@opencrvs/toolkit 1.9.3-rc.cbbd7ba → 1.9.3-rc.e47111c
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.
- package/dist/commons/api/router.d.ts +2 -2
- package/dist/commons/events/AdvancedSearchConfig.d.ts +30 -24
- package/dist/commons/events/CompositeFieldValue.d.ts +22 -0
- package/dist/commons/events/EventConfig.d.ts +22 -20
- package/dist/commons/events/FieldConfig.d.ts +284 -2
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +88 -3
- package/dist/commons/events/FieldValue.d.ts +52 -4
- package/dist/commons/events/defineConfig.d.ts +2 -2
- package/dist/commons/events/utils.d.ts +14 -2
- package/dist/events/index.js +43 -0
- package/dist/notification/index.js +28 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -314,6 +332,24 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
314
332
|
start: string;
|
|
315
333
|
end: string;
|
|
316
334
|
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
|
335
|
+
numericValue: z.ZodNumber;
|
|
336
|
+
unit: z.ZodString;
|
|
337
|
+
}, "strip", z.ZodTypeAny, {
|
|
338
|
+
numericValue: number;
|
|
339
|
+
unit: string;
|
|
340
|
+
}, {
|
|
341
|
+
numericValue: number;
|
|
342
|
+
unit: string;
|
|
343
|
+
}>, z.ZodObject<{
|
|
344
|
+
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
345
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
numericValue?: number | undefined;
|
|
348
|
+
unit?: string | undefined;
|
|
349
|
+
}, {
|
|
350
|
+
numericValue?: number | undefined;
|
|
351
|
+
unit?: string | undefined;
|
|
352
|
+
}>, z.ZodObject<{
|
|
317
353
|
path: z.ZodEffects<z.ZodString, string, string>;
|
|
318
354
|
originalFilename: z.ZodString;
|
|
319
355
|
type: z.ZodString;
|
|
@@ -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;
|
|
@@ -549,6 +597,24 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
549
597
|
start: string;
|
|
550
598
|
end: string;
|
|
551
599
|
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
|
600
|
+
numericValue: z.ZodNumber;
|
|
601
|
+
unit: z.ZodString;
|
|
602
|
+
}, "strip", z.ZodTypeAny, {
|
|
603
|
+
numericValue: number;
|
|
604
|
+
unit: string;
|
|
605
|
+
}, {
|
|
606
|
+
numericValue: number;
|
|
607
|
+
unit: string;
|
|
608
|
+
}>, z.ZodObject<{
|
|
609
|
+
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
610
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
611
|
+
}, "strip", z.ZodTypeAny, {
|
|
612
|
+
numericValue?: number | undefined;
|
|
613
|
+
unit?: string | undefined;
|
|
614
|
+
}, {
|
|
615
|
+
numericValue?: number | undefined;
|
|
616
|
+
unit?: string | undefined;
|
|
617
|
+
}>, z.ZodObject<{
|
|
552
618
|
path: z.ZodEffects<z.ZodString, string, string>;
|
|
553
619
|
originalFilename: z.ZodString;
|
|
554
620
|
type: z.ZodString;
|
|
@@ -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).
|
|
@@ -111,6 +111,24 @@ declare const FieldValuesWithoutDataField: z.ZodUnion<[z.ZodDiscriminatedUnion<"
|
|
|
111
111
|
start: string;
|
|
112
112
|
end: string;
|
|
113
113
|
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
|
114
|
+
numericValue: z.ZodNumber;
|
|
115
|
+
unit: z.ZodString;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
numericValue: number;
|
|
118
|
+
unit: string;
|
|
119
|
+
}, {
|
|
120
|
+
numericValue: number;
|
|
121
|
+
unit: string;
|
|
122
|
+
}>, z.ZodObject<{
|
|
123
|
+
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
numericValue?: number | undefined;
|
|
127
|
+
unit?: string | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
numericValue?: number | undefined;
|
|
130
|
+
unit?: string | undefined;
|
|
131
|
+
}>, z.ZodObject<{
|
|
114
132
|
path: z.ZodEffects<z.ZodString, string, string>;
|
|
115
133
|
originalFilename: z.ZodString;
|
|
116
134
|
type: z.ZodString;
|
|
@@ -257,6 +275,24 @@ export declare const DataFieldValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
|
257
275
|
start: string;
|
|
258
276
|
end: string;
|
|
259
277
|
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
|
278
|
+
numericValue: z.ZodNumber;
|
|
279
|
+
unit: z.ZodString;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
numericValue: number;
|
|
282
|
+
unit: string;
|
|
283
|
+
}, {
|
|
284
|
+
numericValue: number;
|
|
285
|
+
unit: string;
|
|
286
|
+
}>, z.ZodObject<{
|
|
287
|
+
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
288
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
289
|
+
}, "strip", z.ZodTypeAny, {
|
|
290
|
+
numericValue?: number | undefined;
|
|
291
|
+
unit?: string | undefined;
|
|
292
|
+
}, {
|
|
293
|
+
numericValue?: number | undefined;
|
|
294
|
+
unit?: string | undefined;
|
|
295
|
+
}>, z.ZodObject<{
|
|
260
296
|
path: z.ZodEffects<z.ZodString, string, string>;
|
|
261
297
|
originalFilename: z.ZodString;
|
|
262
298
|
type: z.ZodString;
|
|
@@ -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 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;
|
package/dist/events/index.js
CHANGED
|
@@ -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();
|
|
@@ -777,6 +789,8 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
|
777
789
|
SelectDateRangeValue,
|
|
778
790
|
CheckboxFieldValue,
|
|
779
791
|
NumberFieldValue,
|
|
792
|
+
NumberWithUnitFieldValue,
|
|
793
|
+
NumberWithUnitFieldUpdateValue,
|
|
780
794
|
FileFieldValue,
|
|
781
795
|
FileFieldWithOptionValue,
|
|
782
796
|
NameFieldValue,
|
|
@@ -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
|
};
|
|
@@ -5655,6 +5691,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
5655
5691
|
{
|
|
5656
5692
|
id: "collector",
|
|
5657
5693
|
type: PageTypes.enum.FORM,
|
|
5694
|
+
requireCompletionToContinue: true,
|
|
5658
5695
|
title: {
|
|
5659
5696
|
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
5660
5697
|
defaultMessage: "Print certified copy",
|
|
@@ -6262,6 +6299,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
6262
6299
|
{
|
|
6263
6300
|
id: "collector.identity.verify",
|
|
6264
6301
|
type: PageTypes.enum.VERIFICATION,
|
|
6302
|
+
requireCompletionToContinue: true,
|
|
6265
6303
|
conditional: field("collector.requesterId").isEqualTo("INFORMANT"),
|
|
6266
6304
|
title: {
|
|
6267
6305
|
id: "event.tennis-club-membership.action.print.verifyIdentity",
|
|
@@ -8165,6 +8203,11 @@ function mapFieldTypeToMockValue(field3, i, rng) {
|
|
|
8165
8203
|
case FieldType.ID:
|
|
8166
8204
|
case FieldType.OFFICE:
|
|
8167
8205
|
case FieldType.LINK_BUTTON:
|
|
8206
|
+
case FieldType.NUMBER_WITH_UNIT:
|
|
8207
|
+
return {
|
|
8208
|
+
numericValue: 4,
|
|
8209
|
+
unit: "Days"
|
|
8210
|
+
};
|
|
8168
8211
|
case FieldType.LOADER:
|
|
8169
8212
|
return `${field3.id}-${field3.type}-${i}`;
|
|
8170
8213
|
case FieldType.VERIFICATION_STATUS:
|
|
@@ -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();
|
|
@@ -438,6 +447,8 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
|
438
447
|
SelectDateRangeValue,
|
|
439
448
|
CheckboxFieldValue,
|
|
440
449
|
NumberFieldValue,
|
|
450
|
+
NumberWithUnitFieldValue,
|
|
451
|
+
NumberWithUnitFieldUpdateValue,
|
|
441
452
|
FileFieldValue,
|
|
442
453
|
FileFieldWithOptionValue,
|
|
443
454
|
NameFieldValue,
|
|
@@ -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,
|
|
@@ -3919,6 +3945,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
3919
3945
|
{
|
|
3920
3946
|
id: "collector",
|
|
3921
3947
|
type: PageTypes.enum.FORM,
|
|
3948
|
+
requireCompletionToContinue: true,
|
|
3922
3949
|
title: {
|
|
3923
3950
|
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
3924
3951
|
defaultMessage: "Print certified copy",
|
|
@@ -4526,6 +4553,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
4526
4553
|
{
|
|
4527
4554
|
id: "collector.identity.verify",
|
|
4528
4555
|
type: PageTypes.enum.VERIFICATION,
|
|
4556
|
+
requireCompletionToContinue: true,
|
|
4529
4557
|
conditional: field("collector.requesterId").isEqualTo("INFORMANT"),
|
|
4530
4558
|
title: {
|
|
4531
4559
|
id: "event.tennis-club-membership.action.print.verifyIdentity",
|