@cognigy/rest-api-client
Version:
Cognigy REST-Client
49 lines • 1.49 kB
JavaScript
import { __awaiter } from "tslib";
/** Custom Modules */
import { createNodeDescriptor } from "../../../createNodeDescriptor";
/** Helper Modules */
import { nodeColor } from "../utils/design";
import { sendMetadata } from "../mappers/sendMetadata.mapper";
export const SEND_METADATA = createNodeDescriptor({
type: "sendMetadata",
defaultLabel: "Send Metadata",
summary: "UI__NODE_EDITOR__SEND_METADATA__SUMMARY",
tags: [""],
fields: [
{
key: "metadata",
label: "UI__NODE_EDITOR__SEND_METADATA__FIELDS__METADATA__LABEL",
type: "json",
defaultValue: { myParamName: "myParamValue" },
params: {
require: true,
},
description: "UI__NODE_EDITOR__SEND_METADATA__FIELDS__METADATA__DESCRIPTION"
}
],
appearance: {
color: nodeColor,
},
form: [
{
type: "field",
key: "metadata"
}
],
function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () {
const { api, input } = cognigy;
const { endpointType } = input;
if (!config.metadata)
return;
try {
yield api.say(null, {
_cognigy: sendMetadata.handleInput(endpointType, config.metadata)
});
}
catch (error) {
api.log("error", error.message);
}
;
}),
});
//# sourceMappingURL=sendMetadata.js.map