@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,250 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue, HttpFieldUpdateValue } from './CompositeFieldValue';
|
|
3
|
+
/**
|
|
4
|
+
* FieldValues defined in this file are primitive field values.
|
|
5
|
+
* FieldValues defined in CompositeFieldValue.ts are composed of multiple primitive field values (Address, File etc).
|
|
6
|
+
*
|
|
7
|
+
* FieldValue is a union of primitive and composite field values.
|
|
8
|
+
* FieldValue can never be null.
|
|
9
|
+
*
|
|
10
|
+
* FieldUpdateValue accepts null values for primitive field values when they are optional.
|
|
11
|
+
* API is build assuming partial (PATCH) updates. In order to edit and remove optional value, we need to accept null values.
|
|
12
|
+
* Omitting a field value in partial updates leaves it untouched.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare const TextValue: z.ZodString;
|
|
16
|
+
export declare const NonEmptyTextValue: z.ZodString;
|
|
17
|
+
export declare const DateValue: z.ZodString;
|
|
18
|
+
export declare const TimeValue: z.ZodString;
|
|
19
|
+
export declare const DatetimeValue: z.ZodString;
|
|
20
|
+
export declare const SelectDateRangeValue: z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>;
|
|
21
|
+
export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodObject<{
|
|
22
|
+
start: z.ZodString;
|
|
23
|
+
end: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
start: string;
|
|
26
|
+
end: string;
|
|
27
|
+
}, {
|
|
28
|
+
start: string;
|
|
29
|
+
end: string;
|
|
30
|
+
}>, z.ZodString]>;
|
|
31
|
+
export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
|
|
32
|
+
export type SelectDateRangeValue = z.infer<typeof SelectDateRangeValue>;
|
|
33
|
+
export declare const EmailValue: z.ZodString;
|
|
34
|
+
export declare const CheckboxFieldValue: z.ZodBoolean;
|
|
35
|
+
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
|
36
|
+
export declare const NumberFieldValue: z.ZodNumber;
|
|
37
|
+
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
|
38
|
+
export declare const DataFieldValue: z.ZodUndefined;
|
|
39
|
+
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
|
40
|
+
export declare const SignatureFieldValue: z.ZodString;
|
|
41
|
+
export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
|
|
42
|
+
export declare const ButtonFieldValue: z.ZodNumber;
|
|
43
|
+
export type ButtonFieldValue = z.infer<typeof ButtonFieldValue>;
|
|
44
|
+
export declare const FieldValue: z.ZodUnion<[z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodString, z.ZodString, z.ZodString, z.ZodObject<{
|
|
45
|
+
country: z.ZodString;
|
|
46
|
+
addressType: z.ZodEnum<["DOMESTIC", "INTERNATIONAL"]>;
|
|
47
|
+
administrativeArea: z.ZodOptional<z.ZodString>;
|
|
48
|
+
streetLevelDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
country: string;
|
|
51
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
52
|
+
administrativeArea?: string | undefined;
|
|
53
|
+
streetLevelDetails?: Record<string, string> | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
country: string;
|
|
56
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
57
|
+
administrativeArea?: string | undefined;
|
|
58
|
+
streetLevelDetails?: Record<string, string> | undefined;
|
|
59
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
60
|
+
start: z.ZodString;
|
|
61
|
+
end: z.ZodString;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
start: string;
|
|
64
|
+
end: string;
|
|
65
|
+
}, {
|
|
66
|
+
start: string;
|
|
67
|
+
end: string;
|
|
68
|
+
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
|
69
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
70
|
+
originalFilename: z.ZodString;
|
|
71
|
+
type: z.ZodString;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
type: string;
|
|
74
|
+
path: string;
|
|
75
|
+
originalFilename: string;
|
|
76
|
+
}, {
|
|
77
|
+
type: string;
|
|
78
|
+
path: string;
|
|
79
|
+
originalFilename: string;
|
|
80
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
81
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
82
|
+
originalFilename: z.ZodString;
|
|
83
|
+
type: z.ZodString;
|
|
84
|
+
option: z.ZodString;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
type: string;
|
|
87
|
+
option: string;
|
|
88
|
+
path: string;
|
|
89
|
+
originalFilename: string;
|
|
90
|
+
}, {
|
|
91
|
+
type: string;
|
|
92
|
+
option: string;
|
|
93
|
+
path: string;
|
|
94
|
+
originalFilename: string;
|
|
95
|
+
}>, "many">, z.ZodUndefined, z.ZodObject<{
|
|
96
|
+
firstname: z.ZodString;
|
|
97
|
+
surname: z.ZodString;
|
|
98
|
+
middlename: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
firstname: string;
|
|
101
|
+
surname: string;
|
|
102
|
+
middlename?: string | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
firstname: string;
|
|
105
|
+
surname: string;
|
|
106
|
+
middlename?: string | undefined;
|
|
107
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
108
|
+
firstname: z.ZodString;
|
|
109
|
+
surname: z.ZodString;
|
|
110
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
firstname: string;
|
|
113
|
+
surname: string;
|
|
114
|
+
middlename?: string | null | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
firstname: string;
|
|
117
|
+
surname: string;
|
|
118
|
+
middlename?: string | null | undefined;
|
|
119
|
+
}>, z.ZodNull]>, z.ZodUndefined]>, z.ZodNumber, z.ZodObject<{
|
|
120
|
+
loading: z.ZodBoolean;
|
|
121
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
122
|
+
statusCode: z.ZodNumber;
|
|
123
|
+
message: z.ZodString;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
message: string;
|
|
126
|
+
statusCode: number;
|
|
127
|
+
}, {
|
|
128
|
+
message: string;
|
|
129
|
+
statusCode: number;
|
|
130
|
+
}>>>;
|
|
131
|
+
data: z.ZodAny;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
loading: boolean;
|
|
134
|
+
data?: any;
|
|
135
|
+
error?: {
|
|
136
|
+
message: string;
|
|
137
|
+
statusCode: number;
|
|
138
|
+
} | null | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
loading: boolean;
|
|
141
|
+
data?: any;
|
|
142
|
+
error?: {
|
|
143
|
+
message: string;
|
|
144
|
+
statusCode: number;
|
|
145
|
+
} | null | undefined;
|
|
146
|
+
}>]>;
|
|
147
|
+
export type FieldValue = z.infer<typeof FieldValue>;
|
|
148
|
+
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>, z.ZodString, z.ZodString, z.ZodString, z.ZodObject<{
|
|
149
|
+
country: z.ZodString;
|
|
150
|
+
addressType: z.ZodEnum<["DOMESTIC", "INTERNATIONAL"]>;
|
|
151
|
+
administrativeArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
streetLevelDetails: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
country: string;
|
|
155
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
156
|
+
administrativeArea?: string | null | undefined;
|
|
157
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
country: string;
|
|
160
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
161
|
+
administrativeArea?: string | null | undefined;
|
|
162
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
163
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
164
|
+
start: z.ZodString;
|
|
165
|
+
end: z.ZodString;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
start: string;
|
|
168
|
+
end: string;
|
|
169
|
+
}, {
|
|
170
|
+
start: string;
|
|
171
|
+
end: string;
|
|
172
|
+
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
|
173
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
174
|
+
originalFilename: z.ZodString;
|
|
175
|
+
type: z.ZodString;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
type: string;
|
|
178
|
+
path: string;
|
|
179
|
+
originalFilename: string;
|
|
180
|
+
}, {
|
|
181
|
+
type: string;
|
|
182
|
+
path: string;
|
|
183
|
+
originalFilename: string;
|
|
184
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
185
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
186
|
+
originalFilename: z.ZodString;
|
|
187
|
+
type: z.ZodString;
|
|
188
|
+
option: z.ZodString;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
type: string;
|
|
191
|
+
option: string;
|
|
192
|
+
path: string;
|
|
193
|
+
originalFilename: string;
|
|
194
|
+
}, {
|
|
195
|
+
type: string;
|
|
196
|
+
option: string;
|
|
197
|
+
path: string;
|
|
198
|
+
originalFilename: string;
|
|
199
|
+
}>, "many">, z.ZodUndefined, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
200
|
+
firstname: z.ZodString;
|
|
201
|
+
surname: z.ZodString;
|
|
202
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
firstname: string;
|
|
205
|
+
surname: string;
|
|
206
|
+
middlename?: string | null | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
firstname: string;
|
|
209
|
+
surname: string;
|
|
210
|
+
middlename?: string | null | undefined;
|
|
211
|
+
}>, z.ZodNull]>, z.ZodUndefined]>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
212
|
+
loading: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
213
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
214
|
+
statusCode: z.ZodNumber;
|
|
215
|
+
message: z.ZodString;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
message: string;
|
|
218
|
+
statusCode: number;
|
|
219
|
+
}, {
|
|
220
|
+
message: string;
|
|
221
|
+
statusCode: number;
|
|
222
|
+
}>>>;
|
|
223
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
data?: any;
|
|
226
|
+
error?: {
|
|
227
|
+
message: string;
|
|
228
|
+
statusCode: number;
|
|
229
|
+
} | null | undefined;
|
|
230
|
+
loading?: boolean | null | undefined;
|
|
231
|
+
}, {
|
|
232
|
+
data?: any;
|
|
233
|
+
error?: {
|
|
234
|
+
message: string;
|
|
235
|
+
statusCode: number;
|
|
236
|
+
} | null | undefined;
|
|
237
|
+
loading?: boolean | null | undefined;
|
|
238
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
|
239
|
+
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
|
240
|
+
/**
|
|
241
|
+
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
|
242
|
+
* */
|
|
243
|
+
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
|
|
244
|
+
/**
|
|
245
|
+
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
|
246
|
+
*
|
|
247
|
+
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
|
248
|
+
* */
|
|
249
|
+
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;
|
|
250
|
+
//# sourceMappingURL=FieldValue.d.ts.map
|