@opencrvs/toolkit 1.8.0-rc.fd936ab → 1.8.0-rc.fde984c
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 +13648 -4236
- package/dist/commons/conditionals/conditionals.d.ts +14 -6
- package/dist/commons/conditionals/validate.d.ts +5 -6
- package/dist/commons/events/ActionConfig.d.ts +117418 -1729
- package/dist/commons/events/ActionDocument.d.ts +2305 -383
- package/dist/commons/events/ActionInput.d.ts +1583 -303
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +31 -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 +143 -29
- package/dist/commons/events/EventConfig.d.ts +56369 -1354
- package/dist/commons/events/EventDocument.d.ts +1428 -264
- package/dist/commons/events/EventIndex.d.ts +1590 -25
- package/dist/commons/events/EventMetadata.d.ts +299 -43
- 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 +93 -42
- package/dist/commons/events/User.d.ts +31 -2
- 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 +147 -78
- package/dist/commons/events/utils.d.ts +13352 -68
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +76 -36
- package/dist/events/index.js +3692 -1456
- package/dist/scopes/index.d.ts +94 -6
- package/dist/scopes/index.js +42 -21
- 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,53 +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
|
-
|
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 generateActionAnnotationInput(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,20 +78,19 @@ 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
|
/**
|
110
88
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
111
89
|
*/
|
112
|
-
notify: (eventId: string, input?: {
|
113
|
-
transactionId?: string;
|
114
|
-
declaration?: Partial<ActionUpdate>;
|
115
|
-
}) => {
|
90
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
116
91
|
type: "NOTIFY";
|
117
92
|
transactionId: string;
|
118
|
-
declaration:
|
93
|
+
declaration: Record<string, string | number | boolean | {
|
119
94
|
type: string;
|
120
95
|
filename: string;
|
121
96
|
originalFilename: string;
|
@@ -130,6 +105,10 @@ export declare const eventPayloadGenerator: {
|
|
130
105
|
residentialArea?: string | null | undefined;
|
131
106
|
street?: string | null | undefined;
|
132
107
|
zipCode?: string | null | undefined;
|
108
|
+
} | {
|
109
|
+
firstname: string;
|
110
|
+
surname: string;
|
111
|
+
middlename?: string | null | undefined;
|
133
112
|
} | {
|
134
113
|
country: string;
|
135
114
|
district: string;
|
@@ -152,11 +131,11 @@ export declare const eventPayloadGenerator: {
|
|
152
131
|
option: string;
|
153
132
|
filename: string;
|
154
133
|
originalFilename: string;
|
155
|
-
}[] | undefined
|
134
|
+
}[] | [string, string] | null | undefined>;
|
156
135
|
eventId: string;
|
136
|
+
keepAssignment: boolean | undefined;
|
157
137
|
};
|
158
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
159
|
-
type: "VALIDATE";
|
138
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
160
139
|
transactionId: string;
|
161
140
|
declaration: Record<string, string | number | boolean | {
|
162
141
|
type: string;
|
@@ -173,6 +152,10 @@ export declare const eventPayloadGenerator: {
|
|
173
152
|
residentialArea?: string | null | undefined;
|
174
153
|
street?: string | null | undefined;
|
175
154
|
zipCode?: string | null | undefined;
|
155
|
+
} | {
|
156
|
+
firstname: string;
|
157
|
+
surname: string;
|
158
|
+
middlename?: string | null | undefined;
|
176
159
|
} | {
|
177
160
|
country: string;
|
178
161
|
district: string;
|
@@ -195,8 +178,10 @@ export declare const eventPayloadGenerator: {
|
|
195
178
|
option: string;
|
196
179
|
filename: string;
|
197
180
|
originalFilename: string;
|
198
|
-
}[] | undefined>;
|
181
|
+
}[] | [string, string] | null | undefined>;
|
199
182
|
annotation: {};
|
183
|
+
keepAssignment?: boolean | undefined;
|
184
|
+
type: "VALIDATE";
|
200
185
|
duplicates: never[];
|
201
186
|
eventId: string;
|
202
187
|
};
|
@@ -214,26 +199,73 @@ export declare const eventPayloadGenerator: {
|
|
214
199
|
assignedTo: null;
|
215
200
|
eventId: string;
|
216
201
|
};
|
217
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
218
|
-
type: "ARCHIVE";
|
202
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
219
203
|
transactionId: string;
|
220
|
-
declaration: {
|
221
|
-
|
222
|
-
|
223
|
-
|
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: {};
|
224
249
|
duplicates: never[];
|
225
250
|
eventId: string;
|
251
|
+
reason: {
|
252
|
+
message: string;
|
253
|
+
isDuplicate: boolean;
|
254
|
+
};
|
226
255
|
};
|
227
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
228
|
-
type: "REJECT";
|
256
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
229
257
|
transactionId: string;
|
230
|
-
declaration: {};
|
231
258
|
annotation: {};
|
259
|
+
keepAssignment?: boolean | undefined;
|
260
|
+
type: "REJECT";
|
261
|
+
declaration: {};
|
232
262
|
duplicates: never[];
|
233
263
|
eventId: string;
|
264
|
+
reason: {
|
265
|
+
message: string;
|
266
|
+
};
|
234
267
|
};
|
235
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
236
|
-
type: "REGISTER";
|
268
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
237
269
|
transactionId: string;
|
238
270
|
declaration: Record<string, string | number | boolean | {
|
239
271
|
type: string;
|
@@ -250,6 +282,10 @@ export declare const eventPayloadGenerator: {
|
|
250
282
|
residentialArea?: string | null | undefined;
|
251
283
|
street?: string | null | undefined;
|
252
284
|
zipCode?: string | null | undefined;
|
285
|
+
} | {
|
286
|
+
firstname: string;
|
287
|
+
surname: string;
|
288
|
+
middlename?: string | null | undefined;
|
253
289
|
} | {
|
254
290
|
country: string;
|
255
291
|
district: string;
|
@@ -272,19 +308,22 @@ export declare const eventPayloadGenerator: {
|
|
272
308
|
option: string;
|
273
309
|
filename: string;
|
274
310
|
originalFilename: string;
|
275
|
-
}[] | undefined>;
|
311
|
+
}[] | [string, string] | null | undefined>;
|
276
312
|
annotation: {};
|
313
|
+
keepAssignment?: boolean | undefined;
|
314
|
+
type: "REGISTER";
|
277
315
|
eventId: string;
|
278
316
|
};
|
279
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
280
|
-
type: "PRINT_CERTIFICATE";
|
317
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
281
318
|
transactionId: string;
|
282
|
-
declaration: {};
|
283
319
|
annotation: {};
|
320
|
+
keepAssignment?: boolean | undefined;
|
321
|
+
type: "PRINT_CERTIFICATE";
|
322
|
+
declaration: {};
|
284
323
|
eventId: string;
|
285
324
|
};
|
286
325
|
correction: {
|
287
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
326
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
288
327
|
type: "REQUEST_CORRECTION";
|
289
328
|
transactionId: string;
|
290
329
|
declaration: Record<string, string | number | boolean | {
|
@@ -302,6 +341,10 @@ export declare const eventPayloadGenerator: {
|
|
302
341
|
residentialArea?: string | null | undefined;
|
303
342
|
street?: string | null | undefined;
|
304
343
|
zipCode?: string | null | undefined;
|
344
|
+
} | {
|
345
|
+
firstname: string;
|
346
|
+
surname: string;
|
347
|
+
middlename?: string | null | undefined;
|
305
348
|
} | {
|
306
349
|
country: string;
|
307
350
|
district: string;
|
@@ -324,39 +367,65 @@ export declare const eventPayloadGenerator: {
|
|
324
367
|
option: string;
|
325
368
|
filename: string;
|
326
369
|
originalFilename: string;
|
327
|
-
}[] | undefined>;
|
370
|
+
}[] | [string, string] | null | undefined>;
|
328
371
|
annotation: {};
|
329
372
|
eventId: string;
|
373
|
+
keepAssignment: boolean | undefined;
|
330
374
|
};
|
331
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
375
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
332
376
|
type: "APPROVE_CORRECTION";
|
333
377
|
transactionId: string;
|
334
378
|
declaration: {};
|
335
379
|
annotation: {};
|
336
380
|
eventId: string;
|
337
381
|
requestId: string;
|
382
|
+
keepAssignment: boolean | undefined;
|
338
383
|
};
|
339
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
384
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
340
385
|
type: "REJECT_CORRECTION";
|
341
386
|
transactionId: string;
|
342
387
|
declaration: {};
|
343
388
|
annotation: {};
|
344
389
|
eventId: string;
|
345
390
|
requestId: string;
|
391
|
+
keepAssignment: boolean | undefined;
|
346
392
|
};
|
347
393
|
};
|
348
394
|
};
|
349
395
|
};
|
350
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
396
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
351
397
|
configuration: EventConfig;
|
352
398
|
action: ActionType;
|
399
|
+
rng?: () => number;
|
353
400
|
defaults?: Partial<ActionDocument>;
|
354
401
|
}): ActionDocument;
|
355
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
402
|
+
export declare function generateEventDocument({ configuration, actions, rng }: {
|
356
403
|
configuration: EventConfig;
|
357
404
|
actions: ActionType[];
|
405
|
+
rng?: () => number;
|
358
406
|
}): EventDocument;
|
359
|
-
export declare function generateEventDraftDocument(eventId
|
360
|
-
|
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;
|
361
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[];
|
362
431
|
//# sourceMappingURL=test.utils.d.ts.map
|