From 8d50b63be5dd754d9260adbf69323f3ac2b8cb08 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Sun, 5 Jan 2020 16:03:59 -0800 Subject: default configuration --- src/server/Session/session_config_schema.ts | 46 ++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'src/server/Session/session_config_schema.ts') diff --git a/src/server/Session/session_config_schema.ts b/src/server/Session/session_config_schema.ts index 34d1ad523..0acb304db 100644 --- a/src/server/Session/session_config_schema.ts +++ b/src/server/Session/session_config_schema.ts @@ -1,17 +1,9 @@ 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 localPortPattern = /\/[a-zA-Z]*/g; const properties: { [name: string]: Schema } = { - recipients: { - type: "array", - items: { - type: "string", - pattern: emailPattern - }, - minLength: 1 - }, ports: { type: "object", properties: { @@ -25,16 +17,42 @@ const properties: { [name: string]: Schema } = { type: "string", pattern: localPortPattern }, - signature: { type: "string" }, - masterIdentifier: { type: "string", minLength: 1 }, - workerIdentifier: { type: "string", minLength: 1 }, + 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 } + pollingIntervalSeconds: { + type: "number", + minimum: 1, + maximum: 86400 + } }; export const configurationSchema: Schema = { id: "/configuration", type: "object", properties, - required: Object.keys(properties) }; \ No newline at end of file -- cgit v1.2.3-70-g09d2