@opencrvs/toolkit 2.0.0-rc.ca280e0 → 2.0.0-rc.ca3fe84

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 (121) hide show
  1. package/README.md +15 -0
  2. package/build.sh +3 -2
  3. package/dist/application-config/index.js +70 -40
  4. package/dist/cli.js +3262 -50
  5. package/dist/commons/api/router.d.ts +3012 -2927
  6. package/dist/commons/application-config/index.d.ts +7 -6
  7. package/dist/commons/conditionals/conditionals.d.ts +287 -234
  8. package/dist/commons/conditionals/validate.d.ts +51 -2
  9. package/dist/commons/events/ActionConfig.d.ts +93 -67
  10. package/dist/commons/events/ActionDocument.d.ts +113 -107
  11. package/dist/commons/events/ActionInput.d.ts +6 -0
  12. package/dist/commons/events/ActionType.d.ts +57 -57
  13. package/dist/commons/events/AdvancedSearchConfig.d.ts +651 -297
  14. package/dist/commons/events/AuditLog.d.ts +41 -41
  15. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  16. package/dist/commons/events/Conditional.d.ts +3 -3
  17. package/dist/commons/events/CountryConfigQueryInput.d.ts +603 -561
  18. package/dist/commons/events/Draft.d.ts +35 -35
  19. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  20. package/dist/commons/events/EventConfig.d.ts +5 -3
  21. package/dist/commons/events/EventDocument.d.ts +46 -43
  22. package/dist/commons/events/EventIndex.d.ts +76 -51
  23. package/dist/commons/events/EventMetadata.d.ts +60 -34
  24. package/dist/commons/events/FieldConfig.d.ts +710 -372
  25. package/dist/commons/events/FieldType.d.ts +51 -50
  26. package/dist/commons/events/FieldTypeMapping.d.ts +101 -101
  27. package/dist/commons/events/FieldValue.d.ts +18 -12
  28. package/dist/commons/events/Flag.d.ts +15 -15
  29. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  30. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  31. package/dist/commons/events/WorkqueueConfig.d.ts +837 -798
  32. package/dist/commons/events/deduplication.d.ts +1 -1
  33. package/dist/commons/events/event.d.ts +2 -2
  34. package/dist/commons/events/field.d.ts +112 -189
  35. package/dist/commons/events/index.d.ts +1 -0
  36. package/dist/commons/events/locations.d.ts +5 -4
  37. package/dist/commons/events/mocks.test.utils.d.ts +2 -2
  38. package/dist/commons/events/scopes.d.ts +4 -4
  39. package/dist/commons/events/state/flags.d.ts +16 -0
  40. package/dist/commons/events/state/index.d.ts +23 -15
  41. package/dist/commons/events/state/utils.d.ts +25 -291
  42. package/dist/commons/events/test.utils.d.ts +33 -33
  43. package/dist/commons/events/utils.d.ts +120 -109
  44. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  45. package/dist/conditionals/index.js +58 -6
  46. package/dist/environment/custom-types.d.ts +33 -0
  47. package/dist/environment/custom-types.d.ts.map +1 -0
  48. package/dist/environment/custom-types.js +12 -0
  49. package/dist/environment/derived-variables.d.ts +134 -0
  50. package/dist/environment/derived-variables.d.ts.map +1 -0
  51. package/dist/environment/derived-variables.js +169 -0
  52. package/dist/environment/editor-questions.d.ts +4 -0
  53. package/dist/environment/editor-questions.d.ts.map +1 -0
  54. package/dist/environment/editor-questions.js +67 -0
  55. package/dist/environment/git.d.ts +5 -0
  56. package/dist/environment/git.d.ts.map +1 -0
  57. package/dist/environment/git.js +38 -0
  58. package/dist/environment/github.d.ts +26 -0
  59. package/dist/environment/github.d.ts.map +1 -0
  60. package/dist/environment/github.js +247 -0
  61. package/dist/environment/index.d.ts +5 -0
  62. package/dist/environment/index.d.ts.map +1 -0
  63. package/dist/environment/index.js +71 -0
  64. package/dist/environment/logger.d.ts +6 -0
  65. package/dist/environment/logger.d.ts.map +1 -0
  66. package/dist/environment/logger.js +25 -0
  67. package/dist/environment/manage-users.d.ts +11 -0
  68. package/dist/environment/manage-users.d.ts.map +1 -0
  69. package/dist/environment/manage-users.js +507 -0
  70. package/dist/environment/questions-helper.d.ts +15 -0
  71. package/dist/environment/questions-helper.d.ts.map +1 -0
  72. package/dist/environment/questions-helper.js +70 -0
  73. package/dist/environment/questions.d.ts +200 -0
  74. package/dist/environment/questions.d.ts.map +1 -0
  75. package/dist/environment/questions.js +412 -0
  76. package/dist/environment/setup-environment.d.ts +2 -0
  77. package/dist/environment/setup-environment.d.ts.map +1 -0
  78. package/dist/environment/setup-environment.js +788 -0
  79. package/dist/environment/ssh-keygen.d.ts +5 -0
  80. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  81. package/dist/environment/ssh-keygen.js +21 -0
  82. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  83. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  84. package/dist/environment/swarm-to-k8s.js +183 -0
  85. package/dist/environment/templates.d.ts +27 -0
  86. package/dist/environment/templates.d.ts.map +1 -0
  87. package/dist/environment/templates.js +163 -0
  88. package/dist/environment/update-workflows.d.ts +2 -0
  89. package/dist/environment/update-workflows.d.ts.map +1 -0
  90. package/dist/environment/update-workflows.js +179 -0
  91. package/dist/environment/users.d.ts +2 -0
  92. package/dist/environment/users.d.ts.map +1 -0
  93. package/dist/environment/users.js +122 -0
  94. package/dist/environment/utils.d.ts +18 -0
  95. package/dist/environment/utils.d.ts.map +1 -0
  96. package/dist/environment/utils.js +110 -0
  97. package/dist/events/deduplication.d.ts +1 -1
  98. package/dist/events/index.js +446 -147
  99. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  100. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  101. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  102. package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
  103. package/dist/migrations/v2.0/index.js +20 -9
  104. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  105. package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
  106. package/dist/notification/index.js +265 -45
  107. package/dist/scopes/index.d.ts +209 -123
  108. package/dist/scopes/index.js +19 -8
  109. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  110. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  111. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  112. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  113. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  114. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  115. package/dist/templates/inventory/inventory.template.yml +100 -0
  116. package/dist/templates/inventory/production.example.yml +77 -0
  117. package/dist/templates/inventory/qa.example.yml +48 -0
  118. package/opencrvs-toolkit-2.0.0-rc.ca3fe84.tgz +0 -0
  119. package/package.json +16 -3
  120. package/tsconfig.tsbuildinfo +1 -1
  121. package/opencrvs-toolkit-2.0.0-rc.ca280e0.tgz +0 -0
