@opencrvs/toolkit 1.9.5-rc.fe5b5f8 → 1.9.6-rc.54e1cbb

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.
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, LocationInput, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField, AlphaPrintButton, HttpField, SearchField, ButtonField, LinkButtonField, VerificationStatus, QueryParamReaderField, QrReaderField, IdReaderField, LoaderField, AgeField } from './FieldConfig';
3
- import { FieldValue, DataFieldValue, DateRangeFieldValue, SelectDateRangeValue, VerificationStatusValue, AgeValue } from './FieldValue';
2
+ import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, LocationInput, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, NumberWithUnitField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField, AlphaPrintButton, HttpField, SearchField, ButtonField, LinkButtonField, VerificationStatus, QueryParamReaderField, QrReaderField, IdReaderField, LoaderField, AgeField } from './FieldConfig';
3
+ import { FieldValue, DataFieldValue, DateRangeFieldValue, SelectDateRangeValue, VerificationStatusValue, AgeValue, FieldUpdateValue } from './FieldValue';
4
4
  import { FullDocumentPath } from '../documents';
5
- import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
5
+ import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NumberWithUnitFieldValue } from './CompositeFieldValue';
6
6
  import { ActionType } from './ActionType';
7
7
  /**
8
8
  * Mapping of field types to Zod schema.
@@ -229,6 +229,24 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
229
229
  data?: any;
230
230
  }, {
231
231
  data?: any;
232
+ }>>> | z.ZodObject<{
233
+ numericValue: z.ZodOptional<z.ZodNumber>;
234
+ unit: z.ZodOptional<z.ZodString>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ numericValue?: number | undefined;
237
+ unit?: string | undefined;
238
+ }, {
239
+ numericValue?: number | undefined;
240
+ unit?: string | undefined;
241
+ }> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
242
+ numericValue: z.ZodOptional<z.ZodNumber>;
243
+ unit: z.ZodOptional<z.ZodString>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ numericValue?: number | undefined;
246
+ unit?: string | undefined;
247
+ }, {
248
+ numericValue?: number | undefined;
249
+ unit?: string | undefined;
232
250
  }>>> | z.ZodObject<{
233
251
  age: z.ZodNumber;
234
252
  asOfDateRef: z.ZodString;
@@ -409,6 +427,24 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
409
427
  data?: any;
410
428
  }, {
411
429
  data?: any;
430
+ }>, z.ZodObject<{
431
+ numericValue: z.ZodNumber;
432
+ unit: z.ZodString;
433
+ }, "strip", z.ZodTypeAny, {
434
+ numericValue: number;
435
+ unit: string;
436
+ }, {
437
+ numericValue: number;
438
+ unit: string;
439
+ }>, z.ZodObject<{
440
+ numericValue: z.ZodOptional<z.ZodNumber>;
441
+ unit: z.ZodOptional<z.ZodString>;
442
+ }, "strip", z.ZodTypeAny, {
443
+ numericValue?: number | undefined;
444
+ unit?: string | undefined;
445
+ }, {
446
+ numericValue?: number | undefined;
447
+ unit?: string | undefined;
412
448
  }>]>>;
413
449
  }, "strip", z.ZodTypeAny, {
414
450
  data: Record<string, string | number | boolean | {
@@ -448,6 +484,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
448
484
  data: Record<string, string>;
449
485
  } | {
450
486
  data?: any;
487
+ } | {
488
+ numericValue: number;
489
+ unit: string;
490
+ } | {
491
+ numericValue?: number | undefined;
492
+ unit?: string | undefined;
451
493
  } | {
452
494
  age: number;
453
495
  asOfDateRef: string;
@@ -493,6 +535,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
493
535
  data: Record<string, string>;
494
536
  } | {
495
537
  data?: any;
538
+ } | {
539
+ numericValue: number;
540
+ unit: string;
541
+ } | {
542
+ numericValue?: number | undefined;
543
+ unit?: string | undefined;
496
544
  } | {
497
545
  age: number;
498
546
  asOfDateRef: string;
@@ -644,6 +692,24 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
644
692
  data?: any;
645
693
  }, {
646
694
  data?: any;
695
+ }>, z.ZodObject<{
696
+ numericValue: z.ZodNumber;
697
+ unit: z.ZodString;
698
+ }, "strip", z.ZodTypeAny, {
699
+ numericValue: number;
700
+ unit: string;
701
+ }, {
702
+ numericValue: number;
703
+ unit: string;
704
+ }>, z.ZodObject<{
705
+ numericValue: z.ZodOptional<z.ZodNumber>;
706
+ unit: z.ZodOptional<z.ZodString>;
707
+ }, "strip", z.ZodTypeAny, {
708
+ numericValue?: number | undefined;
709
+ unit?: string | undefined;
710
+ }, {
711
+ numericValue?: number | undefined;
712
+ unit?: string | undefined;
647
713
  }>]>>;
648
714
  }, "strip", z.ZodTypeAny, {
649
715
  data: Record<string, string | number | boolean | {
@@ -683,6 +749,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
683
749
  data: Record<string, string>;
684
750
  } | {
685
751
  data?: any;
752
+ } | {
753
+ numericValue: number;
754
+ unit: string;
755
+ } | {
756
+ numericValue?: number | undefined;
757
+ unit?: string | undefined;
686
758
  } | {
687
759
  age: number;
688
760
  asOfDateRef: string;
@@ -728,6 +800,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
728
800
  data: Record<string, string>;
729
801
  } | {
730
802
  data?: any;
803
+ } | {
804
+ numericValue: number;
805
+ unit: string;
806
+ } | {
807
+ numericValue?: number | undefined;
808
+ unit?: string | undefined;
731
809
  } | {
732
810
  age: number;
733
811
  asOfDateRef: string;
@@ -970,6 +1048,13 @@ export declare const isNumberFieldType: (field: {
970
1048
  value: number;
971
1049
  config: NumberField;
972
1050
  };
1051
+ export declare const isNumberWithUnitFieldType: (field: {
1052
+ config: FieldConfig;
1053
+ value: FieldValue | FieldUpdateValue;
1054
+ }) => field is {
1055
+ value: NumberWithUnitFieldValue;
1056
+ config: NumberWithUnitField;
1057
+ };
973
1058
  export declare const isNameFieldType: (field: {
974
1059
  config: FieldConfig;
975
1060
  value: FieldValue;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue, HttpFieldUpdateValue, QueryParamReaderFieldUpdateValue, QrReaderFieldValue, IdReaderFieldValue } from './CompositeFieldValue';
2
+ import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue, NumberWithUnitFieldValue, NumberWithUnitFieldUpdateValue, HttpFieldUpdateValue, QueryParamReaderFieldUpdateValue, QrReaderFieldValue, IdReaderFieldValue } from './CompositeFieldValue';
3
3
  /**
4
4
  * FieldValues defined in this file are primitive field values.
5
5
  * FieldValues defined in CompositeFieldValue.ts are composed of multiple primitive field values (Address, File etc).
@@ -206,6 +206,24 @@ declare const FieldValuesWithoutDataField: z.ZodUnion<[z.ZodDiscriminatedUnion<"
206
206
  data?: any;
207
207
  }, {
208
208
  data?: any;
209
+ }>, z.ZodObject<{
210
+ numericValue: z.ZodNumber;
211
+ unit: z.ZodString;
212
+ }, "strip", z.ZodTypeAny, {
213
+ numericValue: number;
214
+ unit: string;
215
+ }, {
216
+ numericValue: number;
217
+ unit: string;
218
+ }>, z.ZodObject<{
219
+ numericValue: z.ZodOptional<z.ZodNumber>;
220
+ unit: z.ZodOptional<z.ZodString>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ numericValue?: number | undefined;
223
+ unit?: string | undefined;
224
+ }, {
225
+ numericValue?: number | undefined;
226
+ unit?: string | undefined;
209
227
  }>]>;
210
228
  type FieldValuesWithoutDataField = z.infer<typeof FieldValuesWithoutDataField>;
211
229
  export declare const DataFieldValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -352,6 +370,24 @@ export declare const DataFieldValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
352
370
  data?: any;
353
371
  }, {
354
372
  data?: any;
373
+ }>, z.ZodObject<{
374
+ numericValue: z.ZodNumber;
375
+ unit: z.ZodString;
376
+ }, "strip", z.ZodTypeAny, {
377
+ numericValue: number;
378
+ unit: string;
379
+ }, {
380
+ numericValue: number;
381
+ unit: string;
382
+ }>, z.ZodObject<{
383
+ numericValue: z.ZodOptional<z.ZodNumber>;
384
+ unit: z.ZodOptional<z.ZodString>;
385
+ }, "strip", z.ZodTypeAny, {
386
+ numericValue?: number | undefined;
387
+ unit?: string | undefined;
388
+ }, {
389
+ numericValue?: number | undefined;
390
+ unit?: string | undefined;
355
391
  }>]>>;
356
392
  }, "strip", z.ZodTypeAny, {
357
393
  data: Record<string, string | number | boolean | {
@@ -391,6 +427,12 @@ export declare const DataFieldValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
391
427
  data: Record<string, string>;
392
428
  } | {
393
429
  data?: any;
430
+ } | {
431
+ numericValue: number;
432
+ unit: string;
433
+ } | {
434
+ numericValue?: number | undefined;
435
+ unit?: string | undefined;
394
436
  } | {
395
437
  age: number;
396
438
  asOfDateRef: string;
@@ -436,6 +478,12 @@ export declare const DataFieldValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
436
478
  data: Record<string, string>;
437
479
  } | {
438
480
  data?: any;
481
+ } | {
482
+ numericValue: number;
483
+ unit: string;
484
+ } | {
485
+ numericValue?: number | undefined;
486
+ unit?: string | undefined;
439
487
  } | {
440
488
  age: number;
441
489
  asOfDateRef: string;
@@ -448,17 +496,17 @@ export type DataFieldValue = z.infer<typeof DataFieldValue>;
448
496
  export type FieldValue = FieldValuesWithoutDataField | DataFieldValue;
449
497
  export declare const FieldValue: z.ZodType<FieldValue>;
450
498
  export declare function safeUnion<T extends [z.ZodTypeAny, ...z.ZodTypeAny[]]>(schemas: T): z.ZodType<z.TypeOf<T[number]>, z.ZodTypeDef, z.TypeOf<T[number]>>;
451
- export type FieldUpdateValue = z.infer<typeof TextValue> | z.infer<typeof DateValue> | z.infer<typeof TimeValue> | z.infer<typeof AgeUpdateValue> | z.infer<typeof AddressFieldUpdateValue> | z.infer<typeof DateRangeFieldValue> | z.infer<typeof SelectDateRangeValue> | z.infer<typeof CheckboxFieldValue> | z.infer<typeof NumberFieldValue> | z.infer<typeof FileFieldValue> | z.infer<typeof FileFieldWithOptionValue> | z.infer<typeof DataFieldValue> | z.infer<typeof NameFieldUpdateValue> | z.infer<typeof HttpFieldUpdateValue> | z.infer<typeof QueryParamReaderFieldUpdateValue>;
499
+ export type FieldUpdateValue = z.infer<typeof TextValue> | z.infer<typeof DateValue> | z.infer<typeof TimeValue> | z.infer<typeof AgeUpdateValue> | z.infer<typeof AddressFieldUpdateValue> | z.infer<typeof DateRangeFieldValue> | z.infer<typeof SelectDateRangeValue> | z.infer<typeof CheckboxFieldValue> | z.infer<typeof NumberFieldValue> | z.infer<typeof NumberWithUnitFieldUpdateValue> | z.infer<typeof FileFieldValue> | z.infer<typeof FileFieldWithOptionValue> | z.infer<typeof DataFieldValue> | z.infer<typeof NameFieldUpdateValue> | z.infer<typeof HttpFieldUpdateValue> | z.infer<typeof QueryParamReaderFieldUpdateValue>;
452
500
  export declare const FieldUpdateValue: z.ZodType<FieldUpdateValue>;
453
501
  /**
454
502
  * NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
455
503
  * */
