@opencrvs/toolkit 1.8.0-rc.f8a9481 → 1.8.0-rc.f8be155
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 +13997 -988
- package/dist/commons/conditionals/conditionals.d.ts +14 -6
- package/dist/commons/conditionals/validate.d.ts +6 -0
- package/dist/commons/events/ActionConfig.d.ts +117418 -1729
- package/dist/commons/events/ActionDocument.d.ts +2270 -554
- package/dist/commons/events/ActionInput.d.ts +1637 -365
- package/dist/commons/events/ActionType.d.ts +4 -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 +2 -0
- package/dist/commons/events/Draft.d.ts +143 -39
- package/dist/commons/events/EventConfig.d.ts +56291 -1361
- package/dist/commons/events/EventDocument.d.ts +1399 -394
- package/dist/commons/events/EventIndex.d.ts +1589 -30
- package/dist/commons/events/EventMetadata.d.ts +298 -48
- package/dist/commons/events/FieldConfig.d.ts +5414 -1057
- 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 +17 -52
- 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 +4775 -16
- package/dist/commons/events/defineConfig.d.ts +8981 -51
- 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 +6 -0
- package/dist/commons/events/scopes.d.ts +21 -1
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +149 -79
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13353 -68
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +76 -36
- package/dist/events/index.js +3464 -1333
- 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';
|
@@ -31,6 +34,9 @@ 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';
|
40
|
+
export * from './field';
|
41
|
+
export * from './event';
|
36
42
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1,7 +1,7 @@
|
|
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"];
|
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
5
|
export declare const ACTION_ALLOWED_SCOPES: {
|
6
6
|
READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
|
7
7
|
CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
|
@@ -21,5 +21,25 @@ export declare const ACTION_ALLOWED_SCOPES: {
|
|
21
21
|
UNASSIGN: null;
|
22
22
|
DETECT_DUPLICATE: [];
|
23
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;
|
24
44
|
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
25
45
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -1,53 +1,27 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { UUID } from '../uuid';
|
2
|
+
import { ActionDocument, EventState } from './ActionDocument';
|
3
|
+
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
3
4
|
import { ActionType } from './ActionType';
|
4
5
|
import { Draft } from './Draft';
|
5
6
|
import { EventConfig } from './EventConfig';
|
6
7
|
import { EventDocument } from './EventDocument';
|
7
8
|
import { EventIndex } from './EventIndex';
|
8
9
|
import { EventInput } from './EventInput';
|
9
|
-
import { FieldValue } from './FieldValue';
|
10
10
|
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: {
|
11
|
+
import { FieldConfig } from './FieldConfig';
|
12
|
+
import { WorkqueueConfig } from './WorkqueueConfig';
|
13
|
+
import { FieldValue } from './FieldValue';
|
14
|
+
export declare function generateRandomName(rng: () => number): {
|
15
|
+
firstname: string;
|
16
|
+
surname: string;
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* Quick-and-dirty mock data generator for event actions.
|
20
|
+
*/
|
21
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
|
22
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
|
23
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
|
24
|
+
export declare function eventPayloadGenerator(rng: () => number): {
|
51
25
|
create: (input?: Partial<EventInput>) => {
|
52
26
|
transactionId: string;
|
53
27
|
type: string;
|
@@ -58,12 +32,11 @@ export declare const eventPayloadGenerator: {
|
|
58
32
|
id: string;
|
59
33
|
};
|
60
34
|
draft: ({ eventId, actionType }: {
|
61
|
-
eventId:
|
35
|
+
eventId: UUID;
|
62
36
|
actionType: ActionType;
|
63
37
|
}, input?: Partial<Draft>) => Draft;
|
64
38
|
actions: {
|
65
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
66
|
-
type: "DECLARE";
|
39
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
67
40
|
transactionId: string;
|
68
41
|
declaration: Record<string, string | number | boolean | {
|
69
42
|
type: string;
|
@@ -80,6 +53,10 @@ export declare const eventPayloadGenerator: {
|
|
80
53
|
residentialArea?: string | null | undefined;
|
81
54
|
street?: string | null | undefined;
|
82
55
|
zipCode?: string | null | undefined;
|
56
|
+
} | {
|
57
|
+
firstname: string;
|
58
|
+
surname: string;
|
59
|
+
middlename?: string | null | undefined;
|
83
60
|
} | {
|
84
61
|
country: string;
|
85
62
|
district: string;
|
@@ -102,20 +79,19 @@ export declare const eventPayloadGenerator: {
|
|
102
79
|
option: string;
|
103
80
|
filename: string;
|
104
81
|
originalFilename: string;
|
105
|
-
}[] | undefined>;
|
82
|
+
}[] | [string, string] | null | undefined>;
|
106
83
|
annotation: {};
|
84
|
+
keepAssignment?: boolean | undefined;
|
85
|
+
type: "DECLARE";
|
107
86
|
eventId: string;
|
108
87
|
};
|
109
88
|
/**
|
110
89
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
111
90
|
*/
|
112
|
-
notify: (eventId: string, input?: {
|
113
|
-
transactionId?: string;
|
114
|
-
declaration?: Partial<ActionUpdate>;
|
115
|
-
}) => {
|
91
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
116
92
|
type: "NOTIFY";
|
117
93
|
transactionId: string;
|
118
|
-
declaration:
|
94
|
+
declaration: Record<string, string | number | boolean | {
|
119
95
|
type: string;
|
120
96
|
filename: string;
|
121
97
|
originalFilename: string;
|
@@ -130,6 +106,10 @@ export declare const eventPayloadGenerator: {
|
|
130
106
|
residentialArea?: string | null | undefined;
|
131
107
|
street?: string | null | undefined;
|
132
108
|
zipCode?: string | null | undefined;
|
109
|
+
} | {
|
110
|
+
firstname: string;
|
111
|
+
surname: string;
|
112
|
+
middlename?: string | null | undefined;
|
133
113
|
} | {
|
134
114
|
country: string;
|
135
115
|
district: string;
|
@@ -152,11 +132,11 @@ export declare const eventPayloadGenerator: {
|
|
152
132
|
option: string;
|
153
133
|
filename: string;
|
154
134
|
originalFilename: string;
|
155
|
-
}[] | undefined
|
135
|
+
}[] | [string, string] | null | undefined>;
|
156
136
|
eventId: string;
|
137
|
+
keepAssignment: boolean | undefined;
|
157
138
|
};
|
158
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
159
|
-
type: "VALIDATE";
|
139
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
160
140
|
transactionId: string;
|
161
141
|
declaration: Record<string, string | number | boolean | {
|
162
142
|
type: string;
|
@@ -173,6 +153,10 @@ export declare const eventPayloadGenerator: {
|
|
173
153
|
residentialArea?: string | null | undefined;
|
174
154
|
street?: string | null | undefined;
|
175
155
|
zipCode?: string | null | undefined;
|
156
|
+
} | {
|
157
|
+
firstname: string;
|
158
|
+
surname: string;
|
159
|
+
middlename?: string | null | undefined;
|
176
160
|
} | {
|
177
161
|
country: string;
|
178
162
|
district: string;
|
@@ -195,8 +179,10 @@ export declare const eventPayloadGenerator: {
|
|
195
179
|
option: string;
|
196
180
|
filename: string;
|
197
181
|
originalFilename: string;
|
198
|
-
}[] | undefined>;
|
182
|
+
}[] | [string, string] | null | undefined>;
|
199
183
|
annotation: {};
|
184
|
+
keepAssignment?: boolean | undefined;
|
185
|
+
type: "VALIDATE";
|
200
186
|
duplicates: never[];
|
201
187
|
eventId: string;
|
202
188
|
};
|
@@ -214,26 +200,73 @@ export declare const eventPayloadGenerator: {
|
|
214
200
|
assignedTo: null;
|
215
201
|
eventId: string;
|
216
202
|
};
|
217
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
218
|
-
type: "ARCHIVE";
|
203
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
219
204
|
transactionId: string;
|
220
|
-
declaration: {
|
221
|
-
|
222
|
-
|
223
|
-
|
205
|
+
declaration: Record<string, string | number | boolean | {
|
206
|
+
type: string;
|
207
|
+
filename: string;
|
208
|
+
originalFilename: string;
|
209
|
+
} | {
|
210
|
+
country: string;
|
211
|
+
district: string;
|
212
|
+
addressType: "DOMESTIC";
|
213
|
+
province: string;
|
214
|
+
urbanOrRural: "URBAN";
|
215
|
+
number?: string | null | undefined;
|
216
|
+
town?: string | null | undefined;
|
217
|
+
residentialArea?: string | null | undefined;
|
218
|
+
street?: string | null | undefined;
|
219
|
+
zipCode?: string | null | undefined;
|
220
|
+
} | {
|
221
|
+
firstname: string;
|
222
|
+
surname: string;
|
223
|
+
middlename?: string | null | undefined;
|
224
|
+
} | {
|
225
|
+
country: string;
|
226
|
+
district: string;
|
227
|
+
addressType: "DOMESTIC";
|
228
|
+
province: string;
|
229
|
+
urbanOrRural: "RURAL";
|
230
|
+
village?: string | null | undefined;
|
231
|
+
} | {
|
232
|
+
country: string;
|
233
|
+
state: string;
|
234
|
+
addressType: "INTERNATIONAL";
|
235
|
+
district2: string;
|
236
|
+
cityOrTown?: string | null | undefined;
|
237
|
+
addressLine1?: string | null | undefined;
|
238
|
+
addressLine2?: string | null | undefined;
|
239
|
+
addressLine3?: string | null | undefined;
|
240
|
+
postcodeOrZip?: string | null | undefined;
|
241
|
+
} | {
|
242
|
+
type: string;
|
243
|
+
option: string;
|
244
|
+
filename: string;
|
245
|
+
originalFilename: string;
|
246
|
+
}[] | [string, string] | null | undefined>;
|
247
|
+
keepAssignment?: boolean | undefined;
|
248
|
+
type: "ARCHIVE";
|
249
|
+
annotation: {};
|
224
250
|
duplicates: never[];
|
225
251
|
eventId: string;
|
252
|
+
reason: {
|
253
|
+
message: string;
|
254
|
+
isDuplicate: boolean;
|
255
|
+
};
|
226
256
|
};
|
227
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
228
|
-
type: "REJECT";
|
257
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
229
258
|
transactionId: string;
|
230
|
-
declaration: {};
|
231
259
|
annotation: {};
|
260
|
+
keepAssignment?: boolean | undefined;
|
261
|
+
type: "REJECT";
|
262
|
+
declaration: {};
|
232
263
|
duplicates: never[];
|
233
264
|
eventId: string;
|
265
|
+
reason: {
|
266
|
+
message: string;
|
267
|
+
};
|
234
268
|
};
|
235
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
236
|
-
type: "REGISTER";
|
269
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
237
270
|
transactionId: string;
|
238
271
|
declaration: Record<string, string | number | boolean | {
|
239
272
|
type: string;
|
@@ -250,6 +283,10 @@ export declare const eventPayloadGenerator: {
|
|
250
283
|
residentialArea?: string | null | undefined;
|
251
284
|
street?: string | null | undefined;
|
252
285
|
zipCode?: string | null | undefined;
|
286
|
+
} | {
|
287
|
+
firstname: string;
|
288
|
+
surname: string;
|
289
|
+
middlename?: string | null | undefined;
|
253
290
|
} | {
|
254
291
|
country: string;
|
255
292
|
district: string;
|
@@ -272,19 +309,22 @@ export declare const eventPayloadGenerator: {
|
|
272
309
|
option: string;
|
273
310
|
filename: string;
|
274
311
|
originalFilename: string;
|
275
|
-
}[] | undefined>;
|
312
|
+
}[] | [string, string] | null | undefined>;
|
276
313
|
annotation: {};
|
314
|
+
keepAssignment?: boolean | undefined;
|
315
|
+
type: "REGISTER";
|
277
316
|
eventId: string;
|
278
317
|
};
|
279
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
280
|
-
type: "PRINT_CERTIFICATE";
|
318
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
281
319
|
transactionId: string;
|
282
|
-
declaration: {};
|
283
320
|
annotation: {};
|
321
|
+
keepAssignment?: boolean | undefined;
|
322
|
+
type: "PRINT_CERTIFICATE";
|
323
|
+
declaration: {};
|
284
324
|
eventId: string;
|
285
325
|
};
|
286
326
|
correction: {
|
287
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
327
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
288
328
|
type: "REQUEST_CORRECTION";
|
289
329
|
transactionId: string;
|
290
330
|
declaration: Record<string, string | number | boolean | {
|
@@ -302,6 +342,10 @@ export declare const eventPayloadGenerator: {
|
|
302
342
|
residentialArea?: string | null | undefined;
|
303
343
|
street?: string | null | undefined;
|
304
344
|
zipCode?: string | null | undefined;
|
345
|
+
} | {
|
346
|
+
firstname: string;
|
347
|
+
surname: string;
|
348
|
+
middlename?: string | null | undefined;
|
305
349
|
} | {
|
306
350
|
country: string;
|
307
351
|
district: string;
|
@@ -324,39 +368,65 @@ export declare const eventPayloadGenerator: {
|
|
324
368
|
option: string;
|
325
369
|
filename: string;
|
326
370
|
originalFilename: string;
|
327
|
-
}[] | undefined>;
|
371
|
+
}[] | [string, string] | null | undefined>;
|
328
372
|
annotation: {};
|
329
373
|
eventId: string;
|
374
|
+
keepAssignment: boolean | undefined;
|
330
375
|
};
|
331
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
376
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
332
377
|
type: "APPROVE_CORRECTION";
|
333
378
|
transactionId: string;
|
334
379
|
declaration: {};
|
335
380
|
annotation: {};
|
336
381
|
eventId: string;
|
337
382
|
requestId: string;
|
383
|
+
keepAssignment: boolean | undefined;
|
338
384
|
};
|
339
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
385
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
340
386
|
type: "REJECT_CORRECTION";
|
341
387
|
transactionId: string;
|
342
388
|
declaration: {};
|
343
389
|
annotation: {};
|
344
390
|
eventId: string;
|
345
391
|
requestId: string;
|
392
|
+
keepAssignment: boolean | undefined;
|
346
393
|
};
|
347
394
|
};
|
348
395
|
};
|
349
396
|
};
|
350
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
397
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults }: {
|
351
398
|
configuration: EventConfig;
|
352
399
|
action: ActionType;
|
400
|
+
rng?: () => number;
|
353
401
|
defaults?: Partial<ActionDocument>;
|
354
402
|
}): ActionDocument;
|
355
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
403
|
+
export declare function generateEventDocument({ configuration, actions, rng }: {
|
356
404
|
configuration: EventConfig;
|
357
405
|
actions: ActionType[];
|
406
|
+
rng?: () => number;
|
358
407
|
}): EventDocument;
|
359
|
-
export declare function generateEventDraftDocument(eventId
|
360
|
-
|
408
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
409
|
+
eventId: UUID;
|
410
|
+
actionType: ActionType;
|
411
|
+
rng?: () => number;
|
412
|
+
declaration?: EventState;
|
413
|
+
}): Draft;
|
414
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
415
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
416
|
+
/**
|
417
|
+
* Useful for testing when we need deterministic outcome.
|
418
|
+
* @param seed - Seed value for the pseudo-random number generator
|
419
|
+
*
|
420
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
421
|
+
*/
|
422
|
+
export declare function createPrng(seed: number): () => number;
|
423
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
424
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
361
425
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
426
|
+
export declare const BearerTokenByUserType: {
|
427
|
+
fieldAgent: string;
|
428
|
+
registrationAgent: string;
|
429
|
+
localRegistrar: string;
|
430
|
+
};
|
431
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
362
432
|
//# sourceMappingURL=test.utils.d.ts.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare function generateTransactionId(): import("
|
1
|
+
export declare function generateTransactionId(): string & import("zod").BRAND<"UUID">;
|
2
2
|
//# sourceMappingURL=transactions.d.ts.map
|