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