@opencrvs/toolkit 2.1.0-rc.b0003b1 → 2.1.0-rc.b89dfd1

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 (73) hide show
  1. package/build.sh +2 -2
  2. package/dist/application-config/index.js +12 -0
  3. package/dist/cli.js +165 -5106
  4. package/dist/commons/api/router.d.ts +3476 -2883
  5. package/dist/commons/application-config/index.d.ts +6 -6
  6. package/dist/commons/conditionals/conditionals.d.ts +32 -323
  7. package/dist/commons/events/ActionConfig.d.ts +272 -70
  8. package/dist/commons/events/ActionDocument.d.ts +149 -105
  9. package/dist/commons/events/ActionInput.d.ts +26 -0
  10. package/dist/commons/events/ActionType.d.ts +63 -58
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +507 -501
  12. package/dist/commons/events/AuditLog.d.ts +43 -41
  13. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  14. package/dist/commons/events/Conditional.d.ts +3 -3
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
  16. package/dist/commons/events/Draft.d.ts +37 -35
  17. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  18. package/dist/commons/events/EventConfig.d.ts +5 -5
  19. package/dist/commons/events/EventDocument.d.ts +64 -42
  20. package/dist/commons/events/EventIndex.d.ts +62 -62
  21. package/dist/commons/events/EventMetadata.d.ts +40 -40
  22. package/dist/commons/events/FieldConfig.d.ts +336 -331
  23. package/dist/commons/events/FieldType.d.ts +51 -51
  24. package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
  25. package/dist/commons/events/FieldValue.d.ts +12 -12
  26. package/dist/commons/events/Flag.d.ts +15 -15
  27. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  28. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  29. package/dist/commons/events/WorkqueueConfig.d.ts +827 -824
  30. package/dist/commons/events/deduplication.d.ts +1 -1
  31. package/dist/commons/events/event.d.ts +2 -2
  32. package/dist/commons/events/field.d.ts +69 -198
  33. package/dist/commons/events/locations.d.ts +4 -4
  34. package/dist/commons/events/mocks.test.utils.d.ts +2 -2
  35. package/dist/commons/events/scopes.d.ts +5 -4
  36. package/dist/commons/events/state/index.d.ts +17 -17
  37. package/dist/commons/events/state/utils.d.ts +7 -7
  38. package/dist/commons/events/test.utils.d.ts +40 -32
  39. package/dist/commons/events/utils.d.ts +119 -105
  40. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  41. package/dist/conditionals/index.js +2 -0
  42. package/dist/environment/derived-variables.d.ts +131 -131
  43. package/dist/environment/derived-variables.d.ts.map +1 -1
  44. package/dist/environment/logger.d.ts +3 -12
  45. package/dist/environment/logger.d.ts.map +1 -1
  46. package/dist/environment/manage-users.js +17 -7
  47. package/dist/environment/questions.d.ts +75 -74
  48. package/dist/environment/questions.d.ts.map +1 -1
  49. package/dist/environment/setup-environment.js +8 -14
  50. package/dist/environment/swarm-to-k8s.js +17 -7
  51. package/dist/environment/update-workflows.js +17 -7
  52. package/dist/environment/users.js +17 -7
  53. package/dist/environment/utils.d.ts +1 -1
  54. package/dist/environment/utils.js +17 -7
  55. package/dist/events/deduplication.d.ts +1 -1
  56. package/dist/events/index.js +166 -18
  57. package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
  58. package/dist/migrations/v2.0/index.js +88 -5144
  59. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  60. package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
  61. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
  62. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
  63. package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
  64. package/dist/migrations/v2.1/index.d.ts +6 -0
  65. package/dist/migrations/v2.1/index.d.ts.map +1 -0
  66. package/dist/migrations/v2.1/index.js +218 -0
  67. package/dist/notification/index.js +131 -11
  68. package/dist/scopes/index.d.ts +146 -140
  69. package/dist/scopes/index.js +2 -0
  70. package/opencrvs-toolkit-2.1.0-rc.b89dfd1.tgz +0 -0
  71. package/package.json +2 -3
  72. package/tsconfig.tsbuildinfo +1 -1
  73. package/opencrvs-toolkit-2.1.0-rc.b0003b1.tgz +0 -0
@@ -2,8 +2,8 @@ import * as z from 'zod/v4';
2
2
  import { Role } from './roles';
3
3
  export declare const JurisdictionFilter: z.ZodEnum<{
4
4
  administrativeArea: "administrativeArea";
5
- location: "location";
6
5
  all: "all";
6
+ location: "location";
7
7
  }>;
8
8
  export type JurisdictionFilter = z.infer<typeof JurisdictionFilter>;
