@opencrvs/toolkit 1.9.12-rc.7c8c97f → 1.9.12-rc.8353a87
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.
- package/build.sh +8 -0
- package/dist/application-config/index.js +47 -36
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2422 -0
- package/dist/commons/api/router.d.ts +24 -0
- package/dist/commons/application-config/index.d.ts +7 -12
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/ActionDocument.d.ts +194 -194
- package/dist/commons/events/ActionInput.d.ts +113 -113
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/CountryConfigQueryInput.d.ts +295 -24
- package/dist/commons/events/Draft.d.ts +7 -7
- package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
- package/dist/commons/events/EventDocument.d.ts +79 -79
- package/dist/commons/events/EventIndex.d.ts +20 -12
- package/dist/commons/events/EventInput.d.ts +1 -1
- package/dist/commons/events/EventMetadata.d.ts +12 -12
- package/dist/commons/events/FieldConfig.d.ts +129 -18
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +94 -68
- package/dist/commons/events/FieldValue.d.ts +54 -26
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +4 -4
- package/dist/commons/events/WorkqueueConfig.d.ts +270 -26
- package/dist/commons/events/defineConfig.d.ts +0 -4
- package/dist/commons/events/locations.d.ts +4 -4
- package/dist/commons/events/utils.d.ts +2 -174
- package/dist/conditionals/index.js +13 -5
- package/dist/events/index.js +142 -33
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +753 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
- package/dist/migrations/v2.0/index.d.ts +7 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -0
- package/dist/migrations/v2.0/index.js +2361 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-scopes.js +281 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-api-paths.js +188 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
- package/dist/notification/index.js +73 -23
- package/dist/scopes/index.d.ts +31 -10
- package/dist/scopes/index.js +17 -5
- package/opencrvs-toolkit-1.9.12-rc.8353a87.tgz +0 -0
- package/package.json +11 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-1.9.12-rc.7c8c97f.tgz +0 -0
|
@@ -131,7 +131,7 @@ export declare function isPageVisible(page: PageConfig, formValues: ActionUpdate
|
|
|
131
131
|
* * @param validatorContext - custom validation context
|
|
132
132
|
* @returns {Partial<T>} A new object containing only the values for visible fields
|
|
133
133
|
*/
|
|
134
|
-
export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], formValues: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean): Partial<T>;
|
|
134
|
+
export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], formValues: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean, declarationContext?: EventState): Partial<T>;
|
|
135
135
|
export declare function omitHiddenPaginatedFields<T extends EventState | ActionUpdate>(formConfig: FormConfig, values: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean): Partial<Partial<T>>;
|
|
136
136
|
/**
|
|
137
137
|
*
|
|
@@ -141,179 +141,7 @@ export declare function findActiveDraftForEvent(event: EventDocument, draft: Dra
|
|
|
141
141
|
export declare function createEmptyDraft(eventId: UUID, draftId: UUID, actionType: Exclude<ActionType, 'DELETE'>): Draft;
|
|
142
142
|
export declare function isVerificationPage(page: PageConfig): page is VerificationPageConfig;
|
|
143
143
|
export declare function getVisibleVerificationPageIds(pages: PageConfig[], annotation: ActionUpdate, context: ValidatorContext): string[];
|
|
144
|
-
export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, declaration: EventState, annotation: ActionUpdate, context: ValidatorContext): Partial<
|
|
145
|
-
[x: string]: string | number | boolean | {
|
|
146
|
-
path: string & import("zod").$brand<"DocumentPath">;
|
|
147
|
-
originalFilename: string;
|
|
148
|
-
type: string;
|
|
149
|
-
} | {
|
|
150
|
-
firstname: string;
|
|
151
|
-
surname: string;
|
|
152
|
-
middlename?: string | undefined;
|
|
153
|
-
} | {
|
|
154
|
-
firstname?: string | null | undefined;
|
|
155
|
-
surname?: string | null | undefined;
|
|
156
|
-
middlename?: string | null | undefined;
|
|
157
|
-
} | {
|
|
158
|
-
country: string;
|
|
159
|
-
addressType: "DOMESTIC";
|
|
160
|
-
administrativeArea: string;
|
|
161
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
162
|
-
} | {
|
|
163
|
-
country: string;
|
|
164
|
-
addressType: "INTERNATIONAL";
|
|
165
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
166
|
-
} | {
|
|
167
|
-
addressType: "DOMESTIC";
|
|
168
|
-
country?: string | null | undefined;
|
|
169
|
-
streetLevelDetails?: Record<string, string | null> | null | undefined;
|
|
170
|
-
administrativeArea?: string | null | undefined;
|
|
171
|
-
} | {
|
|
172
|
-
addressType: "INTERNATIONAL";
|
|
173
|
-
country?: string | null | undefined;
|
|
174
|
-
streetLevelDetails?: Record<string, string | null> | null | undefined;
|
|
175
|
-
} | {
|
|
176
|
-
path: string & import("zod").$brand<"DocumentPath">;
|
|
177
|
-
originalFilename: string;
|
|
178
|
-
type: string;
|
|
179
|
-
option: string;
|
|
180
|
-
}[] | {
|
|
181
|
-
loading: boolean;
|
|
182
|
-
data: any;
|
|
183
|
-
error?: {
|
|
184
|
-
statusCode: number;
|
|
185
|
-
message: string;
|
|
186
|
-
} | null | undefined;
|
|
187
|
-
} | {
|
|
188
|
-
data: Record<string, string>;
|
|
189
|
-
updatedAt: string;
|
|
190
|
-
} | {
|
|
191
|
-
data: any;
|
|
192
|
-
} | {
|
|
193
|
-
numericValue: number;
|
|
194
|
-
unit: string;
|
|
195
|
-
} | {
|
|
196
|
-
numericValue?: number | undefined;
|
|
197
|
-
unit?: string | undefined;
|
|
198
|
-
} | import("zod").$brand<"CustomFieldValue"> | (string & import("zod").$brand<"PlainDate">) | {
|
|
199
|
-
age: number;
|
|
200
|
-
asOfDateRef: string;
|
|
201
|
-
} | {
|
|
202
|
-
start: string & import("zod").$brand<"PlainDate">;
|
|
203
|
-
end: string & import("zod").$brand<"PlainDate">;
|
|
204
|
-
} | Record<string, string | number | boolean | {
|
|
205
|
-
path: string & import("zod").$brand<"DocumentPath">;
|
|
206
|
-
originalFilename: string;
|
|
207
|
-
type: string;
|
|
208
|
-
} | {
|
|
209
|
-
firstname: string;
|
|
210
|
-
surname: string;
|
|
211
|
-
middlename?: string | undefined;
|
|
212
|
-
} | {
|
|
213
|
-
firstname?: string | null | undefined;
|
|
214
|
-
surname?: string | null | undefined;
|
|
215
|
-
middlename?: string | null | undefined;
|
|
216
|
-
} | {
|
|
217
|
-
country: string;
|
|
218
|
-
addressType: "DOMESTIC";
|
|
219
|
-
administrativeArea: string;
|
|
220
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
221
|
-
} | {
|
|
222
|
-
country: string;
|
|
223
|
-
addressType: "INTERNATIONAL";
|
|
224
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
225
|
-
} | {
|
|
226
|
-
path: string & import("zod").$brand<"DocumentPath">;
|
|
227
|
-
originalFilename: string;
|
|
228
|
-
type: string;
|
|
229
|
-
option: string;
|
|
230
|
-
}[] | {
|
|
231
|
-
loading: boolean;
|
|
232
|
-
data: any;
|
|
233
|
-
error?: {
|
|
234
|
-
statusCode: number;
|
|
235
|
-
message: string;
|
|
236
|
-
} | null | undefined;
|
|
237
|
-
} | {
|
|
238
|
-
data: Record<string, string>;
|
|
239
|
-
updatedAt: string;
|
|
240
|
-
} | {
|
|
241
|
-
data: any;
|
|
242
|
-
} | {
|
|
243
|
-
numericValue: number;
|
|
244
|
-
unit: string;
|
|
245
|
-
} | {
|
|
246
|
-
numericValue?: number | undefined;
|
|
247
|
-
unit?: string | undefined;
|
|
248
|
-
} | import("zod").$brand<"CustomFieldValue"> | (string & import("zod").$brand<"PlainDate">) | {
|
|
249
|
-
age: number;
|
|
250
|
-
asOfDateRef: string;
|
|
251
|
-
} | {
|
|
252
|
-
start: string & import("zod").$brand<"PlainDate">;
|
|
253
|
-
end: string & import("zod").$brand<"PlainDate">;
|
|
254
|
-
} | null | undefined> | {
|
|
255
|
-
data: Record<string, string | number | boolean | {
|
|
256
|
-
path: string & import("zod").$brand<"DocumentPath">;
|
|
257
|
-
originalFilename: string;
|
|
258
|
-
type: string;
|
|
259
|
-
} | {
|
|
260
|
-
firstname: string;
|
|
261
|
-
surname: string;
|
|
262
|
-
middlename?: string | undefined;
|
|
263
|
-
} | {
|
|
264
|
-
firstname?: string | null | undefined;
|
|
265
|
-
surname?: string | null | undefined;
|
|
266
|
-
middlename?: string | null | undefined;
|
|
267
|
-
} | {
|
|
268
|
-
country: string;
|
|
269
|
-
addressType: "DOMESTIC";
|
|
270
|
-
administrativeArea: string;
|
|
271
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
272
|
-
} | {
|
|
273
|
-
country: string;
|
|
274
|
-
addressType: "INTERNATIONAL";
|
|
275
|
-
streetLevelDetails?: Record<string, string> | undefined;
|
|
276
|
-
} | {
|
|
277
|
-
path: string & import("zod").$brand<"DocumentPath">;
|
|
278
|
-
originalFilename: string;
|
|
279
|
-
type: string;
|
|
280
|
-
option: string;
|
|
281
|
-
}[] | {
|
|
282
|
-
loading: boolean;
|
|
283
|
-
data: any;
|
|
284
|
-
error?: {
|
|
285
|
-
statusCode: number;
|
|
286
|
-
message: string;
|
|
287
|
-
} | null | undefined;
|
|
288
|
-
} | {
|
|
289
|
-
data: Record<string, string>;
|
|
290
|
-
updatedAt: string;
|
|
291
|
-
} | {
|
|
292
|
-
data: any;
|
|
293
|
-
} | {
|
|
294
|
-
numericValue: number;
|
|
295
|
-
unit: string;
|
|
296
|
-
} | {
|
|
297
|
-
numericValue?: number | undefined;
|
|
298
|
-
unit?: string | undefined;
|
|
299
|
-
} | import("zod").$brand<"CustomFieldValue"> | (string & import("zod").$brand<"PlainDate">) | {
|
|
300
|
-
age: number;
|
|
301
|
-
asOfDateRef: string;
|
|
302
|
-
} | {
|
|
303
|
-
start: string & import("zod").$brand<"PlainDate">;
|
|
304
|
-
end: string & import("zod").$brand<"PlainDate">;
|
|
305
|
-
} | null | undefined>;
|
|
306
|
-
} | {
|
|
307
|
-
loading?: boolean | null | undefined;
|
|
308
|
-
error?: {
|
|
309
|
-
statusCode: number;
|
|
310
|
-
message: string;
|
|
311
|
-
} | null | undefined;
|
|
312
|
-
data?: any;
|
|
313
|
-
} | {
|
|
314
|
-
data: Record<string, string>;
|
|
315
|
-
} | null | undefined;
|
|
316
|
-
}>;
|
|
144
|
+
export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, declaration: EventState, annotation: ActionUpdate, context: ValidatorContext): Partial<Record<string, import("./FieldValue").FieldUpdateValue>>;
|
|
317
145
|
/**
|
|
318
146
|
* Merges two documents together.
|
|
319
147
|
*
|
|
@@ -205,16 +205,16 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
205
205
|
var AccessLevelOptions = z6.object({
|
|
206
206
|
accessLevel: JurisdictionFilter.optional()
|
|
207
207
|
});
|
|
208
|
-
var
|
|
208
|
+
var WorkqueueOrDashboardOptions = z6.object({
|
|
209
209
|
ids: z6.preprocess(
|
|
210
210
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
211
211
|
z6.array(z6.string())
|
|
212
|
-
).describe("Must contain a list of workqueue ids.")
|
|
212
|
+
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
213
213
|
});
|
|
214
214
|
var AllScopeOptions = z6.object({
|
|
215
215
|
...AllRecordScopeOptions.shape,
|
|
216
216
|
...AccessLevelOptions.shape,
|
|
217
|
-
...
|
|
217
|
+
...WorkqueueOrDashboardOptions.shape
|
|
218
218
|
});
|
|
219
219
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
220
220
|
var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
@@ -316,13 +316,21 @@ var Scope2 = z6.discriminatedUnion("type", [
|
|
|
316
316
|
z6.object({ type: PlainScopeType }),
|
|
317
317
|
...RecordScopeV2.options,
|
|
318
318
|
z6.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
319
|
-
z6.object({
|
|
319
|
+
z6.object({
|
|
320
|
+
type: z6.literal("workqueue"),
|
|
321
|
+
options: WorkqueueOrDashboardOptions
|
|
322
|
+
}),
|
|
323
|
+
z6.object({
|
|
324
|
+
type: z6.literal("dashboard.view"),
|
|
325
|
+
options: WorkqueueOrDashboardOptions
|
|
326
|
+
})
|
|
320
327
|
]);
|
|
321
328
|
var ScopeType2 = z6.enum([
|
|
322
329
|
...SystemScopeType.options,
|
|
323
330
|
...RecordScopeTypeV2.options,
|
|
324
331
|
...PlainScopeType.options,
|
|
325
|
-
"workqueue"
|
|
332
|
+
"workqueue",
|
|
333
|
+
"dashboard.view"
|
|
326
334
|
]);
|
|
327
335
|
var EncodedScope2 = z6.string().brand("EncodedScope");
|
|
328
336
|
var DEFAULT_SCOPE_OPTIONS = {
|
package/dist/events/index.js
CHANGED
|
@@ -64,6 +64,8 @@ __export(events_exports, {
|
|
|
64
64
|
AssignmentStatus: () => AssignmentStatus,
|
|
65
65
|
AsyncRejectActionDocument: () => AsyncRejectActionDocument,
|
|
66
66
|
AuditLogEntrySchema: () => AuditLogEntrySchema,
|
|
67
|
+
AutocompleteUpdateValue: () => AutocompleteUpdateValue,
|
|
68
|
+
AutocompleteValue: () => AutocompleteValue,
|
|
67
69
|
BaseActionInput: () => BaseActionInput,
|
|
68
70
|
BearerTokenByUserType: () => BearerTokenByUserType,
|
|
69
71
|
ButtonFieldValue: () => ButtonFieldValue,
|
|
@@ -330,6 +332,7 @@ __export(events_exports, {
|
|
|
330
332
|
isAddressFieldType: () => isAddressFieldType,
|
|
331
333
|
isAdministrativeAreaFieldType: () => isAdministrativeAreaFieldType,
|
|
332
334
|
isAgeFieldType: () => isAgeFieldType,
|
|
335
|
+
isAutocompleteFieldType: () => isAutocompleteFieldType,
|
|
333
336
|
isBulletListFieldType: () => isBulletListFieldType,
|
|
334
337
|
isButtonFieldType: () => isButtonFieldType,
|
|
335
338
|
isCheckboxFieldType: () => isCheckboxFieldType,
|
|
@@ -509,16 +512,16 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
509
512
|
var AccessLevelOptions = z2.object({
|
|
510
513
|
accessLevel: JurisdictionFilter.optional()
|
|
511
514
|
});
|
|
512
|
-
var
|
|
515
|
+
var WorkqueueOrDashboardOptions = z2.object({
|
|
513
516
|
ids: z2.preprocess(
|
|
514
517
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
515
518
|
z2.array(z2.string())
|
|
516
|
-
).describe("Must contain a list of workqueue ids.")
|
|
519
|
+
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
517
520
|
});
|
|
518
521
|
var AllScopeOptions = z2.object({
|
|
519
522
|
...AllRecordScopeOptions.shape,
|
|
520
523
|
...AccessLevelOptions.shape,
|
|
521
|
-
...
|
|
524
|
+
...WorkqueueOrDashboardOptions.shape
|
|
522
525
|
});
|
|
523
526
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
524
527
|
var ResolvedScopeOptionsPlaceEvent = z2.object({
|
|
@@ -632,13 +635,21 @@ var Scope = z2.discriminatedUnion("type", [
|
|
|
632
635
|
z2.object({ type: PlainScopeType }),
|
|
633
636
|
...RecordScopeV2.options,
|
|
634
637
|
z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
635
|
-
z2.object({
|
|
638
|
+
z2.object({
|
|
639
|
+
type: z2.literal("workqueue"),
|
|
640
|
+
options: WorkqueueOrDashboardOptions
|
|
641
|
+
}),
|
|
642
|
+
z2.object({
|
|
643
|
+
type: z2.literal("dashboard.view"),
|
|
644
|
+
options: WorkqueueOrDashboardOptions
|
|
645
|
+
})
|
|
636
646
|
]);
|
|
637
647
|
var ScopeType = z2.enum([
|
|
638
648
|
...SystemScopeType.options,
|
|
639
649
|
...RecordScopeTypeV2.options,
|
|
640
650
|
...PlainScopeType.options,
|
|
641
|
-
"workqueue"
|
|
651
|
+
"workqueue",
|
|
652
|
+
"dashboard.view"
|
|
642
653
|
]);
|
|
643
654
|
var unflattenScope = (input) => {
|
|
644
655
|
const { type, ...options } = input;
|
|
@@ -1088,6 +1099,7 @@ var FieldType = {
|
|
|
1088
1099
|
SIGNATURE: "SIGNATURE",
|
|
1089
1100
|
DATA: "DATA",
|
|
1090
1101
|
BUTTON: "BUTTON",
|
|
1102
|
+
AUTOCOMPLETE: "AUTOCOMPLETE",
|
|
1091
1103
|
SEARCH: "SEARCH",
|
|
1092
1104
|
ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON",
|
|
1093
1105
|
HTTP: "HTTP",
|
|
@@ -1273,6 +1285,11 @@ var AgeValue = z12.object({
|
|
|
1273
1285
|
asOfDateRef: z12.string()
|
|
1274
1286
|
});
|
|
1275
1287
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
1288
|
+
var AutocompleteValue = z12.object({
|
|
1289
|
+
label: z12.string(),
|
|
1290
|
+
value: z12.string()
|
|
1291
|
+
});
|
|
1292
|
+
var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
|
|
1276
1293
|
var TimeValue = z12.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
1277
1294
|
var DatetimeValue = z12.iso.datetime();
|
|
1278
1295
|
var SelectDateRangeValue = z12.enum([
|
|
@@ -1319,7 +1336,9 @@ var LeafFieldValues = z12.union([
|
|
|
1319
1336
|
IdReaderFieldValue,
|
|
1320
1337
|
NumberWithUnitFieldValue,
|
|
1321
1338
|
NumberWithUnitFieldUpdateValue,
|
|
1322
|
-
CustomFieldValue
|
|
1339
|
+
CustomFieldValue,
|
|
1340
|
+
AutocompleteValue,
|
|
1341
|
+
AutocompleteUpdateValue
|
|
1323
1342
|
]);
|
|
1324
1343
|
var FieldGroupValue = z12.record(z12.string(), LeafFieldValues);
|
|
1325
1344
|
var DataFieldValue = z12.object({
|
|
@@ -1401,7 +1420,8 @@ var FieldUpdateValue = safeUnion([
|
|
|
1401
1420
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
1402
1421
|
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
1403
1422
|
CustomFieldValue.describe("CustomFieldValue"),
|
|
1404
|
-
HiddenFieldValue.describe("HiddenFieldValue")
|
|
1423
|
+
HiddenFieldValue.describe("HiddenFieldValue"),
|
|
1424
|
+
AutocompleteUpdateValue.describe("AutocompleteUpdateValue")
|
|
1405
1425
|
]);
|
|
1406
1426
|
|
|
1407
1427
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
@@ -1980,8 +2000,8 @@ var QueryExpression = import_v4.z.object({
|
|
|
1980
2000
|
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1981
2001
|
"legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
|
|
1982
2002
|
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1983
|
-
createdAtLocation: import_v4.z.optional(Within),
|
|
1984
|
-
updatedAtLocation: import_v4.z.optional(Within),
|
|
2003
|
+
createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
2004
|
+
updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1985
2005
|
assignedTo: import_v4.z.optional(Exact),
|
|
1986
2006
|
createdByUserType: import_v4.z.optional(ExactUserType),
|
|
1987
2007
|
updatedByUserRole: import_v4.z.optional(Exact),
|
|
@@ -2318,17 +2338,14 @@ var ImageViewField = BaseField.extend({
|
|
|
2318
2338
|
}).describe("A read-only image component for form pages");
|
|
2319
2339
|
var Paragraph = BaseField.extend({
|
|
2320
2340
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
2321
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2322
2341
|
configuration: ParagraphConfiguration
|
|
2323
2342
|
}).describe("A read-only HTML <p> paragraph");
|
|
2324
2343
|
var Heading = BaseField.extend({
|
|
2325
2344
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
2326
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2327
2345
|
configuration: HeadingConfiguration
|
|
2328
2346
|
}).describe("A read-only heading component for form pages");
|
|
2329
2347
|
var PageHeader = BaseField.extend({
|
|
2330
|
-
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2331
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
2348
|
+
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2332
2349
|
}).describe("A read-only header component for form pages");
|
|
2333
2350
|
var File = BaseField.extend({
|
|
2334
2351
|
type: import_v43.default.literal(FieldType.FILE),
|
|
@@ -2378,7 +2395,6 @@ var RadioGroup = BaseField.extend({
|
|
|
2378
2395
|
}).describe("Grouped radio options");
|
|
2379
2396
|
var BulletList = BaseField.extend({
|
|
2380
2397
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
2381
|
-
defaultValue: TextValue.optional(),
|
|
2382
2398
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
2383
2399
|
configuration: import_v43.default.object({
|
|
2384
2400
|
styles: import_v43.default.object({
|
|
@@ -2560,16 +2576,32 @@ var DataField = BaseField.extend({
|
|
|
2560
2576
|
data: import_v43.default.array(DataEntry)
|
|
2561
2577
|
})
|
|
2562
2578
|
}).describe("Data field for displaying read-only data");
|
|
2579
|
+
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2580
|
+
var ButtonType = import_v43.default.enum([
|
|
2581
|
+
"primary",
|
|
2582
|
+
"secondary",
|
|
2583
|
+
"tertiary",
|
|
2584
|
+
"positive",
|
|
2585
|
+
"negative",
|
|
2586
|
+
"secondaryNegative",
|
|
2587
|
+
"icon",
|
|
2588
|
+
"iconPrimary"
|
|
2589
|
+
]);
|
|
2590
|
+
var TextColor = import_v43.default.enum(["primary", "copy"]);
|
|
2591
|
+
var TextVariant = import_v43.default.enum(["bold14", "reg14"]);
|
|
2592
|
+
var ButtonConfiguration = import_v43.default.object({
|
|
2593
|
+
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit."),
|
|
2594
|
+
loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2595
|
+
buttonSize: ButtonSize.optional().describe("Size of the button."),
|
|
2596
|
+
buttonType: ButtonType.optional().describe("Type of the button."),
|
|
2597
|
+
textColor: TextColor.optional().describe("Color of the text."),
|
|
2598
|
+
textVariant: TextVariant.optional().describe("Variant of the text."),
|
|
2599
|
+
text: TranslationConfig.describe("Text to display on the button")
|
|
2600
|
+
});
|
|
2563
2601
|
var ButtonField = BaseField.extend({
|
|
2564
2602
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2565
2603
|
defaultValue: ButtonFieldValue.optional(),
|
|
2566
|
-
configuration:
|
|
2567
|
-
icon: import_v43.default.string().optional().describe(
|
|
2568
|
-
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
2569
|
-
),
|
|
2570
|
-
loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2571
|
-
text: TranslationConfig.describe("Text to display on the button")
|
|
2572
|
-
})
|
|
2604
|
+
configuration: ButtonConfiguration
|
|
2573
2605
|
}).describe("Generic button without any built-in functionality");
|
|
2574
2606
|
var FieldGroup = BaseField.extend({
|
|
2575
2607
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
@@ -2601,6 +2633,19 @@ var HttpField = BaseField.extend({
|
|
|
2601
2633
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2602
2634
|
})
|
|
2603
2635
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
2636
|
+
var AutocompleteField = BaseField.extend({
|
|
2637
|
+
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2638
|
+
configuration: import_v43.default.object({
|
|
2639
|
+
url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
|
|
2640
|
+
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2641
|
+
defaultOptions: import_v43.default.array(
|
|
2642
|
+
import_v43.default.object({
|
|
2643
|
+
label: import_v43.default.string(),
|
|
2644
|
+
value: import_v43.default.string()
|
|
2645
|
+
})
|
|
2646
|
+
).optional()
|
|
2647
|
+
})
|
|
2648
|
+
}).describe("Autocomplete input field");
|
|
2604
2649
|
var SearchField = HttpField.extend({
|
|
2605
2650
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2606
2651
|
configuration: SearchQuery.pick({
|
|
@@ -2686,8 +2731,11 @@ var CustomField = BaseField.extend({
|
|
|
2686
2731
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2687
2732
|
configuration: import_v43.default.unknown().optional()
|
|
2688
2733
|
});
|
|
2734
|
+
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2689
2735
|
var LoaderField = BaseField.extend({
|
|
2690
2736
|
type: import_v43.default.literal(FieldType.LOADER),
|
|
2737
|
+
variant: FieldStyleVariant.default("default").optional(),
|
|
2738
|
+
hideLabel: import_v43.default.boolean().default(true).optional().describe("Loader field does not show a label by default"),
|
|
2691
2739
|
configuration: import_v43.default.object({
|
|
2692
2740
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2693
2741
|
})
|
|
@@ -2744,6 +2792,7 @@ var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
|
2744
2792
|
ButtonField,
|
|
2745
2793
|
AlphaPrintButton,
|
|
2746
2794
|
HttpField,
|
|
2795
|
+
AutocompleteField,
|
|
2747
2796
|
LinkButtonField,
|
|
2748
2797
|
VerificationStatus,
|
|
2749
2798
|
QrReaderField,
|
|
@@ -3370,6 +3419,9 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
3370
3419
|
case FieldType.ALPHA_PRINT_BUTTON:
|
|
3371
3420
|
schema = TextValue;
|
|
3372
3421
|
break;
|
|
3422
|
+
case FieldType.AUTOCOMPLETE:
|
|
3423
|
+
schema = AutocompleteValue;
|
|
3424
|
+
break;
|
|
3373
3425
|
case FieldType.HTTP:
|
|
3374
3426
|
case FieldType.SEARCH:
|
|
3375
3427
|
schema = HttpFieldUpdateValue;
|
|
@@ -3430,6 +3482,7 @@ function mapFieldTypeToEmptyValue(field3) {
|
|
|
3430
3482
|
case FieldType.BUTTON:
|
|
3431
3483
|
case FieldType.ALPHA_PRINT_BUTTON:
|
|
3432
3484
|
case FieldType.HTTP:
|
|
3485
|
+
case FieldType.AUTOCOMPLETE:
|
|
3433
3486
|
case FieldType.SEARCH:
|
|
3434
3487
|
case FieldType.LINK_BUTTON:
|
|
3435
3488
|
case FieldType.QUERY_PARAM_READER:
|
|
@@ -3569,6 +3622,9 @@ var isPrintButtonFieldType = (field3) => {
|
|
|
3569
3622
|
var isHttpFieldType = (field3) => {
|
|
3570
3623
|
return field3.config.type === FieldType.HTTP;
|
|
3571
3624
|
};
|
|
3625
|
+
var isAutocompleteFieldType = (field3) => {
|
|
3626
|
+
return field3.config.type === FieldType.AUTOCOMPLETE;
|
|
3627
|
+
};
|
|
3572
3628
|
var isSearchFieldType = (field3) => {
|
|
3573
3629
|
return field3.config.type === FieldType.SEARCH;
|
|
3574
3630
|
};
|
|
@@ -4212,16 +4268,17 @@ function isPageVisible(page, formValues, context) {
|
|
|
4212
4268
|
}
|
|
4213
4269
|
return isConditionMet(page.conditional, formValues, context);
|
|
4214
4270
|
}
|
|
4215
|
-
function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false) {
|
|
4271
|
+
function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false, declarationContext) {
|
|
4216
4272
|
const base = (0, import_lodash.cloneDeep)(formValues);
|
|
4217
4273
|
function fn(prevVisibilityContext) {
|
|
4274
|
+
const visibilityForm = declarationContext ? { ...declarationContext, ...prevVisibilityContext } : prevVisibilityContext;
|
|
4218
4275
|
const cleaned = (0, import_lodash.omitBy)(base, (value, fieldId) => {
|
|
4219
4276
|
const fieldConfig = fields.filter((f) => f.id === fieldId);
|
|
4220
4277
|
if (!fieldConfig.length) {
|
|
4221
4278
|
return false;
|
|
4222
4279
|
}
|
|
4223
4280
|
const isHidden = fieldConfig.every(
|
|
4224
|
-
(f) => !isFieldVisible(f,
|
|
4281
|
+
(f) => !isFieldVisible(f, visibilityForm, validatorContext)
|
|
4225
4282
|
);
|
|
4226
4283
|
if (!isHidden) {
|
|
4227
4284
|
return false;
|
|
@@ -4288,8 +4345,10 @@ function omitHiddenAnnotationFields(actionConfig, declaration, annotation, conte
|
|
|
4288
4345
|
const annotationFields = getActionAnnotationFields(actionConfig);
|
|
4289
4346
|
return omitHiddenFields(
|
|
4290
4347
|
annotationFields,
|
|
4291
|
-
|
|
4292
|
-
context
|
|
4348
|
+
annotation,
|
|
4349
|
+
context,
|
|
4350
|
+
false,
|
|
4351
|
+
declaration
|
|
4293
4352
|
);
|
|
4294
4353
|
}
|
|
4295
4354
|
function deepMerge(currentDocument, actionDocument) {
|
|
@@ -5544,8 +5603,12 @@ var SerializedQueryExpression = z35.object({
|
|
|
5544
5603
|
"legalStatuses.REGISTERED.createdAtLocation": z35.optional(SerializableWithin),
|
|
5545
5604
|
"legalStatuses.REGISTERED.createdByRole": z35.optional(AnyOf),
|
|
5546
5605
|
"legalStatuses.REGISTERED.registrationNumber": z35.optional(Exact),
|
|
5547
|
-
createdAtLocation: z35.optional(
|
|
5548
|
-
|
|
5606
|
+
createdAtLocation: z35.optional(
|
|
5607
|
+
z35.union([SerializableWithin, SerializableExact])
|
|
5608
|
+
),
|
|
5609
|
+
updatedAtLocation: z35.optional(
|
|
5610
|
+
z35.union([SerializableWithin, SerializableExact])
|
|
5611
|
+
),
|
|
5549
5612
|
updatedByUserRole: z35.optional(SerializableExact),
|
|
5550
5613
|
assignedTo: z35.optional(SerializableExact),
|
|
5551
5614
|
createdBy: z35.optional(SerializableExact),
|
|
@@ -5732,7 +5795,20 @@ function defineWorkqueue(workqueueInput) {
|
|
|
5732
5795
|
const query = "type" in queryInput ? queryInput : { type: "and", clauses: [queryInput] };
|
|
5733
5796
|
return WorkqueueConfig.parse({ ...workqueueInput, query });
|
|
5734
5797
|
}
|
|
5798
|
+
function warnOnConfigurationIssues(workqueue) {
|
|
5799
|
+
if (workqueue.actions) {
|
|
5800
|
+
console.warn(
|
|
5801
|
+
`
|
|
5802
|
+
************** WARNING **************
|
|
5803
|
+
'actions' property is deprecated, but used on workqueue: '${workqueue.slug}'.
|
|
5804
|
+
Use 'action' property instead!
|
|
5805
|
+
************** WARNING **************
|
|
5806
|
+
`
|
|
5807
|
+
);
|
|
5808
|
+
}
|
|
5809
|
+
}
|
|
5735
5810
|
function defineWorkqueues(workqueues) {
|
|
5811
|
+
workqueues.forEach(warnOnConfigurationIssues);
|
|
5736
5812
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
|
5737
5813
|
}
|
|
5738
5814
|
var WorkqueueCountInput = z37.array(
|
|
@@ -6467,7 +6543,7 @@ var IGNORED_EVENT_TYPES = [
|
|
|
6467
6543
|
"digital-identity",
|
|
6468
6544
|
"event-with-optional-address"
|
|
6469
6545
|
];
|
|
6470
|
-
function
|
|
6546
|
+
function warnOnConfigurationIssues2(config) {
|
|
6471
6547
|
const eventId = config.id;
|
|
6472
6548
|
if (IGNORED_EVENT_TYPES.includes(eventId)) {
|
|
6473
6549
|
return;
|
|
@@ -6490,7 +6566,7 @@ function warnOnConfigurationIssues(config) {
|
|
|
6490
6566
|
}
|
|
6491
6567
|
var defineConfig = (config) => {
|
|
6492
6568
|
const input = EventConfig.parse(config);
|
|
6493
|
-
|
|
6569
|
+
warnOnConfigurationIssues2(input);
|
|
6494
6570
|
return input;
|
|
6495
6571
|
};
|
|
6496
6572
|
|
|
@@ -9055,6 +9131,7 @@ function mapFieldTypeToMockValue(field3, i, rng, administrativeHierarchy) {
|
|
|
9055
9131
|
type: "image/png"
|
|
9056
9132
|
};
|
|
9057
9133
|
case FieldType.SEARCH:
|
|
9134
|
+
case FieldType.AUTOCOMPLETE:
|
|
9058
9135
|
case FieldType.HTTP:
|
|
9059
9136
|
return {
|
|
9060
9137
|
error: null,
|
|
@@ -9938,12 +10015,44 @@ function userDeserializer(serializedUserField, user2) {
|
|
|
9938
10015
|
function isDefined(value) {
|
|
9939
10016
|
return value !== void 0;
|
|
9940
10017
|
}
|
|
10018
|
+
function serializeLocationField(expression, user2) {
|
|
10019
|
+
if (expression.type === "exact") {
|
|
10020
|
+
return userDeserializer(expression.term, user2);
|
|
10021
|
+
}
|
|
10022
|
+
if (expression.type === "within") {
|
|
10023
|
+
return userDeserializer(expression.location, user2);
|
|
10024
|
+
}
|
|
10025
|
+
return void 0;
|
|
10026
|
+
}
|
|
10027
|
+
function deserializeExpression(expression, user2) {
|
|
10028
|
+
if (expression.type === "exact") {
|
|
10029
|
+
const term = userDeserializer(expression.term, user2);
|
|
10030
|
+
if (!term) {
|
|
10031
|
+
return void 0;
|
|
10032
|
+
}
|
|
10033
|
+
return {
|
|
10034
|
+
...expression,
|
|
10035
|
+
term
|
|
10036
|
+
};
|
|
10037
|
+
}
|
|
10038
|
+
if (expression.type === "within") {
|
|
10039
|
+
const location = userDeserializer(expression.location, user2);
|
|
10040
|
+
if (!location) {
|
|
10041
|
+
return void 0;
|
|
10042
|
+
}
|
|
10043
|
+
return {
|
|
10044
|
+
...expression,
|
|
10045
|
+
location
|
|
10046
|
+
};
|
|
10047
|
+
}
|
|
10048
|
+
return void 0;
|
|
10049
|
+
}
|
|
9941
10050
|
function deserializeQueryExpression(expression, user2) {
|
|
9942
10051
|
const assignedTo = expression.assignedTo ? userDeserializer(expression.assignedTo.term, user2) : void 0;
|
|
9943
10052
|
const createdBy = expression.createdBy ? userDeserializer(expression.createdBy.term, user2) : void 0;
|
|
9944
10053
|
const updatedBy = expression.updatedBy ? userDeserializer(expression.updatedBy.term, user2) : void 0;
|
|
9945
|
-
const createdAtLocation = expression.createdAtLocation ?
|
|
9946
|
-
const updatedAtLocation = expression.updatedAtLocation ?
|
|
10054
|
+
const createdAtLocation = expression.createdAtLocation ? serializeLocationField(expression.createdAtLocation, user2) : void 0;
|
|
10055
|
+
const updatedAtLocation = expression.updatedAtLocation ? serializeLocationField(expression.updatedAtLocation, user2) : void 0;
|
|
9947
10056
|
const updatedByUserRole = expression.updatedByUserRole ? userDeserializer(expression.updatedByUserRole.term, user2) : void 0;
|
|
9948
10057
|
const declaredLocation = expression["legalStatuses.DECLARED.createdAtLocation"] ? userDeserializer(
|
|
9949
10058
|
expression["legalStatuses.DECLARED.createdAtLocation"].location,
|
|
@@ -9962,8 +10071,8 @@ function deserializeQueryExpression(expression, user2) {
|
|
|
9962
10071
|
...expression.updatedByUserRole,
|
|
9963
10072
|
term: updatedByUserRole
|
|
9964
10073
|
} : void 0,
|
|
9965
|
-
createdAtLocation: expression.createdAtLocation && isDefined(createdAtLocation) ?
|
|
9966
|
-
updatedAtLocation: expression.updatedAtLocation && isDefined(updatedAtLocation) ?
|
|
10074
|
+
createdAtLocation: expression.createdAtLocation && isDefined(createdAtLocation) ? deserializeExpression(expression.createdAtLocation, user2) : void 0,
|
|
10075
|
+
updatedAtLocation: expression.updatedAtLocation && isDefined(updatedAtLocation) ? deserializeExpression(expression.updatedAtLocation, user2) : void 0,
|
|
9967
10076
|
["legalStatuses.DECLARED.createdAtLocation"]: expression["legalStatuses.DECLARED.createdAtLocation"] && isDefined(declaredLocation) ? {
|
|
9968
10077
|
...expression["legalStatuses.DECLARED.createdAtLocation"],
|
|
9969
10078
|
location: declaredLocation
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-birth-certificate-issuance-flag.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/add-birth-certificate-issuance-flag.ts"],"names":[],"mappings":"AA6aA,iBAAe,IAAI,kBAiDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|