@opencrvs/toolkit 2.2.0-rc.045257f → 2.2.0-rc.1a111f2

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 (54) hide show
  1. package/dist/cli.js +925 -356
  2. package/dist/commons/api/router.d.ts +4 -4
  3. package/dist/commons/events/ActionType.d.ts +2 -0
  4. package/dist/commons/events/AdvancedSearchConfig.d.ts +3 -0
  5. package/dist/commons/events/Draft.d.ts +34 -1
  6. package/dist/commons/events/EventConfig.d.ts +385 -0
  7. package/dist/commons/events/defineConfig.d.ts +7 -2
  8. package/dist/commons/events/event.d.ts +4 -1
  9. package/dist/commons/events/field.d.ts +5 -0
  10. package/dist/commons/events/scopes.d.ts +1 -0
  11. package/dist/commons/events/test.utils.d.ts +57 -5
  12. package/dist/commons/events/utils.d.ts +13 -0
  13. package/dist/environment/custom-types.d.ts +1 -0
  14. package/dist/environment/custom-types.d.ts.map +1 -1
  15. package/dist/environment/derived-variables.d.ts +8 -0
  16. package/dist/environment/derived-variables.d.ts.map +1 -1
  17. package/dist/environment/derived-variables.js +9 -0
  18. package/dist/environment/questions.d.ts +42 -9
  19. package/dist/environment/questions.d.ts.map +1 -1
  20. package/dist/environment/questions.js +70 -47
  21. package/dist/environment/registry.d.ts +15 -0
  22. package/dist/environment/registry.d.ts.map +1 -0
  23. package/dist/environment/registry.js +112 -0
  24. package/dist/environment/setup-environment.d.ts.map +1 -1
  25. package/dist/environment/setup-environment.js +98 -23
  26. package/dist/events/index.js +462 -99
  27. package/dist/migrations/add-notify-config.d.ts +40 -0
  28. package/dist/migrations/add-notify-config.d.ts.map +1 -0
  29. package/dist/migrations/add-notify-config.js +249 -0
  30. package/dist/migrations/index.d.ts.map +1 -1
  31. package/dist/migrations/index.js +602 -143
  32. package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -1
  33. package/dist/migrations/move-declaration-to-declare-action.js +27 -144
  34. package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -1
  35. package/dist/migrations/read-declaration-through-helper.js +3 -61
  36. package/dist/migrations/resolve-versioned-event-config.d.ts +56 -0
  37. package/dist/migrations/resolve-versioned-event-config.d.ts.map +1 -0
  38. package/dist/migrations/resolve-versioned-event-config.js +353 -0
  39. package/dist/migrations/utils.d.ts +61 -0
  40. package/dist/migrations/utils.d.ts.map +1 -0
  41. package/dist/migrations/utils.js +218 -0
  42. package/dist/notification/index.js +510 -36
  43. package/dist/templates/charts-values/dependencies/values.yaml +2 -1
  44. package/dist/templates/charts-values/opencrvs-services/values.yaml +2 -2
  45. package/dist/verify/endpoints.d.ts +11 -0
  46. package/dist/verify/endpoints.d.ts.map +1 -1
  47. package/dist/verify/endpoints.js +21 -27
  48. package/opencrvs-toolkit-2.2.0-rc.1a111f2.tgz +0 -0
  49. package/package.json +2 -1
  50. package/tsconfig.build.tsbuildinfo +1 -1
  51. package/dist/environment/dockerhub.d.ts +0 -15
  52. package/dist/environment/dockerhub.d.ts.map +0 -1
  53. package/dist/environment/dockerhub.js +0 -104
  54. package/opencrvs-toolkit-2.2.0-rc.045257f.tgz +0 -0
@@ -114,7 +114,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
114
114
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
115
115
  get: import("@trpc/server").TRPCQueryProcedure<{
116
116
  input: void;
117
- output: import("../commons").EventConfig[];
117
+ output: import("../commons").VersionedEventConfig[];
118
118
  meta: import("trpc-to-openapi").OpenApiMeta;
119
119
  }>;
120
120
  }>>;
@@ -1227,7 +1227,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
1227
1227
  annotation?: Record<string, import("../commons").FieldUpdateValue> | null | undefined;
1228
1228
  status: "Accepted" | "Rejected" | "Requested";
