@opencrvs/toolkit 1.8.0-rc.ff73871 → 1.8.0-rc.ffe8c17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { TranslationConfig } from './TranslationConfig';
3
+ export declare enum PageType {
4
+ FORM = "FORM",
5
+ VERIFICATION = "VERIFICATION"
6
+ }
3
7
  export declare const FormPage: z.ZodObject<{
4
8
  id: z.ZodString;
5
9
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
@@ -8,7 +12,9 @@ export declare const FormPage: z.ZodObject<{
8
12
  defaultMessage: string;
9
13
  }>;
10
14
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").Inferred, any, import("./FieldConfig").Inferred>, "many">;
15
+ type: z.ZodDefault<z.ZodLiteral<PageType.FORM>>;
11
16
  }, "strip", z.ZodTypeAny, {
17
+ type: PageType.FORM;
12
18
  id: string;
13
19
  title: TranslationConfig;
14
20
  fields: import("./FieldConfig").Inferred[];
@@ -20,53 +26,329 @@ export declare const FormPage: z.ZodObject<{
20
26
  defaultMessage: string;
21
27
  };
22
28
  fields: import("./FieldConfig").Inferred[];
29
+ type?: PageType.FORM | undefined;
23
30
  }>;
24
- export declare const FormConfig: z.ZodObject<{
25
- label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
26
- id: string;
27
- description: string;
28
- defaultMessage: string;
31
+ export declare const VerificationPageConfig: z.ZodObject<{
32
+ verify: z.ZodObject<{
33
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
34
+ id: string;
35
+ description: string;
36
+ defaultMessage: string;
37
+ }>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ label: TranslationConfig;
40
+ }, {
41
+ label: {
42
+ id: string;
43
+ description: string;
44
+ defaultMessage: string;
45
+ };
29
46
  }>;
30
- version: z.ZodObject<{
31
- id: z.ZodString;
47
+ cancel: z.ZodObject<{
32
48
  label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
33
49
  id: string;
34
50
  description: string;
35
51
  defaultMessage: string;
36
52
  }>;
53
+ confirmation: z.ZodObject<{
54
+ title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
55
+ id: string;
56
+ description: string;
57
+ defaultMessage: string;
58
+ }>;
59
+ body: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
60
+ id: string;
61
+ description: string;
62
+ defaultMessage: string;
63
+ }>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ title: TranslationConfig;
66
+ body: TranslationConfig;
67
+ }, {
68
+ title: {
69
+ id: string;
70
+ description: string;
71
+ defaultMessage: string;
72
+ };
73
+ body: {
74
+ id: string;
75
+ description: string;
76
+ defaultMessage: string;
77
+ };
78
+ }>;
37
79
  }, "strip", z.ZodTypeAny, {
38
- id: string;
39
80
  label: TranslationConfig;
81
+ confirmation: {
82
+ title: TranslationConfig;
83
+ body: TranslationConfig;
84
+ };
40
85
  }, {
41
- id: string;
42
86
  label: {
43
87
  id: string;
44
88
  description: string;
45
89
  defaultMessage: string;
46
90
  };
91
+ confirmation: {
92
+ title: {
93
+ id: string;
94
+ description: string;
95
+ defaultMessage: string;
96
+ };
97
+ body: {
98
+ id: string;
99
+ description: string;
100
+ defaultMessage: string;
101
+ };
102
+ };
47
103
  }>;
