@opencrvs/toolkit 2.0.0-rc.9954a7c → 2.0.0-rc.99921a2

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 (113) hide show
  1. package/README.md +15 -0
  2. package/build.sh +5 -4
  3. package/dist/application-config/index.js +82 -40
  4. package/dist/cli.js +3186 -4915
  5. package/dist/commons/api/router.d.ts +700 -22
  6. package/dist/commons/application-config/index.d.ts +1 -0
  7. package/dist/commons/conditionals/conditionals.d.ts +354 -10
  8. package/dist/commons/conditionals/validate.d.ts +51 -2
  9. package/dist/commons/events/ActionConfig.d.ts +230 -2
  10. package/dist/commons/events/ActionDocument.d.ts +50 -0
  11. package/dist/commons/events/ActionInput.d.ts +32 -0
  12. package/dist/commons/events/ActionType.d.ts +6 -1
  13. package/dist/commons/events/AdvancedSearchConfig.d.ts +360 -0
  14. package/dist/commons/events/AuditLog.d.ts +2 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
  16. package/dist/commons/events/Draft.d.ts +2 -0
  17. package/dist/commons/events/EventConfig.d.ts +2 -0
  18. package/dist/commons/events/EventDocument.d.ts +25 -0
  19. package/dist/commons/events/EventIndex.d.ts +25 -0
  20. package/dist/commons/events/EventMetadata.d.ts +26 -0
  21. package/dist/commons/events/FieldConfig.d.ts +393 -50
  22. package/dist/commons/events/FieldType.d.ts +1 -0
  23. package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
  24. package/dist/commons/events/FieldValue.d.ts +6 -0
  25. package/dist/commons/events/WorkqueueConfig.d.ts +44 -2
  26. package/dist/commons/events/field.d.ts +53 -1
  27. package/dist/commons/events/index.d.ts +1 -0
  28. package/dist/commons/events/locations.d.ts +1 -0
  29. package/dist/commons/events/scopes.d.ts +1 -0
  30. package/dist/commons/events/state/flags.d.ts +14 -0
  31. package/dist/commons/events/state/index.d.ts +8 -0
  32. package/dist/commons/events/state/utils.d.ts +21 -287
  33. package/dist/commons/events/test.utils.d.ts +9 -1
  34. package/dist/commons/events/utils.d.ts +27 -2
  35. package/dist/conditionals/index.js +60 -6
  36. package/dist/environment/custom-types.d.ts +33 -0
  37. package/dist/environment/custom-types.d.ts.map +1 -0
  38. package/dist/environment/custom-types.js +12 -0
  39. package/dist/environment/derived-variables.d.ts +134 -0
  40. package/dist/environment/derived-variables.d.ts.map +1 -0
  41. package/dist/environment/derived-variables.js +169 -0
  42. package/dist/environment/editor-questions.d.ts +4 -0
  43. package/dist/environment/editor-questions.d.ts.map +1 -0
  44. package/dist/environment/editor-questions.js +67 -0
  45. package/dist/environment/git.d.ts +5 -0
  46. package/dist/environment/git.d.ts.map +1 -0
  47. package/dist/environment/git.js +38 -0
  48. package/dist/environment/github.d.ts +26 -0
  49. package/dist/environment/github.d.ts.map +1 -0
  50. package/dist/environment/github.js +247 -0
  51. package/dist/environment/index.d.ts +5 -0
  52. package/dist/environment/index.d.ts.map +1 -0
  53. package/dist/environment/index.js +71 -0
  54. package/dist/environment/logger.d.ts +15 -0
  55. package/dist/environment/logger.d.ts.map +1 -0
  56. package/dist/environment/logger.js +25 -0
  57. package/dist/environment/manage-users.d.ts +11 -0
  58. package/dist/environment/manage-users.d.ts.map +1 -0
  59. package/dist/environment/manage-users.js +497 -0
  60. package/dist/environment/questions-helper.d.ts +15 -0
  61. package/dist/environment/questions-helper.d.ts.map +1 -0
  62. package/dist/environment/questions-helper.js +70 -0
  63. package/dist/environment/questions.d.ts +199 -0
  64. package/dist/environment/questions.d.ts.map +1 -0
  65. package/dist/environment/questions.js +412 -0
  66. package/dist/environment/setup-environment.d.ts +2 -0
  67. package/dist/environment/setup-environment.d.ts.map +1 -0
  68. package/dist/environment/setup-environment.js +794 -0
  69. package/dist/environment/ssh-keygen.d.ts +5 -0
  70. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  71. package/dist/environment/ssh-keygen.js +21 -0
  72. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  73. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  74. package/dist/environment/swarm-to-k8s.js +173 -0
  75. package/dist/environment/templates.d.ts +27 -0
  76. package/dist/environment/templates.d.ts.map +1 -0
  77. package/dist/environment/templates.js +163 -0
  78. package/dist/environment/update-workflows.d.ts +2 -0
  79. package/dist/environment/update-workflows.d.ts.map +1 -0
  80. package/dist/environment/update-workflows.js +169 -0
  81. package/dist/environment/users.d.ts +2 -0
  82. package/dist/environment/users.d.ts.map +1 -0
  83. package/dist/environment/users.js +112 -0
  84. package/dist/environment/utils.d.ts +18 -0
  85. package/dist/environment/utils.d.ts.map +1 -0
  86. package/dist/environment/utils.js +100 -0
  87. package/dist/events/index.js +600 -158
  88. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  89. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  90. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  91. package/dist/migrations/v2.0/index.js +88 -5133
  92. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
  93. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
  94. package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
  95. package/dist/migrations/v2.1/index.d.ts +6 -0
  96. package/dist/migrations/v2.1/index.d.ts.map +1 -0
  97. package/dist/migrations/v2.1/index.js +218 -0
  98. package/dist/notification/index.js +389 -49
  99. package/dist/scopes/index.d.ts +100 -8
  100. package/dist/scopes/index.js +21 -8
  101. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  102. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  103. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  104. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  105. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  106. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  107. package/dist/templates/inventory/inventory.template.yml +100 -0
  108. package/dist/templates/inventory/production.example.yml +77 -0
  109. package/dist/templates/inventory/qa.example.yml +48 -0
  110. package/opencrvs-toolkit-2.0.0-rc.99921a2.tgz +0 -0
  111. package/package.json +15 -1
  112. package/tsconfig.tsbuildinfo +1 -1
  113. package/opencrvs-toolkit-2.0.0-rc.9954a7c.tgz +0 -0