@@ -21,8 +21,8 @@ export declare function getDeclarationPages(configuration: EventConfig): {
21
21
  };
22
22
  requireCompletionToContinue: boolean;
23
23
  fields: FieldConfig[];
24
- type: "FORM";
25
24
  conditional?: any;
25
+ type: "FORM";
26
26
  }[];
27
27
  export declare function getDeclaration(configuration: EventConfig): {
28
28
  label: {
@@ -39,8 +39,8 @@ export declare function getDeclaration(configuration: EventConfig): {
39
39
  };
40
40
  requireCompletionToContinue: boolean;
41
41
  fields: FieldConfig[];
42
- type: "FORM";
43
42
  conditional?: any;
43
+ type: "FORM";
44
44
  }[];
45
45
  };
46
46
  export declare function isActionConfigType(type: ActionType): type is ActionConfigTypes;
@@ -59,8 +59,8 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
59
59
  };
60
60
  requireCompletionToContinue: boolean;
61
61
  fields: FieldConfig[];
62
- type: "FORM";
63
62
  conditional?: any;
63
+ type: "FORM";
64
64
  } | {
65
65
  id: string;
66
66
  title: {
@@ -70,6 +70,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
70
70
  };
71
71
  requireCompletionToContinue: boolean;
72
72
  fields: FieldConfig[];
73
+ conditional?: any;
73
74
  type: "VERIFICATION";
74
75
  actions: {
75
76
  verify: {
@@ -99,7 +100,6 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
99
100
  };
100
101
  };
101
102
  };
102
- conditional?: any;
103
103
  })[];
104
104
  export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => FieldConfig[];
105
105
  export declare function getAllUniqueFields(eventConfig: EventConfig): FieldConfig[];
@@ -154,296 +154,299 @@ export declare function deepMerge<T extends Record<string, unknown>, K extends R
154
154
  export declare function findLastAssignmentAction(actions: Action[]): {
155
155
  id: string & import("zod").$brand<"UUID">;
156
156
  transactionId: string;
157
- createdByUserType: "user" | "system";
157
+ createdByUserType: "system" | "user";
158
158
  createdAt: string;
159
159
  createdBy: string;
160
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
161
- status: "Requested" | "Accepted" | "Rejected";
162
- type: "REGISTER";
163
160
  createdByRole?: string | undefined;
164
161
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
165
162
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
163
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
166
164
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
165
+ status: "Accepted" | "Rejected" | "Requested";
167
166
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
168
- registrationNumber?: string | undefined;
167
+ type: "CREATE";
169
168
  } | {
170
169
  id: string & import("zod").$brand<"UUID">;
171
170
  transactionId: string;
172
- createdByUserType: "user" | "system";
171
+ createdByUserType: "system" | "user";
173
172
  createdAt: string;
174
173
  createdBy: string;
175
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
176
- status: "Requested" | "Accepted" | "Rejected";
177
- type: "DUPLICATE_DETECTED";
178
- content: {
179
- duplicates: {
180
- id: string & import("zod").$brand<"UUID">;
181
- trackingId: string;
182
- }[];
183
- };
184
174
  createdByRole?: string | undefined;
185
175
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
186
176
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
177
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
187
178
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
179
+ status: "Accepted" | "Rejected" | "Requested";
188
180
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
181
+ type: "REJECT";
182
+ content: {
183
+ reason: string;
184
+ };
189
185
  } | {
190
186
  id: string & import("zod").$brand<"UUID">;
191
187
  transactionId: string;
192
- createdByUserType: "user" | "system";
188
+ createdByUserType: "system" | "user";
193
189
  createdAt: string;
194
190
  createdBy: string;
195
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
196
- status: "Requested" | "Accepted" | "Rejected";
197
- type: "EDIT";
198
- content: {
199
- comment?: string | undefined;
200
- };
201
191
  createdByRole?: string | undefined;
202
192
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
203
193
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
194
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
204
195
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
196
+ status: "Accepted" | "Rejected" | "Requested";
205
197
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
198
+ type: "DUPLICATE_DETECTED";
199
+ content: {
200
+ duplicates: {
201
+ id: string & import("zod").$brand<"UUID">;
202
+ trackingId: string;
203
+ }[];
204
+ };
206
205
  } | {
207
206
  id: string & import("zod").$brand<"UUID">;
208
207
  transactionId: string;
209
- createdByUserType: "user" | "system";
208
+ createdByUserType: "system" | "user";
210
209
  createdAt: string;
211
210
  createdBy: string;
212
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
213
- status: "Requested" | "Accepted" | "Rejected";
214
- type: "PRINT_CERTIFICATE";
215
211
  createdByRole?: string | undefined;
216
212
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
217
213
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
214
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
218
215
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
216
+ status: "Accepted" | "Rejected" | "Requested";
219
217
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
220
- content?: {
221
- templateId?: string | undefined;
222
- } | null | undefined;
218
+ type: "MARK_AS_NOT_DUPLICATE";
223
219
  } | {
224
220
  id: string & import("zod").$brand<"UUID">;
225
221
  transactionId: string;
226
- createdByUserType: "user" | "system";
222
+ createdByUserType: "system" | "user";
227
223
  createdAt: string;
228
224
  createdBy: string;
229
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
230
- status: "Requested" | "Accepted" | "Rejected";
231
- type: "REQUEST_CORRECTION";
232
225
  createdByRole?: string | undefined;
233
226
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
234
227
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
228
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
235
229
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
230
+ status: "Accepted" | "Rejected" | "Requested";
236
231
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
232
+ type: "MARK_AS_DUPLICATE";
233
+ content?: {
234
+ duplicateOf: string & import("zod").$brand<"UUID">;
235
+ } | undefined;
237
236
  } | {
238
237
  id: string & import("zod").$brand<"UUID">;
239
238
  transactionId: string;
240
- createdByUserType: "user" | "system";
239
+ createdByUserType: "system" | "user";
241
240
  createdAt: string;
242
241
  createdBy: string;
243
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
244
- status: "Requested" | "Accepted" | "Rejected";
245
- type: "CUSTOM";
246
- customActionType: string;
247
242
  createdByRole?: string | undefined;
248
243
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
249
244
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
245
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
250
246
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
247
+ status: "Accepted" | "Rejected" | "Requested";
251
248
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
249
+ type: "ARCHIVE";
250
+ content: {
251
+ reason: string;
252
+ };
252
253
  } | {
253
254
  id: string & import("zod").$brand<"UUID">;
254
255
  transactionId: string;
255
- createdByUserType: "user" | "system";
256
+ createdByUserType: "system" | "user";
256
257
  createdAt: string;
257
258
  createdBy: string;
258
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
259
- status: "Requested" | "Accepted" | "Rejected";
260
- type: "CREATE";
261
259
  createdByRole?: string | undefined;
262
260
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
263
261
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
262
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
264
263
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
264
+ status: "Accepted" | "Rejected" | "Requested";
265
265
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
266
+ type: "NOTIFY";
266
267
  } | {
267
268
  id: string & import("zod").$brand<"UUID">;
268
269
  transactionId: string;
269
- createdByUserType: "user" | "system";
270
+ createdByUserType: "system" | "user";
270
271
  createdAt: string;
271
272
  createdBy: string;
272
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
273
- status: "Requested" | "Accepted" | "Rejected";
274
- type: "REJECT";
275
- content: {
276
- reason: string;
277
- };
278
273
  createdByRole?: string | undefined;
279
274
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
280
275
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
276
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
281
277
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
278
+ status: "Accepted" | "Rejected" | "Requested";
282
279
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
280
+ type: "REGISTER";
281
+ registrationNumber?: string | undefined;
283
282
  } | {
284
283
  id: string & import("zod").$brand<"UUID">;
285
284
  transactionId: string;
286
- createdByUserType: "user" | "system";
285
+ createdByUserType: "system" | "user";
287
286
  createdAt: string;
288
287
  createdBy: string;
289
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
290
- status: "Requested" | "Accepted" | "Rejected";
291
- type: "MARK_AS_NOT_DUPLICATE";
292
288
  createdByRole?: string | undefined;
293
289
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
294
290
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
291
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
295
292
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
293
+ status: "Accepted" | "Rejected" | "Requested";
296
294
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
295
+ type: "DECLARE";
297
296
  } | {
298
297
  id: string & import("zod").$brand<"UUID">;
299
298
  transactionId: string;
300
- createdByUserType: "user" | "system";
299
+ createdByUserType: "system" | "user";
301
300
  createdAt: string;
302
301
  createdBy: string;
303
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
304
- status: "Requested" | "Accepted" | "Rejected";
305
- type: "MARK_AS_DUPLICATE";
306
302
  createdByRole?: string | undefined;
307
303
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
308
304
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
305
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
309
306
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
307
+ status: "Accepted" | "Rejected" | "Requested";
310
308
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
311
- content?: {
312
- duplicateOf: string & import("zod").$brand<"UUID">;
313
- } | undefined;
309
+ type: "ASSIGN";
310
+ assignedTo: string;
314
311
  } | {
315
312
  id: string & import("zod").$brand<"UUID">;
316
313
  transactionId: string;
317
- createdByUserType: "user" | "system";
314
+ createdByUserType: "system" | "user";
318
315
  createdAt: string;
319
316
  createdBy: string;
320
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
321
- status: "Requested" | "Accepted" | "Rejected";
322
- type: "ARCHIVE";
323
- content: {
324
- reason: string;
325
- };
326
317
  createdByRole?: string | undefined;
327
318
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
328
319
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
320
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
329
321
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
322
+ status: "Accepted" | "Rejected" | "Requested";
330
323
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
324
+ type: "REQUEST_CORRECTION";
331
325
  } | {
332
326
  id: string & import("zod").$brand<"UUID">;
333
327
  transactionId: string;
334
- createdByUserType: "user" | "system";
328
+ createdByUserType: "system" | "user";
335
329
  createdAt: string;
336
330
  createdBy: string;
337
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
338
- status: "Requested" | "Accepted" | "Rejected";
339
- type: "NOTIFY";
340
331
  createdByRole?: string | undefined;
341
332
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
342
333
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
334
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
343
335
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
336
+ status: "Accepted" | "Rejected" | "Requested";
344
337
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
338
+ type: "APPROVE_CORRECTION";
339
+ requestId: string;
340
+ content?: {
341
+ immediateCorrection?: boolean | undefined;
342
+ } | undefined;
345
343
  } | {
346
344
  id: string & import("zod").$brand<"UUID">;
347
345
  transactionId: string;
348
- createdByUserType: "user" | "system";
346
+ createdByUserType: "system" | "user";
349
347
  createdAt: string;
350
348
  createdBy: string;
351
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
352
- status: "Requested" | "Accepted" | "Rejected";
353
- type: "DECLARE";
354
349
  createdByRole?: string | undefined;
355
350
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
356
351
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
352
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
357
353
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
354
+ status: "Accepted" | "Rejected" | "Requested";
358
355
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
356
+ type: "REJECT_CORRECTION";
357
+ requestId: string;
358
+ content: {
359
+ reason: string;
360
+ };
359
361
  } | {
360
362
  id: string & import("zod").$brand<"UUID">;
361
363
  transactionId: string;
362
- createdByUserType: "user" | "system";
364
+ createdByUserType: "system" | "user";
363
365
  createdAt: string;
364
366
  createdBy: string;
365
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
366
- status: "Requested" | "Accepted" | "Rejected";
367
- type: "ASSIGN";
368
- assignedTo: string;
369
367
  createdByRole?: string | undefined;
370
368
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
371
369
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
370
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
372
371
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
372
+ status: "Accepted" | "Rejected" | "Requested";
373
373
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
374
+ type: "UNASSIGN";
374
375
  } | {
375
376
  id: string & import("zod").$brand<"UUID">;
376
377
  transactionId: string;
377
- createdByUserType: "user" | "system";
378
+ createdByUserType: "system" | "user";
378
379
  createdAt: string;
379
380
  createdBy: string;
380
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
381
- status: "Requested" | "Accepted" | "Rejected";
382
- type: "APPROVE_CORRECTION";
383
- requestId: string;
384
381
  createdByRole?: string | undefined;
385
382
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
386
383
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
384
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
387
385
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
386
+ status: "Accepted" | "Rejected" | "Requested";
388
387
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
388
+ type: "PRINT_CERTIFICATE";
389
+ content?: {
390
+ templateId?: string | undefined;
391
+ } | null | undefined;
389
392
  } | {
390
393
  id: string & import("zod").$brand<"UUID">;
391
394
  transactionId: string;
392
- createdByUserType: "user" | "system";
395
+ createdByUserType: "system" | "user";
393
396
  createdAt: string;
394
397
  createdBy: string;
395
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
396
- status: "Requested" | "Accepted" | "Rejected";
397
- type: "REJECT_CORRECTION";
398
- requestId: string;
399
- content: {
400
- reason: string;
401
- };
402
398
  createdByRole?: string | undefined;
403
399
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
404
400
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
401
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
405
402
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
403
+ status: "Accepted" | "Rejected" | "Requested";
406
404
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
405
+ type: "READ";
407
406
  } | {
408
407
  id: string & import("zod").$brand<"UUID">;
409
408
  transactionId: string;
410
- createdByUserType: "user" | "system";
409
+ createdByUserType: "system" | "user";
411
410
  createdAt: string;
412
411
  createdBy: string;
413
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
414
- status: "Requested" | "Accepted" | "Rejected";
415
- type: "UNASSIGN";
416
412
  createdByRole?: string | undefined;
417
413
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
418
414
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
415
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
419
416
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
417
+ status: "Accepted" | "Rejected" | "Requested";
420
418
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
419
+ type: "EDIT";
420
+ content: {
421
+ comment?: string | undefined;
422
+ };
421
423
  } | {
422
424
  id: string & import("zod").$brand<"UUID">;
423
425
  transactionId: string;
424
- createdByUserType: "user" | "system";
426
+ createdByUserType: "system" | "user";
425
427
  createdAt: string;
426
428
  createdBy: string;
427
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
428
- status: "Requested" | "Accepted" | "Rejected";
429
- type: "READ";
430
429
  createdByRole?: string | undefined;
431
430
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
432
431
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
432
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
433
433
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
434
+ status: "Accepted" | "Rejected" | "Requested";
434
435
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
436
+ type: "CUSTOM";
437
+ customActionType: string;
435
438
  } | {
436
439
  id: string & import("zod").$brand<"UUID">;
437
440
  transactionId: string;
438
- createdByUserType: "user" | "system";
441
+ createdByUserType: "system" | "user";
439
442
  createdAt: string;
440
443
  createdBy: string;
441
- type: "CUSTOM" | "NOTIFY" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION";
442
- status: "Rejected";
443
444
  createdByRole?: string | undefined;
444
445
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
445
446
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
446
447
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
448
+ type: "APPROVE_CORRECTION" | "ARCHIVE" | "CUSTOM" | "DECLARE" | "EDIT" | "NOTIFY" | "PRINT_CERTIFICATE" | "REGISTER" | "REJECT" | "REJECT_CORRECTION" | "REQUEST_CORRECTION";
449
+ status: "Rejected";
447
450
  } | undefined;
