work-workflow-prods 2.0.0 → 4.0.0
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/container.svg +3 -0
- package/dist/global_add_record.svg +3 -0
- package/dist/index.css +1 -1
- package/dist/unselect_container.svg +3 -0
- package/dist/workflow.es.js +10849 -8143
- package/dist/workflow.umd.js +63 -51
- package/package.json +3 -1
- package/types/components/Form/query.d.ts +1 -0
- package/types/components/GlobalCustomNode/GlobalApprovalNode.d.ts +3 -0
- package/types/components/GlobalCustomNode/GlobalConditionNode.d.ts +3 -0
- package/types/components/GlobalCustomNode/GlobalCustomChildNode.d.ts +3 -0
- package/types/components/GlobalCustomNode/index.d.ts +1 -0
- package/types/components/GlobalWorkflow/GlobalWorkflowCanvas/GlobalDeletableEdge.d.ts +3 -0
- package/types/components/GlobalWorkflow/GlobalWorkflowCanvas/index.d.ts +11 -0
- package/types/components/GlobalWorkflow/NodeSetting/ApprovalForm/index.d.ts +6 -0
- package/types/components/GlobalWorkflow/NodeSetting/ConditionForm/index.d.ts +6 -0
- package/types/components/GlobalWorkflow/NodeSetting/CopyRecord/CopyRecordOtherWork.d.ts +9 -0
- package/types/components/GlobalWorkflow/NodeSetting/CreateDeleteRecordForm/index.d.ts +7 -0
- package/types/components/GlobalWorkflow/NodeSetting/DelayForm/index.d.ts +5 -0
- package/types/components/GlobalWorkflow/NodeSetting/MailApprovalForm/index.d.ts +6 -0
- package/types/components/GlobalWorkflow/NodeSetting/NotificationForm/NotificationFormByField.d.ts +7 -0
- package/types/components/GlobalWorkflow/NodeSetting/NotificationForm/NotificationFormByUser.d.ts +6 -0
- package/types/components/GlobalWorkflow/NodeSetting/NotificationForm/index.d.ts +4 -0
- package/types/components/GlobalWorkflow/NodeSetting/UpdateRecordForm/index.d.ts +7 -0
- package/types/components/GlobalWorkflow/NodeSetting/index.d.ts +10 -0
- package/types/components/GlobalWorkflow/SelectNodeComp/index.d.ts +7 -0
- package/types/components/GlobalWorkflow/WorkflowCanva/index.d.ts +3 -0
- package/types/components/GlobalWorkflow/WorkflowCanvas/Edges/WorkflowEdge.d.ts +3 -0
- package/types/components/GlobalWorkflow/WorkflowCanvas/Nodes/FilterNode.d.ts +3 -0
- package/types/components/GlobalWorkflow/WorkflowCanvas/Nodes/TriggerNode.d.ts +3 -0
- package/types/components/GlobalWorkflow/WorkflowCanvas/index.d.ts +3 -0
- package/types/components/GlobalWorkflow/constant.d.ts +23 -0
- package/types/components/GlobalWorkflow/index.d.ts +3 -0
- package/types/components/GlobalWorkflow/services/globalWorkflowApi.d.ts +58 -0
- package/types/components/GlobalWorkflow/services/workflowConverter.d.ts +36 -0
- package/types/components/WorkflowModal/services.d.ts +24 -0
- package/types/components/WorkflowModal/types.d.ts +4 -0
- package/types/index.d.ts +5 -1
- package/types/main.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "work-workflow-prods",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/workflow.cjs.js",
|
|
6
6
|
"module": "./dist/workflow.es.js",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@emotion/react": "^11.14.0",
|
|
32
32
|
"@emotion/styled": "^11.14.1",
|
|
33
33
|
"@mui/styled-engine": "^7.2.0",
|
|
34
|
+
"@xyflow/react": "^12.10.1",
|
|
34
35
|
"aws-amplify": "^6.15.4",
|
|
35
36
|
"axios": "^1.11.0",
|
|
36
37
|
"graphql": "^16",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"react-hook-form": "^7",
|
|
41
42
|
"reactflow": "^11.11.4",
|
|
42
43
|
"universal-cookie": "^8.0.1",
|
|
44
|
+
"uuid": "^13.0.0",
|
|
43
45
|
"work-workflow-prod": "^0.0.8"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
@@ -2,3 +2,4 @@ export declare const GET_SEARCH_ACCESS_OWNER: import("@apollo/client").DocumentN
|
|
|
2
2
|
export declare const GET_DATASET_DETAILS: import("@apollo/client").DocumentNode;
|
|
3
3
|
export declare const GET_Field_DETAILS: import("@apollo/client").DocumentNode;
|
|
4
4
|
export declare const GET_WORKSPACE_LIST: import("@apollo/client").DocumentNode;
|
|
5
|
+
export declare const GET_SEARCH_ORGANISATION_USER: import("@apollo/client").DocumentNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function GlobalCustomNode({ data }: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Node } from "reactflow";
|
|
2
|
+
declare const GlobalWorkflowCanvas: ({ edges, nodes, onNodesChange, onEdgesChange, onConnect, setNodeSettingId, onNodesDelete, }: {
|
|
3
|
+
nodes: any[];
|
|
4
|
+
edges: any[];
|
|
5
|
+
onNodesChange: any;
|
|
6
|
+
onEdgesChange: any;
|
|
7
|
+
onConnect: any;
|
|
8
|
+
setNodeSettingId: any;
|
|
9
|
+
onNodesDelete: (deleted: Node[]) => void;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default GlobalWorkflowCanvas;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const CopyRecordOtherWork: ({ nodeData, datasetId, workspaceId, targetWorkspaceId, defaultValue, updateCurrentNode, }: {
|
|
2
|
+
nodeData: any;
|
|
3
|
+
datasetId: string;
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
targetWorkspaceId: string;
|
|
6
|
+
defaultValue: any;
|
|
7
|
+
updateCurrentNode: any;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default CopyRecordOtherWork;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const CreateDeleteRecordForm: ({ updateCurrentNode, nodeData, targetWorkspaceId, isRecordUpdate, }: {
|
|
2
|
+
updateCurrentNode: any;
|
|
3
|
+
nodeData: any;
|
|
4
|
+
targetWorkspaceId: Number;
|
|
5
|
+
isRecordUpdate?: boolean;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default CreateDeleteRecordForm;
|
package/types/components/GlobalWorkflow/NodeSetting/NotificationForm/NotificationFormByField.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const NotificationFormByField: ({ nodeData, targetWorkspaceId, triggerDatasetId, updateCurrentNode, }: {
|
|
2
|
+
nodeData: any;
|
|
3
|
+
targetWorkspaceId: Number;
|
|
4
|
+
triggerDatasetId?: string;
|
|
5
|
+
updateCurrentNode: any;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default NotificationFormByField;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const UpdateRecordForm: ({ updateCurrentNode, nodeData, targetWorkspaceId, triggerDatasetId, }: {
|
|
2
|
+
updateCurrentNode: any;
|
|
3
|
+
nodeData: any;
|
|
4
|
+
targetWorkspaceId: Number;
|
|
5
|
+
triggerDatasetId?: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default UpdateRecordForm;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const NodeSetting: ({ nodes, setNodes, nodeSettingId, setNodeSettingId, workspaceId, userData, onSave, }: {
|
|
2
|
+
nodes: any[];
|
|
3
|
+
setNodes: any;
|
|
4
|
+
nodeSettingId: any;
|
|
5
|
+
setNodeSettingId: any;
|
|
6
|
+
workspaceId: Number;
|
|
7
|
+
userData: any;
|
|
8
|
+
onSave?: (nodesOverride?: any[]) => Promise<void>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default NodeSetting;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
export declare const triggerData: {
|
|
3
|
+
title: string;
|
|
4
|
+
subTitle: string;
|
|
5
|
+
image: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
data: {
|
|
7
|
+
title: string;
|
|
8
|
+
subTitle: string;
|
|
9
|
+
label: string;
|
|
10
|
+
image: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
titleImage: ({ className }: {
|
|
12
|
+
className?: String;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
type: string;
|
|
15
|
+
settingType: string;
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
export declare const actionData: {
|
|
19
|
+
title: String;
|
|
20
|
+
subTitle: String;
|
|
21
|
+
image: () => JSX.Element;
|
|
22
|
+
data: any;
|
|
23
|
+
}[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface WorkflowDefinitionPayload {
|
|
2
|
+
name: string;
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
datasetId: string;
|
|
5
|
+
triggerType: string;
|
|
6
|
+
workflowDefinition: {
|
|
7
|
+
nodes: any[];
|
|
8
|
+
edges: any[];
|
|
9
|
+
};
|
|
10
|
+
isPublished?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkflowDefinitionResponse {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
datasetId: string;
|
|
17
|
+
triggerType: string;
|
|
18
|
+
workflowDefinition: {
|
|
19
|
+
nodes: any[];
|
|
20
|
+
edges: any[];
|
|
21
|
+
};
|
|
22
|
+
isPublished: boolean;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
/** Create a new workflow definition */
|
|
28
|
+
export declare const createWorkflowDefinition: (payload: WorkflowDefinitionPayload) => Promise<WorkflowDefinitionResponse>;
|
|
29
|
+
/** Update an existing workflow definition */
|
|
30
|
+
export declare const updateWorkflowDefinition: (workspaceId: string, id: string, payload: Partial<WorkflowDefinitionPayload>) => Promise<WorkflowDefinitionResponse>;
|
|
31
|
+
/** Get all workflows for a workspace */
|
|
32
|
+
export declare const getWorkflowsByWorkspace: (workspaceId: string) => Promise<WorkflowDefinitionResponse[]>;
|
|
33
|
+
/** Get a single workflow by ID */
|
|
34
|
+
export declare const getWorkflowById: (workspaceId: string, id: string) => Promise<WorkflowDefinitionResponse>;
|
|
35
|
+
/** Delete a workflow */
|
|
36
|
+
export declare const deleteWorkflowDefinition: (workspaceId: string, id: string) => Promise<void>;
|
|
37
|
+
/** Toggle publish state */
|
|
38
|
+
export declare const publishWorkflow: (workspaceId: string, id: string, isPublished: boolean) => Promise<WorkflowDefinitionResponse>;
|
|
39
|
+
/** Manually trigger a workflow */
|
|
40
|
+
export declare const triggerWorkflow: (payload: {
|
|
41
|
+
workspaceId: string;
|
|
42
|
+
datasetId: string;
|
|
43
|
+
triggerType: string;
|
|
44
|
+
recordId: string;
|
|
45
|
+
recordData?: Record<string, any>;
|
|
46
|
+
triggeredBy?: string;
|
|
47
|
+
}) => Promise<{
|
|
48
|
+
jobId: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** Get executions for a workflow */
|
|
51
|
+
export declare const getExecutionsByWorkflow: (workspaceId: string, workflowId: string) => Promise<any[]>;
|
|
52
|
+
/** Get pending approvals for a user */
|
|
53
|
+
export declare const getPendingApprovals: (workspaceId: string, userId: string) => Promise<any[]>;
|
|
54
|
+
/** Submit approval response */
|
|
55
|
+
export declare const submitApprovalResponse: (workspaceId: string, approvalId: string, response: "yes" | "no") => Promise<{
|
|
56
|
+
success: boolean;
|
|
57
|
+
message: string;
|
|
58
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Node, Edge } from "reactflow";
|
|
2
|
+
/**
|
|
3
|
+
* Convert ReactFlow nodes + edges into a backend-compatible workflow
|
|
4
|
+
* definition JSON. Functions / JSX are stripped from node data.
|
|
5
|
+
*/
|
|
6
|
+
export declare const nodesToDefinition: (nodes: Node[], edges: Edge[]) => {
|
|
7
|
+
nodes: any[];
|
|
8
|
+
edges: any[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Restore image/titleImage functions on nodes loaded from the backend,
|
|
12
|
+
* using the constant definitions as a lookup.
|
|
13
|
+
*/
|
|
14
|
+
export declare const definitionToNodes: (definition: {
|
|
15
|
+
nodes: any[];
|
|
16
|
+
edges: any[];
|
|
17
|
+
}, triggerDataMap: Record<string, any>, actionDataMap: Record<string, any>) => {
|
|
18
|
+
nodes: Node[];
|
|
19
|
+
edges: Edge[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Build lookup maps from the triggerData / actionData arrays.
|
|
23
|
+
* Keyed by settingType for fast restoration.
|
|
24
|
+
*/
|
|
25
|
+
export declare const buildConstantMaps: (triggerData: any[], actionData: any[]) => {
|
|
26
|
+
triggerDataMap: Record<string, any>;
|
|
27
|
+
actionDataMap: Record<string, any>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Extract trigger info from nodes for the backend payload.
|
|
31
|
+
* Returns the triggerType and datasetId from the trigger node.
|
|
32
|
+
*/
|
|
33
|
+
export declare const extractTriggerInfo: (nodes: Node[]) => {
|
|
34
|
+
triggerType: string;
|
|
35
|
+
datasetId: string;
|
|
36
|
+
} | null;
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import type { Stage, WorkflowMap } from "./types";
|
|
2
2
|
import type { Edge, Node as FlowNode } from "reactflow";
|
|
3
3
|
export declare const createNodesFromStages: (stages: Stage[], startingPoint?: number) => FlowNode[];
|
|
4
|
+
export declare const createNodeForGlobal: (data: any, position?: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}) => {
|
|
8
|
+
id: string;
|
|
9
|
+
type: string;
|
|
10
|
+
position: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
data: any;
|
|
15
|
+
};
|
|
16
|
+
export declare const createChildNodeForGlobal: (data: any, position?: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}) => {
|
|
20
|
+
id: string;
|
|
21
|
+
type: string;
|
|
22
|
+
position: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
data: any;
|
|
27
|
+
};
|
|
4
28
|
export declare const autoGenerateEdges: (nodes: any[]) => {
|
|
5
29
|
id: string;
|
|
6
30
|
source: any;
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import "@style/global.scss";
|
|
2
2
|
import "reactflow/dist/style.css";
|
|
3
|
-
export type { ReactFlowModalType, MiniFlowType, FlowPreviewProps, } from "./components/WorkflowModal/types";
|
|
3
|
+
export type { ReactFlowModalType, MiniFlowType, FlowPreviewProps, GlobalWorkflowType, } from "./components/WorkflowModal/types";
|
|
4
4
|
export { default as ReactFlowModal } from "./components/WorkflowModal";
|
|
5
5
|
export { default as FieldAutomationModal } from "./components/FieldAutomationModal";
|
|
6
6
|
export { default as MiniFlow } from "./components/MiniFlow/index";
|
|
7
7
|
export { default as FlowPreview } from "./components/FlowPreview/index";
|
|
8
|
+
export { default as GlobalWorkflow } from "./components/GlobalWorkflow/index";
|
|
9
|
+
export { nodesToDefinition, definitionToNodes, buildConstantMaps, extractTriggerInfo, } from "./components/GlobalWorkflow/services/workflowConverter";
|
|
10
|
+
export type { WorkflowDefinitionPayload, WorkflowDefinitionResponse, } from "./components/GlobalWorkflow/services/globalWorkflowApi";
|
|
11
|
+
export { getPendingApprovals, submitApprovalResponse, } from "./components/GlobalWorkflow/services/globalWorkflowApi";
|
package/types/main.d.ts
CHANGED