aboutsummaryrefslogtreecommitdiff
path: root/src/server/Session/session_config_schema.ts
blob: a5010055ac5bd3fccae6fef408f78568b02a97db (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
import { Schema } from "jsonschema";

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

const properties = {
    recipients: {
        type: "array",
        items: {
            type: "string",
            pattern: emailPattern
        },
        minLength: 1
    },
    heartbeat: {
        type: "string",
        pattern: localPortPattern
    },
    signature: { type: "string" },
    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,
    required: Object.keys(properties)
};