@cognigy/rest-api-client
Version:
Cognigy REST-Client
63 lines • 3.38 kB
JavaScript
/* Custom Modules */
import { createQuerySchema } from "../../helper/createQuerySchema";
import { entityMetaSchema } from "./IEntityMeta";
import { trainGroupFeedbackReportDataSchema } from "./intent/ITrainGroupFeedbackReport";
export const localizedFlowDataSchema = {
title: "localizedFlowDataSchema",
type: "object",
additionalProperties: false,
properties: {
attachedLexiconReferences: {
type: "array",
items: { format: "mongo-id" },
},
localeReference: { format: "mongo-id" },
}
};
export const flowInDBSchema = {
title: "flowInDBSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign({}, entityMetaSchema.properties), { attachedFlows: { type: "array", additionalItems: { type: "string", format: "mongo-id" } }, localizedData: { type: "array", items: localizedFlowDataSchema }, context: {}, img: { type: "string" }, name: { type: "string", format: "resource-name" }, description: { type: "string", format: "resource-description" }, chartReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } }),
};
export const flowDataSchema = {
title: "flowDataSchema",
type: "object",
additionalProperties: false,
properties: {
attachedFlows: { type: "array", additionalItems: { type: "string", format: "mongo-id" } },
attachedLexicons: { type: "array", additionalItems: { type: "string", format: "mongo-id" } },
context: {
type: "object",
additionalProperties: false,
patternProperties: {
'^[^.]+$': {
type: ['object', 'string', 'number', 'boolean', 'array'],
additionalProperties: false,
patternProperties: {
'^[^.]+$': {} // Specify the desired schema for the innermost properties
}
}
}
},
img: { type: "string" },
name: { type: "string", format: "resource-name" },
description: { type: "string", format: "resource-description" },
},
};
export const flowSchema = {
title: "flowSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), flowDataSchema.properties), { feedbackReport: trainGroupFeedbackReportDataSchema, isTrainingOutOfDate: { type: "boolean" }, lastTrainedAt: { type: "number" }, localeReference: { format: "mongo-id" }, chartReference: { type: "string", format: "mongo-id" }, intentTrainGroupReference: { type: "string", format: "mongo-id" }, intentTrainGroupReferenceId: { type: "string", format: "uuid" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" }, nluOptions: {
type: "object",
additionalProperties: false,
properties: {
intentModelVersion: {
type: "string"
}
}
} }),
};
export const flowQuerySchema = createQuerySchema("flowQuerySchema", flowSchema);
//# sourceMappingURL=IFlow.js.map