@notmrabhi/flowforge 0.1.28 → 0.1.30

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/index.js CHANGED
@@ -1,15 +1,16 @@
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-Bq_V61R9.js";
2
- import { F as Y, S as G, a as J, u as K } from "./SchemaBuilderDrawer-BV83LksA.js";
1
+ import { D as c, F as m, a as u, b as f, c as g, I as F, T as b, V as h, d as k, e as w, f as T, 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-B0u18V8x.js";
2
+ import { F as Y, S as G, a as J, u as K } from "./SchemaBuilderDrawer-Lp7zHKBy.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material";
6
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-CmHx-oga.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-Dxoy5B1A.js";
7
+ import { NodeTypeRegistry as U, nodeTypeRegistry as X } from "./index-Dcur-XJ9.js";
8
+ import { TemplateRegistry as $, templateRegistry as ee } from "./index-BeZylHBB.js";
9
+ import { F as se, S as re, F as oe, W as te, a as ie, b as le, o as ne, u as pe, w as de } from "./templateSkeletons-CxjL_Z5B.js";
10
+ import { d as me } from "./messages-CO299wPN.js";
11
+ import { l as fe, s as ge } from "./bpmn-CtfWDaOY.js";
12
+ import { A as be, b as he, E as ke, c as we, F as Te, R as Se, S as ye, T as xe, W as De, e as Ne } from "./GatewayBranchEdge-Dxoy5B1A.js";
13
+ import { b as We, c as Ae, d as Pe, e as ve, m as Ee, n as Ce, r as Ie, s as Be, a as ze, w as Ve, f as Le } from "./subWorkflowDescriptor-DYOYgBzX.js";
13
14
  class s {
14
15
  constructor() {
15
16
  this.channels = /* @__PURE__ */ new Map();
@@ -29,49 +30,49 @@ class s {
29
30
  }
30
31
  const n = new s();
31
32
  export {
32
- We as ActionNode,
33
- Ae as ApprovalNode,
33
+ be as ActionNode,
34
+ he as ApprovalNode,
34
35
  c as DynamicFormRenderer,
35
- Pe as EdgeWithPlusLabel,
36
- ve as EndNode,
37
- u as FF,
36
+ ke as EdgeWithPlusLabel,
37
+ we as EndNode,
38
+ m as FF,
38
39
  Y as FIELD_TYPE_OPTIONS,
39
- Ee as FilterNode,
40
- me as FlowForgeCanvas,
41
- m as FlowForgeRegistry,
40
+ Te as FilterNode,
41
+ se as FlowForgeCanvas,
42
+ u as FlowForgeRegistry,
42
43
  f as FlowForm,
43
44
  g as FormulaInput,
44
45
  F as InfiniteSelectField,
45
46
  U as NodeTypeRegistry,
46
- Ce as RestApiNode,
47
+ Se as RestApiNode,
47
48
  G as SchemaBuilder,
48
49
  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,
50
+ ye as StartNode,
51
+ re as SubWorkflowPreviewDrawer,
52
+ b as TablePickerField,
53
+ $ as TemplateRegistry,
54
+ xe as TriggerNode,
55
+ h as VariablePicker,
55
56
  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,
57
+ De as WebhookTriggerNode,
58
+ oe as WorkflowCanvas,
59
+ te as WorkflowExecutionHistory,
60
+ ie as WorkflowTemplateLibrary,
61
+ le as accessRequestSkeleton,
62
+ w as astHasRefs,
63
+ T as astToTokens,
64
+ We as baseNodeDefaults,
64
65
  S as buildEvaluationPayload,
65
66
  y as buildFieldConfig,
66
67
  x as buildFormulaPath,
67
68
  D as buildSelectStyles,
68
69
  N as buildValidationSchema,
69
- Ve as builtInNodeTypes,
70
- Z as conditionBranchDescriptor,
70
+ Ne as builtInNodeTypes,
71
+ Ae as conditionBranchDescriptor,
71
72
  R as dataSourceRegistry,
72
- ye as defaultFlowForgeMessages,
73
- $ as defineNode,
74
- ee as endEventDescriptor,
73
+ me as defaultFlowForgeMessages,
74
+ Pe as defineNode,
75
+ ve as endEventDescriptor,
75
76
  W as errorTextStyle,
76
77
  A as extractLabel,
77
78
  P as fieldRegistry,
@@ -79,29 +80,29 @@ export {
79
80
  E as helperTextStyle,
80
81
  C as inputStyle,
81
82
  I as isFormula,
82
- De as loadWorkflowFromBpmn,
83
- ae as makeSubWorkflowDescriptor,
84
- se as nodeTypeRegistry,
83
+ fe as loadWorkflowFromBpmn,
84
+ Ee as makeSubWorkflowDescriptor,
85
+ X as nodeTypeRegistry,
85
86
  n as notificationChannelRegistry,
86
- re as notificationDescriptor,
87
- ke as offboardingSkeleton,
87
+ Ce as notificationDescriptor,
88
+ ne as offboardingSkeleton,
88
89
  B as parseToAST,
89
- oe as restApiDescriptor,
90
- Ne as saveWorkflowToBpmn,
90
+ Ie as restApiDescriptor,
91
+ ge as saveWorkflowToBpmn,
91
92
  z as serializeAST,
92
93
  V as serializeASTAsConfig,
93
94
  L as serializeConditionExpressions,
94
- te as startEventDescriptor,
95
+ Be as startEventDescriptor,
95
96
  O as stripFormulaTokens,
96
- ie as subWorkflowDescriptor,
97
- ce as templateRegistry,
97
+ ze as subWorkflowDescriptor,
98
+ ee as templateRegistry,
98
99
  q as tokenize,
99
100
  H as unwrapFormula,
100
101
  K as useFlowForm,
101
102
  M as useVariablePickerContext,
102
- Te as userOnboardingSkeleton,
103
- we as webhookIntegrationSkeleton,
104
- le as webhookTriggerDescriptor,
105
- ne as webhookTriggerTemplate,
103
+ pe as userOnboardingSkeleton,
104
+ de as webhookIntegrationSkeleton,
105
+ Ve as webhookTriggerDescriptor,
106
+ Le as webhookTriggerTemplate,
106
107
  _ as wrapFormula
107
108
  };
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./subWorkflowDescriptor-JDKi2INh.js");class o{constructor(){this.descriptors=new Map}register(r){return this.descriptors.set(r.type,r),this}forType(r){return this.descriptors.get(r)}forId(r){for(const t of this.descriptors.values())if(t.matches(r))return t}list(){return[...this.descriptors.values()]}}const s=new o;exports.baseNodeDefaults=e.baseNodeDefaults;exports.conditionBranchDescriptor=e.conditionBranchDescriptor;exports.defineNode=e.defineNode;exports.endEventDescriptor=e.endEventDescriptor;exports.makeSubWorkflowDescriptor=e.makeSubWorkflowDescriptor;exports.notificationDescriptor=e.notificationDescriptor;exports.restApiDescriptor=e.restApiDescriptor;exports.startEventDescriptor=e.startEventDescriptor;exports.subWorkflowDescriptor=e.subWorkflowDescriptor;exports.webhookTriggerDescriptor=e.webhookTriggerDescriptor;exports.webhookTriggerTemplate=e.webhookTriggerTemplate;exports.NodeTypeRegistry=o;exports.nodeTypeRegistry=s;