@opencrvs/toolkit 1.8.0-rc.f97f8f2 → 1.8.0-rc.f988670
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 +10613 -8753
- package/dist/commons/conditionals/conditionals.d.ts +7 -14
- package/dist/commons/conditionals/validate.d.ts +14 -0
- package/dist/commons/events/ActionConfig.d.ts +82300 -42816
- package/dist/commons/events/ActionDocument.d.ts +3996 -1262
- package/dist/commons/events/ActionInput.d.ts +3139 -967
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +981 -47
- package/dist/commons/events/CompositeFieldValue.d.ts +37 -9
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +3069 -443
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +273 -95
- package/dist/commons/events/EventConfig.d.ts +33357 -14451
- package/dist/commons/events/EventDocument.d.ts +2554 -848
- package/dist/commons/events/EventIndex.d.ts +1281 -495
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +126 -92
- package/dist/commons/events/FieldConfig.d.ts +4564 -1588
- package/dist/commons/events/FieldType.d.ts +10 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +149 -75
- package/dist/commons/events/FieldValue.d.ts +87 -20
- package/dist/commons/events/FormConfig.d.ts +22178 -8396
- package/dist/commons/events/PageConfig.d.ts +5525 -2087
- package/dist/commons/events/SummaryConfig.d.ts +0 -5
- package/dist/commons/events/User.d.ts +6 -3
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +18 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +6406 -1001
- package/dist/commons/events/defineConfig.d.ts +3797 -870
- package/dist/commons/events/event.d.ts +41 -14
- package/dist/commons/events/field.d.ts +55 -15
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/scopes.d.ts +21 -3
- package/dist/commons/events/test.utils.d.ts +208 -54
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +14039 -1170
- package/dist/conditionals/index.js +69 -62
- package/dist/events/index.js +3836 -1956
- package/dist/scopes/index.d.ts +147 -5
- package/dist/scopes/index.js +133 -43
- package/package.json +3 -3
- package/tsconfig.json +1 -1
- package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
- package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
- package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { ActionType } from './ActionType';
|
2
|
+
import { EventFieldIdInput } from './AdvancedSearchConfig';
|
3
|
+
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
4
|
/**
|
5
5
|
* Creates a function that acts like a callable + static method container.
|
6
6
|
*
|
@@ -8,20 +8,47 @@ import { SelectOption } from './FieldConfig';
|
|
8
8
|
* event('status') // → returns search config
|
9
9
|
* event.hasAction('CLICKED') // → returns conditional
|
10
10
|
*/
|
11
|
-
declare function eventFn(fieldId:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
declare function eventFn(fieldId: EventFieldIdInput): {
|
12
|
+
range: () => {
|
13
|
+
fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
|
14
|
+
fieldType: "event";
|
15
|
+
} & {
|
16
|
+
config: {
|
17
|
+
type: "range";
|
18
|
+
};
|
19
|
+
};
|
20
|
+
exact: () => {
|
21
|
+
fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
|
22
|
+
fieldType: "event";
|
23
|
+
} & {
|
24
|
+
config: {
|
25
|
+
type: "exact";
|
26
|
+
};
|
27
|
+
};
|
28
|
+
fuzzy: () => {
|
29
|
+
fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
|
30
|
+
fieldType: "event";
|
31
|
+
} & {
|
32
|
+
config: {
|
33
|
+
type: "fuzzy";
|
34
|
+
};
|
35
|
+
};
|
36
|
+
within: () => {
|
37
|
+
fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
|
38
|
+
fieldType: "event";
|
39
|
+
} & {
|
40
|
+
config: {
|
41
|
+
type: "within";
|
42
|
+
};
|
19
43
|
};
|
20
|
-
fieldType: "event";
|
21
44
|
};
|
22
45
|
declare const event: typeof eventFn & {
|
23
|
-
|
24
|
-
|
46
|
+
/**
|
47
|
+
* Checks if the event contains a specific action type.
|
48
|
+
* @param action - The action type to check for.
|
49
|
+
*/
|
50
|
+
hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
|
51
|
+
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
25
52
|
};
|
26
53
|
export { event };
|
27
54
|
//# sourceMappingURL=event.d.ts.map
|
@@ -1,38 +1,83 @@
|
|
1
|
+
import { FieldConditional } from './Conditional';
|
2
|
+
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
import { SelectOption, ValidationConfig } from './FieldConfig';
|
1
4
|
/**
|
2
5
|
* Entry point for defining conditional logic or configuration for a form field.
|
3
6
|
* @param fieldId - The ID of the field to define rules or config for.
|
4
7
|
* @returns An object combining conditional methods and configuration builders.
|
5
8
|
*/
|
6
|
-
export declare function field(fieldId: string
|
9
|
+
export declare function field(fieldId: string, options?: {
|
10
|
+
options?: SelectOption[];
|
11
|
+
excludeInSearchQuery?: boolean;
|
12
|
+
alternateFieldIds?: string[];
|
13
|
+
conditionals?: FieldConditional[];
|
14
|
+
validations?: ValidationConfig[];
|
15
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
16
|
+
}): {
|
7
17
|
range: () => {
|
18
|
+
options?: SelectOption[];
|
19
|
+
excludeInSearchQuery?: boolean;
|
20
|
+
alternateFieldIds?: string[];
|
21
|
+
conditionals?: FieldConditional[];
|
22
|
+
validations?: ValidationConfig[];
|
23
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
24
|
+
fieldId: string;
|
25
|
+
fieldType: "field";
|
26
|
+
} & {
|
8
27
|
config: {
|
9
28
|
type: "range";
|
10
29
|
};
|
11
|
-
fieldId: string;
|
12
|
-
fieldType: "field";
|
13
30
|
};
|
14
31
|
exact: () => {
|
32
|
+
options?: SelectOption[];
|
33
|
+
excludeInSearchQuery?: boolean;
|
34
|
+
alternateFieldIds?: string[];
|
35
|
+
conditionals?: FieldConditional[];
|
36
|
+
validations?: ValidationConfig[];
|
37
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
38
|
+
fieldId: string;
|
39
|
+
fieldType: "field";
|
40
|
+
} & {
|
15
41
|
config: {
|
16
42
|
type: "exact";
|
17
43
|
};
|
18
|
-
fieldId: string;
|
19
|
-
fieldType: "field";
|
20
44
|
};
|
21
45
|
fuzzy: () => {
|
46
|
+
options?: SelectOption[];
|
47
|
+
excludeInSearchQuery?: boolean;
|
48
|
+
alternateFieldIds?: string[];
|
49
|
+
conditionals?: FieldConditional[];
|
50
|
+
validations?: ValidationConfig[];
|
51
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
52
|
+
fieldId: string;
|
53
|
+
fieldType: "field";
|
54
|
+
} & {
|
22
55
|
config: {
|
23
56
|
type: "fuzzy";
|
24
57
|
};
|
58
|
+
};
|
59
|
+
within: () => {
|
60
|
+
options?: SelectOption[];
|
61
|
+
excludeInSearchQuery?: boolean;
|
62
|
+
alternateFieldIds?: string[];
|
63
|
+
conditionals?: FieldConditional[];
|
64
|
+
validations?: ValidationConfig[];
|
65
|
+
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
66
|
fieldId: string;
|
26
67
|
fieldType: "field";
|
68
|
+
} & {
|
69
|
+
config: {
|
70
|
+
type: "within";
|
71
|
+
};
|
27
72
|
};
|
73
|
+
$$field: string;
|
28
74
|
isAfter: () => {
|
29
75
|
days: (days: number) => {
|
30
76
|
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
31
77
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
32
78
|
};
|
33
79
|
date: (date: string | {
|
34
|
-
|
35
|
-
_fieldId: string;
|
80
|
+
$$field: string;
|
36
81
|
}) => import("../conditionals/conditionals").JSONSchema;
|
37
82
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
38
83
|
};
|
@@ -42,14 +87,12 @@ export declare function field(fieldId: string): {
|
|
42
87
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
43
88
|
};
|
44
89
|
date: (date: string | {
|
45
|
-
|
46
|
-
_fieldId: string;
|
90
|
+
$$field: string;
|
47
91
|
}) => import("../conditionals/conditionals").JSONSchema;
|
48
92
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
49
93
|
};
|
50
94
|
isEqualTo: (value: string | boolean | {
|
51
|
-
|
52
|
-
_fieldId: string;
|
95
|
+
$$field: string;
|
53
96
|
}) => import("../conditionals/conditionals").JSONSchema;
|
54
97
|
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
55
98
|
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
@@ -60,9 +103,6 @@ export declare function field(fieldId: string): {
|
|
60
103
|
getId: () => {
|
61
104
|
fieldId: string;
|
62
105
|
};
|
63
|
-
|
64
|
-
* @private Internal property used for field reference tracking.
|
65
|
-
*/
|
66
|
-
_fieldId: string;
|
106
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
67
107
|
};
|
68
108
|
//# sourceMappingURL=field.d.ts.map
|
@@ -1,3 +1,4 @@
|
|
1
|
+
export * from './Constants';
|
1
2
|
export * from './ActionConfig';
|
2
3
|
export * from './offline';
|
3
4
|
export * from './EventConfig';
|
@@ -34,6 +35,7 @@ export * from './test.utils';
|
|
34
35
|
export * from './TemplateConfig';
|
35
36
|
export * from './scopes';
|
36
37
|
export * from './serializer';
|
38
|
+
export * from './state/availableActions';
|
37
39
|
export * from '../conditionals/conditionals';
|
38
40
|
export * from '../conditionals/validate';
|
39
41
|
export * from './field';
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import { Scope } from '../scopes';
|
2
|
-
import { ActionType } from './ActionType';
|
3
|
-
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
4
2
|
export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"];
|
5
3
|
export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[];
|
6
4
|
export declare const ACTION_ALLOWED_SCOPES: {
|
@@ -22,5 +20,25 @@ export declare const ACTION_ALLOWED_SCOPES: {
|
|
22
20
|
UNASSIGN: null;
|
23
21
|
DETECT_DUPLICATE: [];
|
24
22
|
};
|
25
|
-
export declare
|
23
|
+
export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
24
|
+
READ: never[];
|
25
|
+
CREATE: "record.notify"[];
|
26
|
+
NOTIFY: "record.notify"[];
|
27
|
+
DECLARE: never[];
|
28
|
+
DELETE: never[];
|
29
|
+
VALIDATE: never[];
|
30
|
+
REGISTER: never[];
|
31
|
+
PRINT_CERTIFICATE: never[];
|
32
|
+
REQUEST_CORRECTION: never[];
|
33
|
+
REJECT_CORRECTION: never[];
|
34
|
+
APPROVE_CORRECTION: never[];
|
35
|
+
MARKED_AS_DUPLICATE: never[];
|
36
|
+
ARCHIVE: never[];
|
37
|
+
REJECT: never[];
|
38
|
+
ASSIGN: never[];
|
39
|
+
UNASSIGN: never[];
|
40
|
+
DETECT_DUPLICATE: never[];
|
41
|
+
};
|
42
|
+
export declare const WRITE_ACTION_SCOPES: ("record.declare-birth" | "record.declaration-submit-for-approval" | "record.register" | "record.registration-print&issue-certified-copies")[];
|
43
|
+
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
26
44
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -1,16 +1,39 @@
|
|
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
|
-
|
11
|
+
import { FieldConfig } from './FieldConfig';
|
12
|
+
import { WorkqueueConfig } from './WorkqueueConfig';
|
13
|
+
import { FieldValue } from './FieldValue';
|
14
|
+
import { z } from 'zod';
|
15
|
+
/**
|
16
|
+
* IANA timezone used in testing. Used for queries that expect similar results independent of the users location (e.g. when event was registered.)
|
17
|
+
* Since we query by range, providing UTC offset will result to different results when DST changes during the range.
|
18
|
+
*/
|
19
|
+
export declare const TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
20
|
+
/**
|
21
|
+
* In real application, the roles are defined in the countryconfig.
|
22
|
+
* These are just for testing purposes to generate realistic mock data.
|
23
|
+
*/
|
24
|
+
export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT"]>;
|
25
|
+
export type TestUserRole = z.infer<typeof TestUserRole>;
|
26
|
+
export declare function generateRandomName(rng: () => number): {
|
27
|
+
firstname: string;
|
28
|
+
surname: string;
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* Quick-and-dirty mock data generator for event actions.
|
32
|
+
*/
|
33
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
|
34
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
|
35
|
+
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
|
36
|
+
export declare function eventPayloadGenerator(rng: () => number): {
|
14
37
|
create: (input?: Partial<EventInput>) => {
|
15
38
|
transactionId: string;
|
16
39
|
type: string;
|
@@ -20,17 +43,17 @@ export declare const eventPayloadGenerator: {
|
|
20
43
|
type: string;
|
21
44
|
id: string;
|
22
45
|
};
|
23
|
-
draft: ({ eventId, actionType }: {
|
24
|
-
eventId:
|
25
|
-
actionType:
|
46
|
+
draft: ({ eventId, actionType, annotation }: {
|
47
|
+
eventId: UUID;
|
48
|
+
actionType: Draft["action"]["type"];
|
49
|
+
annotation?: Record<string, any>;
|
26
50
|
}, input?: Partial<Draft>) => Draft;
|
27
51
|
actions: {
|
28
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
29
|
-
type: "DECLARE";
|
52
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
30
53
|
transactionId: string;
|
31
54
|
declaration: Record<string, string | number | boolean | {
|
32
55
|
type: string;
|
33
|
-
|
56
|
+
path: string;
|
34
57
|
originalFilename: string;
|
35
58
|
} | {
|
36
59
|
country: string;
|
@@ -43,6 +66,10 @@ export declare const eventPayloadGenerator: {
|
|
43
66
|
residentialArea?: string | null | undefined;
|
44
67
|
street?: string | null | undefined;
|
45
68
|
zipCode?: string | null | undefined;
|
69
|
+
} | {
|
70
|
+
firstname: string;
|
71
|
+
surname: string;
|
72
|
+
middlename?: string | null | undefined;
|
46
73
|
} | {
|
47
74
|
country: string;
|
48
75
|
district: string;
|
@@ -63,24 +90,26 @@ export declare const eventPayloadGenerator: {
|
|
63
90
|
} | {
|
64
91
|
type: string;
|
65
92
|
option: string;
|
66
|
-
|
93
|
+
path: string;
|
67
94
|
originalFilename: string;
|
68
|
-
}[] |
|
95
|
+
}[] | {
|
96
|
+
start: string;
|
97
|
+
end: string;
|
98
|
+
} | null | undefined>;
|
69
99
|
annotation: {};
|
100
|
+
keepAssignment?: boolean | undefined;
|
101
|
+
type: "DECLARE";
|
70
102
|
eventId: string;
|
71
103
|
};
|
72
104
|
/**
|
73
105
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
74
106
|
*/
|
75
|
-
notify: (eventId: string, input?: {
|
76
|
-
transactionId?: string;
|
77
|
-
declaration?: Partial<ActionUpdate>;
|
78
|
-
}) => {
|
107
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
79
108
|
type: "NOTIFY";
|
80
109
|
transactionId: string;
|
81
|
-
declaration:
|
110
|
+
declaration: Record<string, string | number | boolean | {
|
82
111
|
type: string;
|
83
|
-
|
112
|
+
path: string;
|
84
113
|
originalFilename: string;
|
85
114
|
} | {
|
86
115
|
country: string;
|
@@ -93,6 +122,10 @@ export declare const eventPayloadGenerator: {
|
|
93
122
|
residentialArea?: string | null | undefined;
|
94
123
|
street?: string | null | undefined;
|
95
124
|
zipCode?: string | null | undefined;
|
125
|
+
} | {
|
126
|
+
firstname: string;
|
127
|
+
surname: string;
|
128
|
+
middlename?: string | null | undefined;
|
96
129
|
} | {
|
97
130
|
country: string;
|
98
131
|
district: string;
|
@@ -113,17 +146,20 @@ export declare const eventPayloadGenerator: {
|
|
113
146
|
} | {
|
114
147
|
type: string;
|
115
148
|
option: string;
|
116
|
-
|
149
|
+
path: string;
|
117
150
|
originalFilename: string;
|
118
|
-
}[] |
|
151
|
+
}[] | {
|
152
|
+
start: string;
|
153
|
+
end: string;
|
154
|
+
} | null | undefined>;
|
119
155
|
eventId: string;
|
156
|
+
keepAssignment: boolean | undefined;
|
120
157
|
};
|
121
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
122
|
-
type: "VALIDATE";
|
158
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
123
159
|
transactionId: string;
|
124
160
|
declaration: Record<string, string | number | boolean | {
|
125
161
|
type: string;
|
126
|
-
|
162
|
+
path: string;
|
127
163
|
originalFilename: string;
|
128
164
|
} | {
|
129
165
|
country: string;
|
@@ -136,6 +172,10 @@ export declare const eventPayloadGenerator: {
|
|
136
172
|
residentialArea?: string | null | undefined;
|
137
173
|
street?: string | null | undefined;
|
138
174
|
zipCode?: string | null | undefined;
|
175
|
+
} | {
|
176
|
+
firstname: string;
|
177
|
+
surname: string;
|
178
|
+
middlename?: string | null | undefined;
|
139
179
|
} | {
|
140
180
|
country: string;
|
141
181
|
district: string;
|
@@ -156,10 +196,15 @@ export declare const eventPayloadGenerator: {
|
|
156
196
|
} | {
|
157
197
|
type: string;
|
158
198
|
option: string;
|
159
|
-
|
199
|
+
path: string;
|
160
200
|
originalFilename: string;
|
161
|
-
}[] |
|
201
|
+
}[] | {
|
202
|
+
start: string;
|
203
|
+
end: string;
|
204
|
+
} | null | undefined>;
|
162
205
|
annotation: {};
|
206
|
+
keepAssignment?: boolean | undefined;
|
207
|
+
type: "VALIDATE";
|
163
208
|
duplicates: never[];
|
164
209
|
eventId: string;
|
165
210
|
};
|
@@ -177,30 +222,80 @@ export declare const eventPayloadGenerator: {
|
|
177
222
|
assignedTo: null;
|
178
223
|
eventId: string;
|
179
224
|
};
|
180
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
181
|
-
type: "ARCHIVE";
|
225
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
182
226
|
transactionId: string;
|
183
|
-
declaration: {
|
184
|
-
|
185
|
-
|
186
|
-
|
227
|
+
declaration: Record<string, string | number | boolean | {
|
228
|
+
type: string;
|
229
|
+
path: string;
|
230
|
+
originalFilename: string;
|
231
|
+
} | {
|
232
|
+
country: string;
|
233
|
+
district: string;
|
234
|
+
addressType: "DOMESTIC";
|
235
|
+
province: string;
|
236
|
+
urbanOrRural: "URBAN";
|
237
|
+
number?: string | null | undefined;
|
238
|
+
town?: string | null | undefined;
|
239
|
+
residentialArea?: string | null | undefined;
|
240
|
+
street?: string | null | undefined;
|
241
|
+
zipCode?: string | null | undefined;
|
242
|
+
} | {
|
243
|
+
firstname: string;
|
244
|
+
surname: string;
|
245
|
+
middlename?: string | null | undefined;
|
246
|
+
} | {
|
247
|
+
country: string;
|
248
|
+
district: string;
|
249
|
+
addressType: "DOMESTIC";
|
250
|
+
province: string;
|
251
|
+
urbanOrRural: "RURAL";
|
252
|
+
village?: string | null | undefined;
|
253
|
+
} | {
|
254
|
+
country: string;
|
255
|
+
state: string;
|
256
|
+
addressType: "INTERNATIONAL";
|
257
|
+
district2: string;
|
258
|
+
cityOrTown?: string | null | undefined;
|
259
|
+
addressLine1?: string | null | undefined;
|
260
|
+
addressLine2?: string | null | undefined;
|
261
|
+
addressLine3?: string | null | undefined;
|
262
|
+
postcodeOrZip?: string | null | undefined;
|
263
|
+
} | {
|
264
|
+
type: string;
|
265
|
+
option: string;
|
266
|
+
path: string;
|
267
|
+
originalFilename: string;
|
268
|
+
}[] | {
|
269
|
+
start: string;
|
270
|
+
end: string;
|
271
|
+
} | null | undefined>;
|
272
|
+
keepAssignment?: boolean | undefined;
|
273
|
+
type: "ARCHIVE";
|
274
|
+
annotation: {};
|
187
275
|
duplicates: never[];
|
188
276
|
eventId: string;
|
277
|
+
reason: {
|
278
|
+
message: string;
|
279
|
+
isDuplicate: boolean;
|
280
|
+
};
|
189
281
|
};
|
190
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
191
|
-
type: "REJECT";
|
282
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
192
283
|
transactionId: string;
|
193
|
-
declaration: {};
|
194
284
|
annotation: {};
|
285
|
+
keepAssignment?: boolean | undefined;
|
286
|
+
type: "REJECT";
|
287
|
+
declaration: {};
|
195
288
|
duplicates: never[];
|
196
289
|
eventId: string;
|
290
|
+
reason: {
|
291
|
+
message: string;
|
292
|
+
};
|
197
293
|
};
|
198
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
199
|
-
type: "REGISTER";
|
294
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
200
295
|
transactionId: string;
|
201
296
|
declaration: Record<string, string | number | boolean | {
|
202
297
|
type: string;
|
203
|
-
|
298
|
+
path: string;
|
204
299
|
originalFilename: string;
|
205
300
|
} | {
|
206
301
|
country: string;
|
@@ -213,6 +308,10 @@ export declare const eventPayloadGenerator: {
|
|
213
308
|
residentialArea?: string | null | undefined;
|
214
309
|
street?: string | null | undefined;
|
215
310
|
zipCode?: string | null | undefined;
|
311
|
+
} | {
|
312
|
+
firstname: string;
|
313
|
+
surname: string;
|
314
|
+
middlename?: string | null | undefined;
|
216
315
|
} | {
|
217
316
|
country: string;
|
218
317
|
district: string;
|
@@ -233,26 +332,33 @@ export declare const eventPayloadGenerator: {
|
|
233
332
|
} | {
|
234
333
|
type: string;
|
235
334
|
option: string;
|
236
|
-
|
335
|
+
path: string;
|
237
336
|
originalFilename: string;
|
238
|
-
}[] |
|
337
|
+
}[] | {
|
338
|
+
start: string;
|
339
|
+
end: string;
|
340
|
+
} | null | undefined>;
|
239
341
|
annotation: {};
|
342
|
+
registrationNumber?: string | undefined;
|
343
|
+
keepAssignment?: boolean | undefined;
|
344
|
+
type: "REGISTER";
|
240
345
|
eventId: string;
|
241
346
|
};
|
242
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
243
|
-
type: "PRINT_CERTIFICATE";
|
347
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
244
348
|
transactionId: string;
|
245
|
-
declaration: {};
|
246
349
|
annotation: {};
|
350
|
+
keepAssignment?: boolean | undefined;
|
351
|
+
type: "PRINT_CERTIFICATE";
|
352
|
+
declaration: {};
|
247
353
|
eventId: string;
|
248
354
|
};
|
249
355
|
correction: {
|
250
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
356
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
251
357
|
type: "REQUEST_CORRECTION";
|
252
358
|
transactionId: string;
|
253
359
|
declaration: Record<string, string | number | boolean | {
|
254
360
|
type: string;
|
255
|
-
|
361
|
+
path: string;
|
256
362
|
originalFilename: string;
|
257
363
|
} | {
|
258
364
|
country: string;
|
@@ -265,6 +371,10 @@ export declare const eventPayloadGenerator: {
|
|
265
371
|
residentialArea?: string | null | undefined;
|
266
372
|
street?: string | null | undefined;
|
267
373
|
zipCode?: string | null | undefined;
|
374
|
+
} | {
|
375
|
+
firstname: string;
|
376
|
+
surname: string;
|
377
|
+
middlename?: string | null | undefined;
|
268
378
|
} | {
|
269
379
|
country: string;
|
270
380
|
district: string;
|
@@ -285,41 +395,85 @@ export declare const eventPayloadGenerator: {
|
|
285
395
|
} | {
|
286
396
|
type: string;
|
287
397
|
option: string;
|
288
|
-
|
398
|
+
path: string;
|
289
399
|
originalFilename: string;
|
290
|
-
}[] |
|
400
|
+
}[] | {
|
401
|
+
start: string;
|
402
|
+
end: string;
|
403
|
+
} | null | undefined>;
|
291
404
|
annotation: {};
|
292
405
|
eventId: string;
|
406
|
+
keepAssignment: boolean | undefined;
|
293
407
|
};
|
294
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
408
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
295
409
|
type: "APPROVE_CORRECTION";
|
296
410
|
transactionId: string;
|
297
411
|
declaration: {};
|
298
412
|
annotation: {};
|
299
413
|
eventId: string;
|
300
414
|
requestId: string;
|
415
|
+
keepAssignment: boolean | undefined;
|
301
416
|
};
|
302
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
417
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
303
418
|
type: "REJECT_CORRECTION";
|
304
419
|
transactionId: string;
|
305
420
|
declaration: {};
|
306
421
|
annotation: {};
|
307
422
|
eventId: string;
|
308
423
|
requestId: string;
|
424
|
+
keepAssignment: boolean | undefined;
|
309
425
|
};
|
310
426
|
};
|
311
427
|
};
|
312
428
|
};
|
313
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
429
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
314
430
|
configuration: EventConfig;
|
315
431
|
action: ActionType;
|
432
|
+
rng?: () => number;
|
316
433
|
defaults?: Partial<ActionDocument>;
|
434
|
+
user?: Partial<{
|
435
|
+
signature: string;
|
436
|
+
primaryOfficeId: UUID;
|
437
|
+
role: TestUserRole;
|
438
|
+
id: string;
|
439
|
+
}>;
|
317
440
|
}): ActionDocument;
|
318
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
441
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
319
442
|
configuration: EventConfig;
|
320
443
|
actions: ActionType[];
|
444
|
+
rng?: () => number;
|
445
|
+
user?: Partial<{
|
446
|
+
signature: string;
|
447
|
+
primaryOfficeId: UUID;
|
448
|
+
role: TestUserRole;
|
449
|
+
id: string;
|
450
|
+
}>;
|
321
451
|
}): EventDocument;
|
322
|
-
export declare function generateEventDraftDocument(eventId
|
323
|
-
|
452
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
453
|
+
eventId: UUID;
|
454
|
+
actionType: ActionType;
|
455
|
+
rng?: () => number;
|
456
|
+
declaration?: EventState;
|
457
|
+
annotation?: EventState;
|
458
|
+
}): Draft;
|
459
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
460
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
461
|
+
/**
|
462
|
+
* Useful for testing when we need deterministic outcome.
|
463
|
+
* @param seed - Seed value for the pseudo-random number generator
|
464
|
+
*
|
465
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
466
|
+
*/
|
467
|
+
export declare function createPrng(seed: number): () => number;
|
468
|
+
export declare function generateUuid(rng?: () => number): UUID;
|
469
|
+
export declare function generateRegistrationNumber(rng: () => number): string;
|
470
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
471
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
324
472
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
473
|
+
export declare const BearerTokenByUserType: {
|
474
|
+
fieldAgent: string;
|
475
|
+
registrationAgent: string;
|
476
|
+
localRegistrar: string;
|
477
|
+
};
|
478
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
325
479
|
//# 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
|