448
451
  /**
449
452
  * Tell compiler that accessing record with arbitrary key might result to undefined
@@ -559,7 +562,15 @@ export declare function timePeriodToDateRange(value: SelectDateRangeValue): {
559
562
  };
560
563
  export declare function mergeDrafts(currentDraft: Draft, incomingDraft: Draft): Draft;
561
564
  export declare function getPendingAction(actions: Action[]): ActionDocument;
562
- export declare function getCompleteActionAnnotation(annotation: ActionUpdate, event: EventDocument, action: ActionDocument): ActionUpdate;
565
+ export declare function getCompleteActionAnnotation(event: EventDocument, action: ActionDocument): ActionUpdate;
566
+ /**
567
+ * Resolves the complete content for an action, inheriting from its original
568
+ * Requested action when the Accepted action carries no content of its own.
569
+ *
570
+ * Mirrors the same "originalActionId → merge from Requested" pattern used by
571
+ * getCompleteActionAnnotation and getCompleteActionDeclaration.
572
+ */
573
+ export declare function getCompleteActionContent(event: EventDocument, action: ActionDocument): Record<string, unknown> | null | undefined;
563
574
  export declare function getCompleteActionDeclaration<T extends EventState | ActionUpdate>(declaration: T, event: EventDocument, action: ActionDocument): T;