@@ -14,7 +14,7 @@ export type UserFilter = z.infer<typeof UserFilter>;
14
14
  * The different types of scopes that can be used to control access to records. Each type has different options that can be used to further filter the records that the scope applies to.
15
15
  * When adding new scope types, they should be added to the appropriate section based on the options they require.
16
16
  *
17
- * @see scopeOptionsPlaceEvent @see scopeOptionsDeclared @see scopeOptionsFull
17
+ * @see scopeOptionsPlaceEvent @see scopeOptionsDeclaredOrNotified @see scopeOptionsFull
18
18
  */
19
19
  export declare const RecordScopeTypeV2: z.ZodEnum<{
20
20
  "record.search": "record.search";
@@ -25,6 +25,7 @@ export declare const RecordScopeTypeV2: z.ZodEnum<{
25
25
  "record.edit": "record.edit";
26
26
  "record.reject": "record.reject";
27
27
  "record.archive": "record.archive";
28
+ "record.unarchive": "record.unarchive";
28
29
  "record.review-duplicates": "record.review-duplicates";
29
30
  "record.register": "record.register";
30
31
  "record.print-certified-copies": "record.print-certified-copies";
@@ -48,6 +49,14 @@ declare const AllScopeOptions: z.ZodObject<{
48
49
  location: "location";
49
50
  all: "all";
50
51
  }>>;
52
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
53
+ administrativeArea: "administrativeArea";
54
+ location: "location";
55
+ all: "all";
56
+ }>>;
57
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
58
+ user: "user";
59
+ }>>;
51
60
  declaredIn: z.ZodOptional<z.ZodEnum<{
52
61
  administrativeArea: "administrativeArea";
53
62
  location: "location";
@@ -70,6 +79,8 @@ export declare const ScopeOptionKey: z.ZodEnum<{
70
79
  role: "role";
71
80
  event: "event";
72
81
  placeOfEvent: "placeOfEvent";
82
+ notifiedIn: "notifiedIn";
83
+ notifiedBy: "notifiedBy";
73
84
  declaredIn: "declaredIn";
74
85
  declaredBy: "declaredBy";
75
86
  registeredIn: "registeredIn";
@@ -87,6 +98,7 @@ export declare const ScopesWithDeclaredOptions: z.ZodEnum<{
87
98
  "record.edit": "record.edit";
88
99
  "record.reject": "record.reject";
89
100
  "record.archive": "record.archive";
101
+ "record.unarchive": "record.unarchive";
90
102
  "record.review-duplicates": "record.review-duplicates";
91
103
  "record.register": "record.register";
92
104
  }>;
@@ -116,6 +128,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
128
  "record.edit": "record.edit";
117
129
  "record.reject": "record.reject";
118
130
  "record.archive": "record.archive";
131
+ "record.unarchive": "record.unarchive";
119
132
  "record.review-duplicates": "record.review-duplicates";
120
133
  "record.register": "record.register";
121
134
  }>;
@@ -126,6 +139,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
126
139
  location: "location";
127
140
  all: "all";
128
141
  }>>;
