@cognigy/rest-api-client
Version:
Cognigy REST-Client
80 lines • 3.75 kB
JavaScript
import { entityMetaSchema } from "./IEntityMeta";
import { nodeDescriptorSchema } from "./INodeDescriptorSet";
export const extensionNodePackageDataSchema = {
title: "extensionNodePackageDataSchema",
type: "object",
additionalProperties: false,
properties: {
nodes: { type: "array", items: nodeDescriptorSchema },
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 */
export const EXTENSION_README_SIZE = 1048576;
export const 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: 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 } }, extensionNodePackageDataSchema.properties)
};
export const extensionSchema = {
title: "extensionSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), extensionDataSchema.properties), { subResourceReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } })
};
//# sourceMappingURL=IExtension.js.map