@opencrvs/toolkit 2.0.0-rc.ddf354d → 2.0.0-rc.de6e7de

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.
@@ -1080,8 +1080,8 @@ var ActionConditional = z7.discriminatedUnion("type", [
1080
1080
  // Action can be shown to the user in the list but as disabled
1081
1081
  EnableConditional
1082
1082
  ]).meta({
1083
- description: "Action conditional configuration",
1084
- id: "ActionConditional"
1083
+ id: "ActionConditional",
1084
+ 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."
1085
1085
  });
1086
1086
  var DisplayOnReviewConditional = z7.object({
1087
1087
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
@@ -1097,8 +1097,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
1097
1097
  // Field output can be shown / hidden on the review page
1098
1098
  DisplayOnReviewConditional
1099
1099
  ]).meta({
1100
- description: "Field conditional configuration",
1101
- id: "FieldConditional"
1100
+ id: "FieldConditional",
1101
+ 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."
1102
1102
  });
1103
1103
 
1104
1104
  // ../commons/src/events/FieldType.ts
@@ -1742,8 +1742,8 @@ var FlagConfig = z15.object({
1742
1742
  ),
1743
1743
  label: TranslationConfig.describe("Human readable label of the flag.")
1744
1744
  }).meta({
1745
- description: "Flag configuration",
1746
- id: "FlagConfig"
1745
+ id: "FlagConfig",
1746
+ description: "Configuration for a custom flag that can be added to or removed from records by event actions."
1747
1747
  });
1748
1748
  var ActionFlagConfig = z15.object({
1749
1749
  id: Flag,
@@ -1752,8 +1752,8 @@ var ActionFlagConfig = z15.object({
1752
1752
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1753
1753
  )
1754
1754
  }).meta({
1755
- description: "Action flag configuration",
1756
- id: "ActionFlagConfig"
1755
+ id: "ActionFlagConfig",
1756
+ description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
1757
1757
  });
1758
1758
 
1759
1759
  // ../commons/src/events/EventMetadata.ts
@@ -2183,8 +2183,15 @@ var FieldReference = import_v43.default.object({
2183
2183
  )
2184
2184
  }).describe("Reference to a field by its ID");
2185
2185
  var ValidationConfig = import_v43.default.object({
2186
- validator: Conditional,
2187
- message: TranslationConfig
2186
+ validator: Conditional.describe(
2187
+ "Conditional expression that must hold for the field value to be considered valid."
2188
+ ),
2189
+ message: TranslationConfig.describe(
2190
+ "Error message displayed when the validator does not hold."
2191
+ )
2192
+ }).meta({
2193
+ id: "ValidationConfig",
2194
+ 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."
2188
2195
  });
