@ecrvs/opencrvs-toolkit 1.8.1-rc.11dbd54
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 +70 -0
- package/build.sh +56 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +52 -0
- package/dist/commons/api/router.d.ts +14568 -0
- package/dist/commons/conditionals/abbreviation.d.ts +5 -0
- package/dist/commons/conditionals/conditionals.d.ts +200 -0
- package/dist/commons/conditionals/ill-defined.d.ts +2 -0
- package/dist/commons/conditionals/index.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +129 -0
- package/dist/commons/events/ActionConfig.d.ts +2034 -0
- package/dist/commons/events/ActionDocument.d.ts +14400 -0
- package/dist/commons/events/ActionInput.d.ts +11157 -0
- package/dist/commons/events/ActionType.d.ts +52 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1175 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +181 -0
- package/dist/commons/events/Conditional.d.ts +55 -0
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4494 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +209 -0
- package/dist/commons/events/Draft.d.ts +814 -0
- package/dist/commons/events/EventConfig.d.ts +2237 -0
- package/dist/commons/events/EventConfigInput.d.ts +10 -0
- package/dist/commons/events/EventDocument.d.ts +8505 -0
- package/dist/commons/events/EventIndex.d.ts +3858 -0
- package/dist/commons/events/EventInput.d.ts +13 -0
- package/dist/commons/events/EventMetadata.d.ts +408 -0
- package/dist/commons/events/FieldConfig.d.ts +7125 -0
- package/dist/commons/events/FieldType.d.ts +46 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +537 -0
- package/dist/commons/events/FieldValue.d.ts +250 -0
- package/dist/commons/events/FileUtils.d.ts +4 -0
- package/dist/commons/events/FormConfig.d.ts +725 -0
- package/dist/commons/events/PageConfig.d.ts +336 -0
- package/dist/commons/events/SummaryConfig.d.ts +170 -0
- package/dist/commons/events/TemplateConfig.d.ts +38 -0
- package/dist/commons/events/TranslationConfig.d.ts +15 -0
- package/dist/commons/events/User.d.ts +45 -0
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +8997 -0
- package/dist/commons/events/deduplication.d.ts +32 -0
- package/dist/commons/events/defineConfig.d.ts +309 -0
- package/dist/commons/events/event.d.ts +109 -0
- package/dist/commons/events/field.d.ts +169 -0
- package/dist/commons/events/index.d.ts +46 -0
- package/dist/commons/events/locations.d.ts +24 -0
- package/dist/commons/events/scopes.d.ts +55 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/state/availableActions.d.ts +6 -0
- package/dist/commons/events/state/flags.d.ts +4 -0
- package/dist/commons/events/state/index.d.ts +146 -0
- package/dist/commons/events/state/utils.d.ts +1263 -0
- package/dist/commons/events/test.utils.d.ts +473 -0
- package/dist/commons/events/transactions.d.ts +2 -0
- package/dist/commons/events/utils.d.ts +501 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/commons/notification/UserNotifications.d.ts +632 -0
- package/dist/commons/notification/index.d.ts +2 -0
- package/dist/conditionals/index.d.ts +2 -0
- package/dist/conditionals/index.d.ts.map +1 -0
- package/dist/conditionals/index.js +538 -0
- package/dist/events/deduplication.d.ts +32 -0
- package/dist/events/deduplication.d.ts.map +1 -0
- package/dist/events/deduplication.js +67 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +9755 -0
- package/dist/notification/index.d.ts +2 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/index.js +7300 -0
- package/dist/scopes/index.d.ts +335 -0
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/scopes/index.js +379 -0
- package/package.json +40 -0
- package/tsconfig.json +27 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { UUID } from '../uuid';
|
|
2
|
+
import { ActionDocument, EventState } from './ActionDocument';
|
|
3
|
+
import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
|
4
|
+
import { ActionType } from './ActionType';
|
|
5
|
+
import { Draft } from './Draft';
|
|
6
|
+
import { EventConfig } from './EventConfig';
|
|
7
|
+
import { EventDocument } from './EventDocument';
|
|
8
|
+
import { EventIndex } from './EventIndex';
|
|
9
|
+
import { EventInput } from './EventInput';
|
|
10
|
+
import { TranslationConfig } from './TranslationConfig';
|
|
11
|
+
import { FieldConfig } from './FieldConfig';
|
|
12
|
+
import { WorkqueueConfig } from './WorkqueueConfig';
|
|
13
|
+
import { FieldValue } from './FieldValue';
|
|
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
|
+
export declare function generateUuid(rng?: () => number): UUID;
|
|
31
|
+
export declare function generateTrackingId(rng: () => number): string;
|
|
32
|
+
export declare function generateRegistrationNumber(rng: () => number): string;
|
|
33
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
|
34
|
+
/**
|
|
35
|
+
* Quick-and-dirty mock data generator for event actions.
|
|
36
|
+
*/
|
|
37
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
|
|
38
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: Partial<EventState>): EventState;
|
|
39
|
+
export declare function generateActionDuplicateDeclarationInput(...args: Parameters<typeof generateActionDeclarationInput>): ReturnType<typeof generateActionDeclarationInput>;
|
|
40
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
|
|
41
|
+
export declare function eventPayloadGenerator(rng: () => number, configuration?: EventConfig): {
|
|
42
|
+
create: (input?: Partial<EventInput>) => {
|
|
43
|
+
transactionId: string;
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
patch: (id: string, input?: Partial<EventInput>) => {
|
|
47
|
+
transactionId: string;
|
|
48
|
+
type: string;
|
|
49
|
+
id: string;
|
|
50
|
+
};
|
|
51
|
+
draft: ({ eventId, actionType, annotation, omitFields }: {
|
|
52
|
+
eventId: UUID;
|
|
53
|
+
actionType: Draft["action"]["type"];
|
|
54
|
+
annotation?: Record<string, any>;
|
|
55
|
+
omitFields?: string[];
|
|
56
|
+
}, input?: Partial<Draft>) => Draft;
|
|
57
|
+
actions: {
|
|
58
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
|
59
|
+
transactionId: string;
|
|
60
|
+
declaration: Record<string, string | number | boolean | {
|
|
61
|
+
type: string;
|
|
62
|
+
path: string;
|
|
63
|
+
originalFilename: string;
|
|
64
|
+
} | {
|
|
65
|
+
firstname: string;
|
|
66
|
+
surname: string;
|
|
67
|
+
middlename?: string | null | undefined;
|
|
68
|
+
} | Record<string, string> | {
|
|
69
|
+
country: string;
|
|
70
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
71
|
+
administrativeArea?: string | null | undefined;
|
|
72
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
73
|
+
} | {
|
|
74
|
+
type: string;
|
|
75
|
+
option: string;
|
|
76
|
+
path: string;
|
|
77
|
+
originalFilename: string;
|
|
78
|
+
}[] | {
|
|
79
|
+
data?: any;
|
|
80
|
+
error?: {
|
|
81
|
+
message: string;
|
|
82
|
+
statusCode: number;
|
|
83
|
+
} | null | undefined;
|
|
84
|
+
loading?: boolean | null | undefined;
|
|
85
|
+
} | {
|
|
86
|
+
start: string;
|
|
87
|
+
end: string;
|
|
88
|
+
} | null | undefined>;
|
|
89
|
+
annotation: {};
|
|
90
|
+
keepAssignment?: boolean | undefined;
|
|
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";
|
|
99
|
+
transactionId: string;
|
|
100
|
+
declaration: Record<string, string | number | boolean | {
|
|
101
|
+
type: string;
|
|
102
|
+
path: string;
|
|
103
|
+
originalFilename: string;
|
|
104
|
+
} | {
|
|
105
|
+
firstname: string;
|
|
106
|
+
surname: string;
|
|
107
|
+
middlename?: string | null | undefined;
|
|
108
|
+
} | Record<string, string> | {
|
|
109
|
+
country: string;
|
|
110
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
111
|
+
administrativeArea?: string | null | undefined;
|
|
112
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
113
|
+
} | {
|
|
114
|
+
type: string;
|
|
115
|
+
option: string;
|
|
116
|
+
path: string;
|
|
117
|
+
originalFilename: string;
|
|
118
|
+
}[] | {
|
|
119
|
+
data?: any;
|
|
120
|
+
error?: {
|
|
121
|
+
message: string;
|
|
122
|
+
statusCode: number;
|
|
123
|
+
} | null | undefined;
|
|
124
|
+
loading?: boolean | null | undefined;
|
|
125
|
+
} | {
|
|
126
|
+
start: string;
|
|
127
|
+
end: string;
|
|
128
|
+
} | null | undefined>;
|
|
129
|
+
eventId: string;
|
|
130
|
+
keepAssignment: boolean | undefined;
|
|
131
|
+
};
|
|
132
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
|
133
|
+
transactionId: string;
|
|
134
|
+
declaration: Record<string, string | number | boolean | {
|
|
135
|
+
type: string;
|
|
136
|
+
path: string;
|
|
137
|
+
originalFilename: string;
|
|
138
|
+
} | {
|
|
139
|
+
firstname: string;
|
|
140
|
+
surname: string;
|
|
141
|
+
middlename?: string | null | undefined;
|
|
142
|
+
} | Record<string, string> | {
|
|
143
|
+
country: string;
|
|
144
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
145
|
+
administrativeArea?: string | null | undefined;
|
|
146
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
147
|
+
} | {
|
|
148
|
+
type: string;
|
|
149
|
+
option: string;
|
|
150
|
+
path: string;
|
|
151
|
+
originalFilename: string;
|
|
152
|
+
}[] | {
|
|
153
|
+
data?: any;
|
|
154
|
+
error?: {
|
|
155
|
+
message: string;
|
|
156
|
+
statusCode: number;
|
|
157
|
+
} | null | undefined;
|
|
158
|
+
loading?: boolean | null | undefined;
|
|
159
|
+
} | {
|
|
160
|
+
start: string;
|
|
161
|
+
end: string;
|
|
162
|
+
} | null | undefined>;
|
|
163
|
+
annotation: {};
|
|
164
|
+
keepAssignment?: boolean | undefined;
|
|
165
|
+
type: "VALIDATE";
|
|
166
|
+
duplicates: never[];
|
|
167
|
+
eventId: string;
|
|
168
|
+
};
|
|
169
|
+
assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
|
|
170
|
+
type: "ASSIGN";
|
|
171
|
+
transactionId: string;
|
|
172
|
+
declaration: {};
|
|
173
|
+
assignedTo: string;
|
|
174
|
+
eventId: string;
|
|
175
|
+
};
|
|
176
|
+
unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
|
|
177
|
+
type: "UNASSIGN";
|
|
178
|
+
transactionId: string;
|
|
179
|
+
declaration: {};
|
|
180
|
+
assignedTo: null;
|
|
181
|
+
eventId: string;
|
|
182
|
+
};
|
|
183
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
|
184
|
+
transactionId: string;
|
|
185
|
+
declaration: Record<string, string | number | boolean | {
|
|
186
|
+
type: string;
|
|
187
|
+
path: string;
|
|
188
|
+
originalFilename: string;
|
|
189
|
+
} | {
|
|
190
|
+
firstname: string;
|
|
191
|
+
surname: string;
|
|
192
|
+
middlename?: string | null | undefined;
|
|
193
|
+
} | Record<string, string> | {
|
|
194
|
+
country: string;
|
|
195
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
196
|
+
administrativeArea?: string | null | undefined;
|
|
197
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
198
|
+
} | {
|
|
199
|
+
type: string;
|
|
200
|
+
option: string;
|
|
201
|
+
path: string;
|
|
202
|
+
originalFilename: string;
|
|
203
|
+
}[] | {
|
|
204
|
+
data?: any;
|
|
205
|
+
error?: {
|
|
206
|
+
message: string;
|
|
207
|
+
statusCode: number;
|
|
208
|
+
} | null | undefined;
|
|
209
|
+
loading?: boolean | null | undefined;
|
|
210
|
+
} | {
|
|
211
|
+
start: string;
|
|
212
|
+
end: string;
|
|
213
|
+
} | null | undefined>;
|
|
214
|
+
keepAssignment?: boolean | undefined;
|
|
215
|
+
type: "ARCHIVE";
|
|
216
|
+
annotation: {};
|
|
217
|
+
duplicates: never[];
|
|
218
|
+
eventId: string;
|
|
219
|
+
content: {
|
|
220
|
+
reason: string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
|
224
|
+
transactionId: string;
|
|
225
|
+
annotation: {};
|
|
226
|
+
keepAssignment?: boolean | undefined;
|
|
227
|
+
type: "REJECT";
|
|
228
|
+
declaration: {};
|
|
229
|
+
duplicates: never[];
|
|
230
|
+
eventId: string;
|
|
231
|
+
content: {
|
|
232
|
+
reason: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
|
236
|
+
transactionId: string;
|
|
237
|
+
declaration: Record<string, string | number | boolean | {
|
|
238
|
+
type: string;
|
|
239
|
+
path: string;
|
|
240
|
+
originalFilename: string;
|
|
241
|
+
} | {
|
|
242
|
+
firstname: string;
|
|
243
|
+
surname: string;
|
|
244
|
+
middlename?: string | null | undefined;
|
|
245
|
+
} | Record<string, string> | {
|
|
246
|
+
country: string;
|
|
247
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
248
|
+
administrativeArea?: string | null | undefined;
|
|
249
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
250
|
+
} | {
|
|
251
|
+
type: string;
|
|
252
|
+
option: string;
|
|
253
|
+
path: string;
|
|
254
|
+
originalFilename: string;
|
|
255
|
+
}[] | {
|
|
256
|
+
data?: any;
|
|
257
|
+
error?: {
|
|
258
|
+
message: string;
|
|
259
|
+
statusCode: number;
|
|
260
|
+
} | null | undefined;
|
|
261
|
+
loading?: boolean | null | undefined;
|
|
262
|
+
} | {
|
|
263
|
+
start: string;
|
|
264
|
+
end: string;
|
|
265
|
+
} | null | undefined>;
|
|
266
|
+
annotation: {};
|
|
267
|
+
registrationNumber?: string | undefined;
|
|
268
|
+
keepAssignment?: boolean | undefined;
|
|
269
|
+
type: "REGISTER";
|
|
270
|
+
eventId: string;
|
|
271
|
+
};
|
|
272
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
|
273
|
+
transactionId: string;
|
|
274
|
+
annotation: {};
|
|
275
|
+
keepAssignment?: boolean | undefined;
|
|
276
|
+
type: "PRINT_CERTIFICATE";
|
|
277
|
+
declaration: {};
|
|
278
|
+
eventId: string;
|
|
279
|
+
};
|
|
280
|
+
correction: {
|
|
281
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
|
282
|
+
type: "REQUEST_CORRECTION";
|
|
283
|
+
transactionId: string;
|
|
284
|
+
declaration: Record<string, string | number | boolean | {
|
|
285
|
+
type: string;
|
|
286
|
+
path: string;
|
|
287
|
+
originalFilename: string;
|
|
288
|
+
} | {
|
|
289
|
+
firstname: string;
|
|
290
|
+
surname: string;
|
|
291
|
+
middlename?: string | null | undefined;
|
|
292
|
+
} | Record<string, string> | {
|
|
293
|
+
country: string;
|
|
294
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
295
|
+
administrativeArea?: string | null | undefined;
|
|
296
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
297
|
+
} | {
|
|
298
|
+
type: string;
|
|
299
|
+
option: string;
|
|
300
|
+
path: string;
|
|
301
|
+
originalFilename: string;
|
|
302
|
+
}[] | {
|
|
303
|
+
data?: any;
|
|
304
|
+
error?: {
|
|
305
|
+
message: string;
|
|
306
|
+
statusCode: number;
|
|
307
|
+
} | null | undefined;
|
|
308
|
+
loading?: boolean | null | undefined;
|
|
309
|
+
} | {
|
|
310
|
+
start: string;
|
|
311
|
+
end: string;
|
|
312
|
+
} | null | undefined>;
|
|
313
|
+
annotation: {};
|
|
314
|
+
eventId: string;
|
|
315
|
+
keepAssignment: boolean | undefined;
|
|
316
|
+
};
|
|
317
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
|
318
|
+
type: "APPROVE_CORRECTION";
|
|
319
|
+
transactionId: string;
|
|
320
|
+
declaration: {};
|
|
321
|
+
annotation: {};
|
|
322
|
+
eventId: string;
|
|
323
|
+
requestId: string;
|
|
324
|
+
keepAssignment: boolean | undefined;
|
|
325
|
+
};
|
|
326
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "content">>) => {
|
|
327
|
+
type: "REJECT_CORRECTION";
|
|
328
|
+
transactionId: string;
|
|
329
|
+
declaration: {};
|
|
330
|
+
annotation: {};
|
|
331
|
+
eventId: string;
|
|
332
|
+
requestId: string;
|
|
333
|
+
keepAssignment: boolean | undefined;
|
|
334
|
+
content: {
|
|
335
|
+
reason: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
duplicate: {
|
|
340
|
+
markAsDuplicate: (eventId: string, input?: Partial<Pick<MarkAsDuplicateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
|
341
|
+
type: "MARK_AS_DUPLICATE";
|
|
342
|
+
transactionId: string;
|
|
343
|
+
declaration: Record<string, string | number | boolean | {
|
|
344
|
+
type: string;
|
|
345
|
+
path: string;
|
|
346
|
+
originalFilename: string;
|
|
347
|
+
} | {
|
|
348
|
+
firstname: string;
|
|
349
|
+
surname: string;
|
|
350
|
+
middlename?: string | null | undefined;
|
|
351
|
+
} | Record<string, string> | {
|
|
352
|
+
country: string;
|
|
353
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
354
|
+
administrativeArea?: string | null | undefined;
|
|
355
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
356
|
+
} | {
|
|
357
|
+
type: string;
|
|
358
|
+
option: string;
|
|
359
|
+
path: string;
|
|
360
|
+
originalFilename: string;
|
|
361
|
+
}[] | {
|
|
362
|
+
data?: any;
|
|
363
|
+
error?: {
|
|
364
|
+
message: string;
|
|
365
|
+
statusCode: number;
|
|
366
|
+
} | null | undefined;
|
|
367
|
+
loading?: boolean | null | undefined;
|
|
368
|
+
} | {
|
|
369
|
+
start: string;
|
|
370
|
+
end: string;
|
|
371
|
+
} | null | undefined>;
|
|
372
|
+
annotation: {};
|
|
373
|
+
eventId: string;
|
|
374
|
+
keepAssignment: boolean | undefined;
|
|
375
|
+
};
|
|
376
|
+
markNotDuplicate: (eventId: string, input?: Partial<Pick<MarkNotDuplicateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
|
377
|
+
type: "MARK_AS_NOT_DUPLICATE";
|
|
378
|
+
transactionId: string;
|
|
379
|
+
declaration: Record<string, string | number | boolean | {
|
|
380
|
+
type: string;
|
|
381
|
+
path: string;
|
|
382
|
+
originalFilename: string;
|
|
383
|
+
} | {
|
|
384
|
+
firstname: string;
|
|
385
|
+
surname: string;
|
|
386
|
+
middlename?: string | null | undefined;
|
|
387
|
+
} | Record<string, string> | {
|
|
388
|
+
country: string;
|
|
389
|
+
addressType: "DOMESTIC" | "INTERNATIONAL";
|
|
390
|
+
administrativeArea?: string | null | undefined;
|
|
391
|
+
streetLevelDetails?: Record<string, string> | null | undefined;
|
|
392
|
+
} | {
|
|
393
|
+
type: string;
|
|
394
|
+
option: string;
|
|
395
|
+
path: string;
|
|
396
|
+
originalFilename: string;
|
|
397
|
+
}[] | {
|
|
398
|
+
data?: any;
|
|
399
|
+
error?: {
|
|
400
|
+
message: string;
|
|
401
|
+
statusCode: number;
|
|
402
|
+
} | null | undefined;
|
|
403
|
+
loading?: boolean | null | undefined;
|
|
404
|
+
} | {
|
|
405
|
+
start: string;
|
|
406
|
+
end: string;
|
|
407
|
+
} | null | undefined>;
|
|
408
|
+
annotation: {};
|
|
409
|
+
eventId: string;
|
|
410
|
+
keepAssignment: boolean | undefined;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
export declare function generateActionDocument<T extends ActionType>({ configuration, action, rng, defaults, declarationOverrides }: {
|
|
416
|
+
configuration: EventConfig;
|
|
417
|
+
action: T;
|
|
418
|
+
rng?: () => number;
|
|
419
|
+
defaults?: Partial<Extract<ActionDocument, {
|
|
420
|
+
type: T;
|
|
421
|
+
}>>;
|
|
422
|
+
declarationOverrides?: Partial<EventState>;
|
|
423
|
+
}): ActionDocument;
|
|
424
|
+
export declare function generateEventDocument({ configuration, actions, rng, user, declarationOverrides }: {
|
|
425
|
+
configuration: EventConfig;
|
|
426
|
+
actions: ActionType[];
|
|
427
|
+
rng?: () => number;
|
|
428
|
+
user?: Partial<{
|
|
429
|
+
signature: string;
|
|
430
|
+
primaryOfficeId: UUID;
|
|
431
|
+
role: TestUserRole;
|
|
432
|
+
id: string;
|
|
433
|
+
}>;
|
|
434
|
+
/**
|
|
435
|
+
* Overrides for default event state
|
|
436
|
+
*/
|
|
437
|
+
declarationOverrides?: Partial<EventState>;
|
|
438
|
+
}): EventDocument;
|
|
439
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
|
440
|
+
eventId: UUID;
|
|
441
|
+
actionType: ActionType;
|
|
442
|
+
rng?: () => number;
|
|
443
|
+
declaration?: EventState;
|
|
444
|
+
annotation?: EventState;
|
|
445
|
+
}): Draft;
|
|
446
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
|
447
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
|
448
|
+
/**
|
|
449
|
+
* Useful for testing when we need deterministic outcome.
|
|
450
|
+
* @param seed - Seed value for the pseudo-random number generator
|
|
451
|
+
*
|
|
452
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
|
453
|
+
*/
|
|
454
|
+
export declare function createPrng(seed: number): () => number;
|
|
455
|
+
/**
|
|
456
|
+
* @param overrides - Partial EventIndex object to override the default values.
|
|
457
|
+
* @param seed - Seed value for the pseudo-random number generator.
|
|
458
|
+
* @returns A mock EventIndex object with default values for tennis club
|
|
459
|
+
* membership events.
|
|
460
|
+
*
|
|
461
|
+
* N.B. Unless a different seed is provided, the generated values will be
|
|
462
|
+
* consistent across calls.
|
|
463
|
+
*
|
|
464
|
+
*/
|
|
465
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
|
466
|
+
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
|
467
|
+
export declare const BearerTokenByUserType: {
|
|
468
|
+
fieldAgent: string;
|
|
469
|
+
registrationAgent: string;
|
|
470
|
+
localRegistrar: string;
|
|
471
|
+
};
|
|
472
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
|
473
|
+
//# sourceMappingURL=test.utils.d.ts.map
|