@notmrabhi/flowforge 0.1.42 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SchemaBuilderDrawer-CUzYWGCN.js → SchemaBuilderDrawer-DlmInnSC.js} +33 -33
- package/dist/{SchemaBuilderDrawer-CUzYWGCN.js.map → SchemaBuilderDrawer-DlmInnSC.js.map} +1 -1
- package/dist/{SchemaBuilderDrawer-CiSdfXzJ.js → SchemaBuilderDrawer-KUOXc7K_.js} +2 -2
- package/dist/{SchemaBuilderDrawer-CiSdfXzJ.js.map → SchemaBuilderDrawer-KUOXc7K_.js.map} +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +131 -1
- package/dist/canvas.js +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +39 -0
- package/dist/core.js +22 -23
- package/dist/core.js.map +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +121 -0
- package/dist/form.js +36 -33
- package/dist/{index-B8-KKaH_.js → index-AISQhG1t.js} +2 -2
- package/dist/{index-B8-KKaH_.js.map → index-AISQhG1t.js.map} +1 -1
- package/dist/index-BDDJrQn0.js +10 -0
- package/dist/index-BDDJrQn0.js.map +1 -0
- package/dist/{index-Buv1ylwP.js → index-CBJiDDQc.js} +2 -2
- package/dist/{index-Buv1ylwP.js.map → index-CBJiDDQc.js.map} +1 -1
- package/dist/{index-DjKhaaWf.js → index-CbdFoSw3.js} +2 -2
- package/dist/{index-DjKhaaWf.js.map → index-CbdFoSw3.js.map} +1 -1
- package/dist/{index-CiU9_8f1.js → index-DU-niBi3.js} +2 -2
- package/dist/{index-CiU9_8f1.js.map → index-DU-niBi3.js.map} +1 -1
- package/dist/{index-B74jTc2b.js → index-y_v8Qog1.js} +3124 -3005
- package/dist/index-y_v8Qog1.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +143 -1
- package/dist/index.js +81 -79
- package/dist/index.js.map +1 -1
- package/dist/nodeRegistry.cjs +1 -1
- package/dist/nodeRegistry.cjs.map +1 -1
- package/dist/nodeRegistry.d.ts +39 -0
- package/dist/nodeRegistry.js +543 -23
- package/dist/nodeRegistry.js.map +1 -1
- package/dist/{templateSkeletons-CFMb6KIK.js → templateSkeletons-CHrd4Z5h.js} +375 -373
- package/dist/templateSkeletons-CHrd4Z5h.js.map +1 -0
- package/dist/templateSkeletons-CtknKiGO.js +2 -0
- package/dist/templateSkeletons-CtknKiGO.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-B6xrei80.js +0 -87
- package/dist/index-B6xrei80.js.map +0 -1
- package/dist/index-B74jTc2b.js.map +0 -1
- package/dist/index-BrJBVztu.js +0 -2
- package/dist/index-BrJBVztu.js.map +0 -1
- package/dist/index-CXmgrKoe.js +0 -2
- package/dist/index-CXmgrKoe.js.map +0 -1
- package/dist/index-CqMPyOkL.js +0 -10
- package/dist/index-CqMPyOkL.js.map +0 -1
- package/dist/index-Dcur-XJ9.js +0 -36
- package/dist/index-Dcur-XJ9.js.map +0 -1
- package/dist/subWorkflowDescriptor-DYOYgBzX.js +0 -535
- package/dist/subWorkflowDescriptor-DYOYgBzX.js.map +0 -1
- package/dist/subWorkflowDescriptor-JDKi2INh.js +0 -2
- package/dist/subWorkflowDescriptor-JDKi2INh.js.map +0 -1
- package/dist/templateSkeletons-CFMb6KIK.js.map +0 -1
- package/dist/templateSkeletons-DKBMuT6K.js +0 -2
- package/dist/templateSkeletons-DKBMuT6K.js.map +0 -1
package/dist/nodeRegistry.d.ts
CHANGED
|
@@ -59,6 +59,13 @@ declare interface ConditionFieldDef {
|
|
|
59
59
|
value: string;
|
|
60
60
|
label: string;
|
|
61
61
|
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Declarative dynamic options — same shape as `FieldDescriptor.optionsSource`.
|
|
64
|
+
* `dependsOn` resolves against the OUTER form values (not the condition entry),
|
|
65
|
+
* so a condition column can depend on another top-level field (e.g. attributes
|
|
66
|
+
* scoped by `applicationUuid`).
|
|
67
|
+
*/
|
|
68
|
+
optionsSource?: OptionsSource;
|
|
62
69
|
/** When true, renders a FormulaInput chip editor instead of a plain <input> */
|
|
63
70
|
formula?: boolean;
|
|
64
71
|
}
|
|
@@ -166,6 +173,12 @@ declare interface FieldDescriptor {
|
|
|
166
173
|
onChange?: (value: unknown, ctx: FieldContext & {
|
|
167
174
|
setFieldValue: (name: string, value: unknown) => void;
|
|
168
175
|
}) => void;
|
|
176
|
+
/**
|
|
177
|
+
* Declarative dynamic options. The renderer translates this into a paged,
|
|
178
|
+
* cached, abortable async loader via the host's resolver registry.
|
|
179
|
+
* Mutually compatible with static `options`: static wins if both set.
|
|
180
|
+
*/
|
|
181
|
+
optionsSource?: OptionsSource;
|
|
169
182
|
[key: string]: unknown;
|
|
170
183
|
}
|
|
171
184
|
|
|
@@ -282,6 +295,32 @@ export declare const nodeTypeRegistry: NodeTypeRegistry;
|
|
|
282
295
|
|
|
283
296
|
export declare const notificationDescriptor: NodeDescriptor;
|
|
284
297
|
|
|
298
|
+
declare interface OptionsSource {
|
|
299
|
+
/** Resolver id — must match a key in the host's `optionsResolvers` map. */
|
|
300
|
+
id: string;
|
|
301
|
+
/**
|
|
302
|
+
* Other field values this resolver depends on. Two shapes accepted:
|
|
303
|
+
* - `string[]` — pass through verbatim ({ fieldA: values.fieldA, ... })
|
|
304
|
+
* - `Record<arg, fieldName>` — rename parent values for the resolver
|
|
305
|
+
*
|
|
306
|
+
* When any dep value changes, the cache key for this field invalidates
|
|
307
|
+
* and the resolver re-fires.
|
|
308
|
+
*/
|
|
309
|
+
dependsOn?: string[] | Record<string, string>;
|
|
310
|
+
/**
|
|
311
|
+
* Static params merged into the deps object for every call. Use for
|
|
312
|
+
* "URL template via the generic resolver" style:
|
|
313
|
+
* { id: 'default', params: { url: '/groups', valueKey: 'uuid' } }
|
|
314
|
+
*/
|
|
315
|
+
params?: Record<string, unknown>;
|
|
316
|
+
/**
|
|
317
|
+
* Lookup individual options by value (edit-mode hydration). When set,
|
|
318
|
+
* the field calls this resolver with `{ ids: [...] }` to render labels
|
|
319
|
+
* for already-selected values that aren't in the current page.
|
|
320
|
+
*/
|
|
321
|
+
resolveValueId?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
285
324
|
/** The fields every node MUST provide — there is no sensible default for these. */
|
|
286
325
|
declare type RequiredNodeFields = Pick<NodeDescriptor, 'type' | 'label' | 'matches' | 'reactFlowType'>;
|
|
287
326
|
|
package/dist/nodeRegistry.js
CHANGED
|
@@ -1,36 +1,556 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { MdPlayCircleOutline as s, MdStopCircle as p, MdHttp as c, MdNotifications as u, MdCallSplit as b, MdWebhook as n, MdAccountTree as h } from "react-icons/md";
|
|
3
|
+
import { N as d } from "./canvasTokens-CAD6G24b.js";
|
|
4
|
+
const m = {
|
|
5
|
+
formSchema: [],
|
|
6
|
+
bpmnEntry: (e) => e,
|
|
7
|
+
bpmnExit: (e) => e,
|
|
8
|
+
emitBpmnElements: (e) => [{ id: e, $type: "bpmn:Task" }]
|
|
9
|
+
};
|
|
10
|
+
function r(e) {
|
|
11
|
+
return { ...m, ...e };
|
|
12
|
+
}
|
|
13
|
+
const T = r({
|
|
14
|
+
type: "startEvent",
|
|
15
|
+
label: "Start",
|
|
16
|
+
icon: a.createElement(s, { size: 18, color: "#616161" }),
|
|
17
|
+
matches: (e) => e === "start",
|
|
18
|
+
reactFlowType: "startNode",
|
|
19
|
+
emitBpmnElements: (e) => [{ id: e, $type: "bpmn:StartEvent" }],
|
|
20
|
+
maxPerWorkflow: 1
|
|
21
|
+
}), v = r({
|
|
22
|
+
type: "endEvent",
|
|
23
|
+
label: "End",
|
|
24
|
+
icon: a.createElement(p, { size: 18, color: "#616161" }),
|
|
25
|
+
matches: (e) => e === "end" || e.startsWith("end-"),
|
|
26
|
+
reactFlowType: "endNode",
|
|
27
|
+
emitBpmnElements: (e) => [{ id: e, $type: "bpmn:EndEvent" }]
|
|
28
|
+
}), S = r({
|
|
29
|
+
type: "restApi",
|
|
30
|
+
label: "REST API Call",
|
|
31
|
+
icon: a.createElement(c, { size: 18, color: "#546e7a" }),
|
|
32
|
+
matches: (e) => e.startsWith("restApi-"),
|
|
33
|
+
reactFlowType: "restApiNode",
|
|
34
|
+
formSchema: [
|
|
35
|
+
{
|
|
36
|
+
id: "method",
|
|
37
|
+
type: "select",
|
|
38
|
+
label: "HTTP Method",
|
|
39
|
+
required: !0,
|
|
40
|
+
options: [
|
|
41
|
+
{ label: "GET", value: "GET" },
|
|
42
|
+
{ label: "POST", value: "POST" },
|
|
43
|
+
{ label: "PUT", value: "PUT" },
|
|
44
|
+
{ label: "PATCH", value: "PATCH" },
|
|
45
|
+
{ label: "DELETE", value: "DELETE" }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "url",
|
|
50
|
+
type: "text",
|
|
51
|
+
label: "URL",
|
|
52
|
+
required: !0,
|
|
53
|
+
placeholder: "https://api.example.com/endpoint",
|
|
54
|
+
formulaEnabled: !0
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "headers",
|
|
58
|
+
type: "key-value",
|
|
59
|
+
label: "Request Headers",
|
|
60
|
+
placeholder: "Add headers..."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "queryParams",
|
|
64
|
+
type: "key-value",
|
|
65
|
+
label: "Query Parameters",
|
|
66
|
+
shouldHide: ({ values: e }) => e.method !== "GET" && e.method !== "DELETE"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "body",
|
|
70
|
+
type: "json-editor",
|
|
71
|
+
label: "Request Body (JSON)",
|
|
72
|
+
shouldHide: ({ values: e }) => e.method === "GET" || e.method === "DELETE"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "responseMapping",
|
|
76
|
+
type: "array",
|
|
77
|
+
label: "Map Response Fields to Variables",
|
|
78
|
+
children: [
|
|
79
|
+
{
|
|
80
|
+
id: "jsonPath",
|
|
81
|
+
type: "text",
|
|
82
|
+
label: "JSON Path",
|
|
83
|
+
placeholder: "$.data.userId",
|
|
84
|
+
required: !0
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "variableName",
|
|
88
|
+
type: "text",
|
|
89
|
+
label: "Variable Name",
|
|
90
|
+
placeholder: "userId",
|
|
91
|
+
required: !0
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "timeoutMs",
|
|
97
|
+
type: "number",
|
|
98
|
+
label: "Timeout (ms)",
|
|
99
|
+
placeholder: "5000"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "continueOnError",
|
|
103
|
+
type: "toggle",
|
|
104
|
+
label: "Continue workflow on error"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
bpmnEntry: (e) => `REST API Call: ${e}`,
|
|
108
|
+
bpmnExit: (e) => `End REST API Call: ${e}`,
|
|
109
|
+
emitBpmnElements: (e, t) => {
|
|
110
|
+
const l = t;
|
|
111
|
+
return [{
|
|
112
|
+
id: e,
|
|
113
|
+
$type: "bpmn:ServiceTask",
|
|
114
|
+
name: `${l.method ?? "HTTP"} ${l.url ?? ""}`.trim()
|
|
115
|
+
}];
|
|
116
|
+
}
|
|
117
|
+
}), x = r({
|
|
118
|
+
type: "notification",
|
|
119
|
+
label: "Send Notification",
|
|
120
|
+
icon: a.createElement(u, { size: 18, color: "#7b1fa2" }),
|
|
121
|
+
matches: (e) => e.startsWith("notification-"),
|
|
122
|
+
reactFlowType: "notificationNode",
|
|
123
|
+
formSchema: [
|
|
124
|
+
{
|
|
125
|
+
id: "channel",
|
|
126
|
+
type: "descriptive-select",
|
|
127
|
+
label: "Notification Channel",
|
|
128
|
+
required: !0,
|
|
129
|
+
options: [
|
|
130
|
+
{ value: "email", label: "Email", description: "Send via SMTP or email provider" },
|
|
131
|
+
{ value: "slack", label: "Slack", description: "Post to a Slack channel or DM" },
|
|
132
|
+
{ value: "teams", label: "Microsoft Teams", description: "Post to a Teams channel or chat" },
|
|
133
|
+
{ value: "sms", label: "SMS", description: "Send a text message" },
|
|
134
|
+
{ value: "in-app", label: "In-App", description: "miniOrange notification center" },
|
|
135
|
+
{ value: "webhook", label: "Webhook", description: "POST to an external URL" }
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
// ── Email fields ──────────────────────────────────────────────────────────
|
|
139
|
+
{
|
|
140
|
+
id: "emailTo",
|
|
141
|
+
type: "tags",
|
|
142
|
+
label: "To",
|
|
143
|
+
placeholder: "Add email address...",
|
|
144
|
+
required: !0,
|
|
145
|
+
shouldHide: ({ values: e }) => e.channel !== "email",
|
|
146
|
+
formulaEnabled: !0
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: "emailCc",
|
|
150
|
+
type: "tags",
|
|
151
|
+
label: "CC",
|
|
152
|
+
placeholder: "Add email address...",
|
|
153
|
+
shouldHide: ({ values: e }) => e.channel !== "email"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "emailSubject",
|
|
157
|
+
type: "text",
|
|
158
|
+
label: "Subject",
|
|
159
|
+
required: !0,
|
|
160
|
+
formulaEnabled: !0,
|
|
161
|
+
shouldHide: ({ values: e }) => e.channel !== "email"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "emailBody",
|
|
165
|
+
type: "rich-text",
|
|
166
|
+
label: "Body",
|
|
167
|
+
required: !0,
|
|
168
|
+
shouldHide: ({ values: e }) => e.channel !== "email"
|
|
169
|
+
},
|
|
170
|
+
// ── Slack fields ──────────────────────────────────────────────────────────
|
|
171
|
+
{
|
|
172
|
+
id: "slackChannel",
|
|
173
|
+
type: "text",
|
|
174
|
+
label: "Channel / DM",
|
|
175
|
+
required: !0,
|
|
176
|
+
placeholder: "#general or @username",
|
|
177
|
+
formulaEnabled: !0,
|
|
178
|
+
shouldHide: ({ values: e }) => e.channel !== "slack"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "slackMessage",
|
|
182
|
+
type: "textarea",
|
|
183
|
+
label: "Message",
|
|
184
|
+
required: !0,
|
|
185
|
+
formulaEnabled: !0,
|
|
186
|
+
shouldHide: ({ values: e }) => e.channel !== "slack"
|
|
187
|
+
},
|
|
188
|
+
// ── Teams fields ──────────────────────────────────────────────────────────
|
|
189
|
+
{
|
|
190
|
+
id: "teamsWebhookUrl",
|
|
191
|
+
type: "text",
|
|
192
|
+
label: "Incoming Webhook URL",
|
|
193
|
+
required: !0,
|
|
194
|
+
placeholder: "https://...",
|
|
195
|
+
shouldHide: ({ values: e }) => e.channel !== "teams"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: "teamsMessage",
|
|
199
|
+
type: "textarea",
|
|
200
|
+
label: "Message",
|
|
201
|
+
required: !0,
|
|
202
|
+
formulaEnabled: !0,
|
|
203
|
+
shouldHide: ({ values: e }) => e.channel !== "teams"
|
|
204
|
+
},
|
|
205
|
+
// ── SMS fields ────────────────────────────────────────────────────────────
|
|
206
|
+
{
|
|
207
|
+
id: "smsTo",
|
|
208
|
+
type: "text",
|
|
209
|
+
label: "Phone Number",
|
|
210
|
+
required: !0,
|
|
211
|
+
placeholder: "+1234567890",
|
|
212
|
+
formulaEnabled: !0,
|
|
213
|
+
shouldHide: ({ values: e }) => e.channel !== "sms"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "smsBody",
|
|
217
|
+
type: "textarea",
|
|
218
|
+
label: "Message",
|
|
219
|
+
required: !0,
|
|
220
|
+
formulaEnabled: !0,
|
|
221
|
+
shouldHide: ({ values: e }) => e.channel !== "sms"
|
|
222
|
+
},
|
|
223
|
+
// ── In-App fields ─────────────────────────────────────────────────────────
|
|
224
|
+
{
|
|
225
|
+
id: "inAppRecipient",
|
|
226
|
+
type: "text",
|
|
227
|
+
label: "Recipient (User ID or Username)",
|
|
228
|
+
required: !0,
|
|
229
|
+
formulaEnabled: !0,
|
|
230
|
+
shouldHide: ({ values: e }) => e.channel !== "in-app"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "inAppTitle",
|
|
234
|
+
type: "text",
|
|
235
|
+
label: "Title",
|
|
236
|
+
required: !0,
|
|
237
|
+
formulaEnabled: !0,
|
|
238
|
+
shouldHide: ({ values: e }) => e.channel !== "in-app"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "inAppBody",
|
|
242
|
+
type: "textarea",
|
|
243
|
+
label: "Message",
|
|
244
|
+
required: !0,
|
|
245
|
+
formulaEnabled: !0,
|
|
246
|
+
shouldHide: ({ values: e }) => e.channel !== "in-app"
|
|
247
|
+
},
|
|
248
|
+
// ── Webhook fields ────────────────────────────────────────────────────────
|
|
249
|
+
{
|
|
250
|
+
id: "webhookUrl",
|
|
251
|
+
type: "text",
|
|
252
|
+
label: "Webhook URL",
|
|
253
|
+
required: !0,
|
|
254
|
+
placeholder: "https://...",
|
|
255
|
+
formulaEnabled: !0,
|
|
256
|
+
shouldHide: ({ values: e }) => e.channel !== "webhook"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: "webhookPayload",
|
|
260
|
+
type: "json-editor",
|
|
261
|
+
label: "Payload (JSON)",
|
|
262
|
+
shouldHide: ({ values: e }) => e.channel !== "webhook"
|
|
263
|
+
},
|
|
264
|
+
// ── Shared options ────────────────────────────────────────────────────────
|
|
265
|
+
{
|
|
266
|
+
id: "sendOnFailure",
|
|
267
|
+
type: "toggle",
|
|
268
|
+
label: "Also send notification on workflow failure"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: "deduplicationKey",
|
|
272
|
+
type: "text",
|
|
273
|
+
label: "Deduplication Key",
|
|
274
|
+
placeholder: "Optional — prevents duplicate sends",
|
|
275
|
+
formulaEnabled: !0
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
bpmnEntry: (e) => `Send Notification: ${e}`,
|
|
279
|
+
bpmnExit: (e) => `End Notification: ${e}`,
|
|
280
|
+
emitBpmnElements: (e, t) => [{ id: e, $type: "bpmn:SendTask", name: `Notify via ${t.channel ?? "channel"}` }]
|
|
281
|
+
}), y = [
|
|
282
|
+
{ label: "equals (=)", value: "eq" },
|
|
283
|
+
{ label: "not equals (≠)", value: "neq" },
|
|
284
|
+
{ label: "greater than (>)", value: "gt" },
|
|
285
|
+
{ label: "greater or equal (≥)", value: "gte" },
|
|
286
|
+
{ label: "less than (<)", value: "lt" },
|
|
287
|
+
{ label: "less or equal (≤)", value: "lte" },
|
|
288
|
+
{ label: "contains", value: "contains" },
|
|
289
|
+
{ label: "starts with", value: "startsWith" },
|
|
290
|
+
{ label: "ends with", value: "endsWith" },
|
|
291
|
+
{ label: "is empty", value: "isEmpty" },
|
|
292
|
+
{ label: "is not empty", value: "isNotEmpty" }
|
|
293
|
+
], q = r({
|
|
294
|
+
type: "conditionBranch",
|
|
295
|
+
label: "Condition Branch",
|
|
296
|
+
icon: a.createElement(b, { size: 18, color: "#512da8" }),
|
|
297
|
+
matches: (e) => e.startsWith("conditionBranch-"),
|
|
298
|
+
reactFlowType: "conditionBranchNode",
|
|
299
|
+
/** Initial branch labels — canvas uses these keys to initialise BranchMap on insert.
|
|
300
|
+
* Pre-seeded as Workato-style IF / ELSE IF / ELSE chain. */
|
|
301
|
+
branchLabels: { branch1: "IF · Branch 1", branch2: "ELSE IF · Branch 2", default: "ELSE" },
|
|
302
|
+
formSchema: [
|
|
303
|
+
{
|
|
304
|
+
id: "title",
|
|
305
|
+
type: "text",
|
|
306
|
+
label: "Node Label",
|
|
307
|
+
placeholder: "e.g. Route by User Role"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "branchConfigs",
|
|
311
|
+
type: "array",
|
|
312
|
+
label: "Branches",
|
|
313
|
+
required: !0,
|
|
314
|
+
children: [
|
|
315
|
+
{
|
|
316
|
+
id: "kind",
|
|
317
|
+
type: "select",
|
|
318
|
+
label: "Branch Type",
|
|
319
|
+
required: !0,
|
|
320
|
+
options: [
|
|
321
|
+
{ label: "IF", value: "if" },
|
|
322
|
+
{ label: "ELSE IF", value: "elseif" },
|
|
323
|
+
{ label: "ELSE", value: "else" }
|
|
324
|
+
],
|
|
325
|
+
// Default for new branches is "elseif" so the chain reads correctly when
|
|
326
|
+
// appended between the first IF and the trailing ELSE.
|
|
327
|
+
placeholder: "elseif"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
id: "key",
|
|
331
|
+
type: "text",
|
|
332
|
+
label: "Branch Key",
|
|
333
|
+
required: !0,
|
|
334
|
+
placeholder: "e.g. admin (no spaces)"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: "label",
|
|
338
|
+
type: "text",
|
|
339
|
+
label: "Branch Label",
|
|
340
|
+
required: !0,
|
|
341
|
+
placeholder: "e.g. Admin Users"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "conditions",
|
|
345
|
+
type: "array",
|
|
346
|
+
label: "Conditions",
|
|
347
|
+
// ELSE branches have no condition by definition — hide the array.
|
|
348
|
+
shouldHide: ({ values: e }) => e.kind === "else",
|
|
349
|
+
children: [
|
|
350
|
+
{
|
|
351
|
+
id: "field",
|
|
352
|
+
type: "text",
|
|
353
|
+
label: "Field / Variable",
|
|
354
|
+
required: !0,
|
|
355
|
+
placeholder: "e.g. user.role",
|
|
356
|
+
formulaEnabled: !0
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "operator",
|
|
360
|
+
type: "select",
|
|
361
|
+
label: "Operator",
|
|
362
|
+
required: !0,
|
|
363
|
+
options: y
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: "value",
|
|
367
|
+
type: "text",
|
|
368
|
+
label: "Value",
|
|
369
|
+
placeholder: "e.g. admin",
|
|
370
|
+
formulaEnabled: !0,
|
|
371
|
+
shouldHide: ({ values: e }) => e.operator === "isEmpty" || e.operator === "isNotEmpty"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: "logicalOperator",
|
|
375
|
+
type: "select",
|
|
376
|
+
label: "Combine with next",
|
|
377
|
+
options: [
|
|
378
|
+
{ label: "AND", value: "AND" },
|
|
379
|
+
{ label: "OR", value: "OR" }
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
id: "defaultBranch",
|
|
388
|
+
type: "text",
|
|
389
|
+
label: "Default Branch Key (fallback if no condition matches)",
|
|
390
|
+
placeholder: "e.g. default"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
bpmnEntry: (e) => `Condition Branch: ${e}`,
|
|
394
|
+
bpmnExit: (e) => `End Condition Branch: ${e}`,
|
|
395
|
+
emitBpmnElements: (e, t) => {
|
|
396
|
+
const l = t, o = l.branchConfigs ?? [];
|
|
397
|
+
return [
|
|
398
|
+
{ id: e, $type: "bpmn:ExclusiveGateway", name: l.title ?? "Condition Branch" },
|
|
399
|
+
...o.map((i) => ({
|
|
400
|
+
id: `${e}-${i.key}`,
|
|
401
|
+
$type: "bpmn:SequenceFlow",
|
|
402
|
+
name: i.label
|
|
403
|
+
}))
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
}), N = r({
|
|
407
|
+
type: "webhookTrigger",
|
|
408
|
+
label: "Webhook Trigger",
|
|
409
|
+
icon: a.createElement(n, { size: d, color: "#1565c0" }),
|
|
410
|
+
matches: (e) => e.startsWith("webhookTrigger-"),
|
|
411
|
+
reactFlowType: "webhookTriggerNode",
|
|
412
|
+
formSchema: [
|
|
413
|
+
{
|
|
414
|
+
id: "endpointUrl",
|
|
415
|
+
type: "text",
|
|
416
|
+
label: "Endpoint URL",
|
|
417
|
+
disabled: !0,
|
|
418
|
+
placeholder: "Generated after saving"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
id: "authMethod",
|
|
422
|
+
type: "select",
|
|
423
|
+
label: "Authentication",
|
|
424
|
+
required: !0,
|
|
425
|
+
options: [
|
|
426
|
+
{ label: "None", value: "none" },
|
|
427
|
+
{ label: "API Key", value: "api-key" },
|
|
428
|
+
{ label: "HMAC Signature", value: "hmac" }
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
id: "apiKeyHeader",
|
|
433
|
+
type: "text",
|
|
434
|
+
label: "API Key Header Name",
|
|
435
|
+
placeholder: "e.g. X-API-Key",
|
|
436
|
+
shouldHide: ({ values: e }) => e.authMethod !== "api-key"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
id: "hmacSecret",
|
|
440
|
+
type: "text",
|
|
441
|
+
label: "HMAC Secret",
|
|
442
|
+
placeholder: "Shared secret for signature verification",
|
|
443
|
+
shouldHide: ({ values: e }) => e.authMethod !== "hmac"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
id: "payloadDescription",
|
|
447
|
+
type: "textarea",
|
|
448
|
+
label: "Expected Payload Description",
|
|
449
|
+
placeholder: "Describe the expected JSON payload fields..."
|
|
450
|
+
}
|
|
451
|
+
],
|
|
452
|
+
bpmnEntry: (e) => `Webhook Trigger: ${e}`,
|
|
453
|
+
bpmnExit: (e) => `End Webhook Trigger: ${e}`,
|
|
454
|
+
emitBpmnElements: (e) => [{ id: e, $type: "bpmn:StartEvent", name: "Webhook Trigger" }]
|
|
455
|
+
}), C = {
|
|
456
|
+
triggerKey: "WEBHOOK_TRIGGER",
|
|
457
|
+
label: "Incoming Webhook",
|
|
458
|
+
description: "Start this workflow when an HTTP POST is received at a generated endpoint.",
|
|
459
|
+
triggerCategory: "webhook",
|
|
460
|
+
icon: a.createElement(n, { size: d, color: "#1565c0" })
|
|
461
|
+
};
|
|
462
|
+
function E(e = {}) {
|
|
463
|
+
return r({
|
|
464
|
+
type: "subWorkflow",
|
|
465
|
+
label: "Sub-Workflow",
|
|
466
|
+
icon: a.createElement(h, { size: 18, color: "#00695c" }),
|
|
467
|
+
matches: (t) => t.startsWith("subWorkflow-"),
|
|
468
|
+
reactFlowType: "subWorkflowNode",
|
|
469
|
+
formSchema: [
|
|
470
|
+
{
|
|
471
|
+
id: "workflowId",
|
|
472
|
+
type: "select",
|
|
473
|
+
label: "Workflow to Call",
|
|
474
|
+
required: !0,
|
|
475
|
+
placeholder: "Select a workflow...",
|
|
476
|
+
...e.fetchWorkflowOptions ? { fetchOptions: e.fetchWorkflowOptions } : { options: [] }
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
id: "workflowLabel",
|
|
480
|
+
type: "text",
|
|
481
|
+
label: "Display Name (optional)",
|
|
482
|
+
placeholder: "Override display name shown on canvas"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: "inputMapping",
|
|
486
|
+
type: "key-value",
|
|
487
|
+
label: "Input Mapping",
|
|
488
|
+
placeholder: "Map parent variables → sub-workflow inputs",
|
|
489
|
+
formulaEnabled: !0
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
id: "outputMapping",
|
|
493
|
+
type: "key-value",
|
|
494
|
+
label: "Output Mapping",
|
|
495
|
+
placeholder: "Map sub-workflow outputs → parent variables"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: "waitForCompletion",
|
|
499
|
+
type: "toggle",
|
|
500
|
+
label: "Wait for sub-workflow to complete before continuing"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
id: "continueOnError",
|
|
504
|
+
type: "toggle",
|
|
505
|
+
label: "Continue parent workflow if sub-workflow fails"
|
|
506
|
+
}
|
|
507
|
+
],
|
|
508
|
+
bpmnEntry: (t) => `Sub-Workflow Call: ${t}`,
|
|
509
|
+
bpmnExit: (t) => `End Sub-Workflow Call: ${t}`,
|
|
510
|
+
emitBpmnElements: (t, l) => {
|
|
511
|
+
const o = l;
|
|
512
|
+
return [{
|
|
513
|
+
id: t,
|
|
514
|
+
$type: "bpmn:CallActivity",
|
|
515
|
+
name: o.workflowLabel || o.workflowId || "Sub-Workflow",
|
|
516
|
+
calledElement: o.workflowId
|
|
517
|
+
}];
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
const M = E();
|
|
522
|
+
class f {
|
|
3
523
|
constructor() {
|
|
4
524
|
this.descriptors = /* @__PURE__ */ new Map();
|
|
5
525
|
}
|
|
6
|
-
register(
|
|
7
|
-
return this.descriptors.set(
|
|
526
|
+
register(t) {
|
|
527
|
+
return this.descriptors.set(t.type, t), this;
|
|
8
528
|
}
|
|
9
|
-
forType(
|
|
10
|
-
return this.descriptors.get(
|
|
529
|
+
forType(t) {
|
|
530
|
+
return this.descriptors.get(t);
|
|
11
531
|
}
|
|
12
|
-
forId(
|
|
13
|
-
for (const
|
|
14
|
-
if (
|
|
532
|
+
forId(t) {
|
|
533
|
+
for (const l of this.descriptors.values())
|
|
534
|
+
if (l.matches(t)) return l;
|
|
15
535
|
}
|
|
16
536
|
list() {
|
|
17
537
|
return [...this.descriptors.values()];
|
|
18
538
|
}
|
|
19
539
|
}
|
|
20
|
-
const
|
|
540
|
+
const H = new f();
|
|
21
541
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
542
|
+
f as NodeTypeRegistry,
|
|
543
|
+
m as baseNodeDefaults,
|
|
544
|
+
q as conditionBranchDescriptor,
|
|
545
|
+
r as defineNode,
|
|
546
|
+
v as endEventDescriptor,
|
|
547
|
+
E as makeSubWorkflowDescriptor,
|
|
548
|
+
H as nodeTypeRegistry,
|
|
549
|
+
x as notificationDescriptor,
|
|
550
|
+
S as restApiDescriptor,
|
|
551
|
+
T as startEventDescriptor,
|
|
552
|
+
M as subWorkflowDescriptor,
|
|
553
|
+
N as webhookTriggerDescriptor,
|
|
554
|
+
C as webhookTriggerTemplate
|
|
35
555
|
};
|
|
36
556
|
//# sourceMappingURL=nodeRegistry.js.map
|