142
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
143
+ administrativeArea: "administrativeArea";
144
+ location: "location";
145
+ all: "all";
146
+ }>>;
147
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
148
+ user: "user";
149
+ }>>;
129
150
  declaredIn: z.ZodOptional<z.ZodEnum<{
130
151
  administrativeArea: "administrativeArea";
131
152
  location: "location";
@@ -150,6 +171,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
171
  location: "location";
151
172
  all: "all";
152
173
  }>>;
174
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
175
+ administrativeArea: "administrativeArea";
176
+ location: "location";
177
+ all: "all";
178
+ }>>;
179
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
180
+ user: "user";
181
+ }>>;
153
182
  declaredIn: z.ZodOptional<z.ZodEnum<{
154
183
  administrativeArea: "administrativeArea";
155
184
  location: "location";
@@ -176,6 +205,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
205
  location: "location";
177
206
  all: "all";
178
207
  }>>;
208
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
209
+ administrativeArea: "administrativeArea";
210
+ location: "location";
211
+ all: "all";
212
+ }>>;
213
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
214
+ user: "user";
215
+ }>>;
179
216
  declaredIn: z.ZodOptional<z.ZodEnum<{
180
217
  administrativeArea: "administrativeArea";
181
218
  location: "location";
@@ -203,6 +240,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
240
  location: "location";
204
241
  all: "all";
205
242
  }>>;
243
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
244
+ administrativeArea: "administrativeArea";
245
+ location: "location";
246
+ all: "all";
247
+ }>>;
248
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
249
+ user: "user";
250
+ }>>;
206
251
  declaredIn: z.ZodOptional<z.ZodEnum<{
207
252
  administrativeArea: "administrativeArea";
208
253
  location: "location";
@@ -299,12 +344,15 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
299
344
  "record.edit": "record.edit";
300
345
  "record.reject": "record.reject";
301
346
  "record.archive": "record.archive";
347
+ "record.unarchive": "record.unarchive";
302
348
  "record.review-duplicates": "record.review-duplicates";
303
349
  "record.register": "record.register";
304
350
  }>;
305
351
  options: z.ZodOptional<z.ZodObject<{
306
352
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
307
353
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
354
+ notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
355
+ notifiedBy: z.ZodOptional<z.ZodString>;
308
356
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
309
357
  declaredBy: z.ZodOptional<z.ZodString>;
310
358
  }, z.core.$strip>>;
