@cognigy/rest-api-client
Version:
Cognigy REST-Client
39 lines • 1.85 kB
JavaScript
/* Interfaces & Types */
import { entityMetaSchema } from "../IEntityMeta";
export const knowledgeSourceStatus = ["ready", "ingesting", "disabled", "failure"];
export const knowledgeSourceType = ["pdf", "txt", "docx", "pptx", "ctxt", "url", "manual", "jpeg", "jpg", "png", "bmp", "heif", "tiff"];
export const knowledgeSourceDataSchema = {
title: "knowledgeSourceDataSchema",
type: "object",
additionalProperties: false,
required: [
"name",
"type"
],
properties: {
name: { type: "string", format: "resource-name" },
description: { type: "string", format: "resource-description" },
type: { type: "string", enum: [...knowledgeSourceType] },
status: { type: "string", enum: [...knowledgeSourceStatus] },
metaData: { type: "object" },
chunkCount: { type: "number" },
data: {
type: "object",
additionalProperties: false,
maxProperties: parseInt(process.env.MAX_SOURCE_METADATA_LIMIT, 10) || 20,
patternProperties: {
"^(?=.{1,200}$)[a-zA-Z][0-9a-zA-Z_$]*$": {
type: ["number", "string", "boolean"],
maxLength: parseInt(process.env.METADATA_VALUE_MAX_LENGTH, 10) || 1000
}
},
}
}
};
export const knowledgeSourceSchema = {
title: "knowledgeSourceSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), knowledgeSourceDataSchema.properties), { referenceId: { type: "string", format: "uuid" }, storeReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } }),
};
//# sourceMappingURL=IKnowledgeSource.js.map