@notmrabhi/flowforge 0.1.27 → 0.1.29
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-DlneLRLs.js → SchemaBuilderDrawer-BoNzFwsl.js} +1 -1
- package/dist/{SchemaBuilderDrawer-D-Ib5uUe.js → SchemaBuilderDrawer-DIcUsNDy.js} +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +22 -23
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +57 -2
- package/dist/form.js +2 -2
- package/dist/{index-DQZAgqcN.js → index-Bp6CzZ-y.js} +1 -1
- package/dist/{index-BYkk9npQ.js → index-CBAhKcZs.js} +1 -1
- package/dist/{index-BDUeh__D.js → index-CBvWu-fq.js} +1 -1
- package/dist/{index-yqsiFHGg.js → index-CdqkWMbb.js} +5 -5
- package/dist/{index-C6sjqV7s.js → index-Cx3f1ixi.js} +1 -1
- package/dist/{index-hrOZNB2l.js → index-DOlwEmVL.js} +2681 -2587
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +57 -2
- package/dist/index.js +50 -51
- package/dist/nodeRegistry.cjs +1 -1
- package/dist/nodeRegistry.js +543 -23
- package/dist/{templateSkeletons-BNtzXJdi.js → templateSkeletons-B812HjgI.js} +1 -1
- package/dist/{templateSkeletons-DpLE0ZiP.js → templateSkeletons-H4iJHjxv.js} +3 -3
- package/package.json +1 -1
- package/dist/index-BeZylHBB.js +0 -43
- package/dist/index-BrJBVztu.js +0 -1
- package/dist/index-CUQQVdoY.js +0 -1
- package/dist/index-Dcur-XJ9.js +0 -35
- package/dist/subWorkflowDescriptor-DYOYgBzX.js +0 -534
- package/dist/subWorkflowDescriptor-JDKi2INh.js +0 -1
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-CdqkWMbb.js"),a=require("./SchemaBuilderDrawer-DIcUsNDy.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-B812HjgI.js"),d=require("./messages-O9Tw_XXR.js"),n=require("./bpmn-CcuE2X_Q.js"),o=require("./GatewayBranchEdge-9YF32wwN.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.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ export declare interface DmnDefinition {
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
/** @deprecated Use FlowForm */
|
|
296
|
-
export declare const DynamicFormRenderer:
|
|
296
|
+
export declare const DynamicFormRenderer: default_2.ForwardRefExoticComponent<FlowFormProps & default_2.RefAttributes<FlowFormHandle>>;
|
|
297
297
|
|
|
298
298
|
/** @deprecated Use FlowFormProps */
|
|
299
299
|
export declare type DynamicFormRendererProps = FlowFormProps;
|
|
@@ -681,7 +681,31 @@ export declare interface FlowForgeTheme {
|
|
|
681
681
|
backgroundColor?: string;
|
|
682
682
|
}
|
|
683
683
|
|
|
684
|
-
export declare
|
|
684
|
+
export declare const FlowForm: default_2.ForwardRefExoticComponent<FlowFormProps & default_2.RefAttributes<FlowFormHandle>>;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Imperative API exposed via `ref` on `<FlowForm>`. Lets a host drive Save
|
|
688
|
+
* from a footer button outside the form without writing forwardRef
|
|
689
|
+
* boilerplate per-section. See README for the canonical pattern.
|
|
690
|
+
*/
|
|
691
|
+
export declare interface FlowFormHandle {
|
|
692
|
+
/**
|
|
693
|
+
* Touch every field, validate the form, and (when valid) call `onSave`
|
|
694
|
+
* with the full payload. Returns `{ isValid, values, errors }` so the
|
|
695
|
+
* caller can also branch off the result directly.
|
|
696
|
+
*/
|
|
697
|
+
save: () => Promise<SaveResult>;
|
|
698
|
+
/** Reset to initial values + clear touched/errors. */
|
|
699
|
+
reset: () => void;
|
|
700
|
+
/** Run validation and return errors without touching fields. */
|
|
701
|
+
validate: () => Promise<Record<string, unknown>>;
|
|
702
|
+
/** Push server-side errors back into formik state for display. */
|
|
703
|
+
setErrors: (errors: Record<string, unknown>) => void;
|
|
704
|
+
/** Read the current values. Includes the conditionConfig sidecar. */
|
|
705
|
+
getValues: () => Record<string, unknown>;
|
|
706
|
+
/** Programmatic write — useful for pre-filling on edit. */
|
|
707
|
+
setValues: (values: Record<string, unknown>) => void;
|
|
708
|
+
}
|
|
685
709
|
|
|
686
710
|
export declare interface FlowFormInstance {
|
|
687
711
|
values: Record<string, unknown>;
|
|
@@ -776,6 +800,24 @@ declare interface FormulaProps {
|
|
|
776
800
|
/** Active per-field condition guards. Key = field pathPrefix. */
|
|
777
801
|
conditionConfig?: ConditionConfig;
|
|
778
802
|
onConditionConfigChange?: (config: ConditionConfig) => void;
|
|
803
|
+
/**
|
|
804
|
+
* Key under `formik.values` where conditionConfig is auto-roundtripped
|
|
805
|
+
* when the host doesn't supply explicit `conditionConfig` /
|
|
806
|
+
* `onConditionConfigChange`. Defaults to `_conditionConfig`.
|
|
807
|
+
*/
|
|
808
|
+
conditionConfigKey?: string;
|
|
809
|
+
/**
|
|
810
|
+
* Called by `flowFormRef.current.save()` once validation passes.
|
|
811
|
+
* Receives the full payload (formik values incl. conditionConfig sidecar)
|
|
812
|
+
* + a meta object with `isValid` / `errors`.
|
|
813
|
+
*
|
|
814
|
+
* Available in controlled AND uncontrolled mode. In uncontrolled mode it
|
|
815
|
+
* runs in addition to `onSubmit`.
|
|
816
|
+
*/
|
|
817
|
+
onSave?: (values: Record<string, unknown>, meta: {
|
|
818
|
+
isValid: boolean;
|
|
819
|
+
errors: Record<string, unknown>;
|
|
820
|
+
}) => void;
|
|
779
821
|
}
|
|
780
822
|
|
|
781
823
|
export declare type FormulaToken = TextToken | ChipToken;
|
|
@@ -1024,6 +1066,19 @@ export declare const restApiDescriptor: NodeDescriptor;
|
|
|
1024
1066
|
|
|
1025
1067
|
export declare const RestApiNode: ({ id, data }: NodeProps) => JSX_2.Element;
|
|
1026
1068
|
|
|
1069
|
+
/**
|
|
1070
|
+
* Result of `FlowFormHandle.save()`.
|
|
1071
|
+
* - `isValid`: true when no validation errors
|
|
1072
|
+
* - `values`: the latest formik values (includes conditionConfig sidecar
|
|
1073
|
+
* under `_conditionConfig` by default, configurable via prop)
|
|
1074
|
+
* - `errors`: per-path validation errors (empty object when isValid)
|
|
1075
|
+
*/
|
|
1076
|
+
export declare interface SaveResult {
|
|
1077
|
+
isValid: boolean;
|
|
1078
|
+
values: Record<string, unknown>;
|
|
1079
|
+
errors: Record<string, unknown>;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1027
1082
|
export declare function saveWorkflowToBpmn(workflow: WorkflowState, options?: BpmnSaveOptions): string;
|
|
1028
1083
|
|
|
1029
1084
|
export declare function SchemaBuilder({ value, onChange, suggestions, label, onPayload, validate, onValidityChange, variableGroups, initialValues: initialValuesProp, initialFormulaConfig, initialConditionConfig, }: SchemaBuilderProps): JSX_2.Element;
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { D as c, F as
|
|
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-DOlwEmVL.js";
|
|
2
|
+
import { F as Y, S as G, a as J, u as K } from "./SchemaBuilderDrawer-BoNzFwsl.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,
|
|
8
|
-
import { TemplateRegistry as
|
|
9
|
-
import { F as
|
|
10
|
-
import { d as
|
|
11
|
-
import { l as
|
|
12
|
-
import { A as
|
|
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";
|
|
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-H4iJHjxv.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";
|
|
14
13
|
class s {
|
|
15
14
|
constructor() {
|
|
16
15
|
this.channels = /* @__PURE__ */ new Map();
|
|
@@ -30,49 +29,49 @@ class s {
|
|
|
30
29
|
}
|
|
31
30
|
const n = new s();
|
|
32
31
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
We as ActionNode,
|
|
33
|
+
Ae as ApprovalNode,
|
|
35
34
|
c as DynamicFormRenderer,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
Pe as EdgeWithPlusLabel,
|
|
36
|
+
ve as EndNode,
|
|
37
|
+
u as FF,
|
|
39
38
|
Y as FIELD_TYPE_OPTIONS,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
Ee as FilterNode,
|
|
40
|
+
me as FlowForgeCanvas,
|
|
41
|
+
m as FlowForgeRegistry,
|
|
43
42
|
f as FlowForm,
|
|
44
43
|
g as FormulaInput,
|
|
45
44
|
F as InfiniteSelectField,
|
|
46
45
|
U as NodeTypeRegistry,
|
|
47
|
-
|
|
46
|
+
Ce as RestApiNode,
|
|
48
47
|
G as SchemaBuilder,
|
|
49
48
|
J as SchemaBuilderDrawer,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
Ie as StartNode,
|
|
50
|
+
fe as SubWorkflowPreviewDrawer,
|
|
51
|
+
h as TablePickerField,
|
|
52
|
+
de as TemplateRegistry,
|
|
53
|
+
Be as TriggerNode,
|
|
54
|
+
b as VariablePicker,
|
|
56
55
|
k as VariablePickerProvider,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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,
|
|
65
64
|
S as buildEvaluationPayload,
|
|
66
65
|
y as buildFieldConfig,
|
|
67
66
|
x as buildFormulaPath,
|
|
68
67
|
D as buildSelectStyles,
|
|
69
68
|
N as buildValidationSchema,
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
Ve as builtInNodeTypes,
|
|
70
|
+
Z as conditionBranchDescriptor,
|
|
72
71
|
R as dataSourceRegistry,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
ye as defaultFlowForgeMessages,
|
|
73
|
+
$ as defineNode,
|
|
74
|
+
ee as endEventDescriptor,
|
|
76
75
|
W as errorTextStyle,
|
|
77
76
|
A as extractLabel,
|
|
78
77
|
P as fieldRegistry,
|
|
@@ -80,29 +79,29 @@ export {
|
|
|
80
79
|
E as helperTextStyle,
|
|
81
80
|
C as inputStyle,
|
|
82
81
|
I as isFormula,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
De as loadWorkflowFromBpmn,
|
|
83
|
+
ae as makeSubWorkflowDescriptor,
|
|
84
|
+
se as nodeTypeRegistry,
|
|
86
85
|
n as notificationChannelRegistry,
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
re as notificationDescriptor,
|
|
87
|
+
ke as offboardingSkeleton,
|
|
89
88
|
B as parseToAST,
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
oe as restApiDescriptor,
|
|
90
|
+
Ne as saveWorkflowToBpmn,
|
|
92
91
|
z as serializeAST,
|
|
93
92
|
V as serializeASTAsConfig,
|
|
94
93
|
L as serializeConditionExpressions,
|
|
95
|
-
|
|
94
|
+
te as startEventDescriptor,
|
|
96
95
|
O as stripFormulaTokens,
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
ie as subWorkflowDescriptor,
|
|
97
|
+
ce as templateRegistry,
|
|
99
98
|
q as tokenize,
|
|
100
99
|
H as unwrapFormula,
|
|
101
100
|
K as useFlowForm,
|
|
102
101
|
M as useVariablePickerContext,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
Te as userOnboardingSkeleton,
|
|
103
|
+
we as webhookIntegrationSkeleton,
|
|
104
|
+
le as webhookTriggerDescriptor,
|
|
105
|
+
ne as webhookTriggerTemplate,
|
|
107
106
|
_ as wrapFormula
|
|
108
107
|
};
|
package/dist/nodeRegistry.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;
|