317 lines
5.7 KiB
TypeScript
317 lines
5.7 KiB
TypeScript
namespace _mimir.conf
|
|
{
|
|
|
|
/**
|
|
*/
|
|
export const schema : lib_plankton.conf.type_schema = {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"version": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
"target": {
|
|
"anyOf": [
|
|
{
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
"enum": ["local"]
|
|
},
|
|
"parameters": {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"directory": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"directory",
|
|
]
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"kind",
|
|
"parameters",
|
|
]
|
|
},
|
|
{
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
"enum": ["borg"]
|
|
},
|
|
"parameters": {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"repository": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
"compression": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
"enum": [
|
|
"none",
|
|
"lz4",
|
|
"zlib",
|
|
"lzma",
|
|
],
|
|
"default": "lz4"
|
|
},
|
|
},
|
|
"required": [
|
|
"repository",
|
|
]
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"kind",
|
|
"parameters",
|
|
]
|
|
}
|
|
]
|
|
},
|
|
/*
|
|
"defaults": {
|
|
},
|
|
*/
|
|
"concerns": {
|
|
"nullable": false,
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"active": {
|
|
"nullable": false,
|
|
"type": "boolean",
|
|
"default": true
|
|
},
|
|
"name": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
"enum": ["files"]
|
|
},
|
|
"parameters": {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"path": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
"name": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"path",
|
|
"name",
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"kind",
|
|
"parameters",
|
|
]
|
|
},
|
|
{
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"active": {
|
|
"nullable": false,
|
|
"type": "boolean",
|
|
"default": true
|
|
},
|
|
"name": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
"enum": ["postgresql_dump"]
|
|
},
|
|
"parameters": {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"credentials": {
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"host": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
"port": {
|
|
"nullable": false,
|
|
"type": "integer",
|
|
"default": 5432
|
|
},
|
|
"username": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
"password": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
"schema": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"host",
|
|
"username",
|
|
"password",
|
|
"schema",
|
|
]
|
|
},
|
|
"name": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"credentials",
|
|
"name",
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"kind",
|
|
"parameters",
|
|
]
|
|
},
|
|
]
|
|
}
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"version",
|
|
"target",
|
|
"concerns",
|
|
]
|
|
};
|
|
|
|
|
|
/**
|
|
* @todo split from conf
|
|
*/
|
|
export type type_target_parameters_local = {
|
|
directory : string;
|
|
};
|
|
|
|
|
|
/**
|
|
* @todo split from conf
|
|
*/
|
|
export type type_target_parameters_borg = {
|
|
repository : string;
|
|
compression : string;
|
|
};
|
|
|
|
|
|
/**
|
|
* @todo split from conf
|
|
*/
|
|
export type type_concern_parameters_files = {
|
|
name : string;
|
|
path : string;
|
|
};
|
|
|
|
|
|
/**
|
|
* @todo split from conf
|
|
*/
|
|
export type type_target = (
|
|
{
|
|
kind : "local";
|
|
parameters : type_target_parameters_local;
|
|
}
|
|
|
|
|
{
|
|
kind : "borg";
|
|
parameters : type_target_parameters_borg;
|
|
}
|
|
);
|
|
|
|
|
|
/**
|
|
* @todo split from conf
|
|
*/
|
|
export type type_concern_parameters_postgresql_dump = {
|
|
credentials : {
|
|
host : string;
|
|
port : int;
|
|
username : string;
|
|
password : string;
|
|
schema : string;
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
* @todo split from conf
|
|
*/
|
|
export type type_concern = (
|
|
{
|
|
kind : "files";
|
|
parameters : type_concern_parameters_files;
|
|
}
|
|
|
|
|
{
|
|
kind : "postgresql_dump";
|
|
parameters : type_concern_parameters_postgresql_dump;
|
|
}
|
|
);
|
|
|
|
|
|
/**
|
|
*/
|
|
export type type_conf = {
|
|
target : type_target;
|
|
concerns : Array<
|
|
{
|
|
active ?: boolean;
|
|
name : string;
|
|
}
|
|
&
|
|
type_concern
|
|
>;
|
|
};
|
|
|
|
}
|
|
|