@opencrvs/toolkit 2.1.2 → 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 (163) hide show
  1. package/build.sh +2 -12
  2. package/create-countryconfig/package.json +1 -1
  3. package/dist/application-config/index.js +41 -9
  4. package/dist/authentication/index.d.ts +1 -0
  5. package/dist/authentication/index.js +30 -6
  6. package/dist/cli.js +1489 -2020
  7. package/dist/commons/api/router.d.ts +1551 -248
  8. package/dist/commons/application-config/index.d.ts +2 -2
  9. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  10. package/dist/commons/conditionals/index.d.ts +1 -0
  11. package/dist/commons/conditionals/validate.d.ts +5 -0
  12. package/dist/commons/events/ActionConfig.d.ts +146 -20
  13. package/dist/commons/events/ActionDocument.d.ts +89 -0
  14. package/dist/commons/events/ActionInput.d.ts +56 -4
  15. package/dist/commons/events/ActionType.d.ts +13 -1
  16. package/dist/commons/events/AdvancedSearchConfig.d.ts +15 -0
  17. package/dist/commons/events/AuditLog.d.ts +4 -0
  18. package/dist/commons/events/CompositeFieldValue.d.ts +5 -1
  19. package/dist/commons/events/CountryConfigQueryInput.d.ts +192 -18
  20. package/dist/commons/events/Draft.d.ts +36 -1
  21. package/dist/commons/events/EventConfig.d.ts +412 -6
  22. package/dist/commons/events/EventDocument.d.ts +88 -0
  23. package/dist/commons/events/EventIndex.d.ts +43 -6
  24. package/dist/commons/events/EventMetadata.d.ts +23 -1
  25. package/dist/commons/events/EventStatus.d.ts +1 -0
  26. package/dist/commons/events/FieldConfig.d.ts +11 -1
  27. package/dist/commons/events/FieldTypeMapping.d.ts +6 -6
  28. package/dist/commons/events/Flag.d.ts +1 -7
  29. package/dist/commons/events/PlainDate.d.ts +1 -0
  30. package/dist/commons/events/WorkqueueConfig.d.ts +224 -33
  31. package/dist/commons/events/defineConfig.d.ts +7 -2
  32. package/dist/commons/events/event.d.ts +4 -1
  33. package/dist/commons/events/eventConfigValidation.d.ts +26 -1
  34. package/dist/commons/events/field.d.ts +5 -0
  35. package/dist/commons/events/index.d.ts +3 -0
  36. package/dist/commons/events/scopes.d.ts +3 -0
  37. package/dist/commons/events/state/flags.d.ts +1 -1
  38. package/dist/commons/events/state/index.d.ts +10 -2
  39. package/dist/commons/events/state/utils.d.ts +11 -1
  40. package/dist/commons/events/test.utils.d.ts +87 -6
  41. package/dist/commons/events/toNotificationForm.d.ts +17 -0
  42. package/dist/commons/events/utils.d.ts +75 -8
  43. package/dist/conditionals/index.js +16 -4
  44. package/dist/environment/custom-types.d.ts +1 -0
  45. package/dist/environment/custom-types.d.ts.map +1 -1
  46. package/dist/environment/derived-variables.d.ts +24 -4
  47. package/dist/environment/derived-variables.d.ts.map +1 -1
  48. package/dist/environment/derived-variables.js +27 -4
  49. package/dist/environment/questions.d.ts +42 -9
  50. package/dist/environment/questions.d.ts.map +1 -1
  51. package/dist/environment/questions.js +71 -48
  52. package/dist/environment/registry.d.ts +15 -0
  53. package/dist/environment/registry.d.ts.map +1 -0
  54. package/dist/environment/registry.js +112 -0
  55. package/dist/environment/setup-environment.d.ts.map +1 -1
  56. package/dist/environment/setup-environment.js +159 -35
  57. package/dist/environment/templates.d.ts.map +1 -1
  58. package/dist/events/index.js +944 -214
  59. package/dist/migrations/add-notify-config.d.ts +40 -0
  60. package/dist/migrations/add-notify-config.d.ts.map +1 -0
  61. package/dist/migrations/add-notify-config.js +249 -0
  62. package/dist/migrations/index.d.ts +9 -0
  63. package/dist/migrations/index.d.ts.map +1 -0
  64. package/dist/migrations/index.js +1306 -0
  65. package/dist/migrations/move-declaration-to-declare-action.d.ts +38 -0
  66. package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -0
  67. package/dist/migrations/move-declaration-to-declare-action.js +260 -0
  68. package/dist/migrations/{v2.1 → persistent}/add-translations.d.ts +7 -1
  69. package/dist/migrations/persistent/add-translations.d.ts.map +1 -0
  70. package/dist/migrations/{v2.1 → persistent}/add-translations.js +14 -12
  71. package/dist/migrations/persistent/check-upgrade-path.d.ts +36 -0
  72. package/dist/migrations/persistent/check-upgrade-path.d.ts.map +1 -0
  73. package/dist/migrations/persistent/check-upgrade-path.js +105 -0
  74. package/dist/migrations/persistent/update-toolkit-dependency.d.ts +7 -0
  75. package/dist/migrations/persistent/update-toolkit-dependency.d.ts.map +1 -0
  76. package/dist/migrations/persistent/update-toolkit-dependency.js +77 -0
  77. package/dist/migrations/read-declaration-through-helper.d.ts +39 -0
  78. package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -0
  79. package/dist/migrations/read-declaration-through-helper.js +199 -0
  80. package/dist/migrations/replace-incomplete-flag.d.ts +26 -0
  81. package/dist/migrations/replace-incomplete-flag.d.ts.map +1 -0
  82. package/dist/migrations/replace-incomplete-flag.js +126 -0
  83. package/dist/migrations/resolve-versioned-event-config.d.ts +56 -0
  84. package/dist/migrations/resolve-versioned-event-config.d.ts.map +1 -0
  85. package/dist/migrations/resolve-versioned-event-config.js +353 -0
  86. package/dist/migrations/utils.d.ts +61 -0
  87. package/dist/migrations/utils.d.ts.map +1 -0
  88. package/dist/migrations/utils.js +218 -0
  89. package/dist/notification/index.js +887 -129
  90. package/dist/scopes/index.d.ts +83 -90
  91. package/dist/scopes/index.js +26 -6
  92. package/dist/templates/charts-values/dependencies/values.yaml +3 -2
  93. package/dist/templates/charts-values/opencrvs-services/values.yaml +5 -7
  94. package/dist/templates/charts-values/traefik/values.yaml +4 -3
  95. package/dist/verify/endpoints.d.ts +11 -0
  96. package/dist/verify/endpoints.d.ts.map +1 -1
  97. package/dist/verify/endpoints.js +21 -27
  98. package/opencrvs-toolkit-2.2.0-rc.1a111f2.tgz +0 -0
  99. package/package.json +3 -2
  100. package/tsconfig.build.tsbuildinfo +1 -1
  101. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +0 -3
  102. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +0 -1
  103. package/dist/migrations/v2.1/add-explicit-correction-flags.js +0 -234
  104. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +0 -3
  105. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +0 -1
  106. package/dist/migrations/v2.1/add-recovery-link-notifications.js +0 -511
  107. package/dist/migrations/v2.1/add-translations.d.ts.map +0 -1
  108. package/dist/migrations/v2.1/enable-telemetry.d.ts +0 -3
  109. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +0 -1
  110. package/dist/migrations/v2.1/enable-telemetry.js +0 -455
  111. package/dist/migrations/v2.1/index.d.ts +0 -6
  112. package/dist/migrations/v2.1/index.d.ts.map +0 -1
  113. package/dist/migrations/v2.1/index.js +0 -2170
  114. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +0 -14
  115. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +0 -1
  116. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +0 -348
  117. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +0 -2
  118. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +0 -1
  119. package/dist/migrations/v2.1/remove-metabase-package-installs.js +0 -161
  120. package/dist/migrations/v2.1/remove-sentry.d.ts +0 -3
  121. package/dist/migrations/v2.1/remove-sentry.d.ts.map +0 -1
  122. package/dist/migrations/v2.1/remove-sentry.js +0 -354
  123. package/dist/migrations/v2.1/rename-trigger-paths.d.ts +0 -3
  124. package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +0 -1
  125. package/dist/migrations/v2.1/rename-trigger-paths.js +0 -216
  126. package/dist/migrations/v2.1/template-files.d.ts +0 -8
  127. package/dist/migrations/v2.1/template-files.d.ts.map +0 -1
  128. package/dist/migrations/v2.1/template-files.js +0 -49
  129. package/dist/migrations/v2.1/upgrade-tilt.d.ts +0 -8
  130. package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +0 -1
  131. package/dist/migrations/v2.1/upgrade-tilt.js +0 -139
  132. package/dist/templates/countryconfig-template/.tiltignore +0 -1
  133. package/dist/templates/countryconfig-template/Dockerfile.assets +0 -7
  134. package/dist/templates/countryconfig-template/Tiltfile +0 -112
  135. package/dist/templates/countryconfig-template/assets/README.md +0 -1
  136. package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +0 -61
  137. package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +0 -455
  138. package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +0 -168
  139. package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +0 -67
  140. package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +0 -168
  141. package/dist/templates/countryconfig-template/assets/metabase/README.md +0 -34
  142. package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +0 -36
  143. package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +0 -46
  144. package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +0 -27737
  145. package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +0 -21
  146. package/dist/templates/countryconfig-template/assets/metabase/package.json +0 -13
  147. package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +0 -108
  148. package/dist/templates/countryconfig-template/assets/metabase/run.sh +0 -120
  149. package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +0 -40
  150. package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +0 -135
  151. package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +0 -108
  152. package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +0 -50
  153. package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +0 -35
  154. package/dist/templates/countryconfig-template/tilt/common.tilt +0 -145
  155. package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +0 -15
  156. package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +0 -56
  157. package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +0 -21
  158. package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +0 -38
  159. package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +0 -17
  160. package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +0 -16
  161. package/dist/templates/countryconfig-template/tilt/lib.tilt +0 -95
  162. package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +0 -136
  163. package/opencrvs-toolkit-2.1.2.tgz +0 -0