9
9
  export declare const UserFilter: z.ZodEnum<{
@@ -17,75 +17,76 @@ export type UserFilter = z.infer<typeof UserFilter>;
17
17
  * @see scopeOptionsPlaceEvent @see scopeOptionsDeclaredOrNotified @see scopeOptionsFull
18
18
  */
19
19
  export declare const RecordScopeTypeV2: z.ZodEnum<{
20
- "record.search": "record.search";
20
+ "record.archive": "record.archive";
21
+ "record.correct": "record.correct";
21
22
  "record.create": "record.create";
22
- "record.read": "record.read";
23
+ "record.custom-action": "record.custom-action";
23
24
  "record.declare": "record.declare";
24
- "record.notify": "record.notify";
25
25
  "record.edit": "record.edit";
26
- "record.reject": "record.reject";
27
- "record.archive": "record.archive";
28
- "record.review-duplicates": "record.review-duplicates";
29
- "record.register": "record.register";
26
+ "record.notify": "record.notify";
30
27
  "record.print-certified-copies": "record.print-certified-copies";
28
+ "record.read": "record.read";
29
+ "record.register": "record.register";
30
+ "record.reject": "record.reject";
31
31
  "record.request-correction": "record.request-correction";
32
- "record.correct": "record.correct";
32
+ "record.review-duplicates": "record.review-duplicates";
33
+ "record.search": "record.search";
34
+ "record.unarchive": "record.unarchive";
33
35
  "record.unassign-others": "record.unassign-others";
34
- "record.custom-action": "record.custom-action";
35
36
  }>;
36
37
  export type RecordScopeTypeV2 = z.infer<typeof RecordScopeTypeV2>;
37
38
  declare const AllScopeOptions: z.ZodObject<{
38
- ids: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodArray<z.ZodString>>;
39
- accessLevel: z.ZodOptional<z.ZodEnum<{
40
- administrativeArea: "administrativeArea";
41
- location: "location";
42
- all: "all";
43
- }>>;
44
- role: z.ZodOptional<z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>>;
45
39
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
46
40
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
47
41
  administrativeArea: "administrativeArea";
48
- location: "location";
49
42
  all: "all";
43
+ location: "location";
50
44
  }>>;
51
45
  notifiedIn: z.ZodOptional<z.ZodEnum<{
52
46
  administrativeArea: "administrativeArea";
53
- location: "location";
54
47
  all: "all";
48
+ location: "location";
55
49
  }>>;
56
50
  notifiedBy: z.ZodOptional<z.ZodEnum<{
57
51
  user: "user";
58
52
  }>>;
59
53
  declaredIn: z.ZodOptional<z.ZodEnum<{
60
54
  administrativeArea: "administrativeArea";
61
- location: "location";
62
55
  all: "all";
56
+ location: "location";
63
57
  }>>;
64
58
  declaredBy: z.ZodOptional<z.ZodEnum<{
65
59
  user: "user";
66
60
  }>>;
67
61
  registeredIn: z.ZodOptional<z.ZodEnum<{
68
62
  administrativeArea: "administrativeArea";
69
- location: "location";
70
63
  all: "all";
64
+ location: "location";
71
65
  }>>;
72
66
  registeredBy: z.ZodOptional<z.ZodEnum<{
73
67
  user: "user";
74
68
  }>>;
69
+ accessLevel: z.ZodOptional<z.ZodEnum<{
70
+ administrativeArea: "administrativeArea";
71
+ all: "all";
72
+ location: "location";
73
+ }>>;
74
+ role: z.ZodOptional<z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>>;
75
+ ids: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodArray<z.ZodString>>;
75
76
  }, z.core.$strip>;
76
77
  type AllScopeOptions = z.infer<typeof AllScopeOptions>;
77
78
  export declare const ScopeOptionKey: z.ZodEnum<{
78
- role: "role";
79
+ accessLevel: "accessLevel";
80
+ declaredBy: "declaredBy";
81
+ declaredIn: "declaredIn";
79
82
  event: "event";
80
- placeOfEvent: "placeOfEvent";
81
- notifiedIn: "notifiedIn";
83
+ ids: "ids";
82
84
  notifiedBy: "notifiedBy";
83
- declaredIn: "declaredIn";
84
- declaredBy: "declaredBy";
85
- registeredIn: "registeredIn";
85
+ notifiedIn: "notifiedIn";
86
+ placeOfEvent: "placeOfEvent";
86
87
  registeredBy: "registeredBy";
87
- accessLevel: "accessLevel";
88
- ids: "ids";
88
+ registeredIn: "registeredIn";
89
+ role: "role";
89
90
  }>;
90
91
  export type ScopeOptionKey = z.infer<typeof ScopeOptionKey>;
