@rytass/bpm-core-shared 0.5.0 → 0.5.1
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/CHANGELOG.md +10 -0
- package/package.json +3 -2
- package/src/index.js +13 -0
- package/src/index.js.map +1 -0
- package/src/lib/condition.d.ts +43 -0
- package/src/lib/condition.js +3 -0
- package/src/lib/condition.js.map +1 -0
- package/src/lib/form.d.ts +48 -0
- package/src/lib/form.js +3 -0
- package/src/lib/form.js.map +1 -0
- package/src/lib/identity.d.ts +24 -0
- package/src/lib/identity.js +3 -0
- package/src/lib/identity.js.map +1 -0
- package/src/lib/organization.d.ts +47 -0
- package/src/lib/organization.js +3 -0
- package/src/lib/organization.js.map +1 -0
- package/src/lib/status.d.ts +7 -0
- package/src/lib/status.js +3 -0
- package/src/lib/status.js.map +1 -0
- package/src/lib/workflow-command.d.ts +156 -0
- package/src/lib/workflow-command.js +292 -0
- package/src/lib/workflow-command.js.map +1 -0
- package/src/lib/workflow-graph.d.ts +96 -0
- package/src/lib/workflow-graph.js +605 -0
- package/src/lib/workflow-graph.js.map +1 -0
- package/src/lib/workflow-toolset.d.ts +105 -0
- package/src/lib/workflow-toolset.js +702 -0
- package/src/lib/workflow-toolset.js.map +1 -0
- package/src/lib/workflow.d.ts +160 -0
- package/src/lib/workflow.js +3 -0
- package/src/lib/workflow.js.map +1 -0
- package/eslint.config.mjs +0 -19
- package/jest.config.cts +0 -10
- package/project.json +0 -49
- package/src/lib/condition.ts +0 -55
- package/src/lib/form.ts +0 -77
- package/src/lib/identity.ts +0 -25
- package/src/lib/organization.ts +0 -52
- package/src/lib/shared.spec.ts +0 -13
- package/src/lib/status.ts +0 -29
- package/src/lib/workflow-command.spec.ts +0 -278
- package/src/lib/workflow-command.ts +0 -848
- package/src/lib/workflow-graph.ts +0 -974
- package/src/lib/workflow-toolset.spec.ts +0 -230
- package/src/lib/workflow-toolset.ts +0 -1083
- package/src/lib/workflow.ts +0 -216
- package/tsconfig.json +0 -23
- package/tsconfig.lib.json +0 -16
- package/tsconfig.spec.json +0 -16
- /package/src/{index.ts → index.d.ts} +0 -0
package/src/lib/workflow.ts
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
export interface WorkflowDefinition {
|
|
2
|
-
readonly edges: readonly WorkflowEdge[];
|
|
3
|
-
readonly meta: WorkflowDefinitionMeta;
|
|
4
|
-
readonly nodes: readonly WorkflowNode[];
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface WorkflowDefinitionMeta {
|
|
8
|
-
readonly diagramVersion?: string;
|
|
9
|
-
readonly schemaVersion: 1;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type WorkflowNode =
|
|
13
|
-
| StartEventNode
|
|
14
|
-
| EndEventNode
|
|
15
|
-
| UserTaskNode
|
|
16
|
-
| ServiceTaskNode
|
|
17
|
-
| ExclusiveGatewayNode
|
|
18
|
-
| ParallelGatewayNode;
|
|
19
|
-
|
|
20
|
-
export interface NodePosition {
|
|
21
|
-
readonly x: number;
|
|
22
|
-
readonly y: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface BaseNodeData {
|
|
26
|
-
readonly label: string;
|
|
27
|
-
readonly triggerMode?: WorkflowNodeTriggerMode;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type WorkflowNodeTriggerMode = 'AND' | 'OR';
|
|
31
|
-
|
|
32
|
-
export interface BaseWorkflowNode<
|
|
33
|
-
TType extends string,
|
|
34
|
-
TData extends BaseNodeData,
|
|
35
|
-
> {
|
|
36
|
-
readonly data: TData;
|
|
37
|
-
readonly id: string;
|
|
38
|
-
readonly position: NodePosition;
|
|
39
|
-
readonly type: TType;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type StartEventNode = BaseWorkflowNode<'startEvent', BaseNodeData>;
|
|
43
|
-
|
|
44
|
-
export type EndEventNode = BaseWorkflowNode<
|
|
45
|
-
'endEvent',
|
|
46
|
-
BaseNodeData & {
|
|
47
|
-
readonly endState?: 'APPROVED' | 'REJECTED';
|
|
48
|
-
}
|
|
49
|
-
>;
|
|
50
|
-
|
|
51
|
-
export type UserTaskNode = BaseWorkflowNode<'userTask', UserTaskNodeData>;
|
|
52
|
-
|
|
53
|
-
export interface UserTaskNodeData extends BaseNodeData {
|
|
54
|
-
readonly allowAddSigner: boolean;
|
|
55
|
-
readonly allowReject: boolean;
|
|
56
|
-
readonly allowTransfer: boolean;
|
|
57
|
-
readonly approverResolver: ApproverResolver;
|
|
58
|
-
readonly decisionPolicy: DecisionPolicy;
|
|
59
|
-
readonly description?: string;
|
|
60
|
-
readonly entryCondition?: string;
|
|
61
|
-
readonly fieldPermissions?: readonly FieldPermission[];
|
|
62
|
-
readonly notification?: NotificationOverride;
|
|
63
|
-
readonly returnBehavior: ReturnBehavior;
|
|
64
|
-
readonly sla?: SlaConfig;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type ApproverResolver =
|
|
68
|
-
| { readonly memberIds: readonly string[]; readonly type: 'DIRECT' }
|
|
69
|
-
| { readonly positionId: string; readonly type: 'POSITION' }
|
|
70
|
-
| {
|
|
71
|
-
readonly includeDescendants?: boolean;
|
|
72
|
-
readonly orgUnitId: string;
|
|
73
|
-
readonly type: 'ORG_UNIT_MEMBER';
|
|
74
|
-
}
|
|
75
|
-
| {
|
|
76
|
-
readonly includeDescendants?: boolean;
|
|
77
|
-
readonly orgUnitId: string;
|
|
78
|
-
readonly positionId: string;
|
|
79
|
-
readonly type: 'ORG_UNIT_POSITION';
|
|
80
|
-
}
|
|
81
|
-
| {
|
|
82
|
-
readonly baseFromInitiator: boolean;
|
|
83
|
-
readonly fallback?: ApproverResolverFallback;
|
|
84
|
-
readonly levelsUp: number;
|
|
85
|
-
readonly type: 'ORG_MANAGER';
|
|
86
|
-
}
|
|
87
|
-
| {
|
|
88
|
-
readonly fallback?: ApproverResolverFallback;
|
|
89
|
-
readonly orgUnitId: string;
|
|
90
|
-
readonly type: 'ORG_UNIT_MANAGER';
|
|
91
|
-
}
|
|
92
|
-
| { readonly formPath: string; readonly type: 'DYNAMIC_FORM' }
|
|
93
|
-
| { readonly expression: string; readonly type: 'EXPRESSION' };
|
|
94
|
-
|
|
95
|
-
export type ApproverResolverFallback =
|
|
96
|
-
| { readonly type: 'NONE' }
|
|
97
|
-
| {
|
|
98
|
-
readonly allowInitiatorSelfApproval?: boolean;
|
|
99
|
-
readonly memberId: string;
|
|
100
|
-
readonly type: 'DIRECT';
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export type DecisionPolicy =
|
|
104
|
-
| { readonly type: 'SINGLE' }
|
|
105
|
-
| { readonly type: 'SEQUENTIAL' }
|
|
106
|
-
| { readonly type: 'PARALLEL_ALL' }
|
|
107
|
-
| { readonly type: 'PARALLEL_ANY' }
|
|
108
|
-
| {
|
|
109
|
-
readonly threshold: number;
|
|
110
|
-
readonly thresholdType: 'COUNT' | 'PERCENTAGE';
|
|
111
|
-
readonly type: 'QUORUM';
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export interface ReturnBehavior {
|
|
115
|
-
readonly allowReturn: boolean;
|
|
116
|
-
readonly allowedTargets: 'PREVIOUS' | 'INITIATOR' | 'ANY';
|
|
117
|
-
readonly resubmitStrategy?: ReturnResubmitStrategy;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export type ReturnResubmitStrategy = 'FROM_RETURN_POINT' | 'RESTART';
|
|
121
|
-
|
|
122
|
-
export interface SlaConfig {
|
|
123
|
-
readonly duration: string;
|
|
124
|
-
readonly escalateLevelsUp?: number;
|
|
125
|
-
readonly onTimeout:
|
|
126
|
-
| 'REMIND'
|
|
127
|
-
| 'AUTO_APPROVE'
|
|
128
|
-
| 'ESCALATE'
|
|
129
|
-
| 'TERMINATE_INSTANCE';
|
|
130
|
-
readonly warningAt?: number;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface FieldPermission {
|
|
134
|
-
readonly editable: boolean;
|
|
135
|
-
readonly fieldPath: string;
|
|
136
|
-
readonly visible: boolean;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export interface NotificationOverride {
|
|
140
|
-
readonly channels?: readonly NotificationChannel[];
|
|
141
|
-
readonly customTemplate?: string;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export type NotificationChannel = 'IN_APP' | 'EMAIL' | 'WEBHOOK';
|
|
145
|
-
|
|
146
|
-
export type ServiceTaskNode = BaseWorkflowNode<
|
|
147
|
-
'serviceTask',
|
|
148
|
-
BaseNodeData & {
|
|
149
|
-
readonly action: ServiceAction;
|
|
150
|
-
readonly entryCondition?: string;
|
|
151
|
-
}
|
|
152
|
-
>;
|
|
153
|
-
|
|
154
|
-
export type ServiceAction =
|
|
155
|
-
| {
|
|
156
|
-
readonly channels: readonly Exclude<NotificationChannel, 'WEBHOOK'>[];
|
|
157
|
-
readonly recipients: ApproverResolver;
|
|
158
|
-
readonly template?: string;
|
|
159
|
-
readonly type: 'NOTIFY';
|
|
160
|
-
}
|
|
161
|
-
| {
|
|
162
|
-
readonly headers?: Readonly<Record<string, string>>;
|
|
163
|
-
readonly payload?: string;
|
|
164
|
-
readonly type: 'WEBHOOK';
|
|
165
|
-
readonly url: string;
|
|
166
|
-
}
|
|
167
|
-
| {
|
|
168
|
-
readonly fieldPath: string;
|
|
169
|
-
readonly type: 'SET_FORM_FIELD';
|
|
170
|
-
readonly value: string;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export type ExclusiveGatewayNode = BaseWorkflowNode<
|
|
174
|
-
'exclusiveGateway',
|
|
175
|
-
BaseNodeData & {
|
|
176
|
-
readonly direction: GatewayDirection;
|
|
177
|
-
}
|
|
178
|
-
>;
|
|
179
|
-
|
|
180
|
-
export type ParallelGatewayNode = BaseWorkflowNode<
|
|
181
|
-
'parallelGateway',
|
|
182
|
-
BaseNodeData & {
|
|
183
|
-
readonly direction: GatewayDirection;
|
|
184
|
-
}
|
|
185
|
-
>;
|
|
186
|
-
|
|
187
|
-
export type GatewayDirection = 'split' | 'join';
|
|
188
|
-
|
|
189
|
-
export interface WorkflowEdge {
|
|
190
|
-
readonly data: WorkflowEdgeData;
|
|
191
|
-
readonly id: string;
|
|
192
|
-
readonly source: string;
|
|
193
|
-
readonly sourceHandle?: string | null;
|
|
194
|
-
readonly target: string;
|
|
195
|
-
readonly targetHandle?: string | null;
|
|
196
|
-
readonly type?: 'smoothstep';
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface WorkflowEdgeData {
|
|
200
|
-
readonly condition?: string;
|
|
201
|
-
readonly conditionFieldKey?: string;
|
|
202
|
-
readonly conditionOperator?: WorkflowEdgeConditionOperator;
|
|
203
|
-
readonly conditionValue?: string;
|
|
204
|
-
readonly isDefault?: boolean;
|
|
205
|
-
readonly label?: string;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export type WorkflowEdgeConditionOperator =
|
|
209
|
-
| 'EQUALS'
|
|
210
|
-
| 'GREATER_THAN'
|
|
211
|
-
| 'GREATER_THAN_OR_EQUALS'
|
|
212
|
-
| 'IS_EMPTY'
|
|
213
|
-
| 'IS_FILLED'
|
|
214
|
-
| 'LESS_THAN'
|
|
215
|
-
| 'LESS_THAN_OR_EQUALS'
|
|
216
|
-
| 'NOT_EQUALS';
|
package/tsconfig.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"forceConsistentCasingInFileNames": true,
|
|
6
|
-
"strict": true,
|
|
7
|
-
"importHelpers": true,
|
|
8
|
-
"noImplicitOverride": true,
|
|
9
|
-
"noImplicitReturns": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true,
|
|
11
|
-
"noPropertyAccessFromIndexSignature": true
|
|
12
|
-
},
|
|
13
|
-
"files": [],
|
|
14
|
-
"include": [],
|
|
15
|
-
"references": [
|
|
16
|
-
{
|
|
17
|
-
"path": "./tsconfig.lib.json"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"path": "./tsconfig.spec.json"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"outDir": "../../dist/out-tsc",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"types": ["node"]
|
|
8
|
-
},
|
|
9
|
-
"include": ["src/**/*.ts"],
|
|
10
|
-
"exclude": [
|
|
11
|
-
"jest.config.ts",
|
|
12
|
-
"jest.config.cts",
|
|
13
|
-
"src/**/*.spec.ts",
|
|
14
|
-
"src/**/*.test.ts"
|
|
15
|
-
]
|
|
16
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"moduleResolution": "node10",
|
|
7
|
-
"types": ["jest", "node"]
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"jest.config.ts",
|
|
11
|
-
"jest.config.cts",
|
|
12
|
-
"src/**/*.test.ts",
|
|
13
|
-
"src/**/*.spec.ts",
|
|
14
|
-
"src/**/*.d.ts"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
File without changes
|