456
- export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
504
+ export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof NumberWithUnitFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
457
505
  /**
458
506
  * NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
459
507
  *
460
508
  * FieldValueInputSchema uses Input types which have set optional values as nullish
461
509
  * */
462
- export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof AgeValue | typeof SelectDateRangeValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | typeof HttpFieldUpdateValue | typeof QueryParamReaderFieldUpdateValue | typeof ButtonFieldValue | typeof QrReaderFieldValue | typeof IdReaderFieldValue | z.ZodString | z.ZodBoolean;
510
+ export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof AgeValue | typeof SelectDateRangeValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof NumberWithUnitFieldValue | typeof NumberWithUnitFieldUpdateValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | typeof HttpFieldUpdateValue | typeof QueryParamReaderFieldUpdateValue | typeof ButtonFieldValue | typeof QrReaderFieldValue | typeof IdReaderFieldValue | z.ZodString | z.ZodBoolean;
463
511
  export {};
464
512
  //# sourceMappingURL=FieldValue.d.ts.map
@@ -172,7 +172,7 @@ export declare const defineConfig: (config: EventConfigInput) => {
172
172
  };
173
173
  fieldId: string;
174
174
  fieldType: "field";
175
- type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
175
+ type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
176
176
  options?: {
177
177
  value: string;
178
178
  label: string | import("./TranslationConfig").TranslationConfig;
@@ -200,7 +200,7 @@ export declare const defineConfig: (config: EventConfigInput) => {
200
200
  };
201
201
  fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
202
202
  fieldType: "event";
203
- type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
203
+ type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
204
204
  options?: {
205
205
  value: string;
206
206
  label: string | import("./TranslationConfig").TranslationConfig;
@@ -150,6 +150,12 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
150
150
  data: Record<string, string>;
151
151
  } | {
152
152
  data?: any;
153
+ } | {
154
+ numericValue: number;
155
+ unit: string;
156
+ } | {
157
+ numericValue?: number | undefined;
158
+ unit?: string | undefined;
153
159
  } | {
154
160
  age: number;
155
161
  asOfDateRef: string;
@@ -194,6 +200,12 @@ export declare function omitHiddenAnnotationFields(actionConfig: ActionConfig, d
194
200
  data: Record<string, string>;
195
201
  } | {
196
202
  data?: any;
203
+ } | {
204
+ numericValue: number;
205
+ unit: string;
206
+ } | {
207
+ numericValue?: number | undefined;
208
+ unit?: string | undefined;
197
209
  } | {
198
210
  age: number;
199
211
  asOfDateRef: string;
@@ -402,7 +414,7 @@ export declare function getEventConfigById(eventConfigs: EventConfig[], id: stri
402
414
  };
403
415
  fieldId: string;
404
416
  fieldType: "field";
405
- type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
417
+ type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
406
418
  options?: {
407
419
  value: string;
408
420
  label: string | import("./TranslationConfig").TranslationConfig;
@@ -430,7 +442,7 @@ export declare function getEventConfigById(eventConfigs: EventConfig[], id: stri
430
442
  };
431
443
  fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
432
444
  fieldType: "event";
433
- type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
445
+ type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
434
446
  options?: {
435
447
  value: string;
436
448
  label: string | import("./TranslationConfig").TranslationConfig;
@@ -153,6 +153,8 @@ __export(events_exports, {
153
153
  NonEmptyTextValue: () => NonEmptyTextValue,
154
154
  NotifyActionInput: () => NotifyActionInput,
155
155
  NumberFieldValue: () => NumberFieldValue,
156
+ NumberWithUnitFieldUpdateValue: () => NumberWithUnitFieldUpdateValue,
157
+ NumberWithUnitFieldValue: () => NumberWithUnitFieldValue,
156
158
  PageConfig: () => PageConfig,
157
159
  PageTypes: () => PageTypes,
158
160
  PotentialDuplicate: () => PotentialDuplicate,
@@ -330,6 +332,7 @@ __export(events_exports, {
330
332
  isNameFieldType: () => isNameFieldType,
331
333
  isNonInteractiveFieldType: () => isNonInteractiveFieldType,
332
334
  isNumberFieldType: () => isNumberFieldType,
335
+ isNumberWithUnitFieldType: () => isNumberWithUnitFieldType,
333
336
  isOfficeFieldType: () => isOfficeFieldType,
334
337
  isOnline: () => isOnline,
335
338
  isPageHeaderFieldType: () => isPageHeaderFieldType,
@@ -565,6 +568,7 @@ var FieldType = {
565
568
  ADDRESS: "ADDRESS",
566
569
  TEXT: "TEXT",
567
570
  NUMBER: "NUMBER",
571
+ NUMBER_WITH_UNIT: "NUMBER_WITH_UNIT",
568
572
  TEXTAREA: "TEXTAREA",
569
573
  EMAIL: "EMAIL",
570
574
  DATE: "DATE",
@@ -733,6 +737,14 @@ var ReadDataValue = import_zod6.z.object({
733
737
  });
734
738
  var QrReaderFieldValue = ReadDataValue;
735
739
  var IdReaderFieldValue = ReadDataValue;
740
+ var NumberWithUnitFieldValue = import_zod6.z.object({
741
+ numericValue: import_zod6.z.number(),
742
+ unit: import_zod6.z.string()
743
+ });
744
+ var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
745
+ numericValue: import_zod6.z.number().optional(),
746
+ unit: import_zod6.z.string().optional()
747
+ });
736
748
 
737
749
  // ../commons/src/events/FieldValue.ts
738
750
  var TextValue = import_zod7.z.string();
@@ -787,7 +799,9 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
787
799
  VerificationStatusValue,
788
800
  QueryParamReaderFieldValue,
789
801
  QrReaderFieldValue,
790
- IdReaderFieldValue
802
+ IdReaderFieldValue,
803
+ NumberWithUnitFieldValue,
804
+ NumberWithUnitFieldUpdateValue
791
805
  ]);
792
806
  var DataFieldValue = import_zod7.z.object({
793
807
  data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
@@ -807,6 +821,7 @@ var PRIORITY_ORDER = [
807
821
  "SelectDateRangeValue",
808
822
  "CheckboxFieldValue",
809
823
  "NumberFieldValue",
824
+ "NumberWithUnitFieldUpdateValue",
810
825
  "FileFieldValue",
811
826
  "FileFieldWithOptionValue",
812
827
  "DataFieldValue"
@@ -840,6 +855,7 @@ var FieldUpdateValue = safeUnion([
840
855
  SelectDateRangeValue.describe("SelectDateRangeValue"),
841
856
  CheckboxFieldValue.describe("CheckboxFieldValue"),
842
857
  NumberFieldValue.describe("NumberFieldValue"),
858
+ NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
843
859
  FileFieldValue.describe("FileFieldValue"),
844
860
  FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
845
861
  DataFieldValue.describe("DataFieldValue"),
@@ -2107,6 +2123,18 @@ var SelectOption = import_zod15.z.object({
2107
2123
  value: import_zod15.z.string().describe("The value of the option"),
2108
2124
  label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
2109
2125
  });
2126
+ var NumberWithUnitField = BaseField.extend({
2127
+ type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
2128
+ defaultValue: NumberWithUnitFieldValue.optional(),
2129
+ options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
2130
+ configuration: import_zod15.z.object({
2131
+ min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
2132
+ max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
2133
+ numberFieldPlaceholder: TranslationConfig.optional().describe(
2134
+ "Placeholder for the number field"
2135
+ )
2136
+ }).optional()
2137
+ }).describe("Number with unit input");
2110
2138
  var RadioGroup = BaseField.extend({
2111
2139
  type: import_zod15.z.literal(FieldType.RADIO_GROUP),
2112
2140
  defaultValue: TextValue.optional(),
@@ -2398,6 +2426,7 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
2398
2426
  Address,
2399
2427
  TextField,
2400
2428
  NumberField,
2429
+ NumberWithUnitField,
2401
2430
  TextAreaField,
2402
2431
  AgeField,
2403
2432
  DateField,
@@ -2969,6 +2998,9 @@ function mapFieldTypeToZod(field3, actionType) {
2969
2998
  case FieldType.NUMBER:
2970
2999
  schema = NumberFieldValue;
2971
3000
  break;
3001
+ case FieldType.NUMBER_WITH_UNIT:
3002
+ schema = NumberWithUnitFieldUpdateValue;
3003
+ break;
2972
3004
  case FieldType.CHECKBOX:
2973
3005
  schema = CheckboxFieldValue;
2974
3006
  break;
@@ -3026,6 +3058,7 @@ function mapFieldTypeToEmptyValue(field3) {
3026
3058
  case FieldType.FACILITY:
3027
3059
  case FieldType.OFFICE:
3028
3060
  case FieldType.NUMBER:
3061
+ case FieldType.NUMBER_WITH_UNIT:
3029
3062
  case FieldType.EMAIL:
3030
3063
  case FieldType.DATE:
3031
3064
  case FieldType.AGE:
@@ -3093,6 +3126,9 @@ var isTextFieldType = (field3) => {
3093
3126
  var isNumberFieldType = (field3) => {
3094
3127
  return field3.config.type === FieldType.NUMBER;
3095
3128
  };
3129
+ var isNumberWithUnitFieldType = (field3) => {
3130
+ return field3.config.type === FieldType.NUMBER_WITH_UNIT;
3131
+ };
3096
3132
  var isNameFieldType = (field3) => {
3097
3133
  return field3.config.type === FieldType.NAME;
3098
3134
  };
@@ -8189,6 +8225,11 @@ function mapFieldTypeToMockValue(field3, i, rng) {
8189
8225
  return generateRandomName(rng);
8190
8226
  case FieldType.NUMBER:
8191
8227
  return 19;
8228
+ case FieldType.NUMBER_WITH_UNIT:
8229
+ return {
8230
+ numericValue: 42,
8231
+ unit: "Hours"
8232
+ };
8192
8233
  case FieldType.BUTTON:
8193
8234
  return 1;
8194
8235
  case FieldType.EMAIL:
@@ -230,6 +230,7 @@ var FieldType = {
230
230
  ADDRESS: "ADDRESS",
231
231
  TEXT: "TEXT",
232
232
  NUMBER: "NUMBER",
233
+ NUMBER_WITH_UNIT: "NUMBER_WITH_UNIT",
233
234
  TEXTAREA: "TEXTAREA",
234
235
  EMAIL: "EMAIL",
235
236
  DATE: "DATE",
@@ -394,6 +395,14 @@ var ReadDataValue = import_zod6.z.object({
394
395
  });
395
396
  var QrReaderFieldValue = ReadDataValue;
396
397
  var IdReaderFieldValue = ReadDataValue;
398
+ var NumberWithUnitFieldValue = import_zod6.z.object({
399
+ numericValue: import_zod6.z.number(),
400
+ unit: import_zod6.z.string()
401
+ });
402
+ var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
403
+ numericValue: import_zod6.z.number().optional(),
404
+ unit: import_zod6.z.string().optional()
405
+ });
397
406
 
398
407
  // ../commons/src/events/FieldValue.ts
399
408
  var TextValue = import_zod7.z.string();
@@ -448,7 +457,9 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
448
457
  VerificationStatusValue,
449
458
  QueryParamReaderFieldValue,
450
459
  QrReaderFieldValue,
451
- IdReaderFieldValue
460
+ IdReaderFieldValue,
461
+ NumberWithUnitFieldValue,
462
+ NumberWithUnitFieldUpdateValue
452
463
  ]);
453
464
  var DataFieldValue = import_zod7.z.object({
454
465
  data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
@@ -468,6 +479,7 @@ var PRIORITY_ORDER = [
468
479
  "SelectDateRangeValue",
469
480
  "CheckboxFieldValue",
470
481
  "NumberFieldValue",
482
+ "NumberWithUnitFieldUpdateValue",
471
483
  "FileFieldValue",
472
484
  "FileFieldWithOptionValue",
473
485
  "DataFieldValue"
@@ -501,6 +513,7 @@ var FieldUpdateValue = safeUnion([
501
513
  SelectDateRangeValue.describe("SelectDateRangeValue"),
502
514
  CheckboxFieldValue.describe("CheckboxFieldValue"),
503
515
  NumberFieldValue.describe("NumberFieldValue"),
516
+ NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
504
517
  FileFieldValue.describe("FileFieldValue"),
505
518
  FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
506
519
  DataFieldValue.describe("DataFieldValue"),
@@ -1633,6 +1646,18 @@ var SelectOption = import_zod15.z.object({
1633
1646
  value: import_zod15.z.string().describe("The value of the option"),
1634
1647
  label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
1635
1648
  });
1649
+ var NumberWithUnitField = BaseField.extend({
1650
+ type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
1651
+ defaultValue: NumberWithUnitFieldValue.optional(),
1652
+ options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
1653
+ configuration: import_zod15.z.object({
1654
+ min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
1655
+ max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
1656
+ numberFieldPlaceholder: TranslationConfig.optional().describe(
1657
+ "Placeholder for the number field"
1658
+ )
1659
+ }).optional()
1660
+ }).describe("Number with unit input");
1636
1661
  var RadioGroup = BaseField.extend({
1637
1662
  type: import_zod15.z.literal(FieldType.RADIO_GROUP),
1638
1663
  defaultValue: TextValue.optional(),
@@ -1924,6 +1949,7 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
1924
1949
  Address,
1925
1950
  TextField,
1926
1951
  NumberField,
1952
+ NumberWithUnitField,
1927
1953
  TextAreaField,
1928
1954
  AgeField,
1929
1955
  DateField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.5-rc.fe5b5f8",
3
+ "version": "1.9.6-rc.54e1cbb",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {