@cognigy/rest-api-client
Version:
Cognigy REST-Client
451 lines • 14.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nodeDescriptorSetSchema = exports.nodeDescriptorSchema = exports.nodeFieldAndSectionFormElementSchema = exports.nodeSectionSchema = exports.nodeFieldSchema = exports.nodeOptionsResolverSchema = exports.nodeFieldConditionSchema = exports.nodeFieldORConditionSchema = exports.nodeFieldANDConditionSchema = exports.nodeFieldSingleConditionSchema = exports.searchableNodeFieldTypes = exports.nodeFieldTypes = exports.nodePreviewTypes = void 0;
const TResourceType_1 = require("./TResourceType");
const ISnippet_1 = require("./ISnippet");
const nodeAppearanceSchema = {
title: "nodeAppearanceSchema",
type: "object",
additionalProperties: false,
properties: {
color: { type: "string", format: "color" },
textColor: { type: "string", format: "color" },
contrastTextColor: { type: "string", format: "color" },
showIcon: { type: "boolean" },
variant: { type: "string", enum: ["regular", "mini", "hexagon"] },
},
};
const nodeBehaviorSchema = {
title: "nodeBehaviorSchema",
type: "object",
additionalProperties: false,
properties: {
stopping: { type: "boolean" },
entrypoint: { type: "boolean" },
},
};
exports.nodePreviewTypes = [
"text",
"sayNode",
"custom",
"resource",
"image",
"aiAgent"
];
const nodePreviewSchema = {
title: "nodePreviewSchema",
type: "object",
additionalProperties: false,
properties: {
key: { type: "string", minLength: 1, maxLength: 200 },
type: { type: "string", enum: [...exports.nodePreviewTypes] },
},
};
const nodeConstraintSchema = {
title: "nodeConstraintSchema",
type: "object",
additionalProperties: false,
properties: {
blacklist: {
type: "array",
items: { type: "string", minLength: 1, maxLength: 200 },
},
whitelist: {
type: "array",
items: { type: "string", minLength: 1, maxLength: 200 },
},
},
};
const nodeConstraintsSchema = {
title: "nodeConstraintsSchema",
type: "object",
additionalProperties: false,
properties: {
collapsable: { type: "boolean" },
childFlowCreatable: { type: "boolean" },
creatable: { type: "boolean" },
deletable: { type: "boolean" },
editable: { type: "boolean" },
movable: { type: "boolean" },
placement: {
type: "object",
additionalProperties: false,
properties: {
children: nodeConstraintSchema,
predecessor: nodeConstraintSchema,
successor: nodeConstraintSchema,
},
},
},
};
const nodeDependenciesSchema = {
title: "nodeDependenciesSchema",
type: "object",
additionalProperties: false,
properties: {
children: {
type: "array",
items: { type: "string", minLength: 1, maxLength: 200 },
},
},
};
exports.nodeFieldTypes = [
"adaptivecard",
"agentAssistConfig",
"aiAgentSelect",
"appTemplate",
"backgroundSelector",
"caseNode",
"checkbox",
"checkAgentAvailabilityProvider",
"checkAgentAvailabilityConfig",
"chipInput",
"code",
"cognigyLLMText",
"cognigyText",
"cognigyTextArray",
"condition",
"connection",
"date",
"daterange",
"datetime",
"description",
"flow",
"flowNode",
"function",
"goalAndStepsSelect",
"handoverProvider",
"handoverProviderConfig",
"json",
"keyValuePairs",
"knowledgeSourceTags",
"knowledgeStore",
"knowledgeStoreSelect",
"lexicon",
"llmSelect",
"localeField",
"node",
"number",
"profileSchemaField",
"rule",
"say",
"select",
"slider",
"slotFillerArray",
"state",
"sttLanguageAzureSelect",
"sttLanguageGoogleSelect",
"sttSelect",
"sttTierModelSelect",
"switchNode",
"text",
"textArray",
"time",
"toggle",
"toolParameters",
"ttsSelect",
"typescript",
"xml"
];
exports.searchableNodeFieldTypes = [
"text",
"json",
"typescript",
"xml",
"textArray",
"cognigyText",
"say",
"code",
"caseNode",
"select",
];
exports.nodeFieldSingleConditionSchema = {
title: "nodeFieldSingleConditionSchema",
type: "object",
additionalProperties: false,
required: ["key", "value"],
properties: {
key: { type: "string", minLength: 1, maxLength: 200 },
value: {
oneOf: [
{ type: "null" },
{ type: "string" },
{ type: "array", items: { type: "string" } },
{ type: "number" },
{ type: "array", items: { type: "number" } },
{ type: "boolean" },
{ type: "array", items: { type: "boolean" } },
],
},
negate: { type: "boolean" },
},
};
exports.nodeFieldANDConditionSchema = {
title: "nodeFieldANDConditionSchema",
type: "object",
additionalProperties: false,
required: ["and"],
properties: {
and: { type: "array", items: { $ref: "nodeFieldConditionSchema" } },
},
};
exports.nodeFieldORConditionSchema = {
title: "nodeFieldORConditionSchema",
type: "object",
additionalProperties: false,
required: ["or"],
properties: {
or: { type: "array", items: { $ref: "nodeFieldConditionSchema" } },
},
};
// @ts-ignore
exports.nodeFieldConditionSchema = {
title: "nodeFieldConditionSchema",
$id: "nodeFieldConditionSchema",
// @ts-ignore
oneOf: [
// @ts-ignore
exports.nodeFieldSingleConditionSchema,
// @ts-ignore
exports.nodeFieldANDConditionSchema,
// @ts-ignore
exports.nodeFieldORConditionSchema,
],
};
exports.nodeOptionsResolverSchema = {
title: "nodeOptionsResolverSchema",
type: "object",
additionalProperties: false,
properties: {
dependencies: {
type: "array",
items: { type: "string", minLength: 1, maxLength: 200 },
},
resolverFunction: {},
},
};
exports.nodeFieldSchema = {
title: "nodeFieldSchema",
type: "object",
additionalProperties: false,
properties: {
type: { type: "string", enum: [...exports.nodeFieldTypes] },
key: { type: "string", minLength: 1, maxLength: 200 },
label: {
oneOf: [
{ type: "string", minLength: 1, maxLength: 200 },
{
type: "object",
additionalProperties: false,
properties: {
default: { type: "string", maxLength: 200 },
enUS: { type: "string", maxLength: 200 },
deDE: { type: "string", maxLength: 200 },
jaJP: { type: "string", maxLength: 200 },
esES: { type: "string", maxLength: 200 },
koKR: { type: "string", maxLength: 200 },
},
},
],
},
condition: exports.nodeFieldConditionSchema,
defaultValue: {
oneOf: [
{ type: "array" },
{ type: "boolean" },
{ type: "number" },
{ type: "null" },
{ type: "object" },
{ type: "string" },
],
},
description: {
oneOf: [
{ type: "string", minLength: 1, maxLength: 200 },
{
type: "object",
additionalProperties: false,
properties: {
default: { type: "string", maxLength: 200 },
enUS: { type: "string", maxLength: 200 },
deDE: { type: "string", maxLength: 200 },
jaJP: { type: "string", maxLength: 200 },
esES: { type: "string", maxLength: 200 },
koKR: { type: "string", maxLength: 200 },
},
},
],
},
params: { type: "object" },
optionsResolver: exports.nodeOptionsResolverSchema,
resetOption: {
type: "object",
additionalProperties: false,
properties: {
lookupValue: { type: "string" },
fieldsToReset: {
type: "array",
items: { type: "string" },
},
},
},
},
};
exports.nodeSectionSchema = {
title: "nodeSectionSchema",
type: "object",
additionalProperties: false,
properties: {
key: { type: "string", minLength: 1, maxLength: 200 },
label: {
oneOf: [
{ type: "string", minLength: 1, maxLength: 200 },
{
type: "object",
additionalProperties: false,
properties: {
default: { type: "string", maxLength: 200 },
enUS: { type: "string", maxLength: 200 },
deDE: { type: "string", maxLength: 200 },
jaJP: { type: "string", maxLength: 200 },
esES: { type: "string", maxLength: 200 },
koKR: { type: "string", maxLength: 200 },
},
},
],
},
description: {
oneOf: [
{ type: "string", minLength: 1, maxLength: 200 },
{
type: "object",
additionalProperties: false,
properties: {
default: { type: "string", maxLength: 200 },
enUS: { type: "string", maxLength: 200 },
deDE: { type: "string", maxLength: 200 },
jaJP: { type: "string", maxLength: 200 },
esES: { type: "string", maxLength: 200 },
koKR: { type: "string", maxLength: 200 },
},
},
],
},
condition: exports.nodeFieldConditionSchema,
defaultCollapsed: { type: "boolean" },
fields: {
type: "array",
maxItems: 35,
additionalItems: false,
uniqueItems: true,
items: {
type: "string",
minLength: 1,
maxLength: 200,
},
},
},
};
exports.nodeFieldAndSectionFormElementSchema = {
title: "nodeFieldAndSectionFormElementSchema",
additionalProperties: false,
required: ["key", "type"],
properties: {
key: { type: "string", minLength: 1, maxLength: 200 },
type: { type: "string", enum: ["field", "section"] },
},
};
exports.nodeDescriptorSchema = {
title: "nodeDescriptorSchema",
type: "object",
additionalProperties: false,
properties: {
_id: { type: "string", format: "mongo-id" },
type: { type: "string", minLength: 1, maxLength: 200 },
parentType: { type: ["string", "null"], minLength: 1, maxLength: 200 },
defaultLabel: {
oneOf: [
{ type: "string", minLength: 1, maxLength: 200 },
{
type: "object",
additionalProperties: false,
properties: {
default: { type: "string", maxLength: 200 },
enUS: { type: "string", maxLength: 200 },
deDE: { type: "string", maxLength: 200 },
jaJP: { type: "string", maxLength: 200 },
esES: { type: "string", maxLength: 200 },
koKR: { type: "string", maxLength: 200 },
},
},
],
},
summary: {
oneOf: [
{ type: "string", maxLength: 200 },
{
type: "object",
additionalProperties: false,
properties: {
default: { type: "string", maxLength: 200 },
enUS: { type: "string", maxLength: 200 },
deDE: { type: "string", maxLength: 200 },
jaJP: { type: "string", maxLength: 200 },
esES: { type: "string", maxLength: 200 },
koKR: { type: "string", maxLength: 200 },
},
},
],
},
appearance: nodeAppearanceSchema,
behavior: nodeBehaviorSchema,
constraints: nodeConstraintsSchema,
dependencies: nodeDependenciesSchema,
fields: { type: "array", items: exports.nodeFieldSchema },
function: {},
preview: nodePreviewSchema,
tags: {
type: "array",
items: { type: "string" },
uniqueItems: true,
minItems: 0,
},
tokens: {
type: "array",
items: ISnippet_1.snippetDataSchema,
uniqueItems: true,
},
sections: {
type: "array",
additionalItems: false,
items: exports.nodeSectionSchema,
},
form: {
type: "array",
additionalItems: false,
maxLength: 25,
items: exports.nodeFieldAndSectionFormElementSchema,
},
},
};
exports.nodeDescriptorSetSchema = {
title: "nodeDescriptorSetSchema",
type: "object",
additionalProperties: false,
properties: {
_id: { type: "string", format: "mongo-id" },
isCognigy: { type: "boolean" },
extension: { type: "string", format: "package-name" },
imageUrlToken: { type: "string", format: "alphanum-64" },
projectReference: { type: "string", format: "mongo-id" },
organisationReference: { type: "string", format: "mongo-id" },
descriptors: {
type: "array",
additionalItems: false,
items: exports.nodeDescriptorSchema,
},
resourceType: { type: "string", enum: TResourceType_1.chartableResourceTypes },
trustedCode: { type: "boolean" },
},
};
//# sourceMappingURL=INodeDescriptorSet.js.map