@opencrvs/toolkit 2.0.0-rc.a8e70b1 → 2.0.0-rc.a928ed6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/create-countryconfig/index.js +73 -0
  2. package/create-countryconfig/package.json +11 -0
  3. package/dist/application-config/index.js +203 -81
  4. package/dist/cli.js +504 -170
  5. package/dist/commons/api/router.d.ts +3322 -268
  6. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  7. package/dist/commons/conditionals/validate.d.ts +1 -0
  8. package/dist/commons/events/ActionInput.d.ts +108 -0
  9. package/dist/commons/events/Draft.d.ts +3 -0
  10. package/dist/commons/events/EventIndex.d.ts +0 -3
  11. package/dist/commons/events/EventMetadata.d.ts +0 -7
  12. package/dist/commons/events/FieldConfig.d.ts +5 -0
  13. package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
  14. package/dist/commons/events/locations.d.ts +21 -0
  15. package/dist/commons/events/mocks.test.utils.d.ts +19 -0
  16. package/dist/commons/events/scopes.d.ts +24 -1
  17. package/dist/commons/events/state/index.d.ts +0 -4
  18. package/dist/commons/events/state/utils.d.ts +0 -2
  19. package/dist/commons/events/utils.d.ts +1 -1
  20. package/dist/conditionals/index.js +5 -3
  21. package/dist/events/index.js +285 -129
  22. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
  23. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +60 -35
  24. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  25. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  26. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -2
  27. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
  28. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
  29. package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
  30. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
  31. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
  32. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
  33. package/dist/migrations/v2.0/index.d.ts +5 -3
  34. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  35. package/dist/migrations/v2.0/index.js +502 -168
  36. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
  37. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +90 -1
  38. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
  39. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
  40. package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
  41. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  42. package/dist/migrations/v2.0/migrate-scopes.js +54 -30
  43. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
  44. package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
  45. package/dist/notification/index.js +217 -99
  46. package/dist/scopes/index.d.ts +6 -1
  47. package/dist/scopes/index.js +5 -3
  48. package/opencrvs-toolkit-2.0.0-rc.a928ed6.tgz +0 -0
  49. package/package.json +1 -1
  50. package/tsconfig.tsbuildinfo +1 -1
  51. package/opencrvs-toolkit-2.0.0-rc.a8e70b1.tgz +0 -0
