@opencrvs/toolkit 2.0.0 → 2.1.0-rc.00fa07b

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 (133) hide show
  1. package/README.md +16 -0
  2. package/build.sh +5 -4
  3. package/create-countryconfig/package.json +1 -1
  4. package/dist/application-config/index.js +32 -7
  5. package/dist/cli.js +3222 -4889
  6. package/dist/commons/api/router.d.ts +3561 -2890
  7. package/dist/commons/application-config/index.d.ts +6 -6
  8. package/dist/commons/conditionals/conditionals.d.ts +32 -323
  9. package/dist/commons/events/ActionConfig.d.ts +302 -67
  10. package/dist/commons/events/ActionDocument.d.ts +155 -111
  11. package/dist/commons/events/ActionInput.d.ts +26 -6
  12. package/dist/commons/events/ActionType.d.ts +63 -58
  13. package/dist/commons/events/AdvancedSearchConfig.d.ts +513 -489
  14. package/dist/commons/events/AuditLog.d.ts +79 -40
  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 +37 -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 +66 -44
  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 +341 -321
  25. package/dist/commons/events/FieldType.d.ts +51 -51
  26. package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
  27. package/dist/commons/events/FieldValue.d.ts +12 -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 +840 -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 +69 -198
  35. package/dist/commons/events/index.d.ts +1 -0
  36. package/dist/commons/events/locationPayloads.d.ts +95 -0
  37. package/dist/commons/events/locations.d.ts +104 -6
  38. package/dist/commons/events/mocks.test.utils.d.ts +18 -4
  39. package/dist/commons/events/scopes.d.ts +5 -4
  40. package/dist/commons/events/state/index.d.ts +23 -15
  41. package/dist/commons/events/state/utils.d.ts +15 -6
  42. package/dist/commons/events/test.utils.d.ts +44 -39
  43. package/dist/commons/events/utils.d.ts +127 -105
  44. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  45. package/dist/conditionals/index.js +13 -5
  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 +122 -0
  50. package/dist/environment/derived-variables.d.ts.map +1 -0
  51. package/dist/environment/derived-variables.js +155 -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 +6 -0
  62. package/dist/environment/index.d.ts.map +1 -0
  63. package/dist/environment/index.js +81 -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/paths.d.ts +7 -0
  71. package/dist/environment/paths.d.ts.map +1 -0
  72. package/dist/environment/paths.js +72 -0
  73. package/dist/environment/questions-helper.d.ts +15 -0
  74. package/dist/environment/questions-helper.d.ts.map +1 -0
  75. package/dist/environment/questions-helper.js +70 -0
  76. package/dist/environment/questions.d.ts +200 -0
  77. package/dist/environment/questions.d.ts.map +1 -0
  78. package/dist/environment/questions.js +412 -0
  79. package/dist/environment/setup-environment.d.ts +2 -0
  80. package/dist/environment/setup-environment.d.ts.map +1 -0
  81. package/dist/environment/setup-environment.js +775 -0
  82. package/dist/environment/ssh-keygen.d.ts +5 -0
  83. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  84. package/dist/environment/ssh-keygen.js +21 -0
  85. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  86. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  87. package/dist/environment/swarm-to-k8s.js +183 -0
  88. package/dist/environment/templates.d.ts +27 -0
  89. package/dist/environment/templates.d.ts.map +1 -0
  90. package/dist/environment/templates.js +164 -0
  91. package/dist/environment/update-workflows.d.ts +2 -0
  92. package/dist/environment/update-workflows.d.ts.map +1 -0
  93. package/dist/environment/update-workflows.js +191 -0
  94. package/dist/environment/upgrade.d.ts +2 -0
  95. package/dist/environment/upgrade.d.ts.map +1 -0
  96. package/dist/environment/upgrade.js +82 -0
  97. package/dist/environment/users.d.ts +2 -0
  98. package/dist/environment/users.d.ts.map +1 -0
  99. package/dist/environment/users.js +120 -0
  100. package/dist/environment/utils.d.ts +18 -0
  101. package/dist/environment/utils.d.ts.map +1 -0
  102. package/dist/environment/utils.js +110 -0
  103. package/dist/events/deduplication.d.ts +1 -1
  104. package/dist/events/index.js +422 -97
  105. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  106. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  107. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  108. package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
  109. package/dist/migrations/v2.0/index.js +88 -5139
  110. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  111. package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
  112. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
  113. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
  114. package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
  115. package/dist/migrations/v2.1/index.d.ts +6 -0
  116. package/dist/migrations/v2.1/index.d.ts.map +1 -0
  117. package/dist/migrations/v2.1/index.js +218 -0
  118. package/dist/notification/index.js +344 -110
  119. package/dist/scopes/index.d.ts +213 -117
  120. package/dist/scopes/index.js +13 -5
  121. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  122. package/dist/templates/charts-values/dependencies/values.yaml +80 -0
  123. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  124. package/dist/templates/charts-values/opencrvs-services/values.yaml +77 -0
  125. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  126. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  127. package/dist/templates/inventory/inventory.template.yml +100 -0
  128. package/dist/templates/inventory/production.example.yml +77 -0
  129. package/dist/templates/inventory/qa.example.yml +48 -0
  130. package/opencrvs-toolkit-2.1.0-rc.00fa07b.tgz +0 -0
  131. package/package.json +18 -4
  132. package/tsconfig.tsbuildinfo +1 -1
  133. package/opencrvs-toolkit-2.0.0.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;
