@opencrvs/toolkit 1.8.0-rc.ff62f9e → 1.8.0-rc.ffb4f66
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 +6496 -15505
- package/dist/commons/conditionals/conditionals.d.ts +25 -3
- package/dist/commons/conditionals/validate.d.ts +14 -17
- package/dist/commons/events/ActionConfig.d.ts +1202 -6605
- package/dist/commons/events/ActionDocument.d.ts +6956 -255
- package/dist/commons/events/ActionInput.d.ts +1316 -367
- package/dist/commons/events/ActionType.d.ts +25 -16
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Draft.d.ts +52 -37
- package/dist/commons/events/EventConfig.d.ts +648 -2983
- package/dist/commons/events/EventConfigInput.d.ts +5 -2
- package/dist/commons/events/EventDocument.d.ts +495 -662
- 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 +245 -45
- package/dist/commons/events/FormConfig.d.ts +559 -322
- package/dist/commons/events/PageConfig.d.ts +335 -0
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- package/dist/commons/events/defineConfig.d.ts +28 -433
- package/dist/commons/events/index.d.ts +2 -1
- package/dist/commons/events/test.utils.d.ts +63 -284
- package/dist/commons/events/utils.d.ts +83 -178
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/conditionals/index.js +161 -93
- package/dist/events/index.js +1103 -819
- 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';
|
@@ -8,7 +8,7 @@ import { EventIndex } from './EventIndex';
|
|
8
8
|
import { EventInput } from './EventInput';
|
9
9
|
import { FieldValue } from './FieldValue';
|
10
10
|
import { TranslationConfig } from './TranslationConfig';
|
11
|
-
export declare function
|
11
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | {
|
12
12
|
type: string;
|
13
13
|
filename: string;
|
14
14
|
originalFilename: string;
|
@@ -46,7 +46,7 @@ export declare function generateActionInput(configuration: EventConfig, action:
|
|
46
46
|
filename: string;
|
47
47
|
originalFilename: string;
|
48
48
|
}[] | undefined>;
|
49
|
-
export declare function
|
49
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
|
50
50
|
export declare const eventPayloadGenerator: {
|
51
51
|
create: (input?: Partial<EventInput>) => {
|
52
52
|
transactionId: string;
|
@@ -57,35 +57,15 @@ export declare const eventPayloadGenerator: {
|
|
57
57
|
type: string;
|
58
58
|
id: string;
|
59
59
|
};
|
60
|
-
draft: (eventId
|
61
|
-
id: import("../uuid").UUID;
|
60
|
+
draft: ({ eventId, actionType }: {
|
62
61
|
eventId: string;
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
'applicant.dob': string;
|
71
|
-
'recommender.none': boolean;
|
72
|
-
};
|
73
|
-
metadata: {
|
74
|
-
'correction.requester.relationship': string;
|
75
|
-
'correction.request.reason': string;
|
76
|
-
};
|
77
|
-
createdAt: string;
|
78
|
-
createdBy: string;
|
79
|
-
createdAtLocation: string;
|
80
|
-
};
|
81
|
-
} & Partial<{
|
82
|
-
id: string;
|
83
|
-
createdAt: string;
|
84
|
-
eventId: string;
|
85
|
-
transactionId: string;
|
86
|
-
action: {
|
87
|
-
type: ActionType;
|
88
|
-
data: 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 | {
|
89
69
|
type: string;
|
90
70
|
filename: string;
|
91
71
|
originalFilename: string;
|
@@ -123,54 +103,19 @@ export declare const eventPayloadGenerator: {
|
|
123
103
|
filename: string;
|
124
104
|
originalFilename: string;
|
125
105
|
}[] | undefined>;
|
126
|
-
|
127
|
-
|
128
|
-
createdAtLocation: string;
|
129
|
-
metadata?: Record<string, string | number | boolean | {
|
130
|
-
type: string;
|
131
|
-
filename: string;
|
132
|
-
originalFilename: string;
|
133
|
-
} | {
|
134
|
-
country: string;
|
135
|
-
district: string;
|
136
|
-
addressType: "DOMESTIC";
|
137
|
-
province: string;
|
138
|
-
urbanOrRural: "URBAN";
|
139
|
-
number?: string | null | undefined;
|
140
|
-
town?: string | null | undefined;
|
141
|
-
residentialArea?: string | null | undefined;
|
142
|
-
street?: string | null | undefined;
|
143
|
-
zipCode?: string | null | undefined;
|
144
|
-
} | {
|
145
|
-
country: string;
|
146
|
-
district: string;
|
147
|
-
addressType: "DOMESTIC";
|
148
|
-
province: string;
|
149
|
-
urbanOrRural: "RURAL";
|
150
|
-
village?: string | null | undefined;
|
151
|
-
} | {
|
152
|
-
country: string;
|
153
|
-
state: string;
|
154
|
-
addressType: "INTERNATIONAL";
|
155
|
-
district2: string;
|
156
|
-
cityOrTown?: string | null | undefined;
|
157
|
-
addressLine1?: string | null | undefined;
|
158
|
-
addressLine2?: string | null | undefined;
|
159
|
-
addressLine3?: string | null | undefined;
|
160
|
-
postcodeOrZip?: string | null | undefined;
|
161
|
-
} | {
|
162
|
-
type: string;
|
163
|
-
option: string;
|
164
|
-
filename: string;
|
165
|
-
originalFilename: string;
|
166
|
-
}[] | undefined> | undefined;
|
106
|
+
annotation: {};
|
107
|
+
eventId: string;
|
167
108
|
};
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
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";
|
172
117
|
transactionId: string;
|
173
|
-
|
118
|
+
declaration: Partial<Record<string, string | number | boolean | {
|
174
119
|
type: string;
|
175
120
|
filename: string;
|
176
121
|
originalFilename: string;
|
@@ -207,13 +152,13 @@ export declare const eventPayloadGenerator: {
|
|
207
152
|
option: string;
|
208
153
|
filename: string;
|
209
154
|
originalFilename: string;
|
210
|
-
}[] | undefined
|
155
|
+
}[] | undefined>>;
|
211
156
|
eventId: string;
|
212
157
|
};
|
213
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "
|
158
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
214
159
|
type: "VALIDATE";
|
215
160
|
transactionId: string;
|
216
|
-
|
161
|
+
declaration: Record<string, string | number | boolean | {
|
217
162
|
type: string;
|
218
163
|
filename: string;
|
219
164
|
originalFilename: string;
|
@@ -251,104 +196,46 @@ export declare const eventPayloadGenerator: {
|
|
251
196
|
filename: string;
|
252
197
|
originalFilename: string;
|
253
198
|
}[] | undefined>;
|
199
|
+
annotation: {};
|
254
200
|
duplicates: never[];
|
255
201
|
eventId: string;
|
256
202
|
};
|
257
|
-
|
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) => {
|
258
218
|
type: "ARCHIVE";
|
259
219
|
transactionId: string;
|
260
|
-
|
261
|
-
|
262
|
-
filename: string;
|
263
|
-
originalFilename: string;
|
264
|
-
} | {
|
265
|
-
country: string;
|
266
|
-
district: string;
|
267
|
-
addressType: "DOMESTIC";
|
268
|
-
province: string;
|
269
|
-
urbanOrRural: "URBAN";
|
270
|
-
number?: string | null | undefined;
|
271
|
-
town?: string | null | undefined;
|
272
|
-
residentialArea?: string | null | undefined;
|
273
|
-
street?: string | null | undefined;
|
274
|
-
zipCode?: string | null | undefined;
|
275
|
-
} | {
|
276
|
-
country: string;
|
277
|
-
district: string;
|
278
|
-
addressType: "DOMESTIC";
|
279
|
-
province: string;
|
280
|
-
urbanOrRural: "RURAL";
|
281
|
-
village?: string | null | undefined;
|
282
|
-
} | {
|
283
|
-
country: string;
|
284
|
-
state: string;
|
285
|
-
addressType: "INTERNATIONAL";
|
286
|
-
district2: string;
|
287
|
-
cityOrTown?: string | null | undefined;
|
288
|
-
addressLine1?: string | null | undefined;
|
289
|
-
addressLine2?: string | null | undefined;
|
290
|
-
addressLine3?: string | null | undefined;
|
291
|
-
postcodeOrZip?: string | null | undefined;
|
292
|
-
} | {
|
293
|
-
type: string;
|
294
|
-
option: string;
|
295
|
-
filename: string;
|
296
|
-
originalFilename: string;
|
297
|
-
}[] | undefined>;
|
298
|
-
metadata: {
|
220
|
+
declaration: {};
|
221
|
+
annotation: {
|
299
222
|
isDuplicate: boolean;
|
300
223
|
};
|
301
224
|
duplicates: never[];
|
302
225
|
eventId: string;
|
303
226
|
};
|
304
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "
|
227
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
305
228
|
type: "REJECT";
|
306
229
|
transactionId: string;
|
307
|
-
|
308
|
-
|
309
|
-
filename: string;
|
310
|
-
originalFilename: string;
|
311
|
-
} | {
|
312
|
-
country: string;
|
313
|
-
district: string;
|
314
|
-
addressType: "DOMESTIC";
|
315
|
-
province: string;
|
316
|
-
urbanOrRural: "URBAN";
|
317
|
-
number?: string | null | undefined;
|
318
|
-
town?: string | null | undefined;
|
319
|
-
residentialArea?: string | null | undefined;
|
320
|
-
street?: string | null | undefined;
|
321
|
-
zipCode?: string | null | undefined;
|
322
|
-
} | {
|
323
|
-
country: string;
|
324
|
-
district: string;
|
325
|
-
addressType: "DOMESTIC";
|
326
|
-
province: string;
|
327
|
-
urbanOrRural: "RURAL";
|
328
|
-
village?: string | null | undefined;
|
329
|
-
} | {
|
330
|
-
country: string;
|
331
|
-
state: string;
|
332
|
-
addressType: "INTERNATIONAL";
|
333
|
-
district2: string;
|
334
|
-
cityOrTown?: string | null | undefined;
|
335
|
-
addressLine1?: string | null | undefined;
|
336
|
-
addressLine2?: string | null | undefined;
|
337
|
-
addressLine3?: string | null | undefined;
|
338
|
-
postcodeOrZip?: string | null | undefined;
|
339
|
-
} | {
|
340
|
-
type: string;
|
341
|
-
option: string;
|
342
|
-
filename: string;
|
343
|
-
originalFilename: string;
|
344
|
-
}[] | undefined>;
|
230
|
+
declaration: {};
|
231
|
+
annotation: {};
|
345
232
|
duplicates: never[];
|
346
233
|
eventId: string;
|
347
234
|
};
|
348
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
235
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
349
236
|
type: "REGISTER";
|
350
237
|
transactionId: string;
|
351
|
-
|
238
|
+
declaration: Record<string, string | number | boolean | {
|
352
239
|
type: string;
|
353
240
|
filename: string;
|
354
241
|
originalFilename: string;
|
@@ -386,57 +273,21 @@ export declare const eventPayloadGenerator: {
|
|
386
273
|
filename: string;
|
387
274
|
originalFilename: string;
|
388
275
|
}[] | undefined>;
|
276
|
+
annotation: {};
|
389
277
|
eventId: string;
|
390
278
|
};
|
391
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
279
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
392
280
|
type: "PRINT_CERTIFICATE";
|
393
281
|
transactionId: string;
|
394
|
-
|
395
|
-
|
396
|
-
filename: string;
|
397
|
-
originalFilename: string;
|
398
|
-
} | {
|
399
|
-
country: string;
|
400
|
-
district: string;
|
401
|
-
addressType: "DOMESTIC";
|
402
|
-
province: string;
|
403
|
-
urbanOrRural: "URBAN";
|
404
|
-
number?: string | null | undefined;
|
405
|
-
town?: string | null | undefined;
|
406
|
-
residentialArea?: string | null | undefined;
|
407
|
-
street?: string | null | undefined;
|
408
|
-
zipCode?: string | null | undefined;
|
409
|
-
} | {
|
410
|
-
country: string;
|
411
|
-
district: string;
|
412
|
-
addressType: "DOMESTIC";
|
413
|
-
province: string;
|
414
|
-
urbanOrRural: "RURAL";
|
415
|
-
village?: string | null | undefined;
|
416
|
-
} | {
|
417
|
-
country: string;
|
418
|
-
state: string;
|
419
|
-
addressType: "INTERNATIONAL";
|
420
|
-
district2: string;
|
421
|
-
cityOrTown?: string | null | undefined;
|
422
|
-
addressLine1?: string | null | undefined;
|
423
|
-
addressLine2?: string | null | undefined;
|
424
|
-
addressLine3?: string | null | undefined;
|
425
|
-
postcodeOrZip?: string | null | undefined;
|
426
|
-
} | {
|
427
|
-
type: string;
|
428
|
-
option: string;
|
429
|
-
filename: string;
|
430
|
-
originalFilename: string;
|
431
|
-
}[] | undefined>;
|
432
|
-
metadata: {};
|
282
|
+
declaration: {};
|
283
|
+
annotation: {};
|
433
284
|
eventId: string;
|
434
285
|
};
|
435
286
|
correction: {
|
436
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
287
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
437
288
|
type: "REQUEST_CORRECTION";
|
438
289
|
transactionId: string;
|
439
|
-
|
290
|
+
declaration: Record<string, string | number | boolean | {
|
440
291
|
type: string;
|
441
292
|
filename: string;
|
442
293
|
originalFilename: string;
|
@@ -474,94 +325,22 @@ export declare const eventPayloadGenerator: {
|
|
474
325
|
filename: string;
|
475
326
|
originalFilename: string;
|
476
327
|
}[] | undefined>;
|
477
|
-
|
328
|
+
annotation: {};
|
478
329
|
eventId: string;
|
479
330
|
};
|
480
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
331
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
481
332
|
type: "APPROVE_CORRECTION";
|
482
333
|
transactionId: string;
|
483
|
-
|
484
|
-
|
485
|
-
filename: string;
|
486
|
-
originalFilename: string;
|
487
|
-
} | {
|
488
|
-
country: string;
|
489
|
-
district: string;
|
490
|
-
addressType: "DOMESTIC";
|
491
|
-
province: string;
|
492
|
-
urbanOrRural: "URBAN";
|
493
|
-
number?: string | null | undefined;
|
494
|
-
town?: string | null | undefined;
|
495
|
-
residentialArea?: string | null | undefined;
|
496
|
-
street?: string | null | undefined;
|
497
|
-
zipCode?: string | null | undefined;
|
498
|
-
} | {
|
499
|
-
country: string;
|
500
|
-
district: string;
|
501
|
-
addressType: "DOMESTIC";
|
502
|
-
province: string;
|
503
|
-
urbanOrRural: "RURAL";
|
504
|
-
village?: string | null | undefined;
|
505
|
-
} | {
|
506
|
-
country: string;
|
507
|
-
state: string;
|
508
|
-
addressType: "INTERNATIONAL";
|
509
|
-
district2: string;
|
510
|
-
cityOrTown?: string | null | undefined;
|
511
|
-
addressLine1?: string | null | undefined;
|
512
|
-
addressLine2?: string | null | undefined;
|
513
|
-
addressLine3?: string | null | undefined;
|
514
|
-
postcodeOrZip?: string | null | undefined;
|
515
|
-
} | {
|
516
|
-
type: string;
|
517
|
-
option: string;
|
518
|
-
filename: string;
|
519
|
-
originalFilename: string;
|
520
|
-
}[] | undefined>;
|
334
|
+
declaration: {};
|
335
|
+
annotation: {};
|
521
336
|
eventId: string;
|
522
337
|
requestId: string;
|
523
338
|
};
|
524
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
339
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
525
340
|
type: "REJECT_CORRECTION";
|
526
341
|
transactionId: string;
|
527
|
-
|
528
|
-
|
529
|
-
filename: string;
|
530
|
-
originalFilename: string;
|
531
|
-
} | {
|
532
|
-
country: string;
|
533
|
-
district: string;
|
534
|
-
addressType: "DOMESTIC";
|
535
|
-
province: string;
|
536
|
-
urbanOrRural: "URBAN";
|
537
|
-
number?: string | null | undefined;
|
538
|
-
town?: string | null | undefined;
|
539
|
-
residentialArea?: string | null | undefined;
|
540
|
-
street?: string | null | undefined;
|
541
|
-
zipCode?: string | null | undefined;
|
542
|
-
} | {
|
543
|
-
country: string;
|
544
|
-
district: string;
|
545
|
-
addressType: "DOMESTIC";
|
546
|
-
province: string;
|
547
|
-
urbanOrRural: "RURAL";
|
548
|
-
village?: string | null | undefined;
|
549
|
-
} | {
|
550
|
-
country: string;
|
551
|
-
state: string;
|
552
|
-
addressType: "INTERNATIONAL";
|
553
|
-
district2: string;
|
554
|
-
cityOrTown?: string | null | undefined;
|
555
|
-
addressLine1?: string | null | undefined;
|
556
|
-
addressLine2?: string | null | undefined;
|
557
|
-
addressLine3?: string | null | undefined;
|
558
|
-
postcodeOrZip?: string | null | undefined;
|
559
|
-
} | {
|
560
|
-
type: string;
|
561
|
-
option: string;
|
562
|
-
filename: string;
|
563
|
-
originalFilename: string;
|
564
|
-
}[] | undefined>;
|
342
|
+
declaration: {};
|
343
|
+
annotation: {};
|
565
344
|
eventId: string;
|
566
345
|
requestId: string;
|
567
346
|
};
|
@@ -577,7 +356,7 @@ export declare function generateEventDocument({ configuration, actions }: {
|
|
577
356
|
configuration: EventConfig;
|
578
357
|
actions: ActionType[];
|
579
358
|
}): EventDocument;
|
580
|
-
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType,
|
359
|
+
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: Record<string, FieldValue>): Draft;
|
581
360
|
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex;
|
582
361
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
583
362
|
//# sourceMappingURL=test.utils.d.ts.map
|