@opencrvs/toolkit 2.0.1-rc.7e65cec → 2.0.1-rc.837f69d

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 (31) hide show
  1. package/create-countryconfig/index.js +177 -14
  2. package/dist/application-config/index.js +6 -2
  3. package/dist/cli.js +8 -4
  4. package/dist/commons/api/router.d.ts +42 -15
  5. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  6. package/dist/commons/events/ActionConfig.d.ts +4 -0
  7. package/dist/commons/events/ActionDocument.d.ts +2 -2
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
  9. package/dist/commons/events/Draft.d.ts +1 -1
  10. package/dist/commons/events/EventDocument.d.ts +1 -1
  11. package/dist/commons/events/EventMetadata.d.ts +1 -1
  12. package/dist/commons/events/FieldConfig.d.ts +10 -0
  13. package/dist/commons/events/FormConfig.d.ts +6 -0
  14. package/dist/commons/events/PageConfig.d.ts +4 -0
  15. package/dist/commons/events/WorkqueueColumnConfig.d.ts +4 -4
  16. package/dist/commons/events/WorkqueueConfig.d.ts +5 -5
  17. package/dist/commons/events/state/utils.d.ts +1 -1
  18. package/dist/commons/events/utils.d.ts +5 -1
  19. package/dist/conditionals/index.js +6 -2
  20. package/dist/events/index.js +27 -2
  21. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  22. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  23. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  24. package/dist/migrations/v2.0/index.js +8 -4
  25. package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
  26. package/dist/notification/index.js +10 -2
  27. package/dist/scopes/index.d.ts +108 -0
  28. package/dist/scopes/index.js +6 -2
  29. package/opencrvs-toolkit-2.0.1-rc.837f69d.tgz +0 -0
  30. package/package.json +1 -1
  31. package/opencrvs-toolkit-2.0.1-rc.7e65cec.tgz +0 -0
@@ -48,6 +48,14 @@ declare const AllScopeOptions: z.ZodObject<{
48
48
  location: "location";
49
49
  all: "all";
50
50
  }>>;
51
+ createdBy: z.ZodOptional<z.ZodEnum<{
52
+ user: "user";
53
+ }>>;
54
+ createdIn: z.ZodOptional<z.ZodEnum<{
55
+ administrativeArea: "administrativeArea";
56
+ location: "location";
57
+ all: "all";
58
+ }>>;
51
59
  declaredIn: z.ZodOptional<z.ZodEnum<{
52
60
  administrativeArea: "administrativeArea";
53
61
  location: "location";
@@ -70,6 +78,8 @@ export declare const ScopeOptionKey: z.ZodEnum<{
70
78
  role: "role";
71
79
  event: "event";
72
80
  placeOfEvent: "placeOfEvent";
81
+ createdBy: "createdBy";
82
+ createdIn: "createdIn";
73
83
  declaredIn: "declaredIn";
74
84
  declaredBy: "declaredBy";
75
85
  registeredIn: "registeredIn";
@@ -110,6 +120,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
110
120
  location: "location";
111
121
  all: "all";
112
122
  }>>;
123
+ createdBy: z.ZodOptional<z.ZodEnum<{
124
+ user: "user";
125
+ }>>;
126
+ createdIn: z.ZodOptional<z.ZodEnum<{
127
+ administrativeArea: "administrativeArea";
128
+ location: "location";
129
+ all: "all";
130
+ }>>;
113
131
  }, z.core.$strip>>;