@@ -50,6 +50,14 @@ export declare function getActionConfig({ eventConfiguration, actionType, custom
50
50
  customActionType?: string;
51
51
  }): ActionConfig | undefined;
52
52
  export declare function getCustomActionFields(eventConfiguration: EventConfig, customActionType: string): FieldConfig[];
53
+ /**
54
+ * Returns the fields configured for an action's confirmation dialog.
55
+ *
56
+ * Unlike review fields and supporting copy, NOTIFY does NOT fall back to the
57
+ * DECLARE config here: dialog fields always come from the action's own
58
+ * configuration entry.
59
+ */
60
+ export declare function getActionFormFields(eventConfiguration: EventConfig, actionType: ActionType, customActionType?: string): FieldConfig[];
53
61
  export declare function getPrintCertificatePages(configuration: EventConfig): ({
54
62
  id: string;
55
63
  title: {
@@ -59,8 +67,8 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
59
67
  };
60
68
  requireCompletionToContinue: boolean;
61
69
  fields: FieldConfig[];
62
- type: "FORM";
63
70
  conditional?: any;
71
+ type: "FORM";
64
72
  } | {
65
73
  id: string;
66
74
  title: {
@@ -70,6 +78,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
70
78
  };
71
79
  requireCompletionToContinue: boolean;
72
80
  fields: FieldConfig[];
81
+ conditional?: any;
73
82
  type: "VERIFICATION";
74
83
  actions: {
75
84
  verify: {
@@ -99,7 +108,6 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
99
108
  };
100
109
  };
101
110
  };
102
- conditional?: any;
103
111
  })[];
104
112
  export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => FieldConfig[];
105
113
  export declare function getAllUniqueFields(eventConfig: EventConfig): FieldConfig[];
