@notmrabhi/flowforge 0.1.17 → 0.1.19
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-D14R1O1M.js → SchemaBuilderDrawer-157p-2Vj.js} +1 -1
- package/dist/{SchemaBuilderDrawer-jbSe-O-O.js → SchemaBuilderDrawer-Wje7pVrn.js} +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +2 -2
- package/dist/{index-CxVqPygT.js → index-BU09HbVh.js} +11 -5
- package/dist/{index-BWAxupnf.js → index-CQ0cVcHp.js} +1 -1
- package/dist/{index-C0Eu9PxA.js → index-Codx5QwP.js} +1 -1
- package/dist/{index-DZOcYc5S.js → index-Da5NHCS2.js} +1 -1
- package/dist/{index-DNZlQp9z.js → index-a1IOaYsW.js} +1 -1
- package/dist/{index-DLSkW4rA.js → index-a3QMaedZ.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/nodeRegistry.cjs +1 -1
- package/dist/nodeRegistry.js +30 -13
- package/dist/{templateSkeletons-BXebwps_.js → templateSkeletons-CQec51xm.js} +338 -330
- package/dist/{templateSkeletons-S_rxSXbs.js → templateSkeletons-D8-v6BFH.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as Nn, G as qn } from "./index-
|
|
1
|
+
import { _ as Nn, G as qn } from "./index-BU09HbVh.js";
|
|
2
2
|
import { useState as ae, useLayoutEffect as Vn, useEffect as ce, forwardRef as Hn, useRef as Un, useImperativeHandle as zn, useCallback as Gn } from "react";
|
|
3
3
|
import { E as m, b as x, Q as Pt, U as Ft, X as Ae, S as et, T as Ve, F as ge, e as Re, Y as tt, j as Nt, i as nt, Z as te, _, d as F, $ as Kn, a0 as $n, A as rt, r as $e, n as Jn, a1 as Je, m as qt, a2 as it, a3 as _n, a4 as Vt, P as Qn, c as jn, a as Yn, V as Ht, D as v, a5 as ue, a6 as Ut, f as Zn, C as T, a7 as b, a8 as Xn, a9 as er, W as tr, aa as nr, ab as rr, ac as ir, ad as or, ae as sr, af as lr, ag as ar, ah as cr, ai as zt, aj as hr, ak as ur, al as fr, am as dr, k as Gt, an as mr, ao as gr, v as f, ap as pr } from "./index-BnzttJ4w.js";
|
|
4
4
|
import { aq as Xo, ar as es, as as ts, at as ns, au as rs, av as is, aw as os, ax as ss, M as ls, ay as as, az as cs, R as hs, h as us, aA as fs, aB as ds, aC as ms, aD as gs, aE as ps, g as ys, aF as ks, aG as xs, aH as Ss, aI as bs, aJ as Cs, aK as vs, aL as Ms, l as As, s as Ls } from "./index-BnzttJ4w.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-a1IOaYsW.js"),a=require("./SchemaBuilderDrawer-Wje7pVrn.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");const r=require("./nodeRegistry.cjs"),l=require("./templateRegistry.cjs"),i=require("./templateSkeletons-D8-v6BFH.js"),d=require("./messages-O9Tw_XXR.js"),n=require("./bpmn-CcuE2X_Q.js"),o=require("./GatewayBranchEdge-mRo5aZ3f.js");class u{constructor(){this.channels=new Map}register(t,s){this.channels.set(t,s)}get(t){return this.channels.get(t)}list(){return Array.from(this.channels.entries()).map(([t,s])=>({key:t,...s}))}has(t){return this.channels.has(t)}}const c=new u;exports.DynamicFormRenderer=e.DynamicFormRenderer;exports.FF=e.FF;exports.FlowForgeRegistry=e.FlowForgeRegistry;exports.FlowForm=e.FlowForm;exports.FormulaInput=e.FormulaInput;exports.InfiniteSelectField=e.InfiniteSelectField;exports.TablePickerField=e.TablePickerField;exports.VariablePicker=e.VariablePicker;exports.VariablePickerProvider=e.VariablePickerProvider;exports.astHasRefs=e.astHasRefs;exports.astToTokens=e.astToTokens;exports.buildEvaluationPayload=e.buildEvaluationPayload;exports.buildFieldConfig=e.buildFieldConfig;exports.buildFormulaPath=e.buildFormulaPath;exports.buildSelectStyles=e.buildSelectStyles;exports.buildValidationSchema=e.buildValidationSchema;exports.dataSourceRegistry=e.dataSourceRegistry;exports.errorTextStyle=e.errorTextStyle;exports.extractLabel=e.extractLabel;exports.fieldRegistry=e.fieldRegistry;exports.hasFormulaTokens=e.hasFormulaTokens;exports.helperTextStyle=e.helperTextStyle;exports.inputStyle=e.inputStyle;exports.isFormula=e.isFormula;exports.parseToAST=e.parseToAST;exports.serializeAST=e.serializeAST;exports.serializeASTAsConfig=e.serializeASTAsConfig;exports.serializeConditionExpressions=e.serializeConditionExpressions;exports.stripFormulaTokens=e.stripFormulaTokens;exports.tokenize=e.tokenize;exports.unwrapFormula=e.unwrapFormula;exports.useVariablePickerContext=e.useVariablePickerContext;exports.wrapFormula=e.wrapFormula;exports.FIELD_TYPE_OPTIONS=a.FIELD_TYPE_OPTIONS;exports.SchemaBuilder=a.SchemaBuilder;exports.SchemaBuilderDrawer=a.SchemaBuilderDrawer;exports.useFlowForm=a.useFlowForm;exports.NodeTypeRegistry=r.NodeTypeRegistry;exports.baseNodeDefaults=r.baseNodeDefaults;exports.conditionBranchDescriptor=r.conditionBranchDescriptor;exports.defineNode=r.defineNode;exports.endEventDescriptor=r.endEventDescriptor;exports.makeSubWorkflowDescriptor=r.makeSubWorkflowDescriptor;exports.nodeTypeRegistry=r.nodeTypeRegistry;exports.notificationDescriptor=r.notificationDescriptor;exports.restApiDescriptor=r.restApiDescriptor;exports.startEventDescriptor=r.startEventDescriptor;exports.subWorkflowDescriptor=r.subWorkflowDescriptor;exports.webhookTriggerDescriptor=r.webhookTriggerDescriptor;exports.webhookTriggerTemplate=r.webhookTriggerTemplate;exports.TemplateRegistry=l.TemplateRegistry;exports.templateRegistry=l.templateRegistry;exports.FlowForgeCanvas=i.FlowForgeCanvas;exports.SubWorkflowPreviewDrawer=i.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=i.FlowForgeCanvas;exports.WorkflowExecutionHistory=i.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=i.WorkflowTemplateLibrary;exports.accessRequestSkeleton=i.accessRequestSkeleton;exports.offboardingSkeleton=i.offboardingSkeleton;exports.userOnboardingSkeleton=i.userOnboardingSkeleton;exports.webhookIntegrationSkeleton=i.webhookIntegrationSkeleton;exports.defaultFlowForgeMessages=d.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=n.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=n.saveWorkflowToBpmn;exports.ActionNode=o.ActionNode;exports.ApprovalNode=o.ApprovalNode;exports.EdgeWithPlusLabel=o.EdgeWithPlusLabel;exports.EndNode=o.EndNode;exports.FilterNode=o.FilterNode;exports.RestApiNode=o.RestApiNode;exports.StartNode=o.StartNode;exports.TriggerNode=o.TriggerNode;exports.WebhookTriggerNode=o.WebhookTriggerNode;exports.builtInNodeTypes=o.builtInNodeTypes;exports.notificationChannelRegistry=c;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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-
|
|
2
|
-
import { F as Y, S as G, a as J, u as K } from "./SchemaBuilderDrawer-
|
|
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
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material";
|
|
6
6
|
import "react-icons/md";
|
|
7
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
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-
|
|
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-CQec51xm.js";
|
|
10
10
|
import { d as ye } from "./messages-CO299wPN.js";
|
|
11
11
|
import { l as De, s as Ne } from "./bpmn-CtfWDaOY.js";
|
|
12
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-4XMPBHne.js";
|
package/dist/nodeRegistry.cjs
CHANGED
|
@@ -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"}],f=o({type:"conditionBranch",label:"Condition Branch",icon:a.createElement(r.MdCallSplit,{size:18,color:"#512da8"}),matches:e=>e.startsWith("conditionBranch-"),reactFlowType:"conditionBranchNode",branchLabels:{branch1:"Branch 1",branch2:"Branch 2",default:"Default"},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:"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",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}))]}}),E=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=f;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=E;exports.webhookTriggerTemplate=g;
|
|
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.js
CHANGED
|
@@ -290,14 +290,15 @@ const T = r({
|
|
|
290
290
|
{ label: "ends with", value: "endsWith" },
|
|
291
291
|
{ label: "is empty", value: "isEmpty" },
|
|
292
292
|
{ label: "is not empty", value: "isNotEmpty" }
|
|
293
|
-
],
|
|
293
|
+
], q = r({
|
|
294
294
|
type: "conditionBranch",
|
|
295
295
|
label: "Condition Branch",
|
|
296
296
|
icon: a.createElement(b, { size: 18, color: "#512da8" }),
|
|
297
297
|
matches: (e) => e.startsWith("conditionBranch-"),
|
|
298
298
|
reactFlowType: "conditionBranchNode",
|
|
299
|
-
/** Initial branch labels — canvas uses these keys to initialise BranchMap on insert
|
|
300
|
-
|
|
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" },
|
|
301
302
|
formSchema: [
|
|
302
303
|
{
|
|
303
304
|
id: "title",
|
|
@@ -311,6 +312,20 @@ const T = r({
|
|
|
311
312
|
label: "Branches",
|
|
312
313
|
required: !0,
|
|
313
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
|
+
},
|
|
314
329
|
{
|
|
315
330
|
id: "key",
|
|
316
331
|
type: "text",
|
|
@@ -329,6 +344,8 @@ const T = r({
|
|
|
329
344
|
id: "conditions",
|
|
330
345
|
type: "array",
|
|
331
346
|
label: "Conditions",
|
|
347
|
+
// ELSE branches have no condition by definition — hide the array.
|
|
348
|
+
shouldHide: ({ values: e }) => e.kind === "else",
|
|
332
349
|
children: [
|
|
333
350
|
{
|
|
334
351
|
id: "field",
|
|
@@ -386,7 +403,7 @@ const T = r({
|
|
|
386
403
|
}))
|
|
387
404
|
];
|
|
388
405
|
}
|
|
389
|
-
}),
|
|
406
|
+
}), N = r({
|
|
390
407
|
type: "webhookTrigger",
|
|
391
408
|
label: "Webhook Trigger",
|
|
392
409
|
icon: a.createElement(n, { size: d, color: "#1565c0" }),
|
|
@@ -442,7 +459,7 @@ const T = r({
|
|
|
442
459
|
triggerCategory: "webhook",
|
|
443
460
|
icon: a.createElement(n, { size: d, color: "#1565c0" })
|
|
444
461
|
};
|
|
445
|
-
function
|
|
462
|
+
function E(e = {}) {
|
|
446
463
|
return r({
|
|
447
464
|
type: "subWorkflow",
|
|
448
465
|
label: "Sub-Workflow",
|
|
@@ -501,8 +518,8 @@ function f(e = {}) {
|
|
|
501
518
|
}
|
|
502
519
|
});
|
|
503
520
|
}
|
|
504
|
-
const M =
|
|
505
|
-
class
|
|
521
|
+
const M = E();
|
|
522
|
+
class f {
|
|
506
523
|
constructor() {
|
|
507
524
|
this.descriptors = /* @__PURE__ */ new Map();
|
|
508
525
|
}
|
|
@@ -520,19 +537,19 @@ class E {
|
|
|
520
537
|
return [...this.descriptors.values()];
|
|
521
538
|
}
|
|
522
539
|
}
|
|
523
|
-
const
|
|
540
|
+
const H = new f();
|
|
524
541
|
export {
|
|
525
|
-
|
|
542
|
+
f as NodeTypeRegistry,
|
|
526
543
|
m as baseNodeDefaults,
|
|
527
|
-
|
|
544
|
+
q as conditionBranchDescriptor,
|
|
528
545
|
r as defineNode,
|
|
529
546
|
v as endEventDescriptor,
|
|
530
|
-
|
|
531
|
-
|
|
547
|
+
E as makeSubWorkflowDescriptor,
|
|
548
|
+
H as nodeTypeRegistry,
|
|
532
549
|
x as notificationDescriptor,
|
|
533
550
|
S as restApiDescriptor,
|
|
534
551
|
T as startEventDescriptor,
|
|
535
552
|
M as subWorkflowDescriptor,
|
|
536
|
-
|
|
553
|
+
N as webhookTriggerDescriptor,
|
|
537
554
|
C as webhookTriggerTemplate
|
|
538
555
|
};
|