aboutsummaryrefslogtreecommitdiff
path: root/src/server/Session/session_config_schema.ts
blob: 0acb304dbf47583817f6c45945747034ef65ea93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { Schema } from "jsonschema";

const emailPattern = /^(([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+)?$/g;
const localPortPattern = /\/[a-zA-Z]*/g;

const properties: { [name: string]: Schema } = {
    ports: {
        type: "object",
        properties: {
            server: { type: "number" },
            socket: { type: "number" }
        },
        required: ["server"],
        additionalProperties: true
    },
    heartbeatRoute: {
        type: "string",
        pattern: localPortPattern
    },
    email: {
        type: "object",
        properties: {
            recipients: {
                type: "array",
                items: {
                    type: "string",
                    pattern: emailPattern
                },
                minLength: 1
            },
            signature: {
                type: "string",
                minLength: 1
            }
        },
        required: ["recipients"]
    },
    masterIdentifier: {
        type: "string",
        minLength: 1
    },
    workerIdentifier: {
        type: "string",
        minLength: 1
    },
    showServerOutput: { type: "boolean" },
    pollingIntervalSeconds: {
        type: "number",
        minimum: 1,
        maximum: 86400
    }
};

export const configurationSchema: Schema = {
    id: "/configuration",
    type: "object",
    properties,
};