@cognigy/rest-api-client
Version:
Cognigy REST-Client
51 lines • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UPDATE_PROFILE = void 0;
/* Custom modules */
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
/**
* Node name: 'updateProfile'
*
* Purpose:
* Adds a value to the contact profile
*/
exports.UPDATE_PROFILE = (0, createNodeDescriptor_1.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"],
mocking: {
defaultMockCode: `
profile.name = "John Doe"
`
},
function: async ({ cognigy, config }) => {
const { key, value } = config;
const { api } = cognigy;
await 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