@opencrvs/toolkit 1.8.0-rc.fd6feaa → 1.8.0-rc.fd8a78f
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/README.md +1 -1
- package/dist/commons/api/router.d.ts +20563 -13195
- package/dist/commons/conditionals/conditionals.d.ts +37 -6
- package/dist/commons/conditionals/validate.d.ts +18 -17
- package/dist/commons/events/ActionConfig.d.ts +116825 -2069
- package/dist/commons/events/ActionDocument.d.ts +10082 -541
- package/dist/commons/events/ActionInput.d.ts +4524 -727
- package/dist/commons/events/ActionType.d.ts +30 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +83 -12
- package/dist/commons/events/Conditional.d.ts +21 -5
- 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 +276 -75
- package/dist/commons/events/EventConfig.d.ts +56158 -1798
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +2862 -672
- package/dist/commons/events/EventIndex.d.ts +1590 -22
- package/dist/commons/events/EventMetadata.d.ts +299 -40
- package/dist/commons/events/FieldConfig.d.ts +5816 -1011
- package/dist/commons/events/FieldType.d.ts +7 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +142 -44
- package/dist/commons/events/FieldValue.d.ts +77 -16
- package/dist/commons/events/FormConfig.d.ts +49317 -90
- package/dist/commons/events/PageConfig.d.ts +12337 -0
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- 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 +4803 -20
- package/dist/commons/events/defineConfig.d.ts +9111 -301
- 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 +10 -1
- 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 +167 -279
- package/dist/commons/events/utils.d.ts +13393 -94
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +233 -108
- package/dist/events/index.js +4705 -1887
- 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,11 +1,14 @@
|
|
1
|
+
export * from './Constants';
|
1
2
|
export * from './ActionConfig';
|
2
3
|
export * from './offline';
|
3
4
|
export * from './EventConfig';
|
4
5
|
export * from './EventConfigInput';
|
5
6
|
export * from './FieldConfig';
|
6
|
-
export * from './
|
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';
|
@@ -15,6 +18,7 @@ export * from './ActionDocument';
|
|
15
18
|
export * from './EventIndex';
|
16
19
|
export * from './TranslationConfig';
|
17
20
|
export * from './FieldValue';
|
21
|
+
export * from './FormConfig';
|
18
22
|
export * from './CompositeFieldValue';
|
19
23
|
export * from './state';
|
20
24
|
export * from './utils';
|
@@ -29,6 +33,11 @@ export * from './Conditional';
|
|
29
33
|
export * from './AdvancedSearchConfig';
|
30
34
|
export * from './test.utils';
|
31
35
|
export * from './TemplateConfig';
|
36
|
+
export * from './scopes';
|
37
|
+
export * from './serializer';
|
38
|
+
export * from './state/availableActions';
|
32
39
|
export * from '../conditionals/conditionals';
|
33
40
|
export * from '../conditionals/validate';
|
41
|
+
export * from './field';
|
42
|
+
export * from './event';
|
34
43
|
//# 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
|