@cognigy/rest-api-client
Version:
Cognigy REST-Client
97 lines • 4.91 kB
JavaScript
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.extensionSchema = exports.extensionDataSchema = exports.EXTENSION_README_SIZE = exports.extensionNodePackageDataSchema = void 0;
const IEntityMeta_1 = require("./IEntityMeta");
const INodeDescriptorSet_1 = require("./INodeDescriptorSet");
const IKnowledgeDescriptor_1 = require("./IKnowledgeDescriptor");
exports.extensionNodePackageDataSchema = {
title: "extensionNodePackageDataSchema",
type: "object",
additionalProperties: false,
properties: {
// we are not further specifying a schema for "tools" (which are actually tool descriptors)
// as we are using a new code-design in service-resources which validates the properties
// differently.
tools: { type: "array" },
nodes: { type: "array", items: INodeDescriptorSet_1.nodeDescriptorSchema },
knowledge: {
type: "array",
items: IKnowledgeDescriptor_1.knowledgeDescriptorSchema,
maxItems: parseInt((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.EXTENSIONS_KNOWLEDGE_EXTRACTORS_MAX, 10) || 20
},
connections: {
type: "array",
additionalItems: false,
items: {
type: "object",
additionalProperties: false,
required: ["type", "fields"],
properties: {
label: { type: "string", format: "resource-name" },
type: { type: "string", format: "resource-name" },
fields: {
type: "array",
additionalItems: false,
items: {
type: "object",
additionalProperties: false,
required: ["fieldName"],
properties: {
_id: { type: "string", format: "mongo-id" },
fieldName: {
type: "string",
format: "resource-name"
},
label: { type: "string" },
description: { type: "string" },
params: { type: "object" },
required: { type: "boolean", default: true }
}
}
}
}
}
},
appTemplates: {
type: "array",
additionalItems: false,
items: {
type: "object",
additionalProperties: false,
required: ["type", "path"],
properties: {
label: { type: "string", format: "resource-name" },
type: { type: "string", format: "resource-name" },
path: { type: "string" }
}
}
}
}
};
/** 512 KB (1 * 1024 * 1024), Javascript uses 16bit for a single character */
exports.EXTENSION_README_SIZE = 1048576;
exports.extensionDataSchema = {
title: "extensionDataSchema",
type: "object",
additionalProperties: false,
properties: Object.assign({ name: { type: "string", format: "resource-name" }, label: { type: "string", maxLength: 200 }, version: { type: "string", format: "semver" }, imageUrlToken: { type: "string", format: "alphanum-64" }, description: { type: "string", maxLength: 1000 }, readme: { type: "string", maxLength: exports.EXTENSION_README_SIZE }, tags: { type: "array", items: { type: "string", maxLength: 200 } }, author: { type: "string", maxLength: 200 }, extensionType: { type: "string", enum: ["nodes"] }, pathToPackageExecutable: { type: "string", maxLength: 500 }, storage: {
type: "object",
additionalProperties: false,
required: ["layout", "path"],
properties: {
layout: {
type: "string",
enum: ["old_nfs", "new_nfs", "tenant_scoped"]
},
path: { type: "string" }
},
} }, exports.extensionNodePackageDataSchema.properties)
};
exports.extensionSchema = {
title: "extensionSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, IEntityMeta_1.entityMetaSchema.properties), exports.extensionDataSchema.properties), { subResourceReference: { type: "string", format: "mongo-id" }, knowledge: { type: "array", items: IKnowledgeDescriptor_1.knowledgeDescriptorSchema }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } })
};
//# sourceMappingURL=IExtension.js.map