@@ -75,7 +75,10 @@ var ActionConditional = z.discriminatedUnion("type", [
75
75
  ShowConditional,
76
76
  // Action can be shown to the user in the list but as disabled
77
77
  EnableConditional
78
- ]);
78
+ ]).meta({
79
+ description: "Action conditional configuration",
80
+ id: "ActionConditional"
81
+ });
79
82
  var DisplayOnReviewConditional = z.object({
80
83
  type: z.literal(ConditionalType.DISPLAY_ON_REVIEW),
81
84
  conditional: Conditional
@@ -418,28 +421,20 @@ function schemaPriority(schema) {
418
421
  return idx === -1 ? 9999 : idx;
419
422
  }
420
423
  function safeUnion(schemas) {
424
+ const sortedSchemas = [...schemas].sort(
425
+ (a, b) => schemaPriority(a) - schemaPriority(b)
426
+ );
421
427
  return z7.any().superRefine((val, ctx) => {
422
- const successful = schemas.filter((s) => s.safeParse(val).success);
423
- if (successful.length === 1) {
424
- return;
425
- }
426
- if (successful.length === 0) {
427
- ctx.addIssue({
428
- code: "invalid_type",
429
- expected: "custom",
430
- message: "Value does not match any schema"
431
- });
432
- return;
433
- }
434
- successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
435
- const best = successful[0];
436
- if (!best.safeParse(val).success) {
437
- ctx.addIssue({
438
- expected: "custom",
439
- code: "invalid_type",
440
- message: "Value did not match the best schema"
441
- });
428
+ for (const schema of sortedSchemas) {
429
+ if (schema.safeParse(val).success) {
430
+ return;
431
+ }
442
432
  }
433
+ ctx.addIssue({
434
+ code: "invalid_type",
435
+ expected: "custom",
436
+ message: "Value does not match any schema"
437
+ });
443
438
  }).meta({
444
439
  description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
445
440
  });
@@ -772,12 +767,14 @@ var SystemScopeType = z11.enum([
772
767
  "organisation.read-locations",
773
768
  "user.read",
774
769
  "user.create",
775
- "user.edit"
770
+ "user.edit",
771
+ "user.search"
776
772
  ]);
777
773
  var UserScopeType = SystemScopeType.extract([
778
774
  "user.read",
779
775
  "user.create",
780
- "user.edit"
776
+ "user.edit",
777
+ "user.search"
781
778
  ]);
782
779
  var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
783
780
  var UserScopeV2 = z11.discriminatedUnion("type", [
@@ -786,7 +783,7 @@ var UserScopeV2 = z11.discriminatedUnion("type", [
786
783
  options: AllUserScopeOptions.optional()
787
784
  }),
788
785
  z11.object({
789
- type: UserScopeType.extract(["user.read"]),
786
+ type: UserScopeType.extract(["user.read", "user.search"]),
790
787
  options: AccessLevelOptions.optional()
791
788
  })
792
789
  ]);
@@ -1083,6 +1080,9 @@ var FlagConfig = z14.object({
1083
1080
  "Indicates if this flag expects an action to be performed to be cleared."
1084
1081
  ),
1085
1082
  label: TranslationConfig.describe("Human readable label of the flag.")
1083
+ }).meta({
1084
+ description: "Flag configuration",
1085
+ id: "FlagConfig"
1086
1086
  });
1087
1087
  var ActionFlagConfig = z14.object({
1088
1088
  id: Flag,
@@ -1090,6 +1090,9 @@ var ActionFlagConfig = z14.object({
1090
1090
  conditional: Conditional.optional().describe(
1091
1091
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1092
1092
  )
1093
+ }).meta({
1094
+ description: "Action flag configuration",
1095
+ id: "ActionFlagConfig"
1093
1096
  });
1094
1097
 
1095
1098
  // ../commons/src/events/EventMetadata.ts
@@ -1111,8 +1114,7 @@ var ActionCreationMetadata = z15.object({
1111
1114
  ),
1112
1115
  createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1113
1116
  acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
1114
- createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation."),
1115
- createdBySignature: z15.string().nullish().describe("Signature of the user who created the action request.")
1117
+ createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
1116
1118
  });
1117
1119
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1118
1120
  registrationNumber: z15.string().describe(
@@ -1140,9 +1142,6 @@ var EventMetadata = z15.object({
1140
1142
  createdAtLocation: UUID.nullish().describe(
1141
1143
  "Location of the user who created the event."
1142
1144
  ),
1143
- createdBySignature: DocumentPath.nullish().describe(
1144
- "Signature of the user who created the event."
1145
- ),
1146
1145
  updatedAtLocation: UUID.nullish().describe(
1147
1146
  "Location of the user who last changed the status."
1148
1147
  ),
@@ -1406,7 +1405,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
1406
1405
  }
1407
1406
  }).describe("Unique identifier for the field");
1408
1407
  var FieldReference = import_v43.default.object({
1409
- $$field: FieldId,
1408
+ $$field: FieldId.describe("Id of the field to reference"),
1410
1409
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1411
1410
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1412
1411
  )
@@ -1452,6 +1451,9 @@ var BaseField = import_v43.default.object({
1452
1451
  }).describe("Common properties shared across all field types.");
1453
1452
  var Divider = BaseField.extend({
1454
1453
  type: import_v43.default.literal(FieldType.DIVIDER)
1454
+ }).meta({
1455
+ description: "A horizontal line divider",
1456
+ id: "Divider"
1455
1457
  });
1456
1458
  var TextField = BaseField.extend({
1457
1459
  type: import_v43.default.literal(FieldType.TEXT),
@@ -1462,7 +1464,10 @@ var TextField = BaseField.extend({
1462
1464
  prefix: TranslationConfig.optional(),
1463
1465
  postfix: TranslationConfig.optional()
1464
1466
  }).default({ type: "text" }).optional()
1465
- }).describe("Text input");
1467
+ }).meta({
1468
+ description: "A text input field",
1469
+ id: "TextField"
1470
+ });
1466
1471
  var NumberField = BaseField.extend({
1467
1472
  type: import_v43.default.literal(FieldType.NUMBER),
1468
1473
  defaultValue: NumberFieldValue.optional(),
@@ -1472,7 +1477,10 @@ var NumberField = BaseField.extend({
1472
1477
  prefix: TranslationConfig.optional(),
1473
1478
  postfix: TranslationConfig.optional()
1474
1479
  }).optional()
1475
- }).describe("Number input");
1480
+ }).meta({
1481
+ description: "A number input field",
1482
+ id: "NumberField"
1483
+ });
1476
1484
  var TextAreaField = BaseField.extend({
1477
1485
  type: import_v43.default.literal(FieldType.TEXTAREA),
1478
1486
  defaultValue: NonEmptyTextValue.optional(),
@@ -1483,7 +1491,10 @@ var TextAreaField = BaseField.extend({
1483
1491
  prefix: TranslationConfig.optional(),
1484
1492
  postfix: TranslationConfig.optional()
1485
1493
  }).default({ rows: 4 }).optional()
1486
- }).describe("Multiline text input");
1494
+ }).meta({
1495
+ description: "A multiline text input",
1496
+ id: "TextAreaField"
1497
+ });
1487
1498
  var ImageMimeType = import_v43.default.enum([
1488
1499
  "image/png",
1489
1500
  "image/jpg",
@@ -1513,13 +1524,19 @@ var SignatureField = BaseField.extend({
1513
1524
  }).default({
1514
1525
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1515
1526
  })
1516
- }).describe("Signature input field");
1527
+ }).meta({
1528
+ description: "A signature input field",
1529
+ id: "SignatureField"
1530
+ });
1517
1531
  var EmailField = BaseField.extend({
1518
1532
  type: import_v43.default.literal(FieldType.EMAIL),
1519
1533
  configuration: import_v43.default.object({
1520
1534
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1521
1535
  }).default({ maxLength: 255 }).optional(),
1522
1536
  defaultValue: NonEmptyTextValue.optional()
1537
+ }).meta({
1538
+ description: "An email input field",
1539
+ id: "EmailField"
1523
1540
  });
