@contractspec/example.workflow-system 0.0.0-canary-20260113170453

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 (157) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/dist/approval/approval.enum.d.ts +14 -0
  4. package/dist/approval/approval.enum.d.ts.map +1 -0
  5. package/dist/approval/approval.enum.js +29 -0
  6. package/dist/approval/approval.enum.js.map +1 -0
  7. package/dist/approval/approval.event.d.ts +131 -0
  8. package/dist/approval/approval.event.d.ts.map +1 -0
  9. package/dist/approval/approval.event.js +220 -0
  10. package/dist/approval/approval.event.js.map +1 -0
  11. package/dist/approval/approval.handler.d.ts +23 -0
  12. package/dist/approval/approval.handler.d.ts.map +1 -0
  13. package/dist/approval/approval.handler.js +72 -0
  14. package/dist/approval/approval.handler.js.map +1 -0
  15. package/dist/approval/approval.operations.d.ts +535 -0
  16. package/dist/approval/approval.operations.d.ts.map +1 -0
  17. package/dist/approval/approval.operations.js +345 -0
  18. package/dist/approval/approval.operations.js.map +1 -0
  19. package/dist/approval/approval.schema.d.ts +100 -0
  20. package/dist/approval/approval.schema.d.ts.map +1 -0
  21. package/dist/approval/approval.schema.js +110 -0
  22. package/dist/approval/approval.schema.js.map +1 -0
  23. package/dist/approval/index.d.ts +5 -0
  24. package/dist/approval/index.js +6 -0
  25. package/dist/docs/index.d.ts +1 -0
  26. package/dist/docs/index.js +1 -0
  27. package/dist/docs/workflow-system.docblock.d.ts +1 -0
  28. package/dist/docs/workflow-system.docblock.js +115 -0
  29. package/dist/docs/workflow-system.docblock.js.map +1 -0
  30. package/dist/entities/approval.d.ts +58 -0
  31. package/dist/entities/approval.d.ts.map +1 -0
  32. package/dist/entities/approval.js +128 -0
  33. package/dist/entities/approval.js.map +1 -0
  34. package/dist/entities/index.d.ts +139 -0
  35. package/dist/entities/index.d.ts.map +1 -0
  36. package/dist/entities/index.js +32 -0
  37. package/dist/entities/index.js.map +1 -0
  38. package/dist/entities/instance.d.ts +69 -0
  39. package/dist/entities/instance.d.ts.map +1 -0
  40. package/dist/entities/instance.js +168 -0
  41. package/dist/entities/instance.js.map +1 -0
  42. package/dist/entities/step.d.ts +50 -0
  43. package/dist/entities/step.d.ts.map +1 -0
  44. package/dist/entities/step.js +135 -0
  45. package/dist/entities/step.js.map +1 -0
  46. package/dist/entities/workflow.d.ts +41 -0
  47. package/dist/entities/workflow.d.ts.map +1 -0
  48. package/dist/entities/workflow.js +102 -0
  49. package/dist/entities/workflow.js.map +1 -0
  50. package/dist/example.d.ts +7 -0
  51. package/dist/example.d.ts.map +1 -0
  52. package/dist/example.js +58 -0
  53. package/dist/example.js.map +1 -0
  54. package/dist/handlers/index.d.ts +2 -0
  55. package/dist/handlers/index.js +3 -0
  56. package/dist/handlers/workflow.handlers.d.ts +122 -0
  57. package/dist/handlers/workflow.handlers.d.ts.map +1 -0
  58. package/dist/handlers/workflow.handlers.js +263 -0
  59. package/dist/handlers/workflow.handlers.js.map +1 -0
  60. package/dist/index.d.ts +26 -0
  61. package/dist/index.js +26 -0
  62. package/dist/instance/index.d.ts +5 -0
  63. package/dist/instance/index.js +6 -0
  64. package/dist/instance/instance.enum.d.ts +10 -0
  65. package/dist/instance/instance.enum.d.ts.map +1 -0
  66. package/dist/instance/instance.enum.js +20 -0
  67. package/dist/instance/instance.enum.js.map +1 -0
  68. package/dist/instance/instance.event.d.ts +356 -0
  69. package/dist/instance/instance.event.d.ts.map +1 -0
  70. package/dist/instance/instance.event.js +293 -0
  71. package/dist/instance/instance.event.js.map +1 -0
  72. package/dist/instance/instance.handler.d.ts +27 -0
  73. package/dist/instance/instance.handler.d.ts.map +1 -0
  74. package/dist/instance/instance.handler.js +94 -0
  75. package/dist/instance/instance.handler.js.map +1 -0
  76. package/dist/instance/instance.operations.d.ts +1024 -0
  77. package/dist/instance/instance.operations.d.ts.map +1 -0
  78. package/dist/instance/instance.operations.js +464 -0
  79. package/dist/instance/instance.operations.js.map +1 -0
  80. package/dist/instance/instance.schema.d.ts +223 -0
  81. package/dist/instance/instance.schema.d.ts.map +1 -0
  82. package/dist/instance/instance.schema.js +172 -0
  83. package/dist/instance/instance.schema.js.map +1 -0
  84. package/dist/presentations/index.d.ts +63 -0
  85. package/dist/presentations/index.d.ts.map +1 -0
  86. package/dist/presentations/index.js +340 -0
  87. package/dist/presentations/index.js.map +1 -0
  88. package/dist/seeders/index.d.ts +10 -0
  89. package/dist/seeders/index.d.ts.map +1 -0
  90. package/dist/seeders/index.js +19 -0
  91. package/dist/seeders/index.js.map +1 -0
  92. package/dist/shared/index.d.ts +3 -0
  93. package/dist/shared/index.js +3 -0
  94. package/dist/shared/mock-data.d.ts +19 -0
  95. package/dist/shared/mock-data.d.ts.map +1 -0
  96. package/dist/shared/mock-data.js +12 -0
  97. package/dist/shared/mock-data.js.map +1 -0
  98. package/dist/shared/types.d.ts +81 -0
  99. package/dist/shared/types.d.ts.map +1 -0
  100. package/dist/shared/types.js +0 -0
  101. package/dist/state-machine/index.d.ts +148 -0
  102. package/dist/state-machine/index.d.ts.map +1 -0
  103. package/dist/state-machine/index.js +158 -0
  104. package/dist/state-machine/index.js.map +1 -0
  105. package/dist/tests/operations.test-spec.d.ts +10 -0
  106. package/dist/tests/operations.test-spec.d.ts.map +1 -0
  107. package/dist/tests/operations.test-spec.js +123 -0
  108. package/dist/tests/operations.test-spec.js.map +1 -0
  109. package/dist/ui/WorkflowDashboard.d.ts +7 -0
  110. package/dist/ui/WorkflowDashboard.d.ts.map +1 -0
  111. package/dist/ui/WorkflowDashboard.js +223 -0
  112. package/dist/ui/WorkflowDashboard.js.map +1 -0
  113. package/dist/ui/hooks/index.d.ts +2 -0
  114. package/dist/ui/hooks/index.js +5 -0
  115. package/dist/ui/hooks/useWorkflowList.d.ts +22 -0
  116. package/dist/ui/hooks/useWorkflowList.d.ts.map +1 -0
  117. package/dist/ui/hooks/useWorkflowList.js +55 -0
  118. package/dist/ui/hooks/useWorkflowList.js.map +1 -0
  119. package/dist/ui/index.d.ts +6 -0
  120. package/dist/ui/index.js +6 -0
  121. package/dist/ui/renderers/index.d.ts +2 -0
  122. package/dist/ui/renderers/index.js +3 -0
  123. package/dist/ui/renderers/workflow.markdown.d.ts +28 -0
  124. package/dist/ui/renderers/workflow.markdown.d.ts.map +1 -0
  125. package/dist/ui/renderers/workflow.markdown.js +234 -0
  126. package/dist/ui/renderers/workflow.markdown.js.map +1 -0
  127. package/dist/workflow/index.d.ts +5 -0
  128. package/dist/workflow/index.js +6 -0
  129. package/dist/workflow/workflow.enum.d.ts +22 -0
  130. package/dist/workflow/workflow.enum.d.ts.map +1 -0
  131. package/dist/workflow/workflow.enum.js +47 -0
  132. package/dist/workflow/workflow.enum.js.map +1 -0
  133. package/dist/workflow/workflow.event.d.ts +135 -0
  134. package/dist/workflow/workflow.event.d.ts.map +1 -0
  135. package/dist/workflow/workflow.event.js +150 -0
  136. package/dist/workflow/workflow.event.js.map +1 -0
  137. package/dist/workflow/workflow.handler.d.ts +29 -0
  138. package/dist/workflow/workflow.handler.d.ts.map +1 -0
  139. package/dist/workflow/workflow.handler.js +66 -0
  140. package/dist/workflow/workflow.handler.js.map +1 -0
  141. package/dist/workflow/workflow.operations.d.ts +1011 -0
  142. package/dist/workflow/workflow.operations.d.ts.map +1 -0
  143. package/dist/workflow/workflow.operations.js +345 -0
  144. package/dist/workflow/workflow.operations.js.map +1 -0
  145. package/dist/workflow/workflow.schema.d.ts +265 -0
  146. package/dist/workflow/workflow.schema.d.ts.map +1 -0
  147. package/dist/workflow/workflow.schema.js +249 -0
  148. package/dist/workflow/workflow.schema.js.map +1 -0
  149. package/dist/workflow-system.capability.d.ts +9 -0
  150. package/dist/workflow-system.capability.d.ts.map +1 -0
  151. package/dist/workflow-system.capability.js +34 -0
  152. package/dist/workflow-system.capability.js.map +1 -0
  153. package/dist/workflow-system.feature.d.ts +12 -0
  154. package/dist/workflow-system.feature.d.ts.map +1 -0
  155. package/dist/workflow-system.feature.js +346 -0
  156. package/dist/workflow-system.feature.js.map +1 -0
  157. package/package.json +133 -0
