@contractspec/example.workflow-system 3.8.9 → 3.8.10
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/approval/approval.enum.js +1 -22
- package/dist/approval/approval.event.js +1 -112
- package/dist/approval/approval.operations.js +1 -369
- package/dist/approval/approval.schema.js +1 -73
- package/dist/approval/index.js +1 -484
- package/dist/browser/approval/approval.enum.js +1 -22
- package/dist/browser/approval/approval.event.js +1 -112
- package/dist/browser/approval/approval.operations.js +1 -369
- package/dist/browser/approval/approval.schema.js +1 -73
- package/dist/browser/approval/index.js +1 -484
- package/dist/browser/docs/index.js +5 -49
- package/dist/browser/docs/workflow-system.docblock.js +5 -49
- package/dist/browser/entities/approval.js +1 -119
- package/dist/browser/entities/index.js +1 -508
- package/dist/browser/entities/instance.js +1 -161
- package/dist/browser/entities/step.js +1 -124
- package/dist/browser/entities/workflow.js +1 -82
- package/dist/browser/example.js +1 -42
- package/dist/browser/handlers/index.js +8 -253
- package/dist/browser/handlers/workflow.handlers.js +8 -253
- package/dist/browser/index.js +13 -3524
- package/dist/browser/instance/index.js +1 -677
- package/dist/browser/instance/instance.enum.js +1 -15
- package/dist/browser/instance/instance.event.js +1 -164
- package/dist/browser/instance/instance.handler.js +1 -356
- package/dist/browser/instance/instance.operations.js +1 -9
- package/dist/browser/instance/instance.schema.js +1 -101
- package/dist/browser/presentations/index.js +1 -109
- package/dist/browser/seeders/index.js +1 -3
- package/dist/browser/shared/demo-scenario.js +1 -213
- package/dist/browser/shared/index.js +1 -3
- package/dist/browser/shared/mock-data.js +1 -11
- package/dist/browser/state-machine/index.js +1 -6
- package/dist/browser/tests/operations.test-spec.js +1 -6
- package/dist/browser/ui/WorkflowDashboard.js +1 -3
- package/dist/browser/ui/WorkflowDashboard.visualizations.js +1 -239
- package/dist/browser/ui/hooks/index.js +1 -3
- package/dist/browser/ui/hooks/useWorkflowList.js +1 -52
- package/dist/browser/ui/index.js +1 -56
- package/dist/browser/ui/renderers/index.js +5 -562
- package/dist/browser/ui/renderers/workflow.markdown.js +5 -562
- package/dist/browser/visualizations/catalog.js +1 -132
- package/dist/browser/visualizations/index.js +1 -133
- package/dist/browser/visualizations/selectors.js +1 -195
- package/dist/browser/workflow/index.js +1 -21
- package/dist/browser/workflow/workflow.enum.js +1 -36
- package/dist/browser/workflow/workflow.event.js +1 -6
- package/dist/browser/workflow/workflow.handler.js +1 -5
- package/dist/browser/workflow/workflow.operations.js +1 -8
- package/dist/browser/workflow/workflow.schema.js +1 -151
- package/dist/browser/workflow-system.capability.js +1 -5
- package/dist/browser/workflow-system.feature.js +1 -3
- package/dist/docs/index.js +5 -49
- package/dist/docs/workflow-system.docblock.js +5 -49
- package/dist/entities/approval.js +1 -119
- package/dist/entities/index.js +1 -508
- package/dist/entities/instance.js +1 -161
- package/dist/entities/step.js +1 -124
- package/dist/entities/workflow.js +1 -82
- package/dist/example.js +1 -42
- package/dist/handlers/index.js +8 -253
- package/dist/handlers/workflow.handlers.js +8 -253
- package/dist/index.js +13 -3524
- package/dist/instance/index.js +1 -677
- package/dist/instance/instance.enum.js +1 -15
- package/dist/instance/instance.event.js +1 -164
- package/dist/instance/instance.handler.js +1 -356
- package/dist/instance/instance.operations.js +1 -9
- package/dist/instance/instance.schema.js +1 -101
- package/dist/presentations/index.js +1 -109
- package/dist/seeders/index.js +1 -3
- package/dist/shared/demo-scenario.js +1 -213
- package/dist/shared/index.js +1 -3
- package/dist/shared/mock-data.js +1 -11
- package/dist/state-machine/index.js +1 -6
- package/dist/tests/operations.test-spec.js +1 -6
- package/dist/ui/WorkflowDashboard.js +1 -3
- package/dist/ui/WorkflowDashboard.visualizations.js +1 -239
- package/dist/ui/hooks/index.js +1 -3
- package/dist/ui/hooks/useWorkflowList.js +1 -52
- package/dist/ui/index.js +1 -56
- package/dist/ui/renderers/index.js +5 -562
- package/dist/ui/renderers/workflow.markdown.js +5 -562
- package/dist/visualizations/catalog.js +1 -132
- package/dist/visualizations/index.js +1 -133
- package/dist/visualizations/selectors.js +1 -195
- package/dist/workflow/index.js +1 -21
- package/dist/workflow/workflow.enum.js +1 -36
- package/dist/workflow/workflow.event.js +1 -6
- package/dist/workflow/workflow.handler.js +1 -5
- package/dist/workflow/workflow.operations.js +1 -8
- package/dist/workflow/workflow.schema.js +1 -151
- package/dist/workflow-system.capability.js +1 -5
- package/dist/workflow-system.feature.js +1 -3
- package/package.json +8 -8
|
@@ -1,152 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
-
var WorkflowStatusEnum = defineEnum("WorkflowStatus", [
|
|
5
|
-
"DRAFT",
|
|
6
|
-
"ACTIVE",
|
|
7
|
-
"DEPRECATED",
|
|
8
|
-
"ARCHIVED"
|
|
9
|
-
]);
|
|
10
|
-
var TriggerTypeEnum = defineEnum("WorkflowTriggerType", [
|
|
11
|
-
"MANUAL",
|
|
12
|
-
"EVENT",
|
|
13
|
-
"SCHEDULED",
|
|
14
|
-
"API"
|
|
15
|
-
]);
|
|
16
|
-
var StepTypeEnum = defineEnum("StepType", [
|
|
17
|
-
"START",
|
|
18
|
-
"APPROVAL",
|
|
19
|
-
"TASK",
|
|
20
|
-
"CONDITION",
|
|
21
|
-
"PARALLEL",
|
|
22
|
-
"WAIT",
|
|
23
|
-
"ACTION",
|
|
24
|
-
"END"
|
|
25
|
-
]);
|
|
26
|
-
var ApprovalModeEnum = defineEnum("ApprovalMode", [
|
|
27
|
-
"ANY",
|
|
28
|
-
"ALL",
|
|
29
|
-
"MAJORITY",
|
|
30
|
-
"SEQUENTIAL"
|
|
31
|
-
]);
|
|
32
|
-
|
|
33
|
-
// src/workflow/workflow.schema.ts
|
|
34
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
35
|
-
var WorkflowStepModel = defineSchemaModel({
|
|
36
|
-
name: "WorkflowStepModel",
|
|
37
|
-
description: "A step in a workflow definition",
|
|
38
|
-
fields: {
|
|
39
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
40
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
41
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
42
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
43
|
-
type: { type: StepTypeEnum, isOptional: false },
|
|
44
|
-
position: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
45
|
-
transitions: { type: ScalarTypeEnum.JSON(), isOptional: false },
|
|
46
|
-
approvalMode: { type: ApprovalModeEnum, isOptional: true },
|
|
47
|
-
approverRoles: {
|
|
48
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
49
|
-
isArray: true,
|
|
50
|
-
isOptional: true
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var WorkflowDefinitionModel = defineSchemaModel({
|
|
55
|
-
name: "WorkflowDefinitionModel",
|
|
56
|
-
description: "A workflow definition",
|
|
57
|
-
fields: {
|
|
58
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
59
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
60
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
61
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
62
|
-
version: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
63
|
-
status: { type: WorkflowStatusEnum, isOptional: false },
|
|
64
|
-
triggerType: { type: TriggerTypeEnum, isOptional: false },
|
|
65
|
-
initialStepId: {
|
|
66
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
67
|
-
isOptional: true
|
|
68
|
-
},
|
|
69
|
-
featureFlagKey: {
|
|
70
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
71
|
-
isOptional: true
|
|
72
|
-
},
|
|
73
|
-
organizationId: {
|
|
74
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
75
|
-
isOptional: false
|
|
76
|
-
},
|
|
77
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
78
|
-
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
79
|
-
steps: { type: WorkflowStepModel, isArray: true, isOptional: true }
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var CreateWorkflowInputModel = defineSchemaModel({
|
|
83
|
-
name: "CreateWorkflowInput",
|
|
84
|
-
description: "Input for creating a workflow definition",
|
|
85
|
-
fields: {
|
|
86
|
-
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
87
|
-
key: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
88
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
89
|
-
triggerType: { type: TriggerTypeEnum, isOptional: true },
|
|
90
|
-
triggerConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
91
|
-
featureFlagKey: {
|
|
92
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
93
|
-
isOptional: true
|
|
94
|
-
},
|
|
95
|
-
settings: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
var UpdateWorkflowInputModel = defineSchemaModel({
|
|
99
|
-
name: "UpdateWorkflowInput",
|
|
100
|
-
description: "Input for updating a workflow definition",
|
|
101
|
-
fields: {
|
|
102
|
-
workflowId: {
|
|
103
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
104
|
-
isOptional: false
|
|
105
|
-
},
|
|
106
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
107
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
108
|
-
triggerType: { type: TriggerTypeEnum, isOptional: true },
|
|
109
|
-
triggerConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
110
|
-
featureFlagKey: {
|
|
111
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
112
|
-
isOptional: true
|
|
113
|
-
},
|
|
114
|
-
settings: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
var AddStepInputModel = defineSchemaModel({
|
|
118
|
-
name: "AddStepInput",
|
|
119
|
-
description: "Input for adding a step to a workflow",
|
|
120
|
-
fields: {
|
|
121
|
-
workflowId: {
|
|
122
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
123
|
-
isOptional: false
|
|
124
|
-
},
|
|
125
|
-
key: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
126
|
-
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
127
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
128
|
-
type: { type: StepTypeEnum, isOptional: false },
|
|
129
|
-
position: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
130
|
-
transitions: { type: ScalarTypeEnum.JSON(), isOptional: false },
|
|
131
|
-
approvalMode: { type: ApprovalModeEnum, isOptional: true },
|
|
132
|
-
approverRoles: {
|
|
133
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
134
|
-
isArray: true,
|
|
135
|
-
isOptional: true
|
|
136
|
-
},
|
|
137
|
-
approverUserIds: {
|
|
138
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
139
|
-
isArray: true,
|
|
140
|
-
isOptional: true
|
|
141
|
-
},
|
|
142
|
-
timeoutSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
143
|
-
slaSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
export {
|
|
147
|
-
WorkflowStepModel,
|
|
148
|
-
WorkflowDefinitionModel,
|
|
149
|
-
UpdateWorkflowInputModel,
|
|
150
|
-
CreateWorkflowInputModel,
|
|
151
|
-
AddStepInputModel
|
|
152
|
-
};
|
|
2
|
+
import{defineEnum as x}from"@contractspec/lib.schema";var D=x("WorkflowStatus",["DRAFT","ACTIVE","DEPRECATED","ARCHIVED"]),z=x("WorkflowTriggerType",["MANUAL","EVENT","SCHEDULED","API"]),B=x("StepType",["START","APPROVAL","TASK","CONDITION","PARALLEL","WAIT","ACTION","END"]),C=x("ApprovalMode",["ANY","ALL","MAJORITY","SEQUENTIAL"]);import{defineSchemaModel as q,ScalarTypeEnum as j}from"@contractspec/lib.schema";var F=q({name:"WorkflowStepModel",description:"A step in a workflow definition",fields:{id:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},name:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},type:{type:B,isOptional:!1},position:{type:j.Int_unsecure(),isOptional:!1},transitions:{type:j.JSON(),isOptional:!1},approvalMode:{type:C,isOptional:!0},approverRoles:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}}),L=q({name:"WorkflowDefinitionModel",description:"A workflow definition",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},version:{type:j.String_unsecure(),isOptional:!1},status:{type:D,isOptional:!1},triggerType:{type:z,isOptional:!1},initialStepId:{type:j.String_unsecure(),isOptional:!0},featureFlagKey:{type:j.String_unsecure(),isOptional:!0},organizationId:{type:j.String_unsecure(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1},updatedAt:{type:j.DateTime(),isOptional:!1},steps:{type:F,isArray:!0,isOptional:!0}}}),N=q({name:"CreateWorkflowInput",description:"Input for creating a workflow definition",fields:{name:{type:j.NonEmptyString(),isOptional:!1},key:{type:j.NonEmptyString(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},triggerType:{type:z,isOptional:!0},triggerConfig:{type:j.JSON(),isOptional:!0},featureFlagKey:{type:j.String_unsecure(),isOptional:!0},settings:{type:j.JSON(),isOptional:!0}}}),O=q({name:"UpdateWorkflowInput",description:"Input for updating a workflow definition",fields:{workflowId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.String_unsecure(),isOptional:!0},description:{type:j.String_unsecure(),isOptional:!0},triggerType:{type:z,isOptional:!0},triggerConfig:{type:j.JSON(),isOptional:!0},featureFlagKey:{type:j.String_unsecure(),isOptional:!0},settings:{type:j.JSON(),isOptional:!0}}}),P=q({name:"AddStepInput",description:"Input for adding a step to a workflow",fields:{workflowId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.NonEmptyString(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},type:{type:B,isOptional:!1},position:{type:j.Int_unsecure(),isOptional:!0},transitions:{type:j.JSON(),isOptional:!1},approvalMode:{type:C,isOptional:!0},approverRoles:{type:j.String_unsecure(),isArray:!0,isOptional:!0},approverUserIds:{type:j.String_unsecure(),isArray:!0,isOptional:!0},timeoutSeconds:{type:j.Int_unsecure(),isOptional:!0},slaSeconds:{type:j.Int_unsecure(),isOptional:!0}}});export{F as WorkflowStepModel,L as WorkflowDefinitionModel,O as UpdateWorkflowInputModel,N as CreateWorkflowInputModel,P as AddStepInputModel};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.workflow-system",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.10",
|
|
4
4
|
"description": "Workflow and approval system example for ContractSpec - State machine with role-based transitions",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -13,28 +13,28 @@
|
|
|
13
13
|
"dev": "contractspec-bun-build dev",
|
|
14
14
|
"clean": "rimraf dist .turbo",
|
|
15
15
|
"lint": "bun lint:fix",
|
|
16
|
-
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
17
|
-
"lint:check": "biome check .",
|
|
16
|
+
"lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
|
|
17
|
+
"lint:check": "node ../../../scripts/biome.cjs check .",
|
|
18
18
|
"prebuild": "contractspec-bun-build prebuild",
|
|
19
19
|
"test": "bun test",
|
|
20
20
|
"typecheck": "tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@contractspec/lib.schema": "3.7.14",
|
|
24
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
25
|
-
"@contractspec/lib.example-shared-ui": "6.0.
|
|
26
|
-
"@contractspec/lib.design-system": "3.8.
|
|
24
|
+
"@contractspec/lib.contracts-spec": "5.2.0",
|
|
25
|
+
"@contractspec/lib.example-shared-ui": "6.0.18",
|
|
26
|
+
"@contractspec/lib.design-system": "3.8.11",
|
|
27
27
|
"@contractspec/lib.runtime-sandbox": "2.7.14",
|
|
28
28
|
"react": "19.2.0",
|
|
29
29
|
"react-dom": "19.2.0",
|
|
30
|
-
"@contractspec/lib.presentation-runtime-core": "3.9.
|
|
30
|
+
"@contractspec/lib.presentation-runtime-core": "3.9.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@contractspec/tool.typescript": "3.7.13",
|
|
34
34
|
"typescript": "^5.9.3",
|
|
35
35
|
"@types/react": "^19.2.14",
|
|
36
36
|
"@types/react-dom": "^19.2.2",
|
|
37
|
-
"@contractspec/tool.bun": "3.7.
|
|
37
|
+
"@contractspec/tool.bun": "3.7.14"
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|