1229
1229
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
1230
- type: "APPROVE_CORRECTION" | "ARCHIVE" | "ASSIGN" | "CREATE" | "CUSTOM" | "DECLARE" | "DUPLICATE_DETECTED" | "EDIT" | "MARK_AS_DUPLICATE" | "MARK_AS_NOT_DUPLICATE" | "NOTIFY" | "PRINT_CERTIFICATE" | "READ" | "REGISTER" | "REINSTATE_REGISTRATION" | "REJECT" | "REJECT_CORRECTION" | "REQUEST_CORRECTION" | "REVOKE_REGISTRATION" | "UNARCHIVE" | "UNASSIGN";
1230
+ type: "DECLARE" | "NOTIFY";
1231
1231
  };
1232
1232
  }[];
1233
1233
  meta: import("trpc-to-openapi").OpenApiMeta;
@@ -1243,7 +1243,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
1243
1243
  keepAssignmentIfAccepted?: boolean | undefined;
1244
1244
  keepAssignmentIfRejected?: boolean | undefined;
1245
1245
  createdAtLocation?: string | null | undefined;
1246
- type: "DECLARE";
1246
+ type: "DECLARE" | "NOTIFY";
1247
1247
  status: "Accepted" | "Rejected" | "Requested";
1248
1248
  };
1249
1249
  output: {
@@ -1262,7 +1262,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
1262
1262
  annotation?: Record<string, import("../commons").FieldUpdateValue> | null | undefined;
1263
1263
  status: "Accepted" | "Rejected" | "Requested";
1264
1264
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
1265
- type: "APPROVE_CORRECTION" | "ARCHIVE" | "ASSIGN" | "CREATE" | "CUSTOM" | "DECLARE" | "DUPLICATE_DETECTED" | "EDIT" | "MARK_AS_DUPLICATE" | "MARK_AS_NOT_DUPLICATE" | "NOTIFY" | "PRINT_CERTIFICATE" | "READ" | "REGISTER" | "REINSTATE_REGISTRATION" | "REJECT" | "REJECT_CORRECTION" | "REQUEST_CORRECTION" | "REVOKE_REGISTRATION" | "UNARCHIVE" | "UNASSIGN";
1265
+ type: "DECLARE" | "NOTIFY";
1266
1266
  };
1267
1267
  };
1268
1268
  meta: import("trpc-to-openapi").OpenApiMeta;
@@ -59,6 +59,8 @@ export type ActionTypes = z.infer<typeof ActionTypes>;
59
59
  */
60
60
  export declare const ClientSpecificAction: {
61
61
  readonly REVIEW_CORRECTION_REQUEST: 'REVIEW_CORRECTION_REQUEST';
62
+ /** Opens the user's declare or notify draft of the event in its own flow */
63
+ readonly CONTINUE_DRAFT: 'CONTINUE_DRAFT';
62
64
  };
63
65
  export type ClientSpecificAction = (typeof ClientSpecificAction)[keyof typeof ClientSpecificAction];
64
66
  /** Actions which change event data (declaration) before registration / during declaration. */
@@ -161,6 +161,7 @@ export declare const FieldConfigSchema: z.ZodObject<{
161
161
  }, z.core.$strip>>;
162
162
  fieldId: z.ZodString;
163
163
  fieldType: z.ZodLiteral<"field">;
164
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
164
165
  }, z.core.$strip>;
