@opencrvs/toolkit 1.8.0-rc.fbcec4c → 1.8.0-rc.fbec3ce
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 +13657 -4243
- package/dist/commons/conditionals/conditionals.d.ts +14 -6
- package/dist/commons/conditionals/validate.d.ts +6 -11
- package/dist/commons/events/ActionConfig.d.ts +117418 -1729
- package/dist/commons/events/ActionDocument.d.ts +2307 -379
- package/dist/commons/events/ActionInput.d.ts +1673 -303
- package/dist/commons/events/ActionType.d.ts +2 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
- 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 +146 -29
- package/dist/commons/events/EventConfig.d.ts +56364 -1344
- package/dist/commons/events/EventDocument.d.ts +1430 -264
- package/dist/commons/events/EventIndex.d.ts +1590 -28
- package/dist/commons/events/EventMetadata.d.ts +299 -46
- package/dist/commons/events/FieldConfig.d.ts +5436 -1038
- 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 +49 -8
- package/dist/commons/events/FormConfig.d.ts +49156 -514
- package/dist/commons/events/PageConfig.d.ts +12206 -204
- package/dist/commons/events/SummaryConfig.d.ts +95 -39
- 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 +4801 -20
- package/dist/commons/events/defineConfig.d.ts +8993 -58
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +77 -0
- package/dist/commons/events/index.d.ts +7 -0
- package/dist/commons/events/scopes.d.ts +45 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +145 -72
- package/dist/commons/events/utils.d.ts +13362 -70
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +76 -36
- package/dist/events/index.js +4174 -1863
- package/dist/scopes/index.d.ts +158 -1
- package/dist/scopes/index.js +152 -1
- package/package.json +3 -2
@@ -0,0 +1,54 @@
|
|
1
|
+
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
+
import { SelectOption } from './FieldConfig';
|
3
|
+
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
|
+
/**
|
5
|
+
* Creates a function that acts like a callable + static method container.
|
6
|
+
*
|
7
|
+
* @example
|
8
|
+
* event('status') // → returns search config
|
9
|
+
* event.hasAction('CLICKED') // → returns conditional
|
10
|
+
*/
|
11
|
+
declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
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
|
+
};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
declare const event: typeof eventFn & {
|
50
|
+
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
51
|
+
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
52
|
+
};
|
53
|
+
export { event };
|
54
|
+
//# sourceMappingURL=event.d.ts.map
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { FieldConditional } from './Conditional';
|
2
|
+
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
/**
|
4
|
+
* Entry point for defining conditional logic or configuration for a form field.
|
5
|
+
* @param fieldId - The ID of the field to define rules or config for.
|
6
|
+
* @returns An object combining conditional methods and configuration builders.
|
7
|
+
*/
|
8
|
+
export declare function field(fieldId: string, options?: {
|
9
|
+
conditionals?: FieldConditional[];
|
10
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
|
+
}): {
|
12
|
+
range: () => {
|
13
|
+
conditionals?: FieldConditional[];
|
14
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
15
|
+
fieldId: string;
|
16
|
+
fieldType: "field";
|
17
|
+
} & {
|
18
|
+
config: {
|
19
|
+
type: "range";
|
20
|
+
};
|
21
|
+
};
|
22
|
+
exact: () => {
|
23
|
+
conditionals?: FieldConditional[];
|
24
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
|
+
fieldId: string;
|
26
|
+
fieldType: "field";
|
27
|
+
} & {
|
28
|
+
config: {
|
29
|
+
type: "exact";
|
30
|
+
};
|
31
|
+
};
|
32
|
+
fuzzy: () => {
|
33
|
+
conditionals?: FieldConditional[];
|
34
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
35
|
+
fieldId: string;
|
36
|
+
fieldType: "field";
|
37
|
+
} & {
|
38
|
+
config: {
|
39
|
+
type: "fuzzy";
|
40
|
+
};
|
41
|
+
};
|
42
|
+
$$field: string;
|
43
|
+
isAfter: () => {
|
44
|
+
days: (days: number) => {
|
45
|
+
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
46
|
+
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
47
|
+
};
|
48
|
+
date: (date: string | {
|
49
|
+
$$field: string;
|
50
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
51
|
+
now: () => import("../conditionals/conditionals").JSONSchema;
|
52
|
+
};
|
53
|
+
isBefore: () => {
|
54
|
+
days: (days: number) => {
|
55
|
+
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
56
|
+
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
57
|
+
};
|
58
|
+
date: (date: string | {
|
59
|
+
$$field: string;
|
60
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
61
|
+
now: () => import("../conditionals/conditionals").JSONSchema;
|
62
|
+
};
|
63
|
+
isEqualTo: (value: string | boolean | {
|
64
|
+
$$field: string;
|
65
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
66
|
+
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
67
|
+
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
68
|
+
inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
|
69
|
+
isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
|
70
|
+
matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
|
71
|
+
isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
|
72
|
+
getId: () => {
|
73
|
+
fieldId: string;
|
74
|
+
};
|
75
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
76
|
+
};
|
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';
|
@@ -30,6 +33,10 @@ export * from './Conditional';
|
|
30
33
|
export * from './AdvancedSearchConfig';
|
31
34
|
export * from './test.utils';
|
32
35
|
export * from './TemplateConfig';
|
36
|
+
export * from './scopes';
|
37
|
+
export * from './serializer';
|
33
38
|
export * from '../conditionals/conditionals';
|
34
39
|
export * from '../conditionals/validate';
|
40
|
+
export * from './field';
|
41
|
+
export * from './event';
|
35
42
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { Scope } from '../scopes';
|
2
|
+
import { ActionType } from './ActionType';
|
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"];
|
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")[];
|
5
|
+
export declare const ACTION_ALLOWED_SCOPES: {
|
6
|
+
READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
|
7
|
+
CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
|
8
|
+
NOTIFY: ["record.declaration-submit-incomplete"];
|
9
|
+
DECLARE: ["record.declare-birth", "record.declaration-submit-for-approval", "record.register"];
|
10
|
+
DELETE: ["record.declare-birth"];
|
11
|
+
VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
|
12
|
+
REGISTER: ["record.register"];
|
13
|
+
PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
|
14
|
+
REQUEST_CORRECTION: ["record.registration-request-correction"];
|
15
|
+
REJECT_CORRECTION: ["record.registration-correct"];
|
16
|
+
APPROVE_CORRECTION: ["record.registration-correct"];
|
17
|
+
MARKED_AS_DUPLICATE: ["record.declaration-archive"];
|
18
|
+
ARCHIVE: ["record.declaration-archive"];
|
19
|
+
REJECT: ["record.declaration-submit-for-updates"];
|
20
|
+
ASSIGN: null;
|
21
|
+
UNASSIGN: null;
|
22
|
+
DETECT_DUPLICATE: [];
|
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;
|
44
|
+
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
45
|
+
//# sourceMappingURL=scopes.d.ts.map
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ActionDocument, ActionUpdate } from './ActionDocument';
|
1
|
+
import { ActionDocument, ActionUpdate, EventState } from './ActionDocument';
|
2
2
|
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
3
3
|
import { ActionType } from './ActionType';
|
4
4
|
import { Draft } from './Draft';
|
@@ -6,48 +6,21 @@ 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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
zipCode?: string | undefined;
|
26
|
-
} | {
|
27
|
-
country: string;
|
28
|
-
district: string;
|
29
|
-
addressType: "DOMESTIC";
|
30
|
-
province: string;
|
31
|
-
urbanOrRural: "RURAL";
|
32
|
-
village?: string | undefined;
|
33
|
-
} | {
|
34
|
-
country: string;
|
35
|
-
state: string;
|
36
|
-
addressType: "INTERNATIONAL";
|
37
|
-
district2: string;
|
38
|
-
cityOrTown?: string | undefined;
|
39
|
-
addressLine1?: string | undefined;
|
40
|
-
addressLine2?: string | undefined;
|
41
|
-
addressLine3?: string | undefined;
|
42
|
-
postcodeOrZip?: string | undefined;
|
43
|
-
} | {
|
44
|
-
type: string;
|
45
|
-
option: string;
|
46
|
-
filename: string;
|
47
|
-
originalFilename: string;
|
48
|
-
}[] | undefined>;
|
49
|
-
export declare function generateActionMetadataInput(configuration: EventConfig, action: ActionType): {};
|
50
|
-
export declare const eventPayloadGenerator: {
|
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): {
|
51
24
|
create: (input?: Partial<EventInput>) => {
|
52
25
|
transactionId: string;
|
53
26
|
type: string;
|
@@ -62,8 +35,7 @@ export declare const eventPayloadGenerator: {
|
|
62
35
|
actionType: ActionType;
|
63
36
|
}, input?: Partial<Draft>) => Draft;
|
64
37
|
actions: {
|
65
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
66
|
-
type: "DECLARE";
|
38
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
67
39
|
transactionId: string;
|
68
40
|
declaration: Record<string, string | number | boolean | {
|
69
41
|
type: string;
|
@@ -80,6 +52,10 @@ export declare const eventPayloadGenerator: {
|
|
80
52
|
residentialArea?: string | null | undefined;
|
81
53
|
street?: string | null | undefined;
|
82
54
|
zipCode?: string | null | undefined;
|
55
|
+
} | {
|
56
|
+
firstname: string;
|
57
|
+
surname: string;
|
58
|
+
middlename?: string | null | undefined;
|
83
59
|
} | {
|
84
60
|
country: string;
|
85
61
|
district: string;
|
@@ -102,8 +78,10 @@ export declare const eventPayloadGenerator: {
|
|
102
78
|
option: string;
|
103
79
|
filename: string;
|
104
80
|
originalFilename: string;
|
105
|
-
}[] | undefined>;
|
81
|
+
}[] | [string, string] | null | undefined>;
|
106
82
|
annotation: {};
|
83
|
+
keepAssignment?: boolean | undefined;
|
84
|
+
type: "DECLARE";
|
107
85
|
eventId: string;
|
108
86
|
};
|
109
87
|
/**
|
@@ -112,6 +90,7 @@ export declare const eventPayloadGenerator: {
|
|
112
90
|
notify: (eventId: string, input?: {
|
113
91
|
transactionId?: string;
|
114
92
|
declaration?: Partial<ActionUpdate>;
|
93
|
+
keepAssignment?: boolean;
|
115
94
|
}) => {
|
116
95
|
type: "NOTIFY";
|
117
96
|
transactionId: string;
|
@@ -130,6 +109,10 @@ export declare const eventPayloadGenerator: {
|
|
130
109
|
residentialArea?: string | null | undefined;
|
131
110
|
street?: string | null | undefined;
|
132
111
|
zipCode?: string | null | undefined;
|
112
|
+
} | {
|
113
|
+
firstname: string;
|
114
|
+
surname: string;
|
115
|
+
middlename?: string | null | undefined;
|
133
116
|
} | {
|
134
117
|
country: string;
|
135
118
|
district: string;
|
@@ -152,11 +135,11 @@ export declare const eventPayloadGenerator: {
|
|
152
135
|
option: string;
|
153
136
|
filename: string;
|
154
137
|
originalFilename: string;
|
155
|
-
}[] | undefined>>;
|
138
|
+
}[] | [string, string] | null | undefined>>;
|
156
139
|
eventId: string;
|
140
|
+
keepAssignment: boolean | undefined;
|
157
141
|
};
|
158
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
159
|
-
type: "VALIDATE";
|
142
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
160
143
|
transactionId: string;
|
161
144
|
declaration: Record<string, string | number | boolean | {
|
162
145
|
type: string;
|
@@ -173,6 +156,10 @@ export declare const eventPayloadGenerator: {
|
|
173
156
|
residentialArea?: string | null | undefined;
|
174
157
|
street?: string | null | undefined;
|
175
158
|
zipCode?: string | null | undefined;
|
159
|
+
} | {
|
160
|
+
firstname: string;
|
161
|
+
surname: string;
|
162
|
+
middlename?: string | null | undefined;
|
176
163
|
} | {
|
177
164
|
country: string;
|
178
165
|
district: string;
|
@@ -195,8 +182,10 @@ export declare const eventPayloadGenerator: {
|
|
195
182
|
option: string;
|
196
183
|
filename: string;
|
197
184
|
originalFilename: string;
|
198
|
-
}[] | undefined>;
|
185
|
+
}[] | [string, string] | null | undefined>;
|
199
186
|
annotation: {};
|
187
|
+
keepAssignment?: boolean | undefined;
|
188
|
+
type: "VALIDATE";
|
200
189
|
duplicates: never[];
|
201
190
|
eventId: string;
|
202
191
|
};
|
@@ -214,26 +203,73 @@ export declare const eventPayloadGenerator: {
|
|
214
203
|
assignedTo: null;
|
215
204
|
eventId: string;
|
216
205
|
};
|
217
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
218
|
-
type: "ARCHIVE";
|
206
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
219
207
|
transactionId: string;
|
220
|
-
declaration: {
|
221
|
-
|
222
|
-
|
223
|
-
|
208
|
+
declaration: Record<string, string | number | boolean | {
|
209
|
+
type: string;
|
210
|
+
filename: string;
|
211
|
+
originalFilename: string;
|
212
|
+
} | {
|
213
|
+
country: string;
|
214
|
+
district: string;
|
215
|
+
addressType: "DOMESTIC";
|
216
|
+
province: string;
|
217
|
+
urbanOrRural: "URBAN";
|
218
|
+
number?: string | null | undefined;
|
219
|
+
town?: string | null | undefined;
|
220
|
+
residentialArea?: string | null | undefined;
|
221
|
+
street?: string | null | undefined;
|
222
|
+
zipCode?: string | null | undefined;
|
223
|
+
} | {
|
224
|
+
firstname: string;
|
225
|
+
surname: string;
|
226
|
+
middlename?: string | null | undefined;
|
227
|
+
} | {
|
228
|
+
country: string;
|
229
|
+
district: string;
|
230
|
+
addressType: "DOMESTIC";
|
231
|
+
province: string;
|
232
|
+
urbanOrRural: "RURAL";
|
233
|
+
village?: string | null | undefined;
|
234
|
+
} | {
|
235
|
+
country: string;
|
236
|
+
state: string;
|
237
|
+
addressType: "INTERNATIONAL";
|
238
|
+
district2: string;
|
239
|
+
cityOrTown?: string | null | undefined;
|
240
|
+
addressLine1?: string | null | undefined;
|
241
|
+
addressLine2?: string | null | undefined;
|
242
|
+
addressLine3?: string | null | undefined;
|
243
|
+
postcodeOrZip?: string | null | undefined;
|
244
|
+
} | {
|
245
|
+
type: string;
|
246
|
+
option: string;
|
247
|
+
filename: string;
|
248
|
+
originalFilename: string;
|
249
|
+
}[] | [string, string] | null | undefined>;
|
250
|
+
keepAssignment?: boolean | undefined;
|
251
|
+
type: "ARCHIVE";
|
252
|
+
annotation: {};
|
224
253
|
duplicates: never[];
|
225
254
|
eventId: string;
|
255
|
+
reason: {
|
256
|
+
message: string;
|
257
|
+
isDuplicate: boolean;
|
258
|
+
};
|
226
259
|
};
|
227
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
228
|
-
type: "REJECT";
|
260
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
229
261
|
transactionId: string;
|
230
|
-
declaration: {};
|
231
262
|
annotation: {};
|
263
|
+
keepAssignment?: boolean | undefined;
|
264
|
+
type: "REJECT";
|
265
|
+
declaration: {};
|
232
266
|
duplicates: never[];
|
233
267
|
eventId: string;
|
268
|
+
reason: {
|
269
|
+
message: string;
|
270
|
+
};
|
234
271
|
};
|
235
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
236
|
-
type: "REGISTER";
|
272
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
237
273
|
transactionId: string;
|
238
274
|
declaration: Record<string, string | number | boolean | {
|
239
275
|
type: string;
|
@@ -250,6 +286,10 @@ export declare const eventPayloadGenerator: {
|
|
250
286
|
residentialArea?: string | null | undefined;
|
251
287
|
street?: string | null | undefined;
|
252
288
|
zipCode?: string | null | undefined;
|
289
|
+
} | {
|
290
|
+
firstname: string;
|
291
|
+
surname: string;
|
292
|
+
middlename?: string | null | undefined;
|
253
293
|
} | {
|
254
294
|
country: string;
|
255
295
|
district: string;
|
@@ -272,19 +312,22 @@ export declare const eventPayloadGenerator: {
|
|
272
312
|
option: string;
|
273
313
|
filename: string;
|
274
314
|
originalFilename: string;
|
275
|
-
}[] | undefined>;
|
315
|
+
}[] | [string, string] | null | undefined>;
|
276
316
|
annotation: {};
|
317
|
+
keepAssignment?: boolean | undefined;
|
318
|
+
type: "REGISTER";
|
277
319
|
eventId: string;
|
278
320
|
};
|
279
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
280
|
-
type: "PRINT_CERTIFICATE";
|
321
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
281
322
|
transactionId: string;
|
282
|
-
declaration: {};
|
283
323
|
annotation: {};
|
324
|
+
keepAssignment?: boolean | undefined;
|
325
|
+
type: "PRINT_CERTIFICATE";
|
326
|
+
declaration: {};
|
284
327
|
eventId: string;
|
285
328
|
};
|
286
329
|
correction: {
|
287
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
330
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
288
331
|
type: "REQUEST_CORRECTION";
|
289
332
|
transactionId: string;
|
290
333
|
declaration: Record<string, string | number | boolean | {
|
@@ -302,6 +345,10 @@ export declare const eventPayloadGenerator: {
|
|
302
345
|
residentialArea?: string | null | undefined;
|
303
346
|
street?: string | null | undefined;
|
304
347
|
zipCode?: string | null | undefined;
|
348
|
+
} | {
|
349
|
+
firstname: string;
|
350
|
+
surname: string;
|
351
|
+
middlename?: string | null | undefined;
|
305
352
|
} | {
|
306
353
|
country: string;
|
307
354
|
district: string;
|
@@ -324,39 +371,65 @@ export declare const eventPayloadGenerator: {
|
|
324
371
|
option: string;
|
325
372
|
filename: string;
|
326
373
|
originalFilename: string;
|
327
|
-
}[] | undefined>;
|
374
|
+
}[] | [string, string] | null | undefined>;
|
328
375
|
annotation: {};
|
329
376
|
eventId: string;
|
377
|
+
keepAssignment: boolean | undefined;
|
330
378
|
};
|
331
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
379
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
332
380
|
type: "APPROVE_CORRECTION";
|
333
381
|
transactionId: string;
|
334
382
|
declaration: {};
|
335
383
|
annotation: {};
|
336
384
|
eventId: string;
|
337
385
|
requestId: string;
|
386
|
+
keepAssignment: boolean | undefined;
|
338
387
|
};
|
339
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
388
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
340
389
|
type: "REJECT_CORRECTION";
|
341
390
|
transactionId: string;
|
342
391
|
declaration: {};
|
343
392
|
annotation: {};
|
344
393
|
eventId: string;
|
345
394
|
requestId: string;
|
395
|
+
keepAssignment: boolean | undefined;
|
346
396
|
};
|
347
397
|
};
|
348
398
|
};
|
349
399
|
};
|
350
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
400
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
351
401
|
configuration: EventConfig;
|
352
402
|
action: ActionType;
|
403
|
+
rng?: () => number;
|
353
404
|
defaults?: Partial<ActionDocument>;
|
354
405
|
}): ActionDocument;
|
355
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
406
|
+
export declare function generateEventDocument({ configuration, actions, rng }: {
|
356
407
|
configuration: EventConfig;
|
357
408
|
actions: ActionType[];
|
409
|
+
rng?: () => number;
|
358
410
|
}): EventDocument;
|
359
|
-
export declare function generateEventDraftDocument(eventId
|
360
|
-
|
411
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
412
|
+
eventId: string;
|
413
|
+
actionType: ActionType;
|
414
|
+
rng?: () => number;
|
415
|
+
declaration?: EventState;
|
416
|
+
}): Draft;
|
417
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
418
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
419
|
+
/**
|
420
|
+
* Useful for testing when we need deterministic outcome.
|
421
|
+
* @param seed - Seed value for the pseudo-random number generator
|
422
|
+
*
|
423
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
424
|
+
*/
|
425
|
+
export declare function createPrng(seed: number): () => number;
|
426
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
427
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
361
428
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
429
|
+
export declare const BearerTokenByUserType: {
|
430
|
+
fieldAgent: string;
|
431
|
+
registrationAgent: string;
|
432
|
+
localRegistrar: string;
|
433
|
+
};
|
434
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
362
435
|
//# sourceMappingURL=test.utils.d.ts.map
|