@contractspec/example.workflow-system 1.46.1 → 1.48.0

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 (87) hide show
  1. package/dist/approval/approval.enum.d.ts +3 -3
  2. package/dist/approval/approval.enum.d.ts.map +1 -1
  3. package/dist/approval/approval.event.d.ts +32 -32
  4. package/dist/approval/approval.event.d.ts.map +1 -1
  5. package/dist/approval/approval.event.js +5 -5
  6. package/dist/approval/approval.event.js.map +1 -1
  7. package/dist/approval/approval.handler.js.map +1 -1
  8. package/dist/approval/approval.operations.d.ts +134 -134
  9. package/dist/approval/approval.operations.d.ts.map +1 -1
  10. package/dist/approval/approval.schema.d.ts +24 -24
  11. package/dist/entities/approval.d.ts +36 -36
  12. package/dist/entities/approval.d.ts.map +1 -1
  13. package/dist/entities/index.d.ts +127 -127
  14. package/dist/entities/index.d.ts.map +1 -1
  15. package/dist/entities/index.js.map +1 -1
  16. package/dist/entities/instance.d.ts +47 -47
  17. package/dist/entities/step.d.ts +32 -32
  18. package/dist/entities/workflow.d.ts +23 -23
  19. package/dist/example.d.ts +2 -2
  20. package/dist/example.d.ts.map +1 -1
  21. package/dist/example.js +4 -2
  22. package/dist/example.js.map +1 -1
  23. package/dist/handlers/index.d.ts +2 -0
  24. package/dist/handlers/index.js +3 -0
  25. package/dist/handlers/workflow.handlers.d.ts +122 -0
  26. package/dist/handlers/workflow.handlers.d.ts.map +1 -0
  27. package/dist/handlers/workflow.handlers.js +263 -0
  28. package/dist/handlers/workflow.handlers.js.map +1 -0
  29. package/dist/index.d.ts +6 -1
  30. package/dist/index.js +6 -1
  31. package/dist/instance/instance.enum.d.ts +2 -2
  32. package/dist/instance/instance.event.d.ts +87 -87
  33. package/dist/instance/instance.event.d.ts.map +1 -1
  34. package/dist/instance/instance.event.js +4 -4
  35. package/dist/instance/instance.event.js.map +1 -1
  36. package/dist/instance/instance.handler.js.map +1 -1
  37. package/dist/instance/instance.operations.d.ts +256 -256
  38. package/dist/instance/instance.schema.d.ts +54 -54
  39. package/dist/presentations/index.d.ts +23 -24
  40. package/dist/presentations/index.d.ts.map +1 -1
  41. package/dist/presentations/index.js +26 -23
  42. package/dist/presentations/index.js.map +1 -1
  43. package/dist/seeders/index.d.ts +10 -0
  44. package/dist/seeders/index.d.ts.map +1 -0
  45. package/dist/seeders/index.js +19 -0
  46. package/dist/seeders/index.js.map +1 -0
  47. package/dist/state-machine/index.js.map +1 -1
  48. package/dist/tests/operations.test-spec.d.ts +10 -0
  49. package/dist/tests/operations.test-spec.d.ts.map +1 -0
  50. package/dist/tests/operations.test-spec.js +123 -0
  51. package/dist/tests/operations.test-spec.js.map +1 -0
  52. package/dist/ui/WorkflowDashboard.d.ts +7 -0
  53. package/dist/ui/WorkflowDashboard.d.ts.map +1 -0
  54. package/dist/ui/WorkflowDashboard.js +223 -0
  55. package/dist/ui/WorkflowDashboard.js.map +1 -0
  56. package/dist/ui/hooks/index.d.ts +2 -0
  57. package/dist/ui/hooks/index.js +5 -0
  58. package/dist/ui/hooks/useWorkflowList.d.ts +22 -0
  59. package/dist/ui/hooks/useWorkflowList.d.ts.map +1 -0
  60. package/dist/ui/hooks/useWorkflowList.js +55 -0
  61. package/dist/ui/hooks/useWorkflowList.js.map +1 -0
  62. package/dist/ui/index.d.ts +6 -0
  63. package/dist/ui/index.js +6 -0
  64. package/dist/ui/renderers/index.d.ts +2 -0
  65. package/dist/ui/renderers/index.js +3 -0
  66. package/dist/ui/renderers/workflow.markdown.d.ts +28 -0
  67. package/dist/ui/renderers/workflow.markdown.d.ts.map +1 -0
  68. package/dist/ui/renderers/workflow.markdown.js +234 -0
  69. package/dist/ui/renderers/workflow.markdown.js.map +1 -0
  70. package/dist/workflow/workflow.enum.d.ts +5 -5
  71. package/dist/workflow/workflow.event.d.ts +33 -33
  72. package/dist/workflow/workflow.event.d.ts.map +1 -1
  73. package/dist/workflow/workflow.event.js +3 -3
  74. package/dist/workflow/workflow.event.js.map +1 -1
  75. package/dist/workflow/workflow.handler.js.map +1 -1
  76. package/dist/workflow/workflow.operations.d.ts +246 -246
  77. package/dist/workflow/workflow.schema.d.ts +63 -63
  78. package/dist/workflow/workflow.schema.d.ts.map +1 -1
  79. package/dist/workflow-system.capability.d.ts +9 -0
  80. package/dist/workflow-system.capability.d.ts.map +1 -0
  81. package/dist/workflow-system.capability.js +34 -0
  82. package/dist/workflow-system.capability.js.map +1 -0
  83. package/dist/workflow-system.feature.d.ts +2 -2
  84. package/dist/workflow-system.feature.d.ts.map +1 -1
  85. package/dist/workflow-system.feature.js +9 -2
  86. package/dist/workflow-system.feature.js.map +1 -1
  87. package/package.json +24 -8
