@opencrvs/toolkit 2.1.0-rc.b0003b1 → 2.1.0-rc.e773220
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.
- package/build.sh +2 -2
- package/dist/cli.js +165 -5106
- package/dist/commons/events/ActionConfig.d.ts +176 -0
- package/dist/events/index.js +92 -7
- package/dist/migrations/v2.0/index.js +88 -5144
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +218 -0
- package/dist/notification/index.js +91 -3
- package/opencrvs-toolkit-2.1.0-rc.e773220.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.b0003b1.tgz +0 -0
|
@@ -85,6 +85,58 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
85
85
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
86
86
|
}, z.core.$strip>;
|
|
87
87
|
conditionals: z.ZodOptional<z.ZodNever>;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
90
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
91
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
92
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"SHOW">;
|
|
94
|
+
conditional: z.ZodAny;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
97
|
+
conditional: z.ZodAny;
|
|
98
|
+
}, z.core.$strip>], "type">>>;
|
|
99
|
+
type: z.ZodLiteral<"ASSIGN">;
|
|
100
|
+
flags: z.ZodOptional<z.ZodNever>;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
103
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
104
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
105
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
|
+
type: z.ZodLiteral<"SHOW">;
|
|
107
|
+
conditional: z.ZodAny;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
110
|
+
conditional: z.ZodAny;
|
|
111
|
+
}, z.core.$strip>], "type">>>;
|
|
112
|
+
type: z.ZodLiteral<"UNASSIGN">;
|
|
113
|
+
flags: z.ZodOptional<z.ZodNever>;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
116
|
+
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
117
|
+
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
118
|
+
readonly INCOMPLETE: "incomplete";
|
|
119
|
+
readonly REJECTED: "rejected";
|
|
120
|
+
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
121
|
+
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
122
|
+
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
123
|
+
}>]>, z.ZodString]>;
|
|
124
|
+
operation: z.ZodEnum<{
|
|
125
|
+
add: "add";
|
|
126
|
+
remove: "remove";
|
|
127
|
+
}>;
|
|
128
|
+
conditional: z.ZodOptional<z.ZodAny>;
|
|
129
|
+
}, z.core.$strip>>>>;
|
|
130
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
131
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
132
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"SHOW">;
|
|
134
|
+
conditional: z.ZodAny;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
137
|
+
conditional: z.ZodAny;
|
|
138
|
+
}, z.core.$strip>], "type">>>;
|
|
139
|
+
type: z.ZodLiteral<"DELETE">;
|
|
88
140
|
}, z.core.$strip>, z.ZodObject<{
|
|
89
141
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
90
142
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -151,6 +203,78 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
151
203
|
declare: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
152
204
|
register: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
153
205
|
}, z.core.$strip>>;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
208
|
+
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
209
|
+
readonly INCOMPLETE: "incomplete";
|
|
210
|
+
readonly REJECTED: "rejected";
|
|
211
|
+
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
212
|
+
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
213
|
+
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
214
|
+
}>]>, z.ZodString]>;
|
|
215
|
+
operation: z.ZodEnum<{
|
|
216
|
+
add: "add";
|
|
217
|
+
remove: "remove";
|
|
218
|
+
}>;
|
|
219
|
+
conditional: z.ZodOptional<z.ZodAny>;
|
|
220
|
+
}, z.core.$strip>>>>;
|
|
221
|
+
type: z.ZodLiteral<"DUPLICATE_DETECTED">;
|
|
222
|
+
label: z.ZodOptional<z.ZodNever>;
|
|
223
|
+
supportingCopy: z.ZodOptional<z.ZodNever>;
|
|
224
|
+
icon: z.ZodOptional<z.ZodNever>;
|
|
225
|
+
conditionals: z.ZodOptional<z.ZodNever>;
|
|
226
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
227
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
228
|
+
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
229
|
+
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
230
|
+
readonly INCOMPLETE: "incomplete";
|
|
231
|
+
readonly REJECTED: "rejected";
|
|
232
|
+
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
233
|
+
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
234
|
+
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
235
|
+
}>]>, z.ZodString]>;
|
|
236
|
+
operation: z.ZodEnum<{
|
|
237
|
+
add: "add";
|
|
238
|
+
remove: "remove";
|
|
239
|
+
}>;
|
|
240
|
+
conditional: z.ZodOptional<z.ZodAny>;
|
|
241
|
+
}, z.core.$strip>>>>;
|
|
242
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
243
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
244
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
245
|
+
type: z.ZodLiteral<"SHOW">;
|
|
246
|
+
conditional: z.ZodAny;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
249
|
+
conditional: z.ZodAny;
|
|
250
|
+
}, z.core.$strip>], "type">>>;
|
|
251
|
+
type: z.ZodLiteral<"MARK_AS_DUPLICATE">;
|
|
252
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
253
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
254
|
+
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
255
|
+
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
256
|
+
readonly INCOMPLETE: "incomplete";
|
|
257
|
+
readonly REJECTED: "rejected";
|
|
258
|
+
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
259
|
+
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
260
|
+
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
261
|
+
}>]>, z.ZodString]>;
|
|
262
|
+
operation: z.ZodEnum<{
|
|
263
|
+
add: "add";
|
|
264
|
+
remove: "remove";
|
|
265
|
+
}>;
|
|
266
|
+
conditional: z.ZodOptional<z.ZodAny>;
|
|
267
|
+
}, z.core.$strip>>>>;
|
|
268
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
269
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
270
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
271
|
+
type: z.ZodLiteral<"SHOW">;
|
|
272
|
+
conditional: z.ZodAny;
|
|
273
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
275
|
+
conditional: z.ZodAny;
|
|
276
|
+
}, z.core.$strip>], "type">>>;
|
|
277
|
+
type: z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">;
|
|
154
278
|
}, z.core.$strip>, z.ZodObject<{
|
|
155
279
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
156
280
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -320,6 +444,58 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
320
444
|
}, z.core.$strip>;
|
|
321
445
|
}, z.core.$strip>], "type">>;
|
|
322
446
|
}, z.core.$strip>;
|
|
447
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
448
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
449
|
+
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
450
|
+
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
451
|
+
readonly INCOMPLETE: "incomplete";
|
|
452
|
+
readonly REJECTED: "rejected";
|
|
453
|
+
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
454
|
+
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
455
|
+
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
456
|
+
}>]>, z.ZodString]>;
|
|
457
|
+
operation: z.ZodEnum<{
|
|
458
|
+
add: "add";
|
|
459
|
+
remove: "remove";
|
|
460
|
+
}>;
|
|
461
|
+
conditional: z.ZodOptional<z.ZodAny>;
|
|
462
|
+
}, z.core.$strip>>>>;
|
|
463
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
464
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
465
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
466
|
+
type: z.ZodLiteral<"SHOW">;
|
|
467
|
+
conditional: z.ZodAny;
|
|
468
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
469
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
470
|
+
conditional: z.ZodAny;
|
|
471
|
+
}, z.core.$strip>], "type">>>;
|
|
472
|
+
type: z.ZodLiteral<"APPROVE_CORRECTION">;
|
|
473
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
474
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
475
|
+
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
476
|
+
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
477
|
+
readonly INCOMPLETE: "incomplete";
|
|
478
|
+
readonly REJECTED: "rejected";
|
|
479
|
+
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
480
|
+
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
481
|
+
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
482
|
+
}>]>, z.ZodString]>;
|
|
483
|
+
operation: z.ZodEnum<{
|
|
484
|
+
add: "add";
|
|
485
|
+
remove: "remove";
|
|
486
|
+
}>;
|
|
487
|
+
conditional: z.ZodOptional<z.ZodAny>;
|
|
488
|
+
}, z.core.$strip>>>>;
|
|
489
|
+
supportingCopy: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
490
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
491
|
+
conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
492
|
+
type: z.ZodLiteral<"SHOW">;
|
|
493
|
+
conditional: z.ZodAny;
|
|
494
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
495
|
+
type: z.ZodLiteral<"ENABLE">;
|
|
496
|
+
conditional: z.ZodAny;
|
|
497
|
+
}, z.core.$strip>], "type">>>;
|
|
498
|
+
type: z.ZodLiteral<"REJECT_CORRECTION">;
|
|
323
499
|
}, z.core.$strip>, z.ZodObject<{
|
|
324
500
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
325
501
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
package/dist/events/index.js
CHANGED
|
@@ -3238,6 +3238,52 @@ var NotifyConfig = ActionConfigBase.extend(
|
|
|
3238
3238
|
type: z24.literal(ActionType.NOTIFY)
|
|
3239
3239
|
}).shape
|
|
3240
3240
|
);
|
|
3241
|
+
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
3242
|
+
z24.object({
|
|
3243
|
+
type: z24.literal(ActionType.DUPLICATE_DETECTED),
|
|
3244
|
+
label: z24.never().optional().describe(
|
|
3245
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
3246
|
+
),
|
|
3247
|
+
supportingCopy: z24.never().optional(),
|
|
3248
|
+
icon: z24.never().optional().describe(
|
|
3249
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
3250
|
+
),
|
|
3251
|
+
conditionals: z24.never().optional().describe(
|
|
3252
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
3253
|
+
)
|
|
3254
|
+
}).shape
|
|
3255
|
+
);
|
|
3256
|
+
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
3257
|
+
z24.object({
|
|
3258
|
+
type: z24.literal(ActionType.MARK_AS_DUPLICATE)
|
|
3259
|
+
}).shape
|
|
3260
|
+
);
|
|
3261
|
+
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
3262
|
+
z24.object({
|
|
3263
|
+
type: z24.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3264
|
+
}).shape
|
|
3265
|
+
);
|
|
3266
|
+
var AssignConfig = ActionConfigBase.extend(
|
|
3267
|
+
z24.object({
|
|
3268
|
+
type: z24.literal(ActionType.ASSIGN),
|
|
3269
|
+
flags: z24.never().optional().describe(
|
|
3270
|
+
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
3271
|
+
)
|
|
3272
|
+
}).shape
|
|
3273
|
+
);
|
|
3274
|
+
var UnassignConfig = ActionConfigBase.extend(
|
|
3275
|
+
z24.object({
|
|
3276
|
+
type: z24.literal(ActionType.UNASSIGN),
|
|
3277
|
+
flags: z24.never().optional().describe(
|
|
3278
|
+
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
3279
|
+
)
|
|
3280
|
+
}).shape
|
|
3281
|
+
);
|
|
3282
|
+
var DeleteConfig = ActionConfigBase.extend(
|
|
3283
|
+
z24.object({
|
|
3284
|
+
type: z24.literal(ActionType.DELETE)
|
|
3285
|
+
}).shape
|
|
3286
|
+
);
|
|
3241
3287
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
3242
3288
|
z24.object({
|
|
3243
3289
|
type: z24.literal(ActionType.DECLARE),
|
|
@@ -3300,7 +3346,17 @@ var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
|
3300
3346
|
correctionForm: ActionFormConfig
|
|
3301
3347
|
}).shape
|
|
3302
3348
|
);
|
|
3303
|
-
var
|
|
3349
|
+
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
3350
|
+
z24.object({
|
|
3351
|
+
type: z24.literal(ActionType.APPROVE_CORRECTION)
|
|
3352
|
+
}).shape
|
|
3353
|
+
);
|
|
3354
|
+
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
3355
|
+
z24.object({
|
|
3356
|
+
type: z24.literal(ActionType.REJECT_CORRECTION)
|
|
3357
|
+
}).shape
|
|
3358
|
+
);
|
|
3359
|
+
var CustomActionConfig = ActionConfigBase.extend(
|
|
3304
3360
|
z24.object({
|
|
3305
3361
|
type: z24.literal(ActionType.CUSTOM),
|
|
3306
3362
|
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
@@ -3311,7 +3367,7 @@ var CustomActionConfig = ActionConfigBase.merge(
|
|
|
3311
3367
|
auditHistoryLabel: TranslationConfig.describe(
|
|
3312
3368
|
'The label to show in audit history for this action. For example "Approved".'
|
|
3313
3369
|
)
|
|
3314
|
-
})
|
|
3370
|
+
}).shape
|
|
3315
3371
|
);
|
|
3316
3372
|
var ActionConfig = z24.discriminatedUnion("type", [
|
|
3317
3373
|
/*
|
|
@@ -3322,6 +3378,18 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3322
3378
|
id: "ReadActionConfig",
|
|
3323
3379
|
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
3324
3380
|
}),
|
|
3381
|
+
AssignConfig.meta({
|
|
3382
|
+
id: "AssignActionConfig",
|
|
3383
|
+
description: "Configuration for assigning a record to the current user."
|
|
3384
|
+
}),
|
|
3385
|
+
UnassignConfig.meta({
|
|
3386
|
+
id: "UnassignActionConfig",
|
|
3387
|
+
description: "Configuration for unassigning a record from its current assignee."
|
|
3388
|
+
}),
|
|
3389
|
+
DeleteConfig.meta({
|
|
3390
|
+
id: "DeleteActionConfig",
|
|
3391
|
+
description: "Configuration for deleting a draft record."
|
|
3392
|
+
}),
|
|
3325
3393
|
NotifyConfig.meta({
|
|
3326
3394
|
id: "NotifyActionConfig",
|
|
3327
3395
|
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
@@ -3330,6 +3398,18 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3330
3398
|
id: "DeclareActionConfig",
|
|
3331
3399
|
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
3332
3400
|
}),
|
|
3401
|
+
DuplicateDetectedConfig.meta({
|
|
3402
|
+
id: "DuplicateDetectedActionConfig",
|
|
3403
|
+
description: "Configuration for the system-generated duplicate-detection action. Never shown as a button, so it only supports flags \u2014 not label, icon, or conditionals."
|
|
3404
|
+
}),
|
|
3405
|
+
MarkAsDuplicateConfig.meta({
|
|
3406
|
+
id: "MarkAsDuplicateActionConfig",
|
|
3407
|
+
description: "Configuration for marking a record as a duplicate."
|
|
3408
|
+
}),
|
|
3409
|
+
MarkAsNotDuplicateConfig.meta({
|
|
3410
|
+
id: "MarkAsNotDuplicateActionConfig",
|
|
3411
|
+
description: "Configuration for marking a record as not a duplicate, after it was previously flagged as one."
|
|
3412
|
+
}),
|
|
3333
3413
|
RejectConfig.meta({
|
|
3334
3414
|
id: "RejectActionConfig",
|
|
3335
3415
|
description: "Configuration for rejecting a record before registration."
|
|
@@ -3346,6 +3426,14 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3346
3426
|
id: "RequestCorrectionActionConfig",
|
|
3347
3427
|
description: "Configuration for requesting a correction on a registered record."
|
|
3348
3428
|
}),
|
|
3429
|
+
ApproveCorrectionConfig.meta({
|
|
3430
|
+
id: "ApproveCorrectionActionConfig",
|
|
3431
|
+
description: "Configuration for approving a requested correction."
|
|
3432
|
+
}),
|
|
3433
|
+
RejectCorrectionConfig.meta({
|
|
3434
|
+
id: "RejectCorrectionActionConfig",
|
|
3435
|
+
description: "Configuration for rejecting a requested correction."
|
|
3436
|
+
}),
|
|
3349
3437
|
EditActionConfig.meta({
|
|
3350
3438
|
id: "EditActionConfig",
|
|
3351
3439
|
description: "Configuration for editing a record before registration."
|
|
@@ -4504,9 +4592,6 @@ function getActionConfig({
|
|
|
4504
4592
|
if (a.type === ActionType.CUSTOM && customActionType) {
|
|
4505
4593
|
return a.customActionType === customActionType;
|
|
4506
4594
|
}
|
|
4507
|
-
if (actionType === ActionType.APPROVE_CORRECTION || actionType === ActionType.REJECT_CORRECTION) {
|
|
4508
|
-
return a.type === ActionType.REQUEST_CORRECTION;
|
|
4509
|
-
}
|
|
4510
4595
|
return a.type === actionType;
|
|
4511
4596
|
});
|
|
4512
4597
|
}
|
|
@@ -5660,7 +5745,7 @@ function validateActionFlags(event2, ctx) {
|
|
|
5660
5745
|
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
5661
5746
|
const configuredFlagIds = event2.flags.map((flag2) => flag2.id);
|
|
5662
5747
|
const actionFlagIds = event2.actions.flatMap(
|
|
5663
|
-
(action) => action.flags.map((flag2) => flag2.id)
|
|
5748
|
+
(action) => (action.flags ?? []).map((flag2) => flag2.id)
|
|
5664
5749
|
);
|
|
5665
5750
|
for (const actionFlagId of actionFlagIds) {
|
|
5666
5751
|
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
@@ -6703,7 +6788,7 @@ function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
|
6703
6788
|
const declaration = aggregateActionDeclarations(eventUpToThisAction);
|
|
6704
6789
|
const annotation = aggregateActionAnnotations(eventUpToThisAction);
|
|
6705
6790
|
const form = { ...declaration, ...annotation };
|
|
6706
|
-
const flagsWithMetConditions = actionConfig.flags.filter(
|
|
6791
|
+
const flagsWithMetConditions = (actionConfig.flags ?? []).filter(
|
|
6707
6792
|
({ conditional }) => (
|
|
6708
6793
|
// If conditional is not provided, the flag is resolved
|
|
6709
6794
|
conditional ? isFlagConditionMet(conditional, form, action) : true
|