@opencrvs/toolkit 1.8.0-rc.f7a451a → 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/dist/commons/api/router.d.ts +14932 -5124
- package/dist/commons/conditionals/conditionals.d.ts +6 -2
- package/dist/commons/conditionals/validate.d.ts +6 -0
- package/dist/commons/events/ActionConfig.d.ts +32976 -12647
- package/dist/commons/events/ActionDocument.d.ts +2005 -309
- package/dist/commons/events/ActionInput.d.ts +1455 -183
- package/dist/commons/events/ActionType.d.ts +6 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +279 -3
- package/dist/commons/events/CompositeFieldValue.d.ts +28 -0
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +314 -254
- package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
- package/dist/commons/events/Draft.d.ts +127 -21
- package/dist/commons/events/EventConfig.d.ts +22415 -12245
- package/dist/commons/events/EventDocument.d.ts +1308 -232
- package/dist/commons/events/EventIndex.d.ts +616 -423
- package/dist/commons/events/EventMetadata.d.ts +104 -81
- package/dist/commons/events/FieldConfig.d.ts +2082 -1191
- package/dist/commons/events/FieldType.d.ts +4 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +94 -52
- package/dist/commons/events/FieldValue.d.ts +43 -5
- package/dist/commons/events/FormConfig.d.ts +10259 -4769
- package/dist/commons/events/PageConfig.d.ts +3480 -2134
- package/dist/commons/events/SummaryConfig.d.ts +0 -5
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +17 -6
- package/dist/commons/events/WorkqueueConfig.d.ts +2589 -1640
- package/dist/commons/events/defineConfig.d.ts +2439 -679
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +10 -10
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/scopes.d.ts +1 -2
- package/dist/commons/events/test.utils.d.ts +158 -40
- package/dist/commons/events/utils.d.ts +10021 -326
- package/dist/conditionals/index.js +26 -6
- package/dist/events/index.js +2401 -1217
- package/dist/scopes/index.d.ts +6 -2
- package/dist/scopes/index.js +70 -17
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
-
import { EventMetadataKeys, EventMetadataParameter } from './EventMetadata';
|
3
2
|
import { SelectOption } from './FieldConfig';
|
3
|
+
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
4
|
/**
|
5
5
|
* Creates a function that acts like a callable + static method container.
|
6
6
|
*
|
@@ -47,7 +47,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
47
47
|
};
|
48
48
|
};
|
49
49
|
declare const event: typeof eventFn & {
|
50
|
-
field(field:
|
50
|
+
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
51
51
|
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
52
52
|
};
|
53
53
|
export { event };
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FieldConditional } from './Conditional';
|
2
2
|
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
import { ValidationConfig } from './FieldConfig';
|
3
4
|
/**
|
4
5
|
* Entry point for defining conditional logic or configuration for a form field.
|
5
6
|
* @param fieldId - The ID of the field to define rules or config for.
|
@@ -7,10 +8,12 @@ import { TranslationConfig } from './TranslationConfig';
|
|
7
8
|
*/
|
8
9
|
export declare function field(fieldId: string, options?: {
|
9
10
|
conditionals?: FieldConditional[];
|
11
|
+
validations?: ValidationConfig[];
|
10
12
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
13
|
}): {
|
12
14
|
range: () => {
|
13
15
|
conditionals?: FieldConditional[];
|
16
|
+
validations?: ValidationConfig[];
|
14
17
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
15
18
|
fieldId: string;
|
16
19
|
fieldType: "field";
|
@@ -21,6 +24,7 @@ export declare function field(fieldId: string, options?: {
|
|
21
24
|
};
|
22
25
|
exact: () => {
|
23
26
|
conditionals?: FieldConditional[];
|
27
|
+
validations?: ValidationConfig[];
|
24
28
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
29
|
fieldId: string;
|
26
30
|
fieldType: "field";
|
@@ -31,6 +35,7 @@ export declare function field(fieldId: string, options?: {
|
|
31
35
|
};
|
32
36
|
fuzzy: () => {
|
33
37
|
conditionals?: FieldConditional[];
|
38
|
+
validations?: ValidationConfig[];
|
34
39
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
35
40
|
fieldId: string;
|
36
41
|
fieldType: "field";
|
@@ -39,14 +44,14 @@ export declare function field(fieldId: string, options?: {
|
|
39
44
|
type: "fuzzy";
|
40
45
|
};
|
41
46
|
};
|
47
|
+
$$field: string;
|
42
48
|
isAfter: () => {
|
43
49
|
days: (days: number) => {
|
44
50
|
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
45
51
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
46
52
|
};
|
47
53
|
date: (date: string | {
|
48
|
-
|
49
|
-
_fieldId: string;
|
54
|
+
$$field: string;
|
50
55
|
}) => import("../conditionals/conditionals").JSONSchema;
|
51
56
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
52
57
|
};
|
@@ -56,14 +61,12 @@ export declare function field(fieldId: string, options?: {
|
|
56
61
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
57
62
|
};
|
58
63
|
date: (date: string | {
|
59
|
-
|
60
|
-
_fieldId: string;
|
64
|
+
$$field: string;
|
61
65
|
}) => import("../conditionals/conditionals").JSONSchema;
|
62
66
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
63
67
|
};
|
64
68
|
isEqualTo: (value: string | boolean | {
|
65
|
-
|
66
|
-
_fieldId: string;
|
69
|
+
$$field: string;
|
67
70
|
}) => import("../conditionals/conditionals").JSONSchema;
|
68
71
|
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
69
72
|
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
@@ -74,9 +77,6 @@ export declare function field(fieldId: string, options?: {
|
|
74
77
|
getId: () => {
|
75
78
|
fieldId: string;
|
76
79
|
};
|
77
|
-
|
78
|
-
* @private Internal property used for field reference tracking.
|
79
|
-
*/
|
80
|
-
_fieldId: string;
|
80
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
81
81
|
};
|
82
82
|
//# sourceMappingURL=field.d.ts.map
|
@@ -1,3 +1,4 @@
|
|
1
|
+
export * from './Constants';
|
1
2
|
export * from './ActionConfig';
|
2
3
|
export * from './offline';
|
3
4
|
export * from './EventConfig';
|
@@ -34,6 +35,7 @@ export * from './test.utils';
|
|
34
35
|
export * from './TemplateConfig';
|
35
36
|
export * from './scopes';
|
36
37
|
export * from './serializer';
|
38
|
+
export * from './state/availableActions';
|
37
39
|
export * from '../conditionals/conditionals';
|
38
40
|
export * from '../conditionals/validate';
|
39
41
|
export * from './field';
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Scope } from '../scopes';
|
2
|
-
import { ActionType } from './ActionType';
|
3
2
|
export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"];
|
4
3
|
export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[];
|
5
4
|
export declare const ACTION_ALLOWED_SCOPES: {
|
@@ -40,6 +39,6 @@ export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
|
40
39
|
UNASSIGN: never[];
|
41
40
|
DETECT_DUPLICATE: never[];
|
42
41
|
};
|
42
|
+
export declare const WRITE_ACTION_SCOPES: ("record.declare-birth" | "record.declaration-submit-for-approval" | "record.register" | "record.registration-print&issue-certified-copies")[];
|
43
43
|
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
44
|
-
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
45
44
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ActionDocument,
|
2
|
-
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, 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';
|
@@ -7,10 +7,27 @@ import { EventDocument } from './EventDocument';
|
|
7
7
|
import { EventIndex } from './EventIndex';
|
8
8
|
import { EventInput } from './EventInput';
|
9
9
|
import { TranslationConfig } from './TranslationConfig';
|
10
|
+
import { FieldConfig } from './FieldConfig';
|
10
11
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
11
|
-
|
12
|
-
|
13
|
-
|
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): {
|
14
31
|
create: (input?: Partial<EventInput>) => {
|
15
32
|
transactionId: string;
|
16
33
|
type: string;
|
@@ -25,8 +42,7 @@ export declare const eventPayloadGenerator: {
|
|
25
42
|
actionType: ActionType;
|
26
43
|
}, input?: Partial<Draft>) => Draft;
|
27
44
|
actions: {
|
28
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
29
|
-
type: "DECLARE";
|
45
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
30
46
|
transactionId: string;
|
31
47
|
declaration: Record<string, string | number | boolean | {
|
32
48
|
type: string;
|
@@ -43,6 +59,10 @@ export declare const eventPayloadGenerator: {
|
|
43
59
|
residentialArea?: string | null | undefined;
|
44
60
|
street?: string | null | undefined;
|
45
61
|
zipCode?: string | null | undefined;
|
62
|
+
} | {
|
63
|
+
firstname: string;
|
64
|
+
surname: string;
|
65
|
+
middlename?: string | null | undefined;
|
46
66
|
} | {
|
47
67
|
country: string;
|
48
68
|
district: string;
|
@@ -65,20 +85,19 @@ export declare const eventPayloadGenerator: {
|
|
65
85
|
option: string;
|
66
86
|
filename: string;
|
67
87
|
originalFilename: string;
|
68
|
-
}[] | [string, string] | undefined>;
|
88
|
+
}[] | [string, string] | null | undefined>;
|
69
89
|
annotation: {};
|
90
|
+
keepAssignment?: boolean | undefined;
|
91
|
+
type: "DECLARE";
|
70
92
|
eventId: string;
|
71
93
|
};
|
72
94
|
/**
|
73
95
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
74
96
|
*/
|
75
|
-
notify: (eventId: string, input?: {
|
76
|
-
transactionId?: string;
|
77
|
-
declaration?: Partial<ActionUpdate>;
|
78
|
-
}) => {
|
97
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
79
98
|
type: "NOTIFY";
|
80
99
|
transactionId: string;
|
81
|
-
declaration:
|
100
|
+
declaration: Record<string, string | number | boolean | {
|
82
101
|
type: string;
|
83
102
|
filename: string;
|
84
103
|
originalFilename: string;
|
@@ -93,6 +112,10 @@ export declare const eventPayloadGenerator: {
|
|
93
112
|
residentialArea?: string | null | undefined;
|
94
113
|
street?: string | null | undefined;
|
95
114
|
zipCode?: string | null | undefined;
|
115
|
+
} | {
|
116
|
+
firstname: string;
|
117
|
+
surname: string;
|
118
|
+
middlename?: string | null | undefined;
|
96
119
|
} | {
|
97
120
|
country: string;
|
98
121
|
district: string;
|
@@ -115,11 +138,11 @@ export declare const eventPayloadGenerator: {
|
|
115
138
|
option: string;
|
116
139
|
filename: string;
|
117
140
|
originalFilename: string;
|
118
|
-
}[] | [string, string] | undefined
|
141
|
+
}[] | [string, string] | null | undefined>;
|
119
142
|
eventId: string;
|
143
|
+
keepAssignment: boolean | undefined;
|
120
144
|
};
|
121
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
122
|
-
type: "VALIDATE";
|
145
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
123
146
|
transactionId: string;
|
124
147
|
declaration: Record<string, string | number | boolean | {
|
125
148
|
type: string;
|
@@ -136,6 +159,10 @@ export declare const eventPayloadGenerator: {
|
|
136
159
|
residentialArea?: string | null | undefined;
|
137
160
|
street?: string | null | undefined;
|
138
161
|
zipCode?: string | null | undefined;
|
162
|
+
} | {
|
163
|
+
firstname: string;
|
164
|
+
surname: string;
|
165
|
+
middlename?: string | null | undefined;
|
139
166
|
} | {
|
140
167
|
country: string;
|
141
168
|
district: string;
|
@@ -158,8 +185,10 @@ export declare const eventPayloadGenerator: {
|
|
158
185
|
option: string;
|
159
186
|
filename: string;
|
160
187
|
originalFilename: string;
|
161
|
-
}[] | [string, string] | undefined>;
|
188
|
+
}[] | [string, string] | null | undefined>;
|
162
189
|
annotation: {};
|
190
|
+
keepAssignment?: boolean | undefined;
|
191
|
+
type: "VALIDATE";
|
163
192
|
duplicates: never[];
|
164
193
|
eventId: string;
|
165
194
|
};
|
@@ -177,26 +206,73 @@ export declare const eventPayloadGenerator: {
|
|
177
206
|
assignedTo: null;
|
178
207
|
eventId: string;
|
179
208
|
};
|
180
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
181
|
-
type: "ARCHIVE";
|
209
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
182
210
|
transactionId: string;
|
183
|
-
declaration: {
|
184
|
-
|
185
|
-
|
186
|
-
|
211
|
+
declaration: Record<string, string | number | boolean | {
|
212
|
+
type: string;
|
213
|
+
filename: string;
|
214
|
+
originalFilename: string;
|
215
|
+
} | {
|
216
|
+
country: string;
|
217
|
+
district: string;
|
218
|
+
addressType: "DOMESTIC";
|
219
|
+
province: string;
|
220
|
+
urbanOrRural: "URBAN";
|
221
|
+
number?: string | null | undefined;
|
222
|
+
town?: string | null | undefined;
|
223
|
+
residentialArea?: string | null | undefined;
|
224
|
+
street?: string | null | undefined;
|
225
|
+
zipCode?: string | null | undefined;
|
226
|
+
} | {
|
227
|
+
firstname: string;
|
228
|
+
surname: string;
|
229
|
+
middlename?: string | null | undefined;
|
230
|
+
} | {
|
231
|
+
country: string;
|
232
|
+
district: string;
|
233
|
+
addressType: "DOMESTIC";
|
234
|
+
province: string;
|
235
|
+
urbanOrRural: "RURAL";
|
236
|
+
village?: string | null | undefined;
|
237
|
+
} | {
|
238
|
+
country: string;
|
239
|
+
state: string;
|
240
|
+
addressType: "INTERNATIONAL";
|
241
|
+
district2: string;
|
242
|
+
cityOrTown?: string | null | undefined;
|
243
|
+
addressLine1?: string | null | undefined;
|
244
|
+
addressLine2?: string | null | undefined;
|
245
|
+
addressLine3?: string | null | undefined;
|
246
|
+
postcodeOrZip?: string | null | undefined;
|
247
|
+
} | {
|
248
|
+
type: string;
|
249
|
+
option: string;
|
250
|
+
filename: string;
|
251
|
+
originalFilename: string;
|
252
|
+
}[] | [string, string] | null | undefined>;
|
253
|
+
keepAssignment?: boolean | undefined;
|
254
|
+
type: "ARCHIVE";
|
255
|
+
annotation: {};
|
187
256
|
duplicates: never[];
|
188
257
|
eventId: string;
|
258
|
+
reason: {
|
259
|
+
message: string;
|
260
|
+
isDuplicate: boolean;
|
261
|
+
};
|
189
262
|
};
|
190
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
191
|
-
type: "REJECT";
|
263
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
192
264
|
transactionId: string;
|
193
|
-
declaration: {};
|
194
265
|
annotation: {};
|
266
|
+
keepAssignment?: boolean | undefined;
|
267
|
+
type: "REJECT";
|
268
|
+
declaration: {};
|
195
269
|
duplicates: never[];
|
196
270
|
eventId: string;
|
271
|
+
reason: {
|
272
|
+
message: string;
|
273
|
+
};
|
197
274
|
};
|
198
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
199
|
-
type: "REGISTER";
|
275
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
200
276
|
transactionId: string;
|
201
277
|
declaration: Record<string, string | number | boolean | {
|
202
278
|
type: string;
|
@@ -213,6 +289,10 @@ export declare const eventPayloadGenerator: {
|
|
213
289
|
residentialArea?: string | null | undefined;
|
214
290
|
street?: string | null | undefined;
|
215
291
|
zipCode?: string | null | undefined;
|
292
|
+
} | {
|
293
|
+
firstname: string;
|
294
|
+
surname: string;
|
295
|
+
middlename?: string | null | undefined;
|
216
296
|
} | {
|
217
297
|
country: string;
|
218
298
|
district: string;
|
@@ -235,19 +315,22 @@ export declare const eventPayloadGenerator: {
|
|
235
315
|
option: string;
|
236
316
|
filename: string;
|
237
317
|
originalFilename: string;
|
238
|
-
}[] | [string, string] | undefined>;
|
318
|
+
}[] | [string, string] | null | undefined>;
|
239
319
|
annotation: {};
|
320
|
+
keepAssignment?: boolean | undefined;
|
321
|
+
type: "REGISTER";
|
240
322
|
eventId: string;
|
241
323
|
};
|
242
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
243
|
-
type: "PRINT_CERTIFICATE";
|
324
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
244
325
|
transactionId: string;
|
245
|
-
declaration: {};
|
246
326
|
annotation: {};
|
327
|
+
keepAssignment?: boolean | undefined;
|
328
|
+
type: "PRINT_CERTIFICATE";
|
329
|
+
declaration: {};
|
247
330
|
eventId: string;
|
248
331
|
};
|
249
332
|
correction: {
|
250
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
333
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
251
334
|
type: "REQUEST_CORRECTION";
|
252
335
|
transactionId: string;
|
253
336
|
declaration: Record<string, string | number | boolean | {
|
@@ -265,6 +348,10 @@ export declare const eventPayloadGenerator: {
|
|
265
348
|
residentialArea?: string | null | undefined;
|
266
349
|
street?: string | null | undefined;
|
267
350
|
zipCode?: string | null | undefined;
|
351
|
+
} | {
|
352
|
+
firstname: string;
|
353
|
+
surname: string;
|
354
|
+
middlename?: string | null | undefined;
|
268
355
|
} | {
|
269
356
|
country: string;
|
270
357
|
district: string;
|
@@ -287,40 +374,71 @@ export declare const eventPayloadGenerator: {
|
|
287
374
|
option: string;
|
288
375
|
filename: string;
|
289
376
|
originalFilename: string;
|
290
|
-
}[] | [string, string] | undefined>;
|
377
|
+
}[] | [string, string] | null | undefined>;
|
291
378
|
annotation: {};
|
292
379
|
eventId: string;
|
380
|
+
keepAssignment: boolean | undefined;
|
293
381
|
};
|
294
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
382
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
295
383
|
type: "APPROVE_CORRECTION";
|
296
384
|
transactionId: string;
|
297
385
|
declaration: {};
|
298
386
|
annotation: {};
|
299
387
|
eventId: string;
|
300
388
|
requestId: string;
|
389
|
+
keepAssignment: boolean | undefined;
|
301
390
|
};
|
302
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
391
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
303
392
|
type: "REJECT_CORRECTION";
|
304
393
|
transactionId: string;
|
305
394
|
declaration: {};
|
306
395
|
annotation: {};
|
307
396
|
eventId: string;
|
308
397
|
requestId: string;
|
398
|
+
keepAssignment: boolean | undefined;
|
309
399
|
};
|
310
400
|
};
|
311
401
|
};
|
312
402
|
};
|
313
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
403
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
314
404
|
configuration: EventConfig;
|
315
405
|
action: ActionType;
|
406
|
+
rng?: () => number;
|
316
407
|
defaults?: Partial<ActionDocument>;
|
408
|
+
user?: Partial<{
|
409
|
+
signature: string;
|
410
|
+
primaryOfficeId: string;
|
411
|
+
role: TestUserRole;
|
412
|
+
id: string;
|
413
|
+
}>;
|
317
414
|
}): ActionDocument;
|
318
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
415
|
+
export declare function generateEventDocument({ configuration, actions, rng }: {
|
319
416
|
configuration: EventConfig;
|
320
417
|
actions: ActionType[];
|
418
|
+
rng?: () => number;
|
321
419
|
}): EventDocument;
|
322
|
-
export declare function generateEventDraftDocument(eventId
|
323
|
-
|
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;
|
324
437
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
438
|
+
export declare const BearerTokenByUserType: {
|
439
|
+
fieldAgent: string;
|
440
|
+
registrationAgent: string;
|
441
|
+
localRegistrar: string;
|
442
|
+
};
|
325
443
|
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
326
444
|
//# sourceMappingURL=test.utils.d.ts.map
|