91
92
  export declare const ScopesWithPlaceEventOptions: z.ZodEnum<{
@@ -94,17 +95,18 @@ export declare const ScopesWithPlaceEventOptions: z.ZodEnum<{
94
95
  "record.notify": "record.notify";
95
96
  }>;
96
97
  export declare const ScopesWithDeclaredOptions: z.ZodEnum<{
98
+ "record.archive": "record.archive";
97
99
  "record.edit": "record.edit";
100
+ "record.register": "record.register";
98
101
  "record.reject": "record.reject";
99
- "record.archive": "record.archive";
100
102
  "record.review-duplicates": "record.review-duplicates";
101
- "record.register": "record.register";
103
+ "record.unarchive": "record.unarchive";
102
104
  }>;
103
105
  export declare const ScopesWithFullOptions: z.ZodEnum<{
104
- "record.search": "record.search";
106
+ "record.correct": "record.correct";
105
107
  "record.read": "record.read";
106
108
  "record.request-correction": "record.request-correction";
107
- "record.correct": "record.correct";
109
+ "record.search": "record.search";
108
110
  "record.unassign-others": "record.unassign-others";
109
111
  }>;
110
112
  export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -117,37 +119,38 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
117
119
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
118
120
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
119
121
  administrativeArea: "administrativeArea";
120
- location: "location";
121
122
  all: "all";
123
+ location: "location";
122
124
  }>>;
123
125
  }, z.core.$strip>>;
124
126
  }, z.core.$strip>, z.ZodObject<{
125
127
  type: z.ZodEnum<{
128
+ "record.archive": "record.archive";
126
129
  "record.edit": "record.edit";
130
+ "record.register": "record.register";
127
131
  "record.reject": "record.reject";
128
- "record.archive": "record.archive";
129
132
  "record.review-duplicates": "record.review-duplicates";
130
- "record.register": "record.register";
133
+ "record.unarchive": "record.unarchive";
131
134
  }>;
132
135
  options: z.ZodOptional<z.ZodObject<{
133
136
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
134
137
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
135
138
  administrativeArea: "administrativeArea";
136
- location: "location";
137
139
  all: "all";
140
+ location: "location";
138
141
  }>>;
139
142
  notifiedIn: z.ZodOptional<z.ZodEnum<{
140
143
  administrativeArea: "administrativeArea";
141
- location: "location";
142
144
  all: "all";
145
+ location: "location";
143
146
  }>>;
144
147
  notifiedBy: z.ZodOptional<z.ZodEnum<{
145
148
  user: "user";
146
149
  }>>;
147
150
  declaredIn: z.ZodOptional<z.ZodEnum<{
148
151
  administrativeArea: "administrativeArea";
149
- location: "location";
150
152
  all: "all";
153
+ location: "location";
151
154
  }>>;
152
155
  declaredBy: z.ZodOptional<z.ZodEnum<{
153
156
  user: "user";
@@ -155,39 +158,39 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
155
158
  }, z.core.$strip>>;
156
159
  }, z.core.$strip>, z.ZodObject<{
157
160
  type: z.ZodEnum<{
158
- "record.search": "record.search";
161
+ "record.correct": "record.correct";
159
162
  "record.read": "record.read";
160
163
  "record.request-correction": "record.request-correction";
161
- "record.correct": "record.correct";
164
+ "record.search": "record.search";
162
165
  "record.unassign-others": "record.unassign-others";
163
166
  }>;
164
167
  options: z.ZodOptional<z.ZodObject<{
165
168
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
166
169
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
167
170
  administrativeArea: "administrativeArea";
168
- location: "location";
169
171
  all: "all";
172
+ location: "location";
170
173
  }>>;
171
174
  notifiedIn: z.ZodOptional<z.ZodEnum<{
172
175
  administrativeArea: "administrativeArea";
173
- location: "location";
174
176
  all: "all";
177
+ location: "location";
175
178
  }>>;
176
179
  notifiedBy: z.ZodOptional<z.ZodEnum<{
177
180
  user: "user";
178
181
  }>>;
179
182
  declaredIn: z.ZodOptional<z.ZodEnum<{
180
183
  administrativeArea: "administrativeArea";
181
- location: "location";
182
184
  all: "all";
185
+ location: "location";
183
186
  }>>;
184
187
  declaredBy: z.ZodOptional<z.ZodEnum<{
185
188
  user: "user";
186
189
  }>>;
187
190
  registeredIn: z.ZodOptional<z.ZodEnum<{
188
191
  administrativeArea: "administrativeArea";
189
- location: "location";
190
192
  all: "all";
193
+ location: "location";
191
194
  }>>;
192
195
  registeredBy: z.ZodOptional<z.ZodEnum<{
193
196
  user: "user";
@@ -199,29 +202,29 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
199
202
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
200
203
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
201
204
  administrativeArea: "administrativeArea";
202
- location: "location";
203
205
  all: "all";
206
+ location: "location";
204
207
  }>>;
205
208
  notifiedIn: z.ZodOptional<z.ZodEnum<{
206
209
  administrativeArea: "administrativeArea";
207
- location: "location";
208
210
  all: "all";
211
+ location: "location";
209
212
  }>>;
210
213
  notifiedBy: z.ZodOptional<z.ZodEnum<{
211
214
  user: "user";
212
215
  }>>;
213
216
  declaredIn: z.ZodOptional<z.ZodEnum<{
214
217
  administrativeArea: "administrativeArea";
215
- location: "location";
216
218
  all: "all";
219
+ location: "location";
217
220
  }>>;
218
221
  declaredBy: z.ZodOptional<z.ZodEnum<{
219
222
  user: "user";
220
223
  }>>;
221
224
  registeredIn: z.ZodOptional<z.ZodEnum<{
222
225
  administrativeArea: "administrativeArea";
223
- location: "location";
224
226
  all: "all";
227
+ location: "location";
225
228
  }>>;
226
229
  registeredBy: z.ZodOptional<z.ZodEnum<{
227
230
  user: "user";
@@ -234,29 +237,29 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
234
237
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
235
238
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
236
239
  administrativeArea: "administrativeArea";
237
- location: "location";
238
240
  all: "all";
241
+ location: "location";
239
242
  }>>;
240
243
  notifiedIn: z.ZodOptional<z.ZodEnum<{
241
244
  administrativeArea: "administrativeArea";
242
- location: "location";
243
245
  all: "all";
246
+ location: "location";
244
247
  }>>;
245
248
  notifiedBy: z.ZodOptional<z.ZodEnum<{
246
249
  user: "user";
247
250
  }>>;
248
251
  declaredIn: z.ZodOptional<z.ZodEnum<{
249
252
  administrativeArea: "administrativeArea";
250
- location: "location";
251
253
  all: "all";
254
+ location: "location";
252
255
  }>>;
253
256
  declaredBy: z.ZodOptional<z.ZodEnum<{
254
257
  user: "user";
255
258
  }>>;
256
259
  registeredIn: z.ZodOptional<z.ZodEnum<{
257
260
  administrativeArea: "administrativeArea";
258
- location: "location";
259
261
  all: "all";
262
+ location: "location";
260
263
  }>>;
261
264
  registeredBy: z.ZodOptional<z.ZodEnum<{
262
265
  user: "user";
@@ -266,16 +269,16 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
266
269
  }, z.core.$strip>], "type">;
