@opencrvs/toolkit 1.8.0-rc.fea3888 → 1.8.0-rc.fec1d5d
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 +15788 -4866
- package/dist/commons/conditionals/conditionals.d.ts +8 -3
- package/dist/commons/conditionals/validate.d.ts +6 -0
- package/dist/commons/events/ActionConfig.d.ts +72517 -38926
- package/dist/commons/events/ActionDocument.d.ts +2095 -484
- package/dist/commons/events/ActionInput.d.ts +1515 -243
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +709 -48
- 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 +2982 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
- package/dist/commons/events/Draft.d.ts +129 -30
- package/dist/commons/events/EventConfig.d.ts +28812 -12195
- package/dist/commons/events/EventDocument.d.ts +1269 -357
- package/dist/commons/events/EventIndex.d.ts +980 -316
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +290 -44
- package/dist/commons/events/FieldConfig.d.ts +2954 -1142
- package/dist/commons/events/FieldType.d.ts +6 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
- package/dist/commons/events/FieldValue.d.ts +48 -7
- package/dist/commons/events/FormConfig.d.ts +20532 -9126
- package/dist/commons/events/PageConfig.d.ts +4906 -2112
- package/dist/commons/events/SummaryConfig.d.ts +17 -5
- package/dist/commons/events/User.d.ts +31 -7
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +4784 -16
- package/dist/commons/events/defineConfig.d.ts +3197 -626
- package/dist/commons/events/event.d.ts +37 -8
- package/dist/commons/events/field.d.ts +29 -20
- package/dist/commons/events/index.d.ts +4 -0
- package/dist/commons/events/scopes.d.ts +20 -1
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +147 -41
- package/dist/commons/events/utils.d.ts +10707 -318
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +45 -8
- package/dist/events/index.js +3408 -1469
- package/dist/scopes/index.d.ts +158 -1
- package/dist/scopes/index.js +152 -1
- package/package.json +1 -1
@@ -1,5 +1,6 @@
|
|
1
1
|
import { EventFieldId } from './AdvancedSearchConfig';
|
2
2
|
import { SelectOption } from './FieldConfig';
|
3
|
+
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
3
4
|
/**
|
4
5
|
* Creates a function that acts like a callable + static method container.
|
5
6
|
*
|
@@ -8,17 +9,45 @@ import { SelectOption } from './FieldConfig';
|
|
8
9
|
* event.hasAction('CLICKED') // → returns conditional
|
9
10
|
*/
|
10
11
|
declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
range: () => {
|
13
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
|
14
|
+
options: {
|
15
|
+
value: string;
|
16
|
+
label: import("./TranslationConfig").TranslationConfig;
|
17
|
+
}[] | undefined;
|
18
|
+
fieldType: "event";
|
19
|
+
} & {
|
20
|
+
config: {
|
21
|
+
type: "range";
|
22
|
+
};
|
23
|
+
};
|
24
|
+
exact: () => {
|
25
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
|
26
|
+
options: {
|
27
|
+
value: string;
|
28
|
+
label: import("./TranslationConfig").TranslationConfig;
|
29
|
+
}[] | undefined;
|
30
|
+
fieldType: "event";
|
31
|
+
} & {
|
32
|
+
config: {
|
33
|
+
type: "exact";
|
34
|
+
};
|
35
|
+
};
|
36
|
+
fuzzy: () => {
|
37
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
|
38
|
+
options: {
|
39
|
+
value: string;
|
40
|
+
label: import("./TranslationConfig").TranslationConfig;
|
41
|
+
}[] | undefined;
|
42
|
+
fieldType: "event";
|
43
|
+
} & {
|
44
|
+
config: {
|
45
|
+
type: "fuzzy";
|
46
|
+
};
|
18
47
|
};
|
19
|
-
fieldType: "event";
|
20
48
|
};
|
21
49
|
declare const event: typeof eventFn & {
|
50
|
+
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
22
51
|
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
23
52
|
};
|
24
53
|
export { event };
|
@@ -1,38 +1,52 @@
|
|
1
|
+
import { FieldConditional } from './Conditional';
|
2
|
+
import { TranslationConfig } from './TranslationConfig';
|
1
3
|
/**
|
2
4
|
* Entry point for defining conditional logic or configuration for a form field.
|
3
5
|
* @param fieldId - The ID of the field to define rules or config for.
|
4
6
|
* @returns An object combining conditional methods and configuration builders.
|
5
7
|
*/
|
6
|
-
export declare function field(fieldId: string
|
8
|
+
export declare function field(fieldId: string, options?: {
|
9
|
+
conditionals?: FieldConditional[];
|
10
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
|
+
}): {
|
7
12
|
range: () => {
|
8
|
-
|
9
|
-
|
10
|
-
};
|
13
|
+
conditionals?: FieldConditional[];
|
14
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
15
|
fieldId: string;
|
12
16
|
fieldType: "field";
|
13
|
-
}
|
14
|
-
exact: () => {
|
17
|
+
} & {
|
15
18
|
config: {
|
16
|
-
type: "
|
19
|
+
type: "range";
|
17
20
|
};
|
21
|
+
};
|
22
|
+
exact: () => {
|
23
|
+
conditionals?: FieldConditional[];
|
24
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
18
25
|
fieldId: string;
|
19
26
|
fieldType: "field";
|
20
|
-
}
|
21
|
-
fuzzy: () => {
|
27
|
+
} & {
|
22
28
|
config: {
|
23
|
-
type: "
|
29
|
+
type: "exact";
|
24
30
|
};
|
31
|
+
};
|
32
|
+
fuzzy: () => {
|
33
|
+
conditionals?: FieldConditional[];
|
34
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
35
|
fieldId: string;
|
26
36
|
fieldType: "field";
|
37
|
+
} & {
|
38
|
+
config: {
|
39
|
+
type: "fuzzy";
|
40
|
+
};
|
27
41
|
};
|
42
|
+
$$field: string;
|
28
43
|
isAfter: () => {
|
29
44
|
days: (days: number) => {
|
30
45
|
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
31
46
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
32
47
|
};
|
33
48
|
date: (date: string | {
|
34
|
-
|
35
|
-
_fieldId: string;
|
49
|
+
$$field: string;
|
36
50
|
}) => import("../conditionals/conditionals").JSONSchema;
|
37
51
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
38
52
|
};
|
@@ -42,14 +56,12 @@ export declare function field(fieldId: string): {
|
|
42
56
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
43
57
|
};
|
44
58
|
date: (date: string | {
|
45
|
-
|
46
|
-
_fieldId: string;
|
59
|
+
$$field: string;
|
47
60
|
}) => import("../conditionals/conditionals").JSONSchema;
|
48
61
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
49
62
|
};
|
50
63
|
isEqualTo: (value: string | boolean | {
|
51
|
-
|
52
|
-
_fieldId: string;
|
64
|
+
$$field: string;
|
53
65
|
}) => import("../conditionals/conditionals").JSONSchema;
|
54
66
|
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
55
67
|
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
@@ -60,9 +72,6 @@ export declare function field(fieldId: string): {
|
|
60
72
|
getId: () => {
|
61
73
|
fieldId: string;
|
62
74
|
};
|
63
|
-
|
64
|
-
* @private Internal property used for field reference tracking.
|
65
|
-
*/
|
66
|
-
_fieldId: string;
|
75
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
67
76
|
};
|
68
77
|
//# 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';
|
@@ -6,6 +7,8 @@ export * from './FieldConfig';
|
|
6
7
|
export * from './PageConfig';
|
7
8
|
export * from './SummaryConfig';
|
8
9
|
export * from './WorkqueueConfig';
|
10
|
+
export * from './WorkqueueColumnConfig';
|
11
|
+
export * from './workqueueDefaultColumns';
|
9
12
|
export * from './Draft';
|
10
13
|
export * from './EventMetadata';
|
11
14
|
export * from './EventInput';
|
@@ -31,6 +34,7 @@ export * from './AdvancedSearchConfig';
|
|
31
34
|
export * from './test.utils';
|
32
35
|
export * from './TemplateConfig';
|
33
36
|
export * from './scopes';
|
37
|
+
export * from './serializer';
|
34
38
|
export * from '../conditionals/conditionals';
|
35
39
|
export * from '../conditionals/validate';
|
36
40
|
export * from './field';
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { Scope } from '../scopes';
|
2
2
|
import { ActionType } from './ActionType';
|
3
|
-
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
4
3
|
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"];
|
5
4
|
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")[];
|
6
5
|
export declare const ACTION_ALLOWED_SCOPES: {
|
@@ -22,5 +21,25 @@ export declare const ACTION_ALLOWED_SCOPES: {
|
|
22
21
|
UNASSIGN: null;
|
23
22
|
DETECT_DUPLICATE: [];
|
24
23
|
};
|
24
|
+
export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
25
|
+
READ: never[];
|
26
|
+
CREATE: "record.notify"[];
|
27
|
+
NOTIFY: "record.notify"[];
|
28
|
+
DECLARE: never[];
|
29
|
+
DELETE: never[];
|
30
|
+
VALIDATE: never[];
|
31
|
+
REGISTER: never[];
|
32
|
+
PRINT_CERTIFICATE: never[];
|
33
|
+
REQUEST_CORRECTION: never[];
|
34
|
+
REJECT_CORRECTION: never[];
|
35
|
+
APPROVE_CORRECTION: never[];
|
36
|
+
MARKED_AS_DUPLICATE: never[];
|
37
|
+
ARCHIVE: never[];
|
38
|
+
REJECT: never[];
|
39
|
+
ASSIGN: never[];
|
40
|
+
UNASSIGN: never[];
|
41
|
+
DETECT_DUPLICATE: never[];
|
42
|
+
};
|
43
|
+
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
25
44
|
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
26
45
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -1,16 +1,26 @@
|
|
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';
|
6
6
|
import { EventDocument } from './EventDocument';
|
7
7
|
import { EventIndex } from './EventIndex';
|
8
8
|
import { EventInput } from './EventInput';
|
9
|
-
import { FieldValue } from './FieldValue';
|
10
9
|
import { TranslationConfig } from './TranslationConfig';
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
import { FieldConfig } from './FieldConfig';
|
11
|
+
import { WorkqueueConfig } from './WorkqueueConfig';
|
12
|
+
import { FieldValue } from './FieldValue';
|
13
|
+
export declare function generateRandomName(rng: () => number): {
|
14
|
+
firstname: string;
|
15
|
+
surname: string;
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* Quick-and-dirty mock data generator for event actions.
|
19
|
+
*/
|
20
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
|
21
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
|
22
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
|
23
|
+
export declare function eventPayloadGenerator(rng: () => number): {
|
14
24
|
create: (input?: Partial<EventInput>) => {
|
15
25
|
transactionId: string;
|
16
26
|
type: string;
|
@@ -25,8 +35,7 @@ export declare const eventPayloadGenerator: {
|
|
25
35
|
actionType: ActionType;
|
26
36
|
}, input?: Partial<Draft>) => Draft;
|
27
37
|
actions: {
|
28
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
29
|
-
type: "DECLARE";
|
38
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
30
39
|
transactionId: string;
|
31
40
|
declaration: Record<string, string | number | boolean | {
|
32
41
|
type: string;
|
@@ -43,6 +52,10 @@ export declare const eventPayloadGenerator: {
|
|
43
52
|
residentialArea?: string | null | undefined;
|
44
53
|
street?: string | null | undefined;
|
45
54
|
zipCode?: string | null | undefined;
|
55
|
+
} | {
|
56
|
+
firstname: string;
|
57
|
+
surname: string;
|
58
|
+
middlename?: string | null | undefined;
|
46
59
|
} | {
|
47
60
|
country: string;
|
48
61
|
district: string;
|
@@ -65,20 +78,19 @@ export declare const eventPayloadGenerator: {
|
|
65
78
|
option: string;
|
66
79
|
filename: string;
|
67
80
|
originalFilename: string;
|
68
|
-
}[] | undefined>;
|
81
|
+
}[] | [string, string] | null | undefined>;
|
69
82
|
annotation: {};
|
83
|
+
keepAssignment?: boolean | undefined;
|
84
|
+
type: "DECLARE";
|
70
85
|
eventId: string;
|
71
86
|
};
|
72
87
|
/**
|
73
88
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
74
89
|
*/
|
75
|
-
notify: (eventId: string, input?: {
|
76
|
-
transactionId?: string;
|
77
|
-
declaration?: Partial<ActionUpdate>;
|
78
|
-
}) => {
|
90
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
79
91
|
type: "NOTIFY";
|
80
92
|
transactionId: string;
|
81
|
-
declaration:
|
93
|
+
declaration: Record<string, string | number | boolean | {
|
82
94
|
type: string;
|
83
95
|
filename: string;
|
84
96
|
originalFilename: string;
|
@@ -93,6 +105,10 @@ export declare const eventPayloadGenerator: {
|
|
93
105
|
residentialArea?: string | null | undefined;
|
94
106
|
street?: string | null | undefined;
|
95
107
|
zipCode?: string | null | undefined;
|
108
|
+
} | {
|
109
|
+
firstname: string;
|
110
|
+
surname: string;
|
111
|
+
middlename?: string | null | undefined;
|
96
112
|
} | {
|
97
113
|
country: string;
|
98
114
|
district: string;
|
@@ -115,11 +131,11 @@ export declare const eventPayloadGenerator: {
|
|
115
131
|
option: string;
|
116
132
|
filename: string;
|
117
133
|
originalFilename: string;
|
118
|
-
}[] | undefined
|
134
|
+
}[] | [string, string] | null | undefined>;
|
119
135
|
eventId: string;
|
136
|
+
keepAssignment: boolean | undefined;
|
120
137
|
};
|
121
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
122
|
-
type: "VALIDATE";
|
138
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
123
139
|
transactionId: string;
|
124
140
|
declaration: Record<string, string | number | boolean | {
|
125
141
|
type: string;
|
@@ -136,6 +152,10 @@ export declare const eventPayloadGenerator: {
|
|
136
152
|
residentialArea?: string | null | undefined;
|
137
153
|
street?: string | null | undefined;
|
138
154
|
zipCode?: string | null | undefined;
|
155
|
+
} | {
|
156
|
+
firstname: string;
|
157
|
+
surname: string;
|
158
|
+
middlename?: string | null | undefined;
|
139
159
|
} | {
|
140
160
|
country: string;
|
141
161
|
district: string;
|
@@ -158,8 +178,10 @@ export declare const eventPayloadGenerator: {
|
|
158
178
|
option: string;
|
159
179
|
filename: string;
|
160
180
|
originalFilename: string;
|
161
|
-
}[] | undefined>;
|
181
|
+
}[] | [string, string] | null | undefined>;
|
162
182
|
annotation: {};
|
183
|
+
keepAssignment?: boolean | undefined;
|
184
|
+
type: "VALIDATE";
|
163
185
|
duplicates: never[];
|
164
186
|
eventId: string;
|
165
187
|
};
|
@@ -177,26 +199,73 @@ export declare const eventPayloadGenerator: {
|
|
177
199
|
assignedTo: null;
|
178
200
|
eventId: string;
|
179
201
|
};
|
180
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
181
|
-
type: "ARCHIVE";
|
202
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
182
203
|
transactionId: string;
|
183
|
-
declaration: {
|
184
|
-
|
185
|
-
|
186
|
-
|
204
|
+
declaration: Record<string, string | number | boolean | {
|
205
|
+
type: string;
|
206
|
+
filename: string;
|
207
|
+
originalFilename: string;
|
208
|
+
} | {
|
209
|
+
country: string;
|
210
|
+
district: string;
|
211
|
+
addressType: "DOMESTIC";
|
212
|
+
province: string;
|
213
|
+
urbanOrRural: "URBAN";
|
214
|
+
number?: string | null | undefined;
|
215
|
+
town?: string | null | undefined;
|
216
|
+
residentialArea?: string | null | undefined;
|
217
|
+
street?: string | null | undefined;
|
218
|
+
zipCode?: string | null | undefined;
|
219
|
+
} | {
|
220
|
+
firstname: string;
|
221
|
+
surname: string;
|
222
|
+
middlename?: string | null | undefined;
|
223
|
+
} | {
|
224
|
+
country: string;
|
225
|
+
district: string;
|
226
|
+
addressType: "DOMESTIC";
|
227
|
+
province: string;
|
228
|
+
urbanOrRural: "RURAL";
|
229
|
+
village?: string | null | undefined;
|
230
|
+
} | {
|
231
|
+
country: string;
|
232
|
+
state: string;
|
233
|
+
addressType: "INTERNATIONAL";
|
234
|
+
district2: string;
|
235
|
+
cityOrTown?: string | null | undefined;
|
236
|
+
addressLine1?: string | null | undefined;
|
237
|
+
addressLine2?: string | null | undefined;
|
238
|
+
addressLine3?: string | null | undefined;
|
239
|
+
postcodeOrZip?: string | null | undefined;
|
240
|
+
} | {
|
241
|
+
type: string;
|
242
|
+
option: string;
|
243
|
+
filename: string;
|
244
|
+
originalFilename: string;
|
245
|
+
}[] | [string, string] | null | undefined>;
|
246
|
+
keepAssignment?: boolean | undefined;
|
247
|
+
type: "ARCHIVE";
|
248
|
+
annotation: {};
|
187
249
|
duplicates: never[];
|
188
250
|
eventId: string;
|
251
|
+
reason: {
|
252
|
+
message: string;
|
253
|
+
isDuplicate: boolean;
|
254
|
+
};
|
189
255
|
};
|
190
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
191
|
-
type: "REJECT";
|
256
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
192
257
|
transactionId: string;
|
193
|
-
declaration: {};
|
194
258
|
annotation: {};
|
259
|
+
keepAssignment?: boolean | undefined;
|
260
|
+
type: "REJECT";
|
261
|
+
declaration: {};
|
195
262
|
duplicates: never[];
|
196
263
|
eventId: string;
|
264
|
+
reason: {
|
265
|
+
message: string;
|
266
|
+
};
|
197
267
|
};
|
198
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
199
|
-
type: "REGISTER";
|
268
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
200
269
|
transactionId: string;
|
201
270
|
declaration: Record<string, string | number | boolean | {
|
202
271
|
type: string;
|
@@ -213,6 +282,10 @@ export declare const eventPayloadGenerator: {
|
|
213
282
|
residentialArea?: string | null | undefined;
|
214
283
|
street?: string | null | undefined;
|
215
284
|
zipCode?: string | null | undefined;
|
285
|
+
} | {
|
286
|
+
firstname: string;
|
287
|
+
surname: string;
|
288
|
+
middlename?: string | null | undefined;
|
216
289
|
} | {
|
217
290
|
country: string;
|
218
291
|
district: string;
|
@@ -235,19 +308,22 @@ export declare const eventPayloadGenerator: {
|
|
235
308
|
option: string;
|
236
309
|
filename: string;
|
237
310
|
originalFilename: string;
|
238
|
-
}[] | undefined>;
|
311
|
+
}[] | [string, string] | null | undefined>;
|
239
312
|
annotation: {};
|
313
|
+
keepAssignment?: boolean | undefined;
|
314
|
+
type: "REGISTER";
|
240
315
|
eventId: string;
|
241
316
|
};
|
242
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
243
|
-
type: "PRINT_CERTIFICATE";
|
317
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
244
318
|
transactionId: string;
|
245
|
-
declaration: {};
|
246
319
|
annotation: {};
|
320
|
+
keepAssignment?: boolean | undefined;
|
321
|
+
type: "PRINT_CERTIFICATE";
|
322
|
+
declaration: {};
|
247
323
|
eventId: string;
|
248
324
|
};
|
249
325
|
correction: {
|
250
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
326
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
251
327
|
type: "REQUEST_CORRECTION";
|
252
328
|
transactionId: string;
|
253
329
|
declaration: Record<string, string | number | boolean | {
|
@@ -265,6 +341,10 @@ export declare const eventPayloadGenerator: {
|
|
265
341
|
residentialArea?: string | null | undefined;
|
266
342
|
street?: string | null | undefined;
|
267
343
|
zipCode?: string | null | undefined;
|
344
|
+
} | {
|
345
|
+
firstname: string;
|
346
|
+
surname: string;
|
347
|
+
middlename?: string | null | undefined;
|
268
348
|
} | {
|
269
349
|
country: string;
|
270
350
|
district: string;
|
@@ -287,39 +367,65 @@ export declare const eventPayloadGenerator: {
|
|
287
367
|
option: string;
|
288
368
|
filename: string;
|
289
369
|
originalFilename: string;
|
290
|
-
}[] | undefined>;
|
370
|
+
}[] | [string, string] | null | undefined>;
|
291
371
|
annotation: {};
|
292
372
|
eventId: string;
|
373
|
+
keepAssignment: boolean | undefined;
|
293
374
|
};
|
294
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
375
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
295
376
|
type: "APPROVE_CORRECTION";
|
296
377
|
transactionId: string;
|
297
378
|
declaration: {};
|
298
379
|
annotation: {};
|
299
380
|
eventId: string;
|
300
381
|
requestId: string;
|
382
|
+
keepAssignment: boolean | undefined;
|
301
383
|
};
|
302
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
384
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
303
385
|
type: "REJECT_CORRECTION";
|
304
386
|
transactionId: string;
|
305
387
|
declaration: {};
|
306
388
|
annotation: {};
|
307
389
|
eventId: string;
|
308
390
|
requestId: string;
|
391
|
+
keepAssignment: boolean | undefined;
|
309
392
|
};
|
310
393
|
};
|
311
394
|
};
|
312
395
|
};
|
313
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
396
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
314
397
|
configuration: EventConfig;
|
315
398
|
action: ActionType;
|
399
|
+
rng?: () => number;
|
316
400
|
defaults?: Partial<ActionDocument>;
|
317
401
|
}): ActionDocument;
|
318
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
402
|
+
export declare function generateEventDocument({ configuration, actions, rng }: {
|
319
403
|
configuration: EventConfig;
|
320
404
|
actions: ActionType[];
|
405
|
+
rng?: () => number;
|
321
406
|
}): EventDocument;
|
322
|
-
export declare function generateEventDraftDocument(eventId
|
323
|
-
|
407
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
408
|
+
eventId: string;
|
409
|
+
actionType: ActionType;
|
410
|
+
rng?: () => number;
|
411
|
+
declaration?: EventState;
|
412
|
+
}): Draft;
|
413
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
414
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
415
|
+
/**
|
416
|
+
* Useful for testing when we need deterministic outcome.
|
417
|
+
* @param seed - Seed value for the pseudo-random number generator
|
418
|
+
*
|
419
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
420
|
+
*/
|
421
|
+
export declare function createPrng(seed: number): () => number;
|
422
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
423
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
324
424
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
425
|
+
export declare const BearerTokenByUserType: {
|
426
|
+
fieldAgent: string;
|
427
|
+
registrationAgent: string;
|
428
|
+
localRegistrar: string;
|
429
|
+
};
|
430
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
325
431
|
//# sourceMappingURL=test.utils.d.ts.map
|