247 lines
4.8 KiB
TypeScript
247 lines
4.8 KiB
TypeScript
/*
|
|
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
|
|
{
|
|
|
|
/**
|
|
*/
|
|
export type type_conf = {
|
|
sources : Array<
|
|
(
|
|
{
|
|
kind : "kalender_digital",
|
|
data : {
|
|
path : string;
|
|
filtration : {
|
|
category_blacklist : Array<string>;
|
|
title_blacklist : Array<string>;
|
|
};
|
|
};
|
|
}
|
|
)
|
|
>;
|
|
targets : Array<
|
|
(
|
|
{
|
|
kind : "telegram_bot",
|
|
data : {
|
|
bot_token : string;
|
|
chat_id : int;
|
|
/**
|
|
* in hours
|
|
*/
|
|
interval : Array<int>;
|
|
}
|
|
}
|
|
)
|
|
>;
|
|
/**
|
|
* in hours
|
|
*/
|
|
frequency : float;
|
|
labels : {
|
|
head : string;
|
|
title : string;
|
|
time : string;
|
|
location : string;
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
*/
|
|
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": {
|
|
"path": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
"filtration": {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"category_blacklist": {
|
|
"nullable": false,
|
|
"type": "array",
|
|
"items": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
"default": [],
|
|
},
|
|
"title_blacklist": {
|
|
"nullable": false,
|
|
"type": "array",
|
|
"items": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
"default": [],
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
],
|
|
"default": {}
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"id",
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"kind",
|
|
"data",
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"targets": {
|
|
"nullable": false,
|
|
"type": "array",
|
|
"items": {
|
|
"nullable": false,
|
|
"anyOf": [
|
|
{
|
|
"nullable": false,
|
|
"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",
|
|
]
|
|
}
|
|
],
|
|
}
|
|
},
|
|
"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": {}
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"version",
|
|
"sources",
|
|
"targets",
|
|
],
|
|
};
|
|
|
|
}
|
|
|