@opencrvs/toolkit 2.0.0-rc.fa6d7c7 → 2.0.0-rc.fa96c0e

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.
@@ -8,6 +8,7 @@ export declare const BaseActionInput: z.ZodObject<{
8
8
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
9
9
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
10
10
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
11
+ waitFor: z.ZodOptional<z.ZodBoolean>;
11
12
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
12
13
  }, z.core.$strip>;
13
14
  export declare const RegisterActionInput: z.ZodObject<{
@@ -19,6 +20,7 @@ export declare const RegisterActionInput: z.ZodObject<{
19
20
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
20
21
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
21
22
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
23
+ waitFor: z.ZodOptional<z.ZodBoolean>;
22
24
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
23
25
  type: z.ZodDefault<z.ZodLiteral<"REGISTER">>;
24
26
  registrationNumber: z.ZodOptional<z.ZodString>;
@@ -33,6 +35,7 @@ export declare const NotifyActionInput: z.ZodObject<{
33
35
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
34
36
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
35
37
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
38
+ waitFor: z.ZodOptional<z.ZodBoolean>;
36
39
  type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
37
40
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
38
41
  }, z.core.$strip>;
@@ -46,6 +49,7 @@ export declare const DeclareActionInput: z.ZodObject<{
46
49
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
47
50
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
48
51
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
52
+ waitFor: z.ZodOptional<z.ZodBoolean>;
49
53
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
50
54
  type: z.ZodDefault<z.ZodLiteral<"DECLARE">>;
51
55
  }, z.core.$strip>;
@@ -58,6 +62,7 @@ export declare const EditActionInput: z.ZodObject<{
58
62
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
59
63
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
60
64
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
65
+ waitFor: z.ZodOptional<z.ZodBoolean>;
61
66
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
62
67
  type: z.ZodDefault<z.ZodLiteral<"EDIT">>;
63
68
  content: z.ZodObject<{
@@ -74,6 +79,7 @@ export declare const PrintCertificateActionInput: z.ZodObject<{
74
79
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
75
80
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
76
81
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
82
+ waitFor: z.ZodOptional<z.ZodBoolean>;
77
83
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
78
84
  type: z.ZodDefault<z.ZodLiteral<"PRINT_CERTIFICATE">>;
79
85
  content: z.ZodOptional<z.ZodObject<{
@@ -90,6 +96,7 @@ export declare const RejectDeclarationActionInput: z.ZodObject<{
90
96
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
91
97
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
92
98
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
99
+ waitFor: z.ZodOptional<z.ZodBoolean>;
93
100
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
94
101
  type: z.ZodDefault<z.ZodLiteral<"REJECT">>;
95
102
  content: z.ZodObject<{
@@ -106,6 +113,7 @@ export declare const DuplicateDetectedActionInput: z.ZodObject<{
106
113
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
107
114
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
108
115
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
116
+ waitFor: z.ZodOptional<z.ZodBoolean>;
109
117
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
110
118
  type: z.ZodDefault<z.ZodLiteral<"DUPLICATE_DETECTED">>;
111
119
  content: z.ZodObject<{
@@ -124,6 +132,7 @@ export declare const MarkAsDuplicateActionInput: z.ZodObject<{
124
132
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
125
133
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
126
134
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
135
+ waitFor: z.ZodOptional<z.ZodBoolean>;
127
136
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
128
137
  type: z.ZodDefault<z.ZodLiteral<"MARK_AS_DUPLICATE">>;
129
138
  content: z.ZodOptional<z.ZodObject<{
@@ -140,6 +149,7 @@ export declare const MarkNotDuplicateActionInput: z.ZodObject<{
140
149
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
141
150
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
142
151
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
152
+ waitFor: z.ZodOptional<z.ZodBoolean>;
143
153
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
144
154
  type: z.ZodDefault<z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">>;
145
155
  }, z.core.$strip>;
@@ -153,6 +163,7 @@ export declare const ArchiveActionInput: z.ZodObject<{
153
163
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
154
164
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
155
165
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
166
+ waitFor: z.ZodOptional<z.ZodBoolean>;
156
167
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
157
168
  type: z.ZodDefault<z.ZodLiteral<"ARCHIVE">>;
158
169
  content: z.ZodObject<{
@@ -169,6 +180,7 @@ export declare const AssignActionInput: z.ZodObject<{
169
180
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
170
181
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
171
182
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
183
+ waitFor: z.ZodOptional<z.ZodBoolean>;
172
184
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
173
185
  type: z.ZodLiteral<"ASSIGN">;
174
186
  assignedTo: z.ZodString;
@@ -183,6 +195,7 @@ export declare const UnassignActionInput: z.ZodObject<{
183
195
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
184
196
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
185
197
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
198
+ waitFor: z.ZodOptional<z.ZodBoolean>;
186
199
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
187
200
  type: z.ZodDefault<z.ZodLiteral<"UNASSIGN">>;
188
201
  assignedTo: z.ZodDefault<z.ZodLiteral<null>>;
@@ -197,6 +210,7 @@ export declare const RequestCorrectionActionInput: z.ZodObject<{
197
210
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
198
211
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
199
212
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
213
+ waitFor: z.ZodOptional<z.ZodBoolean>;
200
214
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
201
215
  type: z.ZodDefault<z.ZodLiteral<"REQUEST_CORRECTION">>;
202
216
  }, z.core.$strip>;
@@ -210,6 +224,7 @@ export declare const RejectCorrectionActionInput: z.ZodObject<{
210
224
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
211
225
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
212
226
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
227
+ waitFor: z.ZodOptional<z.ZodBoolean>;
213
228
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
214
229
  requestId: z.ZodString;
215
230
  type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
@@ -227,6 +242,7 @@ export declare const ApproveCorrectionActionInput: z.ZodObject<{
227
242
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
228
243
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
229
244
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
245
+ waitFor: z.ZodOptional<z.ZodBoolean>;
230
246
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
231
247
  requestId: z.ZodString;
232
248
  type: z.ZodDefault<z.ZodLiteral<"APPROVE_CORRECTION">>;
@@ -241,6 +257,7 @@ export declare const ReadActionInput: z.ZodObject<{
241
257
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
242
258
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
243
259
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
260
+ waitFor: z.ZodOptional<z.ZodBoolean>;
244
261
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
245
262
  type: z.ZodDefault<z.ZodLiteral<"READ">>;
246
263
  }, z.core.$strip>;
@@ -258,6 +275,7 @@ export declare const CustomActionInput: z.ZodObject<{
258
275
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
259
276
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
260
277
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
278
+ waitFor: z.ZodOptional<z.ZodBoolean>;
261
279
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
262
280
  type: z.ZodDefault<z.ZodLiteral<"CUSTOM">>;
263
281
  customActionType: z.ZodString;
@@ -280,6 +298,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
280
298
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
281
299
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
282
300
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
301
+ waitFor: z.ZodOptional<z.ZodBoolean>;
283
302
  type: z.ZodDefault<z.ZodLiteral<"CREATE">>;
284
303
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
285
304
  }, z.core.$strip>, z.ZodObject<{
@@ -291,6 +310,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
291
310
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
292
311
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
293
312
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
313
+ waitFor: z.ZodOptional<z.ZodBoolean>;
294
314
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
295
315
  type: z.ZodDefault<z.ZodLiteral<"REGISTER">>;
296
316
  registrationNumber: z.ZodOptional<z.ZodString>;
@@ -303,6 +323,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
303
323
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
304
324
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
305
325
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
326
+ waitFor: z.ZodOptional<z.ZodBoolean>;
306
327
  type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
307
328
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
308
329
  }, z.core.$strip>, z.ZodObject<{
@@ -314,6 +335,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
314
335
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
315
336
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
316
337
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
338
+ waitFor: z.ZodOptional<z.ZodBoolean>;
317
339
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
318
340
  type: z.ZodDefault<z.ZodLiteral<"DECLARE">>;
319
341
  }, z.core.$strip>, z.ZodObject<{
@@ -325,6 +347,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
325
347
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
326
348
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
327
349
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
350
+ waitFor: z.ZodOptional<z.ZodBoolean>;
328
351
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
329
352
  type: z.ZodDefault<z.ZodLiteral<"REJECT">>;
330
353
  content: z.ZodObject<{
@@ -339,6 +362,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
339
362
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
340
363
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
341
364
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
365
+ waitFor: z.ZodOptional<z.ZodBoolean>;
342
366
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
343
367
  type: z.ZodDefault<z.ZodLiteral<"DUPLICATE_DETECTED">>;
344
368
  content: z.ZodObject<{
@@ -356,6 +380,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
356
380
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
357
381
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
358
382
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
383
+ waitFor: z.ZodOptional<z.ZodBoolean>;
359
384
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
360
385
  type: z.ZodDefault<z.ZodLiteral<"MARK_AS_DUPLICATE">>;
361
386
  content: z.ZodOptional<z.ZodObject<{
@@ -370,6 +395,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
370
395
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
371
396
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
372
397
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
398
+ waitFor: z.ZodOptional<z.ZodBoolean>;
373
399
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
374
400
  type: z.ZodDefault<z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">>;
375
401
  }, z.core.$strip>, z.ZodObject<{
@@ -381,6 +407,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
381
407
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
382
408
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
383
409
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
410
+ waitFor: z.ZodOptional<z.ZodBoolean>;
384
411
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
385
412
  type: z.ZodDefault<z.ZodLiteral<"ARCHIVE">>;
386
413
  content: z.ZodObject<{
@@ -395,6 +422,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
395
422
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
396
423
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
397
424
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
425
+ waitFor: z.ZodOptional<z.ZodBoolean>;
398
426
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
399
427
  type: z.ZodLiteral<"ASSIGN">;
400
428
  assignedTo: z.ZodString;
@@ -407,6 +435,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
407
435
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
408
436
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
409
437
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
438
+ waitFor: z.ZodOptional<z.ZodBoolean>;
410
439
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
411
440
  type: z.ZodDefault<z.ZodLiteral<"UNASSIGN">>;
412
441
  assignedTo: z.ZodDefault<z.ZodLiteral<null>>;
@@ -419,6 +448,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
419
448
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
420
449
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
421
450
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
451
+ waitFor: z.ZodOptional<z.ZodBoolean>;
422
452
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
423
453
  type: z.ZodDefault<z.ZodLiteral<"PRINT_CERTIFICATE">>;
424
454
  content: z.ZodOptional<z.ZodObject<{
@@ -433,6 +463,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
433
463
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
434
464
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
435
465
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
466
+ waitFor: z.ZodOptional<z.ZodBoolean>;
436
467
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
437
468
  type: z.ZodDefault<z.ZodLiteral<"REQUEST_CORRECTION">>;
438
469
  }, z.core.$strip>, z.ZodObject<{
@@ -444,6 +475,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
444
475
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
445
476
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
446
477
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
478
+ waitFor: z.ZodOptional<z.ZodBoolean>;
447
479
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
448
480
  requestId: z.ZodString;
449
481
  type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
@@ -459,6 +491,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
459
491
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
460
492
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
461
493
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
494
+ waitFor: z.ZodOptional<z.ZodBoolean>;
462
495
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
463
496
  requestId: z.ZodString;
464
497
  type: z.ZodDefault<z.ZodLiteral<"APPROVE_CORRECTION">>;
@@ -471,6 +504,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
471
504
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
472
505
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
473
506
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
507
+ waitFor: z.ZodOptional<z.ZodBoolean>;
474
508
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
475
509
  type: z.ZodDefault<z.ZodLiteral<"READ">>;
476
510
  }, z.core.$strip>, z.ZodObject<{
@@ -482,6 +516,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
482
516
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
483
517
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
484
518
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
519
+ waitFor: z.ZodOptional<z.ZodBoolean>;
485
520
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
486
521
  type: z.ZodDefault<z.ZodLiteral<"CUSTOM">>;
487
522
  customActionType: z.ZodString;
@@ -494,6 +529,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
494
529
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
495
530
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
496
531
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
532
+ waitFor: z.ZodOptional<z.ZodBoolean>;
497
533
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
498
534
  type: z.ZodDefault<z.ZodLiteral<"EDIT">>;
499
535
  content: z.ZodObject<{
@@ -53,6 +53,7 @@ export declare const DraftInput: z.ZodObject<{
53
53
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
54
54
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
55
55
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
56
+ waitFor: z.ZodOptional<z.ZodBoolean>;
56
57
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
57
58
  type: z.ZodEnum<{
58
59
  CUSTOM: "CUSTOM";
@@ -1414,28 +1414,20 @@ function schemaPriority(schema) {
1414
1414
  return idx === -1 ? 9999 : idx;
1415
1415
  }
1416
1416
  function safeUnion(schemas) {
1417
+ const sortedSchemas = [...schemas].sort(
1418
+ (a, b) => schemaPriority(a) - schemaPriority(b)
1419
+ );
1417
1420
  return z12.any().superRefine((val, ctx) => {
1418
- const successful = schemas.filter((s) => s.safeParse(val).success);
1419
- if (successful.length === 1) {
1420
- return;
1421
- }
1422
- if (successful.length === 0) {
1423
- ctx.addIssue({
1424
- code: "invalid_type",
1425
- expected: "custom",
1426
- message: "Value does not match any schema"
1427
- });
1428
- return;
1429
- }
1430
- successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
1431
- const best = successful[0];
1432
- if (!best.safeParse(val).success) {
1433
- ctx.addIssue({
1434
- expected: "custom",
1435
- code: "invalid_type",
1436
- message: "Value did not match the best schema"
1437
- });
1421
+ for (const schema of sortedSchemas) {
1422
+ if (schema.safeParse(val).success) {
1423
+ return;
1424
+ }
1438
1425
  }
1426
+ ctx.addIssue({
1427
+ code: "invalid_type",
1428
+ expected: "custom",
1429
+ message: "Value does not match any schema"
1430
+ });
1439
1431
  }).meta({
1440
1432
  description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
1441
1433
  });
@@ -5901,6 +5893,7 @@ var BaseActionInput = z38.object({
5901
5893
  keepAssignment: z38.boolean().optional(),
5902
5894
  keepAssignmentIfAccepted: z38.boolean().optional(),
5903
5895
  keepAssignmentIfRejected: z38.boolean().optional(),
5896
+ waitFor: z38.boolean().optional(),
5904
5897
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
5905
5898
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
5906
5899
  createdAtLocation: UUID.nullish().describe(
@@ -2132,6 +2132,10 @@ Done. Converted ${convertedCount} config file(s), replaced ${totalReplaced} rout
2132
2132
  var import_ts_morph11 = require("ts-morph");
2133
2133
  var import_path11 = __toESM(require("path"));
2134
2134
 
2135
+ // ../commons/src/scopes.deprecated.do-not-use.ts
2136
+ var z4 = __toESM(require("zod/v4"));
2137
+ var import_lodash = require("lodash");
2138
+
2135
2139
  // ../commons/src/scopes.ts
2136
2140
  var z3 = __toESM(require("zod/v4"));
2137
2141
  var qs = __toESM(require("qs"));
@@ -2405,7 +2409,6 @@ var DEFAULT_SCOPE_OPTIONS = {
2405
2409
  };
2406
2410
 
2407
2411
  // ../commons/src/scopes.deprecated.do-not-use.ts
2408
- var z4 = __toESM(require("zod/v4"));
2409
2412
  var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
2410
2413
  var rawConfigurableScope = z4.string().regex(rawConfigurableScopeRegex);
2411
2414
  var SearchScope = z4.object({
@@ -2639,6 +2642,74 @@ var legacyScopeToV2Scope = (v1Scope) => {
2639
2642
  }
2640
2643
  throw new Error(`Unsupported V1 scope type: ${v1Scope}`);
2641
2644
  };
2645
+ var MERGEABLE_USER_SCOPE_TYPES = ["user.create", "user.edit"];
2646
+ function isMergeableUserScopeType(type) {
2647
+ return MERGEABLE_USER_SCOPE_TYPES.includes(type);
2648
+ }
2649
+ function decodeLegacyScope(legacy) {
2650
+ const encoded = legacyScopeToV2Scope(legacy);
2651
+ const scope = decodeScope(encoded);
2652
+ if (!scope) {
2653
+ throw new Error(
2654
+ `Could not decode migrated scope from legacy '${legacy}' (encoded: '${encoded}').`
2655
+ );
2656
+ }
2657
+ return { legacy, scope };
2658
+ }
2659
+ function groupByType(entries) {
2660
+ return entries.reduce(
2661
+ (groups, entry) => ({
2662
+ ...groups,
2663
+ [entry.scope.type]: [...groups[entry.scope.type] ?? [], entry]
2664
+ }),
2665
+ {}
2666
+ );
2667
+ }
2668
+ function deduplicateEntries(entries) {
2669
+ return entries.filter(
2670
+ (entry, index) => entries.findIndex((e) => (0, import_lodash.isEqual)(e.scope, entry.scope)) === index
2671
+ );
2672
+ }
2673
+ function mergeEntries(type, entries) {
2674
+ const optionsList = entries.map(
2675
+ (e) => "options" in e.scope && e.scope.options ? e.scope.options : {}
2676
+ );
2677
+ const allKeys = optionsList.flatMap(
2678
+ (opts) => Object.keys(opts).filter((k) => opts[k] !== void 0)
2679
+ );
2680
+ const conflictKey = allKeys.find((key, i) => allKeys.indexOf(key) !== i);
2681
+ if (conflictKey) {
2682
+ const conflicting = entries.filter(
2683
+ (e) => conflictKey in ("options" in e.scope && e.scope.options || {})
2684
+ ).map((e) => JSON.stringify(e.legacy));
2685
+ throw new Error(
2686
+ `Cannot auto-merge two '${type}' scopes that both define '${conflictKey}'. Conflicting legacy scopes: [${conflicting.join(", ")}]. Resolve manually in roles.ts and re-run.`
2687
+ );
2688
+ }
2689
+ const mergedOptions = Object.assign({}, ...optionsList);
2690
+ const merged = Object.keys(mergedOptions).length > 0 ? { type, options: mergedOptions } : { type };
2691
+ const parsed = Scope2.safeParse(merged);
2692
+ if (!parsed.success) {
2693
+ throw new Error(
2694
+ `Merged '${type}' scope failed schema validation: ${parsed.error.message}. Legacy scopes: [${entries.map((e) => JSON.stringify(e.legacy)).join(", ")}].`
2695
+ );
2696
+ }
2697
+ return parsed.data;
2698
+ }
2699
+ function migrateLegacyScopesArrayToV2Scopes(legacyScopes) {
2700
+ const groups = groupByType(legacyScopes.map(decodeLegacyScope));
2701
+ return Object.entries(groups).flatMap(([type, entries]) => {
2702
+ const deduped = deduplicateEntries(entries);
2703
+ if (deduped.length <= 1) return deduped.map((e) => e.scope);
2704
+ if (!isMergeableUserScopeType(type)) {
2705
+ console.warn(
2706
+ `Multiple non-mergeable '${type}' scopes detected after dedup \u2014 kept all as-is. Legacy scopes: [${deduped.map((e) => JSON.stringify(e.legacy)).join(", ")}]. Review whether the duplication is intentional.`
2707
+ );
2708
+ return deduped.map((e) => e.scope);
2709
+ }
2710
+ return [mergeEntries(type, deduped)];
2711
+ });
2712
+ }
2642
2713
 
2643
2714
  // src/migrations/v2.0/migrate-scopes.ts
2644
2715
  var ROLES_FILE_RELATIVE_PATH = "src/data-seeding/roles/roles.ts";
@@ -2676,57 +2747,65 @@ function resolveLegacyScopeFromElement(element) {
2676
2747
  }
2677
2748
  function migrateScopesArrays(rolesFilePath, project) {
2678
2749
  const sourceFile = project.getSourceFile(rolesFilePath);
2679
- if (!sourceFile) return { migratedCount: 0, removedCount: 0 };
2750
+ if (!sourceFile) {
2751
+ return { migratedCount: 0, removedCount: 0, mergedCount: 0 };
2752
+ }
2680
2753
  let migratedCount = 0;
2681
2754
  let removedCount = 0;
2755
+ let mergedCount = 0;
2682
2756
  const scopesProperties = sourceFile.getDescendantsOfKind(import_ts_morph11.SyntaxKind.PropertyAssignment).filter((prop) => prop.getName() === SCOPES_PROPERTY_NAME);
2757
+ const relPath = import_path11.default.relative(process.cwd(), rolesFilePath);
2683
2758
  for (const scopesProp of scopesProperties) {
2684
2759
  const initializer = scopesProp.getInitializer();
2685
2760
  if (!initializer || !import_ts_morph11.Node.isArrayLiteralExpression(initializer)) continue;
2686
- const elements = initializer.getElements();
2687
- for (let index = elements.length - 1; index >= 0; index--) {
2688
- const element = elements[index];
2689
- if (!import_ts_morph11.Node.isExpression(element)) continue;
2761
+ const rawTexts = [];
2762
+ const legacyStrings = [];
2763
+ let anyChange = false;
2764
+ for (const element of initializer.getElements()) {
2690
2765
  const scopeKey = resolveScopeKeyFromElementAccess(element);
2691
2766
  if (scopeKey && !(scopeKey in SCOPES)) {
2692
2767
  console.warn(
2693
- ` [${import_path11.default.relative(process.cwd(), rolesFilePath)}] Removing unknown scope reference: SCOPES.${scopeKey}`
2768
+ ` [${relPath}] Removing unknown scope reference: SCOPES.${scopeKey}`
2694
2769
  );
2695
- initializer.removeElement(index);
2696
2770
  removedCount++;
2771
+ anyChange = true;
2697
2772
  continue;
2698
2773
  }
2699
2774
  const legacyScope = resolveLegacyScopeFromElement(element);
2700
2775
  if (!legacyScope) {
2701
2776
  console.warn(
2702
- ` [${import_path11.default.relative(process.cwd(), rolesFilePath)}] Skipping non-literal scope expression: ${element.getText()}`
2777
+ ` [${relPath}] Preserving non-literal scope expression verbatim: ${element.getText()}`
2703
2778
  );
2779
+ rawTexts.push(element.getText());
2704
2780
  continue;
2705
2781
  }
2706
- try {
2707
- const migratedScope = legacyScopeToV2Scope(legacyScope);
2708
- const scope = decodeScope(migratedScope);
2709
- if (!scope) {
2710
- console.warn(
2711
- ` [${import_path11.default.relative(process.cwd(), rolesFilePath)}] Could not decode migrated scope '${migratedScope}'.`
2712
- );
2713
- continue;
2714
- }
2715
- element.replaceWithText(JSON.stringify(scope));
2716
- migratedCount++;
2717
- } catch (error) {
2718
- console.warn(
2719
- ` [${import_path11.default.relative(process.cwd(), rolesFilePath)}] Could not migrate scope '${legacyScope}': ${error}`
2720
- );
2721
- }
2782
+ legacyStrings.push(legacyScope);
2783
+ anyChange = true;
2784
+ }
2785
+ if (!anyChange) continue;
2786
+ let mergedScopes;
2787
+ try {
2788
+ mergedScopes = migrateLegacyScopesArrayToV2Scopes(legacyStrings);
2789
+ } catch (error) {
2790
+ throw new Error(
2791
+ `[${relPath}] Failed to migrate scopes for role: ${error instanceof Error ? error.message : String(error)}`,
2792
+ { cause: error }
2793
+ );
2722
2794
  }
2795
+ migratedCount += legacyStrings.length;
2796
+ mergedCount += legacyStrings.length - mergedScopes.length;
2797
+ const outputElements = [
2798
+ ...rawTexts,
2799
+ ...mergedScopes.map((s) => JSON.stringify(s))
2800
+ ];
2801
+ scopesProp.setInitializer(`[${outputElements.join(", ")}]`);
2723
2802
  }
2724
2803
  if (removedCount > 0) {
2725
2804
  console.log(
2726
- ` Removed ${removedCount} unknown SCOPES reference(s) from '${import_path11.default.relative(process.cwd(), rolesFilePath)}'.`
2805
+ ` Removed ${removedCount} unknown SCOPES reference(s) from '${relPath}'.`
2727
2806
  );
2728
2807
  }
2729
- return { migratedCount, removedCount };
2808
+ return { migratedCount, removedCount, mergedCount };
2730
2809
  }
2731
2810
  function ensureScopesHelpersImport(rolesFilePath, project) {
2732
2811
  const sourceFile = project.getSourceFile(rolesFilePath);
@@ -2861,7 +2940,7 @@ async function main11() {
2861
2940
  return;
2862
2941
  }
2863
2942
  const importChanged = ensureScopesHelpersImport(rolesFilePath, project);
2864
- const { migratedCount, removedCount } = migrateScopesArrays(
2943
+ const { migratedCount, removedCount, mergedCount } = migrateScopesArrays(
2865
2944
  rolesFilePath,
2866
2945
  project
2867
2946
  );
@@ -2880,7 +2959,7 @@ async function main11() {
2880
2959
  }
2881
2960
  await sourceFile.save();
2882
2961
  console.log(
2883
- `Done. Migrated ${migratedCount} legacy scope(s), removed ${removedCount} unknown SCOPES reference(s), wrapped ${wrappedScopesCount} scope array(s) with defineScopes()${wrappedRoles ? ", wrapped roles with defineRoles()" : ""}${removedRoleType ? ", and removed Role type definition" : ""}${importChanged ? ". Updated toolkit/scopes imports." : "."}`
2962
+ `Done. Migrated ${migratedCount} legacy scope(s), merged ${mergedCount} AND-paired scope(s) into single v2 objects (privilege-escalation fix, see issue #12489), removed ${removedCount} unknown SCOPES reference(s), wrapped ${wrappedScopesCount} scope array(s) with defineScopes()${wrappedRoles ? ", wrapped roles with defineRoles()" : ""}${removedRoleType ? ", and removed Role type definition" : ""}${importChanged ? ". Updated toolkit/scopes imports." : "."}`
2884
2963
  );
2885
2964
  }
2886
2965
 
@@ -1 +1 @@
1
- {"version":3,"file":"migrate-scopes.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/migrate-scopes.ts"],"names":[],"mappings":"AAyVA,iBAAe,IAAI,kBAmDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"migrate-scopes.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/migrate-scopes.ts"],"names":[],"mappings":"AAoXA,iBAAe,IAAI,kBAmDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}