48
- active: z.ZodDefault<z.ZodBoolean>;
49
- pages: z.ZodArray<z.ZodObject<{
104
+ }, "strip", z.ZodTypeAny, {
105
+ verify: {
106
+ label: TranslationConfig;
107
+ };
108
+ cancel: {
109
+ label: TranslationConfig;
110
+ confirmation: {
111
+ title: TranslationConfig;
112
+ body: TranslationConfig;
113
+ };
114
+ };
115
+ }, {
116
+ verify: {
117
+ label: {
118
+ id: string;
119
+ description: string;
120
+ defaultMessage: string;
121
+ };
122
+ };
123
+ cancel: {
124
+ label: {
125
+ id: string;
126
+ description: string;
127
+ defaultMessage: string;
128
+ };
129
+ confirmation: {
130
+ title: {
131
+ id: string;
132
+ description: string;
133
+ defaultMessage: string;
134
+ };
135
+ body: {
136
+ id: string;
137
+ description: string;
138
+ defaultMessage: string;
139
+ };
140
+ };
141
+ };
142
+ }>;
143
+ export declare const VerificationPage: z.ZodObject<z.objectUtil.extendShape<{
144
+ id: z.ZodString;
145
+ title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
146
+ id: string;
147
+ description: string;
148
+ defaultMessage: string;
149
+ }>;
150
+ fields: z.ZodArray<z.ZodType<import("./FieldConfig").Inferred, any, import("./FieldConfig").Inferred>, "many">;
151
+ type: z.ZodDefault<z.ZodLiteral<PageType.FORM>>;
152
+ }, {
153
+ type: z.ZodLiteral<PageType.VERIFICATION>;
154
+ actions: z.ZodObject<{
155
+ verify: z.ZodObject<{
156
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
157
+ id: string;
158
+ description: string;
159
+ defaultMessage: string;
160
+ }>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ label: TranslationConfig;
163
+ }, {
164
+ label: {
165
+ id: string;
166
+ description: string;
167
+ defaultMessage: string;
168
+ };
169
+ }>;
170
+ cancel: z.ZodObject<{
171
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
172
+ id: string;
173
+ description: string;
174
+ defaultMessage: string;
175
+ }>;
176
+ confirmation: z.ZodObject<{
177
+ title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
178
+ id: string;
179
+ description: string;
180
+ defaultMessage: string;
181
+ }>;
182
+ body: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
183
+ id: string;
184
+ description: string;
185
+ defaultMessage: string;
186
+ }>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ title: TranslationConfig;
189
+ body: TranslationConfig;
190
+ }, {
191
+ title: {
192
+ id: string;
193
+ description: string;
194
+ defaultMessage: string;
195
+ };
196
+ body: {
197
+ id: string;
198
+ description: string;
199
+ defaultMessage: string;
200
+ };
201
+ }>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ label: TranslationConfig;
204
+ confirmation: {
205
+ title: TranslationConfig;
206
+ body: TranslationConfig;
207
+ };
208
+ }, {
209
+ label: {
210
+ id: string;
211
+ description: string;
212
+ defaultMessage: string;
213
+ };
214
+ confirmation: {
215
+ title: {
216
+ id: string;
217
+ description: string;
218
+ defaultMessage: string;
219
+ };
220
+ body: {
221
+ id: string;
222
+ description: string;
223
+ defaultMessage: string;
224
+ };
225
+ };
226
+ }>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ verify: {
229
+ label: TranslationConfig;
230
+ };
231
+ cancel: {
232
+ label: TranslationConfig;
233
+ confirmation: {
234
+ title: TranslationConfig;
235
+ body: TranslationConfig;
236
+ };
237
+ };
238
+ }, {
239
+ verify: {
240
+ label: {
241
+ id: string;
242
+ description: string;
243
+ defaultMessage: string;
244
+ };
245
+ };
246
+ cancel: {
247
+ label: {
248
+ id: string;
249
+ description: string;
250
+ defaultMessage: string;
251
+ };
252
+ confirmation: {
253
+ title: {
254
+ id: string;
255
+ description: string;
256
+ defaultMessage: string;
257
+ };
258
+ body: {
259
+ id: string;
260
+ description: string;
261
+ defaultMessage: string;
262
+ };
263
+ };
264
+ };
265
+ }>;
266
+ }>, "strip", z.ZodTypeAny, {
267
+ type: PageType.VERIFICATION;
268
+ id: string;
269
+ title: TranslationConfig;
270
+ actions: {
271
+ verify: {
272
+ label: TranslationConfig;
273
+ };
274
+ cancel: {
275
+ label: TranslationConfig;
276
+ confirmation: {
277
+ title: TranslationConfig;
278
+ body: TranslationConfig;
279
+ };
280
+ };
281
+ };
282
+ fields: import("./FieldConfig").Inferred[];
283
+ }, {
284
+ type: PageType.VERIFICATION;
285
+ id: string;
286
+ title: {
287
+ id: string;
288
+ description: string;
289
+ defaultMessage: string;
290
+ };
291
+ actions: {
292
+ verify: {
293
+ label: {
294
+ id: string;
295
+ description: string;
296
+ defaultMessage: string;
297
+ };
298
+ };
299
+ cancel: {
300
+ label: {
301
+ id: string;
302
+ description: string;
303
+ defaultMessage: string;
304
+ };
305
+ confirmation: {
306
+ title: {
307
+ id: string;
308
+ description: string;
309
+ defaultMessage: string;
310
+ };
311
+ body: {
312
+ id: string;
313
+ description: string;
314
+ defaultMessage: string;
315
+ };
316
+ };
317
+ };
318
+ };
319
+ fields: import("./FieldConfig").Inferred[];
320
+ }>;
321
+ export type VerificationPageConfig = z.infer<typeof VerificationPageConfig>;
322
+ export type AllPageConfigs = typeof FormPage | typeof VerificationPage;
323
+ export declare const PageConfig: z.ZodDiscriminatedUnion<"type", AllPageConfigs[]>;
324
+ export type PageInput = z.input<typeof PageConfig>;
325
+ export type Page = z.infer<typeof PageConfig>;
326
+ export declare const FormConfig: z.ZodObject<{
327
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
328
+ id: string;
329
+ description: string;
330
+ defaultMessage: string;
331
+ }>;
332
+ version: z.ZodObject<{
50
333
  id: z.ZodString;
51
- title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
334
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
52
335
  id: string;
53
336
  description: string;
54
337
  defaultMessage: string;
55
338
  }>;
