@opencrvs/toolkit 1.9.3-rc.8641c2b → 1.9.3-rc.8e41e94

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";
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";
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",
@@ -732,6 +736,14 @@ var ReadDataValue = import_zod6.z.object({
732
736
  });
733
737
  var QrReaderFieldValue = ReadDataValue;
734
738
  var IdReaderFieldValue = ReadDataValue;
739
+ var NumberWithUnitFieldValue = import_zod6.z.object({
740
+ numericValue: import_zod6.z.number(),
741
+ unit: import_zod6.z.string()
742
+ });
743
+ var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
744
+ numericValue: import_zod6.z.number().optional(),
745
+ unit: import_zod6.z.string().optional()
746
+ });
735
747
 
736
748
  // ../commons/src/events/FieldValue.ts
737
749
  var TextValue = import_zod7.z.string();
@@ -786,7 +798,9 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
786
798
  VerificationStatusValue,
787
799
  QueryParamReaderFieldValue,
788
800
  QrReaderFieldValue,
789
- IdReaderFieldValue
801
+ IdReaderFieldValue,
802
+ NumberWithUnitFieldValue,
803
+ NumberWithUnitFieldUpdateValue
790
804
  ]);
791
805
  var DataFieldValue = import_zod7.z.object({
792
806
  data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
@@ -806,6 +820,7 @@ var PRIORITY_ORDER = [
806
820
  "SelectDateRangeValue",
807
821
  "CheckboxFieldValue",
808
822
  "NumberFieldValue",
823
+ "NumberWithUnitFieldUpdateValue",
809
824
  "FileFieldValue",
810
825
  "FileFieldWithOptionValue",
811
826
  "DataFieldValue"
@@ -839,6 +854,7 @@ var FieldUpdateValue = safeUnion([
839
854
  SelectDateRangeValue.describe("SelectDateRangeValue"),
840
855
  CheckboxFieldValue.describe("CheckboxFieldValue"),
841
856
  NumberFieldValue.describe("NumberFieldValue"),
857
+ NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
842
858
  FileFieldValue.describe("FileFieldValue"),
843
859
  FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
844
860
  DataFieldValue.describe("DataFieldValue"),
@@ -2098,6 +2114,18 @@ var SelectOption = import_zod15.z.object({
2098
2114
  value: import_zod15.z.string().describe("The value of the option"),
2099
2115
  label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
2100
2116
  });
2117
+ var NumberWithUnitField = BaseField.extend({
2118
+ type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
2119
+ defaultValue: NumberWithUnitFieldValue.optional(),
2120
+ options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
2121
+ configuration: import_zod15.z.object({
2122
+ min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
2123
+ max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
2124
+ numberFieldPlaceholder: TranslationConfig.optional().describe(
2125
+ "Placeholder for the number field"
2126
+ )
2127
+ }).optional()
2128
+ }).describe("Number with unit input");
2101
2129
  var RadioGroup = BaseField.extend({
2102
2130
  type: import_zod15.z.literal(FieldType.RADIO_GROUP),
2103
2131
  defaultValue: TextValue.optional(),
@@ -2386,6 +2414,7 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
2386
2414
  Address,
2387
2415
  TextField,
2388
2416
  NumberField,
2417
+ NumberWithUnitField,
2389
2418
  TextAreaField,
2390
2419
  AgeField,
2391
2420
  DateField,
@@ -2955,6 +2984,9 @@ function mapFieldTypeToZod(field3, actionType) {
2955
2984
  case FieldType.NUMBER:
2956
2985
  schema = NumberFieldValue;
2957
2986
  break;
2987
+ case FieldType.NUMBER_WITH_UNIT:
2988
+ schema = NumberWithUnitFieldUpdateValue;
2989
+ break;
2958
2990
  case FieldType.CHECKBOX:
2959
2991
  schema = CheckboxFieldValue;
2960
2992
  break;
@@ -3012,6 +3044,7 @@ function mapFieldTypeToEmptyValue(field3) {
3012
3044
  case FieldType.FACILITY:
3013
3045
  case FieldType.OFFICE:
3014
3046
  case FieldType.NUMBER:
3047
+ case FieldType.NUMBER_WITH_UNIT:
3015
3048
  case FieldType.EMAIL:
3016
3049
  case FieldType.DATE:
3017
3050
  case FieldType.AGE:
@@ -3079,6 +3112,9 @@ var isTextFieldType = (field3) => {
3079
3112
  var isNumberFieldType = (field3) => {
3080
3113
  return field3.config.type === FieldType.NUMBER;
3081
3114
  };
3115
+ var isNumberWithUnitFieldType = (field3) => {
3116
+ return field3.config.type === FieldType.NUMBER_WITH_UNIT;
3117
+ };
3082
3118
  var isNameFieldType = (field3) => {
3083
3119
  return field3.config.type === FieldType.NAME;
3084
3120
  };
@@ -8175,6 +8211,11 @@ function mapFieldTypeToMockValue(field3, i, rng) {
8175
8211
  return generateRandomName(rng);
8176
8212
  case FieldType.NUMBER:
8177
8213
  return 19;
8214
+ case FieldType.NUMBER_WITH_UNIT:
8215
+ return {
8216
+ numericValue: 42,
8217
+ unit: "Hours"
8218
+ };
8178
8219
  case FieldType.BUTTON:
8179
8220
  return 1;
8180
8221
  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",
@@ -393,6 +394,14 @@ var ReadDataValue = import_zod6.z.object({
393
394
  });
394
395
  var QrReaderFieldValue = ReadDataValue;
395
396
  var IdReaderFieldValue = ReadDataValue;
397
+ var NumberWithUnitFieldValue = import_zod6.z.object({
398
+ numericValue: import_zod6.z.number(),
399
+ unit: import_zod6.z.string()
400
+ });
401
+ var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
402
+ numericValue: import_zod6.z.number().optional(),
403
+ unit: import_zod6.z.string().optional()
404
+ });
396
405
 
397
406
  // ../commons/src/events/FieldValue.ts
398
407
  var TextValue = import_zod7.z.string();
@@ -447,7 +456,9 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
447
456
  VerificationStatusValue,
448
457
  QueryParamReaderFieldValue,
449
458
  QrReaderFieldValue,
450
- IdReaderFieldValue
459
+ IdReaderFieldValue,
460
+ NumberWithUnitFieldValue,
461
+ NumberWithUnitFieldUpdateValue
451
462
  ]);
452
463
  var DataFieldValue = import_zod7.z.object({
453
464
  data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
@@ -467,6 +478,7 @@ var PRIORITY_ORDER = [
467
478
  "SelectDateRangeValue",
468
479
  "CheckboxFieldValue",
469
480
  "NumberFieldValue",
481
+ "NumberWithUnitFieldUpdateValue",
470
482
  "FileFieldValue",
471
483
  "FileFieldWithOptionValue",
472
484
  "DataFieldValue"
@@ -500,6 +512,7 @@ var FieldUpdateValue = safeUnion([
500
512
  SelectDateRangeValue.describe("SelectDateRangeValue"),
501
513
  CheckboxFieldValue.describe("CheckboxFieldValue"),
502
514
  NumberFieldValue.describe("NumberFieldValue"),
515
+ NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
503
516
  FileFieldValue.describe("FileFieldValue"),
504
517
  FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
505
518
  DataFieldValue.describe("DataFieldValue"),
@@ -1624,6 +1637,18 @@ var SelectOption = import_zod15.z.object({
1624
1637
  value: import_zod15.z.string().describe("The value of the option"),
1625
1638
  label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
1626
1639
  });
1640
+ var NumberWithUnitField = BaseField.extend({
1641
+ type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
1642
+ defaultValue: NumberWithUnitFieldValue.optional(),
1643
+ options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
1644
+ configuration: import_zod15.z.object({
1645
+ min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
1646
+ max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
1647
+ numberFieldPlaceholder: TranslationConfig.optional().describe(
1648
+ "Placeholder for the number field"
1649
+ )
1650
+ }).optional()
1651
+ }).describe("Number with unit input");
1627
1652
  var RadioGroup = BaseField.extend({
1628
1653
  type: import_zod15.z.literal(FieldType.RADIO_GROUP),
1629
1654
  defaultValue: TextValue.optional(),
@@ -1912,6 +1937,7 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
1912
1937
  Address,
1913
1938
  TextField,
1914
1939
  NumberField,
1940
+ NumberWithUnitField,
1915
1941
  TextAreaField,
1916
1942
  AgeField,
1917
1943
  DateField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.3-rc.8641c2b",
3
+ "version": "1.9.3-rc.8e41e94",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {