@opencrvs/toolkit 2.2.0-rc.3af310b → 2.2.0-rc.3de6f63
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/dist/application-config/index.js +5 -5
- package/dist/authentication/index.d.ts +1 -0
- package/dist/authentication/index.js +16 -4
- package/dist/cli.js +586 -303
- package/dist/commons/api/router.d.ts +246 -246
- package/dist/commons/application-config/index.d.ts +2 -2
- package/dist/commons/conditionals/index.d.ts +1 -0
- package/dist/commons/conditionals/validate.d.ts +5 -0
- package/dist/commons/events/ActionConfig.d.ts +2 -2
- package/dist/commons/events/ActionDocument.d.ts +1 -0
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +3 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +5 -1
- package/dist/commons/events/EventConfig.d.ts +1 -10
- package/dist/commons/events/EventIndex.d.ts +2 -2
- package/dist/commons/events/FieldConfig.d.ts +1 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +6 -6
- package/dist/commons/events/Flag.d.ts +1 -1
- package/dist/commons/events/PlainDate.d.ts +1 -0
- package/dist/commons/events/eventConfigValidation.d.ts +1 -1
- package/dist/commons/events/field.d.ts +5 -0
- package/dist/commons/events/index.d.ts +3 -0
- package/dist/commons/events/test.utils.d.ts +2 -3
- package/dist/commons/events/toNotificationForm.d.ts +17 -0
- package/dist/commons/events/utils.d.ts +26 -5
- package/dist/conditionals/index.js +2 -2
- package/dist/environment/custom-types.d.ts +1 -0
- package/dist/environment/custom-types.d.ts.map +1 -1
- package/dist/environment/derived-variables.d.ts +6 -4
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +6 -4
- package/dist/environment/questions.d.ts +14 -2
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +39 -18
- package/dist/environment/registry.d.ts +15 -0
- package/dist/environment/registry.d.ts.map +1 -0
- package/dist/environment/registry.js +112 -0
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +76 -28
- package/dist/events/index.js +197 -143
- package/dist/migrations/add-notify-config.d.ts +40 -0
- package/dist/migrations/add-notify-config.d.ts.map +1 -0
- package/dist/migrations/add-notify-config.js +249 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +345 -143
- package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -1
- package/dist/migrations/move-declaration-to-declare-action.js +27 -144
- package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -1
- package/dist/migrations/read-declaration-through-helper.js +3 -61
- package/dist/migrations/utils.d.ts +61 -0
- package/dist/migrations/utils.d.ts.map +1 -0
- package/dist/migrations/utils.js +218 -0
- package/dist/notification/index.js +267 -81
- package/dist/scopes/index.d.ts +54 -51
- package/dist/scopes/index.js +12 -4
- package/dist/templates/charts-values/opencrvs-services/values.yaml +3 -4
- package/opencrvs-toolkit-2.2.0-rc.3de6f63.tgz +0 -0
- package/package.json +3 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/commons/events/notificationFormFallback.d.ts +0 -10
- package/dist/environment/dockerhub.d.ts +0 -15
- package/dist/environment/dockerhub.d.ts.map +0 -1
- package/dist/environment/dockerhub.js +0 -104
- package/opencrvs-toolkit-2.2.0-rc.3af310b.tgz +0 -0
package/dist/scopes/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const RecordScopeTypeV2: z.ZodEnum<{
|
|
|
40
40
|
}>;
|
|
41
41
|
export type RecordScopeTypeV2 = z.infer<typeof RecordScopeTypeV2>;
|
|
42
42
|
declare const AllScopeOptions: z.ZodObject<{
|
|
43
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
43
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
44
44
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
45
45
|
administrativeArea: "administrativeArea";
|
|
46
46
|
all: "all";
|
|
@@ -77,7 +77,7 @@ declare const AllScopeOptions: z.ZodObject<{
|
|
|
77
77
|
NOTIFIED: "NOTIFIED";
|
|
78
78
|
REGISTERED: "REGISTERED";
|
|
79
79
|
REVOKED: "REVOKED";
|
|
80
|
-
}
|
|
80
|
+
}>>>, unknown>;
|
|
81
81
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
82
82
|
administrativeArea: "administrativeArea";
|
|
83
83
|
all: "all";
|
|
@@ -111,8 +111,8 @@ declare const AllScopeOptions: z.ZodObject<{
|
|
|
111
111
|
all: "all";
|
|
112
112
|
location: "location";
|
|
113
113
|
}>>;
|
|
114
|
-
role: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
115
|
-
ids: z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
114
|
+
role: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>>;
|
|
115
|
+
ids: z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>;
|
|
116
116
|
}, z.core.$strip>;
|
|
117
117
|
type AllScopeOptions = z.infer<typeof AllScopeOptions>;
|
|
118
118
|
export declare const ScopeOptionKey: z.ZodEnum<{
|
|
@@ -167,7 +167,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
167
167
|
"record.notify": "record.notify";
|
|
168
168
|
}>;
|
|
169
169
|
options: z.ZodOptional<z.ZodObject<{
|
|
170
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
170
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
171
171
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
172
172
|
administrativeArea: "administrativeArea";
|
|
173
173
|
all: "all";
|
|
@@ -191,7 +191,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
191
191
|
"record.unarchive": "record.unarchive";
|
|
192
192
|
}>;
|
|
193
193
|
options: z.ZodOptional<z.ZodObject<{
|
|
194
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
194
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
195
195
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
196
196
|
administrativeArea: "administrativeArea";
|
|
197
197
|
all: "all";
|
|
@@ -228,7 +228,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
228
228
|
NOTIFIED: "NOTIFIED";
|
|
229
229
|
REGISTERED: "REGISTERED";
|
|
230
230
|
REVOKED: "REVOKED";
|
|
231
|
-
}
|
|
231
|
+
}>>>, unknown>;
|
|
232
232
|
}, z.core.$strip>>;
|
|
233
233
|
}, z.core.$strip>, z.ZodObject<{
|
|
234
234
|
type: z.ZodEnum<{
|
|
@@ -242,7 +242,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
242
242
|
"record.unassign-others": "record.unassign-others";
|
|
243
243
|
}>;
|
|
244
244
|
options: z.ZodOptional<z.ZodObject<{
|
|
245
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
245
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
246
246
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
247
247
|
administrativeArea: "administrativeArea";
|
|
248
248
|
all: "all";
|
|
@@ -279,7 +279,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
279
279
|
NOTIFIED: "NOTIFIED";
|
|
280
280
|
REGISTERED: "REGISTERED";
|
|
281
281
|
REVOKED: "REVOKED";
|
|
282
|
-
}
|
|
282
|
+
}>>>, unknown>;
|
|
283
283
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
284
284
|
administrativeArea: "administrativeArea";
|
|
285
285
|
all: "all";
|
|
@@ -312,7 +312,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
312
312
|
}, z.core.$strip>, z.ZodObject<{
|
|
313
313
|
type: z.ZodLiteral<"record.custom-action">;
|
|
314
314
|
options: z.ZodOptional<z.ZodObject<{
|
|
315
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
315
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
316
316
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
317
317
|
administrativeArea: "administrativeArea";
|
|
318
318
|
all: "all";
|
|
@@ -349,7 +349,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
349
349
|
NOTIFIED: "NOTIFIED";
|
|
350
350
|
REGISTERED: "REGISTERED";
|
|
351
351
|
REVOKED: "REVOKED";
|
|
352
|
-
}
|
|
352
|
+
}>>>, unknown>;
|
|
353
353
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
354
354
|
administrativeArea: "administrativeArea";
|
|
355
355
|
all: "all";
|
|
@@ -378,12 +378,12 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
378
378
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
379
379
|
}>]>, z.ZodString]>>>;
|
|
380
380
|
}, z.core.$strip>>;
|
|
381
|
-
customActionTypes: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
381
|
+
customActionTypes: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
382
382
|
}, z.core.$strip>>;
|
|
383
383
|
}, z.core.$strip>, z.ZodObject<{
|
|
384
384
|
type: z.ZodLiteral<"record.print-certified-copies">;
|
|
385
385
|
options: z.ZodOptional<z.ZodObject<{
|
|
386
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
386
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
387
387
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
388
388
|
administrativeArea: "administrativeArea";
|
|
389
389
|
all: "all";
|
|
@@ -420,7 +420,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
420
420
|
NOTIFIED: "NOTIFIED";
|
|
421
421
|
REGISTERED: "REGISTERED";
|
|
422
422
|
REVOKED: "REVOKED";
|
|
423
|
-
}
|
|
423
|
+
}>>>, unknown>;
|
|
424
424
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
425
425
|
administrativeArea: "administrativeArea";
|
|
426
426
|
all: "all";
|
|
@@ -449,7 +449,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
449
449
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
450
450
|
}>]>, z.ZodString]>>>;
|
|
451
451
|
}, z.core.$strip>>;
|
|
452
|
-
templates: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
452
|
+
templates: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
453
453
|
}, z.core.$strip>>;
|
|
454
454
|
}, z.core.$strip>, z.ZodObject<{
|
|
455
455
|
type: z.ZodEnum<{
|
|
@@ -457,7 +457,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
457
457
|
"record.action.reject": "record.action.reject";
|
|
458
458
|
}>;
|
|
459
459
|
options: z.ZodOptional<z.ZodObject<{
|
|
460
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
460
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
461
461
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
462
462
|
administrativeArea: "administrativeArea";
|
|
463
463
|
all: "all";
|
|
@@ -494,7 +494,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
494
494
|
NOTIFIED: "NOTIFIED";
|
|
495
495
|
REGISTERED: "REGISTERED";
|
|
496
496
|
REVOKED: "REVOKED";
|
|
497
|
-
}
|
|
497
|
+
}>>>, unknown>;
|
|
498
498
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
499
499
|
administrativeArea: "administrativeArea";
|
|
500
500
|
all: "all";
|
|
@@ -556,7 +556,7 @@ export declare const UserScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
556
556
|
all: "all";
|
|
557
557
|
location: "location";
|
|
558
558
|
}>>;
|
|
559
|
-
role: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
559
|
+
role: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>>;
|
|
560
560
|
}, z.core.$strip>>;
|
|
561
561
|
}, z.core.$strip>, z.ZodObject<{
|
|
562
562
|
type: z.ZodEnum<{
|
|
@@ -594,7 +594,7 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
594
594
|
"record.notify": "record.notify";
|
|
595
595
|
}>;
|
|
596
596
|
options: z.ZodOptional<z.ZodObject<{
|
|
597
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
597
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
598
598
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
599
599
|
createdBy: z.ZodOptional<z.ZodString>;
|
|
600
600
|
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -608,7 +608,7 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
608
608
|
"record.unarchive": "record.unarchive";
|
|
609
609
|
}>;
|
|
610
610
|
options: z.ZodOptional<z.ZodObject<{
|
|
611
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
611
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
612
612
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
613
613
|
createdBy: z.ZodOptional<z.ZodString>;
|
|
614
614
|
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -629,7 +629,7 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
629
629
|
"record.unassign-others": "record.unassign-others";
|
|
630
630
|
}>;
|
|
631
631
|
options: z.ZodOptional<z.ZodObject<{
|
|
632
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
632
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
633
633
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
634
634
|
createdBy: z.ZodOptional<z.ZodString>;
|
|
635
635
|
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -663,7 +663,7 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
663
663
|
}, z.core.$strip>, z.ZodObject<{
|
|
664
664
|
type: z.ZodLiteral<"record.print-certified-copies">;
|
|
665
665
|
options: z.ZodOptional<z.ZodObject<{
|
|
666
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
666
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
667
667
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
668
668
|
createdBy: z.ZodOptional<z.ZodString>;
|
|
669
669
|
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -723,7 +723,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
723
723
|
"record.notify": "record.notify";
|
|
724
724
|
}>;
|
|
725
725
|
options: z.ZodOptional<z.ZodObject<{
|
|
726
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
726
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
727
727
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
728
728
|
administrativeArea: "administrativeArea";
|
|
729
729
|
all: "all";
|
|
@@ -747,7 +747,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
747
747
|
"record.unarchive": "record.unarchive";
|
|
748
748
|
}>;
|
|
749
749
|
options: z.ZodOptional<z.ZodObject<{
|
|
750
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
750
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
751
751
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
752
752
|
administrativeArea: "administrativeArea";
|
|
753
753
|
all: "all";
|
|
@@ -784,7 +784,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
784
784
|
NOTIFIED: "NOTIFIED";
|
|
785
785
|
REGISTERED: "REGISTERED";
|
|
786
786
|
REVOKED: "REVOKED";
|
|
787
|
-
}
|
|
787
|
+
}>>>, unknown>;
|
|
788
788
|
}, z.core.$strip>>;
|
|
789
789
|
}, z.core.$strip>, z.ZodObject<{
|
|
790
790
|
type: z.ZodEnum<{
|
|
@@ -798,7 +798,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
798
798
|
"record.unassign-others": "record.unassign-others";
|
|
799
799
|
}>;
|
|
800
800
|
options: z.ZodOptional<z.ZodObject<{
|
|
801
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
801
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
802
802
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
803
803
|
administrativeArea: "administrativeArea";
|
|
804
804
|
all: "all";
|
|
@@ -835,7 +835,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
835
835
|
NOTIFIED: "NOTIFIED";
|
|
836
836
|
REGISTERED: "REGISTERED";
|
|
837
837
|
REVOKED: "REVOKED";
|
|
838
|
-
}
|
|
838
|
+
}>>>, unknown>;
|
|
839
839
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
840
840
|
administrativeArea: "administrativeArea";
|
|
841
841
|
all: "all";
|
|
@@ -868,7 +868,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
868
868
|
}, z.core.$strip>, z.ZodObject<{
|
|
869
869
|
type: z.ZodLiteral<"record.custom-action">;
|
|
870
870
|
options: z.ZodOptional<z.ZodObject<{
|
|
871
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
871
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
872
872
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
873
873
|
administrativeArea: "administrativeArea";
|
|
874
874
|
all: "all";
|
|
@@ -905,7 +905,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
905
905
|
NOTIFIED: "NOTIFIED";
|
|
906
906
|
REGISTERED: "REGISTERED";
|
|
907
907
|
REVOKED: "REVOKED";
|
|
908
|
-
}
|
|
908
|
+
}>>>, unknown>;
|
|
909
909
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
910
910
|
administrativeArea: "administrativeArea";
|
|
911
911
|
all: "all";
|
|
@@ -934,12 +934,12 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
934
934
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
935
935
|
}>]>, z.ZodString]>>>;
|
|
936
936
|
}, z.core.$strip>>;
|
|
937
|
-
customActionTypes: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
937
|
+
customActionTypes: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
938
938
|
}, z.core.$strip>>;
|
|
939
939
|
}, z.core.$strip>, z.ZodObject<{
|
|
940
940
|
type: z.ZodLiteral<"record.print-certified-copies">;
|
|
941
941
|
options: z.ZodOptional<z.ZodObject<{
|
|
942
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
942
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
943
943
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
944
944
|
administrativeArea: "administrativeArea";
|
|
945
945
|
all: "all";
|
|
@@ -976,7 +976,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
976
976
|
NOTIFIED: "NOTIFIED";
|
|
977
977
|
REGISTERED: "REGISTERED";
|
|
978
978
|
REVOKED: "REVOKED";
|
|
979
|
-
}
|
|
979
|
+
}>>>, unknown>;
|
|
980
980
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
981
981
|
administrativeArea: "administrativeArea";
|
|
982
982
|
all: "all";
|
|
@@ -1005,7 +1005,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1005
1005
|
readonly EDIT_IN_PROGRESS: 'edit-in-progress';
|
|
1006
1006
|
}>]>, z.ZodString]>>>;
|
|
1007
1007
|
}, z.core.$strip>>;
|
|
1008
|
-
templates: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
1008
|
+
templates: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
1009
1009
|
}, z.core.$strip>>;
|
|
1010
1010
|
}, z.core.$strip>, z.ZodObject<{
|
|
1011
1011
|
type: z.ZodEnum<{
|
|
@@ -1013,7 +1013,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1013
1013
|
"record.action.reject": "record.action.reject";
|
|
1014
1014
|
}>;
|
|
1015
1015
|
options: z.ZodOptional<z.ZodObject<{
|
|
1016
|
-
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
1016
|
+
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
1017
1017
|
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
1018
1018
|
administrativeArea: "administrativeArea";
|
|
1019
1019
|
all: "all";
|
|
@@ -1050,7 +1050,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1050
1050
|
NOTIFIED: "NOTIFIED";
|
|
1051
1051
|
REGISTERED: "REGISTERED";
|
|
1052
1052
|
REVOKED: "REVOKED";
|
|
1053
|
-
}
|
|
1053
|
+
}>>>, unknown>;
|
|
1054
1054
|
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
1055
1055
|
administrativeArea: "administrativeArea";
|
|
1056
1056
|
all: "all";
|
|
@@ -1091,7 +1091,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1091
1091
|
all: "all";
|
|
1092
1092
|
location: "location";
|
|
1093
1093
|
}>>;
|
|
1094
|
-
role: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString
|
|
1094
|
+
role: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>>;
|
|
1095
1095
|
}, z.core.$strip>>;
|
|
1096
1096
|
}, z.core.$strip>, z.ZodObject<{
|
|
1097
1097
|
type: z.ZodEnum<{
|
|
@@ -1117,12 +1117,12 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1117
1117
|
}, z.core.$strip>, z.ZodObject<{
|
|
1118
1118
|
type: z.ZodLiteral<"workqueue">;
|
|
1119
1119
|
options: z.ZodObject<{
|
|
1120
|
-
ids: z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
1120
|
+
ids: z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>;
|
|
1121
1121
|
}, z.core.$strip>;
|
|
1122
1122
|
}, z.core.$strip>, z.ZodObject<{
|
|
1123
1123
|
type: z.ZodLiteral<"dashboard.view">;
|
|
1124
1124
|
options: z.ZodObject<{
|
|
1125
|
-
ids: z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
1125
|
+
ids: z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>;
|
|
1126
1126
|
}, z.core.$strip>;
|
|
1127
1127
|
}, z.core.$strip>], "type">;
|
|
1128
1128
|
export type Scope = z.infer<typeof Scope>;
|
|
@@ -1191,6 +1191,17 @@ export declare const encodeScope: (scope: Scope) => EncodedScope;
|
|
|
1191
1191
|
* @returns The decoded scope object.
|
|
1192
1192
|
*/
|
|
1193
1193
|
export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
1194
|
+
type: "user.create" | "user.edit";
|
|
1195
|
+
options?: {
|
|
1196
|
+
accessLevel?: "administrativeArea" | "all" | "location" | undefined;
|
|
1197
|
+
role?: string[] | undefined;
|
|
1198
|
+
} | undefined;
|
|
1199
|
+
} | {
|
|
1200
|
+
type: "user.read" | "user.search";
|
|
1201
|
+
options?: {
|
|
1202
|
+
accessLevel?: "administrativeArea" | "all" | "location" | undefined;
|
|
1203
|
+
} | undefined;
|
|
1204
|
+
} | {
|
|
1194
1205
|
type: "record.create" | "record.declare" | "record.notify";
|
|
1195
1206
|
options?: {
|
|
1196
1207
|
event?: string[] | undefined;
|
|
@@ -1293,17 +1304,6 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
1293
1304
|
allOf?: string[] | undefined;
|
|
1294
1305
|
} | undefined;
|
|
1295
1306
|
} | undefined;
|
|
1296
|
-
} | {
|
|
1297
|
-
type: "user.create" | "user.edit";
|
|
1298
|
-
options?: {
|
|
1299
|
-
accessLevel?: "administrativeArea" | "all" | "location" | undefined;
|
|
1300
|
-
role?: string[] | undefined;
|
|
1301
|
-
} | undefined;
|
|
1302
|
-
} | {
|
|
1303
|
-
type: "user.read" | "user.search";
|
|
1304
|
-
options?: {
|
|
1305
|
-
accessLevel?: "administrativeArea" | "all" | "location" | undefined;
|
|
1306
|
-
} | undefined;
|
|
1307
1307
|
} | {
|
|
1308
1308
|
type: "attachment.upload" | "bypassratelimit" | "config.update-all" | "integration.audit.read" | "integration.create" | "location.edit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.import" | "record.reindex" | "user.data-seeding" | "user.read-only-my-audit";
|
|
1309
1309
|
} | {
|
|
@@ -1382,13 +1382,16 @@ export declare function hasScope(token: string, scope: ScopeType): boolean;
|
|
|
1382
1382
|
*/
|
|
1383
1383
|
export declare function hasScope(scopes: EncodedScope[], scope: ScopeType): boolean;
|
|
1384
1384
|
/**
|
|
1385
|
-
* Checks if the
|
|
1385
|
+
* Checks if the user has the scope to perform an action on an event of a certain type.
|
|
1386
1386
|
*
|
|
1387
1387
|
* @param {Scope[]} userScopes - The scopes of the user.
|
|
1388
1388
|
* @param {string} eventType - The event type to check for permission.
|
|
1389
|
-
* @
|
|
1389
|
+
* @param {ScopeType[]} acceptedScopes - The scopes to check for permission.
|
|
1390
|
+
* @returns {boolean} Returns true if the user has the scope to perform an action on an event of a certain type.
|
|
1390
1391
|
*/
|
|
1392
|
+
export declare function hasScopeForEventType(userScopes: EncodedScope[], eventType: string, acceptedScope: ScopeType): boolean;
|
|
1391
1393
|
export declare function canUserCreateEvent(userScopes: EncodedScope[], eventType: string): boolean;
|
|
1394
|
+
export declare function canUserNotifyEvent(userScopes: EncodedScope[], eventType: string): boolean;
|
|
1392
1395
|
/**
|
|
1393
1396
|
* Helper for defining scopes for user roles. Should be used in country config.
|
|
1394
1397
|
*
|
package/dist/scopes/index.js
CHANGED
|
@@ -45,6 +45,7 @@ __export(scopes_exports, {
|
|
|
45
45
|
UserFilter: () => UserFilter,
|
|
46
46
|
UserScopeV2: () => UserScopeV2,
|
|
47
47
|
canUserCreateEvent: () => canUserCreateEvent,
|
|
48
|
+
canUserNotifyEvent: () => canUserNotifyEvent,
|
|
48
49
|
decodeScope: () => decodeScope,
|
|
49
50
|
defineRoles: () => defineRoles,
|
|
50
51
|
defineScopes: () => defineScopes,
|
|
@@ -53,6 +54,7 @@ __export(scopes_exports, {
|
|
|
53
54
|
getScopeOptionValue: () => getScopeOptionValue,
|
|
54
55
|
hasAnyScope: () => hasAnyScope,
|
|
55
56
|
hasScope: () => hasScope,
|
|
57
|
+
hasScopeForEventType: () => hasScopeForEventType,
|
|
56
58
|
isCustomActionScope: () => isCustomActionScope,
|
|
57
59
|
scopeUsesDeclaredOptions: () => scopeUsesDeclaredOptions,
|
|
58
60
|
scopeUsesFullOptions: () => scopeUsesFullOptions,
|
|
@@ -221,7 +223,7 @@ var ActionStatus = {
|
|
|
221
223
|
};
|
|
222
224
|
|
|
223
225
|
// ../commons/src/events/Flag.ts
|
|
224
|
-
var z6 = __toESM(require("zod
|
|
226
|
+
var z6 = __toESM(require("zod"));
|
|
225
227
|
|
|
226
228
|
// ../commons/src/events/TranslationConfig.ts
|
|
227
229
|
var z4 = __toESM(require("zod/v4"));
|
|
@@ -317,7 +319,7 @@ var CustomFlag = z6.string().refine((val) => !Object.values(InherentFlags).inclu
|
|
|
317
319
|
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
318
320
|
InherentFlags
|
|
319
321
|
).join(", ")}`
|
|
320
|
-
}).refine((val) => !ActionFlag.
|
|
322
|
+
}).refine((val) => !ActionFlag.validate(val), {
|
|
321
323
|
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
322
324
|
}).describe("Custom flag identifier defined by the country config.");
|
|
323
325
|
var Flag = ActionFlag.or(z6.enum(InherentFlags)).or(CustomFlag);
|
|
@@ -714,9 +716,9 @@ function hasScope(tokenOrScopes, scope) {
|
|
|
714
716
|
}
|
|
715
717
|
return hasAnyScope(tokenOrScopes, [scope]);
|
|
716
718
|
}
|
|
717
|
-
function
|
|
719
|
+
function hasScopeForEventType(userScopes, eventType, acceptedScope) {
|
|
718
720
|
const scopes = getAcceptedScopesByType({
|
|
719
|
-
acceptedScopes: [
|
|
721
|
+
acceptedScopes: [acceptedScope],
|
|
720
722
|
scopes: userScopes
|
|
721
723
|
});
|
|
722
724
|
return scopes.some((scope) => {
|
|
@@ -726,6 +728,12 @@ function canUserCreateEvent(userScopes, eventType) {
|
|
|
726
728
|
return scope.options?.event?.includes(eventType);
|
|
727
729
|
});
|
|
728
730
|
}
|
|
731
|
+
function canUserCreateEvent(userScopes, eventType) {
|
|
732
|
+
return hasScopeForEventType(userScopes, eventType, "record.create");
|
|
733
|
+
}
|
|
734
|
+
function canUserNotifyEvent(userScopes, eventType) {
|
|
735
|
+
return hasScopeForEventType(userScopes, eventType, "record.notify");
|
|
736
|
+
}
|
|
729
737
|
function defineScopes(scopes) {
|
|
730
738
|
return scopes.map((scope) => Scope2.parse(scope)).map(encodeScope);
|
|
731
739
|
}
|
|
@@ -27,7 +27,7 @@ hpa:
|
|
|
27
27
|
enabled: false
|
|
28
28
|
|
|
29
29
|
env:
|
|
30
|
-
|
|
30
|
+
S3_BUCKET: ocrvs
|
|
31
31
|
OPENCRVS_ENVIRONMENT: {{opencrvs_environment}}
|
|
32
32
|
|
|
33
33
|
otel:
|
|
@@ -39,8 +39,7 @@ elasticsearch:
|
|
|
39
39
|
auth_mode: auto
|
|
40
40
|
host: elasticsearch.opencrvs-deps-{{env}}.svc.cluster.local
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
auth_mode: use_secret
|
|
42
|
+
s3:
|
|
44
43
|
host: minio-0.minio.opencrvs-deps-{{env}}.svc.cluster.local
|
|
45
44
|
|
|
46
45
|
redis:
|
|
@@ -54,7 +53,7 @@ postgres:
|
|
|
54
53
|
platform:
|
|
55
54
|
imagePullSecrets:
|
|
56
55
|
# Default value for credentials created while yarn environment:init
|
|
57
|
-
- name:
|
|
56
|
+
- name: registry-credentials
|
|
58
57
|
|
|
59
58
|
auth:
|
|
60
59
|
env:
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencrvs/toolkit",
|
|
3
|
-
"version": "2.2.0-rc.
|
|
3
|
+
"version": "2.2.0-rc.3de6f63",
|
|
4
4
|
"description": "OpenCRVS toolkit for building country configurations",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"build": "./build.sh",
|
|
23
23
|
"build:all": "pnpm -w exec lerna run build --include-dependencies --scope @opencrvs/toolkit",
|
|
24
24
|
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
25
26
|
"test:compilation": "tsc --noEmit"
|
|
26
27
|
},
|
|
27
28
|
"repository": {
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"superjson": "1.9.0-0",
|
|
53
54
|
"ts-morph": "^27.0.2",
|
|
54
55
|
"uuid": "^9.0.0",
|
|
55
|
-
"zod": "^4.
|
|
56
|
+
"zod": "^4.6.5",
|
|
56
57
|
"zod-openapi": "^5.4.6"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|