267
270
  declare const SystemScopeType: z.ZodEnum<{
268
271
  "organisation.read-locations": "organisation.read-locations";
269
- "user.read": "user.read";
270
272
  "user.create": "user.create";
271
273
  "user.edit": "user.edit";
274
+ "user.read": "user.read";
272
275
  "user.search": "user.search";
273
276
  }>;
274
277
  export type SystemScopeType = z.infer<typeof SystemScopeType>;
275
278
  declare const UserScopeType: z.ZodEnum<{
276
- "user.read": "user.read";
277
279
  "user.create": "user.create";
278
280
  "user.edit": "user.edit";
281
+ "user.read": "user.read";
279
282
  "user.search": "user.search";
280
283
  }>;
281
284
  export type UserScopeType = z.infer<typeof UserScopeType>;
@@ -292,8 +295,8 @@ export declare const UserScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
292
295
  options: z.ZodOptional<z.ZodObject<{
293
296
  accessLevel: z.ZodOptional<z.ZodEnum<{
294
297
  administrativeArea: "administrativeArea";
295
- location: "location";
296
298
  all: "all";
299
+ location: "location";
297
300
  }>>;
298
301
  role: z.ZodOptional<z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>>;
299
302
  }, z.core.$strip>>;
@@ -305,8 +308,8 @@ export declare const UserScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
305
308
  options: z.ZodOptional<z.ZodObject<{
306
309
  accessLevel: z.ZodOptional<z.ZodEnum<{
307
310
  administrativeArea: "administrativeArea";
308
- location: "location";
309
311
  all: "all";
312
+ location: "location";
310
313
  }>>;
311
314
  }, z.core.$strip>>;
312
315
  }, z.core.$strip>], "type">;
@@ -338,11 +341,12 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
338
341
  }, z.core.$strip>>;
