@cognigy/rest-api-client
Version:
Cognigy REST-Client
143 lines • 4.15 kB
JavaScript
import { entityMetaSchema } from "./IEntityMeta";
export const playbookStepSchema = {
title: "playbookStepSchema",
type: "object",
additionalProperties: false,
properties: {
_id: { format: "mongo-id" },
text: { type: "string" },
data: { type: "object" },
asserts: { type: "array" }
}
};
export const assertTypes = [
"assertText",
"assertData",
"assertState",
"assertContext",
"assertIntent",
"assertSlot"
];
export const arrayTChartableResourceType = ["flow"];
export const assertTextSchema = {
title: "assertTextSchema",
type: "object",
properties: {
_id: { type: "string", format: "mongo-id" },
params: {
type: "object",
properties: {
fuzzy: { type: "boolean" },
negate: { type: "boolean" },
text: { type: "string" },
}
},
type: { type: "string", enum: ["assertText"] }
}
};
export const assertDataSchema = {
title: "assertDataSchema",
type: "object",
properties: {
_id: { type: "string", format: "mongo-id" },
params: {
type: "object",
properties: {
data: { type: "object" },
negate: { type: "boolean" },
partial: { type: "boolean" },
}
},
type: { type: "string", enum: ["assertData"] }
}
};
export const assertStateSchema = {
title: "assertStateSchema",
type: "object",
properties: {
_id: { type: "string", format: "mongo-id" },
params: {
type: "object",
properties: {
negate: { type: "boolean" },
state: { type: "string" },
}
},
type: { type: "string", enum: ["assertState"] }
}
};
export const assertContextSchema = {
title: "assertContextSchema",
type: "object",
properties: {
_id: { type: "string", format: "mongo-id" },
params: {
type: "object",
properties: {
data: { type: "object" },
negate: { type: "boolean" },
partial: { type: "boolean" },
}
},
type: { type: "string", enum: ["assertContext"] }
}
};
export const assertIntentSchema = {
title: "assertIntentSchema",
type: "object",
properties: {
_id: { type: "string", format: "mongo-id" },
params: {
type: "object",
properties: {
intent: { type: "string" },
negate: { type: "boolean" },
}
},
type: { type: "string", enum: ["assertIntent"] }
}
};
export const assertSlotSchema = {
title: "assertSlotSchema",
type: "object",
properties: {
_id: { type: "string", format: "mongo-id" },
params: {
type: "object",
properties: {
negate: { type: "boolean" },
slot: { type: "string" },
}
},
type: { type: "string", enum: ["assertSlot"] }
}
};
export const playbookStepAssertSchema = {
title: "playbookStepAssertSchema",
anyOf: [
assertContextSchema,
assertDataSchema,
assertIntentSchema,
assertSlotSchema,
assertStateSchema,
assertTextSchema
]
};
export const playbookDataSchema = {
title: "playbookDataSchema",
type: "object",
additionalProperties: false,
properties: {
abortOnError: { type: "boolean" },
name: { type: "string", format: "resource-name" },
steps: { type: "array", items: playbookStepSchema },
timeout: { type: "integer", minimum: 1 },
}
};
export const playbookSchema = {
title: "playbookSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, playbookDataSchema.properties), entityMetaSchema.properties), { projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } })
};
//# sourceMappingURL=IPlaybook.js.map