munin/source/conf.ts

247 lines
4.8 KiB
TypeScript
Raw Normal View History

2025-04-25 12:50:13 +02:00
/*
This file is part of »munin«.
Copyright 2025 'Fenris Wolf' <fenris@folksprak.org>
»munin« is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
»munin« is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with »munin«. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @todo versioning
*/
namespace _munin.conf
2025-04-25 00:48:05 +02:00
{
/**
*/
export type type_conf = {
sources : Array<
(
{
kind : "kalender_digital",
data : {
2025-04-25 12:50:13 +02:00
path : string;
2025-04-25 00:48:05 +02:00
filtration : {
category_blacklist : Array<string>;
title_blacklist : Array<string>;
};
};
}
)
>;
targets : Array<
2025-04-25 12:50:13 +02:00
(
{
kind : "telegram_bot",
data : {
bot_token : string;
chat_id : int;
/**
* in hours
*/
interval : Array<int>;
}
}
)
2025-04-25 00:48:05 +02:00
>;
2025-04-25 12:50:13 +02:00
/**
* in hours
*/
frequency : float;
labels : {
head : string;
title : string;
time : string;
location : string;
};
2025-04-25 00:48:05 +02:00
};
/**
*/
export const schema : lib_plankton.conf.type_schema = {
"nullable": false,
"type": "object",
"properties": {
"version": {
"nullable": false,
"type": "string",
},
"sources": {
"nullable": false,
"type": "array",
"items": {
"nullable": false,
"anyOf": [
{
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["kalender_digital"]
},
"data": {
"nullable": false,
"type": "object",
"properties": {
2025-04-25 12:50:13 +02:00
"path": {
2025-04-25 00:48:05 +02:00
"nullable": false,
"type": "string"
},
"filtration": {
"nullable": false,
"type": "object",
"properties": {
"category_blacklist": {
"nullable": false,
"type": "array",
"items": {
"nullable": false,
"type": "string",
2025-04-25 12:50:13 +02:00
},
"default": [],
2025-04-25 00:48:05 +02:00
},
"title_blacklist": {
"nullable": false,
"type": "array",
"items": {
"nullable": false,
"type": "string",
2025-04-25 12:50:13 +02:00
},
"default": [],
2025-04-25 00:48:05 +02:00
},
},
"additionalProperties": false,
"required": [
2025-04-25 12:50:13 +02:00
],
"default": {}
2025-04-25 00:48:05 +02:00
},
},
"additionalProperties": false,
"required": [
"id",
]
}
},
"additionalProperties": false,
"required": [
"kind",
"data",
]
}
]
}
},
"targets": {
"nullable": false,
"type": "array",
"items": {
"nullable": false,
2025-04-25 12:50:13 +02:00
"anyOf": [
{
2025-04-25 00:48:05 +02:00
"nullable": false,
2025-04-25 12:50:13 +02:00
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["telegram_bot"]
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"bot_token": {
"nullable": false,
"type": "string",
},
"chat_id": {
"nullable": false,
"type": "integer",
},
"interval": {
"nullable": false,
"type": "array",
"items": {
"nullable": false,
"type": "integer"
},
"default": [24.0],
},
},
"additionalProperties": false,
"required": [
"bot_token",
"chat_id",
]
}
},
"additionalProperties": false,
"required": [
"kind",
"data",
]
}
],
2025-04-25 00:48:05 +02:00
}
},
2025-04-25 12:50:13 +02:00
"frequency": {
"nullable": false,
"type": "number",
"default": 1.0,
},
"labels": {
"nullable": false,
"type": "object",
"properties": {
"head": {
"nullable": false,
"type": "string",
"default": "Termin-Erinnerung"
},
"title": {
"nullable": false,
"type": "string",
"default": "was"
},
"time": {
"nullable": false,
"type": "string",
"default": "wann"
},
"location": {
"nullable": false,
"type": "string",
"default": "wo"
},
},
"additionalProperties": false,
"required": [
],
"default": {}
},
2025-04-25 00:48:05 +02:00
},
"additionalProperties": false,
"required": [
"version",
2025-04-25 12:50:13 +02:00
"sources",
"targets",
2025-04-25 00:48:05 +02:00
],
};
}