114
132
  }, z.core.$strip>, z.ZodObject<{
115
133
  type: z.ZodEnum<{
@@ -126,6 +144,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
126
144
  location: "location";
127
145
  all: "all";
128
146
  }>>;
147
+ createdBy: z.ZodOptional<z.ZodEnum<{
148
+ user: "user";
149
+ }>>;
150
+ createdIn: z.ZodOptional<z.ZodEnum<{
151
+ administrativeArea: "administrativeArea";
152
+ location: "location";
153
+ all: "all";
154
+ }>>;
129
155
  declaredIn: z.ZodOptional<z.ZodEnum<{
130
156
  administrativeArea: "administrativeArea";
131
157
  location: "location";
@@ -150,6 +176,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
176
  location: "location";
151
177
  all: "all";
152
178
  }>>;
179
+ createdBy: z.ZodOptional<z.ZodEnum<{
180
+ user: "user";
181
+ }>>;
182
+ createdIn: z.ZodOptional<z.ZodEnum<{
183
+ administrativeArea: "administrativeArea";
184
+ location: "location";
185
+ all: "all";
186
+ }>>;
153
187
  declaredIn: z.ZodOptional<z.ZodEnum<{
154
188
  administrativeArea: "administrativeArea";
155
189
  location: "location";
@@ -176,6 +210,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
210
  location: "location";
177
211
  all: "all";
178
212
  }>>;
213
+ createdBy: z.ZodOptional<z.ZodEnum<{
214
+ user: "user";
215
+ }>>;
216
+ createdIn: z.ZodOptional<z.ZodEnum<{
217
+ administrativeArea: "administrativeArea";
218
+ location: "location";
219
+ all: "all";
220
+ }>>;
179
221
  declaredIn: z.ZodOptional<z.ZodEnum<{
180
222
  administrativeArea: "administrativeArea";
181
223
  location: "location";
@@ -203,6 +245,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
245
  location: "location";
204
246
  all: "all";
205
247
  }>>;
248
+ createdBy: z.ZodOptional<z.ZodEnum<{
249
+ user: "user";
250
+ }>>;
251
+ createdIn: z.ZodOptional<z.ZodEnum<{
252
+ administrativeArea: "administrativeArea";
253
+ location: "location";
254
+ all: "all";
255
+ }>>;
206
256
  declaredIn: z.ZodOptional<z.ZodEnum<{
207
257
  administrativeArea: "administrativeArea";
208
258
  location: "location";
@@ -293,6 +343,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
293
343
  options: z.ZodOptional<z.ZodObject<{
294
344
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
295
345
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
346
+ createdBy: z.ZodOptional<z.ZodString>;
347
+ createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
296
348
  }, z.core.$strip>>;
297
349
  }, z.core.$strip>, z.ZodObject<{
298
350
  type: z.ZodEnum<{
@@ -305,6 +357,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
305
357
  options: z.ZodOptional<z.ZodObject<{
306
358
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
307
359
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
360
+ createdBy: z.ZodOptional<z.ZodString>;
361
+ createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
308
362
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
309
363
  declaredBy: z.ZodOptional<z.ZodString>;
310
364
  }, z.core.$strip>>;
@@ -319,6 +373,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
319
373
  options: z.ZodOptional<z.ZodObject<{
320
374
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
321
375
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
376
+ createdBy: z.ZodOptional<z.ZodString>;
377
+ createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
322
378
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
323
379
  declaredBy: z.ZodOptional<z.ZodString>;
324
380
  registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
@@ -329,6 +385,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
329
385
  options: z.ZodOptional<z.ZodObject<{
330
386
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
331
387
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
388
+ createdBy: z.ZodOptional<z.ZodString>;
389
+ createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
332
390
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
333
391
  declaredBy: z.ZodOptional<z.ZodString>;
334
392
  registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
@@ -369,6 +427,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
369
427
  location: "location";
370
428
  all: "all";
371
429
  }>>;
430
+ createdBy: z.ZodOptional<z.ZodEnum<{
431
+ user: "user";
432
+ }>>;
433
+ createdIn: z.ZodOptional<z.ZodEnum<{
434
+ administrativeArea: "administrativeArea";
435
+ location: "location";
436
+ all: "all";
437
+ }>>;
372
438
  }, z.core.$strip>>;
373
439
  }, z.core.$strip>, z.ZodObject<{
374
440
  type: z.ZodEnum<{
@@ -385,6 +451,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
385
451
  location: "location";
386
452
  all: "all";
387
453
  }>>;
454
+ createdBy: z.ZodOptional<z.ZodEnum<{
455
+ user: "user";
456
+ }>>;
457
+ createdIn: z.ZodOptional<z.ZodEnum<{
458
+ administrativeArea: "administrativeArea";
459
+ location: "location";
460
+ all: "all";
461
+ }>>;
388
462
  declaredIn: z.ZodOptional<z.ZodEnum<{
389
463
  administrativeArea: "administrativeArea";
390
464
  location: "location";
@@ -409,6 +483,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
483
  location: "location";
410
484
  all: "all";
411
485
  }>>;
486
+ createdBy: z.ZodOptional<z.ZodEnum<{
487
+ user: "user";
488
+ }>>;
489
+ createdIn: z.ZodOptional<z.ZodEnum<{
490
+ administrativeArea: "administrativeArea";
491
+ location: "location";
492
+ all: "all";
493
+ }>>;
412
494
  declaredIn: z.ZodOptional<z.ZodEnum<{
413
495
  administrativeArea: "administrativeArea";
414
496
  location: "location";
@@ -435,6 +517,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
435
517
  location: "location";
436
518
  all: "all";
437
519
  }>>;
520
+ createdBy: z.ZodOptional<z.ZodEnum<{
521
+ user: "user";
522
+ }>>;
523
+ createdIn: z.ZodOptional<z.ZodEnum<{
524
+ administrativeArea: "administrativeArea";
525
+ location: "location";
526
+ all: "all";
527
+ }>>;
438
528
  declaredIn: z.ZodOptional<z.ZodEnum<{
439
529
  administrativeArea: "administrativeArea";
440
530
  location: "location";
@@ -462,6 +552,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
462
552
  location: "location";
463
553
  all: "all";
464
554
  }>>;
555
+ createdBy: z.ZodOptional<z.ZodEnum<{
556
+ user: "user";
557
+ }>>;
558
+ createdIn: z.ZodOptional<z.ZodEnum<{
559
+ administrativeArea: "administrativeArea";
560
+ location: "location";
561
+ all: "all";
562
+ }>>;
465
563
  declaredIn: z.ZodOptional<z.ZodEnum<{
466
564
  administrativeArea: "administrativeArea";
467
565
  location: "location";
@@ -590,12 +688,16 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
590
688
  options?: {
591
689
  event?: string[] | undefined;
592
690
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
691
+ createdBy?: "user" | undefined;
692
+ createdIn?: "administrativeArea" | "location" | "all" | undefined;
593
693
  } | undefined;
594
694
  } | {
595
695
  type: "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register";
596
696
  options?: {
597
697
  event?: string[] | undefined;
598
698
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
699
+ createdBy?: "user" | undefined;
700
+ createdIn?: "administrativeArea" | "location" | "all" | undefined;
599
701
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
600
702
  declaredBy?: "user" | undefined;
601
703
  } | undefined;
@@ -604,6 +706,8 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
604
706
  options?: {
605
707
  event?: string[] | undefined;
606
708
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
709
+ createdBy?: "user" | undefined;
710
+ createdIn?: "administrativeArea" | "location" | "all" | undefined;
607
711
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
608
712
  declaredBy?: "user" | undefined;
609
713
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -614,6 +718,8 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
614
718
  options?: {
615
719
  event?: string[] | undefined;
616
720
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
721
+ createdBy?: "user" | undefined;
722
+ createdIn?: "administrativeArea" | "location" | "all" | undefined;
617
723
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
618
724
  declaredBy?: "user" | undefined;
619
725
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -625,6 +731,8 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
625
731
  options?: {
626
732
  event?: string[] | undefined;
627
733
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
734
+ createdBy?: "user" | undefined;
735
+ createdIn?: "administrativeArea" | "location" | "all" | undefined;
628
736
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
629
737
  declaredBy?: "user" | undefined;
630
738
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -147,7 +147,9 @@ var userRole = z3.preprocess(
147
147
  ).describe("User role, e.g. admin, field agent");
148
148
  var scopeOptionsPlaceEvent = z3.object({
149
149
  event: scopeByEvent,
150
- placeOfEvent: JurisdictionFilter.optional()
150
+ placeOfEvent: JurisdictionFilter.optional(),
151
+ createdBy: UserFilter.optional(),
152
+ createdIn: JurisdictionFilter.optional()
151
153
  }).describe("Options applicable to all record scopes.");
152
154
  var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
153
155
  declaredIn: JurisdictionFilter.optional(),
@@ -186,7 +188,9 @@ var AllScopeOptions = z3.object({
186
188
  var ScopeOptionKey = AllScopeOptions.keyof();
187
189
  var ResolvedScopeOptionsPlaceEvent = z3.object({
188
190
  event: scopeByEvent,
189
- placeOfEvent: UUID.nullish()
191
+ placeOfEvent: UUID.nullish(),
192
+ createdBy: z3.string().optional(),
193
+ createdIn: UUID.nullish()
190
194
  }).describe(
191
195
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
192
196
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "2.0.1-rc.7e65cec",
3
+ "version": "2.0.1-rc.837f69d",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "bin": {