@cognigy/rest-api-client
Version:
Cognigy REST-Client
107 lines • 5.46 kB
JavaScript
import { entityMetaSchema } from "../IEntityMeta";
import { intentFeedbackReportDataSchema, intentFeedbackInDBReportSchema } from "./IIntentFeedbackReport";
import { biasTowardsParentOrChildIntentsTypes } from "./IIntentRelation";
export const intentTypes = ["yesNoIntent", "default"];
export const overrideIntentDefaultRepliesAsExamplesTypes = [
"useFlowSettings",
"on",
"off"
];
export const localizedIntentDataSchema = {
title: "localizedIntentDataSchema",
type: "object",
additionalProperties: false,
properties: {
condition: { type: ["string", "null"], maxLength: 2000 },
confirmationSentences: {
type: "array",
maxItems: 10,
items: { type: "string", minLength: 1, maxLength: 300 }
},
rules: {
type: "array",
maxItems: 10,
items: { type: "string", minLength: 1, maxLength: 300 }
},
disambiguationSentence: { type: "string", maxLength: 300 },
localeReference: { format: "mongo-id" }
}
};
export const intentInDBDataSchema = {
title: "intentInDBDataSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign({}, entityMetaSchema.properties), { feedbackReport: intentFeedbackInDBReportSchema, localizedData: { type: "array", items: localizedIntentDataSchema }, enabledLocaleReferences: { type: "array", items: { format: "mongo-id" } }, name: { type: "string", format: "resource-name" }, description: { type: "string", format: "resource-description" }, intentType: { type: "string", enum: [...intentTypes] }, intentRelationReferences: {
type: "array",
items: { type: "string", format: "mongo-id" }
}, tags: {
type: "array",
maxItems: 10,
items: { type: "string", minLength: 1, maxLength: 30 }
}, data: { type: ["object", "null"] }, nodeReferenceId: { type: ["string", "null"], format: "uuid" }, isDisabled: { type: "boolean" }, isRejectIntent: { type: "boolean" }, parentIntentId: { type: ["string", "null"], format: "mongo-id" }, childFeatures: {
oneOf: [
{ type: "boolean" },
{ type: "array", items: { type: "string", format: "mongo-id" } }
]
}, biasTowardsParentOrChildIntents: { type: "string", enum: [...biasTowardsParentOrChildIntentsTypes] }, flowReferenceId: { type: "string", format: "uuid" }, referenceId: { type: "string", format: "uuid" }, flowReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, analyticsLabel: { type: "string", format: "analytics-label" }, overrideIntentDefaultRepliesAsExamples: {
type: ["string", "null"],
enum: [...overrideIntentDefaultRepliesAsExamplesTypes]
} })
};
export const intentDataSchema = {
title: "intentDataSchema",
type: "object",
additionalProperties: false,
properties: {
name: { type: "string", format: "resource-name" },
description: { type: "string", format: "resource-description" },
intentType: { type: "string", enum: [...intentTypes] },
condition: { type: ["string", "null"], maxLength: 2000 },
intentRelationReferences: {
type: "array",
items: { type: "string", format: "mongo-id" }
},
tags: {
type: "array",
maxItems: 10,
items: { type: "string", minLength: 1, maxLength: 30 }
},
confirmationSentences: {
type: "array",
maxItems: 10,
items: { type: "string", minLength: 1, maxLength: 300 }
},
rules: {
type: "array",
maxItems: 10,
items: { type: "string", minLength: 1, maxLength: 300 }
},
disambiguationSentence: { type: "string", maxLength: 300 },
data: { type: ["object", "null"] },
nodeReferenceId: { type: ["string", "null"], format: "uuid" },
isDisabled: { type: "boolean" },
isRejectIntent: { type: "boolean" },
parentIntentId: { type: ["string", "null"], format: "mongo-id" },
childFeatures: {
oneOf: [
{ type: "boolean" },
{ type: "array", items: { type: "string", format: "mongo-id" } }
]
},
biasTowardsParentOrChildIntents: { type: "string", enum: [...biasTowardsParentOrChildIntentsTypes] },
flowReferenceId: { type: "string", format: "uuid" },
feedbackReport: intentFeedbackReportDataSchema,
analyticsLabel: { type: "string", format: "analytics-label" },
overrideIntentDefaultRepliesAsExamples: {
type: ["string", "null"],
enum: [...overrideIntentDefaultRepliesAsExamplesTypes]
}
}
};
export const intentSchema = {
title: "intentSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), intentDataSchema.properties), { referenceId: { type: "string", format: "uuid" }, localeReference: { type: "string", format: "mongo-id" }, flowReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } })
};
//# sourceMappingURL=IIntent.js.map