@opencrvs/toolkit 1.8.0-rc.f7910f3 → 1.8.0-rc.f7aaf07
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 +20619 -14618
- package/dist/commons/conditionals/conditionals.d.ts +36 -6
- package/dist/commons/conditionals/validate.d.ts +18 -17
- package/dist/commons/events/ActionConfig.d.ts +116370 -6084
- package/dist/commons/events/ActionDocument.d.ts +9528 -401
- package/dist/commons/events/ActionInput.d.ts +3536 -519
- package/dist/commons/events/ActionType.d.ts +32 -16
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1233 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +31 -0
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +3068 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
- package/dist/commons/events/Draft.d.ts +193 -59
- package/dist/commons/events/EventConfig.d.ts +55962 -3150
- package/dist/commons/events/EventConfigInput.d.ts +5 -2
- package/dist/commons/events/EventDocument.d.ts +2192 -552
- package/dist/commons/events/EventIndex.d.ts +2026 -22
- package/dist/commons/events/EventMetadata.d.ts +332 -40
- package/dist/commons/events/FieldConfig.d.ts +5678 -1061
- package/dist/commons/events/FieldType.d.ts +6 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
- package/dist/commons/events/FieldValue.d.ts +49 -8
- package/dist/commons/events/FormConfig.d.ts +49225 -346
- package/dist/commons/events/PageConfig.d.ts +12337 -0
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- package/dist/commons/events/User.d.ts +31 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +6290 -20
- package/dist/commons/events/defineConfig.d.ts +9039 -501
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +82 -0
- package/dist/commons/events/index.d.ts +10 -1
- package/dist/commons/events/scopes.d.ts +44 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +161 -300
- package/dist/commons/events/utils.d.ts +13384 -186
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +228 -120
- package/dist/events/index.js +5066 -2198
- package/dist/scopes/index.d.ts +161 -1
- package/dist/scopes/index.js +202 -1
- package/package.json +3 -2
@@ -1,53 +1,33 @@
|
|
1
|
-
import { ActionDocument } from './ActionDocument';
|
2
|
-
import { ArchiveActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, ValidateActionInput } from './ActionInput';
|
1
|
+
import { ActionDocument, EventState } from './ActionDocument';
|
2
|
+
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, 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';
|
6
6
|
import { EventDocument } from './EventDocument';
|
7
7
|
import { EventIndex } from './EventIndex';
|
8
8
|
import { EventInput } from './EventInput';
|
9
|
-
import { FieldValue } from './FieldValue';
|
10
9
|
import { TranslationConfig } from './TranslationConfig';
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
village?: string | undefined;
|
33
|
-
} | {
|
34
|
-
country: string;
|
35
|
-
state: string;
|
36
|
-
addressType: "INTERNATIONAL";
|
37
|
-
district2: string;
|
38
|
-
cityOrTown?: string | undefined;
|
39
|
-
addressLine1?: string | undefined;
|
40
|
-
addressLine2?: string | undefined;
|
41
|
-
addressLine3?: string | undefined;
|
42
|
-
postcodeOrZip?: string | undefined;
|
43
|
-
} | {
|
44
|
-
type: string;
|
45
|
-
option: string;
|
46
|
-
filename: string;
|
47
|
-
originalFilename: string;
|
48
|
-
}[] | undefined>;
|
49
|
-
export declare function generateActionMetadataInput(configuration: EventConfig, action: ActionType): {};
|
50
|
-
export declare const eventPayloadGenerator: {
|
10
|
+
import { FieldConfig } from './FieldConfig';
|
11
|
+
import { WorkqueueConfig } from './WorkqueueConfig';
|
12
|
+
import { FieldValue } from './FieldValue';
|
13
|
+
import { z } from 'zod';
|
14
|
+
/**
|
15
|
+
* In real application, the roles are defined in the countryconfig.
|
16
|
+
* These are just for testing purposes to generate realistic mock data.
|
17
|
+
*/
|
18
|
+
export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT"]>;
|
19
|
+
export type TestUserRole = z.infer<typeof TestUserRole>;
|
20
|
+
export declare function generateRandomName(rng: () => number): {
|
21
|
+
firstname: string;
|
22
|
+
surname: string;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* Quick-and-dirty mock data generator for event actions.
|
26
|
+
*/
|
27
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
|
28
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
|
29
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
|
30
|
+
export declare function eventPayloadGenerator(rng: () => number): {
|
51
31
|
create: (input?: Partial<EventInput>) => {
|
52
32
|
transactionId: string;
|
53
33
|
type: string;
|
@@ -57,35 +37,14 @@ export declare const eventPayloadGenerator: {
|
|
57
37
|
type: string;
|
58
38
|
id: string;
|
59
39
|
};
|
60
|
-
draft: (eventId
|
61
|
-
id: import("../uuid").UUID;
|
62
|
-
eventId: string;
|
63
|
-
createdAt: string;
|
64
|
-
transactionId: import("../uuid").UUID;
|
65
|
-
action: {
|
66
|
-
type: "REQUEST_CORRECTION";
|
67
|
-
data: {
|
68
|
-
'applicant.firstname': string;
|
69
|
-
'applicant.surname': string;
|
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;
|
40
|
+
draft: ({ eventId, actionType }: {
|
84
41
|
eventId: string;
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
42
|
+
actionType: ActionType;
|
43
|
+
}, input?: Partial<Draft>) => Draft;
|
44
|
+
actions: {
|
45
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
46
|
+
transactionId: string;
|
47
|
+
declaration: Record<string, string | number | boolean | {
|
89
48
|
type: string;
|
90
49
|
filename: string;
|
91
50
|
originalFilename: string;
|
@@ -101,46 +60,9 @@ export declare const eventPayloadGenerator: {
|
|
101
60
|
street?: string | null | undefined;
|
102
61
|
zipCode?: string | null | undefined;
|
103
62
|
} | {
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
province: string;
|
108
|
-
urbanOrRural: "RURAL";
|
109
|
-
village?: string | null | undefined;
|
110
|
-
} | {
|
111
|
-
country: string;
|
112
|
-
state: string;
|
113
|
-
addressType: "INTERNATIONAL";
|
114
|
-
district2: string;
|
115
|
-
cityOrTown?: string | null | undefined;
|
116
|
-
addressLine1?: string | null | undefined;
|
117
|
-
addressLine2?: string | null | undefined;
|
118
|
-
addressLine3?: string | null | undefined;
|
119
|
-
postcodeOrZip?: string | null | undefined;
|
120
|
-
} | {
|
121
|
-
type: string;
|
122
|
-
option: string;
|
123
|
-
filename: string;
|
124
|
-
originalFilename: string;
|
125
|
-
}[] | undefined>;
|
126
|
-
createdAt: string;
|
127
|
-
createdBy: string;
|
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;
|
63
|
+
firstname: string;
|
64
|
+
surname: string;
|
65
|
+
middlename?: string | null | undefined;
|
144
66
|
} | {
|
145
67
|
country: string;
|
146
68
|
district: string;
|
@@ -163,14 +85,19 @@ export declare const eventPayloadGenerator: {
|
|
163
85
|
option: string;
|
164
86
|
filename: string;
|
165
87
|
originalFilename: string;
|
166
|
-
}[] |
|
167
|
-
|
168
|
-
|
169
|
-
actions: {
|
170
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "data">>) => {
|
88
|
+
}[] | [string, string] | null | undefined>;
|
89
|
+
annotation: {};
|
90
|
+
keepAssignment?: boolean | undefined;
|
171
91
|
type: "DECLARE";
|
92
|
+
eventId: string;
|
93
|
+
};
|
94
|
+
/**
|
95
|
+
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
96
|
+
*/
|
97
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
98
|
+
type: "NOTIFY";
|
172
99
|
transactionId: string;
|
173
|
-
|
100
|
+
declaration: Record<string, string | number | boolean | {
|
174
101
|
type: string;
|
175
102
|
filename: string;
|
176
103
|
originalFilename: string;
|
@@ -185,6 +112,10 @@ export declare const eventPayloadGenerator: {
|
|
185
112
|
residentialArea?: string | null | undefined;
|
186
113
|
street?: string | null | undefined;
|
187
114
|
zipCode?: string | null | undefined;
|
115
|
+
} | {
|
116
|
+
firstname: string;
|
117
|
+
surname: string;
|
118
|
+
middlename?: string | null | undefined;
|
188
119
|
} | {
|
189
120
|
country: string;
|
190
121
|
district: string;
|
@@ -207,13 +138,13 @@ export declare const eventPayloadGenerator: {
|
|
207
138
|
option: string;
|
208
139
|
filename: string;
|
209
140
|
originalFilename: string;
|
210
|
-
}[] | undefined>;
|
141
|
+
}[] | [string, string] | null | undefined>;
|
211
142
|
eventId: string;
|
143
|
+
keepAssignment: boolean | undefined;
|
212
144
|
};
|
213
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "
|
214
|
-
type: "VALIDATE";
|
145
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
215
146
|
transactionId: string;
|
216
|
-
|
147
|
+
declaration: Record<string, string | number | boolean | {
|
217
148
|
type: string;
|
218
149
|
filename: string;
|
219
150
|
originalFilename: string;
|
@@ -228,6 +159,10 @@ export declare const eventPayloadGenerator: {
|
|
228
159
|
residentialArea?: string | null | undefined;
|
229
160
|
street?: string | null | undefined;
|
230
161
|
zipCode?: string | null | undefined;
|
162
|
+
} | {
|
163
|
+
firstname: string;
|
164
|
+
surname: string;
|
165
|
+
middlename?: string | null | undefined;
|
231
166
|
} | {
|
232
167
|
country: string;
|
233
168
|
district: string;
|
@@ -250,14 +185,30 @@ export declare const eventPayloadGenerator: {
|
|
250
185
|
option: string;
|
251
186
|
filename: string;
|
252
187
|
originalFilename: string;
|
253
|
-
}[] | undefined>;
|
188
|
+
}[] | [string, string] | null | undefined>;
|
189
|
+
annotation: {};
|
190
|
+
keepAssignment?: boolean | undefined;
|
191
|
+
type: "VALIDATE";
|
254
192
|
duplicates: never[];
|
255
193
|
eventId: string;
|
256
194
|
};
|
257
|
-
|
258
|
-
type: "
|
195
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
|
196
|
+
type: "ASSIGN";
|
259
197
|
transactionId: string;
|
260
|
-
|
198
|
+
declaration: {};
|
199
|
+
assignedTo: string;
|
200
|
+
eventId: string;
|
201
|
+
};
|
202
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
|
203
|
+
type: "UNASSIGN";
|
204
|
+
transactionId: string;
|
205
|
+
declaration: {};
|
206
|
+
assignedTo: null;
|
207
|
+
eventId: string;
|
208
|
+
};
|
209
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
210
|
+
transactionId: string;
|
211
|
+
declaration: Record<string, string | number | boolean | {
|
261
212
|
type: string;
|
262
213
|
filename: string;
|
263
214
|
originalFilename: string;
|
@@ -272,6 +223,10 @@ export declare const eventPayloadGenerator: {
|
|
272
223
|
residentialArea?: string | null | undefined;
|
273
224
|
street?: string | null | undefined;
|
274
225
|
zipCode?: string | null | undefined;
|
226
|
+
} | {
|
227
|
+
firstname: string;
|
228
|
+
surname: string;
|
229
|
+
middlename?: string | null | undefined;
|
275
230
|
} | {
|
276
231
|
country: string;
|
277
232
|
district: string;
|
@@ -294,61 +249,32 @@ export declare const eventPayloadGenerator: {
|
|
294
249
|
option: string;
|
295
250
|
filename: string;
|
296
251
|
originalFilename: string;
|
297
|
-
}[] | undefined>;
|
298
|
-
|
299
|
-
|
300
|
-
};
|
252
|
+
}[] | [string, string] | null | undefined>;
|
253
|
+
keepAssignment?: boolean | undefined;
|
254
|
+
type: "ARCHIVE";
|
255
|
+
annotation: {};
|
301
256
|
duplicates: never[];
|
302
257
|
eventId: string;
|
258
|
+
reason: {
|
259
|
+
message: string;
|
260
|
+
isDuplicate: boolean;
|
261
|
+
};
|
303
262
|
};
|
304
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "
|
305
|
-
type: "REJECT";
|
263
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
306
264
|
transactionId: string;
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
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>;
|
265
|
+
annotation: {};
|
266
|
+
keepAssignment?: boolean | undefined;
|
267
|
+
type: "REJECT";
|
268
|
+
declaration: {};
|
345
269
|
duplicates: never[];
|
346
270
|
eventId: string;
|
271
|
+
reason: {
|
272
|
+
message: string;
|
273
|
+
};
|
347
274
|
};
|
348
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
349
|
-
type: "REGISTER";
|
275
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
350
276
|
transactionId: string;
|
351
|
-
|
277
|
+
declaration: Record<string, string | number | boolean | {
|
352
278
|
type: string;
|
353
279
|
filename: string;
|
354
280
|
originalFilename: string;
|
@@ -363,6 +289,10 @@ export declare const eventPayloadGenerator: {
|
|
363
289
|
residentialArea?: string | null | undefined;
|
364
290
|
street?: string | null | undefined;
|
365
291
|
zipCode?: string | null | undefined;
|
292
|
+
} | {
|
293
|
+
firstname: string;
|
294
|
+
surname: string;
|
295
|
+
middlename?: string | null | undefined;
|
366
296
|
} | {
|
367
297
|
country: string;
|
368
298
|
district: string;
|
@@ -385,58 +315,25 @@ export declare const eventPayloadGenerator: {
|
|
385
315
|
option: string;
|
386
316
|
filename: string;
|
387
317
|
originalFilename: string;
|
388
|
-
}[] | undefined>;
|
318
|
+
}[] | [string, string] | null | undefined>;
|
319
|
+
annotation: {};
|
320
|
+
keepAssignment?: boolean | undefined;
|
321
|
+
type: "REGISTER";
|
389
322
|
eventId: string;
|
390
323
|
};
|
391
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
392
|
-
type: "PRINT_CERTIFICATE";
|
324
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
393
325
|
transactionId: string;
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
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: {};
|
326
|
+
annotation: {};
|
327
|
+
keepAssignment?: boolean | undefined;
|
328
|
+
type: "PRINT_CERTIFICATE";
|
329
|
+
declaration: {};
|
433
330
|
eventId: string;
|
434
331
|
};
|
435
332
|
correction: {
|
436
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
333
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
437
334
|
type: "REQUEST_CORRECTION";
|
438
335
|
transactionId: string;
|
439
|
-
|
336
|
+
declaration: Record<string, string | number | boolean | {
|
440
337
|
type: string;
|
441
338
|
filename: string;
|
442
339
|
originalFilename: string;
|
@@ -451,6 +348,10 @@ export declare const eventPayloadGenerator: {
|
|
451
348
|
residentialArea?: string | null | undefined;
|
452
349
|
street?: string | null | undefined;
|
453
350
|
zipCode?: string | null | undefined;
|
351
|
+
} | {
|
352
|
+
firstname: string;
|
353
|
+
surname: string;
|
354
|
+
middlename?: string | null | undefined;
|
454
355
|
} | {
|
455
356
|
country: string;
|
456
357
|
district: string;
|
@@ -473,111 +374,71 @@ export declare const eventPayloadGenerator: {
|
|
473
374
|
option: string;
|
474
375
|
filename: string;
|
475
376
|
originalFilename: string;
|
476
|
-
}[] | undefined>;
|
477
|
-
|
377
|
+
}[] | [string, string] | null | undefined>;
|
378
|
+
annotation: {};
|
478
379
|
eventId: string;
|
380
|
+
keepAssignment: boolean | undefined;
|
479
381
|
};
|
480
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
382
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
481
383
|
type: "APPROVE_CORRECTION";
|
482
384
|
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>;
|
385
|
+
declaration: {};
|
386
|
+
annotation: {};
|
521
387
|
eventId: string;
|
522
388
|
requestId: string;
|
389
|
+
keepAssignment: boolean | undefined;
|
523
390
|
};
|
524
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
391
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
525
392
|
type: "REJECT_CORRECTION";
|
526
393
|
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>;
|
394
|
+
declaration: {};
|
395
|
+
annotation: {};
|
565
396
|
eventId: string;
|
566
397
|
requestId: string;
|
398
|
+
keepAssignment: boolean | undefined;
|
567
399
|
};
|
568
400
|
};
|
569
401
|
};
|
570
402
|
};
|
571
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
403
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
572
404
|
configuration: EventConfig;
|
573
405
|
action: ActionType;
|
406
|
+
rng?: () => number;
|
574
407
|
defaults?: Partial<ActionDocument>;
|
408
|
+
user?: Partial<{
|
409
|
+
signature: string;
|
410
|
+
primaryOfficeId: string;
|
411
|
+
role: TestUserRole;
|
412
|
+
id: string;
|
413
|
+
}>;
|
575
414
|
}): ActionDocument;
|
576
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
415
|
+
export declare function generateEventDocument({ configuration, actions, rng }: {
|
577
416
|
configuration: EventConfig;
|
578
417
|
actions: ActionType[];
|
418
|
+
rng?: () => number;
|
579
419
|
}): EventDocument;
|
580
|
-
export declare function generateEventDraftDocument(eventId
|
581
|
-
|
420
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
421
|
+
eventId: string;
|
422
|
+
actionType: ActionType;
|
423
|
+
rng?: () => number;
|
424
|
+
declaration?: EventState;
|
425
|
+
}): Draft;
|
426
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
427
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
428
|
+
/**
|
429
|
+
* Useful for testing when we need deterministic outcome.
|
430
|
+
* @param seed - Seed value for the pseudo-random number generator
|
431
|
+
*
|
432
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
433
|
+
*/
|
434
|
+
export declare function createPrng(seed: number): () => number;
|
435
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
436
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
582
437
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
438
|
+
export declare const BearerTokenByUserType: {
|
439
|
+
fieldAgent: string;
|
440
|
+
registrationAgent: string;
|
441
|
+
localRegistrar: string;
|
442
|
+
};
|
443
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
583
444
|
//# sourceMappingURL=test.utils.d.ts.map
|