1524
1541
  var DateField = BaseField.extend({
1525
1542
  type: import_v43.default.literal(FieldType.DATE),
@@ -1529,7 +1546,10 @@ var DateField = BaseField.extend({
1529
1546
  "Text to display above the date input"
1530
1547
  ).optional()
1531
1548
  }).optional()
1532
- }).describe("A single date input (yyyy-MM-dd)");
1549
+ }).meta({
1550
+ description: "A date input (yyyy-MM-dd)",
1551
+ id: "DateField"
1552
+ });
1533
1553
  var AgeField = BaseField.extend({
1534
1554
  type: import_v43.default.literal(FieldType.AGE),
1535
1555
  defaultValue: NumberFieldValue.optional(),
@@ -1538,7 +1558,10 @@ var AgeField = BaseField.extend({
1538
1558
  prefix: TranslationConfig.optional(),
1539
1559
  postfix: TranslationConfig.optional()
1540
1560
  })
1541
- }).describe("An age input field which uses the current date as the asOfDate");
1561
+ }).meta({
1562
+ description: "An age input field which uses the current date as the asOfDate",
1563
+ id: "AgeField"
1564
+ });
1542
1565
  var TimeField = BaseField.extend({
1543
1566
  type: import_v43.default.literal(FieldType.TIME),
1544
1567
  defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
@@ -1548,7 +1571,10 @@ var TimeField = BaseField.extend({
1548
1571
  "Text to display above the time input"
1549
1572
  ).optional()
1550
1573
  }).optional()
1551
- }).describe("A single date input (HH-mm)");
1574
+ }).meta({
1575
+ description: "A single time input (HH-mm)",
1576
+ id: "TimeField"
1577
+ });
1552
1578
  var DateRangeField = BaseField.extend({
1553
1579
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1554
1580
  defaultValue: DateRangeFieldValue.optional(),
@@ -1557,7 +1583,10 @@ var DateRangeField = BaseField.extend({
1557
1583
  "Text to display above the date input"
1558
1584
  ).optional()
1559
1585
  }).optional()
1560
- }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
1586
+ }).meta({
1587
+ description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
1588
+ id: "DateRangeField"
1589
+ });
1561
1590
  var HtmlFontVariant = import_v43.default.enum([
1562
1591
  "reg12",
1563
1592
  "reg14",
@@ -1601,18 +1630,30 @@ var ImageViewField = BaseField.extend({
1601
1630
  type: import_v43.default.literal(FieldType.IMAGE_VIEW),
1602
1631
  defaultValue: NonEmptyTextValue.optional(),
1603
1632
  configuration: ImageConfiguration
1604
- }).describe("A read-only image component for form pages");
1633
+ }).meta({
1634
+ description: "A read-only image component for form pages",
1635
+ id: "ImageViewField"
1636
+ });
1605
1637
  var Paragraph = BaseField.extend({
1606
1638
  type: import_v43.default.literal(FieldType.PARAGRAPH),
1607
1639
  configuration: ParagraphConfiguration
1608
- }).describe("A read-only HTML <p> paragraph");
1640
+ }).meta({
1641
+ description: "A read-only HTML <p> paragraph",
1642
+ id: "Paragraph"
1643
+ });
1609
1644
  var Heading = BaseField.extend({
1610
1645
  type: import_v43.default.literal(FieldType.HEADING),
1611
1646
  configuration: HeadingConfiguration
1612
- }).describe("A read-only heading component for form pages");
1647
+ }).meta({
1648
+ description: "A read-only heading component for form pages",
1649
+ id: "Heading"
1650
+ });
1613
1651
  var PageHeader = BaseField.extend({
1614
1652
  type: import_v43.default.literal(FieldType.PAGE_HEADER)
1615
- }).describe("A read-only header component for form pages");
1653
+ }).meta({
1654
+ description: "A read-only header component for form pages",
1655
+ id: "PageHeader"
1656
+ });
1616
1657
  var File = BaseField.extend({
1617
1658
  type: import_v43.default.literal(FieldType.FILE),
1618
1659
  defaultValue: FileFieldValue.optional(),
@@ -1631,7 +1672,10 @@ var File = BaseField.extend({
1631
1672
  }).default({
1632
1673
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1633
1674
  })
1634
- }).describe("File upload");
1675
+ }).meta({
1676
+ description: "A file upload field",
1677
+ id: "File"
1678
+ });
1635
1679
  var SelectOption = import_v43.default.object({
1636
1680
  value: import_v43.default.string().describe("The value of the option"),
1637
1681
  label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
@@ -1648,7 +1692,10 @@ var NumberWithUnitField = BaseField.extend({
1648
1692
  "Placeholder for the number field"
1649
1693
  )
1650
1694
  }).optional()
1651
- }).describe("Number with unit input");
1695
+ }).meta({
1696
+ description: "A number with unit input field",
1697
+ id: "NumberWithUnitField"
1698
+ });
1652
1699
  var RadioGroup = BaseField.extend({
1653
1700
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1654
1701
  defaultValue: TextValue.optional(),
@@ -1658,7 +1705,10 @@ var RadioGroup = BaseField.extend({
1658
1705
  size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
1659
1706
  }).optional()
1660
1707
  }).optional()