339
342
  }, z.core.$strip>, z.ZodObject<{
340
343
  type: z.ZodEnum<{
344
+ "record.archive": "record.archive";
341
345
  "record.edit": "record.edit";
346
+ "record.register": "record.register";
342
347
  "record.reject": "record.reject";
343
- "record.archive": "record.archive";
344
348
  "record.review-duplicates": "record.review-duplicates";
345
- "record.register": "record.register";
349
+ "record.unarchive": "record.unarchive";
346
350
  }>;
347
351
  options: z.ZodOptional<z.ZodObject<{
348
352
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
@@ -354,10 +358,10 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
354
358
  }, z.core.$strip>>;
355
359
  }, z.core.$strip>, z.ZodObject<{
356
360
  type: z.ZodEnum<{
357
- "record.search": "record.search";
361
+ "record.correct": "record.correct";
358
362
  "record.read": "record.read";
359
363
  "record.request-correction": "record.request-correction";
360
- "record.correct": "record.correct";
364
+ "record.search": "record.search";
361
365
  "record.unassign-others": "record.unassign-others";
362
366
  }>;
363
367
  options: z.ZodOptional<z.ZodObject<{
@@ -389,20 +393,20 @@ export type ResolvedRecordScopeV2 = z.infer<typeof ResolvedRecordScopeV2>;
389
393
  /** The primary scope schema which gathers all scope types together. All scopes are discriminated by type and options are determined according to the type. */
390
394
  export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
391
395
  type: z.ZodEnum<{
396
+ "attachment.upload": "attachment.upload";
392
397
  bypassratelimit: "bypassratelimit";
393
- "record.reindex": "record.reindex";
394
- "user.data-seeding": "user.data-seeding";
395
- "integration.create": "integration.create";
396
- "record.import": "record.import";
397
398
  "config.update-all": "config.update-all";
398
- "attachment.upload": "attachment.upload";
399
- "profile.electronic-signature": "profile.electronic-signature";
400
- "user.read-only-my-audit": "user.read-only-my-audit";
399
+ "integration.create": "integration.create";
401
400
  "performance.read": "performance.read";
402
401
  "performance.read-dashboards": "performance.read-dashboards";
403
402
  "performance.vital-statistics-export": "performance.vital-statistics-export";
403
+ "profile.electronic-signature": "profile.electronic-signature";
404
404
  "record.confirm-registration": "record.confirm-registration";
405
+ "record.import": "record.import";
406
+ "record.reindex": "record.reindex";
405
407
  "record.reject-registration": "record.reject-registration";
408
+ "user.data-seeding": "user.data-seeding";
409
+ "user.read-only-my-audit": "user.read-only-my-audit";
406
410
  }>;
407
411
  }, z.core.$strip>, z.ZodObject<{
408
412
  type: z.ZodEnum<{
@@ -414,37 +418,38 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
414
418
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
415
419
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
416
420
  administrativeArea: "administrativeArea";
417
- location: "location";
418
421
  all: "all";
422
+ location: "location";
419
423
  }>>;
420
424
  }, z.core.$strip>>;
421
425
  }, z.core.$strip>, z.ZodObject<{
422
426
  type: z.ZodEnum<{
427
+ "record.archive": "record.archive";
423
428
  "record.edit": "record.edit";
429
+ "record.register": "record.register";
424
430
  "record.reject": "record.reject";
425
- "record.archive": "record.archive";
426
431
  "record.review-duplicates": "record.review-duplicates";
427
- "record.register": "record.register";
432
+ "record.unarchive": "record.unarchive";
428
433
  }>;
429
434
  options: z.ZodOptional<z.ZodObject<{
430
435
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
431
436
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
432
437
  administrativeArea: "administrativeArea";
433
- location: "location";
434
438
  all: "all";
439
+ location: "location";
435
440
  }>>;
436
441
  notifiedIn: z.ZodOptional<z.ZodEnum<{
437
442
  administrativeArea: "administrativeArea";
438
- location: "location";
439
443
  all: "all";
444
+ location: "location";
440
445
  }>>;
441
446
  notifiedBy: z.ZodOptional<z.ZodEnum<{
442
447
  user: "user";
443
448
  }>>;
444
449
  declaredIn: z.ZodOptional<z.ZodEnum<{
445
450
  administrativeArea: "administrativeArea";
446
- location: "location";
447
451
  all: "all";
452
+ location: "location";
448
453
  }>>;
449
454
  declaredBy: z.ZodOptional<z.ZodEnum<{
450
455
  user: "user";
@@ -452,39 +457,39 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
452
457
  }, z.core.$strip>>;
453
458
  }, z.core.$strip>, z.ZodObject<{
454
459
  type: z.ZodEnum<{
455
- "record.search": "record.search";
460
+ "record.correct": "record.correct";
456
461
  "record.read": "record.read";
457
462
  "record.request-correction": "record.request-correction";
458
- "record.correct": "record.correct";
463
+ "record.search": "record.search";
459
464
  "record.unassign-others": "record.unassign-others";
460
465
  }>;
461
466
  options: z.ZodOptional<z.ZodObject<{
462
467
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
463
468
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
464
469
  administrativeArea: "administrativeArea";
465
- location: "location";
466
470
  all: "all";
471
+ location: "location";
467
472
  }>>;
468
473
  notifiedIn: z.ZodOptional<z.ZodEnum<{
469
474
  administrativeArea: "administrativeArea";
470
- location: "location";
471
475
  all: "all";
476
+ location: "location";
472
477
  }>>;
473
478
  notifiedBy: z.ZodOptional<z.ZodEnum<{
474
479
  user: "user";
475
480
  }>>;
476
481
  declaredIn: z.ZodOptional<z.ZodEnum<{
477
482
  administrativeArea: "administrativeArea";
478
- location: "location";
479
483
  all: "all";
484
+ location: "location";
480
485
  }>>;
481
486
  declaredBy: z.ZodOptional<z.ZodEnum<{
482
487
  user: "user";
483
488
  }>>;
484
489
  registeredIn: z.ZodOptional<z.ZodEnum<{
485
490
  administrativeArea: "administrativeArea";
486
- location: "location";
487
491
  all: "all";
492
+ location: "location";
488
493
  }>>;
489
494
  registeredBy: z.ZodOptional<z.ZodEnum<{
490
495
  user: "user";
@@ -496,29 +501,29 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
496
501
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
497
502
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
498
503
  administrativeArea: "administrativeArea";
499
- location: "location";
500
504
  all: "all";
505
+ location: "location";
501
506
  }>>;
502
507
  notifiedIn: z.ZodOptional<z.ZodEnum<{
503
508
  administrativeArea: "administrativeArea";
504
- location: "location";
505
509
  all: "all";
510
+ location: "location";
506
511
  }>>;
507
512
  notifiedBy: z.ZodOptional<z.ZodEnum<{
508
513
  user: "user";
509
514
  }>>;
510
515
  declaredIn: z.ZodOptional<z.ZodEnum<{
511
516
  administrativeArea: "administrativeArea";
512
- location: "location";
513
517
  all: "all";
518
+ location: "location";
514
519
  }>>;
515
520
  declaredBy: z.ZodOptional<z.ZodEnum<{
516
521
  user: "user";
517
522
  }>>;
518
523
  registeredIn: z.ZodOptional<z.ZodEnum<{
519
524
  administrativeArea: "administrativeArea";
520
- location: "location";
521
525
  all: "all";
526
+ location: "location";
522
527
  }>>;
523
528
  registeredBy: z.ZodOptional<z.ZodEnum<{
524
529
  user: "user";
@@ -531,29 +536,29 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
531
536
  event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
532
537
  placeOfEvent: z.ZodOptional<z.ZodEnum<{
533
538
  administrativeArea: "administrativeArea";
534
- location: "location";
535
539
  all: "all";
540
+ location: "location";
536
541
  }>>;
537
542
  notifiedIn: z.ZodOptional<z.ZodEnum<{
538
543
  administrativeArea: "administrativeArea";
539
- location: "location";
540
544
  all: "all";
545
+ location: "location";
541
546
  }>>;
542
547
  notifiedBy: z.ZodOptional<z.ZodEnum<{
543
548
  user: "user";
544
549
  }>>;
545
550
  declaredIn: z.ZodOptional<z.ZodEnum<{
546
551
  administrativeArea: "administrativeArea";
547
- location: "location";
548
552
  all: "all";
553
+ location: "location";
549
554
  }>>;
550
555
  declaredBy: z.ZodOptional<z.ZodEnum<{
551
556
  user: "user";
552
557
  }>>;
553
558
  registeredIn: z.ZodOptional<z.ZodEnum<{
554
559
  administrativeArea: "administrativeArea";
555
- location: "location";
556
560
  all: "all";
561
+ location: "location";
557
562
  }>>;
558
563
  registeredBy: z.ZodOptional<z.ZodEnum<{
559
564
  user: "user";
@@ -568,8 +573,8 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
568
573
  options: z.ZodOptional<z.ZodObject<{
569
574
  accessLevel: z.ZodOptional<z.ZodEnum<{
570
575
  administrativeArea: "administrativeArea";
571
- location: "location";
572
576
  all: "all";
577
+ location: "location";
573
578
  }>>;
574
579
  role: z.ZodOptional<z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>>;
575
580
  }, z.core.$strip>>;
@@ -581,8 +586,8 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
581
586
  options: z.ZodOptional<z.ZodObject<{
582
587
  accessLevel: z.ZodOptional<z.ZodEnum<{
583
588
  administrativeArea: "administrativeArea";
584
- location: "location";
585
589
  all: "all";
590
+ location: "location";
586
591
  }>>;
587
592
  }, z.core.$strip>>;
588
593
  }, z.core.$strip>, z.ZodObject<{
@@ -590,8 +595,8 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
590
595
  options: z.ZodOptional<z.ZodObject<{
591
596
  accessLevel: z.ZodOptional<z.ZodEnum<{
592
597
  administrativeArea: "administrativeArea";
593
- location: "location";
594
598
  all: "all";
599
+ location: "location";
595
600
  }>>;
596
601
  }, z.core.$strip>>;
597
602
  }, z.core.$strip>, z.ZodObject<{
@@ -607,42 +612,43 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
607
612
  }, z.core.$strip>], "type">;
608
613
  export type Scope = z.infer<typeof Scope>;
609
614
  export declare const ScopeType: z.ZodEnum<{
610
- "record.search": "record.search";
611
- "record.create": "record.create";
612
- "record.read": "record.read";
613
- "record.declare": "record.declare";
614
- "record.notify": "record.notify";
615
- "record.edit": "record.edit";
616
- "record.reject": "record.reject";
617
- "record.archive": "record.archive";
618
- "record.review-duplicates": "record.review-duplicates";
619
- "record.register": "record.register";
620
- "record.print-certified-copies": "record.print-certified-copies";
621
- "record.request-correction": "record.request-correction";
622
- "record.correct": "record.correct";
623
- "record.unassign-others": "record.unassign-others";
624
- "record.custom-action": "record.custom-action";
615
+ "attachment.upload": "attachment.upload";
625
616
  bypassratelimit: "bypassratelimit";
626
- "record.reindex": "record.reindex";
627
- "user.data-seeding": "user.data-seeding";
628
- "integration.create": "integration.create";
629
- "record.import": "record.import";
630
617
  "config.update-all": "config.update-all";
631
- "attachment.upload": "attachment.upload";
632
- "profile.electronic-signature": "profile.electronic-signature";
633
- "user.read-only-my-audit": "user.read-only-my-audit";
618
+ "dashboard.view": "dashboard.view";
619
+ "integration.create": "integration.create";
620
+ "organisation.read-locations": "organisation.read-locations";
634
621
  "performance.read": "performance.read";
635
622
  "performance.read-dashboards": "performance.read-dashboards";
636
623
  "performance.vital-statistics-export": "performance.vital-statistics-export";
624
+ "profile.electronic-signature": "profile.electronic-signature";
625
+ "record.archive": "record.archive";
637
626
  "record.confirm-registration": "record.confirm-registration";
627
+ "record.correct": "record.correct";
628
+ "record.create": "record.create";
629
+ "record.custom-action": "record.custom-action";
630
+ "record.declare": "record.declare";
631
+ "record.edit": "record.edit";
632
+ "record.import": "record.import";
633
+ "record.notify": "record.notify";
634
+ "record.print-certified-copies": "record.print-certified-copies";
635
+ "record.read": "record.read";
636
+ "record.register": "record.register";
637
+ "record.reindex": "record.reindex";
638
+ "record.reject": "record.reject";
638
639
  "record.reject-registration": "record.reject-registration";
639
- "organisation.read-locations": "organisation.read-locations";
640
- "user.read": "user.read";
640
+ "record.request-correction": "record.request-correction";
641
+ "record.review-duplicates": "record.review-duplicates";
642
+ "record.search": "record.search";
643
+ "record.unarchive": "record.unarchive";
644
+ "record.unassign-others": "record.unassign-others";
641
645
  "user.create": "user.create";
646
+ "user.data-seeding": "user.data-seeding";
642
647
  "user.edit": "user.edit";
648
+ "user.read": "user.read";
649
+ "user.read-only-my-audit": "user.read-only-my-audit";
643
650
  "user.search": "user.search";
644
651
  workqueue: "workqueue";
645
- "dashboard.view": "dashboard.view";
646
652
  }>;
647
653
  export type ScopeType = z.infer<typeof ScopeType>;
648
654
  /**
@@ -669,40 +675,40 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
669
675
  type: "record.create" | "record.declare" | "record.notify";
670
676
  options?: {
671
677
  event?: string[] | undefined;
672
- placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
678
+ placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
673
679
  } | undefined;
674
680
  } | {
675
- type: "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register";
681
+ type: "record.archive" | "record.edit" | "record.register" | "record.reject" | "record.review-duplicates" | "record.unarchive";
676
682
  options?: {
677
683
  event?: string[] | undefined;
678
- placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
679
- notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
684
+ placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
685
+ notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
680
686
  notifiedBy?: "user" | undefined;
681
- declaredIn?: "administrativeArea" | "location" | "all" | undefined;
687
+ declaredIn?: "administrativeArea" | "all" | "location" | undefined;
682
688
  declaredBy?: "user" | undefined;
683
689
  } | undefined;
684
690
  } | {
685
- type: "record.search" | "record.read" | "record.request-correction" | "record.correct" | "record.unassign-others";
691
+ type: "record.correct" | "record.read" | "record.request-correction" | "record.search" | "record.unassign-others";
686
692
  options?: {
687
693
  event?: string[] | undefined;
688
- placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
689
- notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
694
+ placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
695
+ notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
690
696
  notifiedBy?: "user" | undefined;
691
- declaredIn?: "administrativeArea" | "location" | "all" | undefined;
697
+ declaredIn?: "administrativeArea" | "all" | "location" | undefined;
692
698
  declaredBy?: "user" | undefined;
693
- registeredIn?: "administrativeArea" | "location" | "all" | undefined;
699
+ registeredIn?: "administrativeArea" | "all" | "location" | undefined;
694
700
  registeredBy?: "user" | undefined;
695
701
  } | undefined;
696
702
  } | {
697
703
  type: "record.custom-action";
698
704
  options?: {
699
705
  event?: string[] | undefined;
700
- placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
701
- notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
706
+ placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
707
+ notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
702
708
  notifiedBy?: "user" | undefined;
703
- declaredIn?: "administrativeArea" | "location" | "all" | undefined;
709
+ declaredIn?: "administrativeArea" | "all" | "location" | undefined;
704
710
  declaredBy?: "user" | undefined;
705
- registeredIn?: "administrativeArea" | "location" | "all" | undefined;
711
+ registeredIn?: "administrativeArea" | "all" | "location" | undefined;
706
712
  registeredBy?: "user" | undefined;
707
713
  customActionTypes?: string[] | undefined;
708
714
  } | undefined;
@@ -710,32 +716,32 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
710
716
  type: "record.print-certified-copies";
711
717
  options?: {
712
718
  event?: string[] | undefined;
713
- placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
714
- notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
719
+ placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
720
+ notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
715
721
  notifiedBy?: "user" | undefined;
716
- declaredIn?: "administrativeArea" | "location" | "all" | undefined;
722
+ declaredIn?: "administrativeArea" | "all" | "location" | undefined;
717
723
  declaredBy?: "user" | undefined;
718
- registeredIn?: "administrativeArea" | "location" | "all" | undefined;
724
+ registeredIn?: "administrativeArea" | "all" | "location" | undefined;
719
725
  registeredBy?: "user" | undefined;
720
726
  templates?: string[] | undefined;
721
727
  } | undefined;
722
728
  } | {
723
729
  type: "user.create" | "user.edit";
724
730
  options?: {
725
- accessLevel?: "administrativeArea" | "location" | "all" | undefined;
731
+ accessLevel?: "administrativeArea" | "all" | "location" | undefined;
726
732
  role?: string[] | undefined;
727
733
  } | undefined;
728
734
  } | {
729
735
  type: "user.read" | "user.search";
730
736
  options?: {
731
- accessLevel?: "administrativeArea" | "location" | "all" | undefined;
737
+ accessLevel?: "administrativeArea" | "all" | "location" | undefined;
732
738
  } | undefined;
733
739
  } | {
734
- type: "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration";
740
+ type: "attachment.upload" | "bypassratelimit" | "config.update-all" | "integration.create" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.confirm-registration" | "record.import" | "record.reindex" | "record.reject-registration" | "user.data-seeding" | "user.read-only-my-audit";
735
741
  } | {
736
742
  type: "organisation.read-locations";
737
743
  options?: {
738
- accessLevel?: "administrativeArea" | "location" | "all" | undefined;
744
+ accessLevel?: "administrativeArea" | "all" | "location" | undefined;
739
745
  } | undefined;
740
746
  } | {
741
747
  type: "workqueue";
@@ -821,7 +827,7 @@ export declare function canUserCreateEvent(userScopes: EncodedScope[], eventType
821
827
  * @param scopes Array of scopes in object format.
822
828
  * @returns Array of scopes in string format, encoded for use in JWT tokens.
823
829
  */
824
- export declare function defineScopes(scopes: Scope[]): (string & z.core.$brand<"EncodedScope">)[];
830
+ export declare function defineScopes(scopes: Scope[]): (string & z.$brand<"EncodedScope">)[];
825
831
  /**
826
832
  * Helper for defining user roles. Should be used in country config.
827
833
  *
@@ -829,7 +835,7 @@ export declare function defineScopes(scopes: Scope[]): (string & z.core.$brand<"
829
835
  */
830
836
  export declare function defineRoles(roles: Role[]): {
831
837
  id: string;
832
- scopes: (string & z.core.$brand<"EncodedScope">)[];
838
+ scopes: (string & z.$brand<"EncodedScope">)[];
833
839
  }[];
834
840
  export {};
835
841
  //# sourceMappingURL=scopes.d.ts.map