2189
2196
  var requiredSchema = import_v43.default.union([
2190
2197
  import_v43.default.boolean(),
@@ -2223,6 +2230,9 @@ var BaseField = import_v43.default.object({
2223
2230
  }).describe("Common properties shared across all field types.");
2224
2231
  var Divider = BaseField.extend({
2225
2232
  type: import_v43.default.literal(FieldType.DIVIDER)
2233
+ }).meta({
2234
+ description: "A horizontal line divider",
2235
+ id: "Divider"
2226
2236
  });
2227
2237
  var TextField = BaseField.extend({
2228
2238
  type: import_v43.default.literal(FieldType.TEXT),
@@ -2233,7 +2243,10 @@ var TextField = BaseField.extend({
2233
2243
  prefix: TranslationConfig.optional(),
2234
2244
  postfix: TranslationConfig.optional()
2235
2245
  }).default({ type: "text" }).optional()
2236
- }).describe("Text input");
2246
+ }).meta({
2247
+ description: "A text input field",
2248
+ id: "TextField"
2249
+ });
2237
2250
  var NumberField = BaseField.extend({
2238
2251
  type: import_v43.default.literal(FieldType.NUMBER),
2239
2252
  defaultValue: NumberFieldValue.optional(),
@@ -2243,7 +2256,10 @@ var NumberField = BaseField.extend({
2243
2256
  prefix: TranslationConfig.optional(),
2244
2257
  postfix: TranslationConfig.optional()
2245
2258
  }).optional()
2246
- }).describe("Number input");
2259
+ }).meta({
2260
+ description: "A number input field",
2261
+ id: "NumberField"
2262
+ });
2247
2263
  var TextAreaField = BaseField.extend({
2248
2264
  type: import_v43.default.literal(FieldType.TEXTAREA),
2249
2265
  defaultValue: NonEmptyTextValue.optional(),
@@ -2254,7 +2270,10 @@ var TextAreaField = BaseField.extend({
2254
2270
  prefix: TranslationConfig.optional(),
2255
2271
  postfix: TranslationConfig.optional()
2256
2272
  }).default({ rows: 4 }).optional()
2257
- }).describe("Multiline text input");
2273
+ }).meta({
2274
+ description: "A multiline text input",
2275
+ id: "TextAreaField"
2276
+ });
2258
2277
  var ImageMimeType = import_v43.default.enum([
2259
2278
  "image/png",
2260
2279
  "image/jpg",
@@ -2284,13 +2303,19 @@ var SignatureField = BaseField.extend({
2284
2303
  }).default({
2285
2304
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2286
2305
  })
2287
- }).describe("Signature input field");
2306
+ }).meta({
2307
+ description: "A signature input field",
2308
+ id: "SignatureField"
2309
+ });
2288
2310
  var EmailField = BaseField.extend({
2289
2311
  type: import_v43.default.literal(FieldType.EMAIL),
2290
2312
  configuration: import_v43.default.object({
2291
2313
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
2292
2314
  }).default({ maxLength: 255 }).optional(),
2293
2315
  defaultValue: NonEmptyTextValue.optional()
2316
+ }).meta({
2317
+ description: "An email input field",
2318
+ id: "EmailField"
2294
2319
  });
2295
2320
  var DateField = BaseField.extend({
2296
2321
  type: import_v43.default.literal(FieldType.DATE),
@@ -2300,7 +2325,10 @@ var DateField = BaseField.extend({
2300
2325
  "Text to display above the date input"
2301
2326
  ).optional()
2302
2327
  }).optional()
2303
- }).describe("A single date input (yyyy-MM-dd)");
2328
+ }).meta({
2329
+ description: "A date input (yyyy-MM-dd)",
2330
+ id: "DateField"
2331
+ });
2304
2332
  var AgeField = BaseField.extend({
2305
2333
  type: import_v43.default.literal(FieldType.AGE),
2306
2334
  defaultValue: NumberFieldValue.optional(),
@@ -2309,7 +2337,10 @@ var AgeField = BaseField.extend({
2309
2337
  prefix: TranslationConfig.optional(),
2310
2338
  postfix: TranslationConfig.optional()
2311
2339
  })
2312
- }).describe("An age input field which uses the current date as the asOfDate");
2340
+ }).meta({
2341
+ description: "An age input field which uses the current date as the asOfDate",
2342
+ id: "AgeField"
2343
+ });
2313
2344
  var TimeField = BaseField.extend({
2314
2345
  type: import_v43.default.literal(FieldType.TIME),
2315
2346
  defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
@@ -2319,7 +2350,10 @@ var TimeField = BaseField.extend({
2319
2350
  "Text to display above the time input"
2320
2351
  ).optional()
2321
2352
  }).optional()
2322
- }).describe("A single date input (HH-mm)");
2353
+ }).meta({
2354
+ description: "A single time input (HH-mm)",
2355
+ id: "TimeField"
2356
+ });
2323
2357
  var DateRangeField = BaseField.extend({
2324
2358
  type: import_v43.default.literal(FieldType.DATE_RANGE),
2325
2359
  defaultValue: DateRangeFieldValue.optional(),
@@ -2328,7 +2362,10 @@ var DateRangeField = BaseField.extend({
2328
2362
  "Text to display above the date input"
2329
2363
  ).optional()
2330
2364
  }).optional()
2331
- }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
2365
+ }).meta({
2366
+ description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
2367
+ id: "DateRangeField"
2368
+ });
2332
2369
  var HtmlFontVariant = import_v43.default.enum([
2333
2370
  "reg12",
2334
2371
  "reg14",
@@ -2372,18 +2409,30 @@ var ImageViewField = BaseField.extend({
2372
2409
  type: import_v43.default.literal(FieldType.IMAGE_VIEW),
2373
2410
  defaultValue: NonEmptyTextValue.optional(),
2374
2411
  configuration: ImageConfiguration
2375
- }).describe("A read-only image component for form pages");
2412
+ }).meta({
2413
+ description: "A read-only image component for form pages",
2414
+ id: "ImageViewField"
2415
+ });
2376
2416
  var Paragraph = BaseField.extend({
2377
2417
  type: import_v43.default.literal(FieldType.PARAGRAPH),
2378
2418
  configuration: ParagraphConfiguration
2379
- }).describe("A read-only HTML <p> paragraph");
2419
+ }).meta({
2420
+ description: "A read-only HTML <p> paragraph",
2421
+ id: "Paragraph"
2422
+ });
2380
2423
  var Heading = BaseField.extend({
2381
2424
  type: import_v43.default.literal(FieldType.HEADING),
2382
2425
  configuration: HeadingConfiguration
2383
- }).describe("A read-only heading component for form pages");
2426
+ }).meta({
2427
+ description: "A read-only heading component for form pages",
2428
+ id: "Heading"
2429
+ });
2384
2430
  var PageHeader = BaseField.extend({
2385
2431
  type: import_v43.default.literal(FieldType.PAGE_HEADER)
2386
- }).describe("A read-only header component for form pages");
2432
+ }).meta({
2433
+ description: "A read-only header component for form pages",
2434
+ id: "PageHeader"
2435
+ });
2387
2436
  var File = BaseField.extend({
2388
2437
  type: import_v43.default.literal(FieldType.FILE),
2389
2438
  defaultValue: FileFieldValue.optional(),
@@ -2402,7 +2451,10 @@ var File = BaseField.extend({
2402
2451
  }).default({
2403
2452
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2404
2453
  })
2405
- }).describe("File upload");
2454
+ }).meta({
2455
+ description: "A file upload field",
2456
+ id: "File"
2457
+ });
2406
2458
  var SelectOption = import_v43.default.object({
2407
2459
  value: import_v43.default.string().describe("The value of the option"),
2408
2460
  label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
@@ -2419,7 +2471,10 @@ var NumberWithUnitField = BaseField.extend({
2419
2471
  "Placeholder for the number field"
2420
2472
  )
2421
2473
  }).optional()
2422
- }).describe("Number with unit input");
2474
+ }).meta({
2475
+ description: "A number with unit input field",
2476
+ id: "NumberWithUnitField"
2477
+ });
2423
2478
  var RadioGroup = BaseField.extend({
2424
2479
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
2425
2480
  defaultValue: TextValue.optional(),
@@ -2429,7 +2484,10 @@ var RadioGroup = BaseField.extend({
2429
2484
  size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
2430
2485
  }).optional()
2431
2486
  }).optional()
