UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

29 lines 931 B
import { __awaiter } from "tslib"; /* Custom modules */ import { createNodeDescriptor } from "../../createNodeDescriptor"; /** * Node name: 'copyDataToContext' * * Purpose: * Takes all data inputs and copies them to the context */ export const COPY_DATA_TO_CONTEXT = createNodeDescriptor({ type: "copyDataToContext", defaultLabel: "Copy Data To Context", summary: "UI__NODE_EDITOR__COPY_DATA_TO_CONTEXT__SUMMARY", appearance: { showIcon: false }, fields: [], tags: ["data"], function: ({ cognigy }) => __awaiter(void 0, void 0, void 0, function* () { const { input, api } = cognigy; let debug = ""; for (const key in input.data) { api.addToContext(key, input.data[key], "simple"); debug += `Copied ${key} to context<br>`; } debug && api.logDebugMessage(`${debug}`); }) }); //# sourceMappingURL=copyDataToContext.js.map