@contractspec/example.workflow-system 3.8.8 → 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.
Files changed (95) hide show
  1. package/dist/approval/approval.enum.js +1 -22
  2. package/dist/approval/approval.event.js +1 -112
  3. package/dist/approval/approval.operations.js +1 -369
  4. package/dist/approval/approval.schema.js +1 -73
  5. package/dist/approval/index.js +1 -484
  6. package/dist/browser/approval/approval.enum.js +1 -22
  7. package/dist/browser/approval/approval.event.js +1 -112
  8. package/dist/browser/approval/approval.operations.js +1 -369
  9. package/dist/browser/approval/approval.schema.js +1 -73
  10. package/dist/browser/approval/index.js +1 -484
  11. package/dist/browser/docs/index.js +5 -49
  12. package/dist/browser/docs/workflow-system.docblock.js +5 -49
  13. package/dist/browser/entities/approval.js +1 -119
  14. package/dist/browser/entities/index.js +1 -508
  15. package/dist/browser/entities/instance.js +1 -161
  16. package/dist/browser/entities/step.js +1 -124
  17. package/dist/browser/entities/workflow.js +1 -82
  18. package/dist/browser/example.js +1 -42
  19. package/dist/browser/handlers/index.js +8 -253
  20. package/dist/browser/handlers/workflow.handlers.js +8 -253
  21. package/dist/browser/index.js +13 -3524
  22. package/dist/browser/instance/index.js +1 -677
  23. package/dist/browser/instance/instance.enum.js +1 -15
  24. package/dist/browser/instance/instance.event.js +1 -164
  25. package/dist/browser/instance/instance.handler.js +1 -356
  26. package/dist/browser/instance/instance.operations.js +1 -9
  27. package/dist/browser/instance/instance.schema.js +1 -101
  28. package/dist/browser/presentations/index.js +1 -109
  29. package/dist/browser/seeders/index.js +1 -3
  30. package/dist/browser/shared/demo-scenario.js +1 -213
  31. package/dist/browser/shared/index.js +1 -3
  32. package/dist/browser/shared/mock-data.js +1 -11
  33. package/dist/browser/state-machine/index.js +1 -6
  34. package/dist/browser/tests/operations.test-spec.js +1 -6
  35. package/dist/browser/ui/WorkflowDashboard.js +1 -3
  36. package/dist/browser/ui/WorkflowDashboard.visualizations.js +1 -239
  37. package/dist/browser/ui/hooks/index.js +1 -3
  38. package/dist/browser/ui/hooks/useWorkflowList.js +1 -52
  39. package/dist/browser/ui/index.js +1 -56
  40. package/dist/browser/ui/renderers/index.js +5 -562
  41. package/dist/browser/ui/renderers/workflow.markdown.js +5 -562
  42. package/dist/browser/visualizations/catalog.js +1 -132
  43. package/dist/browser/visualizations/index.js +1 -133
  44. package/dist/browser/visualizations/selectors.js +1 -195
  45. package/dist/browser/workflow/index.js +1 -21
  46. package/dist/browser/workflow/workflow.enum.js +1 -36
  47. package/dist/browser/workflow/workflow.event.js +1 -6
  48. package/dist/browser/workflow/workflow.handler.js +1 -5
  49. package/dist/browser/workflow/workflow.operations.js +1 -8
  50. package/dist/browser/workflow/workflow.schema.js +1 -151
  51. package/dist/browser/workflow-system.capability.js +1 -5
  52. package/dist/browser/workflow-system.feature.js +1 -3
  53. package/dist/docs/index.js +5 -49
  54. package/dist/docs/workflow-system.docblock.js +5 -49
  55. package/dist/entities/approval.js +1 -119
  56. package/dist/entities/index.js +1 -508
  57. package/dist/entities/instance.js +1 -161
  58. package/dist/entities/step.js +1 -124
  59. package/dist/entities/workflow.js +1 -82
  60. package/dist/example.js +1 -42
  61. package/dist/handlers/index.js +8 -253
  62. package/dist/handlers/workflow.handlers.js +8 -253
  63. package/dist/index.js +13 -3524
  64. package/dist/instance/index.js +1 -677
  65. package/dist/instance/instance.enum.js +1 -15
  66. package/dist/instance/instance.event.js +1 -164
  67. package/dist/instance/instance.handler.js +1 -356
  68. package/dist/instance/instance.operations.js +1 -9
  69. package/dist/instance/instance.schema.js +1 -101
  70. package/dist/presentations/index.js +1 -109
  71. package/dist/seeders/index.js +1 -3
  72. package/dist/shared/demo-scenario.js +1 -213
  73. package/dist/shared/index.js +1 -3
  74. package/dist/shared/mock-data.js +1 -11
  75. package/dist/state-machine/index.js +1 -6
  76. package/dist/tests/operations.test-spec.js +1 -6
  77. package/dist/ui/WorkflowDashboard.js +1 -3
  78. package/dist/ui/WorkflowDashboard.visualizations.js +1 -239
  79. package/dist/ui/hooks/index.js +1 -3
  80. package/dist/ui/hooks/useWorkflowList.js +1 -52
  81. package/dist/ui/index.js +1 -56
  82. package/dist/ui/renderers/index.js +5 -562
  83. package/dist/ui/renderers/workflow.markdown.js +5 -562
  84. package/dist/visualizations/catalog.js +1 -132
  85. package/dist/visualizations/index.js +1 -133
  86. package/dist/visualizations/selectors.js +1 -195
  87. package/dist/workflow/index.js +1 -21
  88. package/dist/workflow/workflow.enum.js +1 -36
  89. package/dist/workflow/workflow.event.js +1 -6
  90. package/dist/workflow/workflow.handler.js +1 -5
  91. package/dist/workflow/workflow.operations.js +1 -8
  92. package/dist/workflow/workflow.schema.js +1 -151
  93. package/dist/workflow-system.capability.js +1 -5
  94. package/dist/workflow-system.feature.js +1 -3
  95. package/package.json +11 -11
@@ -1,152 +1,2 @@
1
1
  // @bun
2
- // src/workflow/workflow.enum.ts
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};
@@ -1,6 +1,2 @@
1
1
  // @bun
2
- export {
3
- WorkflowCapability,
4
- StateMachineCapability,
5
- ApprovalCapability
6
- };
2
+ export{WorkflowCapability,StateMachineCapability,ApprovalCapability};
@@ -1,4 +1,2 @@
1
1
  // @bun
2
- export {
3
- WorkflowSystemFeature
4
- };
2
+ export{WorkflowSystemFeature};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.workflow-system",
3
- "version": "3.8.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
- "@contractspec/lib.schema": "3.7.13",
24
- "@contractspec/lib.contracts-spec": "5.0.4",
25
- "@contractspec/lib.example-shared-ui": "6.0.16",
26
- "@contractspec/lib.design-system": "3.8.9",
27
- "@contractspec/lib.runtime-sandbox": "2.7.13",
23
+ "@contractspec/lib.schema": "3.7.14",
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
+ "@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.4"
30
+ "@contractspec/lib.presentation-runtime-core": "3.9.6"
31
31
  },
32
32
  "devDependencies": {
33
- "@contractspec/tool.typescript": "3.7.12",
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.12"
37
+ "@contractspec/tool.bun": "3.7.14"
38
38
  },
39
39
  "exports": {
40
40
  ".": {