@opencrvs/toolkit 2.0.0-rc.bfc4add → 2.0.0-rc.c0c2dcd

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.
@@ -310,6 +310,7 @@ __export(events_exports, {
310
310
  getAvailableActionsForEvent: () => getAvailableActionsForEvent,
311
311
  getAvailableRolesForUserUpdatePayload: () => getAvailableRolesForUserUpdatePayload,
312
312
  getCompleteActionAnnotation: () => getCompleteActionAnnotation,
313
+ getCompleteActionContent: () => getCompleteActionContent,
313
314
  getCompleteActionDeclaration: () => getCompleteActionDeclaration,
314
315
  getCurrentEventState: () => getCurrentEventState,
315
316
  getCustomActionFields: () => getCustomActionFields,
@@ -704,7 +705,9 @@ var decodeScope = (query) => {
704
705
  };
705
706
  var DEFAULT_SCOPE_OPTIONS = {
706
707
  placeOfEvent: JurisdictionFilter.enum.all,
707
- accessLevel: JurisdictionFilter.enum.all
708
+ accessLevel: JurisdictionFilter.enum.all,
709
+ registeredIn: JurisdictionFilter.enum.all,
710
+ declaredIn: JurisdictionFilter.enum.all
708
711
  };
709
712
  function getAcceptedScopesByType({
710
713
  acceptedScopes,
@@ -1077,7 +1080,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
1077
1080
  ShowConditional,
1078
1081
  // Action can be shown to the user in the list but as disabled
1079
1082
  EnableConditional
1080
- ]);
1083
+ ]).meta({
1084
+ id: "ActionConditional",
1085
+ description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
1086
+ });
1081
1087
  var DisplayOnReviewConditional = z7.object({
1082
1088
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
1083
1089
  conditional: Conditional
@@ -1092,8 +1098,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
1092
1098
  // Field output can be shown / hidden on the review page
1093
1099
  DisplayOnReviewConditional
1094
1100
  ]).meta({
1095
- description: "Field conditional configuration",
1096
- id: "FieldConditional"
1101
+ id: "FieldConditional",
1102
+ description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
1097
1103
  });
1098
1104
 
1099
1105
  // ../commons/src/events/FieldType.ts
@@ -1643,8 +1649,9 @@ var RequestedCorrectionAction = ActionBase.extend(
1643
1649
  var ApprovedCorrectionAction = ActionBase.extend(
1644
1650
  z14.object({
1645
1651
  type: z14.literal(ActionType.APPROVE_CORRECTION),
1646
- requestId: z14.string()
1652
+ requestId: z14.string(),
1647
1653
  // TODO move into 'content' property
1654
+ content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
1648
1655
  }).shape
1649
1656
  );
1650
1657
  var RejectedCorrectionAction = ActionBase.extend(
@@ -1736,6 +1743,9 @@ var FlagConfig = z15.object({
1736
1743
  "Indicates if this flag expects an action to be performed to be cleared."
1737
1744
  ),
1738
1745
  label: TranslationConfig.describe("Human readable label of the flag.")
1746
+ }).meta({
1747
+ id: "FlagConfig",
1748
+ description: "Configuration for a custom flag that can be added to or removed from records by event actions."
1739
1749
  });
1740
1750
  var ActionFlagConfig = z15.object({
1741
1751
  id: Flag,
@@ -1743,6 +1753,9 @@ var ActionFlagConfig = z15.object({
1743
1753
  conditional: Conditional.optional().describe(
1744
1754
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1745
1755
  )
1756
+ }).meta({
1757
+ id: "ActionFlagConfig",
1758
+ description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
1746
1759
  });
1747
1760
 
1748
1761
  // ../commons/src/events/EventMetadata.ts
@@ -2166,14 +2179,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
2166
2179
  }
2167
2180
  }).describe("Unique identifier for the field");
2168
2181
  var FieldReference = import_v43.default.object({
2169
- $$field: FieldId,
2182
+ $$field: FieldId.describe("Id of the field to reference"),
2170
2183
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
2171
2184
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
2172
2185
  )
2173
2186
  }).describe("Reference to a field by its ID");
2174
2187
  var ValidationConfig = import_v43.default.object({
2175
- validator: Conditional,
2176
- message: TranslationConfig
2188
+ validator: Conditional.describe(
2189
+ "Conditional expression that must hold for the field value to be considered valid."
2190
+ ),
2191
+ message: TranslationConfig.describe(
2192
+ "Error message displayed when the validator does not hold."
2193
+ )
2194
+ }).meta({
2195
+ id: "ValidationConfig",
2196
+ description: "Validation rule applied to a form field. The validator is a conditional expression that must hold for the field value to be considered valid."
2177
2197
  });
