@opencrvs/toolkit 1.8.0-rc.fe799b0 → 1.8.0-rc.fe7c504
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 +12626 -10500
- package/dist/commons/conditionals/conditionals.d.ts +37 -6
- package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +45 -17
- package/dist/commons/conditionals/validate.test.d.ts +2 -0
- package/dist/commons/events/ActionConfig.d.ts +119422 -2084
- package/dist/commons/events/ActionDocument.d.ts +11632 -435
- package/dist/commons/events/ActionInput.d.ts +6716 -663
- package/dist/commons/events/ActionType.d.ts +31 -12
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1233 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +183 -2
- 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 +3730 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +488 -69
- package/dist/commons/events/EventConfig.d.ts +57615 -1821
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +4762 -607
- package/dist/commons/events/EventIndex.d.ts +2012 -24
- package/dist/commons/events/EventMetadata.d.ts +343 -42
- package/dist/commons/events/FieldConfig.d.ts +6001 -972
- package/dist/commons/events/FieldType.d.ts +10 -2
- package/dist/commons/events/FieldTypeMapping.d.ts +218 -18
- package/dist/commons/events/FieldValue.d.ts +123 -8
- package/dist/commons/events/FormConfig.d.ts +50409 -90
- package/dist/commons/events/PageConfig.d.ts +12597 -0
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +38 -0
- package/dist/commons/events/User.d.ts +34 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +7300 -20
- package/dist/commons/events/defineConfig.d.ts +9405 -307
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +82 -0
- package/dist/commons/events/index.d.ts +11 -1
- package/dist/commons/events/scopes.d.ts +44 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +245 -225
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13906 -69
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +244 -115
- package/dist/events/index.js +5263 -1871
- package/dist/scopes/index.d.ts +247 -1
- package/dist/scopes/index.js +231 -1
- package/package.json +4 -3
@@ -1,102 +1,149 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { TranslationConfig } from './TranslationConfig';
|
3
3
|
export declare const SummaryConfig: z.ZodObject<{
|
4
|
-
|
4
|
+
fields: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
5
|
+
emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
6
|
+
id: string;
|
7
|
+
description: string;
|
8
|
+
defaultMessage: string;
|
9
|
+
}>>;
|
10
|
+
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
11
|
+
type: z.ZodLiteral<"SHOW">;
|
12
|
+
conditional: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
14
|
+
type: "SHOW";
|
15
|
+
conditional: import(".").JSONSchema;
|
16
|
+
}, {
|
17
|
+
type: "SHOW";
|
18
|
+
conditional: import(".").JSONSchema;
|
19
|
+
}>, "many">>>;
|
20
|
+
}, {
|
5
21
|
id: z.ZodString;
|
6
|
-
|
22
|
+
value: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
7
23
|
id: string;
|
8
24
|
description: string;
|
9
25
|
defaultMessage: string;
|
10
26
|
}>;
|
11
|
-
|
27
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
12
28
|
id: string;
|
13
29
|
description: string;
|
14
30
|
defaultMessage: string;
|
15
|
-
}
|
16
|
-
}
|
31
|
+
}>;
|
32
|
+
}>, "strip", z.ZodTypeAny, {
|
17
33
|
id: string;
|
34
|
+
value: TranslationConfig;
|
18
35
|
label: TranslationConfig;
|
36
|
+
conditionals?: {
|
37
|
+
type: "SHOW";
|
38
|
+
conditional: import(".").JSONSchema;
|
39
|
+
}[] | undefined;
|
19
40
|
emptyValueMessage?: TranslationConfig | undefined;
|
20
41
|
}, {
|
21
42
|
id: string;
|
22
|
-
|
43
|
+
value: {
|
23
44
|
id: string;
|
24
45
|
description: string;
|
25
46
|
defaultMessage: string;
|
26
47
|
};
|
27
|
-
|
28
|
-
id: string;
|
29
|
-
description: string;
|
30
|
-
defaultMessage: string;
|
31
|
-
} | undefined;
|
32
|
-
}>;
|
33
|
-
fields: z.ZodArray<z.ZodObject<{
|
34
|
-
id: z.ZodString;
|
35
|
-
value: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
48
|
+
label: {
|
36
49
|
id: string;
|
37
50
|
description: string;
|
38
51
|
defaultMessage: string;
|
39
|
-
}
|
40
|
-
|
52
|
+
};
|
53
|
+
conditionals?: {
|
54
|
+
type: "SHOW";
|
55
|
+
conditional: import(".").JSONSchema;
|
56
|
+
}[] | undefined;
|
57
|
+
emptyValueMessage?: {
|
41
58
|
id: string;
|
42
59
|
description: string;
|
43
60
|
defaultMessage: string;
|
44
|
-
}
|
61
|
+
} | undefined;
|
62
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
45
63
|
emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
46
64
|
id: string;
|
47
65
|
description: string;
|
48
66
|
defaultMessage: string;
|
49
67
|
}>>;
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
68
|
+
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
69
|
+
type: z.ZodLiteral<"SHOW">;
|
70
|
+
conditional: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
72
|
+
type: "SHOW";
|
73
|
+
conditional: import(".").JSONSchema;
|
74
|
+
}, {
|
75
|
+
type: "SHOW";
|
76
|
+
conditional: import(".").JSONSchema;
|
77
|
+
}>, "many">>>;
|
55
78
|
}, {
|
56
|
-
|
57
|
-
|
79
|
+
fieldId: z.ZodString;
|
80
|
+
label: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
58
81
|
id: string;
|
59
82
|
description: string;
|
60
83
|
defaultMessage: string;
|
61
|
-
}
|
62
|
-
|
84
|
+
}>>;
|
85
|
+
}>, "strip", z.ZodTypeAny, {
|
86
|
+
fieldId: string;
|
87
|
+
conditionals?: {
|
88
|
+
type: "SHOW";
|
89
|
+
conditional: import(".").JSONSchema;
|
90
|
+
}[] | undefined;
|
91
|
+
label?: TranslationConfig | undefined;
|
92
|
+
emptyValueMessage?: TranslationConfig | undefined;
|
93
|
+
}, {
|
94
|
+
fieldId: string;
|
95
|
+
conditionals?: {
|
96
|
+
type: "SHOW";
|
97
|
+
conditional: import(".").JSONSchema;
|
98
|
+
}[] | undefined;
|
99
|
+
label?: {
|
63
100
|
id: string;
|
64
101
|
description: string;
|
65
102
|
defaultMessage: string;
|
66
|
-
};
|
103
|
+
} | undefined;
|
67
104
|
emptyValueMessage?: {
|
68
105
|
id: string;
|
69
106
|
description: string;
|
70
107
|
defaultMessage: string;
|
71
108
|
} | undefined;
|
72
|
-
}>, "many">;
|
109
|
+
}>]>, "many">;
|
73
110
|
}, "strip", z.ZodTypeAny, {
|
74
|
-
|
75
|
-
|
76
|
-
|
111
|
+
fields: ({
|
112
|
+
fieldId: string;
|
113
|
+
conditionals?: {
|
114
|
+
type: "SHOW";
|
115
|
+
conditional: import(".").JSONSchema;
|
116
|
+
}[] | undefined;
|
117
|
+
label?: TranslationConfig | undefined;
|
77
118
|
emptyValueMessage?: TranslationConfig | undefined;
|
78
|
-
}
|
79
|
-
fields: {
|
119
|
+
} | {
|
80
120
|
id: string;
|
81
121
|
value: TranslationConfig;
|
82
122
|
label: TranslationConfig;
|
123
|
+
conditionals?: {
|
124
|
+
type: "SHOW";
|
125
|
+
conditional: import(".").JSONSchema;
|
126
|
+
}[] | undefined;
|
83
127
|
emptyValueMessage?: TranslationConfig | undefined;
|
84
|
-
}[];
|
128
|
+
})[];
|
85
129
|
}, {
|
86
|
-
|
87
|
-
|
88
|
-
|
130
|
+
fields: ({
|
131
|
+
fieldId: string;
|
132
|
+
conditionals?: {
|
133
|
+
type: "SHOW";
|
134
|
+
conditional: import(".").JSONSchema;
|
135
|
+
}[] | undefined;
|
136
|
+
label?: {
|
89
137
|
id: string;
|
90
138
|
description: string;
|
91
139
|
defaultMessage: string;
|
92
|
-
};
|
140
|
+
} | undefined;
|
93
141
|
emptyValueMessage?: {
|
94
142
|
id: string;
|
95
143
|
description: string;
|
96
144
|
defaultMessage: string;
|
97
145
|
} | undefined;
|
98
|
-
}
|
99
|
-
fields: {
|
146
|
+
} | {
|
100
147
|
id: string;
|
101
148
|
value: {
|
102
149
|
id: string;
|
@@ -108,12 +155,16 @@ export declare const SummaryConfig: z.ZodObject<{
|
|
108
155
|
description: string;
|
109
156
|
defaultMessage: string;
|
110
157
|
};
|
158
|
+
conditionals?: {
|
159
|
+
type: "SHOW";
|
160
|
+
conditional: import(".").JSONSchema;
|
161
|
+
}[] | undefined;
|
111
162
|
emptyValueMessage?: {
|
112
163
|
id: string;
|
113
164
|
description: string;
|
114
165
|
defaultMessage: string;
|
115
166
|
} | undefined;
|
116
|
-
}[];
|
167
|
+
})[];
|
117
168
|
}>;
|
118
169
|
export type SummaryConfig = z.infer<typeof SummaryConfig>;
|
119
170
|
//# sourceMappingURL=SummaryConfig.d.ts.map
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/**
|
2
|
+
* TemplateConfig defines configuration rules for system-based variables (e.g. $user.province).
|
3
|
+
* They are currently used for providing default values in FieldConfig.
|
4
|
+
*/
|
5
|
+
import { FieldValue } from './FieldValue';
|
6
|
+
/**
|
7
|
+
* Available system variables for configuration.
|
8
|
+
*/
|
9
|
+
export type SystemVariables = {
|
10
|
+
$user: {
|
11
|
+
province: string;
|
12
|
+
district: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* Recursively flatten the keys of an object. Used to limit types when configuring default values in country config.
|
17
|
+
* @example
|
18
|
+
* type Test = FlattenedKeyStrings<{ a: { b: string, c: { d: string } } }>
|
19
|
+
* // 'a.b' | 'a.c.d' but not 'a' or 'a.c'
|
20
|
+
*/
|
21
|
+
type FlattenedKeyStrings<T, Prefix extends string = ''> = {
|
22
|
+
[K in keyof T]: T[K] extends Record<string, any> ? FlattenedKeyStrings<T[K], `${Prefix}${K & string}.`> : `${Prefix}${K & string}`;
|
23
|
+
}[keyof T];
|
24
|
+
export type FlattenenedSystemVariables = FlattenedKeyStrings<SystemVariables>;
|
25
|
+
/**
|
26
|
+
* Default value for a field when configuring a form.
|
27
|
+
*/
|
28
|
+
export type FieldConfigDefaultValue = FieldValue | FlattenenedSystemVariables | Record<string, FlattenenedSystemVariables | FieldValue>;
|
29
|
+
export declare function isTemplateVariable(value: FieldConfigDefaultValue): value is FlattenenedSystemVariables;
|
30
|
+
export declare function isFieldValue(value: FieldConfigDefaultValue): value is FieldValue;
|
31
|
+
/**
|
32
|
+
* Checks if given value is valid for a field, and known template variables are already resolved.
|
33
|
+
* @todo: Extend functionality to arbitrary depth objects. Currently only checks first level since our compoosite fields are only 1 level deep.
|
34
|
+
*/
|
35
|
+
export declare function isFieldValueWithoutTemplates(value: FieldConfigDefaultValue): value is FieldValue;
|
36
|
+
export declare function isFieldConfigDefaultValue(value: any): value is FieldConfigDefaultValue;
|
37
|
+
export {};
|
38
|
+
//# sourceMappingURL=TemplateConfig.d.ts.map
|
@@ -1,4 +1,33 @@
|
|
1
|
-
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const User: z.ZodObject<{
|
3
|
+
id: z.ZodString;
|
4
|
+
name: z.ZodArray<z.ZodObject<{
|
5
|
+
use: z.ZodString;
|
6
|
+
given: z.ZodArray<z.ZodString, "many">;
|
7
|
+
family: z.ZodString;
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
9
|
+
use: string;
|
10
|
+
given: string[];
|
11
|
+
family: string;
|
12
|
+
}, {
|
13
|
+
use: string;
|
14
|
+
given: string[];
|
15
|
+
family: string;
|
16
|
+
}>, "many">;
|
17
|
+
role: z.ZodString;
|
18
|
+
avatar: z.ZodOptional<z.ZodBranded<z.ZodString, "FullDocumentPath">>;
|
19
|
+
signature: z.ZodOptional<z.ZodBranded<z.ZodString, "FullDocumentPath">>;
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
21
|
+
id: string;
|
22
|
+
name: {
|
23
|
+
use: string;
|
24
|
+
given: string[];
|
25
|
+
family: string;
|
26
|
+
}[];
|
27
|
+
role: string;
|
28
|
+
signature?: (string & z.BRAND<"FullDocumentPath">) | undefined;
|
29
|
+
avatar?: (string & z.BRAND<"FullDocumentPath">) | undefined;
|
30
|
+
}, {
|
2
31
|
id: string;
|
3
32
|
name: {
|
4
33
|
use: string;
|
@@ -6,5 +35,8 @@ export type User = {
|
|
6
35
|
family: string;
|
7
36
|
}[];
|
8
37
|
role: string;
|
9
|
-
|
38
|
+
signature?: string | undefined;
|
39
|
+
avatar?: string | undefined;
|
40
|
+
}>;
|
41
|
+
export type User = z.infer<typeof User>;
|
10
42
|
//# sourceMappingURL=User.d.ts.map
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
export declare const WorkqueueColumnKeysArray: readonly ["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"];
|
4
|
+
export declare const WorkqueueColumnKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"]>;
|
5
|
+
export type WorkqueueColumnKeys = z.infer<typeof WorkqueueColumnKeys>;
|
6
|
+
export declare const WorkqueueColumnValue: z.ZodObject<{
|
7
|
+
$event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"]>;
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
9
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
10
|
+
}, {
|
11
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
12
|
+
}>;
|
13
|
+
export type WorkqueueColumnValue = z.infer<typeof WorkqueueColumnValue>;
|
14
|
+
/**
|
15
|
+
* Configuration for column header and value of cell of workqueue.
|
16
|
+
*/
|
17
|
+
export declare const WorkqueueColumn: z.ZodObject<{
|
18
|
+
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
19
|
+
id: string;
|
20
|
+
description: string;
|
21
|
+
defaultMessage: string;
|
22
|
+
}>;
|
23
|
+
value: z.ZodObject<{
|
24
|
+
$event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "createdByUserType", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags", "title", "outbox"]>;
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
26
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
27
|
+
}, {
|
28
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
29
|
+
}>;
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
31
|
+
value: {
|
32
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
33
|
+
};
|
34
|
+
label: TranslationConfig;
|
35
|
+
}, {
|
36
|
+
value: {
|
37
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
38
|
+
};
|
39
|
+
label: {
|
40
|
+
id: string;
|
41
|
+
description: string;
|
42
|
+
defaultMessage: string;
|
43
|
+
};
|
44
|
+
}>;
|
45
|
+
export type WorkqueueColumn = z.infer<typeof WorkqueueColumn>;
|
46
|
+
export type WorkqueueColumnInput = z.infer<typeof WorkqueueColumn>;
|
47
|
+
export declare function defineWorkqueuesColumns(workqueueColumns: WorkqueueColumnInput[]): {
|
48
|
+
value: {
|
49
|
+
$event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
50
|
+
};
|
51
|
+
label: TranslationConfig;
|
52
|
+
}[];
|
53
|
+
//# sourceMappingURL=WorkqueueColumnConfig.d.ts.map
|