@@ -319,6 +367,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
319
367
  options: z.ZodOptional<z.ZodObject<{
320
368
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
321
369
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
370
+ notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
371
+ notifiedBy: z.ZodOptional<z.ZodString>;
322
372
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
323
373
  declaredBy: z.ZodOptional<z.ZodString>;
324
374
  registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
@@ -329,6 +379,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
329
379
  options: z.ZodOptional<z.ZodObject<{
330
380
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
331
381
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
382
+ notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
383
+ notifiedBy: z.ZodOptional<z.ZodString>;
332
384
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
333
385
  declaredBy: z.ZodOptional<z.ZodString>;
334
386
  registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
@@ -375,6 +427,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
375
427
  "record.edit": "record.edit";
376
428
  "record.reject": "record.reject";
377
429
  "record.archive": "record.archive";
430
+ "record.unarchive": "record.unarchive";
378
431
  "record.review-duplicates": "record.review-duplicates";
379
432
  "record.register": "record.register";
380
433
  }>;
@@ -385,6 +438,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
385
438
  location: "location";
386
439
  all: "all";
387
440
  }>>;
441
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
442
+ administrativeArea: "administrativeArea";
443
+ location: "location";
444
+ all: "all";
445
+ }>>;
446
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
447
+ user: "user";
448
+ }>>;
388
449
  declaredIn: z.ZodOptional<z.ZodEnum<{
389
450
  administrativeArea: "administrativeArea";
390
451
  location: "location";
@@ -409,6 +470,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
470
  location: "location";
410
471
  all: "all";
411
472
  }>>;
473
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
474
+ administrativeArea: "administrativeArea";
475
+ location: "location";
476
+ all: "all";
477
+ }>>;
478
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
479
+ user: "user";
480
+ }>>;
412
481
  declaredIn: z.ZodOptional<z.ZodEnum<{
413
482
  administrativeArea: "administrativeArea";
414
483
  location: "location";
@@ -435,6 +504,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
435
504
  location: "location";
436
505
  all: "all";
437
506
  }>>;
507
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
508
+ administrativeArea: "administrativeArea";
509
+ location: "location";
510
+ all: "all";
511
+ }>>;
512
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
513
+ user: "user";
514
+ }>>;
438
515
  declaredIn: z.ZodOptional<z.ZodEnum<{
439
516
  administrativeArea: "administrativeArea";
440
517
  location: "location";
@@ -462,6 +539,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
462
539
  location: "location";
463
540
  all: "all";
464
541
  }>>;