56
- fields: z.ZodArray<z.ZodType<import("./FieldConfig").Inferred, any, import("./FieldConfig").Inferred>, "many">;
57
339
  }, "strip", z.ZodTypeAny, {
58
340
  id: string;
59
- title: TranslationConfig;
60
- fields: import("./FieldConfig").Inferred[];
341
+ label: TranslationConfig;
61
342
  }, {
62
343
  id: string;
63
- title: {
344
+ label: {
64
345
  id: string;
65
346
  description: string;
66
347
  defaultMessage: string;
67
348
  };
68
- fields: import("./FieldConfig").Inferred[];
69
- }>, "many">;
349
+ }>;
350
+ active: z.ZodDefault<z.ZodBoolean>;
351
+ pages: z.ZodArray<z.ZodDiscriminatedUnion<"type", AllPageConfigs[]>, "many">;
70
352
  review: z.ZodObject<{
71
353
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
72
354
  id: string;
@@ -92,11 +374,29 @@ export declare const FormConfig: z.ZodObject<{
92
374
  label: TranslationConfig;
93
375
  };
94
376
  label: TranslationConfig;
95
- pages: {
377
+ pages: ({
378
+ type: PageType.FORM;
96
379
  id: string;
97
380
  title: TranslationConfig;
98
381
  fields: import("./FieldConfig").Inferred[];
99
- }[];
382
+ } | {
383
+ type: PageType.VERIFICATION;
384
+ id: string;
385
+ title: TranslationConfig;
386
+ actions: {
387
+ verify: {
388
+ label: TranslationConfig;
389
+ };
390
+ cancel: {
391
+ label: TranslationConfig;
392
+ confirmation: {
393
+ title: TranslationConfig;
394
+ body: TranslationConfig;
395
+ };
396
+ };
397
+ };
398
+ fields: import("./FieldConfig").Inferred[];
399
+ })[];
100
400
  review: {
101
401
  title: TranslationConfig;
102
402
  fields: import("./FieldConfig").Inferred[];
@@ -115,15 +415,53 @@ export declare const FormConfig: z.ZodObject<{
115
415
  description: string;
116
416
  defaultMessage: string;
117
417
  };
118
- pages: {
418
+ pages: ({
419
+ id: string;
420
+ title: {
421
+ id: string;
422
+ description: string;
423
+ defaultMessage: string;
424
+ };
425
+ fields: import("./FieldConfig").Inferred[];
426
+ type?: PageType.FORM | undefined;
427
+ } | {
428
+ type: PageType.VERIFICATION;
119
429
  id: string;
120
430
  title: {
121
431
  id: string;
122
432
  description: string;
123
433
  defaultMessage: string;
124
434
  };
435
+ actions: {
436
+ verify: {
437
+ label: {
438
+ id: string;
439
+ description: string;
440
+ defaultMessage: string;
441
+ };
442
+ };
443
+ cancel: {
444
+ label: {
445
+ id: string;
446
+ description: string;
447
+ defaultMessage: string;
448
+ };
449
+ confirmation: {
450
+ title: {
451
+ id: string;
452
+ description: string;
453
+ defaultMessage: string;
454
+ };
455
+ body: {
456
+ id: string;
457
+ description: string;
458
+ defaultMessage: string;
459
+ };
460
+ };
461
+ };
462
+ };
125
463
  fields: import("./FieldConfig").Inferred[];
126
- }[];
464
+ })[];
127
465
  review: {
128
466
  title: {
129
467
  id: string;
@@ -134,7 +472,6 @@ export declare const FormConfig: z.ZodObject<{
134
472
  };
135
473
  active?: boolean | undefined;
136
474
  }>;
137
- export type FormPage = z.infer<typeof FormPage>;
138
475
  export type FormConfig = z.infer<typeof FormConfig>;
139
476
  export type FormConfigInput = z.input<typeof FormConfig>;
140
477
  //# sourceMappingURL=FormConfig.d.ts.map