564
575
  export declare function getAcceptedActions(event: EventDocument): ActionDocument[];
565
576
  export declare function aggregateActionDeclarations(event: EventDocument): EventState;
@@ -1,15 +1,15 @@
1
1
  import * as z from 'zod/v4';
2
2
  export declare const TriggerEvent: {
3
- readonly USER_CREATED: "user-created";
4
- readonly USER_UPDATED: "user-updated";
5
- readonly USERNAME_REMINDER: "username-reminder";
6
- readonly RESET_PASSWORD: "reset-password";
7
- readonly RESET_PASSWORD_BY_ADMIN: "reset-password-by-admin";
8
- readonly RESEND_INVITE: "resend-invite";
9
- readonly TWO_FA: "2fa";
10
- readonly ALL_USER_NOTIFICATION: "all-user-notification";
11
- readonly CHANGE_PHONE_NUMBER: "change-phone-number";
12
- readonly CHANGE_EMAIL_ADDRESS: "change-email-address";
3
+ readonly USER_CREATED: 'user-created';
4
+ readonly USER_UPDATED: 'user-updated';
5
+ readonly USERNAME_REMINDER: 'username-reminder';
6
+ readonly RESET_PASSWORD: 'reset-password';
7
+ readonly RESET_PASSWORD_BY_ADMIN: 'reset-password-by-admin';
8
+ readonly RESEND_INVITE: 'resend-invite';
9
+ readonly TWO_FA: '2fa';
10
+ readonly ALL_USER_NOTIFICATION: 'all-user-notification';
11
+ readonly CHANGE_PHONE_NUMBER: 'change-phone-number';
12
+ readonly CHANGE_EMAIL_ADDRESS: 'change-email-address';
13
13
  };
