@cognigy/rest-api-client
Version:
Cognigy REST-Client
95 lines • 3.28 kB
JavaScript
/* Interfaces & Types */
import { skillSchema } from "../alexa";
import { entityMetaSchema } from "./IEntityMeta";
import { nluTransformerFunctionSchema } from "./INLUTransformerFunction";
export const dialogFlowPrivateKeySchema = {
title: "dialogFlowPrivateKeySchema",
type: "object",
additionalProperties: false,
properties: {
auth_provider_x509_cert_url: { type: "string" },
auth_uri: { type: "string" },
client_email: { type: "string" },
client_id: { type: "string" },
client_x509_cert_url: { type: "string" },
private_key: { type: "string" },
private_key_id: { type: "string" },
project_id: { type: "string" },
token_uri: { type: "string" },
type: { type: "string" },
},
};
const dialogFlowSettingsSchema = {
title: "dialogFlowSettingsSchema",
type: "object",
additionalProperties: false,
properties: {
accessToken: { type: "string" },
dialogflowApiVersion: { type: "integer", enum: [1, 2] },
dialogflowProjectId: { type: "string" },
privateKey: { type: "string", maxLength: 8192 },
},
};
export const luisSettingsSchema = {
title: "luisSettingsSchema",
type: "object",
additionalProperties: false,
properties: {
authenticationURL: { type: "string" },
},
};
export const watsonSettingsSchema = {
title: "watsonSettingsSchema",
type: "object",
additionalProperties: false,
properties: {
apikey: { type: "string" },
serviceURL: { type: "string" },
workspaceId: { type: "string" },
},
};
export const lexSettingsSchema = {
title: "lexSettingsSchema",
type: "object",
additionalProperties: false,
properties: {
accessKeyId: { type: "string" },
secretAccessKey: { type: "string" },
awsRegion: { type: "string" },
botId: { type: "string" },
botAliasId: { type: "string" },
reparseSlots: { type: "boolean" }
},
};
export const alexaSettingsSchema = {
title: "alexaSettingsSchema",
type: "object",
additionalProperties: false,
properties: {
invocationName: { type: "string" },
reparseAlexaSlots: { type: "boolean" },
skill: skillSchema,
},
};
export const nluConnectorDataSchema = {
title: "nluConnectorDataSchema",
type: "object",
additionalProperties: false,
properties: {
type: { type: "string", format: "nlu-connector-type" },
name: { type: "string", format: "resource-name" },
settings: {
// @ts-ignore
anyOf: [alexaSettingsSchema, dialogFlowSettingsSchema, luisSettingsSchema, watsonSettingsSchema, lexSettingsSchema]
},
// @ts-ignore
transformer: nluTransformerFunctionSchema,
},
};
export const nluConnectorSchema = {
title: "nluConnectorSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), nluConnectorDataSchema.properties), { projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } }),
};
//# sourceMappingURL=INLUConnector.js.map