@@ -154,26 +162,47 @@ export declare function deepMerge<T extends Record<string, unknown>, K extends R
154
162
  export declare function findLastAssignmentAction(actions: Action[]): {
155
163
  id: string & import("zod").$brand<"UUID">;
156
164
  transactionId: string;
157
- createdByUserType: "user" | "system";
165
+ createdByUserType: "system" | "user";
158
166
  createdAt: string;
159
167
  createdBy: string;
168
+ createdByRole?: string | undefined;
169
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
170
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
160
171
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
161
- status: "Requested" | "Accepted" | "Rejected";
162
- type: "REGISTER";
172
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
173
+ status: "Accepted" | "Rejected" | "Requested";
174
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
175
+ type: "CREATE";
176
+ } | {
177
+ id: string & import("zod").$brand<"UUID">;
178
+ transactionId: string;
179
+ createdByUserType: "system" | "user";
180
+ createdAt: string;
181
+ createdBy: string;
163
182
  createdByRole?: string | undefined;
164
183
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
165
184
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
185
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
166
186
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
187
+ status: "Accepted" | "Rejected" | "Requested";
167
188
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
168
- registrationNumber?: string | undefined;
189
+ type: "REJECT";
190
+ content: {
191
+ reason: string;
192
+ };
169
193
  } | {
170
194
  id: string & import("zod").$brand<"UUID">;
171
195
  transactionId: string;
172
- createdByUserType: "user" | "system";
196
+ createdByUserType: "system" | "user";
173
197
  createdAt: string;
174
198
  createdBy: string;
199
+ createdByRole?: string | undefined;
200
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
201
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
175
202
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
176
- status: "Requested" | "Accepted" | "Rejected";
203
+ annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
204
+ status: "Accepted" | "Rejected" | "Requested";
205
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
177
206
  type: "DUPLICATE_DETECTED";
178
207
  content: {
179
208
  duplicates: {
@@ -181,272 +210,265 @@ export declare function findLastAssignmentAction(actions: Action[]): {
181
210
  trackingId: string;
182
211
  }[];
183
212
  };
184
- createdByRole?: string | undefined;
185
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
186
- createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
187
- annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
188
- originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
189
213
  } | {
190
214
  id: string & import("zod").$brand<"UUID">;
191
215
  transactionId: string;
192
- createdByUserType: "user" | "system";
216
+ createdByUserType: "system" | "user";
193
217
  createdAt: string;
194
218
  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
219
  createdByRole?: string | undefined;
202
220
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
203
221
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
222
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
204
223
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
224
+ status: "Accepted" | "Rejected" | "Requested";
205
225
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
226
+ type: "MARK_AS_NOT_DUPLICATE";
206
227
  } | {
207
228
  id: string & import("zod").$brand<"UUID">;
208
229
  transactionId: string;
209
- createdByUserType: "user" | "system";
230
+ createdByUserType: "system" | "user";
210
231
  createdAt: string;
211
232
  createdBy: string;
212
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
213
- status: "Requested" | "Accepted" | "Rejected";
214
- type: "PRINT_CERTIFICATE";
215
233
  createdByRole?: string | undefined;
216
234
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
217
235
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
236
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
218
237
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
238
+ status: "Accepted" | "Rejected" | "Requested";
219
239
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
240
+ type: "MARK_AS_DUPLICATE";
220
241
  content?: {
221
- templateId?: string | undefined;
222
- } | null | undefined;
242
+ duplicateOf: string & import("zod").$brand<"UUID">;
243
+ } | undefined;
223
244
  } | {
224
245
  id: string & import("zod").$brand<"UUID">;
225
246
  transactionId: string;
226
- createdByUserType: "user" | "system";
247
+ createdByUserType: "system" | "user";
227
248
  createdAt: string;
228
249
  createdBy: string;
229
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
230
- status: "Requested" | "Accepted" | "Rejected";
231
- type: "REQUEST_CORRECTION";
232
250
  createdByRole?: string | undefined;
233
251
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
234
252
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
253
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
235
254
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
255
+ status: "Accepted" | "Rejected" | "Requested";
236
256
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
257
+ type: "ARCHIVE";
258
+ content: {
259
+ reason: string;
260
+ };
237
261
  } | {
238
262
  id: string & import("zod").$brand<"UUID">;
239
263
  transactionId: string;
240
- createdByUserType: "user" | "system";
264
+ createdByUserType: "system" | "user";
241
265
  createdAt: string;
242
266
  createdBy: string;
243
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
244
- status: "Requested" | "Accepted" | "Rejected";
245
- type: "CUSTOM";
246
- customActionType: string;
247
267
  createdByRole?: string | undefined;
248
268
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
249
269
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
270
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
250
271
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
272
+ status: "Accepted" | "Rejected" | "Requested";
251
273
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
274
+ type: "UNARCHIVE";
252
275
  } | {
253
276
  id: string & import("zod").$brand<"UUID">;
254
277
  transactionId: string;
255
- createdByUserType: "user" | "system";
278
+ createdByUserType: "system" | "user";
256
279
  createdAt: string;
257
280
  createdBy: string;
258
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
259
- status: "Requested" | "Accepted" | "Rejected";
260
- type: "CREATE";
261
281
  createdByRole?: string | undefined;
262
282
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
263
283
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
284
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
264
285
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
286
+ status: "Accepted" | "Rejected" | "Requested";
265
287
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
288
+ type: "NOTIFY";
266
289
  } | {
267
290
  id: string & import("zod").$brand<"UUID">;
268
291
  transactionId: string;
269
- createdByUserType: "user" | "system";
292
+ createdByUserType: "system" | "user";
270
293
  createdAt: string;
271
294
  createdBy: string;
272
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
273
- status: "Requested" | "Accepted" | "Rejected";
274
- type: "REJECT";
275
- content: {
276
- reason: string;
277
- };
278
295
  createdByRole?: string | undefined;
279
296
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
280
297
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
298
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
281
299
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
300
+ status: "Accepted" | "Rejected" | "Requested";
282
301
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
302
+ type: "REGISTER";
303
+ registrationNumber?: string | undefined;
283
304
  } | {
284
305
  id: string & import("zod").$brand<"UUID">;
285
306
  transactionId: string;
286
- createdByUserType: "user" | "system";
307
+ createdByUserType: "system" | "user";
287
308
  createdAt: string;
288
309
  createdBy: string;
289
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
290
- status: "Requested" | "Accepted" | "Rejected";
291
- type: "MARK_AS_NOT_DUPLICATE";
292
310
  createdByRole?: string | undefined;
293
311
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
294
312
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
313
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
295
314
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
315
+ status: "Accepted" | "Rejected" | "Requested";
296
316
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
317
+ type: "DECLARE";
297
318
  } | {
298
319
  id: string & import("zod").$brand<"UUID">;
299
320
  transactionId: string;
300
- createdByUserType: "user" | "system";
321
+ createdByUserType: "system" | "user";
301
322
  createdAt: string;
302
323
  createdBy: string;
303
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
304
- status: "Requested" | "Accepted" | "Rejected";
305
- type: "MARK_AS_DUPLICATE";
306
324
  createdByRole?: string | undefined;
307
325
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
308
326
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
327
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
309
328
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
329
+ status: "Accepted" | "Rejected" | "Requested";
310
330
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
311
- content?: {
312
- duplicateOf: string & import("zod").$brand<"UUID">;
313
- } | undefined;
331
+ type: "ASSIGN";
332
+ assignedTo: string;
314
333
  } | {
315
334
  id: string & import("zod").$brand<"UUID">;
316
335
  transactionId: string;
317
- createdByUserType: "user" | "system";
336
+ createdByUserType: "system" | "user";
318
337
  createdAt: string;
319
338
  createdBy: string;
320
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
321
- status: "Requested" | "Accepted" | "Rejected";
322
- type: "ARCHIVE";
323
- content: {
324
- reason: string;
325
- };
326
339
  createdByRole?: string | undefined;
327
340
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
328
341
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
342
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
329
343
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
344
+ status: "Accepted" | "Rejected" | "Requested";
330
345
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
346
+ type: "REQUEST_CORRECTION";
331
347
  } | {
332
348
  id: string & import("zod").$brand<"UUID">;
333
349
  transactionId: string;
334
- createdByUserType: "user" | "system";
350
+ createdByUserType: "system" | "user";
335
351
  createdAt: string;
336
352
  createdBy: string;
337
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
338
- status: "Requested" | "Accepted" | "Rejected";
339
- type: "NOTIFY";
340
353
  createdByRole?: string | undefined;
341
354
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
342
355
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
356
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
343
357
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
358
+ status: "Accepted" | "Rejected" | "Requested";
344
359
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
360
+ type: "APPROVE_CORRECTION";
361
+ requestId: string;
362
+ content?: {
363
+ immediateCorrection?: boolean | undefined;
364
+ } | undefined;
345
365
  } | {
346
366
  id: string & import("zod").$brand<"UUID">;
347
367
  transactionId: string;
348
- createdByUserType: "user" | "system";
368
+ createdByUserType: "system" | "user";
349
369
  createdAt: string;
350
370
  createdBy: string;
351
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
352
- status: "Requested" | "Accepted" | "Rejected";
353
- type: "DECLARE";
354
371
  createdByRole?: string | undefined;
355
372
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
356
373
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
374
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
357
375
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
376
+ status: "Accepted" | "Rejected" | "Requested";
358
377
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
378
+ type: "REJECT_CORRECTION";
379
+ requestId: string;
380
+ content: {
381
+ reason: string;
382
+ };
359
383
  } | {
360
384
  id: string & import("zod").$brand<"UUID">;
361
385
  transactionId: string;
362
- createdByUserType: "user" | "system";
386
+ createdByUserType: "system" | "user";
363
387
  createdAt: string;
364
388
  createdBy: string;
365
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
366
- status: "Requested" | "Accepted" | "Rejected";
367
- type: "ASSIGN";
368
- assignedTo: string;
369
389
  createdByRole?: string | undefined;
370
390
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
371
391
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
392
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
372
393
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
394
+ status: "Accepted" | "Rejected" | "Requested";
373
395
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
396
+ type: "UNASSIGN";
374
397
  } | {
375
398
  id: string & import("zod").$brand<"UUID">;
376
399
  transactionId: string;
377
- createdByUserType: "user" | "system";
400
+ createdByUserType: "system" | "user";
378
401
  createdAt: string;
379
402
  createdBy: string;
380
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
381
- status: "Requested" | "Accepted" | "Rejected";
382
- type: "APPROVE_CORRECTION";
383
- requestId: string;
384
403
  createdByRole?: string | undefined;
385
404
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
386
405
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
406
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
387
407
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
408
+ status: "Accepted" | "Rejected" | "Requested";
388
409
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
410
+ type: "PRINT_CERTIFICATE";
389
411
  content?: {
390
- immediateCorrection?: boolean | undefined;
391
- } | undefined;
412
+ templateId?: string | undefined;
413
+ } | null | undefined;
392
414
  } | {
393
415
  id: string & import("zod").$brand<"UUID">;
394
416
  transactionId: string;
395
- createdByUserType: "user" | "system";
417
+ createdByUserType: "system" | "user";
396
418
  createdAt: string;
397
419
  createdBy: string;
398
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
399
- status: "Requested" | "Accepted" | "Rejected";
400
- type: "REJECT_CORRECTION";
401
- requestId: string;
402
- content: {
403
- reason: string;
404
- };
405
420
  createdByRole?: string | undefined;
406
421
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
407
422
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
423
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
408
424
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
425
+ status: "Accepted" | "Rejected" | "Requested";
409
426
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
427
+ type: "READ";
410
428
  } | {
411
429
  id: string & import("zod").$brand<"UUID">;
412
430
  transactionId: string;
413
- createdByUserType: "user" | "system";
431
+ createdByUserType: "system" | "user";
414
432
  createdAt: string;
415
433
  createdBy: string;
416
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
417
- status: "Requested" | "Accepted" | "Rejected";
418
- type: "UNASSIGN";
419
434
  createdByRole?: string | undefined;
420
435
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
421
436
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
437
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
422
438
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
439
+ status: "Accepted" | "Rejected" | "Requested";
423
440
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
441
+ type: "EDIT";
442
+ content?: {
443
+ comment?: string | undefined;
444
+ } | undefined;
424
445
  } | {
425
446
  id: string & import("zod").$brand<"UUID">;
426
447
  transactionId: string;
427
- createdByUserType: "user" | "system";
448
+ createdByUserType: "system" | "user";
428
449
  createdAt: string;
429
450
  createdBy: string;
430
- declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
431
- status: "Requested" | "Accepted" | "Rejected";
432
- type: "READ";
433
451
  createdByRole?: string | undefined;
434
452
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
435
453
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
454
+ declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
436
455
  annotation?: Record<string, import("./FieldValue").FieldUpdateValue> | null | undefined;
456
+ status: "Accepted" | "Rejected" | "Requested";
437
457
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
458
+ type: "CUSTOM";
459
+ customActionType: string;
438
460
  } | {
439
461
  id: string & import("zod").$brand<"UUID">;
440
462
  transactionId: string;
441
- createdByUserType: "user" | "system";
463
+ createdByUserType: "system" | "user";
442
464
  createdAt: string;
443
465
  createdBy: string;
444
- type: "CUSTOM" | "NOTIFY" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION";
445
- status: "Rejected";
446
466
  createdByRole?: string | undefined;
447
467
  createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
448
468
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
449
469
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
470
+ type: "APPROVE_CORRECTION" | "ARCHIVE" | "CUSTOM" | "DECLARE" | "EDIT" | "NOTIFY" | "PRINT_CERTIFICATE" | "REGISTER" | "REJECT" | "REJECT_CORRECTION" | "REQUEST_CORRECTION" | "UNARCHIVE";
471
+ status: "Rejected";
450
472
  } | undefined;