14
14
  export type TriggerEvent = (typeof TriggerEvent)[keyof typeof TriggerEvent];
15
15
  export declare const Recipient: z.ZodObject<{
@@ -191,11 +191,13 @@ var scopeOptionsPlaceEvent = z6.object({
191
191
  event: scopeByEvent,
192
192
  placeOfEvent: JurisdictionFilter.optional()
193
193
  }).describe("Options applicable to all record scopes.");
194
- var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
194
+ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
195
+ notifiedIn: JurisdictionFilter.optional(),
196
+ notifiedBy: UserFilter.optional(),
195
197
  declaredIn: JurisdictionFilter.optional(),
196
198
  declaredBy: UserFilter.optional()
197
199
  }).describe("Options applicable to actions that may take place after DECLARE");
198
- var AllRecordScopeOptions = scopeOptionsDeclared.extend({
200
+ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
199
201
  registeredIn: JurisdictionFilter.optional(),
200
202
  registeredBy: UserFilter.optional()
201
203
  }).describe(
@@ -233,6 +235,8 @@ var ResolvedScopeOptionsPlaceEvent = z6.object({
233
235
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
234
236
  );
235
237
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
238
+ notifiedIn: UUID.nullish(),
239
+ notifiedBy: z6.string().optional(),
236
240
  declaredIn: UUID.nullish(),
237
241
  declaredBy: z6.string().optional()
238
242
  }).describe(
@@ -278,7 +282,7 @@ var RecordScopeV2 = z6.discriminatedUnion("type", [
278
282
  }),
279
283
  z6.object({
280
284
  type: ScopesWithDeclaredOptions,
281
- options: scopeOptionsDeclared.optional()
285
+ options: scopeOptionsDeclaredOrNotified.optional()
282
286
  }),
283
287
  z6.object({
284
288
  type: ScopesWithFullOptions,
@@ -367,8 +371,9 @@ var EncodedScope2 = z6.string().brand("EncodedScope");
367
371
  var DEFAULT_SCOPE_OPTIONS = {
368
372
  placeOfEvent: JurisdictionFilter.enum.all,
369
373
  accessLevel: JurisdictionFilter.enum.all,
370
- registeredIn: JurisdictionFilter.enum.all,
371
- declaredIn: JurisdictionFilter.enum.all
374
+ notifiedIn: JurisdictionFilter.enum.all,
375
+ declaredIn: JurisdictionFilter.enum.all,
376
+ registeredIn: JurisdictionFilter.enum.all
372
377
  };
373
378
 
374
379
  // ../commons/src/users/userReferences.ts
@@ -1005,7 +1010,54 @@ function createFieldConditionals(fieldId) {
1005
1010
  }
1006
1011
  },
1007
1012
  required: [fieldId]
1008
- })
1013
+ }),
1014
+ /**
1015
+ * Custom client-side validator. The provided function is serialised and executed
1016
+ * just-in-time on the client only. External references (e.g. lodash) are not
1017
+ * available inside the function body — all logic must be self-contained.
1018
+ *
1019
+ * @example
1020
+ * field('nid').customClientValidator((value) => {
1021
+ * // LUHN check — all logic must be inline
1022
+ * const digits = String(value).split('').map(Number)
1023
+ * // ...
1024
+ * return isValid
1025
+ * })
1026
+ */
1027
+ customClientValidator(validationFn) {
1028
+ const code = validationFn.toString();
1029
+ return defineFormConditional({
1030
+ type: "object",
1031
+ properties: wrapToPath(
1032
+ { [fieldId]: { customClientValidator: { code } } },
1033
+ this.$$subfield
1034
+ ),
1035
+ required: [fieldId]
1036
+ });
1037
+ },
1038
+ /**
1039
+ * Custom client-side evaluation. Returns a {@link FieldReference} descriptor
1040
+ * that can be used as the `value` property or a DATA component entry.
1041
+ * The function receives the referenced field's value as the first argument and
1042
+ * the full form context as the second; its return value replaces the field reference.
1043
+ * The function is serialised and executed just-in-time on the client only.
1044
+ * External references (e.g. lodash) are not available inside the function body.
1045
+ *
1046
+ * For computing a default value without referencing a specific field, use
1047
+ * `evaluate(fn)` in the `defaultValue` property instead.
1048
+ *
1049
+ * @example
1050
+ * field('a').customClientEvaluation((aValue, ctx) =>
1051
+ * Number(aValue) + Number(ctx.$form.b)
1052
+ * )
1053
+ */
1054
+ customClientEvaluation(computationFn) {
1055
+ return {
1056
+ $$code: computationFn.toString(),
1057
+ $$field: fieldId,
1058
+ $$subfield: this.$$subfield
1059
+ };
1060
+ }
1009
1061
  };