@@ -0,0 +1,223 @@
1
+ import * as _contractspec_lib_schema786 from "@contractspec/lib.schema";
2
+
3
+ //#region src/instance/instance.schema.d.ts
4
+ /**
5
+ * A running workflow instance.
6
+ */
7
+ declare const WorkflowInstanceModel: _contractspec_lib_schema786.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema786.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ workflowDefinitionId: {
13
+ type: _contractspec_lib_schema786.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ referenceId: {
17
+ type: _contractspec_lib_schema786.FieldType<string, string>;
18
+ isOptional: true;
19
+ };
20
+ referenceType: {
21
+ type: _contractspec_lib_schema786.FieldType<string, string>;
22
+ isOptional: true;
23
+ };
24
+ status: {
25
+ type: _contractspec_lib_schema786.EnumType<[string, string, string, string, string, string, string, string]>;
26
+ isOptional: false;
27
+ };
28
+ currentStepId: {
29
+ type: _contractspec_lib_schema786.FieldType<string, string>;
30
+ isOptional: true;
31
+ };
32
+ contextData: {
33
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
34
+ isOptional: true;
35
+ };
36
+ triggeredBy: {
37
+ type: _contractspec_lib_schema786.FieldType<string, string>;
38
+ isOptional: false;
39
+ };
40
+ organizationId: {
41
+ type: _contractspec_lib_schema786.FieldType<string, string>;
42
+ isOptional: false;
43
+ };
44
+ priority: {
45
+ type: _contractspec_lib_schema786.FieldType<number, number>;
46
+ isOptional: false;
47
+ };
48
+ dueAt: {
49
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
50
+ isOptional: true;
51
+ };
52
+ outcome: {
53
+ type: _contractspec_lib_schema786.FieldType<string, string>;
54
+ isOptional: true;
55
+ };
56
+ resultData: {
57
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
58
+ isOptional: true;
59
+ };
60
+ errorMessage: {
61
+ type: _contractspec_lib_schema786.FieldType<string, string>;
62
+ isOptional: true;
63
+ };
64
+ createdAt: {
65
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
66
+ isOptional: false;
67
+ };
68
+ startedAt: {
69
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
70
+ isOptional: true;
71
+ };
72
+ completedAt: {
73
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
74
+ isOptional: true;
75
+ };
76
+ }>;
77
+ /**
78
+ * Input for starting a workflow.
79
+ */
80
+ declare const StartWorkflowInputModel: _contractspec_lib_schema786.SchemaModel<{
81
+ workflowKey: {
82
+ type: _contractspec_lib_schema786.FieldType<string, string>;
83
+ isOptional: false;
84
+ };
85
+ contextData: {
86
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
87
+ isOptional: true;
88
+ };
89
+ referenceId: {
90
+ type: _contractspec_lib_schema786.FieldType<string, string>;
91
+ isOptional: true;
92
+ };
93
+ referenceType: {
94
+ type: _contractspec_lib_schema786.FieldType<string, string>;
95
+ isOptional: true;
96
+ };
97
+ priority: {
98
+ type: _contractspec_lib_schema786.FieldType<number, number>;
99
+ isOptional: true;
100
+ };
101
+ dueAt: {
102
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
103
+ isOptional: true;
104
+ };
105
+ }>;
106
+ /**
107
+ * Input for transitioning a workflow.
108
+ */
109
+ declare const TransitionInputModel: _contractspec_lib_schema786.SchemaModel<{
110
+ instanceId: {
111
+ type: _contractspec_lib_schema786.FieldType<string, string>;
112
+ isOptional: false;
113
+ };
114
+ action: {
115
+ type: _contractspec_lib_schema786.FieldType<string, string>;
116
+ isOptional: false;
117
+ };
118
+ data: {
119
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
120
+ isOptional: true;
121
+ };
122
+ comment: {
123
+ type: _contractspec_lib_schema786.FieldType<string, string>;
124
+ isOptional: true;
125
+ };
126
+ }>;
127
+ /**
128
+ * Result of a workflow transition.
129
+ */
130
+ declare const TransitionResultModel: _contractspec_lib_schema786.SchemaModel<{
131
+ success: {
132
+ type: _contractspec_lib_schema786.FieldType<boolean, boolean>;
133
+ isOptional: false;
134
+ };
135
+ instance: {
136
+ type: _contractspec_lib_schema786.SchemaModel<{
137
+ id: {
138
+ type: _contractspec_lib_schema786.FieldType<string, string>;
139
+ isOptional: false;
140
+ };
141
+ workflowDefinitionId: {
142
+ type: _contractspec_lib_schema786.FieldType<string, string>;
143
+ isOptional: false;
144
+ };
145
+ referenceId: {
146
+ type: _contractspec_lib_schema786.FieldType<string, string>;
147
+ isOptional: true;
148
+ };
149
+ referenceType: {
150
+ type: _contractspec_lib_schema786.FieldType<string, string>;
151
+ isOptional: true;
152
+ };
153
+ status: {
154
+ type: _contractspec_lib_schema786.EnumType<[string, string, string, string, string, string, string, string]>;
155
+ isOptional: false;
156
+ };
157
+ currentStepId: {
158
+ type: _contractspec_lib_schema786.FieldType<string, string>;
159
+ isOptional: true;
160
+ };
161
+ contextData: {
162
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
163
+ isOptional: true;
164
+ };
165
+ triggeredBy: {
166
+ type: _contractspec_lib_schema786.FieldType<string, string>;
167
+ isOptional: false;
168
+ };
169
+ organizationId: {
170
+ type: _contractspec_lib_schema786.FieldType<string, string>;
171
+ isOptional: false;
172
+ };
173
+ priority: {
174
+ type: _contractspec_lib_schema786.FieldType<number, number>;
175
+ isOptional: false;
176
+ };
177
+ dueAt: {
178
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
179
+ isOptional: true;
180
+ };
181
+ outcome: {
182
+ type: _contractspec_lib_schema786.FieldType<string, string>;
183
+ isOptional: true;
184
+ };
185
+ resultData: {
186
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
187
+ isOptional: true;
188
+ };
189
+ errorMessage: {
190
+ type: _contractspec_lib_schema786.FieldType<string, string>;
191
+ isOptional: true;
192
+ };
193
+ createdAt: {
194
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
195
+ isOptional: false;
196
+ };
197
+ startedAt: {
198
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
199
+ isOptional: true;
200
+ };
201
+ completedAt: {
202
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
203
+ isOptional: true;
204
+ };
205
+ }>;
206
+ isOptional: false;
207
+ };
208
+ previousStepKey: {
209
+ type: _contractspec_lib_schema786.FieldType<string, string>;
210
+ isOptional: true;
211
+ };
212
+ currentStepKey: {
213
+ type: _contractspec_lib_schema786.FieldType<string, string>;
214
+ isOptional: true;
215
+ };
216
+ message: {
217
+ type: _contractspec_lib_schema786.FieldType<string, string>;
218
+ isOptional: true;
219
+ };
220
+ }>;
221
+ //#endregion
222
+ export { StartWorkflowInputModel, TransitionInputModel, TransitionResultModel, WorkflowInstanceModel };
223
+ //# sourceMappingURL=instance.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.schema.d.ts","names":[],"sources":["../../src/instance/instance.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,qBAqCX,8BArCgC,WAqChC,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;+CArCgC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EA0CrB,CAAA;EAcX,WAAA,EAAA;;;;;;;;EAdkC,cAAA,EAAA;IAmBvB,IAAA,uCASX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;EAT+B,CAAA;EAcpB,KAAA,EAAA;IAgBX,IAAA,uCAAA,KAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CAhBgC,CAAA;;;;cAjCrB,qDAAuB;;UAclC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,kDAAoB;;UAS/B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;cAKW,mDAAqB;;UAgBhC,2BAAA,CAAA"}
@@ -0,0 +1,172 @@
1
+ import { InstanceStatusEnum } from "./instance.enum.js";
2
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+
4
+ //#region src/instance/instance.schema.ts
5
+ /**
6
+ * A running workflow instance.
7
+ */
8
+ const WorkflowInstanceModel = defineSchemaModel({
9
+ name: "WorkflowInstanceModel",
10
+ description: "A running workflow instance",
11
+ fields: {
12
+ id: {
13
+ type: ScalarTypeEnum.String_unsecure(),
14
+ isOptional: false
15
+ },
16
+ workflowDefinitionId: {
17
+ type: ScalarTypeEnum.String_unsecure(),
18
+ isOptional: false
19
+ },
20
+ referenceId: {
21
+ type: ScalarTypeEnum.String_unsecure(),
22
+ isOptional: true
23
+ },
24
+ referenceType: {
25
+ type: ScalarTypeEnum.String_unsecure(),
26
+ isOptional: true
27
+ },
28
+ status: {
29
+ type: InstanceStatusEnum,
30
+ isOptional: false
31
+ },
32
+ currentStepId: {
33
+ type: ScalarTypeEnum.String_unsecure(),
34
+ isOptional: true
35
+ },
36
+ contextData: {
37
+ type: ScalarTypeEnum.JSON(),
38
+ isOptional: true
39
+ },
40
+ triggeredBy: {
41
+ type: ScalarTypeEnum.String_unsecure(),
42
+ isOptional: false
43
+ },
44
+ organizationId: {
45
+ type: ScalarTypeEnum.String_unsecure(),
46
+ isOptional: false
47
+ },
48
+ priority: {
49
+ type: ScalarTypeEnum.Int_unsecure(),
50
+ isOptional: false
51
+ },
52
+ dueAt: {
53
+ type: ScalarTypeEnum.DateTime(),
54
+ isOptional: true
55
+ },
56
+ outcome: {
57
+ type: ScalarTypeEnum.String_unsecure(),
58
+ isOptional: true
59
+ },
60
+ resultData: {
61
+ type: ScalarTypeEnum.JSON(),
62
+ isOptional: true
63
+ },
64
+ errorMessage: {
65
+ type: ScalarTypeEnum.String_unsecure(),
66
+ isOptional: true
67
+ },
68
+ createdAt: {
69
+ type: ScalarTypeEnum.DateTime(),
70
+ isOptional: false
71
+ },
72
+ startedAt: {
73
+ type: ScalarTypeEnum.DateTime(),
74
+ isOptional: true
75
+ },
76
+ completedAt: {
77
+ type: ScalarTypeEnum.DateTime(),
78
+ isOptional: true
79
+ }
80
+ }
81
+ });
82
+ /**
83
+ * Input for starting a workflow.
84
+ */
85
+ const StartWorkflowInputModel = defineSchemaModel({
86
+ name: "StartWorkflowInput",
87
+ description: "Input for starting a workflow",
88
+ fields: {
89
+ workflowKey: {
90
+ type: ScalarTypeEnum.NonEmptyString(),
91
+ isOptional: false
92
+ },
93
+ contextData: {
94
+ type: ScalarTypeEnum.JSON(),
95
+ isOptional: true
96
+ },
97
+ referenceId: {
98
+ type: ScalarTypeEnum.String_unsecure(),
99
+ isOptional: true
100
+ },
101
+ referenceType: {
102
+ type: ScalarTypeEnum.String_unsecure(),
103
+ isOptional: true
104
+ },
105
+ priority: {
106
+ type: ScalarTypeEnum.Int_unsecure(),
107
+ isOptional: true
108
+ },
109
+ dueAt: {
110
+ type: ScalarTypeEnum.DateTime(),
111
+ isOptional: true
112
+ }
113
+ }
114
+ });
115
+ /**
116
+ * Input for transitioning a workflow.
117
+ */
118
+ const TransitionInputModel = defineSchemaModel({
119
+ name: "TransitionInput",
120
+ description: "Input for transitioning a workflow",
121
+ fields: {
122
+ instanceId: {
123
+ type: ScalarTypeEnum.String_unsecure(),
124
+ isOptional: false
125
+ },
126
+ action: {
127
+ type: ScalarTypeEnum.NonEmptyString(),
128
+ isOptional: false
129
+ },
130
+ data: {
131
+ type: ScalarTypeEnum.JSON(),
132
+ isOptional: true
133
+ },
134
+ comment: {
135
+ type: ScalarTypeEnum.String_unsecure(),
136
+ isOptional: true
137
+ }
138
+ }
139
+ });
140
+ /**
141
+ * Result of a workflow transition.
142
+ */
143
+ const TransitionResultModel = defineSchemaModel({
144
+ name: "TransitionResult",
145
+ description: "Result of a workflow transition",
146
+ fields: {
147
+ success: {
148
+ type: ScalarTypeEnum.Boolean(),
149
+ isOptional: false
150
+ },
151
+ instance: {
152
+ type: WorkflowInstanceModel,
153
+ isOptional: false
154
+ },
155
+ previousStepKey: {
156
+ type: ScalarTypeEnum.String_unsecure(),
157
+ isOptional: true
158
+ },
159
+ currentStepKey: {
160
+ type: ScalarTypeEnum.String_unsecure(),
161
+ isOptional: true
162
+ },
163
+ message: {
164
+ type: ScalarTypeEnum.String_unsecure(),
165
+ isOptional: true
166
+ }
167
+ }
168
+ });
169
+
170
+ //#endregion
171
+ export { StartWorkflowInputModel, TransitionInputModel, TransitionResultModel, WorkflowInstanceModel };
172
+ //# sourceMappingURL=instance.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.schema.js","names":[],"sources":["../../src/instance/instance.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { InstanceStatusEnum } from './instance.enum';\n\n/**\n * A running workflow instance.\n */\nexport const WorkflowInstanceModel = defineSchemaModel({\n name: 'WorkflowInstanceModel',\n description: 'A running workflow instance',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n workflowDefinitionId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n referenceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n referenceType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n status: { type: InstanceStatusEnum, isOptional: false },\n currentStepId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n contextData: { type: ScalarTypeEnum.JSON(), isOptional: true },\n triggeredBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n priority: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n dueAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n outcome: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n resultData: { type: ScalarTypeEnum.JSON(), isOptional: true },\n errorMessage: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\n/**\n * Input for starting a workflow.\n */\nexport const StartWorkflowInputModel = defineSchemaModel({\n name: 'StartWorkflowInput',\n description: 'Input for starting a workflow',\n fields: {\n workflowKey: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n contextData: { type: ScalarTypeEnum.JSON(), isOptional: true },\n referenceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n referenceType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n priority: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n dueAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\n/**\n * Input for transitioning a workflow.\n */\nexport const TransitionInputModel = defineSchemaModel({\n name: 'TransitionInput',\n description: 'Input for transitioning a workflow',\n fields: {\n instanceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n action: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n data: { type: ScalarTypeEnum.JSON(), isOptional: true },\n comment: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Result of a workflow transition.\n */\nexport const TransitionResultModel = defineSchemaModel({\n name: 'TransitionResult',\n description: 'Result of a workflow transition',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n instance: { type: WorkflowInstanceModel, isOptional: false },\n previousStepKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n currentStepKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n message: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,sBAAsB;GACpB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,QAAQ;GAAE,MAAM;GAAoB,YAAY;GAAO;EACvD,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,aAAa;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAC9D,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,UAAU;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACpE,OAAO;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAC5D,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,YAAY;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAC7D,cAAc;GACZ,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAChE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EACnE;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,kBAAkB;CACvD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,aAAa;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACzE,aAAa;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAC9D,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,UAAU;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACnE,OAAO;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAC7D;CACF,CAAC;;;;AAKF,MAAa,uBAAuB,kBAAkB;CACpD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,QAAQ;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACpE,MAAM;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EACvD,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAC9D,UAAU;GAAE,MAAM;GAAuB,YAAY;GAAO;EAC5D,iBAAiB;GACf,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE;CACF,CAAC"}
@@ -0,0 +1,63 @@
1
+ import * as _contractspec_lib_contracts29 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations/index.d.ts
4
+ /**
5
+ * Workflow designer canvas for building workflows.
6
+ */
7
+ declare const WorkflowDesignerPresentation: _contractspec_lib_contracts29.PresentationSpec;
8
+ /**
9
+ * List of workflow definitions.
10
+ */
11
+ declare const WorkflowListPresentation: _contractspec_lib_contracts29.PresentationSpec;
12
+ /**
13
+ * Workflow definition detail view.
14
+ */
15
+ declare const WorkflowDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
16
+ /**
17
+ * List of running workflow instances.
18
+ */
19
+ declare const InstanceListPresentation: _contractspec_lib_contracts29.PresentationSpec;
20
+ /**
21
+ * Workflow instance detail view with timeline.
22
+ */
23
+ declare const InstanceDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
24
+ /**
25
+ * Workflow progress tracker widget.
26
+ */
27
+ declare const ProgressTrackerPresentation: _contractspec_lib_contracts29.PresentationSpec;
28
+ /**
29
+ * Approval inbox - list of pending approvals.
30
+ */
31
+ declare const ApprovalInboxPresentation: _contractspec_lib_contracts29.PresentationSpec;
32
+ /**
33
+ * Approval request detail view.
34
+ */
35
+ declare const ApprovalDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
36
+ /**
37
+ * Approval decision form.
38
+ */
39
+ declare const ApprovalFormPresentation: _contractspec_lib_contracts29.PresentationSpec;
40
+ /**
41
+ * Pending approvals count badge.
42
+ */
43
+ declare const PendingApprovalsBadgePresentation: _contractspec_lib_contracts29.PresentationSpec;
44
+ /**
45
+ * Workflow metrics dashboard widget.
46
+ */
47
+ declare const WorkflowMetricsPresentation: _contractspec_lib_contracts29.PresentationSpec;
48
+ declare const WorkflowSystemPresentations: {
49
+ WorkflowDesignerPresentation: _contractspec_lib_contracts29.PresentationSpec;
50
+ WorkflowListPresentation: _contractspec_lib_contracts29.PresentationSpec;
51
+ WorkflowDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
52
+ InstanceListPresentation: _contractspec_lib_contracts29.PresentationSpec;
53
+ InstanceDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
54
+ ProgressTrackerPresentation: _contractspec_lib_contracts29.PresentationSpec;
55
+ ApprovalInboxPresentation: _contractspec_lib_contracts29.PresentationSpec;
56
+ ApprovalDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
57
+ ApprovalFormPresentation: _contractspec_lib_contracts29.PresentationSpec;
58
+ PendingApprovalsBadgePresentation: _contractspec_lib_contracts29.PresentationSpec;
59
+ WorkflowMetricsPresentation: _contractspec_lib_contracts29.PresentationSpec;
60
+ };
61
+ //#endregion
62
+ export { ApprovalDetailPresentation, ApprovalFormPresentation, ApprovalInboxPresentation, InstanceDetailPresentation, InstanceListPresentation, PendingApprovalsBadgePresentation, ProgressTrackerPresentation, WorkflowDesignerPresentation, WorkflowDetailPresentation, WorkflowListPresentation, WorkflowMetricsPresentation, WorkflowSystemPresentations };
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAaa,cAAA,4BAuBX,EAAA,6BAAA,CAvBuC,gBAuBvC;AAKF;AA4BA;AA8BA;AA4Ba,cAtFA,wBA6GX,EAtFA,6BAAA,CAvBmC,gBA6GnC;AAKF;AA8BA;AA4BA;AA4Ba,cA5KA,0BAkMX,EA3KA,6BAAA,CAvBqC,gBAkMrC;AAOF;AA2BA;AA0BA;AAmBC,cAnPY,wBAmPZ,EA5NC,6BAAA,CAvBmC,gBAmPpC;;;;cAvNY,4BAuBX,6BAAA,CAvBqC;;;;cA4B1B,6BAuBX,6BAAA,CAvBsC;;;;cA8B3B,2BAuBX,6BAAA,CAvBoC;;;;cA4BzB,4BAuBX,6BAAA,CAvBqC;;;;cA4B1B,0BAsBX,6BAAA,CAtBmC;;;;cA6BxB,mCAsBX,6BAAA,CAtB4C;;;;cA2BjC,6BAsBX,6BAAA,CAtBsC;cA0B3B;gCAmBZ,6BAAA,CAAA"}