542
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
543
+ administrativeArea: "administrativeArea";
544
+ location: "location";
545
+ all: "all";
546
+ }>>;
547
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
548
+ user: "user";
549
+ }>>;
465
550
  declaredIn: z.ZodOptional<z.ZodEnum<{
466
551
  administrativeArea: "administrativeArea";
467
552
  location: "location";
@@ -535,6 +620,7 @@ export declare const ScopeType: z.ZodEnum<{
535
620
  "record.edit": "record.edit";
536
621
  "record.reject": "record.reject";
537
622
  "record.archive": "record.archive";
623
+ "record.unarchive": "record.unarchive";
538
624
  "record.review-duplicates": "record.review-duplicates";
539
625
  "record.register": "record.register";
540
626
  "record.print-certified-copies": "record.print-certified-copies";
@@ -580,24 +666,24 @@ export type EncodedScope = z.infer<typeof EncodedScope>;
580
666
  */
581
667
  export declare const encodeScope: (scope: Scope) => EncodedScope;
582
668
  /**
583
- * Converts a scope object into an encoded query string representation.
669
+ * Converts an encoded scope string into a scope object.
584
670
  *
585
- * @TODO scope param could be defined as EncodedScope instead of string.
586
- *
587
- * @param scope - The scope object to encode.
588
- * @returns The encoded scope as a branded string (`EncodedScope`).
671
+ * @param scope - The encoded scope string to decode.
672
+ * @returns The decoded scope object.
589
673
  */
590
- export declare const decodeScope: (query: EncodedScope) => {
674
+ export declare const decodeScope: (encodedScope: EncodedScope) => {
591
675
  type: "record.create" | "record.declare" | "record.notify";
592
676
  options?: {
593
677
  event?: string[] | undefined;
594
678
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
595
679
  } | undefined;
596
680
  } | {
597
- type: "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register";
681
+ type: "record.edit" | "record.reject" | "record.archive" | "record.unarchive" | "record.review-duplicates" | "record.register";
598
682
  options?: {
599
683
  event?: string[] | undefined;
600
684
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
685
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
686
+ notifiedBy?: "user" | undefined;
601
687
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
602
688
  declaredBy?: "user" | undefined;
603
689
  } | undefined;
@@ -606,6 +692,8 @@ export declare const decodeScope: (query: EncodedScope) => {
606
692
  options?: {
607
693
  event?: string[] | undefined;
608
694
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
695
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
696
+ notifiedBy?: "user" | undefined;
609
697
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
610
698
  declaredBy?: "user" | undefined;
611
699
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -616,6 +704,8 @@ export declare const decodeScope: (query: EncodedScope) => {
616
704
  options?: {
617
705
  event?: string[] | undefined;
618
706
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
707
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
708
+ notifiedBy?: "user" | undefined;
619
709
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
620
710
  declaredBy?: "user" | undefined;
621
711
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -627,6 +717,8 @@ export declare const decodeScope: (query: EncodedScope) => {
627
717
  options?: {
628
718
  event?: string[] | undefined;
629
719
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
720
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
721
+ notifiedBy?: "user" | undefined;
630
722
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
631
723
  declaredBy?: "user" | undefined;
632
724
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -110,6 +110,7 @@ var RecordScopeTypeV2 = z3.enum([
110
110
  "record.edit",
111
111
  "record.reject",
112
112
  "record.archive",
113
+ "record.unarchive",
113
114
  "record.review-duplicates",
114
115
  "record.register",
115
116
  "record.print-certified-copies",
@@ -149,11 +150,13 @@ var scopeOptionsPlaceEvent = z3.object({
149
150
  event: scopeByEvent,
150
151
  placeOfEvent: JurisdictionFilter.optional()
151
152
  }).describe("Options applicable to all record scopes.");
152
- var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
153
+ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
154
+ notifiedIn: JurisdictionFilter.optional(),
155
+ notifiedBy: UserFilter.optional(),
153
156
  declaredIn: JurisdictionFilter.optional(),
154
157
  declaredBy: UserFilter.optional()
155
158
  }).describe("Options applicable to actions that may take place after DECLARE");
156
- var AllRecordScopeOptions = scopeOptionsDeclared.extend({
159
+ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
157
160
  registeredIn: JurisdictionFilter.optional(),
158
161
  registeredBy: UserFilter.optional()
159
162
  }).describe(
@@ -191,6 +194,8 @@ var ResolvedScopeOptionsPlaceEvent = z3.object({
191
194
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
192
195
  );
193
196
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
197
+ notifiedIn: UUID.nullish(),
198
+ notifiedBy: z3.string().optional(),
194
199
  declaredIn: UUID.nullish(),
195
200
  declaredBy: z3.string().optional()
196
201
  }).describe(
@@ -211,6 +216,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
211
216
  "record.edit",
212
217
  "record.reject",
213
218
  "record.archive",
219
+ "record.unarchive",
214
220
  "record.review-duplicates",
215
221
  "record.register"
216
222
  ]);
@@ -236,7 +242,7 @@ var RecordScopeV2 = z3.discriminatedUnion("type", [
236
242
  }),
237
243
  z3.object({
238
244
  type: ScopesWithDeclaredOptions,
239
- options: scopeOptionsDeclared.optional()
245
+ options: scopeOptionsDeclaredOrNotified.optional()
240
246
  }),
241
247
  z3.object({
242
248
  type: ScopesWithFullOptions,
@@ -354,20 +360,27 @@ var encodeScope = (scope) => {
354
360
  encode: false
355
361
  });
356
362
  };
357
- var decodeScope = (query) => {
358
- const scope = qs.parse(query, {
363
+ var decodedScopeCache = /* @__PURE__ */ new Map();
364
+ var decodeScope = (encodedScope) => {
365
+ if (decodedScopeCache.has(encodedScope)) {
366
+ return decodedScopeCache.get(encodedScope);
367
+ }
368
+ const scope = qs.parse(encodedScope, {
359
369
  ignoreQueryPrefix: true,
360
370
  comma: true,
361
371
  allowDots: true
362
372
  });
363
373
  const unflattenedScope = unflattenScope(scope);
364
- return Scope2.safeParse(unflattenedScope)?.data;
374
+ const result = Scope2.safeParse(unflattenedScope)?.data;
375
+ decodedScopeCache.set(encodedScope, result);
376
+ return result;
365
377
  };
366
378
  var DEFAULT_SCOPE_OPTIONS = {
367
379
  placeOfEvent: JurisdictionFilter.enum.all,
368
380
  accessLevel: JurisdictionFilter.enum.all,
369
- registeredIn: JurisdictionFilter.enum.all,
370
- declaredIn: JurisdictionFilter.enum.all
381
+ notifiedIn: JurisdictionFilter.enum.all,
382
+ declaredIn: JurisdictionFilter.enum.all,
383
+ registeredIn: JurisdictionFilter.enum.all
371
384
  };
372
385
  function getScopeOptionValue(scope, option) {
373
386
  const options = "options" in scope ? scope.options : void 0;
@@ -0,0 +1,4 @@
1
+ ##################################################################################
2
+ # Use this file to customize helm chart behavior
3
+ # Please make sure your custom changes doesn't conflict with values.yaml
4
+ ##################################################################################
@@ -0,0 +1,83 @@
1
+ ##################################################################################
2
+ # GENERATED FILE — DO NOT EDIT
3
+ #
4
+ # This file is managed by `opencrvs environment init` and may be overwritten.
5
+ # Put all custom Helm values in values.override.yaml, preserving the same YAML
6
+ # hierarchy used here. To remove a generated section, set its top-level key to
7
+ # null in values.override.yaml.
8
+ ##################################################################################
9
+
10
+ # Default: storage_type: host_path
11
+ # host_path option is backward compatible with Docker Swarm,
12
+ # configured to use sub-directories within /data folder
13
+ # For new installations feel free to remove storage_type
14
+ storage_type: host_path
15
+
16
+ # All datastores are placed on first node (master1) for backward compatibility
17
+ # with Docker Swarm.
18
+ # For new installations feel free to remove node_selector
19
+ node_selector:
20
+ role: data1
21
+
22
+ minio:
23
+ use_default_credentials: false
24
+ {{#if restore_enabled}}
25
+ restore:
26
+ type: {{restore_type}}
27
+ {{/if}}
28
+ {{#if backup_enabled}}
29
+ backup:
30
+ type: {{backup_type}}
31
+ {{/if}}
32
+
33
+ elasticsearch:
34
+ use_default_credentials: false
35
+
36
+ mongodb:
37
+ use_default_credentials: false
38
+
39
+ postgres:
40
+ use_default_credentials: false
41
+ {{#if restore_enabled}}
42
+ restore:
43
+ type: {{restore_type}}
44
+ {{/if}}
45
+ {{#if backup_enabled}}
46
+ backup:
47
+ type: {{backup_type}}
48
+ {{/if}}
49
+
50
+ redis:
51
+ auth_mode: acl
52
+
53
+ monitoring:
54
+ enabled: true
55
+
56
+ elastalert:
57
+ env:
58
+ NOTIFICATION_TYPE: email
59
+ secrets:
60
+ smtp-config:
61
+ - ALERT_EMAIL
62
+ - SENDER_EMAIL_ADDRESS
63
+ - SMTP_HOST
64
+ - SMTP_PASSWORD
65
+ - SMTP_PORT
66
+ - SMTP_SECURE
67
+ - SMTP_USERNAME
68
+
69
+ # Backup configuration
70
+ backup:
71
+ enabled: {{backup_enabled}}
72
+ schedule: "0 1 * * *"
73
+ backup_server_secret: backup-server-ssh-credentials
74
+ backup_server_dir: /home/backup/{{env}}
75
+
76
+
77
+ # Restore configuration
78
+ restore:
79
+ enabled: {{restore_enabled}}
80
+ schedule: "0 0 * * *"
81
+ backup_server_secret: backup-server-ssh-credentials
82
+ backup_server_dir: /home/backup/{{restore_environment_name}}
83
+ backup_encryption_secret: restore-encryption-secret
@@ -0,0 +1,4 @@
1
+ ##################################################################################
2
+ # Use this file to customize helm chart behavior
3
+ # Please make sure your custom changes doesn't conflict with values.yaml
4
+ ##################################################################################
@@ -0,0 +1,81 @@
1
+ ##################################################################################
2
+ # GENERATED FILE — DO NOT EDIT
3
+ #
4
+ # This file is managed by `opencrvs environment init` and may be overwritten.
5
+ # Put all custom Helm values in values.override.yaml, preserving the same YAML
6
+ # hierarchy used here. To remove a generated section, set its top-level key to
7
+ # null in values.override.yaml.
8
+ ##################################################################################
9
+
10
+ ########################################################################################
11
+ # Initial configuration file for OpenCRVS installation
12
+ ########################################################################################
13
+ # Some properties are not defined in this file and should be provided as key/value at
14
+ # installation time:
15
+ # - hostname: valid DNS name for opencrvs
16
+ # - countryconfig.image.name: Countryconfig image repository
17
+ # - countryconfig.image.tag: Countryconfig image tag
18
+ environment_type: {{environment_type}}
19
+
20
+ hpa:
21
+ enabled: false
22
+
23
+ env:
24
+ APN_SERVICE_URL: "http://apm-server.opencrvs-deps-{{env}}.svc.cluster.local:8200"
25
+ MINIO_BUCKET: ocrvs
26
+ OPENCRVS_ENVIRONMENT: {{opencrvs_environment}}
27
+
28
+ influxdb:
29
+ host: influxdb-0.influxdb.opencrvs-deps-{{env}}.svc.cluster.local
30
+
31
+ elasticsearch:
32
+ auth_mode: auto
33
+ host: elasticsearch.opencrvs-deps-{{env}}.svc.cluster.local
34
+
35
+ minio:
36
+ auth_mode: use_secret
37
+ host: minio-0.minio.opencrvs-deps-{{env}}.svc.cluster.local
38
+
39
+ mongodb:
40
+ auth_mode: auto
41
+ host: mongodb-0.mongodb.opencrvs-deps-{{env}}.svc.cluster.local
42
+
43
+ redis:
44
+ auth_mode: use_secret
45
+ host: redis-0.redis.opencrvs-deps-{{env}}.svc.cluster.local
46
+
47
+ postgres:
48
+ auth_mode: auto
49
+ host: postgres-0.postgres.opencrvs-deps-{{env}}.svc.cluster.local
50
+
51
+ platform:
52
+ imagePullSecrets:
53
+ # Default value for credentials created while yarn environment:init
54
+ - name: dockerhub-credentials
55
+
56
+
57
+ auth:
58
+ env:
59
+ TWO_FA_ENABLED: {{two_fa_enabled}}
60
+
61
+ events:
62
+ env:
63
+ TWO_FA_ENABLED: {{two_fa_enabled}}
64
+
65
+ countryconfig:
66
+ secrets:
67
+ smtp-config:
68
+ - ALERT_EMAIL
69
+ - SENDER_EMAIL_ADDRESS
70
+ - SMTP_HOST
71
+ - SMTP_PASSWORD
72
+ - SMTP_PORT
73
+ - SMTP_SECURE
74
+ - SMTP_USERNAME
75
+
76
+ dashboards:
77
+ use_default_credentials: false
78
+ enabled: true
79
+
80
+ on_restore_cronjob:
81
+ enabled: {{restore_enabled}}
@@ -0,0 +1,4 @@
1
+ ##################################################################################
2
+ # Use this file to customize helm chart behavior
3
+ # Please make sure your custom changes doesn't conflict with values.yaml
4
+ ##################################################################################
@@ -0,0 +1,115 @@
1
+ ##################################################################################
2
+ # GENERATED FILE — DO NOT EDIT
3
+ #
4
+ # This file is managed by `opencrvs environment init` and may be overwritten.
5
+ # Put all custom Helm values in values.override.yaml, preserving the same YAML
6
+ # hierarchy used here. To remove a generated section, set its top-level key to
7
+ # null in values.override.yaml.
8
+ ##################################################################################
9
+
10
+ # Overwriting https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml
11
+ namespaceOverride: "traefik"
12
+ logs:
13
+ general:
14
+ # "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "PANIC"
15
+ level: "INFO"
16
+ # format: "common" # For local environment
17
+ format: "json" # For server environment
18
+ access:
19
+ # -- To enable access logs
20
+ enabled: true
21
+ format: "json"
22
+
23
+ ingressRoute:
24
+ dashboard:
25
+ enabled: false
26
+
27
+ # Be explicit that we only use CRDs, not ingress/gw support
28
+ providers:
29
+ kubernetesCRD:
30
+ enabled: true
31
+ kubernetesIngress:
32
+ enabled: false
33
+ kubernetesGateway:
34
+ enabled: false
35
+
36
+ service:
37
+ enabled: true
38
+ single: false
39
+ type: NodePort
40
+
41
+ ports:
42
+ web:
43
+ port: 8000
44
+ hostPort: 80
45
+ protocol: TCP
46
+ nodePort: 30080
47
+ http:
48
+ redirections:
49
+ entryPoint:
50
+ to: websecure
51
+ scheme: https
52
+ permanent: true
53
+
54
+ websecure:
55
+ port: 8443
56
+ hostPort: 443
57
+ protocol: TCP
58
+ nodePort: 30443
59
+ {{#if lets_encrypt}}
60
+ http:
61
+ tls:
62
+ enabled: true
63
+ certResolver: letsencrypt
64
+ {{/if}}
65
+
66
+
67
+ {{#if lets_encrypt}}
68
+ certificatesResolvers:
69
+ letsencrypt:
70
+ acme:
71
+ tlsChallenge: false
72
+ httpChallenge:
73
+ entryPoint: web
74
+ email: admin@opencrvs.org
75
+ # Storage for certificates:
76
+ storage: /certificates/acme.json
77
+ # NOTE: Sometimes Let's Encrypt hit production SSL certificate issuing limits
78
+ # If you are having issues, switch to staging
79
+ # Staging server
80
+ # caServer: https://acme-staging-v02.api.letsencrypt.org/directory
81
+ # Production server
82
+ caServer: https://acme-v02.api.letsencrypt.org/directory
83
+
84
+ additionalVolumeMounts:
85
+ - name: acme
86
+ mountPath: /certificates
87
+ {{/if}}
88
+ {{#if static_ssl}}
89
+ certificatesResolvers: {}
90
+
91
+ # 👇 Custom TLS configuration
92
+ tlsStore:
93
+ default:
94
+ defaultCertificate:
95
+ # Check documentation how to create secret with static SSL certificate
96
+ secretName: traefik-cert
97
+ {{/if}}
98
+
99
+ deployment:
100
+ hostNetwork: true
101
+ {{#if static_ssl}}
102
+ kind: DaemonSet
103
+ {{/if}}
104
+ {{#if lets_encrypt}}
105
+ additionalVolumes:
106
+ - name: acme
107
+ hostPath:
108
+ path: /data/traefik
109
+ {{/if}}
110
+
111
+ # If you need to run traefik on all cluster nodes
112
+ # Add this line to traefik/values.override.yaml
113
+ # nodeSelector: {}
114
+ nodeSelector:
115
+ traefik-role: ingress