@opencrvs/toolkit 1.8.0-rc.fd16d13 → 1.8.0-rc.fd1df48
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 +11807 -13412
- package/dist/commons/conditionals/conditionals.d.ts +37 -6
- package/dist/commons/conditionals/validate.d.ts +18 -17
- package/dist/commons/events/ActionConfig.d.ts +119425 -2069
- package/dist/commons/events/ActionDocument.d.ts +10215 -575
- package/dist/commons/events/ActionInput.d.ts +4578 -781
- package/dist/commons/events/ActionType.d.ts +30 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1233 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +83 -12
- 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 +3730 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +288 -82
- package/dist/commons/events/EventConfig.d.ts +57613 -1795
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +2974 -709
- package/dist/commons/events/EventIndex.d.ts +2007 -24
- package/dist/commons/events/EventMetadata.d.ts +343 -42
- package/dist/commons/events/FieldConfig.d.ts +5992 -1009
- package/dist/commons/events/FieldType.d.ts +7 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +142 -44
- package/dist/commons/events/FieldValue.d.ts +77 -16
- package/dist/commons/events/FormConfig.d.ts +50409 -90
- package/dist/commons/events/PageConfig.d.ts +12597 -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 +7300 -20
- package/dist/commons/events/defineConfig.d.ts +9405 -301
- 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 +191 -280
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13821 -96
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +243 -115
- package/dist/events/index.js +5353 -2193
- package/dist/scopes/index.d.ts +161 -1
- package/dist/scopes/index.js +202 -1
- package/package.json +4 -3
@@ -1,48 +1,34 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { UUID } from '../uuid';
|
2
|
+
import { ActionDocument, EventState } from './ActionDocument';
|
3
|
+
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
3
4
|
import { ActionType } from './ActionType';
|
4
5
|
import { Draft } from './Draft';
|
5
6
|
import { EventConfig } from './EventConfig';
|
6
7
|
import { EventDocument } from './EventDocument';
|
7
8
|
import { EventIndex } from './EventIndex';
|
8
9
|
import { EventInput } from './EventInput';
|
10
|
+
import { TranslationConfig } from './TranslationConfig';
|
11
|
+
import { FieldConfig } from './FieldConfig';
|
12
|
+
import { WorkqueueConfig } from './WorkqueueConfig';
|
9
13
|
import { FieldValue } from './FieldValue';
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
urbanOrRural: "RURAL";
|
29
|
-
village?: string | undefined;
|
30
|
-
} | {
|
31
|
-
country: string;
|
32
|
-
state: string;
|
33
|
-
district2: string;
|
34
|
-
cityOrTown?: string | undefined;
|
35
|
-
addressLine1?: string | undefined;
|
36
|
-
addressLine2?: string | undefined;
|
37
|
-
addressLine3?: string | undefined;
|
38
|
-
postcodeOrZip?: string | undefined;
|
39
|
-
} | {
|
40
|
-
type: string;
|
41
|
-
option: string;
|
42
|
-
filename: string;
|
43
|
-
originalFilename: string;
|
44
|
-
}[]>;
|
45
|
-
export declare const eventPayloadGenerator: {
|
14
|
+
import { z } from 'zod';
|
15
|
+
/**
|
16
|
+
* In real application, the roles are defined in the countryconfig.
|
17
|
+
* These are just for testing purposes to generate realistic mock data.
|
18
|
+
*/
|
19
|
+
export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT"]>;
|
20
|
+
export type TestUserRole = z.infer<typeof TestUserRole>;
|
21
|
+
export declare function generateRandomName(rng: () => number): {
|
22
|
+
firstname: string;
|
23
|
+
surname: string;
|
24
|
+
};
|
25
|
+
/**
|
26
|
+
* Quick-and-dirty mock data generator for event actions.
|
27
|
+
*/
|
28
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
|
29
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
|
30
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
|
31
|
+
export declare function eventPayloadGenerator(rng: () => number): {
|
46
32
|
create: (input?: Partial<EventInput>) => {
|
47
33
|
transactionId: string;
|
48
34
|
type: string;
|
@@ -52,41 +38,21 @@ export declare const eventPayloadGenerator: {
|
|
52
38
|
type: string;
|
53
39
|
id: string;
|
54
40
|
};
|
55
|
-
draft: (eventId
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
'applicant.firstname': string;
|
64
|
-
'applicant.surname': string;
|
65
|
-
'applicant.dob': string;
|
66
|
-
'recommender.none': boolean;
|
67
|
-
};
|
68
|
-
metadata: {
|
69
|
-
'correction.requester.relationship': string;
|
70
|
-
'correction.request.reason': string;
|
71
|
-
};
|
72
|
-
createdAt: string;
|
73
|
-
createdBy: string;
|
74
|
-
createdAtLocation: string;
|
75
|
-
};
|
76
|
-
} & Partial<{
|
77
|
-
id: string;
|
78
|
-
createdAt: string;
|
79
|
-
eventId: string;
|
80
|
-
transactionId: string;
|
81
|
-
action: {
|
82
|
-
type: ActionType;
|
83
|
-
data: Record<string, string | number | boolean | {
|
41
|
+
draft: ({ eventId, actionType }: {
|
42
|
+
eventId: UUID;
|
43
|
+
actionType: ActionType;
|
44
|
+
}, input?: Partial<Draft>) => Draft;
|
45
|
+
actions: {
|
46
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
47
|
+
transactionId: string;
|
48
|
+
declaration: Record<string, string | number | boolean | {
|
84
49
|
type: string;
|
85
50
|
filename: string;
|
86
51
|
originalFilename: string;
|
87
52
|
} | {
|
88
53
|
country: string;
|
89
54
|
district: string;
|
55
|
+
addressType: "DOMESTIC";
|
90
56
|
province: string;
|
91
57
|
urbanOrRural: "URBAN";
|
92
58
|
number?: string | null | undefined;
|
@@ -95,52 +61,20 @@ export declare const eventPayloadGenerator: {
|
|
95
61
|
street?: string | null | undefined;
|
96
62
|
zipCode?: string | null | undefined;
|
97
63
|
} | {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
urbanOrRural: "RURAL";
|
102
|
-
village?: string | null | undefined;
|
103
|
-
} | {
|
104
|
-
country: string;
|
105
|
-
state: string;
|
106
|
-
district2: string;
|
107
|
-
cityOrTown?: string | null | undefined;
|
108
|
-
addressLine1?: string | null | undefined;
|
109
|
-
addressLine2?: string | null | undefined;
|
110
|
-
addressLine3?: string | null | undefined;
|
111
|
-
postcodeOrZip?: string | null | undefined;
|
112
|
-
} | {
|
113
|
-
type: string;
|
114
|
-
option: string;
|
115
|
-
filename: string;
|
116
|
-
originalFilename: string;
|
117
|
-
}[]>;
|
118
|
-
createdAt: string;
|
119
|
-
createdBy: string;
|
120
|
-
createdAtLocation: string;
|
121
|
-
metadata?: Record<string, string | number | boolean | {
|
122
|
-
type: string;
|
123
|
-
filename: string;
|
124
|
-
originalFilename: string;
|
125
|
-
} | {
|
126
|
-
country: string;
|
127
|
-
district: string;
|
128
|
-
province: string;
|
129
|
-
urbanOrRural: "URBAN";
|
130
|
-
number?: string | null | undefined;
|
131
|
-
town?: string | null | undefined;
|
132
|
-
residentialArea?: string | null | undefined;
|
133
|
-
street?: string | null | undefined;
|
134
|
-
zipCode?: string | null | undefined;
|
64
|
+
firstname?: string | null | undefined;
|
65
|
+
surname?: string | null | undefined;
|
66
|
+
middlename?: string | null | undefined;
|
135
67
|
} | {
|
136
68
|
country: string;
|
137
69
|
district: string;
|
70
|
+
addressType: "DOMESTIC";
|
138
71
|
province: string;
|
139
72
|
urbanOrRural: "RURAL";
|
140
73
|
village?: string | null | undefined;
|
141
74
|
} | {
|
142
75
|
country: string;
|
143
76
|
state: string;
|
77
|
+
addressType: "INTERNATIONAL";
|
144
78
|
district2: string;
|
145
79
|
cityOrTown?: string | null | undefined;
|
146
80
|
addressLine1?: string | null | undefined;
|
@@ -152,20 +86,26 @@ export declare const eventPayloadGenerator: {
|
|
152
86
|
option: string;
|
153
87
|
filename: string;
|
154
88
|
originalFilename: string;
|
155
|
-
}[]
|
156
|
-
|
157
|
-
|
158
|
-
actions: {
|
159
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "data">>) => {
|
89
|
+
}[] | [string, string] | null | undefined>;
|
90
|
+
annotation: {};
|
91
|
+
keepAssignment?: boolean | undefined;
|
160
92
|
type: "DECLARE";
|
93
|
+
eventId: string;
|
94
|
+
};
|
95
|
+
/**
|
96
|
+
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
97
|
+
*/
|
98
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
99
|
+
type: "NOTIFY";
|
161
100
|
transactionId: string;
|
162
|
-
|
101
|
+
declaration: Record<string, string | number | boolean | {
|
163
102
|
type: string;
|
164
103
|
filename: string;
|
165
104
|
originalFilename: string;
|
166
105
|
} | {
|
167
106
|
country: string;
|
168
107
|
district: string;
|
108
|
+
addressType: "DOMESTIC";
|
169
109
|
province: string;
|
170
110
|
urbanOrRural: "URBAN";
|
171
111
|
number?: string | null | undefined;
|
@@ -173,15 +113,21 @@ export declare const eventPayloadGenerator: {
|
|
173
113
|
residentialArea?: string | null | undefined;
|
174
114
|
street?: string | null | undefined;
|
175
115
|
zipCode?: string | null | undefined;
|
116
|
+
} | {
|
117
|
+
firstname?: string | null | undefined;
|
118
|
+
surname?: string | null | undefined;
|
119
|
+
middlename?: string | null | undefined;
|
176
120
|
} | {
|
177
121
|
country: string;
|
178
122
|
district: string;
|
123
|
+
addressType: "DOMESTIC";
|
179
124
|
province: string;
|
180
125
|
urbanOrRural: "RURAL";
|
181
126
|
village?: string | null | undefined;
|
182
127
|
} | {
|
183
128
|
country: string;
|
184
129
|
state: string;
|
130
|
+
addressType: "INTERNATIONAL";
|
185
131
|
district2: string;
|
186
132
|
cityOrTown?: string | null | undefined;
|
187
133
|
addressLine1?: string | null | undefined;
|
@@ -193,19 +139,20 @@ export declare const eventPayloadGenerator: {
|
|
193
139
|
option: string;
|
194
140
|
filename: string;
|
195
141
|
originalFilename: string;
|
196
|
-
}[]>;
|
142
|
+
}[] | [string, string] | null | undefined>;
|
197
143
|
eventId: string;
|
144
|
+
keepAssignment: boolean | undefined;
|
198
145
|
};
|
199
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "
|
200
|
-
type: "VALIDATE";
|
146
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
201
147
|
transactionId: string;
|
202
|
-
|
148
|
+
declaration: Record<string, string | number | boolean | {
|
203
149
|
type: string;
|
204
150
|
filename: string;
|
205
151
|
originalFilename: string;
|
206
152
|
} | {
|
207
153
|
country: string;
|
208
154
|
district: string;
|
155
|
+
addressType: "DOMESTIC";
|
209
156
|
province: string;
|
210
157
|
urbanOrRural: "URBAN";
|
211
158
|
number?: string | null | undefined;
|
@@ -213,15 +160,21 @@ export declare const eventPayloadGenerator: {
|
|
213
160
|
residentialArea?: string | null | undefined;
|
214
161
|
street?: string | null | undefined;
|
215
162
|
zipCode?: string | null | undefined;
|
163
|
+
} | {
|
164
|
+
firstname?: string | null | undefined;
|
165
|
+
surname?: string | null | undefined;
|
166
|
+
middlename?: string | null | undefined;
|
216
167
|
} | {
|
217
168
|
country: string;
|
218
169
|
district: string;
|
170
|
+
addressType: "DOMESTIC";
|
219
171
|
province: string;
|
220
172
|
urbanOrRural: "RURAL";
|
221
173
|
village?: string | null | undefined;
|
222
174
|
} | {
|
223
175
|
country: string;
|
224
176
|
state: string;
|
177
|
+
addressType: "INTERNATIONAL";
|
225
178
|
district2: string;
|
226
179
|
cityOrTown?: string | null | undefined;
|
227
180
|
addressLine1?: string | null | undefined;
|
@@ -233,20 +186,37 @@ export declare const eventPayloadGenerator: {
|
|
233
186
|
option: string;
|
234
187
|
filename: string;
|
235
188
|
originalFilename: string;
|
236
|
-
}[]>;
|
189
|
+
}[] | [string, string] | null | undefined>;
|
190
|
+
annotation: {};
|
191
|
+
keepAssignment?: boolean | undefined;
|
192
|
+
type: "VALIDATE";
|
237
193
|
duplicates: never[];
|
238
194
|
eventId: string;
|
239
195
|
};
|
240
|
-
|
241
|
-
type: "
|
196
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
|
197
|
+
type: "ASSIGN";
|
198
|
+
transactionId: string;
|
199
|
+
declaration: {};
|
200
|
+
assignedTo: string;
|
201
|
+
eventId: string;
|
202
|
+
};
|
203
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
|
204
|
+
type: "UNASSIGN";
|
205
|
+
transactionId: string;
|
206
|
+
declaration: {};
|
207
|
+
assignedTo: null;
|
208
|
+
eventId: string;
|
209
|
+
};
|
210
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
242
211
|
transactionId: string;
|
243
|
-
|
212
|
+
declaration: Record<string, string | number | boolean | {
|
244
213
|
type: string;
|
245
214
|
filename: string;
|
246
215
|
originalFilename: string;
|
247
216
|
} | {
|
248
217
|
country: string;
|
249
218
|
district: string;
|
219
|
+
addressType: "DOMESTIC";
|
250
220
|
province: string;
|
251
221
|
urbanOrRural: "URBAN";
|
252
222
|
number?: string | null | undefined;
|
@@ -254,15 +224,21 @@ export declare const eventPayloadGenerator: {
|
|
254
224
|
residentialArea?: string | null | undefined;
|
255
225
|
street?: string | null | undefined;
|
256
226
|
zipCode?: string | null | undefined;
|
227
|
+
} | {
|
228
|
+
firstname?: string | null | undefined;
|
229
|
+
surname?: string | null | undefined;
|
230
|
+
middlename?: string | null | undefined;
|
257
231
|
} | {
|
258
232
|
country: string;
|
259
233
|
district: string;
|
234
|
+
addressType: "DOMESTIC";
|
260
235
|
province: string;
|
261
236
|
urbanOrRural: "RURAL";
|
262
237
|
village?: string | null | undefined;
|
263
238
|
} | {
|
264
239
|
country: string;
|
265
240
|
state: string;
|
241
|
+
addressType: "INTERNATIONAL";
|
266
242
|
district2: string;
|
267
243
|
cityOrTown?: string | null | undefined;
|
268
244
|
addressLine1?: string | null | undefined;
|
@@ -274,64 +250,39 @@ export declare const eventPayloadGenerator: {
|
|
274
250
|
option: string;
|
275
251
|
filename: string;
|
276
252
|
originalFilename: string;
|
277
|
-
}[]>;
|
278
|
-
|
279
|
-
|
280
|
-
};
|
253
|
+
}[] | [string, string] | null | undefined>;
|
254
|
+
keepAssignment?: boolean | undefined;
|
255
|
+
type: "ARCHIVE";
|
256
|
+
annotation: {};
|
281
257
|
duplicates: never[];
|
282
258
|
eventId: string;
|
259
|
+
reason: {
|
260
|
+
message: string;
|
261
|
+
isDuplicate: boolean;
|
262
|
+
};
|
283
263
|
};
|
284
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "
|
285
|
-
type: "REJECT";
|
264
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
286
265
|
transactionId: string;
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
} | {
|
292
|
-
country: string;
|
293
|
-
district: string;
|
294
|
-
province: string;
|
295
|
-
urbanOrRural: "URBAN";
|
296
|
-
number?: string | null | undefined;
|
297
|
-
town?: string | null | undefined;
|
298
|
-
residentialArea?: string | null | undefined;
|
299
|
-
street?: string | null | undefined;
|
300
|
-
zipCode?: string | null | undefined;
|
301
|
-
} | {
|
302
|
-
country: string;
|
303
|
-
district: string;
|
304
|
-
province: string;
|
305
|
-
urbanOrRural: "RURAL";
|
306
|
-
village?: string | null | undefined;
|
307
|
-
} | {
|
308
|
-
country: string;
|
309
|
-
state: string;
|
310
|
-
district2: string;
|
311
|
-
cityOrTown?: string | null | undefined;
|
312
|
-
addressLine1?: string | null | undefined;
|
313
|
-
addressLine2?: string | null | undefined;
|
314
|
-
addressLine3?: string | null | undefined;
|
315
|
-
postcodeOrZip?: string | null | undefined;
|
316
|
-
} | {
|
317
|
-
type: string;
|
318
|
-
option: string;
|
319
|
-
filename: string;
|
320
|
-
originalFilename: string;
|
321
|
-
}[]>;
|
266
|
+
annotation: {};
|
267
|
+
keepAssignment?: boolean | undefined;
|
268
|
+
type: "REJECT";
|
269
|
+
declaration: {};
|
322
270
|
duplicates: never[];
|
323
271
|
eventId: string;
|
272
|
+
reason: {
|
273
|
+
message: string;
|
274
|
+
};
|
324
275
|
};
|
325
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
326
|
-
type: "REGISTER";
|
276
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
327
277
|
transactionId: string;
|
328
|
-
|
278
|
+
declaration: Record<string, string | number | boolean | {
|
329
279
|
type: string;
|
330
280
|
filename: string;
|
331
281
|
originalFilename: string;
|
332
282
|
} | {
|
333
283
|
country: string;
|
334
284
|
district: string;
|
285
|
+
addressType: "DOMESTIC";
|
335
286
|
province: string;
|
336
287
|
urbanOrRural: "URBAN";
|
337
288
|
number?: string | null | undefined;
|
@@ -339,15 +290,21 @@ export declare const eventPayloadGenerator: {
|
|
339
290
|
residentialArea?: string | null | undefined;
|
340
291
|
street?: string | null | undefined;
|
341
292
|
zipCode?: string | null | undefined;
|
293
|
+
} | {
|
294
|
+
firstname?: string | null | undefined;
|
295
|
+
surname?: string | null | undefined;
|
296
|
+
middlename?: string | null | undefined;
|
342
297
|
} | {
|
343
298
|
country: string;
|
344
299
|
district: string;
|
300
|
+
addressType: "DOMESTIC";
|
345
301
|
province: string;
|
346
302
|
urbanOrRural: "RURAL";
|
347
303
|
village?: string | null | undefined;
|
348
304
|
} | {
|
349
305
|
country: string;
|
350
306
|
state: string;
|
307
|
+
addressType: "INTERNATIONAL";
|
351
308
|
district2: string;
|
352
309
|
cityOrTown?: string | null | undefined;
|
353
310
|
addressLine1?: string | null | undefined;
|
@@ -359,60 +316,33 @@ export declare const eventPayloadGenerator: {
|
|
359
316
|
option: string;
|
360
317
|
filename: string;
|
361
318
|
originalFilename: string;
|
362
|
-
}[]>;
|
319
|
+
}[] | [string, string] | null | undefined>;
|
320
|
+
annotation: {};
|
321
|
+
registrationNumber?: string | undefined;
|
322
|
+
keepAssignment?: boolean | undefined;
|
323
|
+
type: "REGISTER";
|
363
324
|
eventId: string;
|
364
325
|
};
|
365
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "
|
366
|
-
type: "PRINT_CERTIFICATE";
|
326
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
367
327
|
transactionId: string;
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
} | {
|
373
|
-
country: string;
|
374
|
-
district: string;
|
375
|
-
province: string;
|
376
|
-
urbanOrRural: "URBAN";
|
377
|
-
number?: string | null | undefined;
|
378
|
-
town?: string | null | undefined;
|
379
|
-
residentialArea?: string | null | undefined;
|
380
|
-
street?: string | null | undefined;
|
381
|
-
zipCode?: string | null | undefined;
|
382
|
-
} | {
|
383
|
-
country: string;
|
384
|
-
district: string;
|
385
|
-
province: string;
|
386
|
-
urbanOrRural: "RURAL";
|
387
|
-
village?: string | null | undefined;
|
388
|
-
} | {
|
389
|
-
country: string;
|
390
|
-
state: string;
|
391
|
-
district2: string;
|
392
|
-
cityOrTown?: string | null | undefined;
|
393
|
-
addressLine1?: string | null | undefined;
|
394
|
-
addressLine2?: string | null | undefined;
|
395
|
-
addressLine3?: string | null | undefined;
|
396
|
-
postcodeOrZip?: string | null | undefined;
|
397
|
-
} | {
|
398
|
-
type: string;
|
399
|
-
option: string;
|
400
|
-
filename: string;
|
401
|
-
originalFilename: string;
|
402
|
-
}[]>;
|
328
|
+
annotation: {};
|
329
|
+
keepAssignment?: boolean | undefined;
|
330
|
+
type: "PRINT_CERTIFICATE";
|
331
|
+
declaration: {};
|
403
332
|
eventId: string;
|
404
333
|
};
|
405
334
|
correction: {
|
406
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
335
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
407
336
|
type: "REQUEST_CORRECTION";
|
408
337
|
transactionId: string;
|
409
|
-
|
338
|
+
declaration: Record<string, string | number | boolean | {
|
410
339
|
type: string;
|
411
340
|
filename: string;
|
412
341
|
originalFilename: string;
|
413
342
|
} | {
|
414
343
|
country: string;
|
415
344
|
district: string;
|
345
|
+
addressType: "DOMESTIC";
|
416
346
|
province: string;
|
417
347
|
urbanOrRural: "URBAN";
|
418
348
|
number?: string | null | undefined;
|
@@ -420,15 +350,21 @@ export declare const eventPayloadGenerator: {
|
|
420
350
|
residentialArea?: string | null | undefined;
|
421
351
|
street?: string | null | undefined;
|
422
352
|
zipCode?: string | null | undefined;
|
353
|
+
} | {
|
354
|
+
firstname?: string | null | undefined;
|
355
|
+
surname?: string | null | undefined;
|
356
|
+
middlename?: string | null | undefined;
|
423
357
|
} | {
|
424
358
|
country: string;
|
425
359
|
district: string;
|
360
|
+
addressType: "DOMESTIC";
|
426
361
|
province: string;
|
427
362
|
urbanOrRural: "RURAL";
|
428
363
|
village?: string | null | undefined;
|
429
364
|
} | {
|
430
365
|
country: string;
|
431
366
|
state: string;
|
367
|
+
addressType: "INTERNATIONAL";
|
432
368
|
district2: string;
|
433
369
|
cityOrTown?: string | null | undefined;
|
434
370
|
addressLine1?: string | null | undefined;
|
@@ -440,104 +376,79 @@ export declare const eventPayloadGenerator: {
|
|
440
376
|
option: string;
|
441
377
|
filename: string;
|
442
378
|
originalFilename: string;
|
443
|
-
}[]>;
|
444
|
-
|
379
|
+
}[] | [string, string] | null | undefined>;
|
380
|
+
annotation: {};
|
445
381
|
eventId: string;
|
382
|
+
keepAssignment: boolean | undefined;
|
446
383
|
};
|
447
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
384
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
448
385
|
type: "APPROVE_CORRECTION";
|
449
386
|
transactionId: string;
|
450
|
-
|
451
|
-
|
452
|
-
filename: string;
|
453
|
-
originalFilename: string;
|
454
|
-
} | {
|
455
|
-
country: string;
|
456
|
-
district: string;
|
457
|
-
province: string;
|
458
|
-
urbanOrRural: "URBAN";
|
459
|
-
number?: string | null | undefined;
|
460
|
-
town?: string | null | undefined;
|
461
|
-
residentialArea?: string | null | undefined;
|
462
|
-
street?: string | null | undefined;
|
463
|
-
zipCode?: string | null | undefined;
|
464
|
-
} | {
|
465
|
-
country: string;
|
466
|
-
district: string;
|
467
|
-
province: string;
|
468
|
-
urbanOrRural: "RURAL";
|
469
|
-
village?: string | null | undefined;
|
470
|
-
} | {
|
471
|
-
country: string;
|
472
|
-
state: string;
|
473
|
-
district2: string;
|
474
|
-
cityOrTown?: string | null | undefined;
|
475
|
-
addressLine1?: string | null | undefined;
|
476
|
-
addressLine2?: string | null | undefined;
|
477
|
-
addressLine3?: string | null | undefined;
|
478
|
-
postcodeOrZip?: string | null | undefined;
|
479
|
-
} | {
|
480
|
-
type: string;
|
481
|
-
option: string;
|
482
|
-
filename: string;
|
483
|
-
originalFilename: string;
|
484
|
-
}[]>;
|
387
|
+
declaration: {};
|
388
|
+
annotation: {};
|
485
389
|
eventId: string;
|
486
390
|
requestId: string;
|
391
|
+
keepAssignment: boolean | undefined;
|
487
392
|
};
|
488
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "
|
393
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
489
394
|
type: "REJECT_CORRECTION";
|
490
395
|
transactionId: string;
|
491
|
-
|
492
|
-
|
493
|
-
filename: string;
|
494
|
-
originalFilename: string;
|
495
|
-
} | {
|
496
|
-
country: string;
|
497
|
-
district: string;
|
498
|
-
province: string;
|
499
|
-
urbanOrRural: "URBAN";
|
500
|
-
number?: string | null | undefined;
|
501
|
-
town?: string | null | undefined;
|
502
|
-
residentialArea?: string | null | undefined;
|
503
|
-
street?: string | null | undefined;
|
504
|
-
zipCode?: string | null | undefined;
|
505
|
-
} | {
|
506
|
-
country: string;
|
507
|
-
district: string;
|
508
|
-
province: string;
|
509
|
-
urbanOrRural: "RURAL";
|
510
|
-
village?: string | null | undefined;
|
511
|
-
} | {
|
512
|
-
country: string;
|
513
|
-
state: string;
|
514
|
-
district2: string;
|
515
|
-
cityOrTown?: string | null | undefined;
|
516
|
-
addressLine1?: string | null | undefined;
|
517
|
-
addressLine2?: string | null | undefined;
|
518
|
-
addressLine3?: string | null | undefined;
|
519
|
-
postcodeOrZip?: string | null | undefined;
|
520
|
-
} | {
|
521
|
-
type: string;
|
522
|
-
option: string;
|
523
|
-
filename: string;
|
524
|
-
originalFilename: string;
|
525
|
-
}[]>;
|
396
|
+
declaration: {};
|
397
|
+
annotation: {};
|
526
398
|
eventId: string;
|
527
399
|
requestId: string;
|
400
|
+
keepAssignment: boolean | undefined;
|
528
401
|
};
|
529
402
|
};
|
530
403
|
};
|
531
404
|
};
|
532
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
405
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
533
406
|
configuration: EventConfig;
|
534
407
|
action: ActionType;
|
408
|
+
rng?: () => number;
|
535
409
|
defaults?: Partial<ActionDocument>;
|
410
|
+
user?: Partial<{
|
411
|
+
signature: string;
|
412
|
+
primaryOfficeId: UUID;
|
413
|
+
role: TestUserRole;
|
414
|
+
id: string;
|
415
|
+
}>;
|
536
416
|
}): ActionDocument;
|
537
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
417
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
538
418
|
configuration: EventConfig;
|
539
419
|
actions: ActionType[];
|
420
|
+
rng?: () => number;
|
421
|
+
user?: Partial<{
|
422
|
+
signature: string;
|
423
|
+
primaryOfficeId: UUID;
|
424
|
+
role: TestUserRole;
|
425
|
+
id: string;
|
426
|
+
}>;
|
540
427
|
}): EventDocument;
|
541
|
-
export declare function generateEventDraftDocument(eventId
|
542
|
-
|
428
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
429
|
+
eventId: UUID;
|
430
|
+
actionType: ActionType;
|
431
|
+
rng?: () => number;
|
432
|
+
declaration?: EventState;
|
433
|
+
}): Draft;
|
434
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
435
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
436
|
+
/**
|
437
|
+
* Useful for testing when we need deterministic outcome.
|
438
|
+
* @param seed - Seed value for the pseudo-random number generator
|
439
|
+
*
|
440
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
441
|
+
*/
|
442
|
+
export declare function createPrng(seed: number): () => number;
|
443
|
+
export declare function generateUuid(rng?: () => number): UUID;
|
444
|
+
export declare function generateRegistrationNumber(rng: () => number): string;
|
445
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
446
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
447
|
+
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
448
|
+
export declare const BearerTokenByUserType: {
|
449
|
+
fieldAgent: string;
|
450
|
+
registrationAgent: string;
|
451
|
+
localRegistrar: string;
|
452
|
+
};
|
453
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
543
454
|
//# sourceMappingURL=test.utils.d.ts.map
|