@cognigy/rest-api-client
Version:
Cognigy REST-Client
87 lines • 3.41 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sentenceSchema = exports.sentenceDataSchema = void 0;
const IEntityMeta_1 = require("../IEntityMeta");
const anySlotDataSchema = {
title: "anySlotDataSchema",
type: "object",
required: ["type", "name", "start", "end"],
additionalProperties: false,
properties: {
name: { type: "string", minLength: 1 },
type: { type: "string", enum: ["anySlot"] },
start: { type: "integer", minimum: 0 },
end: { type: "integer", minimum: 0 },
}
};
const anySlotSchema = {
title: "anySlotSchema",
type: "object",
required: ["type", "name", "start", "end"],
additionalProperties: false,
properties: Object.assign({ _id: { type: "string", format: "mongo-id" } }, anySlotDataSchema.properties)
};
const lexiconSlotDataSchema = {
title: "lexiconSlotDataSchema",
type: "object",
additionalProperties: false,
properties: {
type: { type: "string", enum: ["lexiconSlot"] },
lexiconReference: { type: "string", format: "mongo-id" },
slotReference: { type: "string", format: "mongo-id" },
start: { type: "integer", minimum: 0 },
end: { type: "integer", minimum: 0 },
name: { type: "string", minLength: 1 },
},
};
const lexiconSlotSchema = {
title: "lexiconSlotSchema",
type: "object",
additionalProperties: false,
properties: Object.assign({ _id: { type: "string", format: "mongo-id" } }, lexiconSlotDataSchema.properties),
};
const systemSlotDataSchema = {
title: "systemSlotDataSchema",
type: "object",
additionalProperties: false,
properties: {
type: { type: "string", enum: ["systemSlot"] },
dimension: { type: "string", minLength: 1 },
start: { type: "integer", minimum: 0 },
end: { type: "integer", minimum: 0 },
}
};
const systemSlotSchema = {
title: "systemSlotSchema",
type: "object",
additionalProperties: false,
properties: Object.assign({ _id: { type: "string", format: "mongo-id" } }, systemSlotDataSchema.properties)
};
const slotDataSchema = {
title: "slotDataSchema",
// @ts-ignore
oneOf: [lexiconSlotDataSchema, anySlotDataSchema, systemSlotDataSchema],
};
const slotSchema = {
title: "slotSchema",
// @ts-ignore
oneOf: [lexiconSlotSchema, anySlotSchema, systemSlotSchema],
};
exports.sentenceDataSchema = {
title: "sentenceDataSchema",
type: "object",
additionalProperties: false,
properties: {
doc: { type: "string" },
text: { type: "string", minLength: 1 },
slots: { type: "array", items: slotDataSchema },
hasAnySlot: { type: "boolean" },
}
};
exports.sentenceSchema = {
title: "sentenceSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, IEntityMeta_1.entityMetaSchema.properties), exports.sentenceDataSchema.properties), { slots: { type: "array", items: slotSchema }, referenceId: { type: "string", format: "uuid" }, intentReference: { type: "string", format: "mongo-id" }, flowReference: { type: "string", format: "mongo-id" }, localeReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } }),
};
//# sourceMappingURL=ISentence.js.map