@opencrvs/toolkit 1.9.12-rc.9db61b1 → 1.9.12-rc.a6c95e7

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 +9 -0
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/application-config/index.d.ts +2 -0
  4. package/dist/application-config/index.d.ts.map +1 -0
  5. package/dist/application-config/index.js +124 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +64 -0
  9. package/dist/commons/api/router.d.ts +3369 -2269
  10. package/dist/commons/application-config/index.d.ts +87 -0
  11. package/dist/commons/conditionals/conditionals.d.ts +27 -3
  12. package/dist/commons/conditionals/validate.d.ts +13 -2
  13. package/dist/commons/events/ActionConfig.d.ts +415 -1555
  14. package/dist/commons/events/ActionDocument.d.ts +889 -1942
  15. package/dist/commons/events/ActionInput.d.ts +277 -1073
  16. package/dist/commons/events/ActionType.d.ts +91 -11
  17. package/dist/commons/events/AdvancedSearchConfig.d.ts +288 -1496
  18. package/dist/commons/events/AuditLog.d.ts +405 -0
  19. package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
  20. package/dist/commons/events/Conditional.d.ts +26 -38
  21. package/dist/commons/events/Constants.d.ts +1 -1
  22. package/dist/commons/events/CountryConfigQueryInput.d.ts +1345 -4495
  23. package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
  24. package/dist/commons/events/Draft.d.ts +73 -108
  25. package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
  26. package/dist/commons/events/EventConfig.d.ts +35 -2420
  27. package/dist/commons/events/EventConfigInput.d.ts +0 -3
  28. package/dist/commons/events/EventDocument.d.ts +354 -1366
  29. package/dist/commons/events/EventIndex.d.ts +208 -1014
  30. package/dist/commons/events/EventInput.d.ts +3 -8
  31. package/dist/commons/events/EventMetadata.d.ts +130 -357
  32. package/dist/commons/events/FieldConfig.d.ts +2776 -12896
  33. package/dist/commons/events/FieldType.d.ts +25 -4
  34. package/dist/commons/events/FieldTypeMapping.d.ts +289 -907
  35. package/dist/commons/events/FieldValue.d.ts +121 -527
  36. package/dist/commons/events/FileUtils.d.ts +2 -2
  37. package/dist/commons/events/Flag.d.ts +67 -0
  38. package/dist/commons/events/FormConfig.d.ts +54 -721
  39. package/dist/commons/events/PageConfig.d.ts +58 -320
  40. package/dist/commons/events/PlainDate.d.ts +1 -1
  41. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  42. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  43. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  44. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  45. package/dist/commons/events/WorkqueueConfig.d.ts +2008 -7597
  46. package/dist/commons/events/deduplication.d.ts +3 -3
  47. package/dist/commons/events/defineConfig.d.ts +2 -243
  48. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  49. package/dist/commons/events/index.d.ts +3 -0
  50. package/dist/commons/events/locations.d.ts +57 -20
  51. package/dist/commons/events/scopes.d.ts +35 -34
  52. package/dist/commons/events/state/availableActions.d.ts +7 -2
  53. package/dist/commons/events/state/flags.d.ts +21 -3
  54. package/dist/commons/events/state/index.d.ts +30 -27
  55. package/dist/commons/events/state/utils.d.ts +191 -173
  56. package/dist/commons/events/test.utils.d.ts +52 -11
  57. package/dist/commons/events/transactions.d.ts +1 -1
  58. package/dist/commons/events/utils.d.ts +413 -310
  59. package/dist/commons/notification/UserNotifications.d.ts +61 -637
  60. package/dist/conditionals/index.d.ts.map +1 -1
  61. package/dist/conditionals/index.js +294 -14
  62. package/dist/events/deduplication.d.ts +3 -3
  63. package/dist/events/index.js +2721 -2099
  64. package/dist/notification/index.d.ts.map +1 -1
  65. package/dist/notification/index.js +2016 -1763
  66. package/dist/scopes/index.d.ts +623 -357
  67. package/dist/scopes/index.d.ts.map +1 -1
  68. package/dist/scopes/index.js +329 -301
  69. package/opencrvs-toolkit-1.9.12-rc.a6c95e7.tgz +0 -0
  70. package/package.json +14 -5
  71. package/tsconfig.json +9 -2
  72. package/tsconfig.tsbuildinfo +1 -1
  73. package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