2432
- }).describe("Grouped radio options");
2487
+ }).meta({
2488
+ description: "A grouped radio button field",
2489
+ id: "RadioGroup"
2490
+ });
2433
2491
  var BulletList = BaseField.extend({
2434
2492
  type: import_v43.default.literal(FieldType.BULLET_LIST),
2435
2493
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
@@ -2438,7 +2496,10 @@ var BulletList = BaseField.extend({
2438
2496
  fontVariant: HtmlFontVariant.optional()
2439
2497
  }).optional()
2440
2498
  }).default({})
2441
- }).describe("A list of bullet points");
2499
+ }).meta({
2500
+ description: "A list of bullet points",
2501
+ id: "BulletList"
2502
+ });
2442
2503
  var Select = BaseField.extend({
2443
2504
  type: import_v43.default.literal(FieldType.SELECT),
2444
2505
  defaultValue: TextValue.optional(),
@@ -2453,7 +2514,10 @@ var Select = BaseField.extend({
2453
2514
  { ..., defaultMessage: "'{input}' is not listed among the health facilities." }
2454
2515
  `
2455
2516
  )
2456
- }).describe("Select input");
2517
+ }).meta({
2518
+ description: "A select input field",
2519
+ id: "Select"
2520
+ });
2457
2521
  var SelectDateRangeOption = import_v43.default.object({
2458
2522
  value: SelectDateRangeValue.describe("The value of the option"),
2459
2523
  label: TranslationConfig.describe("The label of the option")
@@ -2462,7 +2526,10 @@ var SelectDateRangeField = BaseField.extend({
2462
2526
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
2463
2527
  defaultValue: SelectDateRangeValue.optional(),
2464
2528
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
2465
- }).describe("Select input with date range options");
2529
+ }).meta({
2530
+ description: "A date range selection field",
2531
+ id: "SelectDateRangeField"
2532
+ });
2466
2533
  var NameConfig = import_v43.default.object({
2467
2534
  firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
2468
2535
  middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
@@ -2493,26 +2560,41 @@ var NameField = BaseField.extend({
2493
2560
  surname: { required: true }
2494
2561
  }
2495
2562
  }).optional()
2496
- }).describe("Name input field");
2563
+ }).meta({
2564
+ description: "A field for entering a persons name",
2565
+ id: "NameField"
2566
+ });
2497
2567
  var PhoneField = BaseField.extend({
2498
2568
  defaultValue: NonEmptyTextValue.optional(),
2499
2569
  type: import_v43.default.literal(FieldType.PHONE)
2500
- }).describe("Phone input field");
2570
+ }).meta({
2571
+ description: "A field for entering a phone number",
2572
+ id: "PhoneField"
2573
+ });
2501
2574
  var IdField = BaseField.extend({
2502
2575
  defaultValue: NonEmptyTextValue.optional(),
2503
2576
  type: import_v43.default.literal(FieldType.ID)
2504
- }).describe("ID input field");
2577
+ }).meta({
2578
+ description: "A field for entering an ID",
2579
+ id: "IdField"
2580
+ });
2505
2581
  var Checkbox = BaseField.extend({
2506
2582
  type: import_v43.default.literal(FieldType.CHECKBOX),
2507
2583
  defaultValue: CheckboxFieldValue.default(false)
2508
- }).describe("Boolean checkbox field");
2584
+ }).meta({
2585
+ description: "A boolean checkbox field",
2586
+ id: "Checkbox"
2587
+ });
2509
2588
  var Country = BaseField.extend({
2510
2589
  type: import_v43.default.literal(FieldType.COUNTRY),
2511
2590
  defaultValue: NonEmptyTextValue.optional(),
2512
2591
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
2513
2592
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
2514
2593
  )
2515
- }).describe("Country select field");
2594
+ }).meta({
2595
+ description: "A field for selecting a country",
2596
+ id: "Country"
2597
+ });
2516
2598
  var AllowedLocations = JurisdictionReference.optional().describe(
2517
2599
  "Limits which location options are selectable depending on user jurisdiction and location."
2518
2600
  );
@@ -2521,16 +2603,18 @@ var AdministrativeAreas = import_v43.default.enum([
2521
2603
  "HEALTH_FACILITY",
2522
2604
  "CRVS_OFFICE"
2523
2605
  ]);
2524
- var AdministrativeAreaConfiguration = import_v43.default.object({
2525
- partOf: FieldReference.optional().describe("Parent location"),
2526
- type: AdministrativeAreas,
2527
- allowedLocations: AllowedLocations
2528
- }).describe("Administrative area options");
2529
2606
  var AdministrativeAreaField = BaseField.extend({
2530
2607
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
2531
2608
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2532
- configuration: AdministrativeAreaConfiguration
2533
- }).describe("Administrative area input field e.g. facility, office");
2609
+ configuration: import_v43.default.object({
2610
+ partOf: FieldReference.optional().describe("Parent location"),
2611
+ type: AdministrativeAreas,
2612
+ allowedLocations: AllowedLocations
2613
+ }).describe("Administrative area options")
2614
+ }).meta({
2615
+ description: "Administrative area input field",
2616
+ id: "AdministrativeAreaField"
2617
+ });
2534
2618
  var LocationInput = BaseField.extend({
2535
2619
  type: import_v43.default.literal(FieldType.LOCATION),
2536
2620
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
@@ -2538,7 +2622,10 @@ var LocationInput = BaseField.extend({
2538
2622
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2539
2623
  allowedLocations: AllowedLocations
2540
2624
  }).optional()
2541
- }).describe("Input field for a location");
2625
+ }).meta({
2626
+ description: "A field for selecting a location",
2627
+ id: "LocationInput"
2628
+ });
2542
2629
  var FileUploadWithOptions = BaseField.extend({
2543
2630
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
2544
2631
  options: import_v43.default.array(SelectOption).describe("A list of options"),
@@ -2552,6 +2639,9 @@ var FileUploadWithOptions = BaseField.extend({
2552
2639
  }).default({
2553
2640
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2554
2641
  })
2642
+ }).meta({
2643
+ description: "A field for uploading files with file type options",
2644
+ id: "FileUploadWithOptions"
2555
2645
  });
2556
2646
  var Facility = BaseField.extend({
2557
2647
  type: import_v43.default.literal(FieldType.FACILITY),
@@ -2597,7 +2687,10 @@ var Address = BaseField.extend({
2597
2687
  allowedLocations: AllowedLocations
2598
2688
  }).optional(),
2599
2689
  defaultValue: DefaultAddressFieldValue.optional()
2600
- }).describe("Address input field \u2013 a combination of location and text fields");
2690
+ }).meta({
2691
+ description: "Address input field \u2013 a combination of location and text fields",
2692
+ id: "Address"
2693
+ });
2601
2694
  var StaticDataEntry = import_v43.default.object({
2602
2695
  id: import_v43.default.string().describe("ID for the data entry."),
2603
2696
  label: TranslationConfig,
@@ -2612,7 +2705,10 @@ var DataField = BaseField.extend({
2612
2705
  subtitle: TranslationConfig.optional(),
2613
2706
  data: import_v43.default.array(DataEntry)
2614
2707
  })
2615
- }).describe("Data field for displaying read-only data");
2708
+ }).meta({
2709
+ description: "A field for displaying a table of read-only data",
2710
+ id: "DataField"
2711
+ });
2616
2712
  var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2617
2713
  var ButtonType = import_v43.default.enum([
2618
2714
  "primary",
@@ -2639,11 +2735,17 @@ var ButtonField = BaseField.extend({
2639
2735
  type: import_v43.default.literal(FieldType.BUTTON),
2640
2736
  defaultValue: ButtonFieldValue.optional(),
2641
2737
  configuration: ButtonConfiguration
2642
- }).describe("Generic button without any built-in functionality");
2738
+ }).meta({
2739
+ description: "A generic button that can be used to trigger an action",
2740
+ id: "ButtonField"
2741
+ });
2643
2742
  var FieldGroup = BaseField.extend({
2644
2743
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
2645
2744
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2646
2745
  fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
2746
+ }).meta({
2747
+ description: "A group of fields that are displayed together",
2748
+ id: "FieldGroup"
2647
2749
  });
2648
2750
  var AlphaPrintButton = BaseField.extend({
2649
2751
  type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
@@ -2653,7 +2755,10 @@ var AlphaPrintButton = BaseField.extend({
2653
2755
  "Label for the print button"
2654
2756
  )
2655
2757
  })
2656
- }).describe("Print button field for printing certificates");
2758
+ }).meta({
2759
+ description: "An experimental print button field for printing certificates during the declaration process",
2760
+ id: "AlphaPrintButton"
2761
+ });
2657
2762
  var HttpField = BaseField.extend({
2658
2763
  type: import_v43.default.literal(FieldType.HTTP),
2659
2764
  defaultValue: HttpFieldValue.optional(),
@@ -2669,20 +2774,30 @@ var HttpField = BaseField.extend({
2669
2774
  params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
2670
2775
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2671
2776
  })
2672
- }).describe("HTTP request function triggered by a button click or other event");
2777
+ }).meta({
2778
+ 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.",
2779
+ id: "HttpField"
2780
+ });
2673
2781
  var AutocompleteField = BaseField.extend({
2674
2782
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2675
2783
  configuration: import_v43.default.object({
2676
- url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2784
+ url: import_v43.default.string().describe(
2785
+ "URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
2786
+ ).optional(),
2677
2787
  method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2678
2788
  defaultOptions: import_v43.default.array(
2679
2789
  import_v43.default.object({
2680
2790
  label: import_v43.default.string(),
2681
2791
  value: import_v43.default.string()
2682
2792
  })
2683
- ).optional()
2793
+ ).optional().describe(
2794
+ "Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
2795
+ )
2684
2796
  })
2685
- }).describe("Autocomplete input field");
2797
+ }).meta({
2798
+ 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.",
2799
+ id: "AutocompleteField"
2800
+ });
2686
2801
  var SearchField = HttpField.extend({
2687
2802
  type: import_v43.default.literal(FieldType.SEARCH),
2688
2803
  configuration: SearchQuery.pick({
@@ -2715,6 +2830,9 @@ var SearchField = HttpField.extend({
2715
2830
  ok: TranslationConfig.optional()
2716
2831
  }).optional()
2717
2832
  })
2833
+ }).meta({
2834
+ description: "A search input field",
2835
+ id: "SearchField"
2718
2836
  });
2719
2837
  var LinkButtonField = BaseField.extend({
2720
2838
  type: import_v43.default.literal(FieldType.LINK_BUTTON),
@@ -2723,7 +2841,10 @@ var LinkButtonField = BaseField.extend({
2723
2841
  text: TranslationConfig.describe("Text to display on the button"),
2724
2842
  icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
2725
2843
  })
2726
- }).describe("Button that opens a link");
2844
+ }).meta({
2845
+ description: "A button that opens a URL link",
2846
+ id: "LinkButtonField"
2847
+ });
2727
2848
  var VerificationStatus = BaseField.extend({
2728
2849
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2729
2850
  defaultValue: VerificationStatusValue.optional(),
@@ -2733,15 +2854,19 @@ var VerificationStatus = BaseField.extend({
2733
2854
  "Explaining text on the banner in form."
2734
2855
  )
2735
2856
  })
2857
+ }).meta({
2858
+ 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.",
2859
+ id: "VerificationStatus"
2736
2860
  });
2737
2861
  var QueryParamReaderField = BaseField.extend({
2738
2862
  type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
2739
2863
  configuration: import_v43.default.object({
2740
2864
  pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
2741
2865
  })
2742
- }).describe(
2743
- "A field that maps URL query params into form values and clears them afterward"
2744
- );
2866
+ }).meta({
2867
+ description: "A field that maps URL query params into form values and clears them afterward",
2868
+ id: "QueryParamReaderField"
2869
+ });
2745
2870
  var QrReaderField = BaseField.extend({
2746
2871
  type: import_v43.default.literal(FieldType.QR_READER),
2747
2872
  defaultValue: QrReaderFieldValue.optional(),
@@ -2752,7 +2877,7 @@ var QrReaderField = BaseField.extend({
2752
2877
  })
2753
2878
  }).optional()
2754
2879
  }).meta({
2755
- description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2880
+ description: "QR code reader field, including optional JSON Schema validator.",
2756
2881
  id: "QrReaderField"
2757
2882
  });
2758
2883
  var IdReaderField = BaseField.extend({
@@ -2761,12 +2886,18 @@ var IdReaderField = BaseField.extend({
2761
2886
  methods: import_v43.default.array(
2762
2887
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2763
2888
  )
2889
+ }).meta({
2890
+ description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
2891
+ id: "IdReaderField"
2764
2892
  });
2765
2893
  var CustomField = BaseField.extend({
2766
2894
  type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
2767
2895
  defaultValue: CustomFieldValue.optional(),
2768
2896
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2769
2897
  configuration: import_v43.default.unknown().optional()
2898
+ }).meta({
2899
+ description: "An expiremental custom field that is defined by a module source path",
2900
+ id: "CustomField"
2770
2901
  });
2771
2902
  var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2772
2903
  var LoaderField = BaseField.extend({
@@ -2776,22 +2907,25 @@ var LoaderField = BaseField.extend({
2776
2907
  configuration: import_v43.default.object({
2777
2908
  text: TranslationConfig.describe("Display text above the loading spinner")
2778
2909
  })
2779
- }).describe(
2780
- "A non-interactive field that indicates an in progress operation in form"
2781
- );
2910
+ }).meta({
2911
+ description: "A non-interactive field that indicates an in progress operation in form",
2912
+ id: "LoaderField"
2913
+ });
2782
2914
  var HiddenField = BaseField.extend({
2783
2915
  type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
2784
2916
  required: import_v43.default.boolean().default(false).optional(),
2785
2917
  defaultValue: TextValue.optional()
2786
- }).describe(
2787
- "A non-interactive, hidden field that only hold a value in the form"
2788
- );
2918
+ }).meta({
2919
+ description: "A non-interactive, hidden field that only hold a value in the form",
2920
+ id: "HiddenField"
2921
+ });
2789
2922
  var UserRoleField = BaseField.extend({
2790
2923
  type: import_v43.default.literal(FieldType.USER_ROLE),
2791
2924
  defaultValue: TextValue.optional()
2792
- }).describe(
2793
- "A select dropdown that is automatically populated with available user roles"
2794
- );
2925
+ }).meta({
2926
+ description: "A select dropdown that is automatically populated with available user roles",
2927
+ id: "UserRoleField"
2928
+ });
2795
2929
  var FieldConfig = import_v43.default.discriminatedUnion("type", [
2796
2930
  FieldGroup,
2797
2931
  Address,
@@ -2891,15 +3025,18 @@ var VerificationPageConfig = FormPageConfig.extend({
2891
3025
  actions: VerificationActionConfig
2892
3026
  });
2893
3027
  var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
2894
- description: "Page configuration",
2895
- id: "PageConfig"
3028
+ id: "PageConfig",
3029
+ 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."
2896
3030
  });
2897
3031
 
2898
3032
  // ../commons/src/events/FormConfig.ts
2899
3033
  var DeclarationFormConfig = z22.object({
2900
3034
  label: TranslationConfig.describe("Human readable description of the form"),
2901
3035
  pages: z22.array(FormPageConfig)
2902
- }).describe("Configuration of the declaration form.");
3036
+ }).meta({
3037
+ id: "DeclarationFormConfig",
3038
+ description: "Configuration of the declaration form."
3039
+ });
2903
3040
  var ActionFormConfig = z22.object({
2904
3041
  label: TranslationConfig.describe("Human readable description of the form"),
2905
3042
  pages: z22.array(PageConfig)
@@ -3116,17 +3253,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
3116
3253
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
3117
3254
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
3118
3255
  */
3119
- ReadActionConfig.meta({ id: "ReadActionConfig" }),
3120
- DeclareConfig.meta({ id: "DeclareActionConfig" }),
3121
- RejectConfig.meta({ id: "RejectActionConfig" }),
3122
- RegisterConfig.meta({ id: "RegisterActionConfig" }),
3256
+ ReadActionConfig.meta({
3257
+ id: "ReadActionConfig",
3258
+ description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
3259
+ }),
3260
+ DeclareConfig.meta({
3261
+ id: "DeclareActionConfig",
3262
+ description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
3263
+ }),
3264
+ RejectConfig.meta({
3265
+ id: "RejectActionConfig",
3266
+ description: "Configuration for rejecting a record before registration."
3267
+ }),
3268
+ RegisterConfig.meta({
3269
+ id: "RegisterActionConfig",
3270
+ description: "Configuration for registering a record."
3271
+ }),
3123
3272
  PrintCertificateActionConfig.meta({
3124
- id: "PrintCertificateActionConfig"
3273
+ id: "PrintCertificateActionConfig",
3274
+ description: "Configuration for printing a certificate of a registered record."
3275
+ }),
3276
+ RequestCorrectionConfig.meta({
3277
+ id: "RequestCorrectionActionConfig",
3278
+ description: "Configuration for requesting a correction on a registered record."
3279
+ }),
3280
+ EditActionConfig.meta({
3281
+ id: "EditActionConfig",
3282
+ description: "Configuration for editing a record before registration."
3125
3283
  }),
3126
- RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
3127
- EditActionConfig.meta({ id: "EditActionConfig" }),
3128
- ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
3129
- CustomActionConfig.meta({ id: "CustomActionConfig" })
3284
+ ArchiveConfig.meta({
3285
+ id: "ArchiveActionConfig",
3286
+ description: "Configuration for archiving a record."
3287
+ }),
3288
+ CustomActionConfig.meta({
3289
+ id: "CustomActionConfig",
3290
+ description: "Configuration for a country-defined custom action. An event may include any number of these."
3291
+ })
3130
3292
  ]).describe(
3131
3293
  "Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
3132
3294
  ).meta({ id: "ActionConfig" });
@@ -5399,8 +5561,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
5399
5561
  validateActionFlags(event2, ctx);
5400
5562
  validateActionOrder(event2, ctx);
5401
5563
  }).meta({
5402
- id: "EventConfig"
5403
- }).describe("Configuration defining an event type.");
5564
+ id: "EventConfig",
5565
+ description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
5566
+ });
5404
5567
 
5405
5568
  // ../commons/src/events/EventConfigInput.ts
5406
5569
  var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);