@opencrvs/toolkit 2.0.0-rc.f58809d → 2.0.0-rc.f5b6bcb
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/dist/application-config/index.js +192 -60
- package/dist/cli.js +95 -6
- package/dist/commons/api/router.d.ts +347 -31
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +0 -2
- package/dist/events/index.js +203 -94
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +93 -4
- package/dist/notification/index.js +203 -78
- package/opencrvs-toolkit-2.0.0-rc.f5b6bcb.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.f58809d.tgz +0 -0
package/dist/events/index.js
CHANGED
|
@@ -306,7 +306,6 @@ __export(events_exports, {
|
|
|
306
306
|
getAllUniqueFields: () => getAllUniqueFields,
|
|
307
307
|
getAnnotationFromDrafts: () => getAnnotationFromDrafts,
|
|
308
308
|
getAssignedUserFromActions: () => getAssignedUserFromActions,
|
|
309
|
-
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
|
310
309
|
getAssignmentStatus: () => getAssignmentStatus,
|
|
311
310
|
getAvailableActionsForEvent: () => getAvailableActionsForEvent,
|
|
312
311
|
getAvailableRolesForUserUpdatePayload: () => getAvailableRolesForUserUpdatePayload,
|
|
@@ -1078,7 +1077,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
1078
1077
|
ShowConditional,
|
|
1079
1078
|
// Action can be shown to the user in the list but as disabled
|
|
1080
1079
|
EnableConditional
|
|
1081
|
-
])
|
|
1080
|
+
]).meta({
|
|
1081
|
+
description: "Action conditional configuration",
|
|
1082
|
+
id: "ActionConditional"
|
|
1083
|
+
});
|
|
1082
1084
|
var DisplayOnReviewConditional = z7.object({
|
|
1083
1085
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
1084
1086
|
conditional: Conditional
|
|
@@ -1737,6 +1739,9 @@ var FlagConfig = z15.object({
|
|
|
1737
1739
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1738
1740
|
),
|
|
1739
1741
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1742
|
+
}).meta({
|
|
1743
|
+
description: "Flag configuration",
|
|
1744
|
+
id: "FlagConfig"
|
|
1740
1745
|
});
|
|
1741
1746
|
var ActionFlagConfig = z15.object({
|
|
1742
1747
|
id: Flag,
|
|
@@ -1744,6 +1749,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1744
1749
|
conditional: Conditional.optional().describe(
|
|
1745
1750
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1746
1751
|
)
|
|
1752
|
+
}).meta({
|
|
1753
|
+
description: "Action flag configuration",
|
|
1754
|
+
id: "ActionFlagConfig"
|
|
1747
1755
|
});
|
|
1748
1756
|
|
|
1749
1757
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1765,8 +1773,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1765
1773
|
),
|
|
1766
1774
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1767
1775
|
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1768
|
-
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1769
|
-
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1776
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1770
1777
|
});
|
|
1771
1778
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1772
1779
|
registrationNumber: z16.string().describe(
|
|
@@ -1794,9 +1801,6 @@ var EventMetadata = z16.object({
|
|
|
1794
1801
|
createdAtLocation: UUID.nullish().describe(
|
|
1795
1802
|
"Location of the user who created the event."
|
|
1796
1803
|
),
|
|
1797
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1798
|
-
"Signature of the user who created the event."
|
|
1799
|
-
),
|
|
1800
1804
|
updatedAtLocation: UUID.nullish().describe(
|
|
1801
1805
|
"Location of the user who last changed the status."
|
|
1802
1806
|
),
|
|
@@ -2171,7 +2175,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
2171
2175
|
}
|
|
2172
2176
|
}).describe("Unique identifier for the field");
|
|
2173
2177
|
var FieldReference = import_v43.default.object({
|
|
2174
|
-
$$field: FieldId,
|
|
2178
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
2175
2179
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
2176
2180
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
2177
2181
|
)
|
|
@@ -2217,6 +2221,9 @@ var BaseField = import_v43.default.object({
|
|
|
2217
2221
|
}).describe("Common properties shared across all field types.");
|
|
2218
2222
|
var Divider = BaseField.extend({
|
|
2219
2223
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
2224
|
+
}).meta({
|
|
2225
|
+
description: "A horizontal line divider",
|
|
2226
|
+
id: "Divider"
|
|
2220
2227
|
});
|
|
2221
2228
|
var TextField = BaseField.extend({
|
|
2222
2229
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -2227,7 +2234,10 @@ var TextField = BaseField.extend({
|
|
|
2227
2234
|
prefix: TranslationConfig.optional(),
|
|
2228
2235
|
postfix: TranslationConfig.optional()
|
|
2229
2236
|
}).default({ type: "text" }).optional()
|
|
2230
|
-
}).
|
|
2237
|
+
}).meta({
|
|
2238
|
+
description: "A text input field",
|
|
2239
|
+
id: "TextField"
|
|
2240
|
+
});
|
|
2231
2241
|
var NumberField = BaseField.extend({
|
|
2232
2242
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
2233
2243
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -2237,7 +2247,10 @@ var NumberField = BaseField.extend({
|
|
|
2237
2247
|
prefix: TranslationConfig.optional(),
|
|
2238
2248
|
postfix: TranslationConfig.optional()
|
|
2239
2249
|
}).optional()
|
|
2240
|
-
}).
|
|
2250
|
+
}).meta({
|
|
2251
|
+
description: "A number input field",
|
|
2252
|
+
id: "NumberField"
|
|
2253
|
+
});
|
|
2241
2254
|
var TextAreaField = BaseField.extend({
|
|
2242
2255
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
2243
2256
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -2248,7 +2261,10 @@ var TextAreaField = BaseField.extend({
|
|
|
2248
2261
|
prefix: TranslationConfig.optional(),
|
|
2249
2262
|
postfix: TranslationConfig.optional()
|
|
2250
2263
|
}).default({ rows: 4 }).optional()
|
|
2251
|
-
}).
|
|
2264
|
+
}).meta({
|
|
2265
|
+
description: "A multiline text input",
|
|
2266
|
+
id: "TextAreaField"
|
|
2267
|
+
});
|
|
2252
2268
|
var ImageMimeType = import_v43.default.enum([
|
|
2253
2269
|
"image/png",
|
|
2254
2270
|
"image/jpg",
|
|
@@ -2278,13 +2294,19 @@ var SignatureField = BaseField.extend({
|
|
|
2278
2294
|
}).default({
|
|
2279
2295
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2280
2296
|
})
|
|
2281
|
-
}).
|
|
2297
|
+
}).meta({
|
|
2298
|
+
description: "A signature input field",
|
|
2299
|
+
id: "SignatureField"
|
|
2300
|
+
});
|
|
2282
2301
|
var EmailField = BaseField.extend({
|
|
2283
2302
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
2284
2303
|
configuration: import_v43.default.object({
|
|
2285
2304
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
2286
2305
|
}).default({ maxLength: 255 }).optional(),
|
|
2287
2306
|
defaultValue: NonEmptyTextValue.optional()
|
|
2307
|
+
}).meta({
|
|
2308
|
+
description: "An email input field",
|
|
2309
|
+
id: "EmailField"
|
|
2288
2310
|
});
|
|
2289
2311
|
var DateField = BaseField.extend({
|
|
2290
2312
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -2294,7 +2316,10 @@ var DateField = BaseField.extend({
|
|
|
2294
2316
|
"Text to display above the date input"
|
|
2295
2317
|
).optional()
|
|
2296
2318
|
}).optional()
|
|
2297
|
-
}).
|
|
2319
|
+
}).meta({
|
|
2320
|
+
description: "A date input (yyyy-MM-dd)",
|
|
2321
|
+
id: "DateField"
|
|
2322
|
+
});
|
|
2298
2323
|
var AgeField = BaseField.extend({
|
|
2299
2324
|
type: import_v43.default.literal(FieldType.AGE),
|
|
2300
2325
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -2303,7 +2328,10 @@ var AgeField = BaseField.extend({
|
|
|
2303
2328
|
prefix: TranslationConfig.optional(),
|
|
2304
2329
|
postfix: TranslationConfig.optional()
|
|
2305
2330
|
})
|
|
2306
|
-
}).
|
|
2331
|
+
}).meta({
|
|
2332
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
2333
|
+
id: "AgeField"
|
|
2334
|
+
});
|
|
2307
2335
|
var TimeField = BaseField.extend({
|
|
2308
2336
|
type: import_v43.default.literal(FieldType.TIME),
|
|
2309
2337
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -2313,7 +2341,10 @@ var TimeField = BaseField.extend({
|
|
|
2313
2341
|
"Text to display above the time input"
|
|
2314
2342
|
).optional()
|
|
2315
2343
|
}).optional()
|
|
2316
|
-
}).
|
|
2344
|
+
}).meta({
|
|
2345
|
+
description: "A single time input (HH-mm)",
|
|
2346
|
+
id: "TimeField"
|
|
2347
|
+
});
|
|
2317
2348
|
var DateRangeField = BaseField.extend({
|
|
2318
2349
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
2319
2350
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -2322,7 +2353,10 @@ var DateRangeField = BaseField.extend({
|
|
|
2322
2353
|
"Text to display above the date input"
|
|
2323
2354
|
).optional()
|
|
2324
2355
|
}).optional()
|
|
2325
|
-
}).
|
|
2356
|
+
}).meta({
|
|
2357
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
2358
|
+
id: "DateRangeField"
|
|
2359
|
+
});
|
|
2326
2360
|
var HtmlFontVariant = import_v43.default.enum([
|
|
2327
2361
|
"reg12",
|
|
2328
2362
|
"reg14",
|
|
@@ -2366,18 +2400,30 @@ var ImageViewField = BaseField.extend({
|
|
|
2366
2400
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
2367
2401
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2368
2402
|
configuration: ImageConfiguration
|
|
2369
|
-
}).
|
|
2403
|
+
}).meta({
|
|
2404
|
+
description: "A read-only image component for form pages",
|
|
2405
|
+
id: "ImageViewField"
|
|
2406
|
+
});
|
|
2370
2407
|
var Paragraph = BaseField.extend({
|
|
2371
2408
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
2372
2409
|
configuration: ParagraphConfiguration
|
|
2373
|
-
}).
|
|
2410
|
+
}).meta({
|
|
2411
|
+
description: "A read-only HTML <p> paragraph",
|
|
2412
|
+
id: "Paragraph"
|
|
2413
|
+
});
|
|
2374
2414
|
var Heading = BaseField.extend({
|
|
2375
2415
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
2376
2416
|
configuration: HeadingConfiguration
|
|
2377
|
-
}).
|
|
2417
|
+
}).meta({
|
|
2418
|
+
description: "A read-only heading component for form pages",
|
|
2419
|
+
id: "Heading"
|
|
2420
|
+
});
|
|
2378
2421
|
var PageHeader = BaseField.extend({
|
|
2379
2422
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2380
|
-
}).
|
|
2423
|
+
}).meta({
|
|
2424
|
+
description: "A read-only header component for form pages",
|
|
2425
|
+
id: "PageHeader"
|
|
2426
|
+
});
|
|
2381
2427
|
var File = BaseField.extend({
|
|
2382
2428
|
type: import_v43.default.literal(FieldType.FILE),
|
|
2383
2429
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -2396,7 +2442,10 @@ var File = BaseField.extend({
|
|
|
2396
2442
|
}).default({
|
|
2397
2443
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2398
2444
|
})
|
|
2399
|
-
}).
|
|
2445
|
+
}).meta({
|
|
2446
|
+
description: "A file upload field",
|
|
2447
|
+
id: "File"
|
|
2448
|
+
});
|
|
2400
2449
|
var SelectOption = import_v43.default.object({
|
|
2401
2450
|
value: import_v43.default.string().describe("The value of the option"),
|
|
2402
2451
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -2413,7 +2462,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
2413
2462
|
"Placeholder for the number field"
|
|
2414
2463
|
)
|
|
2415
2464
|
}).optional()
|
|
2416
|
-
}).
|
|
2465
|
+
}).meta({
|
|
2466
|
+
description: "A number with unit input field",
|
|
2467
|
+
id: "NumberWithUnitField"
|
|
2468
|
+
});
|
|
2417
2469
|
var RadioGroup = BaseField.extend({
|
|
2418
2470
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
2419
2471
|
defaultValue: TextValue.optional(),
|
|
@@ -2423,7 +2475,10 @@ var RadioGroup = BaseField.extend({
|
|
|
2423
2475
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
2424
2476
|
}).optional()
|
|
2425
2477
|
}).optional()
|
|
2426
|
-
}).
|
|
2478
|
+
}).meta({
|
|
2479
|
+
description: "A grouped radio button field",
|
|
2480
|
+
id: "RadioGroup"
|
|
2481
|
+
});
|
|
2427
2482
|
var BulletList = BaseField.extend({
|
|
2428
2483
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
2429
2484
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -2432,7 +2487,10 @@ var BulletList = BaseField.extend({
|
|
|
2432
2487
|
fontVariant: HtmlFontVariant.optional()
|
|
2433
2488
|
}).optional()
|
|
2434
2489
|
}).default({})
|
|
2435
|
-
}).
|
|
2490
|
+
}).meta({
|
|
2491
|
+
description: "A list of bullet points",
|
|
2492
|
+
id: "BulletList"
|
|
2493
|
+
});
|
|
2436
2494
|
var Select = BaseField.extend({
|
|
2437
2495
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
2438
2496
|
defaultValue: TextValue.optional(),
|
|
@@ -2447,7 +2505,10 @@ var Select = BaseField.extend({
|
|
|
2447
2505
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
2448
2506
|
`
|
|
2449
2507
|
)
|
|
2450
|
-
}).
|
|
2508
|
+
}).meta({
|
|
2509
|
+
description: "A select input field",
|
|
2510
|
+
id: "Select"
|
|
2511
|
+
});
|
|
2451
2512
|
var SelectDateRangeOption = import_v43.default.object({
|
|
2452
2513
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
2453
2514
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -2456,7 +2517,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
2456
2517
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
2457
2518
|
defaultValue: SelectDateRangeValue.optional(),
|
|
2458
2519
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
2459
|
-
}).
|
|
2520
|
+
}).meta({
|
|
2521
|
+
description: "A date range selection field",
|
|
2522
|
+
id: "SelectDateRangeField"
|
|
2523
|
+
});
|
|
2460
2524
|
var NameConfig = import_v43.default.object({
|
|
2461
2525
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2462
2526
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -2487,26 +2551,41 @@ var NameField = BaseField.extend({
|
|
|
2487
2551
|
surname: { required: true }
|
|
2488
2552
|
}
|
|
2489
2553
|
}).optional()
|
|
2490
|
-
}).
|
|
2554
|
+
}).meta({
|
|
2555
|
+
description: "A field for entering a persons name",
|
|
2556
|
+
id: "NameField"
|
|
2557
|
+
});
|
|
2491
2558
|
var PhoneField = BaseField.extend({
|
|
2492
2559
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2493
2560
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
2494
|
-
}).
|
|
2561
|
+
}).meta({
|
|
2562
|
+
description: "A field for entering a phone number",
|
|
2563
|
+
id: "PhoneField"
|
|
2564
|
+
});
|
|
2495
2565
|
var IdField = BaseField.extend({
|
|
2496
2566
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2497
2567
|
type: import_v43.default.literal(FieldType.ID)
|
|
2498
|
-
}).
|
|
2568
|
+
}).meta({
|
|
2569
|
+
description: "A field for entering an ID",
|
|
2570
|
+
id: "IdField"
|
|
2571
|
+
});
|
|
2499
2572
|
var Checkbox = BaseField.extend({
|
|
2500
2573
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
2501
2574
|
defaultValue: CheckboxFieldValue.default(false)
|
|
2502
|
-
}).
|
|
2575
|
+
}).meta({
|
|
2576
|
+
description: "A boolean checkbox field",
|
|
2577
|
+
id: "Checkbox"
|
|
2578
|
+
});
|
|
2503
2579
|
var Country = BaseField.extend({
|
|
2504
2580
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
2505
2581
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2506
2582
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
2507
2583
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2508
2584
|
)
|
|
2509
|
-
}).
|
|
2585
|
+
}).meta({
|
|
2586
|
+
description: "A field for selecting a country",
|
|
2587
|
+
id: "Country"
|
|
2588
|
+
});
|
|
2510
2589
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2511
2590
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2512
2591
|
);
|
|
@@ -2515,16 +2594,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2515
2594
|
"HEALTH_FACILITY",
|
|
2516
2595
|
"CRVS_OFFICE"
|
|
2517
2596
|
]);
|
|
2518
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
2519
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2520
|
-
type: AdministrativeAreas,
|
|
2521
|
-
allowedLocations: AllowedLocations
|
|
2522
|
-
}).describe("Administrative area options");
|
|
2523
2597
|
var AdministrativeAreaField = BaseField.extend({
|
|
2524
2598
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2525
2599
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2526
|
-
configuration:
|
|
2527
|
-
|
|
2600
|
+
configuration: import_v43.default.object({
|
|
2601
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2602
|
+
type: AdministrativeAreas,
|
|
2603
|
+
allowedLocations: AllowedLocations
|
|
2604
|
+
}).describe("Administrative area options")
|
|
2605
|
+
}).meta({
|
|
2606
|
+
description: "Administrative area input field",
|
|
2607
|
+
id: "AdministrativeAreaField"
|
|
2608
|
+
});
|
|
2528
2609
|
var LocationInput = BaseField.extend({
|
|
2529
2610
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2530
2611
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -2532,7 +2613,10 @@ var LocationInput = BaseField.extend({
|
|
|
2532
2613
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2533
2614
|
allowedLocations: AllowedLocations
|
|
2534
2615
|
}).optional()
|
|
2535
|
-
}).
|
|
2616
|
+
}).meta({
|
|
2617
|
+
description: "A field for selecting a location",
|
|
2618
|
+
id: "LocationInput"
|
|
2619
|
+
});
|
|
2536
2620
|
var FileUploadWithOptions = BaseField.extend({
|
|
2537
2621
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2538
2622
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -2546,6 +2630,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2546
2630
|
}).default({
|
|
2547
2631
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2548
2632
|
})
|
|
2633
|
+
}).meta({
|
|
2634
|
+
description: "A field for uploading files with file type options",
|
|
2635
|
+
id: "FileUploadWithOptions"
|
|
2549
2636
|
});
|
|
2550
2637
|
var Facility = BaseField.extend({
|
|
2551
2638
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -2591,7 +2678,10 @@ var Address = BaseField.extend({
|
|
|
2591
2678
|
allowedLocations: AllowedLocations
|
|
2592
2679
|
}).optional(),
|
|
2593
2680
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2594
|
-
}).
|
|
2681
|
+
}).meta({
|
|
2682
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2683
|
+
id: "Address"
|
|
2684
|
+
});
|
|
2595
2685
|
var StaticDataEntry = import_v43.default.object({
|
|
2596
2686
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2597
2687
|
label: TranslationConfig,
|
|
@@ -2606,7 +2696,10 @@ var DataField = BaseField.extend({
|
|
|
2606
2696
|
subtitle: TranslationConfig.optional(),
|
|
2607
2697
|
data: import_v43.default.array(DataEntry)
|
|
2608
2698
|
})
|
|
2609
|
-
}).
|
|
2699
|
+
}).meta({
|
|
2700
|
+
description: "A field for displaying a table of read-only data",
|
|
2701
|
+
id: "DataField"
|
|
2702
|
+
});
|
|
2610
2703
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2611
2704
|
var ButtonType = import_v43.default.enum([
|
|
2612
2705
|
"primary",
|
|
@@ -2633,11 +2726,17 @@ var ButtonField = BaseField.extend({
|
|
|
2633
2726
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2634
2727
|
defaultValue: ButtonFieldValue.optional(),
|
|
2635
2728
|
configuration: ButtonConfiguration
|
|
2636
|
-
}).
|
|
2729
|
+
}).meta({
|
|
2730
|
+
description: "A generic button that can be used to trigger an action",
|
|
2731
|
+
id: "ButtonField"
|
|
2732
|
+
});
|
|
2637
2733
|
var FieldGroup = BaseField.extend({
|
|
2638
2734
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2639
2735
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2640
2736
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2737
|
+
}).meta({
|
|
2738
|
+
description: "A group of fields that are displayed together",
|
|
2739
|
+
id: "FieldGroup"
|
|
2641
2740
|
});
|
|
2642
2741
|
var AlphaPrintButton = BaseField.extend({
|
|
2643
2742
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2647,7 +2746,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2647
2746
|
"Label for the print button"
|
|
2648
2747
|
)
|
|
2649
2748
|
})
|
|
2650
|
-
}).
|
|
2749
|
+
}).meta({
|
|
2750
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2751
|
+
id: "AlphaPrintButton"
|
|
2752
|
+
});
|
|
2651
2753
|
var HttpField = BaseField.extend({
|
|
2652
2754
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2653
2755
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -2663,20 +2765,30 @@ var HttpField = BaseField.extend({
|
|
|
2663
2765
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2664
2766
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2665
2767
|
})
|
|
2666
|
-
}).
|
|
2768
|
+
}).meta({
|
|
2769
|
+
description: "Makes a background HTTP request to an external service and stores the response so other fields can use it. Has no visible UI \u2014 pair with LOADER to show request status.",
|
|
2770
|
+
id: "HttpField"
|
|
2771
|
+
});
|
|
2667
2772
|
var AutocompleteField = BaseField.extend({
|
|
2668
2773
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2669
2774
|
configuration: import_v43.default.object({
|
|
2670
|
-
url: import_v43.default.string().describe(
|
|
2775
|
+
url: import_v43.default.string().describe(
|
|
2776
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2777
|
+
).optional(),
|
|
2671
2778
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2672
2779
|
defaultOptions: import_v43.default.array(
|
|
2673
2780
|
import_v43.default.object({
|
|
2674
2781
|
label: import_v43.default.string(),
|
|
2675
2782
|
value: import_v43.default.string()
|
|
2676
2783
|
})
|
|
2677
|
-
).optional()
|
|
2784
|
+
).optional().describe(
|
|
2785
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2786
|
+
)
|
|
2678
2787
|
})
|
|
2679
|
-
}).
|
|
2788
|
+
}).meta({
|
|
2789
|
+
description: "Generic autocomplete component designed for use with large dictionary-based datasets. The component supports dynamic retrieval of options from configurable data sources and is intended for datasets that may contain tens or hundreds of thousands of records.",
|
|
2790
|
+
id: "AutocompleteField"
|
|
2791
|
+
});
|
|
2680
2792
|
var SearchField = HttpField.extend({
|
|
2681
2793
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2682
2794
|
configuration: SearchQuery.pick({
|
|
@@ -2709,6 +2821,9 @@ var SearchField = HttpField.extend({
|
|
|
2709
2821
|
ok: TranslationConfig.optional()
|
|
2710
2822
|
}).optional()
|
|
2711
2823
|
})
|
|
2824
|
+
}).meta({
|
|
2825
|
+
description: "A search input field",
|
|
2826
|
+
id: "SearchField"
|
|
2712
2827
|
});
|
|
2713
2828
|
var LinkButtonField = BaseField.extend({
|
|
2714
2829
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2717,7 +2832,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
2717
2832
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2718
2833
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2719
2834
|
})
|
|
2720
|
-
}).
|
|
2835
|
+
}).meta({
|
|
2836
|
+
description: "A button that opens a URL link",
|
|
2837
|
+
id: "LinkButtonField"
|
|
2838
|
+
});
|
|
2721
2839
|
var VerificationStatus = BaseField.extend({
|
|
2722
2840
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2723
2841
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -2727,15 +2845,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
2727
2845
|
"Explaining text on the banner in form."
|
|
2728
2846
|
)
|
|
2729
2847
|
})
|
|
2848
|
+
}).meta({
|
|
2849
|
+
description: "Displays a verification state (e.g. ID verified / pending). Often paired with ID_READER \u2014 it can read its value off an ID_READER rather than holding its own.",
|
|
2850
|
+
id: "VerificationStatus"
|
|
2730
2851
|
});
|
|
2731
2852
|
var QueryParamReaderField = BaseField.extend({
|
|
2732
2853
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2733
2854
|
configuration: import_v43.default.object({
|
|
2734
2855
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2735
2856
|
})
|
|
2736
|
-
}).
|
|
2737
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2738
|
-
|
|
2857
|
+
}).meta({
|
|
2858
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2859
|
+
id: "QueryParamReaderField"
|
|
2860
|
+
});
|
|
2739
2861
|
var QrReaderField = BaseField.extend({
|
|
2740
2862
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2741
2863
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -2746,7 +2868,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2746
2868
|
})
|
|
2747
2869
|
}).optional()
|
|
2748
2870
|
}).meta({
|
|
2749
|
-
description: "
|
|
2871
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2750
2872
|
id: "QrReaderField"
|
|
2751
2873
|
});
|
|
2752
2874
|
var IdReaderField = BaseField.extend({
|
|
@@ -2755,12 +2877,18 @@ var IdReaderField = BaseField.extend({
|
|
|
2755
2877
|
methods: import_v43.default.array(
|
|
2756
2878
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2757
2879
|
)
|
|
2880
|
+
}).meta({
|
|
2881
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2882
|
+
id: "IdReaderField"
|
|
2758
2883
|
});
|
|
2759
2884
|
var CustomField = BaseField.extend({
|
|
2760
2885
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2761
2886
|
defaultValue: CustomFieldValue.optional(),
|
|
2762
2887
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2763
2888
|
configuration: import_v43.default.unknown().optional()
|
|
2889
|
+
}).meta({
|
|
2890
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2891
|
+
id: "CustomField"
|
|
2764
2892
|
});
|
|
2765
2893
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2766
2894
|
var LoaderField = BaseField.extend({
|
|
@@ -2770,22 +2898,25 @@ var LoaderField = BaseField.extend({
|
|
|
2770
2898
|
configuration: import_v43.default.object({
|
|
2771
2899
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2772
2900
|
})
|
|
2773
|
-
}).
|
|
2774
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2775
|
-
|
|
2901
|
+
}).meta({
|
|
2902
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2903
|
+
id: "LoaderField"
|
|
2904
|
+
});
|
|
2776
2905
|
var HiddenField = BaseField.extend({
|
|
2777
2906
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2778
2907
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2779
2908
|
defaultValue: TextValue.optional()
|
|
2780
|
-
}).
|
|
2781
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2782
|
-
|
|
2909
|
+
}).meta({
|
|
2910
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2911
|
+
id: "HiddenField"
|
|
2912
|
+
});
|
|
2783
2913
|
var UserRoleField = BaseField.extend({
|
|
2784
2914
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2785
2915
|
defaultValue: TextValue.optional()
|
|
2786
|
-
}).
|
|
2787
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2788
|
-
|
|
2916
|
+
}).meta({
|
|
2917
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2918
|
+
id: "UserRoleField"
|
|
2919
|
+
});
|
|
2789
2920
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2790
2921
|
FieldGroup,
|
|
2791
2922
|
Address,
|
|
@@ -2884,10 +3015,10 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2884
3015
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2885
3016
|
actions: VerificationActionConfig
|
|
2886
3017
|
});
|
|
2887
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
3018
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
3019
|
+
description: "Page configuration",
|
|
3020
|
+
id: "PageConfig"
|
|
3021
|
+
});
|
|
2891
3022
|
|
|
2892
3023
|
// ../commons/src/events/FormConfig.ts
|
|
2893
3024
|
var DeclarationFormConfig = z22.object({
|
|
@@ -5368,7 +5499,7 @@ var _EventConfigBase = z33.object({
|
|
|
5368
5499
|
),
|
|
5369
5500
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
5370
5501
|
actions: z33.array(ActionConfig).describe(
|
|
5371
|
-
"Configuration of
|
|
5502
|
+
"Configuration of core and custom actions associated with the event."
|
|
5372
5503
|
),
|
|
5373
5504
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
5374
5505
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -5380,7 +5511,7 @@ var _EventConfigBase = z33.object({
|
|
|
5380
5511
|
"Configuration of fields available in the advanced search feature."
|
|
5381
5512
|
),
|
|
5382
5513
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
5383
|
-
"Configuration of flags associated with the actions of this event type."
|
|
5514
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
5384
5515
|
),
|
|
5385
5516
|
analytics: z33.boolean().optional().default(true).describe(
|
|
5386
5517
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -5819,18 +5950,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5819
5950
|
query: true,
|
|
5820
5951
|
columns: true
|
|
5821
5952
|
});
|
|
5822
|
-
var WorkqueueConfigInput =
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
query: CountryConfigQueryInputType,
|
|
5828
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
5829
|
-
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
5830
|
-
),
|
|
5831
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5832
|
-
icon: AvailableIcons,
|
|
5833
|
-
emptyMessage: TranslationConfig.optional()
|
|
5953
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
5954
|
+
query: CountryConfigQueryInputType
|
|
5955
|
+
}).meta({
|
|
5956
|
+
description: "Workqueue configuration",
|
|
5957
|
+
id: "WorkqueueConfig"
|
|
5834
5958
|
});
|
|
5835
5959
|
function defineWorkqueue(workqueueInput) {
|
|
5836
5960
|
const queryInput = workqueueInput.query;
|
|
@@ -6147,7 +6271,6 @@ function getDeclarationActionCreationMetadata(actionType, actions) {
|
|
|
6147
6271
|
createdAtLocation: requestAction?.createdAtLocation ?? acceptAction.createdAtLocation,
|
|
6148
6272
|
acceptedAt: acceptAction.createdAt,
|
|
6149
6273
|
createdByRole: requestAction?.createdByRole ?? acceptAction.createdByRole,
|
|
6150
|
-
createdBySignature: requestAction?.createdBySignature ?? acceptAction.createdBySignature,
|
|
6151
6274
|
registrationNumber
|
|
6152
6275
|
};
|
|
6153
6276
|
}
|
|
@@ -6361,17 +6484,6 @@ function getAssignedUserFromActions(actions) {
|
|
|
6361
6484
|
return user2;
|
|
6362
6485
|
}, null);
|
|
6363
6486
|
}
|
|
6364
|
-
function getAssignedUserSignatureFromActions(actions) {
|
|
6365
|
-
return actions.reduce((signature, action) => {
|
|
6366
|
-
if (action.type === ActionType.ASSIGN) {
|
|
6367
|
-
return action.createdBySignature || null;
|
|
6368
|
-
}
|
|
6369
|
-
if (action.type === ActionType.UNASSIGN) {
|
|
6370
|
-
return null;
|
|
6371
|
-
}
|
|
6372
|
-
return signature;
|
|
6373
|
-
}, null);
|
|
6374
|
-
}
|
|
6375
6487
|
function deepDropNulls(obj) {
|
|
6376
6488
|
if (Array.isArray(obj)) {
|
|
6377
6489
|
return obj.map(deepDropNulls);
|
|
@@ -6467,10 +6579,8 @@ function getCurrentEventState(event2, config) {
|
|
|
6467
6579
|
createdBy: creationAction.createdBy,
|
|
6468
6580
|
createdByUserType: creationAction.createdByUserType,
|
|
6469
6581
|
createdAtLocation: creationAction.createdAtLocation,
|
|
6470
|
-
createdBySignature: creationAction.createdBySignature,
|
|
6471
6582
|
updatedAt: acceptedActionMetadata.createdAt,
|
|
6472
6583
|
assignedTo: getAssignedUserFromActions(acceptedActions),
|
|
6473
|
-
assignedToSignature: getAssignedUserSignatureFromActions(acceptedActions),
|
|
6474
6584
|
updatedBy: requestActionMetadata.createdBy,
|
|
6475
6585
|
updatedAtLocation: requestActionMetadata.createdAtLocation,
|
|
6476
6586
|
declaration,
|
|
@@ -9729,7 +9839,6 @@ var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
|
|
9729
9839
|
createdBy: overrides.createdBy ?? generateUuid(rng),
|
|
9730
9840
|
createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
|
|
9731
9841
|
updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
|
|
9732
|
-
createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
|
|
9733
9842
|
updatedAt: overrides.updatedAt ?? (0, import_date_fns4.addDays)(new Date(createdAt), 1).toISOString(),
|
|
9734
9843
|
assignedTo: overrides.assignedTo ?? null,
|
|
9735
9844
|
updatedBy: overrides.updatedBy ?? generateUuid(rng),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-accept-requested-registration-function-type.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/fix-accept-requested-registration-function-type.ts"],"names":[],"mappings":"AAuFA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|