@contractspec/example.workflow-system 1.44.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 (121) 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 +40 -0
  51. package/dist/example.d.ts.map +1 -0
  52. package/dist/example.js +51 -0
  53. package/dist/example.js.map +1 -0
  54. package/dist/index.d.ts +21 -0
  55. package/dist/index.js +21 -0
  56. package/dist/instance/index.d.ts +5 -0
  57. package/dist/instance/index.js +6 -0
  58. package/dist/instance/instance.enum.d.ts +10 -0
  59. package/dist/instance/instance.enum.d.ts.map +1 -0
  60. package/dist/instance/instance.enum.js +20 -0
  61. package/dist/instance/instance.enum.js.map +1 -0
  62. package/dist/instance/instance.event.d.ts +356 -0
  63. package/dist/instance/instance.event.d.ts.map +1 -0
  64. package/dist/instance/instance.event.js +293 -0
  65. package/dist/instance/instance.event.js.map +1 -0
  66. package/dist/instance/instance.handler.d.ts +27 -0
  67. package/dist/instance/instance.handler.d.ts.map +1 -0
  68. package/dist/instance/instance.handler.js +94 -0
  69. package/dist/instance/instance.handler.js.map +1 -0
  70. package/dist/instance/instance.operations.d.ts +1024 -0
  71. package/dist/instance/instance.operations.d.ts.map +1 -0
  72. package/dist/instance/instance.operations.js +464 -0
  73. package/dist/instance/instance.operations.js.map +1 -0
  74. package/dist/instance/instance.schema.d.ts +223 -0
  75. package/dist/instance/instance.schema.d.ts.map +1 -0
  76. package/dist/instance/instance.schema.js +172 -0
  77. package/dist/instance/instance.schema.js.map +1 -0
  78. package/dist/presentations/index.d.ts +64 -0
  79. package/dist/presentations/index.d.ts.map +1 -0
  80. package/dist/presentations/index.js +337 -0
  81. package/dist/presentations/index.js.map +1 -0
  82. package/dist/shared/index.d.ts +3 -0
  83. package/dist/shared/index.js +3 -0
  84. package/dist/shared/mock-data.d.ts +19 -0
  85. package/dist/shared/mock-data.d.ts.map +1 -0
  86. package/dist/shared/mock-data.js +12 -0
  87. package/dist/shared/mock-data.js.map +1 -0
  88. package/dist/shared/types.d.ts +81 -0
  89. package/dist/shared/types.d.ts.map +1 -0
  90. package/dist/shared/types.js +0 -0
  91. package/dist/state-machine/index.d.ts +148 -0
  92. package/dist/state-machine/index.d.ts.map +1 -0
  93. package/dist/state-machine/index.js +158 -0
  94. package/dist/state-machine/index.js.map +1 -0
  95. package/dist/workflow/index.d.ts +5 -0
  96. package/dist/workflow/index.js +6 -0
  97. package/dist/workflow/workflow.enum.d.ts +22 -0
  98. package/dist/workflow/workflow.enum.d.ts.map +1 -0
  99. package/dist/workflow/workflow.enum.js +47 -0
  100. package/dist/workflow/workflow.enum.js.map +1 -0
  101. package/dist/workflow/workflow.event.d.ts +135 -0
  102. package/dist/workflow/workflow.event.d.ts.map +1 -0
  103. package/dist/workflow/workflow.event.js +150 -0
  104. package/dist/workflow/workflow.event.js.map +1 -0
  105. package/dist/workflow/workflow.handler.d.ts +29 -0
  106. package/dist/workflow/workflow.handler.d.ts.map +1 -0
  107. package/dist/workflow/workflow.handler.js +66 -0
  108. package/dist/workflow/workflow.handler.js.map +1 -0
  109. package/dist/workflow/workflow.operations.d.ts +1011 -0
  110. package/dist/workflow/workflow.operations.d.ts.map +1 -0
  111. package/dist/workflow/workflow.operations.js +345 -0
  112. package/dist/workflow/workflow.operations.js.map +1 -0
  113. package/dist/workflow/workflow.schema.d.ts +265 -0
  114. package/dist/workflow/workflow.schema.d.ts.map +1 -0
  115. package/dist/workflow/workflow.schema.js +249 -0
  116. package/dist/workflow/workflow.schema.js.map +1 -0
  117. package/dist/workflow-system.feature.d.ts +12 -0
  118. package/dist/workflow-system.feature.d.ts.map +1 -0
  119. package/dist/workflow-system.feature.js +339 -0
  120. package/dist/workflow-system.feature.js.map +1 -0
  121. package/package.json +124 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval.handler.js","names":["request: ApprovalRequestRecord"],"sources":["../../src/approval/approval.handler.ts"],"sourcesContent":["/**\n * Approval handlers.\n */\n\nimport type {\n ApprovalRequestRecord,\n WorkflowInstanceRecord,\n WorkflowStepRecord,\n HandlerContext,\n} from '../shared/types';\nimport { mockDataStore } from '../shared/mock-data';\nimport { handleTransitionWorkflow } from '../instance/instance.handler';\n\nexport async function createApprovalRequests(\n instance: WorkflowInstanceRecord,\n step: WorkflowStepRecord,\n _context: HandlerContext\n): Promise<void> {\n const now = new Date();\n\n // Create approval request for each approver role\n // In production, this would resolve roles to actual users\n for (let i = 0; i < step.approverRoles.length; i++) {\n const role = step.approverRoles[i];\n const id = `approval_${Date.now()}_${i}`;\n\n const request: ApprovalRequestRecord = {\n id,\n workflowInstanceId: instance.id,\n stepExecutionId: `exec_${instance.id}_${step.id}`,\n approverId: `user_${role}`, // In production, resolve to actual user\n approverRole: role,\n title: `Approval required for ${step.name}`,\n description: step.description,\n status: 'PENDING',\n contextSnapshot: instance.contextData,\n sequenceOrder: i,\n createdAt: now,\n updatedAt: now,\n };\n\n mockDataStore.approvals.set(id, request);\n }\n}\n\nexport async function handleSubmitDecision(\n input: {\n requestId: string;\n decision: 'APPROVE' | 'REJECT' | 'REQUEST_CHANGES' | 'DELEGATE' | 'ABSTAIN';\n comment?: string;\n data?: Record<string, unknown>;\n },\n context: HandlerContext\n): Promise<ApprovalRequestRecord> {\n const request = mockDataStore.approvals.get(input.requestId);\n if (!request) {\n throw new Error(`Approval request ${input.requestId} not found`);\n }\n\n // Verify approver\n if (\n request.approverId !== context.userId &&\n !context.userRoles.includes(request.approverRole ?? '')\n ) {\n throw new Error('User is not authorized to make this decision');\n }\n\n const now = new Date();\n request.decision = input.decision;\n request.decisionComment = input.comment;\n request.decidedAt = now;\n request.updatedAt = now;\n\n if (input.decision === 'APPROVE') {\n request.status = 'APPROVED';\n // Trigger workflow transition\n await handleTransitionWorkflow(\n {\n instanceId: request.workflowInstanceId,\n action: 'approve',\n data: input.data,\n comment: input.comment,\n },\n context\n );\n } else if (input.decision === 'REJECT') {\n request.status = 'REJECTED';\n await handleTransitionWorkflow(\n {\n instanceId: request.workflowInstanceId,\n action: 'reject',\n data: input.data,\n comment: input.comment,\n },\n context\n );\n }\n\n return request;\n}\n\nexport async function handleListMyApprovals(\n input: {\n status?:\n | 'PENDING'\n | 'APPROVED'\n | 'REJECTED'\n | 'DELEGATED'\n | 'ESCALATED'\n | 'WITHDRAWN'\n | 'EXPIRED';\n limit?: number;\n offset?: number;\n },\n context: HandlerContext\n): Promise<{\n requests: ApprovalRequestRecord[];\n total: number;\n pendingCount: number;\n}> {\n let requests = Array.from(mockDataStore.approvals.values()).filter(\n (r) =>\n r.approverId === context.userId ||\n context.userRoles.includes(r.approverRole ?? '')\n );\n\n const pendingCount = requests.filter((r) => r.status === 'PENDING').length;\n\n if (input.status) {\n requests = requests.filter((r) => r.status === input.status);\n }\n\n const total = requests.length;\n const offset = input.offset ?? 0;\n const limit = input.limit ?? 20;\n\n requests = requests\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime())\n .slice(offset, offset + limit);\n\n return { requests, total, pendingCount };\n}\n"],"mappings":";;;;AAaA,eAAsB,uBACpB,UACA,MACA,UACe;CACf,MAAM,sBAAM,IAAI,MAAM;AAItB,MAAK,IAAI,IAAI,GAAG,IAAI,KAAK,cAAc,QAAQ,KAAK;EAClD,MAAM,OAAO,KAAK,cAAc;EAChC,MAAM,KAAK,YAAY,KAAK,KAAK,CAAC,GAAG;EAErC,MAAMA,UAAiC;GACrC;GACA,oBAAoB,SAAS;GAC7B,iBAAiB,QAAQ,SAAS,GAAG,GAAG,KAAK;GAC7C,YAAY,QAAQ;GACpB,cAAc;GACd,OAAO,yBAAyB,KAAK;GACrC,aAAa,KAAK;GAClB,QAAQ;GACR,iBAAiB,SAAS;GA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AS,GAAG,EAAE,UAAU,SAAS,CAAC,CAC7D,MAAM,QAAQ,SAAS,MAAM;AAEhC,QAAO;EAAE;EAAU;EAAO;EAAc"}
@@ -0,0 +1,535 @@
1
+ import * as _contractspec_lib_schema331 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/approval/approval.operations.d.ts
5
+ /**
6
+ * Approve or reject an approval request.
7
+ */
8
+ declare const SubmitDecisionContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema331.SchemaModel<{
9
+ requestId: {
10
+ type: _contractspec_lib_schema331.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ decision: {
14
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
15
+ isOptional: false;
16
+ };
17
+ comment: {
18
+ type: _contractspec_lib_schema331.FieldType<string, string>;
19
+ isOptional: true;
20
+ };
21
+ data: {
22
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
23
+ isOptional: true;
24
+ };
25
+ }>, _contractspec_lib_schema331.SchemaModel<{
26
+ id: {
27
+ type: _contractspec_lib_schema331.FieldType<string, string>;
28
+ isOptional: false;
29
+ };
30
+ workflowInstanceId: {
31
+ type: _contractspec_lib_schema331.FieldType<string, string>;
32
+ isOptional: false;
33
+ };
34
+ stepExecutionId: {
35
+ type: _contractspec_lib_schema331.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ approverId: {
39
+ type: _contractspec_lib_schema331.FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ approverRole: {
43
+ type: _contractspec_lib_schema331.FieldType<string, string>;
44
+ isOptional: true;
45
+ };
46
+ title: {
47
+ type: _contractspec_lib_schema331.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ description: {
51
+ type: _contractspec_lib_schema331.FieldType<string, string>;
52
+ isOptional: true;
53
+ };
54
+ status: {
55
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
56
+ isOptional: false;
57
+ };
58
+ decision: {
59
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
60
+ isOptional: true;
61
+ };
62
+ decisionComment: {
63
+ type: _contractspec_lib_schema331.FieldType<string, string>;
64
+ isOptional: true;
65
+ };
66
+ decidedAt: {
67
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
68
+ isOptional: true;
69
+ };
70
+ dueAt: {
71
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
72
+ isOptional: true;
73
+ };
74
+ contextSnapshot: {
75
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
76
+ isOptional: true;
77
+ };
78
+ sequenceOrder: {
79
+ type: _contractspec_lib_schema331.FieldType<number, number>;
80
+ isOptional: false;
81
+ };
82
+ createdAt: {
83
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
84
+ isOptional: false;
85
+ };
86
+ }>, {
87
+ key: string;
88
+ version: number;
89
+ when: string;
90
+ payload: _contractspec_lib_schema331.SchemaModel<{
91
+ id: {
92
+ type: _contractspec_lib_schema331.FieldType<string, string>;
93
+ isOptional: false;
94
+ };
95
+ workflowInstanceId: {
96
+ type: _contractspec_lib_schema331.FieldType<string, string>;
97
+ isOptional: false;
98
+ };
99
+ stepExecutionId: {
100
+ type: _contractspec_lib_schema331.FieldType<string, string>;
101
+ isOptional: false;
102
+ };
103
+ approverId: {
104
+ type: _contractspec_lib_schema331.FieldType<string, string>;
105
+ isOptional: false;
106
+ };
107
+ approverRole: {
108
+ type: _contractspec_lib_schema331.FieldType<string, string>;
109
+ isOptional: true;
110
+ };
111
+ title: {
112
+ type: _contractspec_lib_schema331.FieldType<string, string>;
113
+ isOptional: false;
114
+ };
115
+ description: {
116
+ type: _contractspec_lib_schema331.FieldType<string, string>;
117
+ isOptional: true;
118
+ };
119
+ status: {
120
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
121
+ isOptional: false;
122
+ };
123
+ decision: {
124
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
125
+ isOptional: true;
126
+ };
127
+ decisionComment: {
128
+ type: _contractspec_lib_schema331.FieldType<string, string>;
129
+ isOptional: true;
130
+ };
131
+ decidedAt: {
132
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
133
+ isOptional: true;
134
+ };
135
+ dueAt: {
136
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
137
+ isOptional: true;
138
+ };
139
+ contextSnapshot: {
140
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
141
+ isOptional: true;
142
+ };
143
+ sequenceOrder: {
144
+ type: _contractspec_lib_schema331.FieldType<number, number>;
145
+ isOptional: false;
146
+ };
147
+ createdAt: {
148
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
149
+ isOptional: false;
150
+ };
151
+ }>;
152
+ }[]>;
153
+ /**
154
+ * Delegate an approval to another user.
155
+ */
156
+ declare const DelegateApprovalContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema331.SchemaModel<{
157
+ requestId: {
158
+ type: _contractspec_lib_schema331.FieldType<string, string>;
159
+ isOptional: false;
160
+ };
161
+ delegateTo: {
162
+ type: _contractspec_lib_schema331.FieldType<string, string>;
163
+ isOptional: false;
164
+ };
165
+ reason: {
166
+ type: _contractspec_lib_schema331.FieldType<string, string>;
167
+ isOptional: true;
168
+ };
169
+ }>, _contractspec_lib_schema331.SchemaModel<{
170
+ id: {
171
+ type: _contractspec_lib_schema331.FieldType<string, string>;
172
+ isOptional: false;
173
+ };
174
+ workflowInstanceId: {
175
+ type: _contractspec_lib_schema331.FieldType<string, string>;
176
+ isOptional: false;
177
+ };
178
+ stepExecutionId: {
179
+ type: _contractspec_lib_schema331.FieldType<string, string>;
180
+ isOptional: false;
181
+ };
182
+ approverId: {
183
+ type: _contractspec_lib_schema331.FieldType<string, string>;
184
+ isOptional: false;
185
+ };
186
+ approverRole: {
187
+ type: _contractspec_lib_schema331.FieldType<string, string>;
188
+ isOptional: true;
189
+ };
190
+ title: {
191
+ type: _contractspec_lib_schema331.FieldType<string, string>;
192
+ isOptional: false;
193
+ };
194
+ description: {
195
+ type: _contractspec_lib_schema331.FieldType<string, string>;
196
+ isOptional: true;
197
+ };
198
+ status: {
199
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
200
+ isOptional: false;
201
+ };
202
+ decision: {
203
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
204
+ isOptional: true;
205
+ };
206
+ decisionComment: {
207
+ type: _contractspec_lib_schema331.FieldType<string, string>;
208
+ isOptional: true;
209
+ };
210
+ decidedAt: {
211
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
212
+ isOptional: true;
213
+ };
214
+ dueAt: {
215
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
216
+ isOptional: true;
217
+ };
218
+ contextSnapshot: {
219
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
220
+ isOptional: true;
221
+ };
222
+ sequenceOrder: {
223
+ type: _contractspec_lib_schema331.FieldType<number, number>;
224
+ isOptional: false;
225
+ };
226
+ createdAt: {
227
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
228
+ isOptional: false;
229
+ };
230
+ }>, {
231
+ key: string;
232
+ version: number;
233
+ when: string;
234
+ payload: _contractspec_lib_schema331.SchemaModel<{
235
+ id: {
236
+ type: _contractspec_lib_schema331.FieldType<string, string>;
237
+ isOptional: false;
238
+ };
239
+ workflowInstanceId: {
240
+ type: _contractspec_lib_schema331.FieldType<string, string>;
241
+ isOptional: false;
242
+ };
243
+ stepExecutionId: {
244
+ type: _contractspec_lib_schema331.FieldType<string, string>;
245
+ isOptional: false;
246
+ };
247
+ approverId: {
248
+ type: _contractspec_lib_schema331.FieldType<string, string>;
249
+ isOptional: false;
250
+ };
251
+ approverRole: {
252
+ type: _contractspec_lib_schema331.FieldType<string, string>;
253
+ isOptional: true;
254
+ };
255
+ title: {
256
+ type: _contractspec_lib_schema331.FieldType<string, string>;
257
+ isOptional: false;
258
+ };
259
+ description: {
260
+ type: _contractspec_lib_schema331.FieldType<string, string>;
261
+ isOptional: true;
262
+ };
263
+ status: {
264
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
265
+ isOptional: false;
266
+ };
267
+ decision: {
268
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
269
+ isOptional: true;
270
+ };
271
+ decisionComment: {
272
+ type: _contractspec_lib_schema331.FieldType<string, string>;
273
+ isOptional: true;
274
+ };
275
+ decidedAt: {
276
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
277
+ isOptional: true;
278
+ };
279
+ dueAt: {
280
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
281
+ isOptional: true;
282
+ };
283
+ contextSnapshot: {
284
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
285
+ isOptional: true;
286
+ };
287
+ sequenceOrder: {
288
+ type: _contractspec_lib_schema331.FieldType<number, number>;
289
+ isOptional: false;
290
+ };
291
+ createdAt: {
292
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
293
+ isOptional: false;
294
+ };
295
+ }>;
296
+ }[]>;
297
+ /**
298
+ * Add a comment to an approval request.
299
+ */
300
+ declare const AddApprovalCommentContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema331.SchemaModel<{
301
+ requestId: {
302
+ type: _contractspec_lib_schema331.FieldType<string, string>;
303
+ isOptional: false;
304
+ };
305
+ content: {
306
+ type: _contractspec_lib_schema331.FieldType<string, string>;
307
+ isOptional: false;
308
+ };
309
+ isInternal: {
310
+ type: _contractspec_lib_schema331.FieldType<boolean, boolean>;
311
+ isOptional: true;
312
+ };
313
+ }>, _contractspec_lib_schema331.SchemaModel<{
314
+ id: {
315
+ type: _contractspec_lib_schema331.FieldType<string, string>;
316
+ isOptional: false;
317
+ };
318
+ approvalRequestId: {
319
+ type: _contractspec_lib_schema331.FieldType<string, string>;
320
+ isOptional: false;
321
+ };
322
+ authorId: {
323
+ type: _contractspec_lib_schema331.FieldType<string, string>;
324
+ isOptional: false;
325
+ };
326
+ content: {
327
+ type: _contractspec_lib_schema331.FieldType<string, string>;
328
+ isOptional: false;
329
+ };
330
+ isInternal: {
331
+ type: _contractspec_lib_schema331.FieldType<boolean, boolean>;
332
+ isOptional: false;
333
+ };
334
+ createdAt: {
335
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
336
+ isOptional: false;
337
+ };
338
+ }>, {
339
+ key: string;
340
+ version: number;
341
+ when: string;
342
+ payload: _contractspec_lib_schema331.SchemaModel<{
343
+ id: {
344
+ type: _contractspec_lib_schema331.FieldType<string, string>;
345
+ isOptional: false;
346
+ };
347
+ approvalRequestId: {
348
+ type: _contractspec_lib_schema331.FieldType<string, string>;
349
+ isOptional: false;
350
+ };
351
+ authorId: {
352
+ type: _contractspec_lib_schema331.FieldType<string, string>;
353
+ isOptional: false;
354
+ };
355
+ content: {
356
+ type: _contractspec_lib_schema331.FieldType<string, string>;
357
+ isOptional: false;
358
+ };
359
+ isInternal: {
360
+ type: _contractspec_lib_schema331.FieldType<boolean, boolean>;
361
+ isOptional: false;
362
+ };
363
+ createdAt: {
364
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
365
+ isOptional: false;
366
+ };
367
+ }>;
368
+ }[]>;
369
+ /**
370
+ * List approvals assigned to the current user.
371
+ */
372
+ declare const ListMyApprovalsContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema331.SchemaModel<{
373
+ status: {
374
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
375
+ isOptional: true;
376
+ };
377
+ limit: {
378
+ type: _contractspec_lib_schema331.FieldType<number, number>;
379
+ isOptional: true;
380
+ defaultValue: number;
381
+ };
382
+ offset: {
383
+ type: _contractspec_lib_schema331.FieldType<number, number>;
384
+ isOptional: true;
385
+ defaultValue: number;
386
+ };
387
+ }>, _contractspec_lib_schema331.SchemaModel<{
388
+ requests: {
389
+ type: _contractspec_lib_schema331.SchemaModel<{
390
+ id: {
391
+ type: _contractspec_lib_schema331.FieldType<string, string>;
392
+ isOptional: false;
393
+ };
394
+ workflowInstanceId: {
395
+ type: _contractspec_lib_schema331.FieldType<string, string>;
396
+ isOptional: false;
397
+ };
398
+ stepExecutionId: {
399
+ type: _contractspec_lib_schema331.FieldType<string, string>;
400
+ isOptional: false;
401
+ };
402
+ approverId: {
403
+ type: _contractspec_lib_schema331.FieldType<string, string>;
404
+ isOptional: false;
405
+ };
406
+ approverRole: {
407
+ type: _contractspec_lib_schema331.FieldType<string, string>;
408
+ isOptional: true;
409
+ };
410
+ title: {
411
+ type: _contractspec_lib_schema331.FieldType<string, string>;
412
+ isOptional: false;
413
+ };
414
+ description: {
415
+ type: _contractspec_lib_schema331.FieldType<string, string>;
416
+ isOptional: true;
417
+ };
418
+ status: {
419
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
420
+ isOptional: false;
421
+ };
422
+ decision: {
423
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
424
+ isOptional: true;
425
+ };
426
+ decisionComment: {
427
+ type: _contractspec_lib_schema331.FieldType<string, string>;
428
+ isOptional: true;
429
+ };
430
+ decidedAt: {
431
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
432
+ isOptional: true;
433
+ };
434
+ dueAt: {
435
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
436
+ isOptional: true;
437
+ };
438
+ contextSnapshot: {
439
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
440
+ isOptional: true;
441
+ };
442
+ sequenceOrder: {
443
+ type: _contractspec_lib_schema331.FieldType<number, number>;
444
+ isOptional: false;
445
+ };
446
+ createdAt: {
447
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
448
+ isOptional: false;
449
+ };
450
+ }>;
451
+ isArray: true;
452
+ isOptional: false;
453
+ };
454
+ total: {
455
+ type: _contractspec_lib_schema331.FieldType<number, number>;
456
+ isOptional: false;
457
+ };
458
+ pendingCount: {
459
+ type: _contractspec_lib_schema331.FieldType<number, number>;
460
+ isOptional: false;
461
+ };
462
+ }>, undefined>;
463
+ /**
464
+ * Get a single approval request.
465
+ */
466
+ declare const GetApprovalContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema331.SchemaModel<{
467
+ requestId: {
468
+ type: _contractspec_lib_schema331.FieldType<string, string>;
469
+ isOptional: false;
470
+ };
471
+ }>, _contractspec_lib_schema331.SchemaModel<{
472
+ id: {
473
+ type: _contractspec_lib_schema331.FieldType<string, string>;
474
+ isOptional: false;
475
+ };
476
+ workflowInstanceId: {
477
+ type: _contractspec_lib_schema331.FieldType<string, string>;
478
+ isOptional: false;
479
+ };
480
+ stepExecutionId: {
481
+ type: _contractspec_lib_schema331.FieldType<string, string>;
482
+ isOptional: false;
483
+ };
484
+ approverId: {
485
+ type: _contractspec_lib_schema331.FieldType<string, string>;
486
+ isOptional: false;
487
+ };
488
+ approverRole: {
489
+ type: _contractspec_lib_schema331.FieldType<string, string>;
490
+ isOptional: true;
491
+ };
492
+ title: {
493
+ type: _contractspec_lib_schema331.FieldType<string, string>;
494
+ isOptional: false;
495
+ };
496
+ description: {
497
+ type: _contractspec_lib_schema331.FieldType<string, string>;
498
+ isOptional: true;
499
+ };
500
+ status: {
501
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string, string, string]>;
502
+ isOptional: false;
503
+ };
504
+ decision: {
505
+ type: _contractspec_lib_schema331.EnumType<[string, string, string, string, string]>;
506
+ isOptional: true;
507
+ };
508
+ decisionComment: {
509
+ type: _contractspec_lib_schema331.FieldType<string, string>;
510
+ isOptional: true;
511
+ };
512
+ decidedAt: {
513
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
514
+ isOptional: true;
515
+ };
516
+ dueAt: {
517
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
518
+ isOptional: true;
519
+ };
520
+ contextSnapshot: {
521
+ type: _contractspec_lib_schema331.FieldType<unknown, unknown>;
522
+ isOptional: true;
523
+ };
524
+ sequenceOrder: {
525
+ type: _contractspec_lib_schema331.FieldType<number, number>;
526
+ isOptional: false;
527
+ };
528
+ createdAt: {
529
+ type: _contractspec_lib_schema331.FieldType<Date, string>;
530
+ isOptional: false;
531
+ };
532
+ }>, undefined>;
533
+ //#endregion
534
+ export { AddApprovalCommentContract, DelegateApprovalContract, GetApprovalContract, ListMyApprovalsContract, SubmitDecisionContract };
535
+ //# sourceMappingURL=approval.operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval.operations.d.ts","names":[],"sources":["../../src/approval/approval.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAaa,qDAAsB,0CAAA;EAAtB,SAAA,EAAA;IA2DX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;8CA3DiC,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;UAAA,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,MAAA,EAAA;IAgEtB,IAAA,sCA6DX,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;8CA7DmC,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,eAAA,EAAA;MAkExB,IAAA,uCAyDX,CAAA,MAAA,EAAA,MAAA,CAAA;MAAA,UAAA,EAAA,KAAA;;;iDAzDqC,CAAA,MAAA,EAAA,MAAA,CAAA;MAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;IAAA,CAAA;IA8D1B,QAAA,EAAA;MA8DX,IAAA,sCAAA,CAAA,CAAA,MAAA,EAA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