@opencrvs/toolkit 1.8.1-rc.032a7f2 → 1.8.1-rc.06c1a33
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 +1350 -4
- package/dist/commons/events/ActionConfig.d.ts +15480 -7338
- package/dist/commons/events/ActionDocument.d.ts +3036 -1
- package/dist/commons/events/ActionInput.d.ts +2460 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +93 -3
- package/dist/commons/events/CompositeFieldValue.d.ts +60 -0
- package/dist/commons/events/Draft.d.ts +200 -8
- package/dist/commons/events/EventConfig.d.ts +8815 -5048
- package/dist/commons/events/EventDocument.d.ts +1704 -0
- package/dist/commons/events/EventIndex.d.ts +47 -1
- package/dist/commons/events/FieldConfig.d.ts +1108 -1128
- package/dist/commons/events/FieldType.d.ts +3 -6
- package/dist/commons/events/FieldTypeMapping.d.ts +85 -3
- package/dist/commons/events/FieldValue.d.ts +62 -3
- package/dist/commons/events/FormConfig.d.ts +7497 -3687
- package/dist/commons/events/PageConfig.d.ts +1382 -460
- package/dist/commons/events/WorkqueueConfig.d.ts +8 -8
- package/dist/commons/events/defineConfig.d.ts +737 -62
- package/dist/commons/events/test.utils.d.ts +43 -2
- package/dist/commons/events/utils.d.ts +1474 -143
- package/dist/events/index.js +882 -896
- package/package.json +1 -1
@@ -1,4 +1,3 @@
|
|
1
|
-
import { z } from 'zod';
|
2
1
|
export declare const FieldType: {
|
3
2
|
readonly NAME: "NAME";
|
4
3
|
readonly PHONE: "PHONE";
|
@@ -28,12 +27,10 @@ export declare const FieldType: {
|
|
28
27
|
readonly OFFICE: "OFFICE";
|
29
28
|
readonly SIGNATURE: "SIGNATURE";
|
30
29
|
readonly DATA: "DATA";
|
30
|
+
readonly BUTTON: "BUTTON";
|
31
|
+
readonly HTTP: "HTTP";
|
31
32
|
};
|
32
|
-
|
33
|
-
* Union of types that handle files. Using common type should help with compiler to know where to add new cases.
|
34
|
-
*/
|
35
|
-
export declare const FileFieldType: z.ZodEnum<["FILE", "FILE_WITH_OPTIONS", "SIGNATURE"]>;
|
36
|
-
export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "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")[];
|
33
|
+
export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "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" | "HTTP")[];
|
37
34
|
export type FieldType = (typeof fieldTypes)[number];
|
38
35
|
/**
|
39
36
|
* Composite field types are field types that consist of multiple field values.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField } from './FieldConfig';
|
2
|
+
import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField, HttpField, ButtonField } from './FieldConfig';
|
3
3
|
import { FieldType } from './FieldType';
|
4
4
|
import { FieldValue, FieldUpdateValueSchema, DateRangeFieldValue, SelectDateRangeValue } from './FieldValue';
|
5
5
|
import { FullDocumentPath } from '../documents';
|
@@ -207,7 +207,34 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
207
207
|
option: string;
|
208
208
|
path: string;
|
209
209
|
originalFilename: string;
|
210
|
-
}>, "many">>> | z.
|
210
|
+
}>, "many">>> | z.ZodBoolean | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
211
|
+
loading: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
212
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
213
|
+
statusCode: z.ZodNullable<z.ZodNumber>;
|
214
|
+
message: z.ZodString;
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
216
|
+
message: string;
|
217
|
+
statusCode: number | null;
|
218
|
+
}, {
|
219
|
+
message: string;
|
220
|
+
statusCode: number | null;
|
221
|
+
}>>>;
|
222
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
224
|
+
data?: any;
|
225
|
+
error?: {
|
226
|
+
message: string;
|
227
|
+
statusCode: number | null;
|
228
|
+
} | null | undefined;
|
229
|
+
loading?: boolean | null | undefined;
|
230
|
+
}, {
|
231
|
+
data?: any;
|
232
|
+
error?: {
|
233
|
+
message: string;
|
234
|
+
statusCode: number | null;
|
235
|
+
} | null | undefined;
|
236
|
+
loading?: boolean | null | undefined;
|
237
|
+
}>, z.ZodNull]>, z.ZodUndefined]> | z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]> | z.ZodUnion<[z.ZodObject<{
|
211
238
|
start: z.ZodString;
|
212
239
|
end: z.ZodString;
|
213
240
|
}, "strip", z.ZodTypeAny, {
|
@@ -225,7 +252,34 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
225
252
|
}, {
|
226
253
|
start: string;
|
227
254
|
end: string;
|
228
|
-
}>, z.ZodString]>>> | z.ZodOptional<z.ZodNullable<z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>>> | z.
|
255
|
+
}>, z.ZodString]>>> | z.ZodOptional<z.ZodNullable<z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>>> | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
256
|
+
loading: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
257
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
258
|
+
statusCode: z.ZodNullable<z.ZodNumber>;
|
259
|
+
message: z.ZodString;
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
261
|
+
message: string;
|
262
|
+
statusCode: number | null;
|
263
|
+
}, {
|
264
|
+
message: string;
|
265
|
+
statusCode: number | null;
|
266
|
+
}>>>;
|
267
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
269
|
+
data?: any;
|
270
|
+
error?: {
|
271
|
+
message: string;
|
272
|
+
statusCode: number | null;
|
273
|
+
} | null | undefined;
|
274
|
+
loading?: boolean | null | undefined;
|
275
|
+
}, {
|
276
|
+
data?: any;
|
277
|
+
error?: {
|
278
|
+
message: string;
|
279
|
+
statusCode: number | null;
|
280
|
+
} | null | undefined;
|
281
|
+
loading?: boolean | null | undefined;
|
282
|
+
}>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
229
283
|
country: z.ZodString;
|
230
284
|
addressType: z.ZodLiteral<"DOMESTIC">;
|
231
285
|
province: z.ZodString;
|
@@ -359,6 +413,13 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
359
413
|
path: string;
|
360
414
|
originalFilename: string;
|
361
415
|
}[] | {
|
416
|
+
data?: any;
|
417
|
+
error?: {
|
418
|
+
message: string;
|
419
|
+
statusCode: number | null;
|
420
|
+
} | null | undefined;
|
421
|
+
loading?: boolean | null | undefined;
|
422
|
+
} | {
|
362
423
|
start: string;
|
363
424
|
end: string;
|
364
425
|
} | null | undefined;
|
@@ -409,6 +470,13 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
409
470
|
path: string;
|
410
471
|
originalFilename: string;
|
411
472
|
}[] | {
|
473
|
+
data?: any;
|
474
|
+
error?: {
|
475
|
+
message: string;
|
476
|
+
statusCode: number | null;
|
477
|
+
} | null | undefined;
|
478
|
+
loading?: boolean | null | undefined;
|
479
|
+
} | {
|
412
480
|
start: string;
|
413
481
|
end: string;
|
414
482
|
} | null | undefined;
|
@@ -641,6 +709,20 @@ export declare const isDataFieldType: (field: {
|
|
641
709
|
value: undefined;
|
642
710
|
config: DataField;
|
643
711
|
};
|
712
|
+
export declare const isButtonFieldType: (field: {
|
713
|
+
config: FieldConfig;
|
714
|
+
value: FieldValue;
|
715
|
+
}) => field is {
|
716
|
+
value: undefined;
|
717
|
+
config: ButtonField;
|
718
|
+
};
|
719
|
+
export declare const isHttpFieldType: (field: {
|
720
|
+
config: FieldConfig;
|
721
|
+
value: FieldValue;
|
722
|
+
}) => field is {
|
723
|
+
value: undefined;
|
724
|
+
config: HttpField;
|
725
|
+
};
|
644
726
|
export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
|
645
727
|
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
646
728
|
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue } from './CompositeFieldValue';
|
2
|
+
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue, HttpFieldUpdateValue } 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).
|
@@ -39,6 +39,8 @@ export declare const DataFieldValue: z.ZodUndefined;
|
|
39
39
|
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
40
40
|
export declare const SignatureFieldValue: z.ZodString;
|
41
41
|
export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
|
42
|
+
export declare const ButtonFieldValue: z.ZodNumber;
|
43
|
+
export type ButtonFieldValue = z.infer<typeof ButtonFieldValue>;
|
42
44
|
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
|
43
45
|
start: z.ZodString;
|
44
46
|
end: z.ZodString;
|
@@ -185,7 +187,37 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodStri
|
|
185
187
|
firstname: string;
|
186
188
|
surname: string;
|
187
189
|
middlename?: string | null | undefined;
|
188
|
-
}>, z.ZodNull]>, z.ZodUndefined]
|
190
|
+
}>, z.ZodNull]>, z.ZodUndefined]>, z.ZodNumber, z.ZodObject<{
|
191
|
+
loading: z.ZodBoolean;
|
192
|
+
error: z.ZodNullable<z.ZodObject<{
|
193
|
+
statusCode: z.ZodNullable<z.ZodNumber>;
|
194
|
+
message: z.ZodString;
|
195
|
+
}, "strip", z.ZodTypeAny, {
|
196
|
+
message: string;
|
197
|
+
statusCode: number | null;
|
198
|
+
}, {
|
199
|
+
message: string;
|
200
|
+
statusCode: number | null;
|
201
|
+
}>>;
|
202
|
+
data: z.ZodAny;
|
203
|
+
trackingValue: z.ZodOptional<z.ZodString>;
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
205
|
+
error: {
|
206
|
+
message: string;
|
207
|
+
statusCode: number | null;
|
208
|
+
} | null;
|
209
|
+
loading: boolean;
|
210
|
+
data?: any;
|
211
|
+
trackingValue?: string | undefined;
|
212
|
+
}, {
|
213
|
+
error: {
|
214
|
+
message: string;
|
215
|
+
statusCode: number | null;
|
216
|
+
} | null;
|
217
|
+
loading: boolean;
|
218
|
+
data?: any;
|
219
|
+
trackingValue?: string | undefined;
|
220
|
+
}>]>;
|
189
221
|
export type FieldValue = z.infer<typeof FieldValue>;
|
190
222
|
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
|
191
223
|
start: z.ZodString;
|
@@ -321,6 +353,33 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
321
353
|
firstname: string;
|
322
354
|
surname: string;
|
323
355
|
middlename?: string | null | undefined;
|
356
|
+
}>, z.ZodNull]>, z.ZodUndefined]>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
357
|
+
loading: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
358
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
359
|
+
statusCode: z.ZodNullable<z.ZodNumber>;
|
360
|
+
message: z.ZodString;
|
361
|
+
}, "strip", z.ZodTypeAny, {
|
362
|
+
message: string;
|
363
|
+
statusCode: number | null;
|
364
|
+
}, {
|
365
|
+
message: string;
|
366
|
+
statusCode: number | null;
|
367
|
+
}>>>;
|
368
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
370
|
+
data?: any;
|
371
|
+
error?: {
|
372
|
+
message: string;
|
373
|
+
statusCode: number | null;
|
374
|
+
} | null | undefined;
|
375
|
+
loading?: boolean | null | undefined;
|
376
|
+
}, {
|
377
|
+
data?: any;
|
378
|
+
error?: {
|
379
|
+
message: string;
|
380
|
+
statusCode: number | null;
|
381
|
+
} | null | undefined;
|
382
|
+
loading?: boolean | null | undefined;
|
324
383
|
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
325
384
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
326
385
|
/**
|
@@ -332,5 +391,5 @@ export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptio
|
|
332
391
|
*
|
333
392
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
334
393
|
* */
|
335
|
-
export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof SelectDateRangeValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | z.ZodString | z.ZodBoolean;
|
394
|
+
export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof SelectDateRangeValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | typeof HttpFieldUpdateValue | typeof ButtonFieldValue | z.ZodString | z.ZodBoolean;
|
336
395
|
//# sourceMappingURL=FieldValue.d.ts.map
|