165
166
  /**
166
167
  * The event fields that are available for advanced search, date of event, summary. These are the values
@@ -513,6 +514,7 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
513
514
  }, z.core.$strip>>;
514
515
  fieldId: z.ZodString;
515
516
  fieldType: z.ZodLiteral<"field">;
517
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
516
518
  }, z.core.$strip>, z.ZodObject<{
517
519
  config: z.ZodObject<{
518
520
  type: z.ZodEnum<{
@@ -836,6 +838,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
836
838
  }, z.core.$strip>>;
837
839
  fieldId: z.ZodString;
838
840
  fieldType: z.ZodLiteral<"field">;
841
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
839
842
  }, z.core.$strip>, z.ZodObject<{
840
843
  config: z.ZodObject<{
841
844
  type: z.ZodEnum<{
@@ -57,13 +57,46 @@ export declare const DraftInput: z.ZodObject<{
57
57
  keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
58
58
  keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
59
59
  createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
60
- type: z.ZodLiteral<"DECLARE">;
60
+ type: z.ZodEnum<{
61
+ DECLARE: "DECLARE";
62
+ NOTIFY: "NOTIFY";
63
+ }>;
61
64
  status: z.ZodEnum<{
62
65
  Accepted: "Accepted";
63
66
  Rejected: "Rejected";
64
67
  Requested: "Requested";
65
68
  }>;
66
69
  }, z.core.$strip>;
70
+ export declare const RemoteDraft: z.ZodObject<{
71
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
72
+ eventId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
73
+ transactionId: z.ZodString;
74
+ createdAt: z.ZodString;
75
+ action: z.ZodObject<{
76
+ transactionId: z.ZodString;
77
+ createdByUserType: z.ZodEnum<{
78
+ system: "system";
79
+ user: "user";
80
+ }>;
81
+ createdAt: z.ZodString;
82
+ createdBy: z.ZodString;
83
+ createdByRole: z.ZodOptional<z.ZodString>;
84
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">>>;
85
+ declaration: z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>;
86
+ annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>>;
87
+ status: z.ZodEnum<{
88
+ Accepted: "Accepted";
89
+ Rejected: "Rejected";
90
+ Requested: "Requested";
91
+ }>;
92
+ originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
93
+ type: z.ZodEnum<{
94
+ DECLARE: "DECLARE";
95
+ NOTIFY: "NOTIFY";
96
+ }>;
97
+ }, z.core.$strip>;
98
+ }, z.core.$strip>;
67
99
  export type Draft = z.infer<typeof Draft>;
68
100
  export type DraftInput = z.infer<typeof DraftInput>;
101
+ export type RemoteDraft = z.infer<typeof RemoteDraft>;
69
102
  //# sourceMappingURL=Draft.d.ts.map
@@ -65,6 +65,391 @@ export type EventConfigInput = Omit<EventConfigSchemaInput, 'actions'> & {
65
65
  declaration?: DeclarationFormConfigInput;
66
66
  })>;
67
67
  };
68
+ /**
69
+ * Input accepted by `defineConfig` for one version of an event.
70
+ * `declaration` lives only on the DECLARE action.
71
+ */
72
+ export type EventConfigVersionInput = Omit<EventConfigSchemaInput, EventLevelField> & {
73
+ /** Identifier of the version, unique within the event (e.g. "birth-v2"). */
74
+ id: string;
75
+ /** Date (YYYY-MM-DD) from which this version is effective. Without one, effective from the beginning of time. */
76
+ effectiveFrom?: string;
77
+ };
78
+ /**
79
+ * Input accepted by `defineConfig` for an event with several versions.
80
+ * `id`, `label` and `advancedSearch` are shared by every version.
81
+ */
82
+ export type VersionedEventConfigInput = Pick<EventConfigInput, EventLevelField> & {
83
+ versions: EventConfigVersionInput[];
84
+ };
85
+ /** Fields shared by every version of an event. */
86
+ declare const eventLevelFields: {
87
+ id: z.ZodString;
88
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
89
+ advancedSearch: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
91
+ fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
92
+ config: z.ZodObject<{
93
+ type: z.ZodEnum<{
94
+ exact: "exact";
95
+ fuzzy: "fuzzy";
96
+ range: "range";
97
+ within: "within";
98
+ }>;
99
+ searchFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
+ }, z.core.$strip>;
101
+ type: z.ZodOptional<z.ZodEnum<{
102
+ readonly NAME: 'NAME';
103
+ readonly PHONE: 'PHONE';
104
+ readonly ID: 'ID';
105
+ readonly ADDRESS: 'ADDRESS';
106
+ readonly TEXT: 'TEXT';
107
+ readonly NUMBER: 'NUMBER';
108
+ readonly NUMBER_WITH_UNIT: 'NUMBER_WITH_UNIT';
109
+ readonly TEXTAREA: 'TEXTAREA';
110
+ readonly EMAIL: 'EMAIL';
111
+ readonly DATE: 'DATE';
112
+ readonly AGE: 'AGE';
113
+ readonly DATE_RANGE: 'DATE_RANGE';
114
+ readonly SELECT_DATE_RANGE: 'SELECT_DATE_RANGE';
115
+ readonly TIME: 'TIME';
116
+ readonly IMAGE_VIEW: 'IMAGE_VIEW';
117
+ readonly PARAGRAPH: 'PARAGRAPH';
118
+ readonly HEADING: 'HEADING';
119
+ readonly PAGE_HEADER: 'PAGE_HEADER';
120
+ readonly RADIO_GROUP: 'RADIO_GROUP';
121
+ readonly FIELD_GROUP: 'FIELD_GROUP';
122
+ readonly FILE: 'FILE';
123
+ readonly FILE_WITH_OPTIONS: 'FILE_WITH_OPTIONS';
124
+ readonly BULLET_LIST: 'BULLET_LIST';
125
+ readonly CHECKBOX: 'CHECKBOX';
126
+ readonly SELECT: 'SELECT';
127
+ readonly COUNTRY: 'COUNTRY';
128
+ readonly LOCATION: 'LOCATION';
129
+ readonly DIVIDER: 'DIVIDER';
130
+ readonly ADMINISTRATIVE_AREA: 'ADMINISTRATIVE_AREA';
131
+ readonly FACILITY: 'FACILITY';
132
+ readonly OFFICE: 'OFFICE';
133
+ readonly SIGNATURE: 'SIGNATURE';
134
+ readonly DATA: 'DATA';
135
+ readonly BUTTON: 'BUTTON';
136
+ readonly AUTOCOMPLETE: 'AUTOCOMPLETE';
137
+ readonly SEARCH: 'SEARCH';
138
+ readonly ALPHA_PRINT_BUTTON: 'ALPHA_PRINT_BUTTON';
139
+ readonly HTTP: 'HTTP';
140
+ readonly LINK_BUTTON: 'LINK_BUTTON';
141
+ readonly VERIFICATION_STATUS: 'VERIFICATION_STATUS';
142
+ readonly QUERY_PARAM_READER: 'QUERY_PARAM_READER';
143
+ readonly QR_READER: 'QR_READER';
144
+ readonly ID_READER: 'ID_READER';
145
+ readonly LOADER: 'LOADER';
146
+ readonly ALPHA_HIDDEN: 'ALPHA_HIDDEN';
147
+ readonly USER_ROLE: 'USER_ROLE';
148
+ readonly _EXPERIMENTAL_CUSTOM: 'CUSTOM';
149
+ }>>;
150
+ label: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
151
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ value: z.ZodString;
153
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>]>;
154
+ conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
155
+ type: z.ZodLiteral<"SHOW">;
156
+ conditional: z.ZodAny;
157
+ }, z.core.$strip>, z.ZodObject<{
158
+ type: z.ZodLiteral<"ENABLE">;
159
+ conditional: z.ZodAny;
160
+ }, z.core.$strip>], "type">>>>;
161
+ }, z.core.$strip>>>;
162
+ searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
163
+ conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
164
+ type: z.ZodLiteral<"SHOW">;
165
+ conditional: z.ZodAny;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ type: z.ZodLiteral<"ENABLE">;
168
+ conditional: z.ZodAny;
169
+ }, z.core.$strip>, z.ZodObject<{
170
+ type: z.ZodLiteral<"DISPLAY_ON_REVIEW">;
171
+ conditional: z.ZodAny;
172
+ }, z.core.$strip>], "type">>>;
173
+ validations: z.ZodOptional<z.ZodArray<z.ZodObject<{
174
+ validator: z.ZodAny;
175
+ message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
176
+ }, z.core.$strip>>>;
177
+ allowedLocations: z.ZodOptional<z.ZodObject<{
178
+ $jurisdiction: z.ZodUnion<[z.ZodEnum<{
179
+ administrativeArea: "administrativeArea";
180
+ all: "all";
181
+ location: "location";
182
+ }>, z.ZodObject<{
183
+ $scope: z.ZodEnum<{
184
+ "attachment.upload": "attachment.upload";
185
+ bypassratelimit: "bypassratelimit";
186
+ "config.update-all": "config.update-all";
187
+ "dashboard.view": "dashboard.view";
188
+ "integration.audit.read": "integration.audit.read";
189
+ "integration.create": "integration.create";
190
+ "location.edit": "location.edit";
191
+ "organisation.read-locations": "organisation.read-locations";
192
+ "performance.read": "performance.read";
193
+ "performance.read-dashboards": "performance.read-dashboards";
194
+ "performance.vital-statistics-export": "performance.vital-statistics-export";
195
+ "profile.electronic-signature": "profile.electronic-signature";
196
+ "record.action.accept": "record.action.accept";
197
+ "record.action.reject": "record.action.reject";
198
+ "record.archive": "record.archive";
199
+ "record.correct": "record.correct";
200
+ "record.create": "record.create";
201
+ "record.custom-action": "record.custom-action";
202
+ "record.declare": "record.declare";
203
+ "record.edit": "record.edit";
204
+ "record.import": "record.import";
205
+ "record.notify": "record.notify";
206
+ "record.print-certified-copies": "record.print-certified-copies";
207
+ "record.read": "record.read";
208
+ "record.register": "record.register";
209
+ "record.reindex": "record.reindex";
210
+ "record.reinstate-registration": "record.reinstate-registration";
211
+ "record.reject": "record.reject";
212
+ "record.request-correction": "record.request-correction";
213
+ "record.review-duplicates": "record.review-duplicates";
214
+ "record.revoke-registration": "record.revoke-registration";
215
+ "record.search": "record.search";
216
+ "record.unarchive": "record.unarchive";
217
+ "record.unassign-others": "record.unassign-others";
218
+ "user.create": "user.create";
219
+ "user.data-seeding": "user.data-seeding";
220
+ "user.edit": "user.edit";
221
+ "user.read": "user.read";
222
+ "user.read-only-my-audit": "user.read-only-my-audit";
223
+ "user.search": "user.search";
224
+ workqueue: "workqueue";
225
+ }>;
226
+ $option: z.ZodEnum<{
227
+ accessLevel: "accessLevel";
228
+ createdBy: "createdBy";
229
+ createdIn: "createdIn";
230
+ declaredBy: "declaredBy";
231
+ declaredIn: "declaredIn";
232
+ event: "event";
233
+ flags: "flags";
234
+ ids: "ids";
235
+ notifiedBy: "notifiedBy";
236
+ notifiedIn: "notifiedIn";
237
+ placeOfEvent: "placeOfEvent";
238
+ registeredBy: "registeredBy";
239
+ registeredIn: "registeredIn";
240
+ role: "role";
241
+ status: "status";
242
+ }>;
243
+ }, z.core.$strip>]>;
244
+ }, z.core.$strip>>;
245
+ fieldId: z.ZodString;
246
+ fieldType: z.ZodLiteral<"field">;
247
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ config: z.ZodObject<{
250
+ type: z.ZodEnum<{
251
+ exact: "exact";
252
+ fuzzy: "fuzzy";
253
+ range: "range";
254
+ within: "within";
255
+ }>;
256
+ searchFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
257
+ }, z.core.$strip>;
258
+ type: z.ZodOptional<z.ZodEnum<{
259
+ readonly NAME: 'NAME';
260
+ readonly PHONE: 'PHONE';
261
+ readonly ID: 'ID';
262
+ readonly ADDRESS: 'ADDRESS';
263
+ readonly TEXT: 'TEXT';
264
+ readonly NUMBER: 'NUMBER';
265
+ readonly NUMBER_WITH_UNIT: 'NUMBER_WITH_UNIT';
266
+ readonly TEXTAREA: 'TEXTAREA';
267
+ readonly EMAIL: 'EMAIL';
268
+ readonly DATE: 'DATE';
269
+ readonly AGE: 'AGE';
270
+ readonly DATE_RANGE: 'DATE_RANGE';
271
+ readonly SELECT_DATE_RANGE: 'SELECT_DATE_RANGE';
272
+ readonly TIME: 'TIME';
273
+ readonly IMAGE_VIEW: 'IMAGE_VIEW';
274
+ readonly PARAGRAPH: 'PARAGRAPH';
275
+ readonly HEADING: 'HEADING';
276
+ readonly PAGE_HEADER: 'PAGE_HEADER';
277
+ readonly RADIO_GROUP: 'RADIO_GROUP';
278
+ readonly FIELD_GROUP: 'FIELD_GROUP';
279
+ readonly FILE: 'FILE';
280
+ readonly FILE_WITH_OPTIONS: 'FILE_WITH_OPTIONS';
281
+ readonly BULLET_LIST: 'BULLET_LIST';
282
+ readonly CHECKBOX: 'CHECKBOX';
283
+ readonly SELECT: 'SELECT';
284
+ readonly COUNTRY: 'COUNTRY';
285
+ readonly LOCATION: 'LOCATION';
286
+ readonly DIVIDER: 'DIVIDER';
287
+ readonly ADMINISTRATIVE_AREA: 'ADMINISTRATIVE_AREA';
288
+ readonly FACILITY: 'FACILITY';
289
+ readonly OFFICE: 'OFFICE';
290
+ readonly SIGNATURE: 'SIGNATURE';
291
+ readonly DATA: 'DATA';
292
+ readonly BUTTON: 'BUTTON';
293
+ readonly AUTOCOMPLETE: 'AUTOCOMPLETE';
294
+ readonly SEARCH: 'SEARCH';
295
+ readonly ALPHA_PRINT_BUTTON: 'ALPHA_PRINT_BUTTON';
296
+ readonly HTTP: 'HTTP';
297
+ readonly LINK_BUTTON: 'LINK_BUTTON';
298
+ readonly VERIFICATION_STATUS: 'VERIFICATION_STATUS';
299
+ readonly QUERY_PARAM_READER: 'QUERY_PARAM_READER';
300
+ readonly QR_READER: 'QR_READER';
301
+ readonly ID_READER: 'ID_READER';
302
+ readonly LOADER: 'LOADER';
303
+ readonly ALPHA_HIDDEN: 'ALPHA_HIDDEN';
304
+ readonly USER_ROLE: 'USER_ROLE';
305
+ readonly _EXPERIMENTAL_CUSTOM: 'CUSTOM';
306
+ }>>;
307
+ label: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
308
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
309
+ value: z.ZodString;
310
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>]>;
311
+ conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
312
+ type: z.ZodLiteral<"SHOW">;
313
+ conditional: z.ZodAny;
314
+ }, z.core.$strip>, z.ZodObject<{
315
+ type: z.ZodLiteral<"ENABLE">;
316
+ conditional: z.ZodAny;
317
+ }, z.core.$strip>], "type">>>>;
318
+ }, z.core.$strip>>>;
319
+ searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
320
+ conditionals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
321
+ type: z.ZodLiteral<"SHOW">;
322
+ conditional: z.ZodAny;
323
+ }, z.core.$strip>, z.ZodObject<{
324
+ type: z.ZodLiteral<"ENABLE">;
325
+ conditional: z.ZodAny;
326
+ }, z.core.$strip>, z.ZodObject<{
327
+ type: z.ZodLiteral<"DISPLAY_ON_REVIEW">;
328
+ conditional: z.ZodAny;
329
+ }, z.core.$strip>], "type">>>;
330
+ validations: z.ZodOptional<z.ZodArray<z.ZodObject<{
331
+ validator: z.ZodAny;
332
+ message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
333
+ }, z.core.$strip>>>;
334
+ allowedLocations: z.ZodOptional<z.ZodObject<{
335
+ $jurisdiction: z.ZodUnion<[z.ZodEnum<{
336
+ administrativeArea: "administrativeArea";
337
+ all: "all";
338
+ location: "location";
339
+ }>, z.ZodObject<{
340
+ $scope: z.ZodEnum<{
341
+ "attachment.upload": "attachment.upload";
342
+ bypassratelimit: "bypassratelimit";
343
+ "config.update-all": "config.update-all";
344
+ "dashboard.view": "dashboard.view";
345
+ "integration.audit.read": "integration.audit.read";
346
+ "integration.create": "integration.create";
347
+ "location.edit": "location.edit";
348
+ "organisation.read-locations": "organisation.read-locations";
349
+ "performance.read": "performance.read";
350
+ "performance.read-dashboards": "performance.read-dashboards";
351
+ "performance.vital-statistics-export": "performance.vital-statistics-export";
352
+ "profile.electronic-signature": "profile.electronic-signature";
353
+ "record.action.accept": "record.action.accept";
354
+ "record.action.reject": "record.action.reject";
355
+ "record.archive": "record.archive";
356
+ "record.correct": "record.correct";
357
+ "record.create": "record.create";
358
+ "record.custom-action": "record.custom-action";
359
+ "record.declare": "record.declare";
360
+ "record.edit": "record.edit";
361
+ "record.import": "record.import";
362
+ "record.notify": "record.notify";
363
+ "record.print-certified-copies": "record.print-certified-copies";
364
+ "record.read": "record.read";
365
+ "record.register": "record.register";
366
+ "record.reindex": "record.reindex";
367
+ "record.reinstate-registration": "record.reinstate-registration";
368
+ "record.reject": "record.reject";
369
+ "record.request-correction": "record.request-correction";
370
+ "record.review-duplicates": "record.review-duplicates";
371
+ "record.revoke-registration": "record.revoke-registration";
372
+ "record.search": "record.search";
373
+ "record.unarchive": "record.unarchive";
374
+ "record.unassign-others": "record.unassign-others";
375
+ "user.create": "user.create";
376
+ "user.data-seeding": "user.data-seeding";
377
+ "user.edit": "user.edit";
378
+ "user.read": "user.read";
379
+ "user.read-only-my-audit": "user.read-only-my-audit";
380
+ "user.search": "user.search";
381
+ workqueue: "workqueue";
382
+ }>;
383
+ $option: z.ZodEnum<{
384
+ accessLevel: "accessLevel";
385
+ createdBy: "createdBy";
386
+ createdIn: "createdIn";
387
+ declaredBy: "declaredBy";
388
+ declaredIn: "declaredIn";
389
+ event: "event";
390
+ flags: "flags";
391
+ ids: "ids";
392
+ notifiedBy: "notifiedBy";
393
+ notifiedIn: "notifiedIn";
394
+ placeOfEvent: "placeOfEvent";
395
+ registeredBy: "registeredBy";
396
+ registeredIn: "registeredIn";
397
+ role: "role";
398
+ status: "status";
399
+ }>;
400
+ }, z.core.$strip>]>;
401
+ }, z.core.$strip>>;
402
+ fieldId: z.ZodEnum<{
403
+ "event.legalStatuses.REGISTERED.acceptedAt": "event.legalStatuses.REGISTERED.acceptedAt";
404
+ "event.legalStatuses.REGISTERED.createdAtLocation": "event.legalStatuses.REGISTERED.createdAtLocation";
405
+ "event.legalStatuses.REGISTERED.registrationNumber": "event.legalStatuses.REGISTERED.registrationNumber";
406
+ "event.status": "event.status";
407
+ "event.trackingId": "event.trackingId";
408
+ "event.updatedAt": "event.updatedAt";
409
+ }>;
410
+ fieldType: z.ZodLiteral<"event">;
411
+ }, z.core.$strip>], "fieldType">>;
412
+ }, z.core.$strip>>>>;
413
+ };
414
+ /** Validations of one version of an event, read together with the fields shared by every version. */
415
+ export declare function validateEventConfig(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
68
416
  export declare const EventConfig: z.ZodType<EventConfig, EventConfigSchemaInput>;
417
+ type EventLevelField = keyof typeof eventLevelFields;
418
+ /** Id of the version of an event configured without `versions`. */
419
+ export declare const DEFAULT_EVENT_CONFIG_VERSION_ID = "default";
420
+ /** `effectiveFrom` of a version configured without one. */
421
+ export declare const DEFAULT_EFFECTIVE_FROM = "0001-01-01";
422
+ /** One version of an event: what the event looks like from `effectiveFrom` on. */
423
+ export type EventConfigVersion = Omit<EventConfig, EventLevelField> & {
424
+ id: string;
425
+ /** Date (YYYY-MM-DD) from which this version is effective. '0001-01-01' when configured without one. */
426
+ effectiveFrom: string;
427
+ };
428
+ /**
429
+ * An event with every version of its configuration. This is what country config serves.
430
+ * Read it through `resolveEventConfig`, which gives the configuration of one version.
431
+ */
432
+ export type VersionedEventConfig = Pick<EventConfig, EventLevelField> & {
433
+ versions: EventConfigVersion[];
434
+ };
435
+ /**
436
+ * @returns the configuration of `version`, together with the fields shared by every
437
+ * version of the event. The same event and version give the same object, so caches
438
+ * keyed on the configuration keep working.
439
+ */
440
+ export declare function getEventConfigOfVersion(config: VersionedEventConfig, version: EventConfigVersion): EventConfig;
441
+ /**
442
+ * @returns the configuration of the version of the event that applies.
443
+ * @TODO: always the first version until the version is resolved from the record (#13602).
444
+ */
445
+ export declare function resolveEventConfig(config: VersionedEventConfig): EventConfig;
446
+ /**
447
+ * Runs `validate` on the configuration of each version (`events[i]` is that of
448
+ * `versions[i]`). Issues on a field of the version are reported under that version.
449
+ * Issues on a field shared by every version (e.g. `advancedSearch`) are reported once,
450
+ * where they are defined.
451
+ */
452
+ export declare function validateEachVersion<E>(ctx: Pick<z.RefinementCtx<unknown>, 'addIssue'>, events: E[], validate: (event: E, versionCtx: z.RefinementCtx<E>) => void): void;
453
+ export declare const VersionedEventConfig: z.ZodType<VersionedEventConfig, VersionedEventConfigInput>;
69
454
  export {};
70
455
  //# sourceMappingURL=EventConfig.d.ts.map
@@ -1,3 +1,8 @@
1
- import { EventConfig, EventConfigInput } from './EventConfig';
2
- export declare const defineConfig: (config: EventConfigInput) => EventConfig;
1
+ import { EventConfigInput, VersionedEventConfig, VersionedEventConfigInput } from './EventConfig';
2
+ /**
3
+ * Validates an event configuration. Accepts an event with `versions`, or, as before
4
+ * versioning, an event without them, which is taken as a single version with id
5
+ * `default`, effective from the beginning of time.
6
+ */
7
+ export declare const defineConfig: (config: EventConfigInput | VersionedEventConfigInput) => VersionedEventConfig;
3
8
  //# sourceMappingURL=defineConfig.d.ts.map
@@ -17,7 +17,10 @@ declare function eventFn(fieldId: NonSearchableEventMetadataTimeFieldIdInput): {
17
17
  };
18
18
  declare const event: typeof eventFn & {
19
19
  /**
20
- * Checks if the event contains a specific action type.
20
+ * Checks if the event contains a specific accepted action type.
21
+ * Only Accepted actions are matched: a confirmable action is stored as a
22
+ * Requested and an Accepted action, and a pending or rejected request must
23
+ * not count as the action having happened.
21
24
  * Can be used directly as a conditional or chained with additional methods.
22
25
  * @param action - The action type to check for.
23
26
  */
@@ -37,6 +37,7 @@ export declare function field(fieldId: string, options?: {
37
37
  validations?: ValidationConfig[];
38
38
  searchCriteriaLabelPrefix?: TranslationConfig;
39
39
  allowedLocations?: JurisdictionReference;
40
+ defaultValue?: boolean | string | number;
40
41
  }): {
41
42
  $$field: string;
42
43
  $$subfield: string[];
@@ -387,6 +388,7 @@ export declare function field(fieldId: string, options?: {
387
388
  validations?: ValidationConfig[];
388
389
  searchCriteriaLabelPrefix?: TranslationConfig;
389
390
  allowedLocations?: JurisdictionReference;
391
+ defaultValue?: boolean | string | number;
390
392
  fieldId: string;
391
393
  fieldType: 'field';
392
394
  } & {
@@ -400,6 +402,7 @@ export declare function field(fieldId: string, options?: {
400
402
  validations?: ValidationConfig[];
401
403
  searchCriteriaLabelPrefix?: TranslationConfig;
402
404
  allowedLocations?: JurisdictionReference;
405
+ defaultValue?: boolean | string | number;
403
406
  fieldId: string;
404
407
  fieldType: 'field';
405
408
  } & {
@@ -413,6 +416,7 @@ export declare function field(fieldId: string, options?: {
413
416
  validations?: ValidationConfig[];
414
417
  searchCriteriaLabelPrefix?: TranslationConfig;
415
418
  allowedLocations?: JurisdictionReference;
419
+ defaultValue?: boolean | string | number;
416
420
  fieldId: string;
417
421
  fieldType: 'field';
418
422
  } & {
@@ -426,6 +430,7 @@ export declare function field(fieldId: string, options?: {
426
430
  validations?: ValidationConfig[];
427
431
  searchCriteriaLabelPrefix?: TranslationConfig;
428
432
  allowedLocations?: JurisdictionReference;
433
+ defaultValue?: boolean | string | number;
429
434
  fieldId: string;
430
435
  fieldType: 'field';
431
436
  } & {
@@ -15,6 +15,7 @@ export declare const ACTION_SCOPE_MAP: {
15
15
  PRINT_CERTIFICATE: "record.print-certified-copies"[];
16
16
  REQUEST_CORRECTION: ("record.correct" | "record.request-correction")[];
17
17
  REVIEW_CORRECTION_REQUEST: "record.correct"[];
18
+ CONTINUE_DRAFT: never[];
18
19
  REJECT_CORRECTION: "record.correct"[];
19
20
  APPROVE_CORRECTION: "record.correct"[];
20
21
  REVOKE_REGISTRATION: "record.revoke-registration"[];