2178
2198
  var requiredSchema = import_v43.default.union([
2179
2199
  import_v43.default.boolean(),
@@ -2212,6 +2232,9 @@ var BaseField = import_v43.default.object({
2212
2232
  }).describe("Common properties shared across all field types.");
2213
2233
  var Divider = BaseField.extend({
2214
2234
  type: import_v43.default.literal(FieldType.DIVIDER)
2235
+ }).meta({
2236
+ description: "A horizontal line divider",
2237
+ id: "Divider"
2215
2238
  });
2216
2239
  var TextField = BaseField.extend({
2217
2240
  type: import_v43.default.literal(FieldType.TEXT),
@@ -2222,7 +2245,10 @@ var TextField = BaseField.extend({
2222
2245
  prefix: TranslationConfig.optional(),
2223
2246
  postfix: TranslationConfig.optional()
2224
2247
  }).default({ type: "text" }).optional()
2225
- }).describe("Text input");
2248
+ }).meta({
2249
+ description: "A text input field",
2250
+ id: "TextField"
2251
+ });
2226
2252
  var NumberField = BaseField.extend({
2227
2253
  type: import_v43.default.literal(FieldType.NUMBER),
2228
2254
  defaultValue: NumberFieldValue.optional(),
@@ -2232,7 +2258,10 @@ var NumberField = BaseField.extend({
2232
2258
  prefix: TranslationConfig.optional(),
2233
2259
  postfix: TranslationConfig.optional()
2234
2260
  }).optional()
2235
- }).describe("Number input");
2261
+ }).meta({
2262
+ description: "A number input field",
2263
+ id: "NumberField"
2264
+ });
2236
2265
  var TextAreaField = BaseField.extend({
2237
2266
  type: import_v43.default.literal(FieldType.TEXTAREA),
2238
2267
  defaultValue: NonEmptyTextValue.optional(),
@@ -2243,7 +2272,10 @@ var TextAreaField = BaseField.extend({
2243
2272
  prefix: TranslationConfig.optional(),
2244
2273
  postfix: TranslationConfig.optional()
2245
2274
  }).default({ rows: 4 }).optional()
2246
- }).describe("Multiline text input");
2275
+ }).meta({
2276
+ description: "A multiline text input",
2277
+ id: "TextAreaField"
2278
+ });
2247
2279
  var ImageMimeType = import_v43.default.enum([
2248
2280
  "image/png",
2249
2281
  "image/jpg",
@@ -2273,13 +2305,19 @@ var SignatureField = BaseField.extend({
2273
2305
  }).default({
2274
2306
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2275
2307
  })
2276
- }).describe("Signature input field");
2308
+ }).meta({
2309
+ description: "A signature input field",
2310
+ id: "SignatureField"
2311
+ });
2277
2312
  var EmailField = BaseField.extend({
2278
2313
  type: import_v43.default.literal(FieldType.EMAIL),
2279
2314
  configuration: import_v43.default.object({
2280
2315
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
2281
2316
  }).default({ maxLength: 255 }).optional(),
2282
2317
  defaultValue: NonEmptyTextValue.optional()
2318
+ }).meta({
2319
+ description: "An email input field",
2320
+ id: "EmailField"
2283
2321
  });
