@opencrvs/toolkit 2.0.0-rc.f3bc98a → 2.0.0-rc.f45dbb8

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 (126) hide show
  1. package/README.md +15 -0
  2. package/build.sh +3 -2
  3. package/create-countryconfig/index.js +103 -0
  4. package/create-countryconfig/package.json +21 -0
  5. package/dist/application-config/index.js +291 -126
  6. package/dist/cli.js +3759 -211
  7. package/dist/commons/api/router.d.ts +3387 -237
  8. package/dist/commons/application-config/index.d.ts +1 -0
  9. package/dist/commons/conditionals/conditionals.d.ts +360 -10
  10. package/dist/commons/conditionals/validate.d.ts +52 -2
  11. package/dist/commons/events/ActionConfig.d.ts +28 -2
  12. package/dist/commons/events/ActionDocument.d.ts +6 -0
  13. package/dist/commons/events/ActionInput.d.ts +114 -0
  14. package/dist/commons/events/AdvancedSearchConfig.d.ts +354 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
  16. package/dist/commons/events/Draft.d.ts +4 -2
  17. package/dist/commons/events/EventConfig.d.ts +2 -0
  18. package/dist/commons/events/EventDocument.d.ts +3 -0
  19. package/dist/commons/events/EventIndex.d.ts +25 -3
  20. package/dist/commons/events/EventMetadata.d.ts +26 -7
  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 +189 -150
  26. package/dist/commons/events/field.d.ts +53 -1
  27. package/dist/commons/events/index.d.ts +2 -0
  28. package/dist/commons/events/locations.d.ts +22 -0
  29. package/dist/commons/events/mocks.test.utils.d.ts +19 -0
  30. package/dist/commons/events/scopes.d.ts +24 -1
  31. package/dist/commons/events/state/flags.d.ts +16 -0
  32. package/dist/commons/events/state/index.d.ts +8 -4
  33. package/dist/commons/events/state/utils.d.ts +21 -289
  34. package/dist/commons/events/utils.d.ts +13 -2
  35. package/dist/conditionals/index.js +68 -8
  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 +1173 -291
  88. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
  89. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +60 -35
  90. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  91. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  92. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -2
  93. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
  94. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
  95. package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
  96. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
  97. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
  98. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
  99. package/dist/migrations/v2.0/index.d.ts +5 -3
  100. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  101. package/dist/migrations/v2.0/index.js +522 -175
  102. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
  103. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +90 -1
  104. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
  105. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
  106. package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
  107. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  108. package/dist/migrations/v2.0/migrate-scopes.js +54 -30
  109. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
  110. package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
  111. package/dist/notification/index.js +919 -162
  112. package/dist/scopes/index.d.ts +99 -8
  113. package/dist/scopes/index.js +25 -10
  114. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  115. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  116. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  117. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  118. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  119. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  120. package/dist/templates/inventory/inventory.template.yml +100 -0
  121. package/dist/templates/inventory/production.example.yml +77 -0
  122. package/dist/templates/inventory/qa.example.yml +48 -0
  123. package/opencrvs-toolkit-2.0.0-rc.f45dbb8.tgz +0 -0
  124. package/package.json +20 -2
  125. package/tsconfig.tsbuildinfo +1 -1
  126. package/opencrvs-toolkit-2.0.0-rc.f3bc98a.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";
@@ -48,6 +48,14 @@ declare const AllScopeOptions: z.ZodObject<{
48
48
  location: "location";
49
49
  all: "all";
50
50
  }>>;
51
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
52
+ administrativeArea: "administrativeArea";
53
+ location: "location";
54
+ all: "all";
55
+ }>>;
56
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
57
+ user: "user";
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
+ notifiedIn: "notifiedIn";
82
+ notifiedBy: "notifiedBy";
73
83
  declaredIn: "declaredIn";
74
84
  declaredBy: "declaredBy";
75
85
  registeredIn: "registeredIn";
@@ -126,6 +136,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
126
136
  location: "location";
127
137
  all: "all";
128
138
  }>>;
139
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
140
+ administrativeArea: "administrativeArea";
141
+ location: "location";
142
+ all: "all";
143
+ }>>;
144
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
145
+ user: "user";
146
+ }>>;
129
147
  declaredIn: z.ZodOptional<z.ZodEnum<{
130
148
  administrativeArea: "administrativeArea";
131
149
  location: "location";
@@ -150,6 +168,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
168
  location: "location";
151
169
  all: "all";
152
170
  }>>;