@@ -3,11 +3,12 @@ import { ActionConfig } from './ActionConfig';
3
3
  import { SummaryConfig } from './SummaryConfig';
4
4
  import { TranslationConfig } from './TranslationConfig';
5
5
  import { AdvancedSearchConfig } from './AdvancedSearchConfig';
6
- import { DeclarationFormConfig, DeclarationFormConfigInput } from './FormConfig';
6
+ import { DeclarationFormConfigInput } from './FormConfig';
7
7
  import { FieldReference } from './FieldConfig';
8
8
  import { FlagConfig } from './Flag';
9
9
  import type { JSONSchema } from '../conditionals/conditionals';
10
10
  import { AvailableIcons } from '../icons';
11
+ import { ActionType } from './ActionType';
11
12
  export declare const EventFieldReference: z.ZodObject<{
12
13
  $$event: z.ZodEnum<{
13
14
  createdAt: "createdAt";
@@ -30,20 +31,425 @@ export type EventConfig = {
30
31
  label: TranslationConfig;
31
32
  actions: ActionConfig[];
32
33
  actionOrder?: string[];
33
- declaration: DeclarationFormConfig;
34
34
  advancedSearch: AdvancedSearchConfig[];
35
35
  flags: FlagConfig[];
36
36
  analytics: boolean;
37
37
  icon?: Partial<Record<AvailableIcons, JSONSchema>>;
38
38
  };
39
- export type EventConfigInput = Omit<EventConfig, 'advancedSearch' | 'flags' | 'declaration' | 'actions' | 'dateOfEvent' | 'placeOfEvent' | 'analytics'> & {
39
+ type ActionConfigInput = z.input<typeof ActionConfig>;
40
+ type DeclareActionConfigInput = Extract<ActionConfigInput, {
41
+ type: typeof ActionType.DECLARE;
42
+ }>;
43
+ /**
44
+ * Input accepted by `EventConfig.parse`. `declaration` lives only on the DECLARE action,
45
+ * and NOTIFY carries its `notificationForm` and `review`.
46
+ */
47
+ type EventConfigSchemaInput = Omit<EventConfig, 'advancedSearch' | 'flags' | 'actions' | 'dateOfEvent' | 'placeOfEvent' | 'analytics'> & {
40
48
  dateOfEvent?: z.input<typeof FieldReference> | z.infer<typeof EventFieldReference>;
41
49
  placeOfEvent?: z.input<typeof FieldReference>;
42
50
  advancedSearch?: AdvancedSearchConfig[];
43
51
  flags?: FlagConfig[];
44
- declaration: DeclarationFormConfigInput;
45
- actions: z.input<typeof ActionConfig>[];
52
+ actions: ActionConfigInput[];
46
53
  analytics?: boolean;
47
54
  };
48
- export declare const EventConfig: z.ZodType<EventConfig, EventConfigInput>;
55
+ /**
56
+ * Input accepted by `defineConfig`.
57
+ * `declaration` may be given at the top level (kept for backwards compatibility)
58
+ * or on the DECLARE action.
59
+ * `defineConfig` checks at runtime that it is given in exactly one of these places.
60
+ */
61
+ export type EventConfigInput = Omit<EventConfigSchemaInput, 'actions'> & {
62
+ /** @deprecated Define `declaration` on the DECLARE action instead. */
63
+ declaration?: DeclarationFormConfigInput;
64
+ actions: Array<Exclude<ActionConfigInput, DeclareActionConfigInput> | (Omit<DeclareActionConfigInput, 'declaration'> & {
65
+ declaration?: DeclarationFormConfigInput;
66
+ })>;
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;
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>;
454
+ export {};
49
455
  //# sourceMappingURL=EventConfig.d.ts.map
@@ -166,6 +166,48 @@ export declare const EventDocument: z.ZodObject<{
166
166
  }>;
167
167
  originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
168
168
  type: z.ZodLiteral<"UNARCHIVE">;
169
+ }, z.core.$strip>, z.ZodObject<{
170
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
171
+ transactionId: z.ZodString;
172
+ createdByUserType: z.ZodEnum<{
173
+ system: "system";
174
+ user: "user";
175
+ }>;
176
+ createdAt: z.ZodString;
177
+ createdBy: z.ZodString;
178
+ createdByRole: z.ZodOptional<z.ZodString>;
179
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">>>;
180
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
181
+ declaration: z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>;
182
+ annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>>;
183
+ status: z.ZodEnum<{
184
+ Accepted: "Accepted";
185
+ Rejected: "Rejected";
186
+ Requested: "Requested";
187
+ }>;
188
+ originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
189
+ type: z.ZodLiteral<"REVOKE_REGISTRATION">;
190
+ }, z.core.$strip>, z.ZodObject<{
191
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
192
+ transactionId: z.ZodString;
193
+ createdByUserType: z.ZodEnum<{
194
+ system: "system";
195
+ user: "user";
196
+ }>;
197
+ createdAt: z.ZodString;
198
+ createdBy: z.ZodString;
199
+ createdByRole: z.ZodOptional<z.ZodString>;
200
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">>>;
201
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
202
+ declaration: z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>;
203
+ annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>>;
204
+ status: z.ZodEnum<{
205
+ Accepted: "Accepted";
206
+ Rejected: "Rejected";
207
+ Requested: "Requested";
208
+ }>;
209
+ originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
210
+ type: z.ZodLiteral<"REINSTATE_REGISTRATION">;
169
211
  }, z.core.$strip>, z.ZodObject<{
170
212
  id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
171
213
  transactionId: z.ZodString;
@@ -457,9 +499,11 @@ export declare const EventDocument: z.ZodObject<{
457
499
  NOTIFY: "NOTIFY";
458
500
  PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
459
501
  REGISTER: "REGISTER";
502
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION";
460
503
  REJECT: "REJECT";
461
504
  REJECT_CORRECTION: "REJECT_CORRECTION";
462
505
  REQUEST_CORRECTION: "REQUEST_CORRECTION";
506
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION";
463
507
  UNARCHIVE: "UNARCHIVE";
464
508
  }>;
465
509
  status: z.ZodLiteral<"Rejected">;
@@ -635,6 +679,48 @@ export declare const EventDocumentOnlyLastAction: z.core.$ZodBranded<z.ZodObject
635
679
  }>;
636
680
  originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
637
681
  type: z.ZodLiteral<"UNARCHIVE">;
682
+ }, z.core.$strip>, z.ZodObject<{
683
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
684
+ transactionId: z.ZodString;
685
+ createdByUserType: z.ZodEnum<{
686
+ system: "system";
687
+ user: "user";
688
+ }>;
689
+ createdAt: z.ZodString;
690
+ createdBy: z.ZodString;
691
+ createdByRole: z.ZodOptional<z.ZodString>;
692
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">>>;
693
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
694
+ declaration: z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>;
695
+ annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>>;
696
+ status: z.ZodEnum<{
697
+ Accepted: "Accepted";
698
+ Rejected: "Rejected";
699
+ Requested: "Requested";
700
+ }>;
701
+ originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
702
+ type: z.ZodLiteral<"REVOKE_REGISTRATION">;
703
+ }, z.core.$strip>, z.ZodObject<{
704
+ id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
705
+ transactionId: z.ZodString;
706
+ createdByUserType: z.ZodEnum<{
707
+ system: "system";
708
+ user: "user";
709
+ }>;
710
+ createdAt: z.ZodString;
711
+ createdBy: z.ZodString;
712
+ createdByRole: z.ZodOptional<z.ZodString>;
713
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">>>;
714
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
715
+ declaration: z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>;
716
+ annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>>;
717
+ status: z.ZodEnum<{
718
+ Accepted: "Accepted";
719
+ Rejected: "Rejected";
720
+ Requested: "Requested";
721
+ }>;
722
+ originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
723
+ type: z.ZodLiteral<"REINSTATE_REGISTRATION">;
638
724
  }, z.core.$strip>, z.ZodObject<{
639
725
  id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
640
726
  transactionId: z.ZodString;
@@ -926,9 +1012,11 @@ export declare const EventDocumentOnlyLastAction: z.core.$ZodBranded<z.ZodObject
926
1012
  NOTIFY: "NOTIFY";
927
1013
  PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
928
1014
  REGISTER: "REGISTER";
1015
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION";
929
1016
  REJECT: "REJECT";
930
1017
  REJECT_CORRECTION: "REJECT_CORRECTION";
931
1018
  REQUEST_CORRECTION: "REQUEST_CORRECTION";
1019
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION";
932
1020
  UNARCHIVE: "UNARCHIVE";
933
1021
  }>;
934
1022
  status: z.ZodLiteral<"Rejected">;