@opencrvs/toolkit 1.8.0-rc.fca3e39 → 1.8.0-rc.fd31705

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,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: string, input?: Partial<Draft>) => {
59
- id: import("../uuid").UUID;
60
+ draft: ({ eventId, actionType }: {
60
61
  eventId: string;
61
- createdAt: string;
62
- transactionId: import("../uuid").UUID;
63
- action: {
64
- type: "REQUEST_CORRECTION";
65
- data: {
66
- 'applicant.firstname': string;
67
- 'applicant.surname': string;
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
- }[]> | undefined;
105
+ }[] | undefined>;
106
+ annotation: {};
107
+ eventId: string;
165
108
  };
166
- }>;
167
- actions: {
168
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "data">>) => {
169
- type: "DECLARE";
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
- data: Record<string, string | number | boolean | {
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" | "data">>) => {
158
+ validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
212
159
  type: "VALIDATE";
213
160
  transactionId: string;
214
- data: Record<string, string | number | boolean | {
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
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "data">>, isDuplicate?: boolean) => {
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
- data: Record<string, string | number | boolean | {
259
- type: string;
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" | "data">>) => {
227
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
303
228
  type: "REJECT";
304
229
  transactionId: string;
305
- data: Record<string, string | number | boolean | {
306
- type: string;
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" | "data">>) => {
235
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
347
236
  type: "REGISTER";
348
237
  transactionId: string;
349
- data: Record<string, string | number | boolean | {
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" | "data">>) => {
279
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
390
280
  type: "PRINT_CERTIFICATE";
391
281
  transactionId: string;
392
- data: Record<string, string | number | boolean | {
393
- type: string;
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" | "data">>) => {
287
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
434
288
  type: "REQUEST_CORRECTION";
435
289
  transactionId: string;
436
- data: Record<string, string | number | boolean | {
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
- metadata: {};
327
+ }[] | undefined>;
328
+ annotation: {};
475
329
  eventId: string;
476
330
  };
477
- approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
331
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
478
332
  type: "APPROVE_CORRECTION";
479
333
  transactionId: string;
480
- data: Record<string, string | number | boolean | {
481
- type: string;
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" | "data">>) => {
339
+ reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
522
340
  type: "REJECT_CORRECTION";
523
341
  transactionId: string;
524
- data: Record<string, string | number | boolean | {
525
- type: string;
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, data?: Record<string, FieldValue>): Draft;
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