1010
1062
  }
1011
1063
 
@@ -0,0 +1,33 @@
1
+ import { PromptObject } from 'prompts';
2
+ import { Secret, Variable } from './github';
3
+ export type Question<T extends string> = PromptObject<T> & {
4
+ name: T;
5
+ valueType?: 'SECRET' | 'VARIABLE';
6
+ scope: 'ENVIRONMENT' | 'REPOSITORY';
7
+ valueLabel?: string;
8
+ };
9
+ export type QuestionDescriptor<T extends string> = Omit<Question<T>, 'type'> & {
10
+ type: 'disabled' | PromptObject<T>['type'];
11
+ };
12
+ export type SecretAnswer = {
13
+ type: 'SECRET';
14
+ scope: 'ENVIRONMENT' | 'REPOSITORY';
15
+ name: string;
16
+ value: string;
17
+ didExist: Secret | undefined;
18
+ };
19
+ export type VariableAnswer = {
20
+ type: 'VARIABLE';
21
+ name: string;
22
+ didExist: Variable | undefined;
23
+ value: string;
24
+ scope: 'ENVIRONMENT' | 'REPOSITORY';
25
+ };
26
+ export type Answer = SecretAnswer | VariableAnswer;
27
+ export type Answers = Answer[];
28
+ export type AnswerWithNullValue = (Omit<SecretAnswer, 'value'> & {
29
+ value: SecretAnswer['value'] | null;
30
+ }) | (Omit<VariableAnswer, 'value'> & {
31
+ value: VariableAnswer['value'] | null;
32
+ });
33
+ //# sourceMappingURL=custom-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-types.d.ts","sourceRoot":"","sources":["../../src/environment/custom-types.ts"],"names":[],"mappings":"AAWA,OAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE3C,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IACzD,IAAI,EAAE,CAAC,CAAA;IACP,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IACjC,KAAK,EAAE,aAAa,GAAG,YAAY,CAAA;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAC7E,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,QAAQ,CAAA;IACd,KAAK,EAAE,aAAa,GAAG,YAAY,CAAA;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,aAAa,GAAG,YAAY,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,cAAc,CAAA;AAClD,MAAM,MAAM,OAAO,GAAG,MAAM,EAAE,CAAA;AAC9B,MAAM,MAAM,mBAAmB,GAC3B,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAC7B,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;CACpC,CAAC,GACF,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG;IAC/B,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;CACtC,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /*
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+ *
7
+ * OpenCRVS is also distributed under the terms of the Civil Registration
8
+ * & Healthcare Disclaimer located at http://opencrvs.org/license.
9
+ *
10
+ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });