UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

44 lines 1.31 kB
import { __awaiter } from "tslib"; /* Custom modules */ import { createNodeDescriptor } from "../../createNodeDescriptor"; /** * Node name: 'updateProfile' * * Purpose: * Adds a value to the contact profile */ export const UPDATE_PROFILE = createNodeDescriptor({ type: "updateProfile", defaultLabel: "Update Profile", summary: "UI__NODE_EDITOR__UPDATE_PROFILE__SUMMARY", appearance: { showIcon: false }, fields: [ { key: "key", type: "profileSchemaField", label: "UI__NODE_EDITOR__UPDATE_PROFILE__KEY__LABEL", params: { required: true } }, { key: "value", type: "cognigyText", label: "UI__NODE_EDITOR__UPDATE_PROFILE__VALUE__LABEL" }, ], preview: { key: "key", type: "text" }, tags: ["analytics", "profile"], function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () { const { key, value } = config; const { api } = cognigy; yield api.updateProfile(key, value); api.logDebugMessage(`UI__DEBUG_MODE__UPDATE_PROFILE__MESSAGE '${key}' UI__DEBUG_MODE__UPDATE_PROFILE__MESSAGE_2 '${value}'`); }) }); //# sourceMappingURL=updateProfile.js.map