@opencrvs/toolkit 1.8.0-rc.fef85f2 → 1.8.0-rc.ff0a1b5
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 +7684 -4215
- package/dist/commons/conditionals/conditionals.d.ts +9 -6
- package/dist/commons/events/ActionConfig.d.ts +90025 -1680
- package/dist/commons/events/ActionDocument.d.ts +542 -211
- package/dist/commons/events/ActionInput.d.ts +248 -240
- package/dist/commons/events/AdvancedSearchConfig.d.ts +369 -25
- package/dist/commons/events/Draft.d.ts +33 -20
- package/dist/commons/events/EventConfig.d.ts +42730 -1400
- package/dist/commons/events/EventDocument.d.ts +337 -159
- package/dist/commons/events/EventIndex.d.ts +1462 -16
- package/dist/commons/events/EventInput.d.ts +13 -0
- package/dist/commons/events/EventMetadata.d.ts +273 -14
- package/dist/commons/events/FieldConfig.d.ts +3682 -714
- package/dist/commons/events/FieldType.d.ts +3 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
- package/dist/commons/events/FieldValue.d.ts +7 -4
- package/dist/commons/events/FormConfig.d.ts +40417 -439
- package/dist/commons/events/PageConfig.d.ts +10077 -203
- package/dist/commons/events/SummaryConfig.d.ts +17 -47
- package/dist/commons/events/WorkqueueConfig.d.ts +1257 -19
- package/dist/commons/events/defineConfig.d.ts +6952 -32
- package/dist/commons/events/event.d.ts +27 -0
- package/dist/commons/events/field.d.ts +68 -0
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/scopes.d.ts +1 -0
- package/dist/commons/events/test.utils.d.ts +7 -44
- package/dist/commons/events/utils.d.ts +3550 -67
- package/dist/conditionals/index.js +36 -33
- package/dist/events/index.js +1446 -949
- package/dist/scopes/index.d.ts +70 -1
- package/dist/scopes/index.js +130 -0
- package/package.json +3 -2
@@ -0,0 +1,27 @@
|
|
1
|
+
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
+
import { EventMetadataKeys, EventMetadataParameter } from './EventMetadata';
|
3
|
+
import { SelectOption } from './FieldConfig';
|
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
|
+
fieldId: "status" | "trackingId";
|
13
|
+
options: {
|
14
|
+
value: string;
|
15
|
+
label: import("./TranslationConfig").TranslationConfig;
|
16
|
+
}[] | undefined;
|
17
|
+
config: {
|
18
|
+
type: "exact";
|
19
|
+
};
|
20
|
+
fieldType: "event";
|
21
|
+
};
|
22
|
+
declare const event: typeof eventFn & {
|
23
|
+
field(field: EventMetadataKeys): EventMetadataParameter;
|
24
|
+
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
25
|
+
};
|
26
|
+
export { event };
|
27
|
+
//# sourceMappingURL=event.d.ts.map
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/**
|
2
|
+
* Entry point for defining conditional logic or configuration for a form field.
|
3
|
+
* @param fieldId - The ID of the field to define rules or config for.
|
4
|
+
* @returns An object combining conditional methods and configuration builders.
|
5
|
+
*/
|
6
|
+
export declare function field(fieldId: string): {
|
7
|
+
range: () => {
|
8
|
+
config: {
|
9
|
+
type: "range";
|
10
|
+
};
|
11
|
+
fieldId: string;
|
12
|
+
fieldType: "field";
|
13
|
+
};
|
14
|
+
exact: () => {
|
15
|
+
config: {
|
16
|
+
type: "exact";
|
17
|
+
};
|
18
|
+
fieldId: string;
|
19
|
+
fieldType: "field";
|
20
|
+
};
|
21
|
+
fuzzy: () => {
|
22
|
+
config: {
|
23
|
+
type: "fuzzy";
|
24
|
+
};
|
25
|
+
fieldId: string;
|
26
|
+
fieldType: "field";
|
27
|
+
};
|
28
|
+
isAfter: () => {
|
29
|
+
days: (days: number) => {
|
30
|
+
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
31
|
+
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
32
|
+
};
|
33
|
+
date: (date: string | {
|
34
|
+
[key: string]: unknown;
|
35
|
+
_fieldId: string;
|
36
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
37
|
+
now: () => import("../conditionals/conditionals").JSONSchema;
|
38
|
+
};
|
39
|
+
isBefore: () => {
|
40
|
+
days: (days: number) => {
|
41
|
+
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
42
|
+
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
43
|
+
};
|
44
|
+
date: (date: string | {
|
45
|
+
[key: string]: unknown;
|
46
|
+
_fieldId: string;
|
47
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
48
|
+
now: () => import("../conditionals/conditionals").JSONSchema;
|
49
|
+
};
|
50
|
+
isEqualTo: (value: string | boolean | {
|
51
|
+
[key: string]: unknown;
|
52
|
+
_fieldId: string;
|
53
|
+
}) => import("../conditionals/conditionals").JSONSchema;
|
54
|
+
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
55
|
+
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
56
|
+
inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
|
57
|
+
isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
|
58
|
+
matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
|
59
|
+
isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
|
60
|
+
getId: () => {
|
61
|
+
fieldId: string;
|
62
|
+
};
|
63
|
+
/**
|
64
|
+
* @private Internal property used for field reference tracking.
|
65
|
+
*/
|
66
|
+
_fieldId: string;
|
67
|
+
};
|
68
|
+
//# sourceMappingURL=field.d.ts.map
|
@@ -2,6 +2,7 @@ import { Scope } from '../scopes';
|
|
2
2
|
import { ActionType } from './ActionType';
|
3
3
|
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
4
4
|
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
|
+
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
6
|
export declare const ACTION_ALLOWED_SCOPES: {
|
6
7
|
READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
|
7
8
|
CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
|
@@ -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';
|
@@ -8,44 +8,7 @@ import { EventIndex } from './EventIndex';
|
|
8
8
|
import { EventInput } from './EventInput';
|
9
9
|
import { FieldValue } from './FieldValue';
|
10
10
|
import { TranslationConfig } from './TranslationConfig';
|
11
|
-
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType):
|
12
|
-
type: string;
|
13
|
-
filename: string;
|
14
|
-
originalFilename: string;
|
15
|
-
} | {
|
16
|
-
country: string;
|
17
|
-
district: string;
|
18
|
-
addressType: "DOMESTIC";
|
19
|
-
province: string;
|
20
|
-
urbanOrRural: "URBAN";
|
21
|
-
number?: string | undefined;
|
22
|
-
town?: string | undefined;
|
23
|
-
residentialArea?: string | undefined;
|
24
|
-
street?: string | undefined;
|
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>;
|
11
|
+
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): EventState;
|
49
12
|
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
|
50
13
|
export declare const eventPayloadGenerator: {
|
51
14
|
create: (input?: Partial<EventInput>) => {
|
@@ -102,7 +65,7 @@ export declare const eventPayloadGenerator: {
|
|
102
65
|
option: string;
|
103
66
|
filename: string;
|
104
67
|
originalFilename: string;
|
105
|
-
}[] | undefined>;
|
68
|
+
}[] | [string, string] | undefined>;
|
106
69
|
annotation: {};
|
107
70
|
eventId: string;
|
108
71
|
};
|
@@ -152,7 +115,7 @@ export declare const eventPayloadGenerator: {
|
|
152
115
|
option: string;
|
153
116
|
filename: string;
|
154
117
|
originalFilename: string;
|
155
|
-
}[] | undefined>>;
|
118
|
+
}[] | [string, string] | undefined>>;
|
156
119
|
eventId: string;
|
157
120
|
};
|
158
121
|
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
@@ -195,7 +158,7 @@ export declare const eventPayloadGenerator: {
|
|
195
158
|
option: string;
|
196
159
|
filename: string;
|
197
160
|
originalFilename: string;
|
198
|
-
}[] | undefined>;
|
161
|
+
}[] | [string, string] | undefined>;
|
199
162
|
annotation: {};
|
200
163
|
duplicates: never[];
|
201
164
|
eventId: string;
|
@@ -272,7 +235,7 @@ export declare const eventPayloadGenerator: {
|
|
272
235
|
option: string;
|
273
236
|
filename: string;
|
274
237
|
originalFilename: string;
|
275
|
-
}[] | undefined>;
|
238
|
+
}[] | [string, string] | undefined>;
|
276
239
|
annotation: {};
|
277
240
|
eventId: string;
|
278
241
|
};
|
@@ -324,7 +287,7 @@ export declare const eventPayloadGenerator: {
|
|
324
287
|
option: string;
|
325
288
|
filename: string;
|
326
289
|
originalFilename: string;
|
327
|
-
}[] | undefined>;
|
290
|
+
}[] | [string, string] | undefined>;
|
328
291
|
annotation: {};
|
329
292
|
eventId: string;
|
330
293
|
};
|