UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

39 lines 1.34 kB
import { __awaiter } from "tslib"; /* Custom modules */ import { createNodeDescriptor } from "../../createNodeDescriptor"; export const SET_RATING = createNodeDescriptor({ type: "setRating", defaultLabel: "Set Rating", summary: "UI__NODE_EDITOR__SET_RATING__SUMMARY", appearance: { showIcon: false }, fields: [ { key: "rating", type: "cognigyText", label: "UI__NODE_EDITOR__SET_RATING__RATING__LABEL", description: "UI__NODE_EDITOR__SET_RATING__RATING__DESCRIPTION" }, { key: "ratingComment", type: "cognigyText", label: "UI__NODE_EDITOR__SET_RATING__RATING_COMMENT__LABEL", }, ], form: [ { type: "field", key: "rating" }, { type: "field", key: "ratingComment" } ], tags: ["analytics", "rating", "success"], function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () { const { api } = cognigy; const { rating, ratingComment } = config; api.setRating({ rating: rating, comment: ratingComment }); api.logDebugMessage(`UI__DEBUG_MODE__SET_RATING__MESSAGE_1 ${rating}<br>UI__DEBUG_MODE__SET_RATING__MESSAGE_2 ${ratingComment}`); }) }); //# sourceMappingURL=setRating.js.map