2284
2322
  var DateField = BaseField.extend({
2285
2323
  type: import_v43.default.literal(FieldType.DATE),
@@ -2289,7 +2327,10 @@ var DateField = BaseField.extend({
2289
2327
  "Text to display above the date input"
2290
2328
  ).optional()
2291
2329
  }).optional()
2292
- }).describe("A single date input (yyyy-MM-dd)");
2330
+ }).meta({
2331
+ description: "A date input (yyyy-MM-dd)",
2332
+ id: "DateField"
2333
+ });
2293
2334
  var AgeField = BaseField.extend({
2294
2335
  type: import_v43.default.literal(FieldType.AGE),
2295
2336
  defaultValue: NumberFieldValue.optional(),
@@ -2298,7 +2339,10 @@ var AgeField = BaseField.extend({
2298
2339
  prefix: TranslationConfig.optional(),
2299
2340
  postfix: TranslationConfig.optional()
2300
2341
  })
2301
- }).describe("An age input field which uses the current date as the asOfDate");
2342
+ }).meta({
2343
+ description: "An age input field which uses the current date as the asOfDate",
2344
+ id: "AgeField"
2345
+ });
2302
2346
  var TimeField = BaseField.extend({
2303
2347
  type: import_v43.default.literal(FieldType.TIME),
2304
2348
  defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
@@ -2308,7 +2352,10 @@ var TimeField = BaseField.extend({
2308
2352
  "Text to display above the time input"
2309
2353
  ).optional()
2310
2354
  }).optional()
2311
- }).describe("A single date input (HH-mm)");
2355
+ }).meta({
2356
+ description: "A single time input (HH-mm)",
2357
+ id: "TimeField"
2358
+ });
2312
2359
  var DateRangeField = BaseField.extend({
2313
2360
  type: import_v43.default.literal(FieldType.DATE_RANGE),
2314
2361
  defaultValue: DateRangeFieldValue.optional(),
@@ -2317,7 +2364,10 @@ var DateRangeField = BaseField.extend({
2317
2364
  "Text to display above the date input"
2318
2365
  ).optional()
2319
2366
  }).optional()
2320
- }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
2367
+ }).meta({
2368
+ description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
2369
+ id: "DateRangeField"
2370
+ });
2321
2371
  var HtmlFontVariant = import_v43.default.enum([
2322
2372
  "reg12",
2323
2373
  "reg14",
@@ -2361,18 +2411,30 @@ var ImageViewField = BaseField.extend({
2361
2411
  type: import_v43.default.literal(FieldType.IMAGE_VIEW),
2362
2412
  defaultValue: NonEmptyTextValue.optional(),
2363
2413
  configuration: ImageConfiguration
2364
- }).describe("A read-only image component for form pages");
2414
+ }).meta({
2415
+ description: "A read-only image component for form pages",
2416
+ id: "ImageViewField"
2417
+ });
2365
2418
  var Paragraph = BaseField.extend({
2366
2419
  type: import_v43.default.literal(FieldType.PARAGRAPH),
2367
2420
  configuration: ParagraphConfiguration
2368
- }).describe("A read-only HTML <p> paragraph");
2421
+ }).meta({
2422
+ description: "A read-only HTML <p> paragraph",
2423
+ id: "Paragraph"
2424
+ });
2369
2425
  var Heading = BaseField.extend({
2370
2426
  type: import_v43.default.literal(FieldType.HEADING),
2371
2427
  configuration: HeadingConfiguration
2372
- }).describe("A read-only heading component for form pages");
2428
+ }).meta({
2429
+ description: "A read-only heading component for form pages",
2430
+ id: "Heading"
2431
+ });
2373
2432
  var PageHeader = BaseField.extend({
2374
2433
  type: import_v43.default.literal(FieldType.PAGE_HEADER)
2375
- }).describe("A read-only header component for form pages");
2434
+ }).meta({
2435
+ description: "A read-only header component for form pages",
2436
+ id: "PageHeader"
2437
+ });
2376
2438
  var File = BaseField.extend({
2377
2439
  type: import_v43.default.literal(FieldType.FILE),
2378
2440
  defaultValue: FileFieldValue.optional(),
@@ -2391,7 +2453,10 @@ var File = BaseField.extend({
2391
2453
  }).default({
2392
2454
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2393
2455
  })
2394
- }).describe("File upload");
2456
+ }).meta({
2457
+ description: "A file upload field",
2458
+ id: "File"
2459
+ });
2395
2460
  var SelectOption = import_v43.default.object({
2396
2461
  value: import_v43.default.string().describe("The value of the option"),
2397
2462
  label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
@@ -2408,7 +2473,10 @@ var NumberWithUnitField = BaseField.extend({
2408
2473
  "Placeholder for the number field"
2409
2474
  )
2410
2475
  }).optional()
2411
- }).describe("Number with unit input");
2476
+ }).meta({
2477
+ description: "A number with unit input field",
2478
+ id: "NumberWithUnitField"
2479
+ });
2412
2480
  var RadioGroup = BaseField.extend({
2413
2481
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
2414
2482
  defaultValue: TextValue.optional(),
@@ -2418,7 +2486,10 @@ var RadioGroup = BaseField.extend({
2418
2486
  size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
2419
2487
  }).optional()
2420
2488
  }).optional()