@@ -0,0 +1,405 @@
1
+ import * as z from 'zod/v4';
2
+ declare const EventActionEntrySchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ clientId: z.ZodString;
5
+ clientType: z.ZodEnum<{
6
+ user: "user";
7
+ system: "system";
8
+ }>;
9
+ createdAt: z.ZodString;
10
+ operation: z.ZodEnum<{
11
+ "event.actions.notify.request": "event.actions.notify.request";
12
+ "event.actions.declare.request": "event.actions.declare.request";
13
+ "event.actions.register.request": "event.actions.register.request";
14
+ "event.actions.reject.request": "event.actions.reject.request";
15
+ "event.actions.validate.request": "event.actions.validate.request";
16
+ "event.actions.edit.request": "event.actions.edit.request";
17
+ "event.actions.assign.request": "event.actions.assign.request";
18
+ "event.actions.unassign.request": "event.actions.unassign.request";
19
+ "event.actions.read.request": "event.actions.read.request";
20
+ "event.actions.archive.request": "event.actions.archive.request";
21
+ "event.actions.reinstate.request": "event.actions.reinstate.request";
22
+ "event.actions.print_certificate.request": "event.actions.print_certificate.request";
23
+ "event.actions.correction.request.request": "event.actions.correction.request.request";
24
+ "event.actions.correction.approve.request": "event.actions.correction.approve.request";
25
+ "event.actions.correction.reject.request": "event.actions.correction.reject.request";
26
+ "event.actions.mark_as_duplicate.request": "event.actions.mark_as_duplicate.request";
27
+ "event.actions.mark_as_not_duplicate.request": "event.actions.mark_as_not_duplicate.request";
28
+ }>;
29
+ requestData: z.ZodObject<{
30
+ eventId: z.ZodString;
31
+ actionType: z.ZodString;
32
+ eventType: z.ZodString;
33
+ trackingId: z.ZodString;
34
+ transactionId: z.ZodString;
35
+ }, z.core.$strip>;
36
+ }, z.core.$strip>;
37
+ /** Write-side schema for the user audit record mutation (no DB-generated fields). */
38
+ export declare const UserAuditRecordInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
39
+ operation: z.ZodLiteral<"user.create_user">;
40
+ requestData: z.ZodObject<{
41
+ subjectId: z.ZodString;
42
+ role: z.ZodString;
43
+ primaryOfficeId: z.ZodString;
44
+ }, z.core.$strip>;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ operation: z.ZodEnum<{
47
+ "user.deactivate": "user.deactivate";
48
+ "user.reactivate": "user.reactivate";
49
+ }>;
50
+ requestData: z.ZodObject<{
51
+ subjectId: z.ZodString;
52
+ reason: z.ZodString;
53
+ comment: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ operation: z.ZodEnum<{
57
+ "user.edit_user": "user.edit_user";
58
+ "user.logged_in": "user.logged_in";
59
+ "user.logged_out": "user.logged_out";
60
+ "user.password_changed": "user.password_changed";
61
+ "user.password_reset": "user.password_reset";
62
+ "user.password_reset_by_admin": "user.password_reset_by_admin";
63
+ "user.username_reminder": "user.username_reminder";
64
+ "user.username_reminder_by_admin": "user.username_reminder_by_admin";
65
+ }>;
66
+ requestData: z.ZodObject<{
67
+ subjectId: z.ZodString;
68
+ }, z.core.$strip>;
69
+ }, z.core.$strip>, z.ZodObject<{
70
+ operation: z.ZodLiteral<"user.email_address_changed">;
71
+ requestData: z.ZodObject<{
72
+ subjectId: z.ZodString;
73
+ }, z.core.$strip>;
74
+ responseSummary: z.ZodObject<{
75
+ email: z.ZodString;
76
+ }, z.core.$strip>;
77
+ }, z.core.$strip>, z.ZodObject<{
78
+ operation: z.ZodLiteral<"user.phone_number_changed">;
79
+ requestData: z.ZodObject<{
80
+ subjectId: z.ZodString;
81
+ }, z.core.$strip>;
82
+ responseSummary: z.ZodObject<{
83
+ phoneNumber: z.ZodString;
84
+ }, z.core.$strip>;
85
+ }, z.core.$strip>], "operation">;
86
+ export type UserAuditLog = z.infer<typeof UserAuditRecordInput>;
87
+ export declare const AuditLogEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
88
+ id: z.ZodString;
89
+ clientId: z.ZodString;
90
+ clientType: z.ZodEnum<{
91
+ user: "user";
92
+ system: "system";
93
+ }>;
94
+ createdAt: z.ZodString;
95
+ operation: z.ZodLiteral<"event.create">;
96
+ requestData: z.ZodObject<{
97
+ transactionId: z.ZodString;
98
+ type: z.ZodString;
99
+ createdAtLocation: z.ZodNullable<z.ZodString>;
100
+ }, z.core.$strip>;
101
+ responseSummary: z.ZodObject<{
102
+ eventId: z.ZodString;
103
+ trackingId: z.ZodString;
104
+ }, z.core.$strip>;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ id: z.ZodString;
107
+ clientId: z.ZodString;
108
+ clientType: z.ZodEnum<{
109
+ user: "user";
110
+ system: "system";
111
+ }>;
112
+ createdAt: z.ZodString;
113
+ operation: z.ZodLiteral<"event.get">;
114
+ requestData: z.ZodObject<{
115
+ eventId: z.ZodString;
116
+ }, z.core.$strip>;
117
+ responseSummary: z.ZodObject<{
118
+ eventType: z.ZodString;
119
+ trackingId: z.ZodString;
120
+ }, z.core.$strip>;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ id: z.ZodString;
123
+ clientId: z.ZodString;
124
+ createdAt: z.ZodString;
125
+ operation: z.ZodLiteral<"event.search">;
126
+ clientType: z.ZodLiteral<"system">;
127
+ requestData: z.ZodObject<{
128
+ query: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
+ limit: z.ZodNullable<z.ZodNumber>;
130
+ offset: z.ZodNullable<z.ZodNumber>;
131
+ }, z.core.$strip>;
132
+ responseSummary: z.ZodObject<{
133
+ total: z.ZodNumber;
134
+ eventIds: z.ZodArray<z.ZodString>;
135
+ }, z.core.$strip>;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ id: z.ZodString;
138
+ clientId: z.ZodString;
139
+ clientType: z.ZodEnum<{
140
+ user: "user";
141
+ system: "system";
142
+ }>;
143
+ createdAt: z.ZodString;
144
+ operation: z.ZodEnum<{
145
+ "event.actions.notify.request": "event.actions.notify.request";
146
+ "event.actions.declare.request": "event.actions.declare.request";
147
+ "event.actions.register.request": "event.actions.register.request";
148
+ "event.actions.reject.request": "event.actions.reject.request";
149
+ "event.actions.validate.request": "event.actions.validate.request";
150
+ "event.actions.edit.request": "event.actions.edit.request";
151
+ "event.actions.assign.request": "event.actions.assign.request";
152
+ "event.actions.unassign.request": "event.actions.unassign.request";
153
+ "event.actions.read.request": "event.actions.read.request";
154
+ "event.actions.archive.request": "event.actions.archive.request";
155
+ "event.actions.reinstate.request": "event.actions.reinstate.request";
156
+ "event.actions.print_certificate.request": "event.actions.print_certificate.request";
157
+ "event.actions.correction.request.request": "event.actions.correction.request.request";
158
+ "event.actions.correction.approve.request": "event.actions.correction.approve.request";
159
+ "event.actions.correction.reject.request": "event.actions.correction.reject.request";
160
+ "event.actions.mark_as_duplicate.request": "event.actions.mark_as_duplicate.request";
161
+ "event.actions.mark_as_not_duplicate.request": "event.actions.mark_as_not_duplicate.request";
162
+ }>;
163
+ requestData: z.ZodObject<{
164
+ eventId: z.ZodString;
165
+ actionType: z.ZodString;
166
+ eventType: z.ZodString;
167
+ trackingId: z.ZodString;
168
+ transactionId: z.ZodString;
169
+ }, z.core.$strip>;
170
+ }, z.core.$strip>, z.ZodObject<{
171
+ id: z.ZodString;
172
+ clientId: z.ZodString;
173
+ clientType: z.ZodEnum<{
174
+ user: "user";
175
+ system: "system";
176
+ }>;
177
+ createdAt: z.ZodString;
178
+ operation: z.ZodLiteral<"event.actions.custom.request">;
179
+ requestData: z.ZodObject<{
180
+ eventId: z.ZodString;
181
+ actionType: z.ZodLiteral<"CUSTOM">;
182
+ customAction: z.ZodString;
183
+ eventType: z.ZodString;
184
+ trackingId: z.ZodString;
185
+ transactionId: z.ZodString;
186
+ }, z.core.$strip>;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ id: z.ZodString;
189
+ clientId: z.ZodString;
190
+ clientType: z.ZodEnum<{
191
+ user: "user";
192
+ system: "system";
193
+ }>;
194
+ createdAt: z.ZodString;
195
+ operation: z.ZodLiteral<"integrations.create">;
196
+ requestData: z.ZodObject<{
197
+ name: z.ZodString;
198
+ scopes: z.ZodArray<z.ZodString>;
199
+ }, z.core.$strip>;
200
+ responseSummary: z.ZodObject<{
201
+ clientId: z.ZodString;
202
+ }, z.core.$strip>;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ id: z.ZodString;
205
+ clientId: z.ZodString;
206
+ clientType: z.ZodEnum<{
207
+ user: "user";
208
+ system: "system";
209
+ }>;
210
+ createdAt: z.ZodString;
211
+ operation: z.ZodLiteral<"integrations.refreshToken">;
212
+ requestData: z.ZodObject<{
213
+ clientId: z.ZodString;
214
+ }, z.core.$strip>;
215
+ responseSummary: z.ZodObject<{
216
+ clientId: z.ZodString;
217
+ }, z.core.$strip>;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ id: z.ZodString;
220
+ clientId: z.ZodString;
221
+ clientType: z.ZodEnum<{
222
+ user: "user";
223
+ system: "system";
224
+ }>;
225
+ createdAt: z.ZodString;
226
+ operation: z.ZodLiteral<"integrations.deactivate">;
227
+ requestData: z.ZodObject<{
228
+ id: z.ZodString;
229
+ }, z.core.$strip>;
230
+ responseSummary: z.ZodObject<{
231
+ id: z.ZodString;
232
+ status: z.ZodString;
233
+ }, z.core.$strip>;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ id: z.ZodString;
236
+ clientId: z.ZodString;
237
+ clientType: z.ZodEnum<{
238
+ user: "user";
239
+ system: "system";
240
+ }>;
241
+ createdAt: z.ZodString;
242
+ operation: z.ZodLiteral<"integrations.activate">;
243
+ requestData: z.ZodObject<{
244
+ id: z.ZodString;
245
+ }, z.core.$strip>;
246
+ responseSummary: z.ZodObject<{
247
+ id: z.ZodString;
248
+ status: z.ZodString;
249
+ }, z.core.$strip>;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ id: z.ZodString;
252
+ clientId: z.ZodString;
253
+ clientType: z.ZodEnum<{
254
+ user: "user";
255
+ system: "system";
256
+ }>;
257
+ createdAt: z.ZodString;
258
+ operation: z.ZodLiteral<"integrations.delete">;
259
+ requestData: z.ZodObject<{
260
+ id: z.ZodString;
261
+ }, z.core.$strip>;
262
+ responseSummary: z.ZodObject<{
263
+ id: z.ZodString;
264
+ name: z.ZodString;
265
+ }, z.core.$strip>;
266
+ }, z.core.$strip>, z.ZodObject<{
267
+ id: z.ZodString;
268
+ clientId: z.ZodString;
269
+ clientType: z.ZodEnum<{
270
+ user: "user";
271
+ system: "system";
272
+ }>;
273
+ createdAt: z.ZodString;
274
+ operation: z.ZodLiteral<"integrations.refreshSecret">;
275
+ requestData: z.ZodObject<{
276
+ id: z.ZodString;
277
+ }, z.core.$strip>;
278
+ responseSummary: z.ZodObject<{
279
+ clientId: z.ZodString;
280
+ }, z.core.$strip>;
281
+ }, z.core.$strip>, z.ZodObject<{
282
+ id: z.ZodString;
283
+ clientId: z.ZodString;
284
+ clientType: z.ZodEnum<{
285
+ user: "user";
286
+ system: "system";
287
+ }>;
288
+ createdAt: z.ZodString;
289
+ operation: z.ZodLiteral<"attachments.upload">;
290
+ requestData: z.ZodObject<{
291
+ transactionId: z.ZodString;
292
+ path: z.ZodNullable<z.ZodString>;
293
+ }, z.core.$strip>;
294
+ responseSummary: z.ZodObject<{
295
+ fileUrl: z.ZodString;
296
+ }, z.core.$strip>;
297
+ }, z.core.$strip>, z.ZodObject<{
298
+ id: z.ZodString;
299
+ clientId: z.ZodString;
300
+ clientType: z.ZodEnum<{
301
+ user: "user";
302
+ system: "system";
303
+ }>;
304
+ createdAt: z.ZodString;
305
+ operation: z.ZodLiteral<"user.create_user">;
306
+ requestData: z.ZodObject<{
307
+ subjectId: z.ZodString;
308
+ role: z.ZodString;
309
+ primaryOfficeId: z.ZodString;
310
+ }, z.core.$strip>;
311
+ }, z.core.$strip>, z.ZodObject<{
312
+ id: z.ZodString;
313
+ clientId: z.ZodString;
314
+ clientType: z.ZodEnum<{
315
+ user: "user";
316
+ system: "system";
317
+ }>;
318
+ createdAt: z.ZodString;
319
+ operation: z.ZodEnum<{
320
+ "user.deactivate": "user.deactivate";
321
+ "user.reactivate": "user.reactivate";
322
+ }>;
323
+ requestData: z.ZodObject<{
324
+ subjectId: z.ZodString;
325
+ reason: z.ZodString;
326
+ comment: z.ZodOptional<z.ZodString>;
327
+ }, z.core.$strip>;
328
+ }, z.core.$strip>, z.ZodObject<{
329
+ id: z.ZodString;
330
+ clientId: z.ZodString;
331
+ clientType: z.ZodEnum<{
332
+ user: "user";
333
+ system: "system";
334
+ }>;
335
+ createdAt: z.ZodString;
336
+ operation: z.ZodEnum<{
337
+ "user.edit_user": "user.edit_user";
338
+ "user.logged_in": "user.logged_in";
339
+ "user.logged_out": "user.logged_out";
340
+ "user.password_changed": "user.password_changed";
341
+ "user.password_reset": "user.password_reset";
342
+ "user.password_reset_by_admin": "user.password_reset_by_admin";
343
+ "user.username_reminder": "user.username_reminder";
344
+ "user.username_reminder_by_admin": "user.username_reminder_by_admin";
345
+ }>;
346
+ requestData: z.ZodObject<{
347
+ subjectId: z.ZodString;
348
+ }, z.core.$strip>;
349
+ }, z.core.$strip>, z.ZodObject<{
350
+ id: z.ZodString;
351
+ clientId: z.ZodString;
352
+ clientType: z.ZodEnum<{
353
+ user: "user";
354
+ system: "system";
355
+ }>;
356
+ createdAt: z.ZodString;
357
+ operation: z.ZodLiteral<"user.email_address_changed">;
358
+ requestData: z.ZodObject<{
359
+ subjectId: z.ZodString;
360
+ }, z.core.$strip>;
361
+ responseSummary: z.ZodObject<{
362
+ email: z.ZodString;
363
+ }, z.core.$strip>;
364
+ }, z.core.$strip>, z.ZodObject<{
365
+ id: z.ZodString;
366
+ clientId: z.ZodString;
367
+ clientType: z.ZodEnum<{
368
+ user: "user";
369
+ system: "system";
370
+ }>;
371
+ createdAt: z.ZodString;
372
+ operation: z.ZodLiteral<"user.phone_number_changed">;
373
+ requestData: z.ZodObject<{
374
+ subjectId: z.ZodString;
375
+ }, z.core.$strip>;
376
+ responseSummary: z.ZodObject<{
377
+ phoneNumber: z.ZodString;
378
+ }, z.core.$strip>;
379
+ }, z.core.$strip>], "operation">;
380
+ /** A persisted audit log entry as returned from the database. */
381
+ export type AuditLogEntry = z.infer<typeof AuditLogEntrySchema>;
382
+ /** Distributes Omit over a union so each variant is narrowed correctly. */
383
+ type DistributiveOmit<T, K extends string> = T extends unknown ? Omit<T, K> : never;
384
+ /** Parameters for writing an audit log entry. All fields must be supplied
385
+ * explicitly by the caller — do not pass JWT or context objects. */
386
+ export type AuditLogParams = DistributiveOmit<AuditLogEntry, 'id' | 'createdAt'>;
387
+ /** Union of all operation shapes (without auth or meta fields). */
388
+ export type AuditLogOperation = DistributiveOmit<AuditLogParams, 'clientId' | 'clientType'>;
389
+ /** Event action entries that carry a full event response summary. */
390
+ export type EventActionAuditLog = z.infer<typeof EventActionEntrySchema>;
391
+ /** Custom action entry — operation carries a `customAction` identifier. */
392
+ export type EventCustomActionAuditLog = Extract<AuditLogEntry, {
393
+ operation: 'event.actions.custom.request';
394
+ }>;
395
+ export type EventCreateAuditLog = Extract<AuditLogEntry, {
396
+ operation: 'event.create';
397
+ }>;
398
+ export type EventGetAuditLog = Extract<AuditLogEntry, {
399
+ operation: 'event.get';
400
+ }>;
401
+ export type EventSearchAuditLog = Extract<AuditLogEntry, {
402
+ operation: 'event.search';
403
+ }>;
404
+ export {};
405
+ //# sourceMappingURL=AuditLog.d.ts.map