@fluxo-dev/shell-workflow 1.0.0 → 25.1.2
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/README.md +7 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +9063 -0
- package/package.json +15 -7
- package/src/index.d.ts +2 -0
- package/src/lib/designer/components/action/action-card.d.ts +5 -0
- package/src/lib/designer/components/action/action-inputs.d.ts +7 -0
- package/src/lib/designer/components/action/outputs-picker.d.ts +5 -0
- package/src/lib/designer/components/action-chooser.d.ts +5 -0
- package/src/lib/designer/components/connectors/action-button.d.ts +8 -0
- package/src/lib/designer/components/connectors/action-connector-vertical-fill.d.ts +10 -0
- package/src/lib/designer/components/connectors/action-connector-vertical.d.ts +9 -0
- package/src/lib/designer/components/connectors/action-connector.d.ts +7 -0
- package/src/lib/designer/components/trigger/trigger-card.d.ts +5 -0
- package/src/lib/designer/components/trigger-chooser.d.ts +5 -0
- package/src/lib/designer/provider/workflow-designer-provider.d.ts +26 -0
- package/src/lib/designer/services/workflow-manager-interface.d.ts +13 -0
- package/src/lib/designer/services/workflow-manager.d.ts +74 -0
- package/src/lib/designer/workflow-designer.d.ts +5 -0
- package/src/lib/fluxo-module.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluxo-dev/shell-workflow",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
3
|
+
"version": "25.1.2",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"react": "^18.3.1",
|
|
6
|
+
"@mantine/core": "^7.12.2",
|
|
7
|
+
"react-router-dom": "^6.11.2",
|
|
8
|
+
"react-redux": "^8.0.5",
|
|
9
|
+
"@reduxjs/toolkit": "^1.9.1",
|
|
10
|
+
"@fluxo-dev/api-client-base": "^25.1.2",
|
|
11
|
+
"@fluxo-dev/state": "^25.1.2",
|
|
12
|
+
"@fluxo-dev/ui-components": "^25.1.2"
|
|
13
|
+
},
|
|
14
|
+
"module": "./index.esm.js",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./index.esm.js",
|
|
17
|
+
"types": "./index.esm.d.ts"
|
|
10
18
|
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WorkflowAction } from "@fluxo-dev/api-client-base";
|
|
2
|
+
export interface ActionInputsProps {
|
|
3
|
+
actionType: string;
|
|
4
|
+
action: WorkflowAction;
|
|
5
|
+
}
|
|
6
|
+
declare function ActionInputs(props: ActionInputsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ActionInputs;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ActionButtonProps {
|
|
2
|
+
disableBranch: boolean;
|
|
3
|
+
parentActionId: string | 'trigger';
|
|
4
|
+
parentActionOutcome: string;
|
|
5
|
+
parallelStrategy?: 'after' | 'before' | 'in-first' | 'in-last';
|
|
6
|
+
parallelBranchId?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function ActionButton(props: ActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface IActionConnectorVerticalFillProps {
|
|
2
|
+
position: 'left' | 'right' | 'center';
|
|
3
|
+
orientation: 'start' | 'end';
|
|
4
|
+
disableButton?: boolean;
|
|
5
|
+
parentActionId: string;
|
|
6
|
+
parentActionOutcome: string;
|
|
7
|
+
parallelStrategy?: 'after' | 'before' | 'in-first' | 'in-last';
|
|
8
|
+
parallelBranchId?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function ActionConnectorVerticalFill(props: IActionConnectorVerticalFillProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ActionConnectorVerticalProps {
|
|
2
|
+
parentActionId: string;
|
|
3
|
+
parentActionOutcome: string;
|
|
4
|
+
parallelStrategy?: 'after' | 'before' | 'in-first' | 'in-last';
|
|
5
|
+
parallelBranchId?: number;
|
|
6
|
+
disableButton?: boolean;
|
|
7
|
+
disableBranch?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function ActionConnectorVertical(props: ActionConnectorVerticalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ActionConnectorProps {
|
|
2
|
+
parentActionId: string;
|
|
3
|
+
parentActionOutcome: string;
|
|
4
|
+
parallelStrategy?: 'after' | 'before' | 'in-first' | 'in-last';
|
|
5
|
+
disableBranch?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function ActionConnector(props: ActionConnectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TriggerDefinition } from "@fluxo-dev/api-client-base";
|
|
2
|
+
export interface TriggerChooserProps {
|
|
3
|
+
onTriggerSelected: (trigger: TriggerDefinition) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function TriggerChooser(props: TriggerChooserProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TriggerCategoryDefinition, TriggerDefinition, Workflow, WorkflowAction, WorkflowActionInputType } from "@fluxo-dev/api-client-base";
|
|
3
|
+
import { IWorkflowDesignerManager } from "../services/workflow-manager-interface";
|
|
4
|
+
import { ActionCategoryDefinition, ActionDefinition, ActionOutputDefinition } from "@fluxo-dev/api-client-base";
|
|
5
|
+
export interface WorkflowDesignerContextState extends IWorkflowDesignerManager {
|
|
6
|
+
workflowDefinition: Workflow | undefined;
|
|
7
|
+
openedActionId: string | undefined;
|
|
8
|
+
setOpenedAction: (actionId: string | undefined) => void;
|
|
9
|
+
workflowActionDefinitions: ActionCategoryDefinition[];
|
|
10
|
+
workflowTriggerDefinitions: TriggerCategoryDefinition[];
|
|
11
|
+
getActionDefinition: (actionType: string) => ActionDefinition | undefined;
|
|
12
|
+
findParentActions: (action: WorkflowAction) => {
|
|
13
|
+
actionId: string;
|
|
14
|
+
actionName: string;
|
|
15
|
+
outputs: ActionOutputDefinition[];
|
|
16
|
+
}[];
|
|
17
|
+
setActionInput: (actionId: string, inputPropertyName: string, inputType: WorkflowActionInputType, value: string) => void;
|
|
18
|
+
getTriggerDefinition: () => TriggerDefinition | undefined;
|
|
19
|
+
}
|
|
20
|
+
interface WorkflowDesignerContextProps {
|
|
21
|
+
children: any;
|
|
22
|
+
workflowDefinition: Workflow | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare const WorkflowDesignerCtx: React.Context<WorkflowDesignerContextState | null>;
|
|
25
|
+
export declare function WorkflowDesignerProvider(props: WorkflowDesignerContextProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Workflow, WorkflowAction, WorkflowTrigger } from "@fluxo-dev/api-client-base";
|
|
2
|
+
export interface IWorkflowDesignerManager {
|
|
3
|
+
load(workflowDefinition: Workflow): void;
|
|
4
|
+
createEmptyWorkflow(id: string, name: string, description: string, version: number, trigger: WorkflowTrigger): void;
|
|
5
|
+
findActionById(actionId: string): WorkflowAction | undefined;
|
|
6
|
+
addParallelAction(parentActionId: string, parallelAction: WorkflowAction): void;
|
|
7
|
+
addAction(actionToAdd: WorkflowAction, outcome: string, parentActionId: string, parallelStrategy?: 'after' | 'before' | 'in-first' | 'in-last', parallelBranchIndex?: number): void;
|
|
8
|
+
setTrigger(trigger: WorkflowTrigger): void;
|
|
9
|
+
addFirstAction(actionToAdd: WorkflowAction): void;
|
|
10
|
+
removeAction(actionToRemoveId: string): void;
|
|
11
|
+
findParentAction(childActionId: string): WorkflowAction | undefined;
|
|
12
|
+
searchLastNextActionRecursively(action: WorkflowAction, outcome: string): WorkflowAction;
|
|
13
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { IWorkflowDesignerManager } from "./workflow-manager-interface";
|
|
2
|
+
import { Workflow, WorkflowAction, WorkflowActionInputType, WorkflowTrigger } from "@fluxo-dev/api-client-base";
|
|
3
|
+
export declare class WorkflowDesignerManager implements IWorkflowDesignerManager {
|
|
4
|
+
private _workflowDefinition;
|
|
5
|
+
private _mode;
|
|
6
|
+
get workflowDefinition(): Workflow | undefined;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Carica un workflow
|
|
10
|
+
* @param workflowDefinition workflow da caricare
|
|
11
|
+
*/
|
|
12
|
+
load(workflowDefinition: Workflow): void;
|
|
13
|
+
/**
|
|
14
|
+
* Crea un nuovo workflow vuoto
|
|
15
|
+
* @param id Id dell'assemblato
|
|
16
|
+
* @param name Nome del workflow
|
|
17
|
+
* @param description Descrizione del workflow
|
|
18
|
+
* @param version Versione del workflow
|
|
19
|
+
* @param firstAction Azione principale del workflow (Trigger)
|
|
20
|
+
*/
|
|
21
|
+
createEmptyWorkflow(id: string, name: string, description: string, version: number, trigger: WorkflowTrigger): void;
|
|
22
|
+
/**
|
|
23
|
+
* Attraversa l'albero partendo dalla prima azione, salva gli ids di tutte le azioni traversate finchè non trova l'azione con l'id specificato
|
|
24
|
+
* @param startAction Azione da cui iniziare la ricerca
|
|
25
|
+
* @param targetAction Azione da cercare
|
|
26
|
+
*/
|
|
27
|
+
findParentActions(startAction: WorkflowAction, targetAction: WorkflowAction): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Ricerca un'azione ricorsivamente grazie al suo id all'interno dell'albero del Workflow. Cerca prima nell'azione principale e poi nelle azioni parallele e nelle nextActions
|
|
30
|
+
* @param actionId id dell'azione da cercare
|
|
31
|
+
* @param startAction
|
|
32
|
+
*/
|
|
33
|
+
findActionById(actionId: string, startAction?: WorkflowAction | undefined): WorkflowAction | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Aggiunge un'azione parallela all'azione padre
|
|
36
|
+
* @param parentActionId id dell'azione padre
|
|
37
|
+
* @param parallelAction azione parallela da aggiungere
|
|
38
|
+
*/
|
|
39
|
+
addParallelAction(parentActionId: string, parallelAction: WorkflowAction): void;
|
|
40
|
+
addFirstAction(actionToAdd: WorkflowAction): void;
|
|
41
|
+
setTrigger(trigger: WorkflowTrigger): void;
|
|
42
|
+
/**
|
|
43
|
+
* Aggiunge un'azione al workflow
|
|
44
|
+
* @param actionToAdd azione da aggiungere
|
|
45
|
+
* @param outcome outcome dell'azione padre
|
|
46
|
+
* @param parentActionId id dell'azione padre
|
|
47
|
+
* @param parallelStrategy eventuale strategia di inserimento dell'azione parallela
|
|
48
|
+
* @param parallelBranchIndex eventuale indice del branch parallelo in cui inserire l'azione
|
|
49
|
+
*/
|
|
50
|
+
addAction(actionToAdd: WorkflowAction, outcome: string, parentActionId: string, parallelStrategy?: 'after' | 'before' | 'in-first' | 'in-last', parallelBranchIndex?: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* Cerca l'ultima azione figlia partendo da un'azione padre
|
|
53
|
+
* @param action child action
|
|
54
|
+
* @param outcome
|
|
55
|
+
*/
|
|
56
|
+
searchLastNextActionRecursively(action: WorkflowAction, outcome?: string): WorkflowAction;
|
|
57
|
+
/**
|
|
58
|
+
* Rimuove un'azione dal workflow
|
|
59
|
+
* @param actionToRemoveId id dell'azione da rimuovere
|
|
60
|
+
*/
|
|
61
|
+
removeAction(actionToRemoveId: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Ricerca l'azione padre di un'azione
|
|
64
|
+
* @param childActionId id dell'azione figlia
|
|
65
|
+
*/
|
|
66
|
+
findParentAction(childActionId: string): WorkflowAction | undefined;
|
|
67
|
+
setActionInput(actionId: string, inputPropertyName: string, inputType: WorkflowActionInputType, value: string): void;
|
|
68
|
+
private findActionRecursive;
|
|
69
|
+
private removeSimpleAction;
|
|
70
|
+
private removeCustomOutcomeAction;
|
|
71
|
+
private removeParallelBranch;
|
|
72
|
+
private getActionCustomOutcomeParent;
|
|
73
|
+
private findParentActionRecursive;
|
|
74
|
+
}
|