@@ -1,220 +1,220 @@
1
- import * as _contractspec_lib_schema594 from "@contractspec/lib.schema";
1
+ import * as _contractspec_lib_schema786 from "@contractspec/lib.schema";
2
2
 
3
3
  //#region src/instance/instance.schema.d.ts
4
4
  /**
5
5
  * A running workflow instance.
6
6
  */
7
- declare const WorkflowInstanceModel: _contractspec_lib_schema594.SchemaModel<{
7
+ declare const WorkflowInstanceModel: _contractspec_lib_schema786.SchemaModel<{
8
8
  id: {
9
- type: _contractspec_lib_schema594.FieldType<string, string>;
9
+ type: _contractspec_lib_schema786.FieldType<string, string>;
10
10
  isOptional: false;
11
11
  };
12
12
  workflowDefinitionId: {
13
- type: _contractspec_lib_schema594.FieldType<string, string>;
13
+ type: _contractspec_lib_schema786.FieldType<string, string>;
14
14
  isOptional: false;
15
15
  };
16
16
  referenceId: {
17
- type: _contractspec_lib_schema594.FieldType<string, string>;
17
+ type: _contractspec_lib_schema786.FieldType<string, string>;
18
18
  isOptional: true;
19
19
  };
20
20
  referenceType: {
21
- type: _contractspec_lib_schema594.FieldType<string, string>;
21
+ type: _contractspec_lib_schema786.FieldType<string, string>;
22
22
  isOptional: true;
23
23
  };
24
24
  status: {
25
- type: _contractspec_lib_schema594.EnumType<[string, string, string, string, string, string, string, string]>;
25
+ type: _contractspec_lib_schema786.EnumType<[string, string, string, string, string, string, string, string]>;
26
26
  isOptional: false;
27
27
  };
28
28
  currentStepId: {
29
- type: _contractspec_lib_schema594.FieldType<string, string>;
29
+ type: _contractspec_lib_schema786.FieldType<string, string>;
30
30
  isOptional: true;
31
31
  };
32
32
  contextData: {
33
- type: _contractspec_lib_schema594.FieldType<unknown, unknown>;
33
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
34
34
  isOptional: true;
35
35
  };
36
36
  triggeredBy: {
37
- type: _contractspec_lib_schema594.FieldType<string, string>;
37
+ type: _contractspec_lib_schema786.FieldType<string, string>;
38
38
  isOptional: false;
39
39
  };
40
40
  organizationId: {
41
- type: _contractspec_lib_schema594.FieldType<string, string>;
41
+ type: _contractspec_lib_schema786.FieldType<string, string>;
42
42
  isOptional: false;
43
43
  };
44
44
  priority: {
45
- type: _contractspec_lib_schema594.FieldType<number, number>;
45
+ type: _contractspec_lib_schema786.FieldType<number, number>;
46
46
  isOptional: false;
47
47
  };
48
48
  dueAt: {
49
- type: _contractspec_lib_schema594.FieldType<Date, string>;
49
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
50
50
  isOptional: true;
51
51
  };
52
52
  outcome: {
53
- type: _contractspec_lib_schema594.FieldType<string, string>;
53
+ type: _contractspec_lib_schema786.FieldType<string, string>;
54
54
  isOptional: true;
55
55
  };
56
56
  resultData: {
57
- type: _contractspec_lib_schema594.FieldType<unknown, unknown>;
57
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
58
58
  isOptional: true;
59
59
  };
60
60
  errorMessage: {
61
- type: _contractspec_lib_schema594.FieldType<string, string>;
61
+ type: _contractspec_lib_schema786.FieldType<string, string>;
62
62
  isOptional: true;
63
63
  };
64
64
  createdAt: {
65
- type: _contractspec_lib_schema594.FieldType<Date, string>;
65
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
66
66
  isOptional: false;
67
67
  };
68
68
  startedAt: {
69
- type: _contractspec_lib_schema594.FieldType<Date, string>;
69
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
70
70
  isOptional: true;
71
71
  };
72
72
  completedAt: {
73
- type: _contractspec_lib_schema594.FieldType<Date, string>;
73
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
74
74
  isOptional: true;
75
75
  };
76
76
  }>;
77
77
  /**
78
78
  * Input for starting a workflow.
79
79
  */
80
- declare const StartWorkflowInputModel: _contractspec_lib_schema594.SchemaModel<{
80
+ declare const StartWorkflowInputModel: _contractspec_lib_schema786.SchemaModel<{
81
81
  workflowKey: {
82
- type: _contractspec_lib_schema594.FieldType<string, string>;
82
+ type: _contractspec_lib_schema786.FieldType<string, string>;
83
83
  isOptional: false;
84
84
  };
85
85
  contextData: {
86
- type: _contractspec_lib_schema594.FieldType<unknown, unknown>;
86
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
87
87
  isOptional: true;
88
88
  };
89
89
  referenceId: {
90
- type: _contractspec_lib_schema594.FieldType<string, string>;
90
+ type: _contractspec_lib_schema786.FieldType<string, string>;
91
91
  isOptional: true;
92
92
  };
93
93
  referenceType: {
94
- type: _contractspec_lib_schema594.FieldType<string, string>;
94
+ type: _contractspec_lib_schema786.FieldType<string, string>;
95
95
  isOptional: true;
96
96
  };
97
97
  priority: {
98
- type: _contractspec_lib_schema594.FieldType<number, number>;
98
+ type: _contractspec_lib_schema786.FieldType<number, number>;
99
99
  isOptional: true;
100
100
  };
101
101
  dueAt: {
102
- type: _contractspec_lib_schema594.FieldType<Date, string>;
102
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
103
103
  isOptional: true;
104
104
  };
105
105
  }>;
106
106
  /**
107
107
  * Input for transitioning a workflow.
108
108
  */
109
- declare const TransitionInputModel: _contractspec_lib_schema594.SchemaModel<{
109
+ declare const TransitionInputModel: _contractspec_lib_schema786.SchemaModel<{
110
110
  instanceId: {
111
- type: _contractspec_lib_schema594.FieldType<string, string>;
111
+ type: _contractspec_lib_schema786.FieldType<string, string>;
112
112
  isOptional: false;
113
113
  };
114
114
  action: {
115
- type: _contractspec_lib_schema594.FieldType<string, string>;
115
+ type: _contractspec_lib_schema786.FieldType<string, string>;
116
116
  isOptional: false;
117
117
  };
118
118
  data: {
119
- type: _contractspec_lib_schema594.FieldType<unknown, unknown>;
119
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
120
120
  isOptional: true;
121
121
  };
122
122
  comment: {
123
- type: _contractspec_lib_schema594.FieldType<string, string>;
123
+ type: _contractspec_lib_schema786.FieldType<string, string>;
124
124
  isOptional: true;
125
125
  };
126
126
  }>;
127
127
  /**
128
128
  * Result of a workflow transition.
129
129
  */
130
- declare const TransitionResultModel: _contractspec_lib_schema594.SchemaModel<{
130
+ declare const TransitionResultModel: _contractspec_lib_schema786.SchemaModel<{
131
131
  success: {
132
- type: _contractspec_lib_schema594.FieldType<boolean, boolean>;
132
+ type: _contractspec_lib_schema786.FieldType<boolean, boolean>;
133
133
  isOptional: false;
134
134
  };
135
135
  instance: {
136
- type: _contractspec_lib_schema594.SchemaModel<{
136
+ type: _contractspec_lib_schema786.SchemaModel<{
137
137
  id: {
138
- type: _contractspec_lib_schema594.FieldType<string, string>;
138
+ type: _contractspec_lib_schema786.FieldType<string, string>;
139
139
  isOptional: false;
140
140
  };
141
141
  workflowDefinitionId: {
142
- type: _contractspec_lib_schema594.FieldType<string, string>;
142
+ type: _contractspec_lib_schema786.FieldType<string, string>;
143
143
  isOptional: false;
144
144
  };
145
145
  referenceId: {
146
- type: _contractspec_lib_schema594.FieldType<string, string>;
146
+ type: _contractspec_lib_schema786.FieldType<string, string>;
147
147
  isOptional: true;
148
148
  };
149
149
  referenceType: {
150
- type: _contractspec_lib_schema594.FieldType<string, string>;
150
+ type: _contractspec_lib_schema786.FieldType<string, string>;
151
151
  isOptional: true;
152
152
  };
153
153
  status: {
154
- type: _contractspec_lib_schema594.EnumType<[string, string, string, string, string, string, string, string]>;
154
+ type: _contractspec_lib_schema786.EnumType<[string, string, string, string, string, string, string, string]>;
155
155
  isOptional: false;
156
156
  };
157
157
  currentStepId: {
158
- type: _contractspec_lib_schema594.FieldType<string, string>;
158
+ type: _contractspec_lib_schema786.FieldType<string, string>;
159
159
  isOptional: true;
160
160
  };
161
161
  contextData: {
162
- type: _contractspec_lib_schema594.FieldType<unknown, unknown>;
162
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
163
163
  isOptional: true;
164
164
  };
165
165
  triggeredBy: {
166
- type: _contractspec_lib_schema594.FieldType<string, string>;
166
+ type: _contractspec_lib_schema786.FieldType<string, string>;
167
167
  isOptional: false;
168
168
  };
169
169
  organizationId: {
170
- type: _contractspec_lib_schema594.FieldType<string, string>;
170
+ type: _contractspec_lib_schema786.FieldType<string, string>;
171
171
  isOptional: false;
172
172
  };
173
173
  priority: {
174
- type: _contractspec_lib_schema594.FieldType<number, number>;
174
+ type: _contractspec_lib_schema786.FieldType<number, number>;
175
175
  isOptional: false;
176
176
  };
177
177
  dueAt: {
178
- type: _contractspec_lib_schema594.FieldType<Date, string>;
178
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
179
179
  isOptional: true;
180
180
  };
181
181
  outcome: {
182
- type: _contractspec_lib_schema594.FieldType<string, string>;
182
+ type: _contractspec_lib_schema786.FieldType<string, string>;
183
183
  isOptional: true;
184
184
  };
185
185
  resultData: {
186
- type: _contractspec_lib_schema594.FieldType<unknown, unknown>;
186
+ type: _contractspec_lib_schema786.FieldType<unknown, unknown>;
187
187
  isOptional: true;
188
188
  };
189
189
  errorMessage: {
190
- type: _contractspec_lib_schema594.FieldType<string, string>;
190
+ type: _contractspec_lib_schema786.FieldType<string, string>;
191
191
  isOptional: true;
192
192
  };
193
193
  createdAt: {
194
- type: _contractspec_lib_schema594.FieldType<Date, string>;
194
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
195
195
  isOptional: false;
196
196
  };
197
197
  startedAt: {
198
- type: _contractspec_lib_schema594.FieldType<Date, string>;
198
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
199
199
  isOptional: true;
200
200
  };
201
201
  completedAt: {
202
- type: _contractspec_lib_schema594.FieldType<Date, string>;
202
+ type: _contractspec_lib_schema786.FieldType<Date, string>;
203
203
  isOptional: true;
204
204
  };
205
205
  }>;
206
206
  isOptional: false;
207
207
  };
208
208
  previousStepKey: {
209
- type: _contractspec_lib_schema594.FieldType<string, string>;
209
+ type: _contractspec_lib_schema786.FieldType<string, string>;
210
210
  isOptional: true;
211
211
  };
212
212
  currentStepKey: {
213
- type: _contractspec_lib_schema594.FieldType<string, string>;
213
+ type: _contractspec_lib_schema786.FieldType<string, string>;
214
214
  isOptional: true;
215
215
  };
216
216
  message: {
217
- type: _contractspec_lib_schema594.FieldType<string, string>;
217
+ type: _contractspec_lib_schema786.FieldType<string, string>;
218
218
  isOptional: true;
219
219
  };
220
220
  }>;
@@ -1,63 +1,62 @@
1
- import { PresentationSpec } from "@contractspec/lib.contracts";
1
+ import * as _contractspec_lib_contracts29 from "@contractspec/lib.contracts";
2
2
 
3
3
  //#region src/presentations/index.d.ts
4
-
5
4
  /**
6
5
  * Workflow designer canvas for building workflows.
7
6
  */
8
- declare const WorkflowDesignerPresentation: PresentationSpec;
7
+ declare const WorkflowDesignerPresentation: _contractspec_lib_contracts29.PresentationSpec;
9
8
  /**
10
9
  * List of workflow definitions.
11
10
  */
12
- declare const WorkflowListPresentation: PresentationSpec;
11
+ declare const WorkflowListPresentation: _contractspec_lib_contracts29.PresentationSpec;
13
12
  /**
14
13
  * Workflow definition detail view.
15
14
  */
16
- declare const WorkflowDetailPresentation: PresentationSpec;
15
+ declare const WorkflowDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
17
16
  /**
18
17
  * List of running workflow instances.
19
18
  */
20
- declare const InstanceListPresentation: PresentationSpec;
19
+ declare const InstanceListPresentation: _contractspec_lib_contracts29.PresentationSpec;
21
20
  /**
22
21
  * Workflow instance detail view with timeline.
23
22
  */
24
- declare const InstanceDetailPresentation: PresentationSpec;
23
+ declare const InstanceDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
25
24
  /**
26
25
  * Workflow progress tracker widget.
27
26
  */
28
- declare const ProgressTrackerPresentation: PresentationSpec;
27
+ declare const ProgressTrackerPresentation: _contractspec_lib_contracts29.PresentationSpec;
29
28
  /**
30
29
  * Approval inbox - list of pending approvals.
31
30
  */
32
- declare const ApprovalInboxPresentation: PresentationSpec;
31
+ declare const ApprovalInboxPresentation: _contractspec_lib_contracts29.PresentationSpec;
33
32
  /**
34
33
  * Approval request detail view.
35
34
  */
36
- declare const ApprovalDetailPresentation: PresentationSpec;
35
+ declare const ApprovalDetailPresentation: _contractspec_lib_contracts29.PresentationSpec;
37
36
  /**
38
37
  * Approval decision form.
39
38
  */
40
- declare const ApprovalFormPresentation: PresentationSpec;
39
+ declare const ApprovalFormPresentation: _contractspec_lib_contracts29.PresentationSpec;
41
40
  /**
42
41
  * Pending approvals count badge.
43
42
  */
44
- declare const PendingApprovalsBadgePresentation: PresentationSpec;
43
+ declare const PendingApprovalsBadgePresentation: _contractspec_lib_contracts29.PresentationSpec;
45
44
  /**
46
45
  * Workflow metrics dashboard widget.
47
46
  */
48
- declare const WorkflowMetricsPresentation: PresentationSpec;
47
+ declare const WorkflowMetricsPresentation: _contractspec_lib_contracts29.PresentationSpec;
49
48
  declare const WorkflowSystemPresentations: {
50
- WorkflowDesignerPresentation: PresentationSpec;
51
- WorkflowListPresentation: PresentationSpec;
52
- WorkflowDetailPresentation: PresentationSpec;
53
- InstanceListPresentation: PresentationSpec;
54
- InstanceDetailPresentation: PresentationSpec;
55
- ProgressTrackerPresentation: PresentationSpec;
56
- ApprovalInboxPresentation: PresentationSpec;
57
- ApprovalDetailPresentation: PresentationSpec;
58
- ApprovalFormPresentation: PresentationSpec;
59
- PendingApprovalsBadgePresentation: PresentationSpec;
60
- WorkflowMetricsPresentation: PresentationSpec;
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;
61
60
  };
62
61
  //#endregion
63
62
  export { ApprovalDetailPresentation, ApprovalFormPresentation, ApprovalInboxPresentation, InstanceDetailPresentation, InstanceListPresentation, PendingApprovalsBadgePresentation, ProgressTrackerPresentation, WorkflowDesignerPresentation, WorkflowDetailPresentation, WorkflowListPresentation, WorkflowMetricsPresentation, WorkflowSystemPresentations };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":[],"mappings":";;;;AA0CA;AA4BA;AA8BA;AA4Ba,cAlHA,4BAkH4B,EAlHE,gBAyI1C;AAKD;AA8BA;AA4BA;AA4Ba,cAxMA,wBAwM0B,EAxMA,gBA8NtC;AAOD;AA2BA;AA0BA;cA9Pa,4BAA4B;;;;cA8B5B,0BAA0B;;;;cA4B1B,4BAA4B;;;;cA4B5B,6BAA6B;;;;cA8B7B,2BAA2B;;;;cA4B3B,4BAA4B;;;;cA4B5B,0BAA0B;;;;cA6B1B,mCAAmC;;;;cA2BnC,6BAA6B;cA0B7B"}
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"}
@@ -1,13 +1,16 @@
1
1
  import { WorkflowDefinitionModel } from "../workflow/workflow.schema.js";
2
2
  import { WorkflowInstanceModel } from "../instance/instance.schema.js";
3
3
  import { ApprovalRequestModel } from "../approval/approval.schema.js";
4
- import { StabilityEnum } from "@contractspec/lib.contracts";
4
+ import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
5
5
 
6
6
  //#region src/presentations/index.ts
7
7
  /**
8
+ * Workflow System Presentation Descriptors
9
+ */
10
+ /**
8
11
  * Workflow designer canvas for building workflows.
9
12
  */
10
- const WorkflowDesignerPresentation = {
13
+ const WorkflowDesignerPresentation = definePresentation({
11
14
  meta: {
12
15
  key: "workflow.designer",
13
16
  version: "1.0.0",
@@ -32,11 +35,11 @@ const WorkflowDesignerPresentation = {
32
35
  },
33
36
  targets: ["react"],
34
37
  policy: { flags: ["workflow.designer.enabled"] }
35
- };
38
+ });
36
39
  /**
37
40
  * List of workflow definitions.
38
41
  */
39
- const WorkflowListPresentation = {
42
+ const WorkflowListPresentation = definePresentation({
40
43
  meta: {
41
44
  key: "workflow.definition.list",
42
45
  version: "1.0.0",
@@ -61,11 +64,11 @@ const WorkflowListPresentation = {
61
64
  },
62
65
  targets: ["react", "markdown"],
63
66
  policy: { flags: ["workflow.enabled"] }
64
- };
67
+ });
65
68
  /**
66
69
  * Workflow definition detail view.
67
70
  */
68
- const WorkflowDetailPresentation = {
71
+ const WorkflowDetailPresentation = definePresentation({
69
72
  meta: {
70
73
  key: "workflow.definition.detail",
71
74
  version: "1.0.0",
@@ -86,11 +89,11 @@ const WorkflowDetailPresentation = {
86
89
  },
87
90
  targets: ["react", "markdown"],
88
91
  policy: { flags: ["workflow.enabled"] }
89
- };
92
+ });
90
93
  /**
91
94
  * List of running workflow instances.
92
95
  */
93
- const InstanceListPresentation = {
96
+ const InstanceListPresentation = definePresentation({
94
97
  meta: {
95
98
  key: "workflow.instance.list",
96
99
  version: "1.0.0",
@@ -115,11 +118,11 @@ const InstanceListPresentation = {
115
118
  },
116
119
  targets: ["react", "markdown"],
117
120
  policy: { flags: ["workflow.enabled"] }
118
- };
121
+ });
119
122
  /**
120
123
  * Workflow instance detail view with timeline.
121
124
  */
122
- const InstanceDetailPresentation = {
125
+ const InstanceDetailPresentation = definePresentation({
123
126
  meta: {
124
127
  key: "workflow.instance.detail",
125
128
  version: "1.0.0",
@@ -145,11 +148,11 @@ const InstanceDetailPresentation = {
145
148
  },
146
149
  targets: ["react", "markdown"],
147
150
  policy: { flags: ["workflow.enabled"] }
148
- };
151
+ });
149
152
  /**
150
153
  * Workflow progress tracker widget.
151
154
  */
152
- const ProgressTrackerPresentation = {
155
+ const ProgressTrackerPresentation = definePresentation({
153
156
  meta: {
154
157
  key: "workflow.instance.progress",
155
158
  version: "1.0.0",
@@ -174,11 +177,11 @@ const ProgressTrackerPresentation = {
174
177
  },
175
178
  targets: ["react"],
176
179
  policy: { flags: ["workflow.enabled"] }
177
- };
180
+ });
178
181
  /**
179
182
  * Approval inbox - list of pending approvals.
180
183
  */
181
- const ApprovalInboxPresentation = {
184
+ const ApprovalInboxPresentation = definePresentation({
182
185
  meta: {
183
186
  key: "workflow.approval.inbox",
184
187
  version: "1.0.0",
@@ -203,11 +206,11 @@ const ApprovalInboxPresentation = {
203
206
  },
204
207
  targets: ["react", "markdown"],
205
208
  policy: { flags: ["workflow.approvals.enabled"] }
206
- };
209
+ });
207
210
  /**
208
211
  * Approval request detail view.
209
212
  */
210
- const ApprovalDetailPresentation = {
213
+ const ApprovalDetailPresentation = definePresentation({
211
214
  meta: {
212
215
  key: "workflow.approval.detail",
213
216
  version: "1.0.0",
@@ -232,11 +235,11 @@ const ApprovalDetailPresentation = {
232
235
  },
233
236
  targets: ["react", "markdown"],
234
237
  policy: { flags: ["workflow.approvals.enabled"] }
235
- };
238
+ });
236
239
  /**
237
240
  * Approval decision form.
238
241
  */
239
- const ApprovalFormPresentation = {
242
+ const ApprovalFormPresentation = definePresentation({
240
243
  meta: {
241
244
  key: "workflow.approval.form",
242
245
  version: "1.0.0",
@@ -260,11 +263,11 @@ const ApprovalFormPresentation = {
260
263
  },
261
264
  targets: ["react"],
262
265
  policy: { flags: ["workflow.approvals.enabled"] }
263
- };
266
+ });
264
267
  /**
265
268
  * Pending approvals count badge.
266
269
  */
267
- const PendingApprovalsBadgePresentation = {
270
+ const PendingApprovalsBadgePresentation = definePresentation({
268
271
  meta: {
269
272
  key: "workflow.approval.badge",
270
273
  version: "1.0.0",
@@ -289,11 +292,11 @@ const PendingApprovalsBadgePresentation = {
289
292
  },
290
293
  targets: ["react"],
291
294
  policy: { flags: ["workflow.approvals.enabled"] }
292
- };
295
+ });
293
296
  /**
294
297
  * Workflow metrics dashboard widget.
295
298
  */
296
- const WorkflowMetricsPresentation = {
299
+ const WorkflowMetricsPresentation = definePresentation({
297
300
  meta: {
298
301
  key: "workflow.metrics",
299
302
  version: "1.0.0",
@@ -317,7 +320,7 @@ const WorkflowMetricsPresentation = {
317
320
  },
318
321
  targets: ["react", "markdown"],
319
322
  policy: { flags: ["workflow.metrics.enabled"] }
320
- };
323
+ });
321
324
  const WorkflowSystemPresentations = {
322
325
  WorkflowDesignerPresentation,
323
326
  WorkflowListPresentation,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["WorkflowDesignerPresentation: PresentationSpec","WorkflowListPresentation: PresentationSpec","WorkflowDetailPresentation: PresentationSpec","InstanceListPresentation: PresentationSpec","InstanceDetailPresentation: PresentationSpec","ProgressTrackerPresentation: PresentationSpec","ApprovalInboxPresentation: PresentationSpec","ApprovalDetailPresentation: PresentationSpec","ApprovalFormPresentation: PresentationSpec","PendingApprovalsBadgePresentation: PresentationSpec","WorkflowMetricsPresentation: PresentationSpec"],"sources":["../../src/presentations/index.ts"],"sourcesContent":["/**\n * Workflow System Presentation Descriptors\n */\nimport type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { WorkflowDefinitionModel } from '../workflow/workflow.schema';\nimport { WorkflowInstanceModel } from '../instance/instance.schema';\nimport { ApprovalRequestModel } from '../approval/approval.schema';\n\n// ============ Workflow Definition Presentations ============\n\n/**\n * Workflow designer canvas for building workflows.\n */\nexport const WorkflowDesignerPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.designer',\n version: '1.0.0',\n title: 'Workflow Designer',\n description: 'Visual workflow designer with drag-and-drop steps',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'designer', 'admin'],\n stability: StabilityEnum.Experimental,\n goal: 'Building and modifying workflow definitions',\n context: 'Workflow administration and setup',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowDesigner',\n props: WorkflowDefinitionModel,\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.designer.enabled'],\n },\n};\n\n/**\n * List of workflow definitions.\n */\nexport const WorkflowListPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.definition.list',\n version: '1.0.0',\n title: 'Workflow List',\n description: 'List of workflow definitions with status and actions',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'list', 'admin'],\n stability: StabilityEnum.Experimental,\n goal: 'Overview of all defined workflows',\n context: 'Workflow management dashboard',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowDefinitionList',\n props: WorkflowDefinitionModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n};\n\n/**\n * Workflow definition detail view.\n */\nexport const WorkflowDetailPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.definition.detail',\n version: '1.0.0',\n title: 'Workflow Details',\n description: 'Detailed view of a workflow definition with steps',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Viewing technical details of a workflow definition',\n context: 'Workflow inspection and debugging',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowDefinitionDetail',\n props: WorkflowDefinitionModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n};\n\n// ============ Workflow Instance Presentations ============\n\n/**\n * List of running workflow instances.\n */\nexport const InstanceListPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.instance.list',\n version: '1.0.0',\n title: 'Instance List',\n description: 'List of workflow instances with status and progress',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'instance', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitoring active and past workflow executions',\n context: 'Operations monitoring',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowInstanceList',\n props: WorkflowInstanceModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n};\n\n/**\n * Workflow instance detail view with timeline.\n */\nexport const InstanceDetailPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.instance.detail',\n version: '1.0.0',\n title: 'Instance Details',\n description: 'Detailed view of a workflow instance with step timeline',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'instance', 'detail', 'timeline'],\n stability: StabilityEnum.Experimental,\n goal: 'Detailed inspection of a specific workflow instance',\n context: 'Case management and troubleshooting',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowInstanceDetail',\n props: WorkflowInstanceModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n};\n\n/**\n * Workflow progress tracker widget.\n */\nexport const ProgressTrackerPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.instance.progress',\n version: '1.0.0',\n title: 'Progress Tracker',\n description: 'Visual progress tracker showing current step in workflow',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'progress', 'widget'],\n stability: StabilityEnum.Experimental,\n goal: 'Quick view of current progress for a workflow',\n context: 'Embedded progress indicator in entity views',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowProgressTracker',\n props: WorkflowInstanceModel,\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.enabled'],\n },\n};\n\n// ============ Approval Presentations ============\n\n/**\n * Approval inbox - list of pending approvals.\n */\nexport const ApprovalInboxPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.approval.inbox',\n version: '1.0.0',\n title: 'Approval Inbox',\n description: 'Inbox showing pending approval requests for current user',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'inbox'],\n stability: StabilityEnum.Experimental,\n goal: 'Managing personal workload of approval requests',\n context: 'Personal task management',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ApprovalInbox',\n props: ApprovalRequestModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n};\n\n/**\n * Approval request detail view.\n */\nexport const ApprovalDetailPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.approval.detail',\n version: '1.0.0',\n title: 'Approval Details',\n description: 'Detailed approval request view with context and actions',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Decision support for an approval request',\n context: 'Specific approval action',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ApprovalRequestDetail',\n props: ApprovalRequestModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n};\n\n/**\n * Approval decision form.\n */\nexport const ApprovalFormPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.approval.form',\n version: '1.0.0',\n title: 'Approval Form',\n description: 'Form for submitting approval decisions',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'form'],\n stability: StabilityEnum.Experimental,\n goal: 'Submitting a decision on an approval request',\n context: 'Approval decision dialog',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ApprovalDecisionForm',\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n};\n\n// ============ Dashboard Widgets ============\n\n/**\n * Pending approvals count badge.\n */\nexport const PendingApprovalsBadgePresentation: PresentationSpec = {\n meta: {\n key: 'workflow.approval.badge',\n version: '1.0.0',\n title: 'Pending Approvals Badge',\n description: 'Badge showing count of pending approvals',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'badge', 'widget'],\n stability: StabilityEnum.Experimental,\n goal: 'Visual notification of pending approvals',\n context: 'Global navigation or sidebar',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'PendingApprovalsBadge',\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n};\n\n/**\n * Workflow metrics dashboard widget.\n */\nexport const WorkflowMetricsPresentation: PresentationSpec = {\n meta: {\n key: 'workflow.metrics',\n version: '1.0.0',\n title: 'Workflow Metrics',\n description: 'Dashboard widget showing workflow metrics and statistics',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'metrics', 'dashboard'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitoring throughput and bottlenecks',\n context: 'System performance dashboard',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowMetricsDashboard',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.metrics.enabled'],\n },\n};\n\n// ============ All Presentations ============\n\nexport const WorkflowSystemPresentations = {\n // Definition\n WorkflowDesignerPresentation,\n WorkflowListPresentation,\n WorkflowDetailPresentation,\n\n // Instance\n InstanceListPresentation,\n InstanceDetailPresentation,\n ProgressTrackerPresentation,\n\n // Approval\n ApprovalInboxPresentation,\n ApprovalDetailPresentation,\n ApprovalFormPresentation,\n PendingApprovalsBadgePresentation,\n\n // Dashboard\n WorkflowMetricsPresentation,\n};\n"],"mappings":";;;;;;;;;AAcA,MAAaA,+BAAiD;CAC5D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAY;GAAQ;EACvC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,4BAA4B,EACrC;CACF;;;;AAKD,MAAaC,2BAA6C;CACxD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAQ;GAAQ;EACnC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,mBAAmB,EAC5B;CACF;;;;AAKD,MAAaC,6BAA+C;CAC1D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM,CAAC,YAAY,SAAS;EAC5B,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAA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CACF;;;;AAKD,MAAaC,8BAAgD;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAW;GAAY;EAC1C,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF;AAID,MAAa,8BAA8B;CAEzC;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":["/**\n * Workflow System Presentation Descriptors\n */\nimport { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport { WorkflowDefinitionModel } from '../workflow/workflow.schema';\nimport { WorkflowInstanceModel } from '../instance/instance.schema';\nimport { ApprovalRequestModel } from '../approval/approval.schema';\n\n// ============ Workflow Definition Presentations ============\n\n/**\n * Workflow designer canvas for building workflows.\n */\nexport const WorkflowDesignerPresentation = definePresentation({\n meta: {\n key: 'workflow.designer',\n version: '1.0.0',\n title: 'Workflow Designer',\n description: 'Visual workflow designer with drag-and-drop steps',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'designer', 'admin'],\n stability: StabilityEnum.Experimental,\n goal: 'Building and modifying workflow definitions',\n context: 'Workflow administration and setup',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowDesigner',\n props: WorkflowDefinitionModel,\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.designer.enabled'],\n },\n});\n\n/**\n * List of workflow definitions.\n */\nexport const WorkflowListPresentation = definePresentation({\n meta: {\n key: 'workflow.definition.list',\n version: '1.0.0',\n title: 'Workflow List',\n description: 'List of workflow definitions with status and actions',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'list', 'admin'],\n stability: StabilityEnum.Experimental,\n goal: 'Overview of all defined workflows',\n context: 'Workflow management dashboard',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowDefinitionList',\n props: WorkflowDefinitionModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n});\n\n/**\n * Workflow definition detail view.\n */\nexport const WorkflowDetailPresentation = definePresentation({\n meta: {\n key: 'workflow.definition.detail',\n version: '1.0.0',\n title: 'Workflow Details',\n description: 'Detailed view of a workflow definition with steps',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Viewing technical details of a workflow definition',\n context: 'Workflow inspection and debugging',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowDefinitionDetail',\n props: WorkflowDefinitionModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n});\n\n// ============ Workflow Instance Presentations ============\n\n/**\n * List of running workflow instances.\n */\nexport const InstanceListPresentation = definePresentation({\n meta: {\n key: 'workflow.instance.list',\n version: '1.0.0',\n title: 'Instance List',\n description: 'List of workflow instances with status and progress',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'instance', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitoring active and past workflow executions',\n context: 'Operations monitoring',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowInstanceList',\n props: WorkflowInstanceModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n});\n\n/**\n * Workflow instance detail view with timeline.\n */\nexport const InstanceDetailPresentation = definePresentation({\n meta: {\n key: 'workflow.instance.detail',\n version: '1.0.0',\n title: 'Instance Details',\n description: 'Detailed view of a workflow instance with step timeline',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'instance', 'detail', 'timeline'],\n stability: StabilityEnum.Experimental,\n goal: 'Detailed inspection of a specific workflow instance',\n context: 'Case management and troubleshooting',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowInstanceDetail',\n props: WorkflowInstanceModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.enabled'],\n },\n});\n\n/**\n * Workflow progress tracker widget.\n */\nexport const ProgressTrackerPresentation = definePresentation({\n meta: {\n key: 'workflow.instance.progress',\n version: '1.0.0',\n title: 'Progress Tracker',\n description: 'Visual progress tracker showing current step in workflow',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'progress', 'widget'],\n stability: StabilityEnum.Experimental,\n goal: 'Quick view of current progress for a workflow',\n context: 'Embedded progress indicator in entity views',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowProgressTracker',\n props: WorkflowInstanceModel,\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.enabled'],\n },\n});\n\n// ============ Approval Presentations ============\n\n/**\n * Approval inbox - list of pending approvals.\n */\nexport const ApprovalInboxPresentation = definePresentation({\n meta: {\n key: 'workflow.approval.inbox',\n version: '1.0.0',\n title: 'Approval Inbox',\n description: 'Inbox showing pending approval requests for current user',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'inbox'],\n stability: StabilityEnum.Experimental,\n goal: 'Managing personal workload of approval requests',\n context: 'Personal task management',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ApprovalInbox',\n props: ApprovalRequestModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n});\n\n/**\n * Approval request detail view.\n */\nexport const ApprovalDetailPresentation = definePresentation({\n meta: {\n key: 'workflow.approval.detail',\n version: '1.0.0',\n title: 'Approval Details',\n description: 'Detailed approval request view with context and actions',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Decision support for an approval request',\n context: 'Specific approval action',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ApprovalRequestDetail',\n props: ApprovalRequestModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n});\n\n/**\n * Approval decision form.\n */\nexport const ApprovalFormPresentation = definePresentation({\n meta: {\n key: 'workflow.approval.form',\n version: '1.0.0',\n title: 'Approval Form',\n description: 'Form for submitting approval decisions',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'form'],\n stability: StabilityEnum.Experimental,\n goal: 'Submitting a decision on an approval request',\n context: 'Approval decision dialog',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ApprovalDecisionForm',\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n});\n\n// ============ Dashboard Widgets ============\n\n/**\n * Pending approvals count badge.\n */\nexport const PendingApprovalsBadgePresentation = definePresentation({\n meta: {\n key: 'workflow.approval.badge',\n version: '1.0.0',\n title: 'Pending Approvals Badge',\n description: 'Badge showing count of pending approvals',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'approval', 'badge', 'widget'],\n stability: StabilityEnum.Experimental,\n goal: 'Visual notification of pending approvals',\n context: 'Global navigation or sidebar',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'PendingApprovalsBadge',\n },\n targets: ['react'],\n policy: {\n flags: ['workflow.approvals.enabled'],\n },\n});\n\n/**\n * Workflow metrics dashboard widget.\n */\nexport const WorkflowMetricsPresentation = definePresentation({\n meta: {\n key: 'workflow.metrics',\n version: '1.0.0',\n title: 'Workflow Metrics',\n description: 'Dashboard widget showing workflow metrics and statistics',\n domain: 'workflow-system',\n owners: ['@workflow-team'],\n tags: ['workflow', 'metrics', 'dashboard'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitoring throughput and bottlenecks',\n context: 'System performance dashboard',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'WorkflowMetricsDashboard',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['workflow.metrics.enabled'],\n },\n});\n\n// ============ All Presentations ============\n\nexport const WorkflowSystemPresentations = {\n // Definition\n WorkflowDesignerPresentation,\n WorkflowListPresentation,\n WorkflowDetailPresentation,\n\n // Instance\n InstanceListPresentation,\n InstanceDetailPresentation,\n ProgressTrackerPresentation,\n\n // Approval\n ApprovalInboxPresentation,\n ApprovalDetailPresentation,\n ApprovalFormPresentation,\n PendingApprovalsBadgePresentation,\n\n // Dashboard\n WorkflowMetricsPresentation,\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,+BAA+B,mBAAmB;CAC7D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAY;GAAQ;EACvC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,4BAA4B,EACrC;CACF,CAAC;;;;AAKF,MAAa,2BAA2B,mBAAmB;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAQ;GAAQ;EACnC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,mBAAmB,EAC5B;CACF,CAAC;;;;AAKF,MAAa,6BAA6B,mBAAmB;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QA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ACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAY;GAAS;GAAS;EACjD,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,6BAA6B,EACtC;CACF,CAAC;;;;AAKF,MAAa,8BAA8B,mBAAmB;CAC5D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAW;GAAY;EAC1C,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF,CAAC;AAIF,MAAa,8BAA8B;CAEzC;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACD"}
@@ -0,0 +1,10 @@
1
+ import { DatabasePort } from "@contractspec/lib.runtime-sandbox";
2
+
3
+ //#region src/seeders/index.d.ts
4
+ declare function seedWorkflowSystem(params: {
5
+ projectId: string;
6
+ db: DatabasePort;
7
+ }): Promise<void>;
8
+ //#endregion
9
+ export { seedWorkflowSystem };
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":[],"mappings":";;;iBAEsB,kBAAA;;EAAA,EAAA,EAEhB,YAFgB;IAGrB"}
@@ -0,0 +1,19 @@
1
+ //#region src/seeders/index.ts
2
+ async function seedWorkflowSystem(params) {
3
+ const { projectId, db } = params;
4
+ if ((await db.query(`SELECT COUNT(*) as count FROM workflow_definition WHERE "projectId" = $1`, [projectId])).rows[0]?.count > 0) return;
5
+ await db.execute(`INSERT INTO workflow_definition (id, "projectId", "organizationId", name, description, type, status)
6
+ VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
7
+ "wf_1",
8
+ projectId,
9
+ "org_demo",
10
+ "Approval Workflow",
11
+ "Demo approval workflow",
12
+ "APPROVAL",
13
+ "ACTIVE"
14
+ ]);
15
+ }
16
+
17
+ //#endregion
18
+ export { seedWorkflowSystem };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":["import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';\n\nexport async function seedWorkflowSystem(params: {\n projectId: string;\n db: DatabasePort;\n}) {\n const { projectId, db } = params;\n\n const existing = await db.query(\n `SELECT COUNT(*) as count FROM workflow_definition WHERE \"projectId\" = $1`,\n [projectId]\n );\n if ((existing.rows[0]?.count as number) > 0) return;\n\n await db.execute(\n `INSERT INTO workflow_definition (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'wf_1',\n projectId,\n 'org_demo',\n 'Approval Workflow',\n 'Demo approval workflow',\n 'APPROVAL',\n 'ACTIVE',\n ]\n );\n}\n"],"mappings":";AAEA,eAAsB,mBAAmB,QAGtC;CACD,MAAM,EAAE,WAAW,OAAO;AAM1B,MAJiB,MAAM,GAAG,MACxB,4EACA,CAAC,UAAU,CACZ,EACa,KAAK,IAAI,QAAmB,EAAG;AAE7C,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF"}