@notmrabhi/flowforge 0.1.20 → 0.1.21
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/package.json +1 -1
- package/dist/GatewayBranchEdge-BdUVHQJc.js +0 -1263
- package/dist/GatewayBranchEdge-DK6kuCK2.js +0 -1
- package/dist/SchemaBuilderDrawer-157p-2Vj.js +0 -1136
- package/dist/SchemaBuilderDrawer-Wje7pVrn.js +0 -1
- package/dist/bpmn-CcuE2X_Q.js +0 -2
- package/dist/bpmn-CtfWDaOY.js +0 -33
- package/dist/canvas.cjs +0 -1
- package/dist/canvas.d.ts +0 -809
- package/dist/canvas.js +0 -28
- package/dist/canvasTokens-CAD6G24b.js +0 -32
- package/dist/canvasTokens-gKNYrPl4.js +0 -1
- package/dist/core.cjs +0 -1
- package/dist/core.d.ts +0 -374
- package/dist/core.js +0 -24
- package/dist/defaultUi.cjs +0 -1
- package/dist/defaultUi.d.ts +0 -83
- package/dist/defaultUi.js +0 -18
- package/dist/form.cjs +0 -1
- package/dist/form.d.ts +0 -857
- package/dist/form.js +0 -44
- package/dist/index-B31-Y5uO.js +0 -11
- package/dist/index-B3aHpb84.js +0 -13
- package/dist/index-BU09HbVh.js +0 -10176
- package/dist/index-BnzttJ4w.js +0 -13758
- package/dist/index-BysKSEtZ.js +0 -1
- package/dist/index-CQ0cVcHp.js +0 -2
- package/dist/index-CkjEllpd.js +0 -1
- package/dist/index-Codx5QwP.js +0 -41
- package/dist/index-Cw9DC-tf.js +0 -76
- package/dist/index-CzPi8KQC.js +0 -1310
- package/dist/index-D14V8rKX.js +0 -1
- package/dist/index-Da5NHCS2.js +0 -8132
- package/dist/index-a1IOaYsW.js +0 -9
- package/dist/index-a3QMaedZ.js +0 -2553
- package/dist/index-gtgq_241.js +0 -3
- package/dist/index-l6kvDx-m.js +0 -1360
- package/dist/index-lcviy90e.js +0 -613
- package/dist/index-wOnYb3DO.js +0 -567
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -1409
- package/dist/index.js +0 -107
- package/dist/messages-CO299wPN.js +0 -22
- package/dist/messages-O9Tw_XXR.js +0 -1
- package/dist/nodeRegistry.cjs +0 -1
- package/dist/nodeRegistry.d.ts +0 -334
- package/dist/nodeRegistry.js +0 -555
- package/dist/style.css +0 -6
- package/dist/templateRegistry.cjs +0 -1
- package/dist/templateRegistry.d.ts +0 -83
- package/dist/templateRegistry.js +0 -43
- package/dist/templateSkeletons--Ol7Sg7H.js +0 -1
- package/dist/templateSkeletons-DcvDac7_.js +0 -2954
package/dist/index.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { D as c, F as u, a as m, b as f, c as g, I as F, T as h, V as b, d as k, e as T, f as w, g as S, h as y, i as x, j as D, k as N, B as R, l as W, m as A, n as P, o as v, p as E, q as C, r as I, s as B, t as z, u as V, v as L, w as O, x as q, y as H, z as M, A as _ } from "./index-BU09HbVh.js";
|
|
2
|
-
import { F as Y, S as G, a as J, u as K } from "./SchemaBuilderDrawer-157p-2Vj.js";
|
|
3
|
-
import "react/jsx-runtime";
|
|
4
|
-
import "react";
|
|
5
|
-
import "@mui/material";
|
|
6
|
-
import "react-icons/md";
|
|
7
|
-
import { NodeTypeRegistry as U, baseNodeDefaults as X, conditionBranchDescriptor as Z, defineNode as $, endEventDescriptor as ee, makeSubWorkflowDescriptor as ae, nodeTypeRegistry as se, notificationDescriptor as re, restApiDescriptor as oe, startEventDescriptor as te, subWorkflowDescriptor as ie, webhookTriggerDescriptor as le, webhookTriggerTemplate as ne } from "./nodeRegistry.js";
|
|
8
|
-
import { TemplateRegistry as de, templateRegistry as ce } from "./templateRegistry.js";
|
|
9
|
-
import { F as me, S as fe, F as ge, W as Fe, a as he, b as be, o as ke, u as Te, w as we } from "./templateSkeletons-DcvDac7_.js";
|
|
10
|
-
import { d as ye } from "./messages-CO299wPN.js";
|
|
11
|
-
import { l as De, s as Ne } from "./bpmn-CtfWDaOY.js";
|
|
12
|
-
import { A as We, b as Ae, E as Pe, c as ve, F as Ee, R as Ce, S as Ie, T as Be, W as ze, e as Ve } from "./GatewayBranchEdge-BdUVHQJc.js";
|
|
13
|
-
class s {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.channels = /* @__PURE__ */ new Map();
|
|
16
|
-
}
|
|
17
|
-
register(e, a) {
|
|
18
|
-
this.channels.set(e, a);
|
|
19
|
-
}
|
|
20
|
-
get(e) {
|
|
21
|
-
return this.channels.get(e);
|
|
22
|
-
}
|
|
23
|
-
list() {
|
|
24
|
-
return Array.from(this.channels.entries()).map(([e, a]) => ({ key: e, ...a }));
|
|
25
|
-
}
|
|
26
|
-
has(e) {
|
|
27
|
-
return this.channels.has(e);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const n = new s();
|
|
31
|
-
export {
|
|
32
|
-
We as ActionNode,
|
|
33
|
-
Ae as ApprovalNode,
|
|
34
|
-
c as DynamicFormRenderer,
|
|
35
|
-
Pe as EdgeWithPlusLabel,
|
|
36
|
-
ve as EndNode,
|
|
37
|
-
u as FF,
|
|
38
|
-
Y as FIELD_TYPE_OPTIONS,
|
|
39
|
-
Ee as FilterNode,
|
|
40
|
-
me as FlowForgeCanvas,
|
|
41
|
-
m as FlowForgeRegistry,
|
|
42
|
-
f as FlowForm,
|
|
43
|
-
g as FormulaInput,
|
|
44
|
-
F as InfiniteSelectField,
|
|
45
|
-
U as NodeTypeRegistry,
|
|
46
|
-
Ce as RestApiNode,
|
|
47
|
-
G as SchemaBuilder,
|
|
48
|
-
J as SchemaBuilderDrawer,
|
|
49
|
-
Ie as StartNode,
|
|
50
|
-
fe as SubWorkflowPreviewDrawer,
|
|
51
|
-
h as TablePickerField,
|
|
52
|
-
de as TemplateRegistry,
|
|
53
|
-
Be as TriggerNode,
|
|
54
|
-
b as VariablePicker,
|
|
55
|
-
k as VariablePickerProvider,
|
|
56
|
-
ze as WebhookTriggerNode,
|
|
57
|
-
ge as WorkflowCanvas,
|
|
58
|
-
Fe as WorkflowExecutionHistory,
|
|
59
|
-
he as WorkflowTemplateLibrary,
|
|
60
|
-
be as accessRequestSkeleton,
|
|
61
|
-
T as astHasRefs,
|
|
62
|
-
w as astToTokens,
|
|
63
|
-
X as baseNodeDefaults,
|
|
64
|
-
S as buildEvaluationPayload,
|
|
65
|
-
y as buildFieldConfig,
|
|
66
|
-
x as buildFormulaPath,
|
|
67
|
-
D as buildSelectStyles,
|
|
68
|
-
N as buildValidationSchema,
|
|
69
|
-
Ve as builtInNodeTypes,
|
|
70
|
-
Z as conditionBranchDescriptor,
|
|
71
|
-
R as dataSourceRegistry,
|
|
72
|
-
ye as defaultFlowForgeMessages,
|
|
73
|
-
$ as defineNode,
|
|
74
|
-
ee as endEventDescriptor,
|
|
75
|
-
W as errorTextStyle,
|
|
76
|
-
A as extractLabel,
|
|
77
|
-
P as fieldRegistry,
|
|
78
|
-
v as hasFormulaTokens,
|
|
79
|
-
E as helperTextStyle,
|
|
80
|
-
C as inputStyle,
|
|
81
|
-
I as isFormula,
|
|
82
|
-
De as loadWorkflowFromBpmn,
|
|
83
|
-
ae as makeSubWorkflowDescriptor,
|
|
84
|
-
se as nodeTypeRegistry,
|
|
85
|
-
n as notificationChannelRegistry,
|
|
86
|
-
re as notificationDescriptor,
|
|
87
|
-
ke as offboardingSkeleton,
|
|
88
|
-
B as parseToAST,
|
|
89
|
-
oe as restApiDescriptor,
|
|
90
|
-
Ne as saveWorkflowToBpmn,
|
|
91
|
-
z as serializeAST,
|
|
92
|
-
V as serializeASTAsConfig,
|
|
93
|
-
L as serializeConditionExpressions,
|
|
94
|
-
te as startEventDescriptor,
|
|
95
|
-
O as stripFormulaTokens,
|
|
96
|
-
ie as subWorkflowDescriptor,
|
|
97
|
-
ce as templateRegistry,
|
|
98
|
-
q as tokenize,
|
|
99
|
-
H as unwrapFormula,
|
|
100
|
-
K as useFlowForm,
|
|
101
|
-
M as useVariablePickerContext,
|
|
102
|
-
Te as userOnboardingSkeleton,
|
|
103
|
-
we as webhookIntegrationSkeleton,
|
|
104
|
-
le as webhookTriggerDescriptor,
|
|
105
|
-
ne as webhookTriggerTemplate,
|
|
106
|
-
_ as wrapFormula
|
|
107
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const e = {
|
|
2
|
-
addTriggerTitle: "Add Trigger",
|
|
3
|
-
addTriggerTooltip: "Click to add a trigger for your workflow",
|
|
4
|
-
addTriggerButton: "Add Trigger",
|
|
5
|
-
chooseTrigger: "Choose a trigger to start the workflow.",
|
|
6
|
-
noTriggers: "No triggers registered.",
|
|
7
|
-
addStepTitle: "Add Step",
|
|
8
|
-
chooseAction: "Choose an action to add to the workflow.",
|
|
9
|
-
noActions: "No actions available for this trigger.",
|
|
10
|
-
configureStep: "Configure Step",
|
|
11
|
-
loadingConfiguration: "Loading configuration...",
|
|
12
|
-
noConfigurationNeeded: "No configuration needed for this step.",
|
|
13
|
-
save: "Save",
|
|
14
|
-
cancel: "Cancel"
|
|
15
|
-
}, r = (o) => ({
|
|
16
|
-
...e,
|
|
17
|
-
...o ?? {}
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
e as d,
|
|
21
|
-
r as m
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e={addTriggerTitle:"Add Trigger",addTriggerTooltip:"Click to add a trigger for your workflow",addTriggerButton:"Add Trigger",chooseTrigger:"Choose a trigger to start the workflow.",noTriggers:"No triggers registered.",addStepTitle:"Add Step",chooseAction:"Choose an action to add to the workflow.",noActions:"No actions available for this trigger.",configureStep:"Configure Step",loadingConfiguration:"Loading configuration...",noConfigurationNeeded:"No configuration needed for this step.",save:"Save",cancel:"Cancel"},r=o=>({...e,...o??{}});exports.defaultFlowForgeMessages=e;exports.mergeMessages=r;
|
package/dist/nodeRegistry.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),r=require("react-icons/md"),d=require("./canvasTokens-gKNYrPl4.js"),s={formSchema:[],bpmnEntry:e=>e,bpmnExit:e=>e,emitBpmnElements:e=>[{id:e,$type:"bpmn:Task"}]};function o(e){return{...s,...e}}const u=o({type:"startEvent",label:"Start",icon:a.createElement(r.MdPlayCircleOutline,{size:18,color:"#616161"}),matches:e=>e==="start",reactFlowType:"startNode",emitBpmnElements:e=>[{id:e,$type:"bpmn:StartEvent"}],maxPerWorkflow:1}),b=o({type:"endEvent",label:"End",icon:a.createElement(r.MdStopCircle,{size:18,color:"#616161"}),matches:e=>e==="end"||e.startsWith("end-"),reactFlowType:"endNode",emitBpmnElements:e=>[{id:e,$type:"bpmn:EndEvent"}]}),h=o({type:"restApi",label:"REST API Call",icon:a.createElement(r.MdHttp,{size:18,color:"#546e7a"}),matches:e=>e.startsWith("restApi-"),reactFlowType:"restApiNode",formSchema:[{id:"method",type:"select",label:"HTTP Method",required:!0,options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"PUT",value:"PUT"},{label:"PATCH",value:"PATCH"},{label:"DELETE",value:"DELETE"}]},{id:"url",type:"text",label:"URL",required:!0,placeholder:"https://api.example.com/endpoint",formulaEnabled:!0},{id:"headers",type:"key-value",label:"Request Headers",placeholder:"Add headers..."},{id:"queryParams",type:"key-value",label:"Query Parameters",shouldHide:({values:e})=>e.method!=="GET"&&e.method!=="DELETE"},{id:"body",type:"json-editor",label:"Request Body (JSON)",shouldHide:({values:e})=>e.method==="GET"||e.method==="DELETE"},{id:"responseMapping",type:"array",label:"Map Response Fields to Variables",children:[{id:"jsonPath",type:"text",label:"JSON Path",placeholder:"$.data.userId",required:!0},{id:"variableName",type:"text",label:"Variable Name",placeholder:"userId",required:!0}]},{id:"timeoutMs",type:"number",label:"Timeout (ms)",placeholder:"5000"},{id:"continueOnError",type:"toggle",label:"Continue workflow on error"}],bpmnEntry:e=>`REST API Call: ${e}`,bpmnExit:e=>`End REST API Call: ${e}`,emitBpmnElements:(e,t)=>{const l=t;return[{id:e,$type:"bpmn:ServiceTask",name:`${l.method??"HTTP"} ${l.url??""}`.trim()}]}}),m=o({type:"notification",label:"Send Notification",icon:a.createElement(r.MdNotifications,{size:18,color:"#7b1fa2"}),matches:e=>e.startsWith("notification-"),reactFlowType:"notificationNode",formSchema:[{id:"channel",type:"descriptive-select",label:"Notification Channel",required:!0,options:[{value:"email",label:"Email",description:"Send via SMTP or email provider"},{value:"slack",label:"Slack",description:"Post to a Slack channel or DM"},{value:"teams",label:"Microsoft Teams",description:"Post to a Teams channel or chat"},{value:"sms",label:"SMS",description:"Send a text message"},{value:"in-app",label:"In-App",description:"miniOrange notification center"},{value:"webhook",label:"Webhook",description:"POST to an external URL"}]},{id:"emailTo",type:"tags",label:"To",placeholder:"Add email address...",required:!0,shouldHide:({values:e})=>e.channel!=="email",formulaEnabled:!0},{id:"emailCc",type:"tags",label:"CC",placeholder:"Add email address...",shouldHide:({values:e})=>e.channel!=="email"},{id:"emailSubject",type:"text",label:"Subject",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="email"},{id:"emailBody",type:"rich-text",label:"Body",required:!0,shouldHide:({values:e})=>e.channel!=="email"},{id:"slackChannel",type:"text",label:"Channel / DM",required:!0,placeholder:"#general or @username",formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="slack"},{id:"slackMessage",type:"textarea",label:"Message",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="slack"},{id:"teamsWebhookUrl",type:"text",label:"Incoming Webhook URL",required:!0,placeholder:"https://...",shouldHide:({values:e})=>e.channel!=="teams"},{id:"teamsMessage",type:"textarea",label:"Message",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="teams"},{id:"smsTo",type:"text",label:"Phone Number",required:!0,placeholder:"+1234567890",formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="sms"},{id:"smsBody",type:"textarea",label:"Message",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="sms"},{id:"inAppRecipient",type:"text",label:"Recipient (User ID or Username)",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="in-app"},{id:"inAppTitle",type:"text",label:"Title",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="in-app"},{id:"inAppBody",type:"textarea",label:"Message",required:!0,formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="in-app"},{id:"webhookUrl",type:"text",label:"Webhook URL",required:!0,placeholder:"https://...",formulaEnabled:!0,shouldHide:({values:e})=>e.channel!=="webhook"},{id:"webhookPayload",type:"json-editor",label:"Payload (JSON)",shouldHide:({values:e})=>e.channel!=="webhook"},{id:"sendOnFailure",type:"toggle",label:"Also send notification on workflow failure"},{id:"deduplicationKey",type:"text",label:"Deduplication Key",placeholder:"Optional — prevents duplicate sends",formulaEnabled:!0}],bpmnEntry:e=>`Send Notification: ${e}`,bpmnExit:e=>`End Notification: ${e}`,emitBpmnElements:(e,t)=>[{id:e,$type:"bpmn:SendTask",name:`Notify via ${t.channel??"channel"}`}]}),y=[{label:"equals (=)",value:"eq"},{label:"not equals (≠)",value:"neq"},{label:"greater than (>)",value:"gt"},{label:"greater or equal (≥)",value:"gte"},{label:"less than (<)",value:"lt"},{label:"less or equal (≤)",value:"lte"},{label:"contains",value:"contains"},{label:"starts with",value:"startsWith"},{label:"ends with",value:"endsWith"},{label:"is empty",value:"isEmpty"},{label:"is not empty",value:"isNotEmpty"}],E=o({type:"conditionBranch",label:"Condition Branch",icon:a.createElement(r.MdCallSplit,{size:18,color:"#512da8"}),matches:e=>e.startsWith("conditionBranch-"),reactFlowType:"conditionBranchNode",branchLabels:{branch1:"IF · Branch 1",branch2:"ELSE IF · Branch 2",default:"ELSE"},formSchema:[{id:"title",type:"text",label:"Node Label",placeholder:"e.g. Route by User Role"},{id:"branchConfigs",type:"array",label:"Branches",required:!0,children:[{id:"kind",type:"select",label:"Branch Type",required:!0,options:[{label:"IF",value:"if"},{label:"ELSE IF",value:"elseif"},{label:"ELSE",value:"else"}],placeholder:"elseif"},{id:"key",type:"text",label:"Branch Key",required:!0,placeholder:"e.g. admin (no spaces)"},{id:"label",type:"text",label:"Branch Label",required:!0,placeholder:"e.g. Admin Users"},{id:"conditions",type:"array",label:"Conditions",shouldHide:({values:e})=>e.kind==="else",children:[{id:"field",type:"text",label:"Field / Variable",required:!0,placeholder:"e.g. user.role",formulaEnabled:!0},{id:"operator",type:"select",label:"Operator",required:!0,options:y},{id:"value",type:"text",label:"Value",placeholder:"e.g. admin",formulaEnabled:!0,shouldHide:({values:e})=>e.operator==="isEmpty"||e.operator==="isNotEmpty"},{id:"logicalOperator",type:"select",label:"Combine with next",options:[{label:"AND",value:"AND"},{label:"OR",value:"OR"}]}]}]},{id:"defaultBranch",type:"text",label:"Default Branch Key (fallback if no condition matches)",placeholder:"e.g. default"}],bpmnEntry:e=>`Condition Branch: ${e}`,bpmnExit:e=>`End Condition Branch: ${e}`,emitBpmnElements:(e,t)=>{const l=t,i=l.branchConfigs??[];return[{id:e,$type:"bpmn:ExclusiveGateway",name:l.title??"Condition Branch"},...i.map(n=>({id:`${e}-${n.key}`,$type:"bpmn:SequenceFlow",name:n.label}))]}}),f=o({type:"webhookTrigger",label:"Webhook Trigger",icon:a.createElement(r.MdWebhook,{size:d.NODE_DESCRIPTOR_ICON_SIZE,color:"#1565c0"}),matches:e=>e.startsWith("webhookTrigger-"),reactFlowType:"webhookTriggerNode",formSchema:[{id:"endpointUrl",type:"text",label:"Endpoint URL",disabled:!0,placeholder:"Generated after saving"},{id:"authMethod",type:"select",label:"Authentication",required:!0,options:[{label:"None",value:"none"},{label:"API Key",value:"api-key"},{label:"HMAC Signature",value:"hmac"}]},{id:"apiKeyHeader",type:"text",label:"API Key Header Name",placeholder:"e.g. X-API-Key",shouldHide:({values:e})=>e.authMethod!=="api-key"},{id:"hmacSecret",type:"text",label:"HMAC Secret",placeholder:"Shared secret for signature verification",shouldHide:({values:e})=>e.authMethod!=="hmac"},{id:"payloadDescription",type:"textarea",label:"Expected Payload Description",placeholder:"Describe the expected JSON payload fields..."}],bpmnEntry:e=>`Webhook Trigger: ${e}`,bpmnExit:e=>`End Webhook Trigger: ${e}`,emitBpmnElements:e=>[{id:e,$type:"bpmn:StartEvent",name:"Webhook Trigger"}]}),g={triggerKey:"WEBHOOK_TRIGGER",label:"Incoming Webhook",description:"Start this workflow when an HTTP POST is received at a generated endpoint.",triggerCategory:"webhook",icon:a.createElement(r.MdWebhook,{size:d.NODE_DESCRIPTOR_ICON_SIZE,color:"#1565c0"})};function p(e={}){return o({type:"subWorkflow",label:"Sub-Workflow",icon:a.createElement(r.MdAccountTree,{size:18,color:"#00695c"}),matches:t=>t.startsWith("subWorkflow-"),reactFlowType:"subWorkflowNode",formSchema:[{id:"workflowId",type:"select",label:"Workflow to Call",required:!0,placeholder:"Select a workflow...",...e.fetchWorkflowOptions?{fetchOptions:e.fetchWorkflowOptions}:{options:[]}},{id:"workflowLabel",type:"text",label:"Display Name (optional)",placeholder:"Override display name shown on canvas"},{id:"inputMapping",type:"key-value",label:"Input Mapping",placeholder:"Map parent variables → sub-workflow inputs",formulaEnabled:!0},{id:"outputMapping",type:"key-value",label:"Output Mapping",placeholder:"Map sub-workflow outputs → parent variables"},{id:"waitForCompletion",type:"toggle",label:"Wait for sub-workflow to complete before continuing"},{id:"continueOnError",type:"toggle",label:"Continue parent workflow if sub-workflow fails"}],bpmnEntry:t=>`Sub-Workflow Call: ${t}`,bpmnExit:t=>`End Sub-Workflow Call: ${t}`,emitBpmnElements:(t,l)=>{const i=l;return[{id:t,$type:"bpmn:CallActivity",name:i.workflowLabel||i.workflowId||"Sub-Workflow",calledElement:i.workflowId}]}})}const k=p();class c{constructor(){this.descriptors=new Map}register(t){return this.descriptors.set(t.type,t),this}forType(t){return this.descriptors.get(t)}forId(t){for(const l of this.descriptors.values())if(l.matches(t))return l}list(){return[...this.descriptors.values()]}}const w=new c;exports.NodeTypeRegistry=c;exports.baseNodeDefaults=s;exports.conditionBranchDescriptor=E;exports.defineNode=o;exports.endEventDescriptor=b;exports.makeSubWorkflowDescriptor=p;exports.nodeTypeRegistry=w;exports.notificationDescriptor=m;exports.restApiDescriptor=h;exports.startEventDescriptor=u;exports.subWorkflowDescriptor=k;exports.webhookTriggerDescriptor=f;exports.webhookTriggerTemplate=g;
|
package/dist/nodeRegistry.d.ts
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import { AnySchema } from 'yup';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Base defaults shared by every node descriptor. A new node only has to specify
|
|
6
|
-
* what makes it different — these fill in the rest.
|
|
7
|
-
*
|
|
8
|
-
* - `formSchema: []` → no config form unless the node defines one
|
|
9
|
-
* - `bpmnEntry` / `bpmnExit` → incoming/outgoing flow connects to the node id itself
|
|
10
|
-
* - `emitBpmnElements` → a single generic bpmn:Task; override for real output
|
|
11
|
-
*/
|
|
12
|
-
export declare const baseNodeDefaults: Pick<NodeDescriptor, 'formSchema' | 'bpmnEntry' | 'bpmnExit' | 'emitBpmnElements'>;
|
|
13
|
-
|
|
14
|
-
declare interface BpmnElement {
|
|
15
|
-
id: string;
|
|
16
|
-
$type: string;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare type BranchChain = CanvasSlot[];
|
|
21
|
-
|
|
22
|
-
declare interface BranchMap {
|
|
23
|
-
[filterId: string]: {
|
|
24
|
-
[branchKey: string]: BranchChain;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
declare interface CanvasSlot {
|
|
29
|
-
id: string;
|
|
30
|
-
kind: SlotKind;
|
|
31
|
-
reactFlowType: string;
|
|
32
|
-
descriptorType?: string;
|
|
33
|
-
formData?: Record<string, unknown>;
|
|
34
|
-
nodeData?: Record<string, unknown>;
|
|
35
|
-
deletable?: boolean;
|
|
36
|
-
label?: string;
|
|
37
|
-
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' } */
|
|
38
|
-
branchLabels?: Record<string, string>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export declare const conditionBranchDescriptor: NodeDescriptor;
|
|
42
|
-
|
|
43
|
-
/** One column in a per-field condition row */
|
|
44
|
-
declare interface ConditionFieldDef {
|
|
45
|
-
/** Key used to store this column's value in ConditionEntry */
|
|
46
|
-
id: string;
|
|
47
|
-
/**
|
|
48
|
-
* 'select' — native <select> with user-supplied options
|
|
49
|
-
* 'operator' — native <select> pre-filled with the standard operator list (no options needed)
|
|
50
|
-
* 'text' — plain <input>
|
|
51
|
-
* any other string — falls back to <input>
|
|
52
|
-
*/
|
|
53
|
-
type: 'select' | 'operator' | 'text' | string;
|
|
54
|
-
colSpan?: number;
|
|
55
|
-
label?: string;
|
|
56
|
-
placeholder?: string;
|
|
57
|
-
/** Options for select columns — user defines these, renderer just renders them */
|
|
58
|
-
options?: Array<{
|
|
59
|
-
value: string;
|
|
60
|
-
label: string;
|
|
61
|
-
}>;
|
|
62
|
-
/** When true, renders a FormulaInput chip editor instead of a plain <input> */
|
|
63
|
-
formula?: boolean;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Build a node descriptor on top of {@link baseNodeDefaults}.
|
|
68
|
-
*
|
|
69
|
-
* Supply the four required identity fields plus only the behaviour you want to
|
|
70
|
-
* override. Everything else inherits the base.
|
|
71
|
-
*
|
|
72
|
-
* export const startEventDescriptor = defineNode({
|
|
73
|
-
* type: 'startEvent',
|
|
74
|
-
* label: 'Start',
|
|
75
|
-
* matches: (id) => id === 'start',
|
|
76
|
-
* reactFlowType: 'startNode',
|
|
77
|
-
* emitBpmnElements: (id) => [{ id, $type: 'bpmn:StartEvent' }], // override
|
|
78
|
-
* });
|
|
79
|
-
*/
|
|
80
|
-
export declare function defineNode(overrides: RequiredNodeFields & Partial<NodeDescriptor>): NodeDescriptor;
|
|
81
|
-
|
|
82
|
-
declare interface DmnDefinition {
|
|
83
|
-
id: string;
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* End event — a fixed skeleton node with no user-editable form.
|
|
89
|
-
* The canvas seeds the main-spine end as the literal slot id `'end'`, and one
|
|
90
|
-
* end per branch as `'end-${filterId}-${branch}'` (see WorkflowCanvas.tsx).
|
|
91
|
-
* `matches` must cover both shapes so every terminal node resolves via `forId`
|
|
92
|
-
* during descriptor-driven BPMN load — otherwise branch ends get skipped.
|
|
93
|
-
*
|
|
94
|
-
* Inherits formSchema (none) and bpmnEntry/bpmnExit from the base node.
|
|
95
|
-
*/
|
|
96
|
-
export declare const endEventDescriptor: NodeDescriptor;
|
|
97
|
-
|
|
98
|
-
/** Condition definition attached to a FieldDescriptor */
|
|
99
|
-
declare interface FieldConditionDef {
|
|
100
|
-
fields: ConditionFieldDef[];
|
|
101
|
-
/** Enables nested condition groups. Defaults to false. */
|
|
102
|
-
allowGroups?: boolean;
|
|
103
|
-
/** Optional depth limit for nested groups when allowGroups is true. */
|
|
104
|
-
maxGroupDepth?: number;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
declare interface FieldContext {
|
|
108
|
-
values: Record<string, unknown>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
declare interface FieldDescriptor {
|
|
112
|
-
/**
|
|
113
|
-
* The formik key for this field.
|
|
114
|
-
* Use `id` (preferred) or `name` — both are accepted.
|
|
115
|
-
* `id` takes precedence if both are provided.
|
|
116
|
-
*/
|
|
117
|
-
id?: string;
|
|
118
|
-
name?: string;
|
|
119
|
-
type: FieldType | string;
|
|
120
|
-
/** Child field descriptors — used by type: 'object' to render a nested group. */
|
|
121
|
-
children?: FieldDescriptor[];
|
|
122
|
-
/** Optional per-field condition guard — renders a condition row below this field. */
|
|
123
|
-
condition?: FieldConditionDef;
|
|
124
|
-
label?: string;
|
|
125
|
-
placeholder?: string;
|
|
126
|
-
required?: boolean;
|
|
127
|
-
showOptional?: boolean;
|
|
128
|
-
disabled?: boolean | ((ctx: FieldContext) => boolean);
|
|
129
|
-
hidden?: boolean;
|
|
130
|
-
colSpan?: number;
|
|
131
|
-
dividerAfter?: boolean;
|
|
132
|
-
info?: string;
|
|
133
|
-
helperText?: string;
|
|
134
|
-
dataTestId?: string;
|
|
135
|
-
validation?: AnySchema;
|
|
136
|
-
shouldHide?: (ctx: FieldContext) => boolean;
|
|
137
|
-
shouldDisable?: (ctx: FieldContext) => boolean;
|
|
138
|
-
shouldRequire?: (ctx: FieldContext) => boolean;
|
|
139
|
-
compute?: (ctx: FieldContext) => unknown;
|
|
140
|
-
transform?: FieldTransform;
|
|
141
|
-
onChange?: (value: unknown, ctx: FieldContext & {
|
|
142
|
-
setFieldValue: (name: string, value: unknown) => void;
|
|
143
|
-
}) => void;
|
|
144
|
-
[key: string]: unknown;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
declare interface FieldTransform {
|
|
148
|
-
in?: (value: unknown) => unknown;
|
|
149
|
-
out?: (value: unknown) => unknown;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
declare type FieldType = 'text' | 'textarea' | 'number' | 'toggle' | 'radio-group' | 'select' | 'descriptive-select' | 'key-value' | 'array' | 'object' | 'reference' | 'cron' | 'schema';
|
|
153
|
-
|
|
154
|
-
declare interface FixedEdge {
|
|
155
|
-
id: string;
|
|
156
|
-
source: string;
|
|
157
|
-
target: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
declare interface FixedNode {
|
|
161
|
-
id: string;
|
|
162
|
-
type: string;
|
|
163
|
-
data?: Record<string, unknown>;
|
|
164
|
-
deletable?: false;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Context passed to `NodeDescriptor.canInsert(ctx)` describing where on the
|
|
169
|
-
* canvas the user clicked "+ Add step". Used by position-aware insertion rules.
|
|
170
|
-
*/
|
|
171
|
-
declare interface InsertContext {
|
|
172
|
-
/** The slot the user clicked under (the one whose "+" edge was clicked). */
|
|
173
|
-
insertAfterSlot: CanvasSlot | null;
|
|
174
|
-
/** Every slot before the insertion point, including the click slot.
|
|
175
|
-
* When inside a branch: spine up to + including the branching parent, then
|
|
176
|
-
* the branch's own slots up to the insertion point. */
|
|
177
|
-
upstreamSlots: CanvasSlot[];
|
|
178
|
-
/** Every slot after the insertion point in the same chain. */
|
|
179
|
-
downstreamSlots: CanvasSlot[];
|
|
180
|
-
/** Branch context, if the insertion is happening inside a branch. */
|
|
181
|
-
branch: {
|
|
182
|
-
filterId: string;
|
|
183
|
-
branch: string;
|
|
184
|
-
} | null;
|
|
185
|
-
/** The currently active template (the one whose trigger is in use). */
|
|
186
|
-
template: WorkflowTemplate | null;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export declare function makeSubWorkflowDescriptor(opts?: SubWorkflowDescriptorOptions): NodeDescriptor;
|
|
190
|
-
|
|
191
|
-
export declare interface NodeDescriptor {
|
|
192
|
-
type: string;
|
|
193
|
-
label: string;
|
|
194
|
-
icon?: ReactNode;
|
|
195
|
-
/**
|
|
196
|
-
* Optional "app" this action belongs to (Slack, Salesforce, …). When present,
|
|
197
|
-
* the node picker drills down: stage 1 lists unique apps, stage 2 lists this
|
|
198
|
-
* app's actions, stage 3 is the action's config form. Descriptors without an
|
|
199
|
-
* `app` field appear ungrouped at stage 1, alongside the app cards.
|
|
200
|
-
*/
|
|
201
|
-
app?: {
|
|
202
|
-
key: string;
|
|
203
|
-
label: string;
|
|
204
|
-
icon?: ReactNode;
|
|
205
|
-
description?: string;
|
|
206
|
-
};
|
|
207
|
-
matches: (id: string) => boolean;
|
|
208
|
-
bpmnEntry: (nodeId: string) => string;
|
|
209
|
-
bpmnExit: (nodeId: string) => string;
|
|
210
|
-
emitBpmnElements: (nodeId: string, nodeData: unknown) => BpmnElement[];
|
|
211
|
-
emitDmnDefinition?: (nodeId: string, nodeData: unknown) => DmnDefinition;
|
|
212
|
-
outgoingCondition?: (nodeId: string, targetId: string, nodeData: unknown) => string;
|
|
213
|
-
reactFlowType: string;
|
|
214
|
-
previewNodeType?: string;
|
|
215
|
-
/**
|
|
216
|
-
* Optional custom node-card body. When provided, the node renderer shows this
|
|
217
|
-
* instead of the default value badges — lets a node author fully design the
|
|
218
|
-
* card body while keeping the shared frame (title, edit/delete, handles).
|
|
219
|
-
* Receives the node's saved formData.
|
|
220
|
-
*/
|
|
221
|
-
renderNode?: (nodeData: Record<string, unknown>) => ReactNode;
|
|
222
|
-
/**
|
|
223
|
-
* Position constraint — this descriptor can be inserted only if at least ONE
|
|
224
|
-
* of the listed tokens appears in the upstream chain of the click site.
|
|
225
|
-
* Tokens can be a descriptorType (e.g. 'createUserTask'), a slot id
|
|
226
|
-
* (e.g. 'event-userCreated'), or a slot kind (e.g. 'triggerFixed').
|
|
227
|
-
* Ignored when `canInsert` is set.
|
|
228
|
-
*/
|
|
229
|
-
insertAfter?: string[];
|
|
230
|
-
/**
|
|
231
|
-
* Symmetric — must appear DOWNSTREAM of the click site. Same token rules
|
|
232
|
-
* as `insertAfter`. Ignored when `canInsert` is set.
|
|
233
|
-
*/
|
|
234
|
-
insertBefore?: string[];
|
|
235
|
-
/**
|
|
236
|
-
* Full custom rule. Overrides `insertAfter` / `insertBefore`. Receives the
|
|
237
|
-
* click context (upstream/downstream slots, branch info, active template);
|
|
238
|
-
* returns `true` to allow the descriptor at this insertion point.
|
|
239
|
-
*/
|
|
240
|
-
canInsert?: (ctx: InsertContext) => boolean;
|
|
241
|
-
/** Maps branch key → display label. e.g. { pass: 'Pass', fail: 'Fail' }. Only applies to branching nodes (filterNode, approvalNode). */
|
|
242
|
-
branchLabels?: Record<string, string>;
|
|
243
|
-
formSchema: FieldDescriptor[] | ((nodeId: string) => Promise<FieldDescriptor[]>);
|
|
244
|
-
maxPerWorkflow?: number;
|
|
245
|
-
relatedNodePrefixes?: string[];
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export declare class NodeTypeRegistry {
|
|
249
|
-
private descriptors;
|
|
250
|
-
register(descriptor: NodeDescriptor): this;
|
|
251
|
-
forType(type: string): NodeDescriptor | undefined;
|
|
252
|
-
forId(id: string): NodeDescriptor | undefined;
|
|
253
|
-
list(): NodeDescriptor[];
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export declare const nodeTypeRegistry: NodeTypeRegistry;
|
|
257
|
-
|
|
258
|
-
export declare const notificationDescriptor: NodeDescriptor;
|
|
259
|
-
|
|
260
|
-
/** The fields every node MUST provide — there is no sensible default for these. */
|
|
261
|
-
declare type RequiredNodeFields = Pick<NodeDescriptor, 'type' | 'label' | 'matches' | 'reactFlowType'>;
|
|
262
|
-
|
|
263
|
-
export declare const restApiDescriptor: NodeDescriptor;
|
|
264
|
-
|
|
265
|
-
declare type SlotKind = 'start' | 'end' | 'addTrigger' | 'triggerFixed' | 'userTask' | 'addStep' | 'filter' | 'approval';
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Start event — a fixed skeleton node with no user-editable form.
|
|
269
|
-
* The canvas seeds it as the literal slot id `'start'` (see buildInitialSlots
|
|
270
|
-
* in WorkflowCanvas.tsx). This descriptor exists so the registry can resolve
|
|
271
|
-
* that id via `forId('start')` and emit it during descriptor-driven BPMN save.
|
|
272
|
-
*
|
|
273
|
-
* Inherits formSchema (none) and bpmnEntry/bpmnExit from the base node.
|
|
274
|
-
*/
|
|
275
|
-
export declare const startEventDescriptor: NodeDescriptor;
|
|
276
|
-
|
|
277
|
-
/** Pre-built static descriptor (no dynamic workflow list). Swap for makeSubWorkflowDescriptor when you have an API. */
|
|
278
|
-
export declare const subWorkflowDescriptor: NodeDescriptor;
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Sub-Workflow node — calls another saved workflow by ID.
|
|
282
|
-
*
|
|
283
|
-
* The host app must provide `fetchWorkflowOptions` at registration time so the
|
|
284
|
-
* `workflowId` select field can populate. Inject it via the descriptor factory:
|
|
285
|
-
*
|
|
286
|
-
* import { makeSubWorkflowDescriptor } from '@miniorange/flowforge';
|
|
287
|
-
* nodeTypeRegistry.register(makeSubWorkflowDescriptor({
|
|
288
|
-
* fetchWorkflowOptions: async () => myApi.listWorkflows(),
|
|
289
|
-
* }));
|
|
290
|
-
*/
|
|
291
|
-
export declare interface SubWorkflowDescriptorOptions {
|
|
292
|
-
/** Return a list of available workflows for the workflowId select field */
|
|
293
|
-
fetchWorkflowOptions?: () => Promise<Array<{
|
|
294
|
-
label: string;
|
|
295
|
-
value: string;
|
|
296
|
-
}>>;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export declare const webhookTriggerDescriptor: NodeDescriptor;
|
|
300
|
-
|
|
301
|
-
export declare const webhookTriggerTemplate: WorkflowTemplate;
|
|
302
|
-
|
|
303
|
-
declare interface WorkflowState {
|
|
304
|
-
slots: CanvasSlot[];
|
|
305
|
-
branches: BranchMap;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
declare interface WorkflowTemplate {
|
|
309
|
-
triggerKey: string;
|
|
310
|
-
label: string;
|
|
311
|
-
description?: string;
|
|
312
|
-
icon?: ReactNode;
|
|
313
|
-
triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
|
|
314
|
-
availableTasks?: string[];
|
|
315
|
-
maxTasks?: number;
|
|
316
|
-
taskLabels?: Record<string, string>;
|
|
317
|
-
fixedNodes?: FixedNode[];
|
|
318
|
-
fixedEdges?: FixedEdge[];
|
|
319
|
-
insertionPoints?: string[];
|
|
320
|
-
source?: string;
|
|
321
|
-
product?: string;
|
|
322
|
-
/** Pre-built workflow state to clone when user selects this template */
|
|
323
|
-
skeletonState?: WorkflowState;
|
|
324
|
-
/** Tags for filtering in the template library */
|
|
325
|
-
tags?: string[];
|
|
326
|
-
/** Category grouping in the library */
|
|
327
|
-
category?: string;
|
|
328
|
-
/** Team or author that owns this template */
|
|
329
|
-
author?: string;
|
|
330
|
-
/** Relative popularity score (higher = shown first in library) */
|
|
331
|
-
popularity?: number;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export { }
|