171
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
172
+ administrativeArea: "administrativeArea";
173
+ location: "location";
174
+ all: "all";
175
+ }>>;
176
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
177
+ user: "user";
178
+ }>>;
153
179
  declaredIn: z.ZodOptional<z.ZodEnum<{
154
180
  administrativeArea: "administrativeArea";
155
181
  location: "location";
@@ -176,6 +202,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
202
  location: "location";
177
203
  all: "all";
178
204
  }>>;
205
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
206
+ administrativeArea: "administrativeArea";
207
+ location: "location";
208
+ all: "all";
209
+ }>>;
210
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
211
+ user: "user";
212
+ }>>;
179
213
  declaredIn: z.ZodOptional<z.ZodEnum<{
180
214
  administrativeArea: "administrativeArea";
181
215
  location: "location";
@@ -203,6 +237,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
237
  location: "location";
204
238
  all: "all";
205
239
  }>>;
240
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
241
+ administrativeArea: "administrativeArea";
242
+ location: "location";
243
+ all: "all";
244
+ }>>;
245
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
246
+ user: "user";
247
+ }>>;
206
248
  declaredIn: z.ZodOptional<z.ZodEnum<{
207
249
  administrativeArea: "administrativeArea";
208
250
  location: "location";
@@ -227,12 +269,14 @@ declare const SystemScopeType: z.ZodEnum<{
227
269
  "user.read": "user.read";
228
270
  "user.create": "user.create";
229
271
  "user.edit": "user.edit";
272
+ "user.search": "user.search";
230
273
  }>;
231
274
  export type SystemScopeType = z.infer<typeof SystemScopeType>;
232
275
  declare const UserScopeType: z.ZodEnum<{
233
276
  "user.read": "user.read";
234
277
  "user.create": "user.create";
235
278
  "user.edit": "user.edit";
279
+ "user.search": "user.search";
236
280
  }>;
237
281
  export type UserScopeType = z.infer<typeof UserScopeType>;
238
282
  declare const ScopesWithRoleOption: z.ZodEnum<{
@@ -256,6 +300,7 @@ export declare const UserScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
256
300
  }, z.core.$strip>, z.ZodObject<{
257
301
  type: z.ZodEnum<{
258
302
  "user.read": "user.read";
303
+ "user.search": "user.search";
259
304
  }>;
260
305
  options: z.ZodOptional<z.ZodObject<{
261
306
  accessLevel: z.ZodOptional<z.ZodEnum<{
@@ -302,6 +347,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
302
347
  options: z.ZodOptional<z.ZodObject<{
303
348
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
304
349
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
350
+ notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
351
+ notifiedBy: z.ZodOptional<z.ZodString>;
305
352
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
306
353
  declaredBy: z.ZodOptional<z.ZodString>;
307
354
  }, z.core.$strip>>;
@@ -316,6 +363,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
316
363
  options: z.ZodOptional<z.ZodObject<{
317
364
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
318
365
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
366
+ notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
367
+ notifiedBy: z.ZodOptional<z.ZodString>;
319
368
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
320
369
  declaredBy: z.ZodOptional<z.ZodString>;
321
370
  registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
@@ -326,6 +375,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
326
375
  options: z.ZodOptional<z.ZodObject<{
327
376
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
328
377
  placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
378
+ notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
379
+ notifiedBy: z.ZodOptional<z.ZodString>;
329
380
  declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
330
381
  declaredBy: z.ZodOptional<z.ZodString>;
331
382
  registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
@@ -382,6 +433,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
382
433
  location: "location";
383
434
  all: "all";
384
435
  }>>;
436
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
437
+ administrativeArea: "administrativeArea";
438
+ location: "location";
439
+ all: "all";
440
+ }>>;
441
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
442
+ user: "user";
443
+ }>>;
385
444
  declaredIn: z.ZodOptional<z.ZodEnum<{
386
445
  administrativeArea: "administrativeArea";
387
446
  location: "location";
@@ -406,6 +465,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
406
465
  location: "location";
407
466
  all: "all";
408
467
  }>>;
468
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
469
+ administrativeArea: "administrativeArea";
470
+ location: "location";
471
+ all: "all";
472
+ }>>;
473
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
474
+ user: "user";
475
+ }>>;
409
476
  declaredIn: z.ZodOptional<z.ZodEnum<{
410
477
  administrativeArea: "administrativeArea";
411
478
  location: "location";
@@ -432,6 +499,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
432
499
  location: "location";
433
500
  all: "all";
434
501
  }>>;
502
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
503
+ administrativeArea: "administrativeArea";
504
+ location: "location";
505
+ all: "all";
506
+ }>>;
507
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
508
+ user: "user";
509
+ }>>;
435
510
  declaredIn: z.ZodOptional<z.ZodEnum<{
436
511
  administrativeArea: "administrativeArea";
437
512
  location: "location";
@@ -459,6 +534,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
459
534
  location: "location";
460
535
  all: "all";
461
536
  }>>;
