UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

31 lines 996 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.COPY_DATA_TO_CONTEXT = void 0; /* Custom modules */ const createNodeDescriptor_1 = require("../../createNodeDescriptor"); /** * Node name: 'copyDataToContext' * * Purpose: * Takes all data inputs and copies them to the context */ exports.COPY_DATA_TO_CONTEXT = (0, createNodeDescriptor_1.createNodeDescriptor)({ type: "copyDataToContext", defaultLabel: "Copy Data To Context", summary: "UI__NODE_EDITOR__COPY_DATA_TO_CONTEXT__SUMMARY", appearance: { showIcon: false }, fields: [], tags: ["data"], function: async ({ cognigy }) => { 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