UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

127 lines 4.33 kB
/* Custom Modules */ import { createQuerySchema } from "../../helper/createQuerySchema"; export const defaultNodeFields = [ "label", "comment", "commentColor", "isDisabled", "isEntryPoint", "preview", "analyticsLabel" ]; export const searchableNodeFields = [ "comment", "label", "type", "_id", "referenceId", "extension", "config", "analyticsLabel" ]; export const nodeInDBSchema = { title: "nodeInDBSchema", type: "object", additionalProperties: false, properties: { _id: { format: "mongo-id" }, localizedData: { type: "array", items: { type: "object", additionalProperties: false, properties: { config: { type: "object" }, localeReference: { format: "mongo-id" }, preview: {} } } }, referenceId: { type: "string", format: "uuid" }, comment: { type: "string", maxLength: 512 }, commentColor: { oneOf: [ { type: "string", format: "color" }, { type: "string", enum: [""] } ] }, label: { type: "string", maxLength: 200 }, isDisabled: { type: "boolean" }, isEntryPoint: { type: "boolean" }, type: { type: "string", minLength: 1, maxLength: 200 }, extension: { type: "string", format: "package-name" }, chartReference: { format: "mongo-id" }, resourceReference: { format: "mongo-id" }, projectReference: { format: "mongo-id" }, organisationReference: { format: "mongo-id" }, analyticsLabel: { format: "analytics-label" } } }; export const nodeDataSchema = { title: "nodeDataSchema", type: "object", additionalProperties: false, properties: { preview: {}, comment: { type: "string", maxLength: 512 }, commentColor: { oneOf: [ { type: "string", format: "color" }, { type: "string", enum: [""] } ] }, label: { type: "string", maxLength: 200 }, analyticsLabel: { type: ["null", "string"], format: "analytics-label" }, isDisabled: { type: "boolean" }, isEntryPoint: { type: "boolean" }, config: { type: "object", additionalProperties: { propertyNames: { type: "string" } } }, localizedData: { type: "array", items: { type: "object", properties: { config: {}, preview: {}, localeReference: { type: "string", format: "mongo-id" } } } } } }; export const updateNodeDataSchema = { title: "nodeDataSchema", type: "object", additionalProperties: false, properties: { preview: {}, comment: { type: "string", maxLength: 512 }, commentColor: { oneOf: [ { type: "string", format: "color" }, { type: "string", enum: [""] } ] }, label: { type: "string", maxLength: 200 }, analyticsLabel: { type: ["null", "string"], format: "analytics-label" }, isDisabled: { type: "boolean" }, isEntryPoint: { type: "boolean" }, config: { type: "object", additionalProperties: { propertyNames: { type: "string" } } } } }; export const nodeSchema = { title: "nodeSchema", type: "object", additionalProperties: false, properties: Object.assign(Object.assign({ _id: { format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } }, nodeDataSchema.properties), { type: { type: "string", minLength: 1, maxLength: 200 }, extension: { type: "string", format: "package-name" }, chartReference: { format: "mongo-id" }, resourceReference: { format: "mongo-id" }, localeReference: { type: "string", format: "mongo-id" }, projectReference: { format: "mongo-id" }, organisationReference: { format: "mongo-id" } }) }; export const nodeQuerySchema = createQuerySchema("nodeQuerySchema", nodeSchema); //# sourceMappingURL=IChartNode.js.map