1661
- }).describe("Grouped radio options");
1708
+ }).meta({
1709
+ description: "A grouped radio button field",
1710
+ id: "RadioGroup"
1711
+ });
1662
1712
  var BulletList = BaseField.extend({
1663
1713
  type: import_v43.default.literal(FieldType.BULLET_LIST),
1664
1714
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
@@ -1667,7 +1717,10 @@ var BulletList = BaseField.extend({
1667
1717
  fontVariant: HtmlFontVariant.optional()
1668
1718
  }).optional()
1669
1719
  }).default({})
1670
- }).describe("A list of bullet points");
1720
+ }).meta({
1721
+ description: "A list of bullet points",
1722
+ id: "BulletList"
1723
+ });
1671
1724
  var Select = BaseField.extend({
1672
1725
  type: import_v43.default.literal(FieldType.SELECT),
1673
1726
  defaultValue: TextValue.optional(),
@@ -1682,7 +1735,10 @@ var Select = BaseField.extend({
1682
1735
  { ..., defaultMessage: "'{input}' is not listed among the health facilities." }
1683
1736
  `
1684
1737
  )
1685
- }).describe("Select input");
1738
+ }).meta({
1739
+ description: "A select input field",
1740
+ id: "Select"
1741
+ });
1686
1742
  var SelectDateRangeOption = import_v43.default.object({
1687
1743
  value: SelectDateRangeValue.describe("The value of the option"),
1688
1744
  label: TranslationConfig.describe("The label of the option")
@@ -1691,7 +1747,10 @@ var SelectDateRangeField = BaseField.extend({
1691
1747
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
1692
1748
  defaultValue: SelectDateRangeValue.optional(),
1693
1749
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
1694
- }).describe("Select input with date range options");
1750
+ }).meta({
1751
+ description: "A date range selection field",
1752
+ id: "SelectDateRangeField"
1753
+ });
1695
1754
  var NameConfig = import_v43.default.object({
1696
1755
  firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1697
1756
  middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
@@ -1722,26 +1781,41 @@ var NameField = BaseField.extend({
1722
1781
  surname: { required: true }
1723
1782
  }
1724
1783
  }).optional()
1725
- }).describe("Name input field");
1784
+ }).meta({
1785
+ description: "A field for entering a persons name",
1786
+ id: "NameField"
1787
+ });
1726
1788
  var PhoneField = BaseField.extend({
1727
1789
  defaultValue: NonEmptyTextValue.optional(),
1728
1790
  type: import_v43.default.literal(FieldType.PHONE)
1729
- }).describe("Phone input field");
1791
+ }).meta({
1792
+ description: "A field for entering a phone number",
1793
+ id: "PhoneField"
1794
+ });
1730
1795
  var IdField = BaseField.extend({
1731
1796
  defaultValue: NonEmptyTextValue.optional(),
1732
1797
  type: import_v43.default.literal(FieldType.ID)
1733
- }).describe("ID input field");
1798
+ }).meta({
1799
+ description: "A field for entering an ID",
1800
+ id: "IdField"
1801
+ });
1734
1802
  var Checkbox = BaseField.extend({
1735
1803
  type: import_v43.default.literal(FieldType.CHECKBOX),
1736
1804
  defaultValue: CheckboxFieldValue.default(false)
1737
- }).describe("Boolean checkbox field");
1805
+ }).meta({
1806
+ description: "A boolean checkbox field",
1807
+ id: "Checkbox"
1808
+ });
1738
1809
  var Country = BaseField.extend({
1739
1810
  type: import_v43.default.literal(FieldType.COUNTRY),
1740
1811
  defaultValue: NonEmptyTextValue.optional(),
1741
1812
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
1742
1813
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
1743
1814
  )
1744
- }).describe("Country select field");
1815
+ }).meta({
1816
+ description: "A field for selecting a country",
1817
+ id: "Country"
1818
+ });
1745
1819
  var AllowedLocations = JurisdictionReference.optional().describe(
1746
1820
  "Limits which location options are selectable depending on user jurisdiction and location."
1747
1821
  );
@@ -1750,16 +1824,18 @@ var AdministrativeAreas = import_v43.default.enum([
1750
1824
  "HEALTH_FACILITY",
1751
1825
  "CRVS_OFFICE"
1752
1826
  ]);
1753
- var AdministrativeAreaConfiguration = import_v43.default.object({
1754
- partOf: FieldReference.optional().describe("Parent location"),
1755
- type: AdministrativeAreas,
1756
- allowedLocations: AllowedLocations
1757
- }).describe("Administrative area options");
1758
1827
  var AdministrativeAreaField = BaseField.extend({
1759
1828
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
1760
1829
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1761
- configuration: AdministrativeAreaConfiguration
1762
- }).describe("Administrative area input field e.g. facility, office");
1830
+ configuration: import_v43.default.object({
1831
+ partOf: FieldReference.optional().describe("Parent location"),
1832
+ type: AdministrativeAreas,
1833
+ allowedLocations: AllowedLocations
1834
+ }).describe("Administrative area options")
1835
+ }).meta({
1836
+ description: "Administrative area input field",
1837
+ id: "AdministrativeAreaField"
1838
+ });
1763
1839
  var LocationInput = BaseField.extend({
1764
1840
  type: import_v43.default.literal(FieldType.LOCATION),
1765
1841
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
@@ -1767,7 +1843,10 @@ var LocationInput = BaseField.extend({
1767
1843
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
1768
1844
  allowedLocations: AllowedLocations
1769
1845
  }).optional()
1770
- }).describe("Input field for a location");
1846
+ }).meta({
1847
+ description: "A field for selecting a location",
1848
+ id: "LocationInput"
1849
+ });
1771
1850
  var FileUploadWithOptions = BaseField.extend({
1772
1851
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
1773
1852
  options: import_v43.default.array(SelectOption).describe("A list of options"),
@@ -1781,6 +1860,9 @@ var FileUploadWithOptions = BaseField.extend({
1781
1860
  }).default({
1782
1861
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1783
1862
  })
1863
+ }).meta({
1864
+ description: "A field for uploading files with file type options",
1865
+ id: "FileUploadWithOptions"
1784
1866
  });
1785
1867
  var Facility = BaseField.extend({
1786
1868
  type: import_v43.default.literal(FieldType.FACILITY),
@@ -1826,7 +1908,10 @@ var Address = BaseField.extend({
1826
1908
  allowedLocations: AllowedLocations
1827
1909
  }).optional(),
1828
1910
  defaultValue: DefaultAddressFieldValue.optional()
1829
- }).describe("Address input field \u2013 a combination of location and text fields");
1911
+ }).meta({
1912
+ description: "Address input field \u2013 a combination of location and text fields",
1913
+ id: "Address"
1914
+ });
1830
1915
  var StaticDataEntry = import_v43.default.object({
1831
1916
  id: import_v43.default.string().describe("ID for the data entry."),
1832
1917
  label: TranslationConfig,
@@ -1841,7 +1926,10 @@ var DataField = BaseField.extend({
1841
1926
  subtitle: TranslationConfig.optional(),
1842
1927
  data: import_v43.default.array(DataEntry)
1843
1928
  })
1844
- }).describe("Data field for displaying read-only data");
1929
+ }).meta({
1930
+ description: "A field for displaying a table of read-only data",
1931
+ id: "DataField"
1932
+ });
1845
1933
  var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
1846
1934
  var ButtonType = import_v43.default.enum([
1847
1935
  "primary",
@@ -1868,11 +1956,17 @@ var ButtonField = BaseField.extend({
1868
1956
  type: import_v43.default.literal(FieldType.BUTTON),
1869
1957
  defaultValue: ButtonFieldValue.optional(),
1870
1958
  configuration: ButtonConfiguration
1871
- }).describe("Generic button without any built-in functionality");
1959
+ }).meta({
1960
+ description: "A generic button that can be used to trigger an action",
1961
+ id: "ButtonField"
1962
+ });
1872
1963
  var FieldGroup = BaseField.extend({
1873
1964
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
1874
1965
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
1875
1966
  fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
1967
+ }).meta({
1968
+ description: "A group of fields that are displayed together",
1969
+ id: "FieldGroup"
1876
1970
  });
1877
1971
  var AlphaPrintButton = BaseField.extend({
1878
1972
  type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
@@ -1882,7 +1976,10 @@ var AlphaPrintButton = BaseField.extend({
1882
1976
  "Label for the print button"
1883
1977
  )
1884
1978
  })
1885
- }).describe("Print button field for printing certificates");
1979
+ }).meta({
1980
+ description: "An experimental print button field for printing certificates during the declaration process",
1981
+ id: "AlphaPrintButton"
1982
+ });
1886
1983
  var HttpField = BaseField.extend({
1887
1984
  type: import_v43.default.literal(FieldType.HTTP),
1888
1985
  defaultValue: HttpFieldValue.optional(),
@@ -1898,7 +1995,10 @@ var HttpField = BaseField.extend({
1898
1995
  params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
1899
1996
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
1900
1997
  })
1901
- }).describe("HTTP request function triggered by a button click or other event");
1998
+ }).meta({
1999
+ 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.",
2000
+ id: "HttpField"
2001
+ });
1902
2002
  var AutocompleteField = BaseField.extend({
1903
2003
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
1904
2004
  configuration: import_v43.default.object({
@@ -1911,7 +2011,10 @@ var AutocompleteField = BaseField.extend({
1911
2011
  })
1912
2012
  ).optional()
1913
2013
  })
1914
- }).describe("Autocomplete input field");
2014
+ }).meta({
2015
+ description: "Autocomplete input field",
2016
+ id: "AutocompleteField"
2017
+ });
1915
2018
  var SearchField = HttpField.extend({
1916
2019
  type: import_v43.default.literal(FieldType.SEARCH),
1917
2020
  configuration: SearchQuery.pick({
@@ -1944,6 +2047,9 @@ var SearchField = HttpField.extend({
1944
2047
  ok: TranslationConfig.optional()
1945
2048
  }).optional()
1946
2049
  })
2050
+ }).meta({
2051
+ description: "A search input field",
2052
+ id: "SearchField"
1947
2053
  });
1948
2054
  var LinkButtonField = BaseField.extend({
1949
2055
  type: import_v43.default.literal(FieldType.LINK_BUTTON),
@@ -1952,7 +2058,10 @@ var LinkButtonField = BaseField.extend({
1952
2058
  text: TranslationConfig.describe("Text to display on the button"),
1953
2059
  icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
1954
2060
  })
1955
- }).describe("Button that opens a link");
2061
+ }).meta({
2062
+ description: "A button that opens a URL link",
2063
+ id: "LinkButtonField"
2064
+ });
1956
2065
  var VerificationStatus = BaseField.extend({
1957
2066
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
1958
2067
  defaultValue: VerificationStatusValue.optional(),
@@ -1962,15 +2071,19 @@ var VerificationStatus = BaseField.extend({
1962
2071
  "Explaining text on the banner in form."
1963
2072
  )
1964
2073
  })
2074
+ }).meta({
2075
+ 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.",
2076
+ id: "VerificationStatus"
1965
2077
  });
1966
2078
  var QueryParamReaderField = BaseField.extend({
1967
2079
  type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
1968
2080
  configuration: import_v43.default.object({
1969
2081
  pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
1970
2082
  })
1971
- }).describe(
1972
- "A field that maps URL query params into form values and clears them afterward"
1973
- );
2083
+ }).meta({
2084
+ description: "A field that maps URL query params into form values and clears them afterward",
2085
+ id: "QueryParamReaderField"
2086
+ });
1974
2087
  var QrReaderField = BaseField.extend({
1975
2088
  type: import_v43.default.literal(FieldType.QR_READER),
1976
2089
  defaultValue: QrReaderFieldValue.optional(),
@@ -1981,7 +2094,7 @@ var QrReaderField = BaseField.extend({
1981
2094
  })
1982
2095
  }).optional()
1983
2096
  }).meta({
1984
- description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2097
+ description: "QR code reader field, including optional JSON Schema validator.",
1985
2098
  id: "QrReaderField"
1986
2099
  });
1987
2100
  var IdReaderField = BaseField.extend({
@@ -1990,12 +2103,18 @@ var IdReaderField = BaseField.extend({
1990
2103
  methods: import_v43.default.array(
1991
2104
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
1992
2105
  )
2106
+ }).meta({
2107
+ description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
2108
+ id: "IdReaderField"
1993
2109
  });
1994
2110
  var CustomField = BaseField.extend({
1995
2111
  type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
1996
2112
  defaultValue: CustomFieldValue.optional(),
1997
2113
  src: import_v43.default.string().describe("Module source path for the custom field component"),
1998
2114
  configuration: import_v43.default.unknown().optional()
2115
+ }).meta({
2116
+ description: "An expiremental custom field that is defined by a module source path",
2117
+ id: "CustomField"
1999
2118
  });
2000
2119
  var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2001
2120
  var LoaderField = BaseField.extend({
@@ -2005,22 +2124,25 @@ var LoaderField = BaseField.extend({
2005
2124
  configuration: import_v43.default.object({
2006
2125
  text: TranslationConfig.describe("Display text above the loading spinner")
2007
2126
  })
2008
- }).describe(
2009
- "A non-interactive field that indicates an in progress operation in form"
2010
- );
2127
+ }).meta({
2128
+ description: "A non-interactive field that indicates an in progress operation in form",
2129
+ id: "LoaderField"
2130
+ });
2011
2131
  var HiddenField = BaseField.extend({
2012
2132
  type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
2013
2133
  required: import_v43.default.boolean().default(false).optional(),
2014
2134
  defaultValue: TextValue.optional()
2015
- }).describe(
2016
- "A non-interactive, hidden field that only hold a value in the form"
2017
- );
2135
+ }).meta({
2136
+ description: "A non-interactive, hidden field that only hold a value in the form",
2137
+ id: "HiddenField"
2138
+ });
2018
2139
  var UserRoleField = BaseField.extend({
2019
2140
  type: import_v43.default.literal(FieldType.USER_ROLE),
2020
2141
  defaultValue: TextValue.optional()
2021
- }).describe(
2022
- "A select dropdown that is automatically populated with available user roles"
2023
- );
2142
+ }).meta({
2143
+ description: "A select dropdown that is automatically populated with available user roles",
2144
+ id: "UserRoleField"
2145
+ });
2024
2146
  var FieldConfig = import_v43.default.discriminatedUnion("type", [
2025
2147
  FieldGroup,
2026
2148
  Address,