451
473
  /**
452
474
  * Tell compiler that accessing record with arbitrary key might result to undefined
@@ -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<{
@@ -152,6 +152,7 @@ var RecordScopeTypeV2 = z6.enum([
152
152
  "record.edit",
153
153
  "record.reject",
154
154
  "record.archive",
155
+ "record.unarchive",
155
156
  "record.review-duplicates",
156
157
  "record.register",
157
158
  "record.print-certified-copies",
@@ -168,6 +169,7 @@ var PlainScopeType = z6.enum([
168
169
  "integration.create",
169
170
  "record.import",
170
171
  "config.update-all",
172
+ "location.edit",
171
173
  "attachment.upload",
172
174
  "profile.electronic-signature",
173
175
  "user.read-only-my-audit",
@@ -191,11 +193,13 @@ var scopeOptionsPlaceEvent = z6.object({
191
193
  event: scopeByEvent,
192
194
  placeOfEvent: JurisdictionFilter.optional()
193
195
  }).describe("Options applicable to all record scopes.");
194
- var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
196
+ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
197
+ notifiedIn: JurisdictionFilter.optional(),
198
+ notifiedBy: UserFilter.optional(),
195
199
  declaredIn: JurisdictionFilter.optional(),
196
200
  declaredBy: UserFilter.optional()
197
201
  }).describe("Options applicable to actions that may take place after DECLARE");
198
- var AllRecordScopeOptions = scopeOptionsDeclared.extend({
202
+ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
199
203
  registeredIn: JurisdictionFilter.optional(),
200
204
  registeredBy: UserFilter.optional()
201
205
  }).describe(
@@ -233,6 +237,8 @@ var ResolvedScopeOptionsPlaceEvent = z6.object({
233
237
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
234
238
  );
235
239
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
240
+ notifiedIn: UUID.nullish(),
241
+ notifiedBy: z6.string().optional(),
236
242
  declaredIn: UUID.nullish(),
237
243
  declaredBy: z6.string().optional()
238
244
  }).describe(
@@ -253,6 +259,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
253
259
  "record.edit",
254
260
  "record.reject",
255
261
  "record.archive",
262
+ "record.unarchive",
256
263
  "record.review-duplicates",
257
264
  "record.register"
258
265
  ]);
@@ -278,7 +285,7 @@ var RecordScopeV2 = z6.discriminatedUnion("type", [
278
285
  }),
279
286
  z6.object({
280
287
  type: ScopesWithDeclaredOptions,
281
- options: scopeOptionsDeclared.optional()
288
+ options: scopeOptionsDeclaredOrNotified.optional()
282
289
  }),
283
290
  z6.object({
284
291
  type: ScopesWithFullOptions,
@@ -367,8 +374,9 @@ var EncodedScope2 = z6.string().brand("EncodedScope");
367
374
  var DEFAULT_SCOPE_OPTIONS = {
368
375
  placeOfEvent: JurisdictionFilter.enum.all,
369
376
  accessLevel: JurisdictionFilter.enum.all,
370
- registeredIn: JurisdictionFilter.enum.all,
371
- declaredIn: JurisdictionFilter.enum.all
377
+ notifiedIn: JurisdictionFilter.enum.all,
378
+ declaredIn: JurisdictionFilter.enum.all,
379
+ registeredIn: JurisdictionFilter.enum.all
372
380
  };
373
381
 
374
382
  // ../commons/src/users/userReferences.ts
@@ -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 });