@ecrvs/opencrvs-toolkit 1.8.1-rc.a7ee8fb
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/README.md +70 -0
- package/build.sh +56 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +52 -0
- package/dist/commons/api/router.d.ts +14568 -0
- package/dist/commons/conditionals/conditionals.d.ts +194 -0
- package/dist/commons/conditionals/index.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +129 -0
- package/dist/commons/events/ActionConfig.d.ts +2034 -0
- package/dist/commons/events/ActionDocument.d.ts +14400 -0
- package/dist/commons/events/ActionInput.d.ts +11157 -0
- package/dist/commons/events/ActionType.d.ts +52 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1175 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +181 -0
- package/dist/commons/events/Conditional.d.ts +55 -0
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4494 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +209 -0
- package/dist/commons/events/Draft.d.ts +814 -0
- package/dist/commons/events/EventConfig.d.ts +2237 -0
- package/dist/commons/events/EventConfigInput.d.ts +10 -0
- package/dist/commons/events/EventDocument.d.ts +8505 -0
- package/dist/commons/events/EventIndex.d.ts +3858 -0
- package/dist/commons/events/EventInput.d.ts +13 -0
- package/dist/commons/events/EventMetadata.d.ts +408 -0
- package/dist/commons/events/FieldConfig.d.ts +7125 -0
- package/dist/commons/events/FieldType.d.ts +46 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +537 -0
- package/dist/commons/events/FieldValue.d.ts +250 -0
- package/dist/commons/events/FileUtils.d.ts +4 -0
- package/dist/commons/events/FormConfig.d.ts +725 -0
- package/dist/commons/events/PageConfig.d.ts +336 -0
- package/dist/commons/events/SummaryConfig.d.ts +170 -0
- package/dist/commons/events/TemplateConfig.d.ts +38 -0
- package/dist/commons/events/TranslationConfig.d.ts +15 -0
- package/dist/commons/events/User.d.ts +45 -0
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +8997 -0
- package/dist/commons/events/deduplication.d.ts +32 -0
- package/dist/commons/events/defineConfig.d.ts +309 -0
- package/dist/commons/events/event.d.ts +109 -0
- package/dist/commons/events/field.d.ts +151 -0
- package/dist/commons/events/index.d.ts +46 -0
- package/dist/commons/events/locations.d.ts +24 -0
- package/dist/commons/events/scopes.d.ts +55 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/state/availableActions.d.ts +6 -0
- package/dist/commons/events/state/flags.d.ts +4 -0
- package/dist/commons/events/state/index.d.ts +146 -0
- package/dist/commons/events/state/utils.d.ts +1263 -0
- package/dist/commons/events/test.utils.d.ts +473 -0
- package/dist/commons/events/transactions.d.ts +2 -0
- package/dist/commons/events/utils.d.ts +501 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/commons/notification/UserNotifications.d.ts +632 -0
- package/dist/commons/notification/index.d.ts +2 -0
- package/dist/conditionals/index.d.ts +2 -0
- package/dist/conditionals/index.d.ts.map +1 -0
- package/dist/conditionals/index.js +491 -0
- package/dist/events/deduplication.d.ts +32 -0
- package/dist/events/deduplication.d.ts.map +1 -0
- package/dist/events/deduplication.js +67 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +8383 -0
- package/dist/notification/index.d.ts +2 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/index.js +5928 -0
- package/dist/scopes/index.d.ts +335 -0
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/scopes/index.js +379 -0
- package/package.json +40 -0
- package/tsconfig.json +27 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FieldType: {
|
|
3
|
+
readonly NAME: "NAME";
|
|
4
|
+
readonly PHONE: "PHONE";
|
|
5
|
+
readonly ID: "ID";
|
|
6
|
+
readonly ADDRESS: "ADDRESS";
|
|
7
|
+
readonly TEXT: "TEXT";
|
|
8
|
+
readonly NUMBER: "NUMBER";
|
|
9
|
+
readonly TEXTAREA: "TEXTAREA";
|
|
10
|
+
readonly EMAIL: "EMAIL";
|
|
11
|
+
readonly DATE: "DATE";
|
|
12
|
+
readonly DATE_RANGE: "DATE_RANGE";
|
|
13
|
+
readonly SELECT_DATE_RANGE: "SELECT_DATE_RANGE";
|
|
14
|
+
readonly TIME: "TIME";
|
|
15
|
+
readonly PARAGRAPH: "PARAGRAPH";
|
|
16
|
+
readonly PAGE_HEADER: "PAGE_HEADER";
|
|
17
|
+
readonly RADIO_GROUP: "RADIO_GROUP";
|
|
18
|
+
readonly FILE: "FILE";
|
|
19
|
+
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
|
|
20
|
+
readonly BULLET_LIST: "BULLET_LIST";
|
|
21
|
+
readonly CHECKBOX: "CHECKBOX";
|
|
22
|
+
readonly SELECT: "SELECT";
|
|
23
|
+
readonly COUNTRY: "COUNTRY";
|
|
24
|
+
readonly LOCATION: "LOCATION";
|
|
25
|
+
readonly DIVIDER: "DIVIDER";
|
|
26
|
+
readonly ADMINISTRATIVE_AREA: "ADMINISTRATIVE_AREA";
|
|
27
|
+
readonly FACILITY: "FACILITY";
|
|
28
|
+
readonly OFFICE: "OFFICE";
|
|
29
|
+
readonly SIGNATURE: "SIGNATURE";
|
|
30
|
+
readonly DATA: "DATA";
|
|
31
|
+
readonly BUTTON: "BUTTON";
|
|
32
|
+
readonly HTTP: "HTTP";
|
|
33
|
+
readonly LINK_BUTTON: "LINK_BUTTON";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Union of types that handle files. Using common type should help with compiler to know where to add new cases.
|
|
37
|
+
*/
|
|
38
|
+
export declare const FileFieldType: z.ZodEnum<["FILE", "FILE_WITH_OPTIONS", "SIGNATURE"]>;
|
|
39
|
+
export declare const fieldTypes: ("NAME" | "PHONE" | "ID" | "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" | "LINK_BUTTON")[];
|
|
40
|
+
export type FieldType = (typeof fieldTypes)[number];
|
|
41
|
+
/**
|
|
42
|
+
* Composite field types are field types that consist of multiple field values.
|
|
43
|
+
*/
|
|
44
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
|
|
45
|
+
export declare const FieldTypesToHideInReview: ("PARAGRAPH" | "PAGE_HEADER" | "BULLET_LIST" | "DIVIDER")[];
|
|
46
|
+
//# sourceMappingURL=FieldType.d.ts.map
|
|
@@ -0,0 +1,537 @@
|
|
|
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, HttpField, ButtonField, LinkButtonField } from './FieldConfig';
|
|
3
|
+
import { FieldType } from './FieldType';
|
|
4
|
+
import { FieldValue, FieldUpdateValueSchema, DateRangeFieldValue, SelectDateRangeValue } from './FieldValue';
|
|
5
|
+
import { FullDocumentPath } from '../documents';
|
|
6
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
|
|
7
|
+
/**
|
|
8
|
+
* FieldTypeMapping.ts should include functions that map field types to different formats dynamically.
|
|
9
|
+
* File is separated from FieldType and FieldConfig to avoid circular dependencies.
|
|
10
|
+
*
|
|
11
|
+
* We can move the specific mapFieldTypeTo* functions where they are used once the core fields are implemented.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Optionality of a field is defined in FieldConfig, not in FieldValue.
|
|
15
|
+
* Allows for nullishness of a field value during validations based on FieldConfig.
|
|
16
|
+
*/
|
|
17
|
+
type NullishFieldValueSchema = z.ZodOptional<z.ZodNullable<FieldUpdateValueSchema>>;
|
|
18
|
+
/**
|
|
19
|
+
* Mapping of field types to Zod schema.
|
|
20
|
+
* Useful for building dynamic validations against FieldConfig
|
|
21
|
+
*/
|
|
22
|
+
export declare function mapFieldTypeToZod(type: FieldType, required?: boolean): z.ZodString | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodObject<{
|
|
23
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
24
|
+
originalFilename: z.ZodString;
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
type: string;
|
|
28
|
+
path: string;
|
|
29
|
+
originalFilename: string;
|
|
30
|
+
}, {
|
|
31
|
+
type: string;
|
|
32
|
+
path: string;
|
|
33
|
+
originalFilename: string;
|
|
34
|
+
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
35
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
36
|
+
originalFilename: z.ZodString;
|
|
37
|
+
type: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
type: string;
|
|
40
|
+
path: string;
|
|
41
|
+
originalFilename: string;
|
|
42
|
+
}, {
|
|
43
|
+
type: string;
|
|
44
|
+
path: string;
|
|
45
|
+
originalFilename: string;
|
|
46
|
+
}>>> | z.ZodObject<{
|
|
47
|
+
firstname: z.ZodString;
|
|
48
|
+
surname: z.ZodString;
|
|
49
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
firstname: string;
|
|
52
|
+
surname: string;
|
|
53
|
+
middlename?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
firstname: string;
|
|
56
|
+
surname: string;
|
|
57
|
+
middlename?: string | undefined;
|
|
58
|
+
}> | z.ZodUndefined | z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
59
|
+
firstname: z.ZodString;
|
|
60
|
+
surname: z.ZodString;
|
|
61
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
firstname: string;
|
|
64
|
+
surname: string;
|
|
65
|
+
middlename?: string | null | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
firstname: string;
|
|
68
|
+
surname: string;
|
|
69
|
+
middlename?: string | null | undefined;
|
|
70
|
+
}>, z.ZodNull]>, z.ZodUndefined]> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
71
|
+
firstname: z.ZodString;
|
|
72
|
+
surname: z.ZodString;
|
|
73
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
firstname: string;
|
|
76
|
+
surname: string;
|
|
77
|
+
middlename?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
firstname: string;
|
|
80
|
+
surname: string;
|
|
81
|
+
middlename?: string | undefined;
|
|
82
|
+
}>>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
83
|
+
firstname: z.ZodString;
|
|
84
|
+
surname: z.ZodString;
|
|
85
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
firstname: string;
|
|
88
|
+
surname: string;
|
|
89
|
+
middlename?: string | null | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
firstname: string;
|
|
92
|
+
surname: string;
|
|
93
|
+
middlename?: string | null | undefined;
|
|
94
|
+
}>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodObject<{
|
|
95
|
+
country: z.ZodString;
|
|
96
|
+
addressType: z.ZodEnum<["DOMESTIC", "INTERNATIONAL"]>;
|
|
97
|
+
administrativeArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
streetLevelDetails: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
country: string;
|
|
101
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
102
|
+
administrativeArea?: string | null | undefined;
|
|
103
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
country: string;
|
|
106
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
107
|
+
administrativeArea?: string | null | undefined;
|
|
108
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
109
|
+
}> | z.ZodArray<z.ZodObject<{
|
|
110
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
111
|
+
originalFilename: z.ZodString;
|
|
112
|
+
type: z.ZodString;
|
|
113
|
+
option: z.ZodString;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
type: string;
|
|
116
|
+
option: string;
|
|
117
|
+
path: string;
|
|
118
|
+
originalFilename: string;
|
|
119
|
+
}, {
|
|
120
|
+
type: string;
|
|
121
|
+
option: string;
|
|
122
|
+
path: string;
|
|
123
|
+
originalFilename: string;
|
|
124
|
+
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
125
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
126
|
+
originalFilename: z.ZodString;
|
|
127
|
+
type: z.ZodString;
|
|
128
|
+
option: z.ZodString;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
type: string;
|
|
131
|
+
option: string;
|
|
132
|
+
path: string;
|
|
133
|
+
originalFilename: string;
|
|
134
|
+
}, {
|
|
135
|
+
type: string;
|
|
136
|
+
option: string;
|
|
137
|
+
path: string;
|
|
138
|
+
originalFilename: string;
|
|
139
|
+
}>, "many">>> | z.ZodBoolean | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
140
|
+
loading: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
141
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
142
|
+
statusCode: z.ZodNumber;
|
|
143
|
+
message: z.ZodString;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
message: string;
|
|
146
|
+
statusCode: number;
|
|
147
|
+
}, {
|
|
148
|
+
message: string;
|
|
149
|
+
statusCode: number;
|
|
150
|
+
}>>>;
|
|
151
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
data?: any;
|
|
154
|
+
error?: {
|
|
155
|
+
message: string;
|
|
156
|
+
statusCode: number;
|
|
157
|
+
} | null | undefined;
|
|
158
|
+
loading?: boolean | null | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
data?: any;
|
|
161
|
+
error?: {
|
|
162
|
+
message: string;
|
|
163
|
+
statusCode: number;
|
|
164
|
+
} | null | undefined;
|
|
165
|
+
loading?: boolean | null | undefined;
|
|
166
|
+
}>, z.ZodNull]>, z.ZodUndefined]> | z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]> | z.ZodUnion<[z.ZodObject<{
|
|
167
|
+
start: z.ZodString;
|
|
168
|
+
end: z.ZodString;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
start: string;
|
|
171
|
+
end: string;
|
|
172
|
+
}, {
|
|
173
|
+
start: string;
|
|
174
|
+
end: string;
|
|
175
|
+
}>, z.ZodString]> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
|
176
|
+
start: z.ZodString;
|
|
177
|
+
end: z.ZodString;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
start: string;
|
|
180
|
+
end: string;
|
|
181
|
+
}, {
|
|
182
|
+
start: string;
|
|
183
|
+
end: string;
|
|
184
|
+
}>, z.ZodString]>>> | z.ZodOptional<z.ZodNullable<z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>>> | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
185
|
+
country: z.ZodString;
|
|
186
|
+
addressType: z.ZodEnum<["DOMESTIC", "INTERNATIONAL"]>;
|
|
187
|
+
administrativeArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
streetLevelDetails: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
country: string;
|
|
191
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
192
|
+
administrativeArea?: string | null | undefined;
|
|
193
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
country: string;
|
|
196
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
197
|
+
administrativeArea?: string | null | undefined;
|
|
198
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
199
|
+
}>>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
200
|
+
loading: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
201
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
202
|
+
statusCode: z.ZodNumber;
|
|
203
|
+
message: z.ZodString;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
message: string;
|
|
206
|
+
statusCode: number;
|
|
207
|
+
}, {
|
|
208
|
+
message: string;
|
|
209
|
+
statusCode: number;
|
|
210
|
+
}>>>;
|
|
211
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
data?: any;
|
|
214
|
+
error?: {
|
|
215
|
+
message: string;
|
|
216
|
+
statusCode: number;
|
|
217
|
+
} | null | undefined;
|
|
218
|
+
loading?: boolean | null | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
data?: any;
|
|
221
|
+
error?: {
|
|
222
|
+
message: string;
|
|
223
|
+
statusCode: number;
|
|
224
|
+
} | null | undefined;
|
|
225
|
+
loading?: boolean | null | undefined;
|
|
226
|
+
}>, z.ZodNull]>, z.ZodUndefined]>>>;
|
|
227
|
+
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
|
228
|
+
[x: string]: string | number | boolean | {
|
|
229
|
+
type: string;
|
|
230
|
+
path: string;
|
|
231
|
+
originalFilename: string;
|
|
232
|
+
} | {
|
|
233
|
+
firstname: string;
|
|
234
|
+
surname: string;
|
|
235
|
+
middlename?: string | undefined;
|
|
236
|
+
} | {
|
|
237
|
+
firstname: string;
|
|
238
|
+
surname: string;
|
|
239
|
+
middlename?: string | null | undefined;
|
|
240
|
+
} | {
|
|
241
|
+
country: string;
|
|
242
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
243
|
+
administrativeArea?: string | null | undefined;
|
|
244
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
245
|
+
} | {
|
|
246
|
+
type: string;
|
|
247
|
+
option: string;
|
|
248
|
+
path: string;
|
|
249
|
+
originalFilename: string;
|
|
250
|
+
}[] | {
|
|
251
|
+
data?: any;
|
|
252
|
+
error?: {
|
|
253
|
+
message: string;
|
|
254
|
+
statusCode: number;
|
|
255
|
+
} | null | undefined;
|
|
256
|
+
loading?: boolean | null | undefined;
|
|
257
|
+
} | {
|
|
258
|
+
start: string;
|
|
259
|
+
end: string;
|
|
260
|
+
} | null | undefined;
|
|
261
|
+
}, {
|
|
262
|
+
[x: string]: string | number | boolean | {
|
|
263
|
+
type: string;
|
|
264
|
+
path: string;
|
|
265
|
+
originalFilename: string;
|
|
266
|
+
} | {
|
|
267
|
+
firstname: string;
|
|
268
|
+
surname: string;
|
|
269
|
+
middlename?: string | undefined;
|
|
270
|
+
} | {
|
|
271
|
+
firstname: string;
|
|
272
|
+
surname: string;
|
|
273
|
+
middlename?: string | null | undefined;
|
|
274
|
+
} | {
|
|
275
|
+
country: string;
|
|
276
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
277
|
+
administrativeArea?: string | null | undefined;
|
|
278
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
279
|
+
} | {
|
|
280
|
+
type: string;
|
|
281
|
+
option: string;
|
|
282
|
+
path: string;
|
|
283
|
+
originalFilename: string;
|
|
284
|
+
}[] | {
|
|
285
|
+
data?: any;
|
|
286
|
+
error?: {
|
|
287
|
+
message: string;
|
|
288
|
+
statusCode: number;
|
|
289
|
+
} | null | undefined;
|
|
290
|
+
loading?: boolean | null | undefined;
|
|
291
|
+
} | {
|
|
292
|
+
start: string;
|
|
293
|
+
end: string;
|
|
294
|
+
} | null | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
/**
|
|
297
|
+
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
|
298
|
+
*/
|
|
299
|
+
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
|
300
|
+
country: string;
|
|
301
|
+
addressType: "DOMESTIC";
|
|
302
|
+
administrativeArea: string;
|
|
303
|
+
streetLevelDetails: {};
|
|
304
|
+
path?: undefined;
|
|
305
|
+
originalFilename?: undefined;
|
|
306
|
+
type?: undefined;
|
|
307
|
+
} | {
|
|
308
|
+
path: FullDocumentPath;
|
|
309
|
+
originalFilename: string;
|
|
310
|
+
type: string;
|
|
311
|
+
country?: undefined;
|
|
312
|
+
addressType?: undefined;
|
|
313
|
+
administrativeArea?: undefined;
|
|
314
|
+
streetLevelDetails?: undefined;
|
|
315
|
+
} | null;
|
|
316
|
+
export declare const isParagraphFieldType: (field: {
|
|
317
|
+
config: FieldConfig;
|
|
318
|
+
value: FieldValue;
|
|
319
|
+
}) => field is {
|
|
320
|
+
value: string;
|
|
321
|
+
config: Paragraph;
|
|
322
|
+
};
|
|
323
|
+
export declare const isDateFieldType: (field: {
|
|
324
|
+
config: FieldConfig;
|
|
325
|
+
value: FieldValue;
|
|
326
|
+
}) => field is {
|
|
327
|
+
value: string;
|
|
328
|
+
config: DateField;
|
|
329
|
+
};
|
|
330
|
+
export declare const isTimeFieldType: (field: {
|
|
331
|
+
config: FieldConfig;
|
|
332
|
+
value: FieldValue;
|
|
333
|
+
}) => field is {
|
|
334
|
+
value: string;
|
|
335
|
+
config: TimeField;
|
|
336
|
+
};
|
|
337
|
+
export declare const isDateRangeFieldType: (field: {
|
|
338
|
+
config: FieldConfig;
|
|
339
|
+
value: FieldValue;
|
|
340
|
+
}) => field is {
|
|
341
|
+
value: DateRangeFieldValue;
|
|
342
|
+
config: DateRangeField;
|
|
343
|
+
};
|
|
344
|
+
export declare const isSelectDateRangeFieldType: (field: {
|
|
345
|
+
config: FieldConfig;
|
|
346
|
+
value: FieldValue;
|
|
347
|
+
}) => field is {
|
|
348
|
+
value: SelectDateRangeValue;
|
|
349
|
+
config: SelectDateRangeField;
|
|
350
|
+
};
|
|
351
|
+
export declare const isPageHeaderFieldType: (field: {
|
|
352
|
+
config: FieldConfig;
|
|
353
|
+
value: FieldValue;
|
|
354
|
+
}) => field is {
|
|
355
|
+
value: string;
|
|
356
|
+
config: PageHeader;
|
|
357
|
+
};
|
|
358
|
+
export declare const isTextFieldType: (field: {
|
|
359
|
+
config: FieldConfig;
|
|
360
|
+
value: FieldValue;
|
|
361
|
+
}) => field is {
|
|
362
|
+
value: string;
|
|
363
|
+
config: TextField;
|
|
364
|
+
};
|
|
365
|
+
export declare const isNumberFieldType: (field: {
|
|
366
|
+
config: FieldConfig;
|
|
367
|
+
value: FieldValue;
|
|
368
|
+
}) => field is {
|
|
369
|
+
value: number;
|
|
370
|
+
config: NumberField;
|
|
371
|
+
};
|
|
372
|
+
export declare const isNameFieldType: (field: {
|
|
373
|
+
config: FieldConfig;
|
|
374
|
+
value: FieldValue;
|
|
375
|
+
}) => field is {
|
|
376
|
+
value: NameFieldValue;
|
|
377
|
+
config: NameField;
|
|
378
|
+
};
|
|
379
|
+
export declare const isPhoneFieldType: (field: {
|
|
380
|
+
config: FieldConfig;
|
|
381
|
+
value: FieldValue;
|
|
382
|
+
}) => field is {
|
|
383
|
+
value: string;
|
|
384
|
+
config: PhoneField;
|
|
385
|
+
};
|
|
386
|
+
export declare const isIdFieldType: (field: {
|
|
387
|
+
config: FieldConfig;
|
|
388
|
+
value: FieldValue;
|
|
389
|
+
}) => field is {
|
|
390
|
+
value: string;
|
|
391
|
+
config: IdField;
|
|
392
|
+
};
|
|
393
|
+
export declare const isTextAreaFieldType: (field: {
|
|
394
|
+
config: FieldConfig;
|
|
395
|
+
value: FieldValue;
|
|
396
|
+
}) => field is {
|
|
397
|
+
value: string;
|
|
398
|
+
config: TextAreaField;
|
|
399
|
+
};
|
|
400
|
+
export declare const isSignatureFieldType: (field: {
|
|
401
|
+
config: FieldConfig;
|
|
402
|
+
value: FieldValue | undefined;
|
|
403
|
+
}) => field is {
|
|
404
|
+
value: FileFieldValue | undefined;
|
|
405
|
+
config: SignatureField;
|
|
406
|
+
};
|
|
407
|
+
export declare const isEmailFieldType: (field: {
|
|
408
|
+
config: FieldConfig;
|
|
409
|
+
value: FieldValue;
|
|
410
|
+
}) => field is {
|
|
411
|
+
value: string;
|
|
412
|
+
config: EmailField;
|
|
413
|
+
};
|
|
414
|
+
export declare const isFileFieldType: (field: {
|
|
415
|
+
config: FieldConfig;
|
|
416
|
+
value: FieldValue;
|
|
417
|
+
}) => field is {
|
|
418
|
+
value: FileFieldValue;
|
|
419
|
+
config: File;
|
|
420
|
+
};
|
|
421
|
+
export declare const isFileFieldWithOptionType: (field: {
|
|
422
|
+
config: FieldConfig;
|
|
423
|
+
value: FieldValue;
|
|
424
|
+
}) => field is {
|
|
425
|
+
value: FileFieldWithOptionValue;
|
|
426
|
+
config: FileUploadWithOptions;
|
|
427
|
+
};
|
|
428
|
+
export declare const isBulletListFieldType: (field: {
|
|
429
|
+
config: FieldConfig;
|
|
430
|
+
value: FieldValue;
|
|
431
|
+
}) => field is {
|
|
432
|
+
value: string;
|
|
433
|
+
config: BulletList;
|
|
434
|
+
};
|
|
435
|
+
export declare const isSelectFieldType: (field: {
|
|
436
|
+
config: FieldConfig;
|
|
437
|
+
value: FieldValue;
|
|
438
|
+
}) => field is {
|
|
439
|
+
value: string;
|
|
440
|
+
config: SelectField;
|
|
441
|
+
};
|
|
442
|
+
export declare const isAddressFieldType: (field: {
|
|
443
|
+
config: FieldConfig;
|
|
444
|
+
value: FieldValue;
|
|
445
|
+
}) => field is {
|
|
446
|
+
value: AddressFieldValue;
|
|
447
|
+
config: AddressField;
|
|
448
|
+
};
|
|
449
|
+
export declare const isCountryFieldType: (field: {
|
|
450
|
+
config: FieldConfig;
|
|
451
|
+
value: FieldValue;
|
|
452
|
+
}) => field is {
|
|
453
|
+
value: string;
|
|
454
|
+
config: Country;
|
|
455
|
+
};
|
|
456
|
+
export declare const isCheckboxFieldType: (field: {
|
|
457
|
+
config: FieldConfig;
|
|
458
|
+
value: FieldValue;
|
|
459
|
+
}) => field is {
|
|
460
|
+
value: boolean;
|
|
461
|
+
config: Checkbox;
|
|
462
|
+
};
|
|
463
|
+
export declare const isRadioGroupFieldType: (field: {
|
|
464
|
+
config: FieldConfig;
|
|
465
|
+
value: FieldValue;
|
|
466
|
+
}) => field is {
|
|
467
|
+
value: string;
|
|
468
|
+
config: RadioGroup;
|
|
469
|
+
};
|
|
470
|
+
export declare const isLocationFieldType: (field: {
|
|
471
|
+
config: FieldConfig;
|
|
472
|
+
value: FieldValue;
|
|
473
|
+
}) => field is {
|
|
474
|
+
value: string;
|
|
475
|
+
config: LocationInput;
|
|
476
|
+
};
|
|
477
|
+
export declare const isDividerFieldType: (field: {
|
|
478
|
+
config: FieldConfig;
|
|
479
|
+
value: FieldValue;
|
|
480
|
+
}) => field is {
|
|
481
|
+
value: string;
|
|
482
|
+
config: Divider;
|
|
483
|
+
};
|
|
484
|
+
export declare const isAdministrativeAreaFieldType: (field: {
|
|
485
|
+
config: FieldConfig;
|
|
486
|
+
value: FieldValue;
|
|
487
|
+
}) => field is {
|
|
488
|
+
value: string;
|
|
489
|
+
config: AdministrativeArea;
|
|
490
|
+
};
|
|
491
|
+
export declare const isFacilityFieldType: (field: {
|
|
492
|
+
config: FieldConfig;
|
|
493
|
+
value: FieldValue;
|
|
494
|
+
}) => field is {
|
|
495
|
+
value: string;
|
|
496
|
+
config: Facility;
|
|
497
|
+
};
|
|
498
|
+
export declare const isOfficeFieldType: (field: {
|
|
499
|
+
config: FieldConfig;
|
|
500
|
+
value: FieldValue;
|
|
501
|
+
}) => field is {
|
|
502
|
+
value: string;
|
|
503
|
+
config: Office;
|
|
504
|
+
};
|
|
505
|
+
export declare const isDataFieldType: (field: {
|
|
506
|
+
config: FieldConfig;
|
|
507
|
+
value: FieldValue;
|
|
508
|
+
}) => field is {
|
|
509
|
+
value: undefined;
|
|
510
|
+
config: DataField;
|
|
511
|
+
};
|
|
512
|
+
export declare const isButtonFieldType: (field: {
|
|
513
|
+
config: FieldConfig;
|
|
514
|
+
value: FieldValue;
|
|
515
|
+
}) => field is {
|
|
516
|
+
value: undefined;
|
|
517
|
+
config: ButtonField;
|
|
518
|
+
};
|
|
519
|
+
export declare const isHttpFieldType: (field: {
|
|
520
|
+
config: FieldConfig;
|
|
521
|
+
value: FieldValue;
|
|
522
|
+
}) => field is {
|
|
523
|
+
value: undefined;
|
|
524
|
+
config: HttpField;
|
|
525
|
+
};
|
|
526
|
+
export declare const isLinkButtonFieldType: (field: {
|
|
527
|
+
config: FieldConfig;
|
|
528
|
+
value: FieldValue;
|
|
529
|
+
}) => field is {
|
|
530
|
+
value: undefined;
|
|
531
|
+
config: LinkButtonField;
|
|
532
|
+
};
|
|
533
|
+
export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField | HttpField | LinkButtonField;
|
|
534
|
+
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
|
535
|
+
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
|
536
|
+
export {};
|
|
537
|
+
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|