537
+ notifiedIn: z.ZodOptional<z.ZodEnum<{
538
+ administrativeArea: "administrativeArea";
539
+ location: "location";
540
+ all: "all";
541
+ }>>;
542
+ notifiedBy: z.ZodOptional<z.ZodEnum<{
543
+ user: "user";
544
+ }>>;
462
545
  declaredIn: z.ZodOptional<z.ZodEnum<{
463
546
  administrativeArea: "administrativeArea";
464
547
  location: "location";
@@ -493,6 +576,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
493
576
  }, z.core.$strip>, z.ZodObject<{
494
577
  type: z.ZodEnum<{
495
578
  "user.read": "user.read";
579
+ "user.search": "user.search";
496
580
  }>;
497
581
  options: z.ZodOptional<z.ZodObject<{
498
582
  accessLevel: z.ZodOptional<z.ZodEnum<{
@@ -556,6 +640,7 @@ export declare const ScopeType: z.ZodEnum<{
556
640
  "user.read": "user.read";
557
641
  "user.create": "user.create";
558
642
  "user.edit": "user.edit";
643
+ "user.search": "user.search";
559
644
  workqueue: "workqueue";
560
645
  "dashboard.view": "dashboard.view";
561
646
  }>;
@@ -575,14 +660,12 @@ export type EncodedScope = z.infer<typeof EncodedScope>;
575
660
  */
576
661
  export declare const encodeScope: (scope: Scope) => EncodedScope;
577
662
  /**
578
- * Converts a scope object into an encoded query string representation.
663
+ * Converts an encoded scope string into a scope object.
579
664
  *
580
- * @TODO scope param could be defined as EncodedScope instead of string.
581
- *
582
- * @param scope - The scope object to encode.
583
- * @returns The encoded scope as a branded string (`EncodedScope`).
665
+ * @param scope - The encoded scope string to decode.
666
+ * @returns The decoded scope object.
584
667
  */
585
- export declare const decodeScope: (query: EncodedScope) => {
668
+ export declare const decodeScope: (encodedScope: EncodedScope) => {
586
669
  type: "record.create" | "record.declare" | "record.notify";
587
670
  options?: {
588
671
  event?: string[] | undefined;
@@ -593,6 +676,8 @@ export declare const decodeScope: (query: EncodedScope) => {
593
676
  options?: {
594
677
  event?: string[] | undefined;
595
678
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
679
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
680
+ notifiedBy?: "user" | undefined;
596
681
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
597
682
  declaredBy?: "user" | undefined;
598
683
  } | undefined;
@@ -601,6 +686,8 @@ export declare const decodeScope: (query: EncodedScope) => {
601
686
  options?: {
602
687
  event?: string[] | undefined;
603
688
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
689
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
690
+ notifiedBy?: "user" | undefined;
604
691
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
605
692
  declaredBy?: "user" | undefined;
606
693
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -611,6 +698,8 @@ export declare const decodeScope: (query: EncodedScope) => {
611
698
  options?: {
612
699
  event?: string[] | undefined;
613
700
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
701
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
702
+ notifiedBy?: "user" | undefined;
614
703
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
615
704
  declaredBy?: "user" | undefined;
616
705
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -622,6 +711,8 @@ export declare const decodeScope: (query: EncodedScope) => {
622
711
  options?: {
623
712
  event?: string[] | undefined;
624
713
  placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
714
+ notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
715
+ notifiedBy?: "user" | undefined;
625
716
  declaredIn?: "administrativeArea" | "location" | "all" | undefined;
626
717
  declaredBy?: "user" | undefined;
627
718
  registeredIn?: "administrativeArea" | "location" | "all" | undefined;
@@ -635,7 +726,7 @@ export declare const decodeScope: (query: EncodedScope) => {
635
726
  role?: string[] | undefined;
636
727
  } | undefined;
637
728
  } | {
638
- type: "user.read";
729
+ type: "user.read" | "user.search";
639
730
  options?: {
640
731
  accessLevel?: "administrativeArea" | "location" | "all" | undefined;
641
732
  } | undefined;
@@ -149,11 +149,13 @@ var scopeOptionsPlaceEvent = z3.object({
149
149
  event: scopeByEvent,
150
150
  placeOfEvent: JurisdictionFilter.optional()
151
151
  }).describe("Options applicable to all record scopes.");
152
- var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
152
+ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
153
+ notifiedIn: JurisdictionFilter.optional(),
154
+ notifiedBy: UserFilter.optional(),
153
155
  declaredIn: JurisdictionFilter.optional(),
154
156
  declaredBy: UserFilter.optional()
155
157
  }).describe("Options applicable to actions that may take place after DECLARE");
156
- var AllRecordScopeOptions = scopeOptionsDeclared.extend({
158
+ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
157
159
  registeredIn: JurisdictionFilter.optional(),
158
160
  registeredBy: UserFilter.optional()
159
161
  }).describe(
@@ -191,6 +193,8 @@ var ResolvedScopeOptionsPlaceEvent = z3.object({
191
193
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
192
194
  );
193
195
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
196
+ notifiedIn: UUID.nullish(),
197
+ notifiedBy: z3.string().optional(),
194
198
  declaredIn: UUID.nullish(),
195
199
  declaredBy: z3.string().optional()
196
200
  }).describe(
@@ -236,7 +240,7 @@ var RecordScopeV2 = z3.discriminatedUnion("type", [
236
240
  }),
237
241
  z3.object({
238
242
  type: ScopesWithDeclaredOptions,
239
- options: scopeOptionsDeclared.optional()
243
+ options: scopeOptionsDeclaredOrNotified.optional()
240
244
  }),
241
245
  z3.object({
242
246
  type: ScopesWithFullOptions,
@@ -257,12 +261,14 @@ var SystemScopeType = z3.enum([
257
261
  "organisation.read-locations",
258
262
  "user.read",
259
263
  "user.create",
260
- "user.edit"
264
+ "user.edit",
265
+ "user.search"
261
266
  ]);
262
267
  var UserScopeType = SystemScopeType.extract([
263
268
  "user.read",
264
269
  "user.create",
265
- "user.edit"
270
+ "user.edit",
271
+ "user.search"
266
272
  ]);
267
273
  var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
268
274
  var UserScopeV2 = z3.discriminatedUnion("type", [
@@ -271,7 +277,7 @@ var UserScopeV2 = z3.discriminatedUnion("type", [
271
277
  options: AllUserScopeOptions.optional()
272
278
  }),
273
279
  z3.object({
274
- type: UserScopeType.extract(["user.read"]),
280
+ type: UserScopeType.extract(["user.read", "user.search"]),
275
281
  options: AccessLevelOptions.optional()
276
282
  })
277
283
  ]);
@@ -352,18 +358,27 @@ var encodeScope = (scope) => {
352
358
  encode: false
353
359
  });
354
360
  };
355
- var decodeScope = (query) => {
356
- const scope = qs.parse(query, {
361
+ var decodedScopeCache = /* @__PURE__ */ new Map();
362
+ var decodeScope = (encodedScope) => {
363
+ if (decodedScopeCache.has(encodedScope)) {
364
+ return decodedScopeCache.get(encodedScope);
365
+ }
366
+ const scope = qs.parse(encodedScope, {
357
367
  ignoreQueryPrefix: true,
358
368
  comma: true,
359
369
  allowDots: true
360
370
  });
361
371
  const unflattenedScope = unflattenScope(scope);
362
- return Scope2.safeParse(unflattenedScope)?.data;
372
+ const result = Scope2.safeParse(unflattenedScope)?.data;
373
+ decodedScopeCache.set(encodedScope, result);
374
+ return result;
363
375
  };
364
376
  var DEFAULT_SCOPE_OPTIONS = {
365
377
  placeOfEvent: JurisdictionFilter.enum.all,
366
- accessLevel: JurisdictionFilter.enum.all
378
+ accessLevel: JurisdictionFilter.enum.all,
379
+ notifiedIn: JurisdictionFilter.enum.all,
380
+ declaredIn: JurisdictionFilter.enum.all,
381
+ registeredIn: JurisdictionFilter.enum.all
367
382
  };
368
383
  function getScopeOptionValue(scope, option) {
369
384
  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