diff options
author | Tyler Schicke <tschicke@gmail.com> | 2020-01-09 21:33:18 -0800 |
---|---|---|
committer | Tyler Schicke <tschicke@gmail.com> | 2020-01-09 21:33:18 -0800 |
commit | 2295ab2500487da6b030d871b8d81724a4ddada3 (patch) | |
tree | cc4bff122cd18066521affb382c0e93cde9b33ce /src/server/Session/session_config_schema.ts | |
parent | 786d25a4f8db1db8795f04a17fba392636e5f891 (diff) | |
parent | a8aa0facfaa23298398c15aa906bc6d69c538564 (diff) |
Merge branch 'master' of github.com:browngraphicslab/Dash-Web into no_db
Diffstat (limited to 'src/server/Session/session_config_schema.ts')
-rw-r--r-- | src/server/Session/session_config_schema.ts | 72 |
1 files changed, 50 insertions, 22 deletions
diff --git a/src/server/Session/session_config_schema.ts b/src/server/Session/session_config_schema.ts index 5a85a45e3..e32cf8c6a 100644 --- a/src/server/Session/session_config_schema.ts +++ b/src/server/Session/session_config_schema.ts @@ -1,39 +1,67 @@ import { Schema } from "jsonschema"; +const colorPattern = /black|red|green|yellow|blue|magenta|cyan|white|gray|grey/; + +const identifierProperties: Schema = { + type: "object", + properties: { + text: { + type: "string", + minLength: 1 + }, + color: { + type: "string", + pattern: colorPattern + } + } +}; + +const portProperties: Schema = { + type: "number", + minimum: 1024, + maximum: 65535 +}; + export const configurationSchema: Schema = { id: "/configuration", type: "object", properties: { + showServerOutput: { type: "boolean" }, ports: { type: "object", properties: { - server: { type: "number", minimum: 1024, maximum: 65535 }, - socket: { type: "number", minimum: 1024, maximum: 65535 } + server: portProperties, + socket: portProperties }, required: ["server"], additionalProperties: true }, - pollingRoute: { - type: "string", - pattern: /\/[a-zA-Z]*/g - }, - masterIdentifier: { - type: "string", - minLength: 1 - }, - workerIdentifier: { - type: "string", - minLength: 1 + identifiers: { + type: "object", + properties: { + master: identifierProperties, + worker: identifierProperties, + exec: identifierProperties + } }, - showServerOutput: { type: "boolean" }, - pollingIntervalSeconds: { - type: "number", - minimum: 1, - maximum: 86400 + polling: { + type: "object", + additionalProperties: false, + properties: { + intervalSeconds: { + type: "number", + minimum: 1, + maximum: 86400 + }, + route: { + type: "string", + pattern: /\/[a-zA-Z]*/g + }, + failureTolerance: { + type: "number", + minimum: 0, + } + } }, - pollingFailureTolerance: { - type: "number", - minimum: 0, - } } };
\ No newline at end of file |