UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

38 lines 1.24 kB
import { __awaiter } from "tslib"; /* Custom modules */ import { createNodeDescriptor } from "../../../createNodeDescriptor"; export const ONCE = createNodeDescriptor({ type: "once", defaultLabel: "Once", summary: "UI__NODE_EDITOR__ONCE__SUMMARY", appearance: { color: '#5c6bc0', variant: 'hexagon', textColor: "white", showIcon: false }, behavior: { stopping: false }, fields: [], dependencies: { children: ["onFirstExecution", "afterwards"], }, constraints: { collapsable: true, placement: {}, }, tags: ["logic", "gate"], function: ({ cognigy, nodeId, childConfigs }) => __awaiter(void 0, void 0, void 0, function* () { const { api } = cognigy; const executionAmount = api.getExecutionAmount(nodeId); const onFirstExecutionChild = childConfigs.find(child => child.type === "onFirstExecution"); const onAfterwardsChild = childConfigs.find(child => child.type === "afterwards"); if (executionAmount === 1) { api.setNextNode(onFirstExecutionChild.id); return; } api.setNextNode(onAfterwardsChild.id); }) }); //# sourceMappingURL=once.js.map