@opencrvs/toolkit 1.8.1-rc.38ac682 → 1.8.1-rc.45a3ec4

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.
@@ -297,7 +297,6 @@ __export(events_exports, {
297
297
  isPageVisible: () => isPageVisible,
298
298
  isParagraphFieldType: () => isParagraphFieldType,
299
299
  isPhoneFieldType: () => isPhoneFieldType,
300
- isPrintButtonFieldType: () => isPrintButtonFieldType,
301
300
  isRadioGroupFieldType: () => isRadioGroupFieldType,
302
301
  isSelectDateRangeFieldType: () => isSelectDateRangeFieldType,
303
302
  isSelectFieldType: () => isSelectFieldType,
@@ -538,8 +537,7 @@ var FieldType = {
538
537
  FACILITY: "FACILITY",
539
538
  OFFICE: "OFFICE",
540
539
  SIGNATURE: "SIGNATURE",
541
- DATA: "DATA",
542
- PRINT_BUTTON: "PRINT_BUTTON"
540
+ DATA: "DATA"
543
541
  };
544
542
  var fieldTypes = Object.values(FieldType);
545
543
  var compositeFieldTypes = [
@@ -608,8 +606,8 @@ var UrbanAddressUpdateValue = AdminStructure.extend({
608
606
  zipCode: import_zod5.z.string().nullish()
609
607
  });
610
608
  var NameFieldValue = import_zod5.z.object({
611
- firstname: import_zod5.z.string(),
612
- surname: import_zod5.z.string(),
609
+ firstname: import_zod5.z.string().min(1),
610
+ surname: import_zod5.z.string().min(1),
613
611
  middlename: import_zod5.z.string().optional()
614
612
  });
615
613
  var NameFieldUpdateValue = import_zod5.z.object({
@@ -1006,15 +1004,6 @@ var DataField = BaseField.extend({
1006
1004
  data: import_zod7.z.array(DataEntry)
1007
1005
  })
1008
1006
  }).describe("Data field for displaying read-only data");
1009
- var PrintButton = BaseField.extend({
1010
- type: import_zod7.z.literal(FieldType.PRINT_BUTTON),
1011
- configuration: import_zod7.z.object({
1012
- template: import_zod7.z.string().describe("Template ID from countryconfig templates to use for printing"),
1013
- buttonLabel: TranslationConfig.optional().describe(
1014
- "Label for the print button"
1015
- )
1016
- })
1017
- }).describe("Print button field for printing certificates");
1018
1007
  var FieldConfig = import_zod7.z.discriminatedUnion("type", [
1019
1008
  Address,
1020
1009
  TextField,
@@ -1043,8 +1032,7 @@ var FieldConfig = import_zod7.z.discriminatedUnion("type", [
1043
1032
  SignatureField,
1044
1033
  EmailField,
1045
1034
  FileUploadWithOptions,
1046
- DataField,
1047
- PrintButton
1035
+ DataField
1048
1036
  ]).openapi({
1049
1037
  description: "Form field configuration",
1050
1038
  ref: "FieldConfig"
@@ -1352,7 +1340,7 @@ var SummaryConfig = import_zod14.z.object({
1352
1340
 
1353
1341
  // ../commons/src/events/AdvancedSearchConfig.ts
1354
1342
  var import_zod15 = require("zod");
1355
- var MatchType = import_zod15.z.enum(["fuzzy", "exact", "range"]);
1343
+ var MatchType = import_zod15.z.enum(["fuzzy", "exact", "range", "within"]);
1356
1344
  var BaseField3 = import_zod15.z.object({
1357
1345
  config: import_zod15.z.object({
1358
1346
  type: MatchType.describe("Determines the type of field")
@@ -2106,9 +2094,6 @@ function mapFieldTypeToZod(type, required) {
2106
2094
  case FieldType.NAME:
2107
2095
  schema = required ? NameFieldValue : NameFieldUpdateValue;
2108
2096
  break;
2109
- case FieldType.PRINT_BUTTON:
2110
- schema = TextValue;
2111
- break;
2112
2097
  }
2113
2098
  return required ? schema : schema.nullish();
2114
2099
  }
@@ -2169,8 +2154,6 @@ function mapFieldTypeToEmptyValue(field2) {
2169
2154
  };
2170
2155
  case FieldType.FILE_WITH_OPTIONS:
2171
2156
  return [];
2172
- case FieldType.PRINT_BUTTON:
2173
- return null;
2174
2157
  }
2175
2158
  }
2176
2159
  var isParagraphFieldType = (field2) => {
@@ -2257,9 +2240,6 @@ var isOfficeFieldType = (field2) => {
2257
2240
  var isDataFieldType = (field2) => {
2258
2241
  return field2.config.type === FieldType.DATA;
2259
2242
  };
2260
- var isPrintButtonFieldType = (field2) => {
2261
- return field2.config.type === FieldType.PRINT_BUTTON;
2262
- };
2263
2243
  var isNonInteractiveFieldType = (field2) => {
2264
2244
  return field2.type === FieldType.DIVIDER || field2.type === FieldType.PAGE_HEADER || field2.type === FieldType.PARAGRAPH || field2.type === FieldType.BULLET_LIST || field2.type === FieldType.DATA;
2265
2245
  };
@@ -3195,6 +3175,19 @@ function createSearchConfig(baseField) {
3195
3175
  fuzzy: () => ({
3196
3176
  ...baseField,
3197
3177
  config: { type: "fuzzy" }
3178
+ }),
3179
+ /**
3180
+ * Creates a configuration for matching locations and the child locations
3181
+ * @returns An object containing the field ID and a configuration object with a type of 'within'.
3182
+ * @example field('createdAtLocation').within()
3183
+ * // {
3184
+ * // ...
3185
+ * // config: { type: 'within' }
3186
+ * // }
3187
+ */
3188
+ within: () => ({
3189
+ ...baseField,
3190
+ config: { type: "within" }
3198
3191
  })
3199
3192
  };
3200
3193
  }
@@ -3544,6 +3537,9 @@ var QueryExpression = import_zod25.z.object({
3544
3537
  createdAt: import_zod25.z.optional(DateCondition),
3545
3538
  updatedAt: import_zod25.z.optional(DateCondition),
3546
3539
  "legalStatuses.REGISTERED.acceptedAt": import_zod25.z.optional(DateCondition),
3540
+ "legalStatuses.DECLARED.createdAtLocation": import_zod25.z.optional(
3541
+ import_zod25.z.union([Within, Exact])
3542
+ ),
3547
3543
  "legalStatuses.REGISTERED.createdAtLocation": import_zod25.z.optional(
3548
3544
  import_zod25.z.union([Within, Exact])
3549
3545
  ),
@@ -6503,8 +6499,6 @@ function mapFieldTypeToMockValue(field2, i, rng) {
6503
6499
  return "2021-01-01";
6504
6500
  case FieldType.TIME:
6505
6501
  return "09:33";
6506
- case FieldType.PRINT_BUTTON:
6507
- return void 0;
6508
6502
  case FieldType.DATE_RANGE:
6509
6503
  return {
6510
6504
  start: "2021-01-01",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.8.1-rc.38ac682",
3
+ "version": "1.8.1-rc.45a3ec4",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {