UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

53 lines 1.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MUTE_SPEECH_INPUT = void 0; /** Custom Modules */ const createNodeDescriptor_1 = require("../../../createNodeDescriptor"); /** Helper Modules */ const design_1 = require("../utils/design"); const muteSpeechInput_mapper_1 = require("../mappers/muteSpeechInput.mapper"); const mapper = new muteSpeechInput_mapper_1.MuteSpeechInputMapper(); exports.MUTE_SPEECH_INPUT = (0, createNodeDescriptor_1.createNodeDescriptor)({ type: "muteSpeechInput", defaultLabel: "Mute Speech Input", tags: [''], summary: "UI__NODE_EDITOR__MUTE_SPEECH_INPUT__SUMMARY", preview: { key: "muteSpeechInput", type: "text" }, appearance: { color: design_1.nodeColor }, fields: [ { key: "muteSpeechInput", label: "UI__NODE_EDITOR__MUTE_SPEECH_INPUT__FIELDS__MUTE_SPEECH_INPUT__LABEL", description: "UI__NODE_EDITOR__MUTE_SPEECH_INPUT__FIELDS__MUTE_SPEECH_INPUT__DESCRIPTION", type: "toggle", params: { required: true }, defaultValue: false }, ], form: [ { type: "field", key: "muteSpeechInput" }, ], function: async ({ cognigy, config }) => { const { api, input } = cognigy; const { endpointType } = input; try { mapper.endpointType = endpointType; const payload = mapper.handleInput(config, api); await api.say(null, { _cognigy: payload }); api.logDebugMessage(`UI__DEBUG_MODE__MUTE_SPEECH__MESSAGE ${config.muteSpeechInput}`); } catch (error) { throw new Error(`Error in muteSpeechInput node. Error message: ${error.message}`); } } }); //# sourceMappingURL=muteSpeechInput.js.map