2421
- }).describe("Grouped radio options");
2489
+ }).meta({
2490
+ description: "A grouped radio button field",
2491
+ id: "RadioGroup"
2492
+ });
2422
2493
  var BulletList = BaseField.extend({
2423
2494
  type: import_v43.default.literal(FieldType.BULLET_LIST),
2424
2495
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
@@ -2427,7 +2498,10 @@ var BulletList = BaseField.extend({
2427
2498
  fontVariant: HtmlFontVariant.optional()
2428
2499
  }).optional()
2429
2500
  }).default({})
2430
- }).describe("A list of bullet points");
2501
+ }).meta({
2502
+ description: "A list of bullet points",
2503
+ id: "BulletList"
2504
+ });
2431
2505
  var Select = BaseField.extend({
2432
2506
  type: import_v43.default.literal(FieldType.SELECT),
2433
2507
  defaultValue: TextValue.optional(),
@@ -2442,7 +2516,10 @@ var Select = BaseField.extend({
2442
2516
  { ..., defaultMessage: "'{input}' is not listed among the health facilities." }
2443
2517
  `
2444
2518
  )
2445
- }).describe("Select input");
2519
+ }).meta({
2520
+ description: "A select input field",
2521
+ id: "Select"
2522
+ });
2446
2523
  var SelectDateRangeOption = import_v43.default.object({
2447
2524
  value: SelectDateRangeValue.describe("The value of the option"),
2448
2525
  label: TranslationConfig.describe("The label of the option")
@@ -2451,7 +2528,10 @@ var SelectDateRangeField = BaseField.extend({
2451
2528
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
2452
2529
  defaultValue: SelectDateRangeValue.optional(),
2453
2530
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
2454
- }).describe("Select input with date range options");
2531
+ }).meta({
2532
+ description: "A date range selection field",
2533
+ id: "SelectDateRangeField"
2534
+ });
2455
2535
  var NameConfig = import_v43.default.object({
2456
2536
  firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
2457
2537
  middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
@@ -2482,26 +2562,41 @@ var NameField = BaseField.extend({
2482
2562
  surname: { required: true }
2483
2563
  }
2484
2564
  }).optional()
2485
- }).describe("Name input field");
2565
+ }).meta({
2566
+ description: "A field for entering a persons name",
2567
+ id: "NameField"
2568
+ });
2486
2569
  var PhoneField = BaseField.extend({
2487
2570
  defaultValue: NonEmptyTextValue.optional(),
2488
2571
  type: import_v43.default.literal(FieldType.PHONE)
2489
- }).describe("Phone input field");
2572
+ }).meta({
2573
+ description: "A field for entering a phone number",
2574
+ id: "PhoneField"
2575
+ });
2490
2576
  var IdField = BaseField.extend({
2491
2577
  defaultValue: NonEmptyTextValue.optional(),
2492
2578
  type: import_v43.default.literal(FieldType.ID)
2493
- }).describe("ID input field");
2579
+ }).meta({
2580
+ description: "A field for entering an ID",
2581
+ id: "IdField"
2582
+ });
2494
2583
  var Checkbox = BaseField.extend({
2495
2584
  type: import_v43.default.literal(FieldType.CHECKBOX),
2496
2585
  defaultValue: CheckboxFieldValue.default(false)
2497
- }).describe("Boolean checkbox field");
2586
+ }).meta({
2587
+ description: "A boolean checkbox field",
2588
+ id: "Checkbox"
2589
+ });
2498
2590
  var Country = BaseField.extend({
2499
2591
  type: import_v43.default.literal(FieldType.COUNTRY),
2500
2592
  defaultValue: NonEmptyTextValue.optional(),
2501
2593
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
2502
2594
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
2503
2595
  )
2504
- }).describe("Country select field");
2596
+ }).meta({
2597
+ description: "A field for selecting a country",
2598
+ id: "Country"
2599
+ });
2505
2600
  var AllowedLocations = JurisdictionReference.optional().describe(
2506
2601
  "Limits which location options are selectable depending on user jurisdiction and location."
2507
2602
  );
@@ -2510,16 +2605,18 @@ var AdministrativeAreas = import_v43.default.enum([
2510
2605
  "HEALTH_FACILITY",
2511
2606
  "CRVS_OFFICE"
2512
2607
  ]);
2513
- var AdministrativeAreaConfiguration = import_v43.default.object({
2514
- partOf: FieldReference.optional().describe("Parent location"),
2515
- type: AdministrativeAreas,
2516
- allowedLocations: AllowedLocations
2517
- }).describe("Administrative area options");
2518
2608
  var AdministrativeAreaField = BaseField.extend({
2519
2609
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
2520
2610
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2521
- configuration: AdministrativeAreaConfiguration
2522
- }).describe("Administrative area input field e.g. facility, office");
2611
+ configuration: import_v43.default.object({
2612
+ partOf: FieldReference.optional().describe("Parent location"),
2613
+ type: AdministrativeAreas,
2614
+ allowedLocations: AllowedLocations
2615
+ }).describe("Administrative area options")
2616
+ }).meta({
2617
+ description: "Administrative area input field",
2618
+ id: "AdministrativeAreaField"
2619
+ });
2523
2620
  var LocationInput = BaseField.extend({
2524
2621
  type: import_v43.default.literal(FieldType.LOCATION),
2525
2622
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
@@ -2527,7 +2624,10 @@ var LocationInput = BaseField.extend({
2527
2624
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2528
2625
  allowedLocations: AllowedLocations
2529
2626
  }).optional()
2530
- }).describe("Input field for a location");
2627
+ }).meta({
2628
+ description: "A field for selecting a location",
2629
+ id: "LocationInput"
2630
+ });
2531
2631
  var FileUploadWithOptions = BaseField.extend({
2532
2632
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
2533
2633
  options: import_v43.default.array(SelectOption).describe("A list of options"),
@@ -2541,6 +2641,9 @@ var FileUploadWithOptions = BaseField.extend({
2541
2641
  }).default({
2542
2642
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2543
2643
  })
2644
+ }).meta({
2645
+ description: "A field for uploading files with file type options",
2646
+ id: "FileUploadWithOptions"
2544
2647
  });
2545
2648
  var Facility = BaseField.extend({
2546
2649
  type: import_v43.default.literal(FieldType.FACILITY),
@@ -2586,7 +2689,10 @@ var Address = BaseField.extend({
2586
2689
  allowedLocations: AllowedLocations
2587
2690
  }).optional(),
2588
2691
  defaultValue: DefaultAddressFieldValue.optional()
2589
- }).describe("Address input field \u2013 a combination of location and text fields");
2692
+ }).meta({
2693
+ description: "Address input field \u2013 a combination of location and text fields",
2694
+ id: "Address"
2695
+ });
2590
2696
  var StaticDataEntry = import_v43.default.object({
2591
2697
  id: import_v43.default.string().describe("ID for the data entry."),
2592
2698
  label: TranslationConfig,
@@ -2601,7 +2707,10 @@ var DataField = BaseField.extend({
2601
2707
  subtitle: TranslationConfig.optional(),
2602
2708
  data: import_v43.default.array(DataEntry)
2603
2709
  })
2604
- }).describe("Data field for displaying read-only data");
2710
+ }).meta({
2711
+ description: "A field for displaying a table of read-only data",
2712
+ id: "DataField"
2713
+ });
2605
2714
  var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2606
2715
  var ButtonType = import_v43.default.enum([
2607
2716
  "primary",
@@ -2628,11 +2737,17 @@ var ButtonField = BaseField.extend({
2628
2737
  type: import_v43.default.literal(FieldType.BUTTON),
2629
2738
  defaultValue: ButtonFieldValue.optional(),
2630
2739
  configuration: ButtonConfiguration
2631
- }).describe("Generic button without any built-in functionality");
2740
+ }).meta({
2741
+ description: "A generic button that can be used to trigger an action",
2742
+ id: "ButtonField"
2743
+ });
2632
2744
  var FieldGroup = BaseField.extend({
2633
2745
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
2634
2746
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2635
2747
  fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
2748
+ }).meta({
2749
+ description: "A group of fields that are displayed together",
2750
+ id: "FieldGroup"
2636
2751
  });
2637
2752
  var AlphaPrintButton = BaseField.extend({
2638
2753
  type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
@@ -2642,7 +2757,10 @@ var AlphaPrintButton = BaseField.extend({
2642
2757
  "Label for the print button"
2643
2758
  )
2644
2759
  })
2645
- }).describe("Print button field for printing certificates");
2760
+ }).meta({
2761
+ description: "An experimental print button field for printing certificates during the declaration process",
2762
+ id: "AlphaPrintButton"
2763
+ });
2646
2764
  var HttpField = BaseField.extend({
2647
2765
  type: import_v43.default.literal(FieldType.HTTP),
2648
2766
  defaultValue: HttpFieldValue.optional(),
@@ -2658,20 +2776,30 @@ var HttpField = BaseField.extend({
2658
2776
  params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
2659
2777
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2660
2778
  })
2661
- }).describe("HTTP request function triggered by a button click or other event");
2779
+ }).meta({
2780
+ 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.",
2781
+ id: "HttpField"
2782
+ });
2662
2783
  var AutocompleteField = BaseField.extend({
2663
2784
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2664
2785
  configuration: import_v43.default.object({
2665
- url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2786
+ url: import_v43.default.string().describe(
2787
+ "URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
2788
+ ).optional(),
2666
2789
  method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2667
2790
  defaultOptions: import_v43.default.array(
2668
2791
  import_v43.default.object({
2669
2792
  label: import_v43.default.string(),
2670
2793
  value: import_v43.default.string()
2671
2794
  })
2672
- ).optional()
2795
+ ).optional().describe(
2796
+ "Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
2797
+ )
2673
2798
  })
2674
- }).describe("Autocomplete input field");
2799
+ }).meta({
2800
+ 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.",
2801
+ id: "AutocompleteField"
2802
+ });
2675
2803
  var SearchField = HttpField.extend({
2676
2804
  type: import_v43.default.literal(FieldType.SEARCH),
2677
2805
  configuration: SearchQuery.pick({
@@ -2704,6 +2832,9 @@ var SearchField = HttpField.extend({
2704
2832
  ok: TranslationConfig.optional()
2705
2833
  }).optional()
2706
2834
  })
2835
+ }).meta({
2836
+ description: "A search input field",
2837
+ id: "SearchField"
2707
2838
  });
2708
2839
  var LinkButtonField = BaseField.extend({
2709
2840
  type: import_v43.default.literal(FieldType.LINK_BUTTON),
@@ -2712,7 +2843,10 @@ var LinkButtonField = BaseField.extend({
2712
2843
  text: TranslationConfig.describe("Text to display on the button"),
2713
2844
  icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
2714
2845
  })
2715
- }).describe("Button that opens a link");
2846
+ }).meta({
2847
+ description: "A button that opens a URL link",
2848
+ id: "LinkButtonField"
2849
+ });
2716
2850
  var VerificationStatus = BaseField.extend({
2717
2851
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2718
2852
  defaultValue: VerificationStatusValue.optional(),
@@ -2722,15 +2856,19 @@ var VerificationStatus = BaseField.extend({
2722
2856
  "Explaining text on the banner in form."
2723
2857
  )
2724
2858
  })
2859
+ }).meta({
2860
+ 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.",
2861
+ id: "VerificationStatus"
2725
2862
  });
2726
2863
  var QueryParamReaderField = BaseField.extend({
2727
2864
  type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
2728
2865
  configuration: import_v43.default.object({
2729
2866
  pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
2730
2867
  })
2731
- }).describe(
2732
- "A field that maps URL query params into form values and clears them afterward"
2733
- );
2868
+ }).meta({
2869
+ description: "A field that maps URL query params into form values and clears them afterward",
2870
+ id: "QueryParamReaderField"
2871
+ });
2734
2872
  var QrReaderField = BaseField.extend({
2735
2873
  type: import_v43.default.literal(FieldType.QR_READER),
2736
2874
  defaultValue: QrReaderFieldValue.optional(),
@@ -2741,7 +2879,7 @@ var QrReaderField = BaseField.extend({
2741
2879
  })
2742
2880
  }).optional()
2743
2881
  }).meta({
2744
- description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2882
+ description: "QR code reader field, including optional JSON Schema validator.",
2745
2883
  id: "QrReaderField"
2746
2884
  });
2747
2885
  var IdReaderField = BaseField.extend({
@@ -2750,12 +2888,18 @@ var IdReaderField = BaseField.extend({
2750
2888
  methods: import_v43.default.array(
2751
2889
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2752
2890
  )
2891
+ }).meta({
2892
+ description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
2893
+ id: "IdReaderField"
2753
2894
  });
2754
2895
  var CustomField = BaseField.extend({
2755
2896
  type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
2756
2897
  defaultValue: CustomFieldValue.optional(),
2757
2898
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2758
2899
  configuration: import_v43.default.unknown().optional()
2900
+ }).meta({
2901
+ description: "An expiremental custom field that is defined by a module source path",
2902
+ id: "CustomField"
2759
2903
  });
2760
2904
  var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2761
2905
  var LoaderField = BaseField.extend({
@@ -2765,22 +2909,25 @@ var LoaderField = BaseField.extend({
2765
2909
  configuration: import_v43.default.object({
2766
2910
  text: TranslationConfig.describe("Display text above the loading spinner")
2767
2911
  })
2768
- }).describe(
2769
- "A non-interactive field that indicates an in progress operation in form"
2770
- );
2912
+ }).meta({
2913
+ description: "A non-interactive field that indicates an in progress operation in form",
2914
+ id: "LoaderField"
2915
+ });
2771
2916
  var HiddenField = BaseField.extend({
2772
2917
  type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
2773
2918
  required: import_v43.default.boolean().default(false).optional(),
2774
2919
  defaultValue: TextValue.optional()
2775
- }).describe(
2776
- "A non-interactive, hidden field that only hold a value in the form"
2777
- );
2920
+ }).meta({
2921
+ description: "A non-interactive, hidden field that only hold a value in the form",
2922
+ id: "HiddenField"
2923
+ });
2778
2924
  var UserRoleField = BaseField.extend({
2779
2925
  type: import_v43.default.literal(FieldType.USER_ROLE),
2780
2926
  defaultValue: TextValue.optional()
2781
- }).describe(
2782
- "A select dropdown that is automatically populated with available user roles"
2783
- );
2927
+ }).meta({
2928
+ description: "A select dropdown that is automatically populated with available user roles",
2929
+ id: "UserRoleField"
2930
+ });
2784
2931
  var FieldConfig = import_v43.default.discriminatedUnion("type", [
2785
2932
  FieldGroup,
2786
2933
  Address,
@@ -2879,16 +3026,19 @@ var VerificationPageConfig = FormPageConfig.extend({
2879
3026
  type: z21.literal(PageTypes.enum.VERIFICATION),
2880
3027
  actions: VerificationActionConfig
2881
3028
  });
2882
- var PageConfig = z21.discriminatedUnion("type", [
2883
- FormPageConfig,
2884
- VerificationPageConfig
2885
- ]);
3029
+ var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
3030
+ id: "PageConfig",
3031
+ description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
3032
+ });
2886
3033
 
2887
3034
  // ../commons/src/events/FormConfig.ts
2888
3035
  var DeclarationFormConfig = z22.object({
2889
3036
  label: TranslationConfig.describe("Human readable description of the form"),
2890
3037
  pages: z22.array(FormPageConfig)
2891
- }).describe("Configuration of the declaration form.");
3038
+ }).meta({
3039
+ id: "DeclarationFormConfig",
3040
+ description: "Configuration of the declaration form."
3041
+ });
2892
3042
  var ActionFormConfig = z22.object({
2893
3043
  label: TranslationConfig.describe("Human readable description of the form"),
2894
3044
  pages: z22.array(PageConfig)
@@ -3105,17 +3255,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
3105
3255
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
3106
3256
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
3107
3257
  */
3108
- ReadActionConfig.meta({ id: "ReadActionConfig" }),
3109
- DeclareConfig.meta({ id: "DeclareActionConfig" }),
3110
- RejectConfig.meta({ id: "RejectActionConfig" }),
3111
- RegisterConfig.meta({ id: "RegisterActionConfig" }),
3258
+ ReadActionConfig.meta({
3259
+ id: "ReadActionConfig",
3260
+ description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
3261
+ }),
3262
+ DeclareConfig.meta({
3263
+ id: "DeclareActionConfig",
3264
+ description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
3265
+ }),
3266
+ RejectConfig.meta({
3267
+ id: "RejectActionConfig",
3268
+ description: "Configuration for rejecting a record before registration."
3269
+ }),
3270
+ RegisterConfig.meta({
3271
+ id: "RegisterActionConfig",
3272
+ description: "Configuration for registering a record."
3273
+ }),
3112
3274
  PrintCertificateActionConfig.meta({
3113
- id: "PrintCertificateActionConfig"
3275
+ id: "PrintCertificateActionConfig",
3276
+ description: "Configuration for printing a certificate of a registered record."
3114
3277
  }),
3115
- RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
3116
- EditActionConfig.meta({ id: "EditActionConfig" }),
3117
- ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
3118
- CustomActionConfig.meta({ id: "CustomActionConfig" })
3278
+ RequestCorrectionConfig.meta({
3279
+ id: "RequestCorrectionActionConfig",
3280
+ description: "Configuration for requesting a correction on a registered record."
3281
+ }),
3282
+ EditActionConfig.meta({
3283
+ id: "EditActionConfig",
3284
+ description: "Configuration for editing a record before registration."
3285
+ }),
3286
+ ArchiveConfig.meta({
3287
+ id: "ArchiveActionConfig",
3288
+ description: "Configuration for archiving a record."
3289
+ }),
3290
+ CustomActionConfig.meta({
3291
+ id: "CustomActionConfig",
3292
+ description: "Configuration for a country-defined custom action. An event may include any number of these."
3293
+ })
3119
3294
  ]).describe(
3120
3295
  "Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
3121
3296
  ).meta({ id: "ActionConfig" });
@@ -4562,6 +4737,19 @@ function getCompleteActionAnnotation(annotation, event2, action) {
4562
4737
  }
4563
4738
  return deepMerge(annotation, action.annotation ?? {});
4564
4739
  }
4740
+ function getCompleteActionContent(event2, action) {
4741
+ const currentContent = "content" in action ? action.content : void 0;
4742
+ if (!action.originalActionId || currentContent) {
4743
+ return currentContent;
4744
+ }
4745
+ const originalAction = event2.actions.find(
4746
+ ({ id }) => id === action.originalActionId
4747
+ );
4748
+ if (originalAction?.status === ActionStatus.Requested && "content" in originalAction && originalAction.content) {
4749
+ return originalAction.content;
4750
+ }
4751
+ return currentContent;
4752
+ }
4565
4753
  function getCompleteActionDeclaration(declaration, event2, action) {
4566
4754
  if (action.originalActionId) {
4567
4755
  const originalAction = event2.actions.find(
@@ -5363,7 +5551,7 @@ var _EventConfigBase = z33.object({
5363
5551
  ),
5364
5552
  label: TranslationConfig.describe("Human-readable label for the event type."),
5365
5553
  actions: z33.array(ActionConfig).describe(
5366
- "Configuration of system-defined actions associated with the event."
5554
+ "Configuration of core and custom actions associated with the event."
5367
5555
  ),
5368
5556
  actionOrder: z33.array(z33.string()).optional().describe(
5369
5557
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
@@ -5375,7 +5563,7 @@ var _EventConfigBase = z33.object({
5375
5563
  "Configuration of fields available in the advanced search feature."
5376
5564
  ),
5377
5565
  flags: z33.array(FlagConfig).optional().default([]).describe(
5378
- "Configuration of flags associated with the actions of this event type."
5566
+ "Configuration of custom flags associated with the actions of this event type."
5379
5567
  ),
5380
5568
  analytics: z33.boolean().optional().default(true).describe(
5381
5569
  "Indicates whether the records of this event type are included in analytics"
@@ -5388,8 +5576,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
5388
5576
  validateActionFlags(event2, ctx);
5389
5577
  validateActionOrder(event2, ctx);
5390
5578
  }).meta({
5391
- id: "EventConfig"
5392
- }).describe("Configuration defining an event type.");
5579
+ id: "EventConfig",
5580
+ description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
5581
+ });
5393
5582
 
5394
5583
  // ../commons/src/events/EventConfigInput.ts
5395
5584
  var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
@@ -5814,18 +6003,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
5814
6003
  query: true,
5815
6004
  columns: true
5816
6005
  });
5817
- var WorkqueueConfigInput = z37.object({
5818
- slug: z37.string().describe("Determines the url of the workqueue."),
5819
- name: TranslationConfig.describe(
5820
- "Title of the workflow (both in navigation and on the page)"
5821
- ),
5822
- query: CountryConfigQueryInputType,
5823
- action: z37.object({ type: WorkqueueActionType }).optional().describe(
5824
- "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."
5825
- ),
5826
- columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
5827
- icon: AvailableIcons,
5828
- emptyMessage: TranslationConfig.optional()
6006
+ var WorkqueueConfigInput = WorkqueueConfig.extend({
6007
+ query: CountryConfigQueryInputType
6008
+ }).meta({
6009
+ description: "Workqueue configuration",
6010
+ id: "WorkqueueConfig"
5829
6011
  });
5830
6012
  function defineWorkqueue(workqueueInput) {
5831
6013
  const queryInput = workqueueInput.query;
@@ -6006,7 +6188,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
6006
6188
  var ApproveCorrectionActionInput = BaseActionInput.extend(
6007
6189
  z38.object({
6008
6190
  requestId: z38.string(),
6009
- type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
6191
+ type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
6192
+ content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
6010
6193
  }).shape
6011
6194
  );
6012
6195
  var ReadActionInput = BaseActionInput.extend(