@opencrvs/toolkit 1.8.0-rc.fca3e39 → 1.8.0-rc.fd071dc
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 +1 -1
- package/dist/commons/api/router.d.ts +6911 -14585
- package/dist/commons/conditionals/conditionals.d.ts +25 -3
- package/dist/commons/conditionals/validate.d.ts +12 -11
- package/dist/commons/events/ActionConfig.d.ts +1123 -2056
- package/dist/commons/events/ActionDocument.d.ts +7441 -347
- package/dist/commons/events/ActionInput.d.ts +2169 -522
- package/dist/commons/events/ActionType.d.ts +24 -16
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Draft.d.ts +64 -52
- package/dist/commons/events/EventConfig.d.ts +551 -1206
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +845 -454
- package/dist/commons/events/EventIndex.d.ts +6 -3
- package/dist/commons/events/EventMetadata.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +465 -73
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +23 -2
- package/dist/commons/events/FieldValue.d.ts +6 -4
- package/dist/commons/events/FormConfig.d.ts +633 -48
- package/dist/commons/events/PageConfig.d.ts +335 -0
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- package/dist/commons/events/User.d.ts +1 -0
- package/dist/commons/events/defineConfig.d.ts +91 -216
- package/dist/commons/events/index.d.ts +2 -1
- package/dist/commons/events/test.utils.d.ts +69 -286
- package/dist/commons/events/utils.d.ts +81 -83
- package/dist/conditionals/index.js +161 -93
- package/dist/events/index.js +1169 -756
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ActionDocument } from './ActionDocument';
|
2
|
-
import { ArchiveActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, ValidateActionInput } from './ActionInput';
|
1
|
+
import { ActionDocument, ActionUpdate } from './ActionDocument';
|
2
|
+
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
3
3
|
import { ActionType } from './ActionType';
|
4
4
|
import { Draft } from './Draft';
|
5
5
|
import { EventConfig } from './EventConfig';
|
@@ -7,6 +7,7 @@ import { EventDocument } from './EventDocument';
|
|
7
7
|
import { EventIndex } from './EventIndex';
|
8
8
|
import { EventInput } from './EventInput';
|
9
9
|
import { FieldValue } from './FieldValue';
|
10
|
+
import { TranslationConfig } from './TranslationConfig';
|
10
11
|
export declare function generateActionInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | {
|
11
12
|
type: string;
|
12
13
|
filename: string;
|
@@ -44,7 +45,8 @@ export declare function generateActionInput(configuration: EventConfig, action:
|
|
44
45
|
option: string;
|
45
46
|
filename: string;
|
46
47
|
originalFilename: string;
|
47
|
-
}[]>;
|
48
|
+
}[] | undefined>;
|
49
|
+
export declare function generateActionMetadataInput(configuration: EventConfig, action: ActionType): {};
|
48
50
|
export declare const eventPayloadGenerator: {
|
49
51
|
create: (input?: Partial<EventInput>) => {
|
50
52
|
transactionId: string;
|
@@ -55,76 +57,15 @@ export declare const eventPayloadGenerator: {
|
|
55
57
|
type: string;
|
56
58
|
id: string;
|
57
59
|
};
|
58
|
-
draft: (eventId
|
59
|
-
id: import("../uuid").UUID;
|
60
|
+
draft: ({ eventId, actionType }: {
|
60
61
|
eventId: string;
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
'applicant.dob': string;
|
69
|
-
'recommender.none': boolean;
|
70
|
-
};
|
71
|
-
metadata: {
|
72
|
-
'correction.requester.relationship': string;
|
73
|
-
'correction.request.reason': string;
|
74
|
-
};
|
75
|
-
createdAt: string;
|
76
|
-
createdBy: string;
|
77
|
-
createdAtLocation: string;
|
78
|
-
};
|
79
|
-
} & Partial<{
|
80
|
-
id: string;
|
81
|
-
createdAt: string;
|
82
|
-
eventId: string;
|
83
|
-
transactionId: string;
|
84
|
-
action: {
|
85
|
-
type: ActionType;
|
86
|
-
data: Record<string, string | number | boolean | {
|
87
|
-
type: string;
|
88
|
-
filename: string;
|
89
|
-
originalFilename: string;
|
90
|
-
} | {
|
91
|
-
country: string;
|
92
|
-
district: string;
|
93
|
-
addressType: "DOMESTIC";
|
94
|
-
province: string;
|
95
|
-
urbanOrRural: "URBAN";
|
96
|
-
number?: string | null | undefined;
|
97
|
-
town?: string | null | undefined;
|
98
|
-
residentialArea?: string | null | undefined;
|
99
|
-
street?: string | null | undefined;
|
100
|
-
zipCode?: string | null | undefined;
|
101
|
-
} | {
|
102
|
-
country: string;
|
103
|
-
district: string;
|
104
|
-
addressType: "DOMESTIC";
|
105
|
-
province: string;
|
106
|
-
urbanOrRural: "RURAL";
|
107
|
-
village?: string | null | undefined;
|
108
|
-
} | {
|
109
|
-
country: string;
|
110
|
-
state: string;
|
111
|
-
addressType: "INTERNATIONAL";
|
112
|
-
district2: string;
|
113
|
-
cityOrTown?: string | null | undefined;
|
114
|
-
addressLine1?: string | null | undefined;
|
115
|
-
addressLine2?: string | null | undefined;
|
116
|
-
addressLine3?: string | null | undefined;
|
117
|
-
postcodeOrZip?: string | null | undefined;
|
118
|
-
} | {
|
119
|
-
type: string;
|
120
|
-
option: string;
|
121
|
-
filename: string;
|
122
|
-
originalFilename: string;
|
123
|
-
}[]>;
|
124
|
-
createdAt: string;
|
125
|
-
createdBy: string;
|
126
|
-
createdAtLocation: string;
|
127
|
-
metadata?: Record<string, string | number | boolean | {
|
62
|
+
actionType: ActionType;
|
63
|
+
}, input?: Partial<Draft>) => Draft;
|
64
|
+
actions: {
|
65
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
66
|
+
type: "DECLARE";
|
67
|
+
transactionId: string;
|
68
|
+
declaration: Record<string, string | number | boolean | {
|
128
69
|
type: string;
|
129
70
|
filename: string;
|
130
71
|
originalFilename: string;
|
@@ -161,14 +102,20 @@ export declare const eventPayloadGenerator: {
|
|
161
102
|
option: string;
|
162
103
|
filename: string;
|
163
104
|
originalFilename: string;
|
164
|
-
}[]
|
105
|
+
}[] | undefined>;
|
106
|
+
annotation: {};
|
107
|
+
eventId: string;
|
165
108
|
};
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
109
|
+
/**
|
110
|
+
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
111
|
+
*/
|
112
|
+
notify: (eventId: string, input?: {
|
113
|
+
transactionId?: string;
|
114
|
+
declaration?: Partial<ActionUpdate>;
|
115
|
+
}) => {
|
116
|
+
type: "NOTIFY";
|
170
117
|
transactionId: string;
|
171
|
-
|
118
|
+
declaration: Partial<Record<string, string | number | boolean | {
|
172
119
|
type: string;
|
173
120
|
filename: string;
|
174
121
|
originalFilename: string;
|
@@ -205,13 +152,13 @@ export declare const eventPayloadGenerator: {
|
|
205
152
|
option: string;
|
206
153
|
filename: string;
|
207
154
|
originalFilename: string;
|
208
|
-
}[]
|
155
|
+
}[] | undefined>>;
|
209
156
|
eventId: string;
|
210
157
|
};
|
211
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "
|
158
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
212
159
|
type: "VALIDATE";
|
213
160
|
transactionId: string;
|
214
|
-
|
161
|
+
declaration: Record<string, string | number | boolean | {
|
215
162
|
type: string;
|
216
163
|
filename: string;
|
217
164
|
originalFilename: string;
|
@@ -248,105 +195,47 @@ export declare const eventPayloadGenerator: {
|
|
248
195
|
option: string;
|
249
196
|
filename: string;
|
250
197
|
originalFilename: string;
|
251
|
-
}[]>;
|
198
|
+
}[] | undefined>;
|
199
|
+
annotation: {};
|
252
200
|
duplicates: never[];
|
253
201
|
eventId: string;
|
254
202
|
};
|
255
|
-
|
203
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
|
204
|
+
type: "ASSIGN";
|
205
|
+
transactionId: string;
|
206
|
+
declaration: {};
|
207
|
+
assignedTo: string;
|
208
|
+
eventId: string;
|
209
|
+
};
|
210
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
|
211
|
+
type: "UNASSIGN";
|
212
|
+
transactionId: string;
|
213
|
+
declaration: {};
|
214
|
+
assignedTo: null;
|
215
|
+
eventId: string;
|
216
|
+
};
|
217
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
256
218
|
type: "ARCHIVE";
|
257
219
|
transactionId: string;
|
258
|
-
|
259
|
-
|
260
|
-
filename: string;
|
261
|
-
originalFilename: string;
|
262
|
-
} | {
|
263
|
-
country: string;
|
264
|
-
district: string;
|
265
|
-
addressType: "DOMESTIC";
|
266
|
-
province: string;
|
267
|
-
urbanOrRural: "URBAN";
|
268
|
-
number?: string | null | undefined;
|
269
|
-
town?: string | null | undefined;
|
270
|
-
residentialArea?: string | null | undefined;
|
271
|
-
street?: string | null | undefined;
|
272
|
-
zipCode?: string | null | undefined;
|
273
|
-
} | {
|
274
|
-
country: string;
|
275
|
-
district: string;
|
276
|
-
addressType: "DOMESTIC";
|
277
|
-
province: string;
|
278
|
-
urbanOrRural: "RURAL";
|
279
|
-
village?: string | null | undefined;
|
280
|
-
} | {
|
281
|
-
country: string;
|
282
|
-
state: string;
|
283
|
-
addressType: "INTERNATIONAL";
|
284
|
-
district2: string;
|
285
|
-
cityOrTown?: string | null | undefined;
|
286
|
-
addressLine1?: string | null | undefined;
|
287
|
-
addressLine2?: string | null | undefined;
|
288
|
-
addressLine3?: string | null | undefined;
|
289
|
-
postcodeOrZip?: string | null | undefined;
|
290
|
-
} | {
|
291
|
-
type: string;
|
292
|
-
option: string;
|
293
|
-
filename: string;
|
294
|
-
originalFilename: string;
|
295
|
-
}[]>;
|
296
|
-
metadata: {
|
220
|
+
declaration: {};
|
221
|
+
annotation: {
|
297
222
|
isDuplicate: boolean;
|
298
223
|
};
|
299
224
|
duplicates: never[];
|
300
225
|
eventId: string;
|
301
226
|
};
|
302
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "
|
227
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
303
228
|
type: "REJECT";
|
304
229
|
transactionId: string;
|
305
|
-
|
306
|
-
|
307
|
-
filename: string;
|
308
|
-
originalFilename: string;
|
309
|
-
} | {
|
310
|
-
country: string;
|
311
|
-
district: string;
|
312
|
-
addressType: "DOMESTIC";
|
313
|
-
province: string;
|
314
|
-
urbanOrRural: "URBAN";
|
315
|
-
number?: string | null | undefined;
|
316
|
-
town?: string | null | undefined;
|
317
|
-
residentialArea?: string | null | undefined;
|
318
|
-
street?: string | null | undefined;
|
319
|
-
zipCode?: string | null | undefined;
|
320
|
-
} | {
|
321
|
-
country: string;
|
322
|
-
district: string;
|
323
|
-
addressType: "DOMESTIC";
|
324
|
-
province: string;
|
325
|
-
urbanOrRural: "RURAL";
|
326
|
-
village?: string | null | undefined;
|
327
|
-
} | {
|
328
|
-
country: string;
|
329
|
-
state: string;
|
330
|
-
addressType: "INTERNATIONAL";
|
331
|
-
district2: string;
|
332
|
-
cityOrTown?: string | null | undefined;
|
333
|
-
addressLine1?: string | null | undefined;
|
334
|
-
addressLine2?: string | null | undefined;
|
335
|
-
addressLine3?: string | null | undefined;
|
336
|
-
postcodeOrZip?: string | null | undefined;
|
337
|
-
} | {
|
338
|
-
type: string;
|
339
|
-
option: string;
|
340
|
-
filename: string;
|
341
|
-
originalFilename: string;
|
342
|
-
}[]>;
|
230
|
+
declaration: {};
|
231
|
+
annotation: {};
|
343
232
|
duplicates: never[];
|
344
233
|
eventId: string;
|
345
234
|
};
|
346
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
235
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
347
236
|
type: "REGISTER";
|
348
237
|
transactionId: string;
|
349
|
-
|
238
|
+
declaration: Record<string, string | number | boolean | {
|
350
239
|
type: string;
|
351
240
|
filename: string;
|
352
241
|
originalFilename: string;
|
@@ -383,57 +272,22 @@ export declare const eventPayloadGenerator: {
|
|
383
272
|
option: string;
|
384
273
|
filename: string;
|
385
274
|
originalFilename: string;
|
386
|
-
}[]>;
|
275
|
+
}[] | undefined>;
|
276
|
+
annotation: {};
|
387
277
|
eventId: string;
|
388
278
|
};
|
389
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
279
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
390
280
|
type: "PRINT_CERTIFICATE";
|
391
281
|
transactionId: string;
|
392
|
-
|
393
|
-
|
394
|
-
filename: string;
|
395
|
-
originalFilename: string;
|
396
|
-
} | {
|
397
|
-
country: string;
|
398
|
-
district: string;
|
399
|
-
addressType: "DOMESTIC";
|
400
|
-
province: string;
|
401
|
-
urbanOrRural: "URBAN";
|
402
|
-
number?: string | null | undefined;
|
403
|
-
town?: string | null | undefined;
|
404
|
-
residentialArea?: string | null | undefined;
|
405
|
-
street?: string | null | undefined;
|
406
|
-
zipCode?: string | null | undefined;
|
407
|
-
} | {
|
408
|
-
country: string;
|
409
|
-
district: string;
|
410
|
-
addressType: "DOMESTIC";
|
411
|
-
province: string;
|
412
|
-
urbanOrRural: "RURAL";
|
413
|
-
village?: string | null | undefined;
|
414
|
-
} | {
|
415
|
-
country: string;
|
416
|
-
state: string;
|
417
|
-
addressType: "INTERNATIONAL";
|
418
|
-
district2: string;
|
419
|
-
cityOrTown?: string | null | undefined;
|
420
|
-
addressLine1?: string | null | undefined;
|
421
|
-
addressLine2?: string | null | undefined;
|
422
|
-
addressLine3?: string | null | undefined;
|
423
|
-
postcodeOrZip?: string | null | undefined;
|
424
|
-
} | {
|
425
|
-
type: string;
|
426
|
-
option: string;
|
427
|
-
filename: string;
|
428
|
-
originalFilename: string;
|
429
|
-
}[]>;
|
282
|
+
declaration: {};
|
283
|
+
annotation: {};
|
430
284
|
eventId: string;
|
431
285
|
};
|
432
286
|
correction: {
|
433
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
287
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
434
288
|
type: "REQUEST_CORRECTION";
|
435
289
|
transactionId: string;
|
436
|
-
|
290
|
+
declaration: Record<string, string | number | boolean | {
|
437
291
|
type: string;
|
438
292
|
filename: string;
|
439
293
|
originalFilename: string;
|
@@ -470,95 +324,23 @@ export declare const eventPayloadGenerator: {
|
|
470
324
|
option: string;
|
471
325
|
filename: string;
|
472
326
|
originalFilename: string;
|
473
|
-
}[]>;
|
474
|
-
|
327
|
+
}[] | undefined>;
|
328
|
+
annotation: {};
|
475
329
|
eventId: string;
|
476
330
|
};
|
477
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
331
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
478
332
|
type: "APPROVE_CORRECTION";
|
479
333
|
transactionId: string;
|
480
|
-
|
481
|
-
|
482
|
-
filename: string;
|
483
|
-
originalFilename: string;
|
484
|
-
} | {
|
485
|
-
country: string;
|
486
|
-
district: string;
|
487
|
-
addressType: "DOMESTIC";
|
488
|
-
province: string;
|
489
|
-
urbanOrRural: "URBAN";
|
490
|
-
number?: string | null | undefined;
|
491
|
-
town?: string | null | undefined;
|
492
|
-
residentialArea?: string | null | undefined;
|
493
|
-
street?: string | null | undefined;
|
494
|
-
zipCode?: string | null | undefined;
|
495
|
-
} | {
|
496
|
-
country: string;
|
497
|
-
district: string;
|
498
|
-
addressType: "DOMESTIC";
|
499
|
-
province: string;
|
500
|
-
urbanOrRural: "RURAL";
|
501
|
-
village?: string | null | undefined;
|
502
|
-
} | {
|
503
|
-
country: string;
|
504
|
-
state: string;
|
505
|
-
addressType: "INTERNATIONAL";
|
506
|
-
district2: string;
|
507
|
-
cityOrTown?: string | null | undefined;
|
508
|
-
addressLine1?: string | null | undefined;
|
509
|
-
addressLine2?: string | null | undefined;
|
510
|
-
addressLine3?: string | null | undefined;
|
511
|
-
postcodeOrZip?: string | null | undefined;
|
512
|
-
} | {
|
513
|
-
type: string;
|
514
|
-
option: string;
|
515
|
-
filename: string;
|
516
|
-
originalFilename: string;
|
517
|
-
}[]>;
|
334
|
+
declaration: {};
|
335
|
+
annotation: {};
|
518
336
|
eventId: string;
|
519
337
|
requestId: string;
|
520
338
|
};
|
521
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
339
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
522
340
|
type: "REJECT_CORRECTION";
|
523
341
|
transactionId: string;
|
524
|
-
|
525
|
-
|
526
|
-
filename: string;
|
527
|
-
originalFilename: string;
|
528
|
-
} | {
|
529
|
-
country: string;
|
530
|
-
district: string;
|
531
|
-
addressType: "DOMESTIC";
|
532
|
-
province: string;
|
533
|
-
urbanOrRural: "URBAN";
|
534
|
-
number?: string | null | undefined;
|
535
|
-
town?: string | null | undefined;
|
536
|
-
residentialArea?: string | null | undefined;
|
537
|
-
street?: string | null | undefined;
|
538
|
-
zipCode?: string | null | undefined;
|
539
|
-
} | {
|
540
|
-
country: string;
|
541
|
-
district: string;
|
542
|
-
addressType: "DOMESTIC";
|
543
|
-
province: string;
|
544
|
-
urbanOrRural: "RURAL";
|
545
|
-
village?: string | null | undefined;
|
546
|
-
} | {
|
547
|
-
country: string;
|
548
|
-
state: string;
|
549
|
-
addressType: "INTERNATIONAL";
|
550
|
-
district2: string;
|
551
|
-
cityOrTown?: string | null | undefined;
|
552
|
-
addressLine1?: string | null | undefined;
|
553
|
-
addressLine2?: string | null | undefined;
|
554
|
-
addressLine3?: string | null | undefined;
|
555
|
-
postcodeOrZip?: string | null | undefined;
|
556
|
-
} | {
|
557
|
-
type: string;
|
558
|
-
option: string;
|
559
|
-
filename: string;
|
560
|
-
originalFilename: string;
|
561
|
-
}[]>;
|
342
|
+
declaration: {};
|
343
|
+
annotation: {};
|
562
344
|
eventId: string;
|
563
345
|
requestId: string;
|
564
346
|
};
|
@@ -574,6 +356,7 @@ export declare function generateEventDocument({ configuration, actions }: {
|
|
574
356
|
configuration: EventConfig;
|
575
357
|
actions: ActionType[];
|
576
358
|
}): EventDocument;
|
577
|
-
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType,
|
359
|
+
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: Record<string, FieldValue>): Draft;
|
578
360
|
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex;
|
361
|
+
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
579
362
|
//# sourceMappingURL=test.utils.d.ts.map
|