@opencrvs/toolkit 1.9.6-rc.21ab241 → 1.9.6-rc.2f591db
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/conditionals/conditionals.d.ts +0 -5
- package/dist/commons/events/DeduplicationConfig.d.ts +26 -0
- package/dist/commons/events/FieldConfig.d.ts +6 -26
- package/dist/commons/events/FieldValue.d.ts +0 -1
- package/dist/commons/events/deduplication.d.ts +4 -0
- package/dist/conditionals/index.js +0 -11
- package/dist/events/deduplication.d.ts +4 -0
- package/dist/events/index.js +481 -464
- package/dist/notification/index.js +501 -483
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import { ITokenPayload as TokenPayload, Scope } from '../authentication';
|
|
|
4
4
|
import { PartialSchema as AjvJSONSchemaType } from 'ajv/dist/types/json-schema';
|
|
5
5
|
import { userSerializer } from '../events/serializers/user/serializer';
|
|
6
6
|
import { UUID } from '../uuid';
|
|
7
|
-
import { todayDateTimeValueSerializer } from '../events/serializers/date/serializer';
|
|
8
7
|
/** @knipignore */
|
|
9
8
|
export type JSONSchema = {
|
|
10
9
|
$id: string;
|
|
@@ -65,10 +64,6 @@ type FieldReference = {
|
|
|
65
64
|
$$field: string;
|
|
66
65
|
$$subfield: string[];
|
|
67
66
|
};
|
|
68
|
-
/**
|
|
69
|
-
* Generate conditional rules for current date
|
|
70
|
-
*/
|
|
71
|
-
export declare const now: typeof todayDateTimeValueSerializer;
|
|
72
67
|
/**
|
|
73
68
|
*
|
|
74
69
|
* Generate conditional rules for user.
|
|
@@ -119,14 +119,32 @@ declare const DateRangeMatcher: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
119
119
|
pivot: z.ZodOptional<z.ZodNumber>;
|
|
120
120
|
days: z.ZodNumber;
|
|
121
121
|
boost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
122
|
+
alsoMatchAgainst: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
123
|
+
$$field: z.ZodEffects<z.ZodString, string, string>;
|
|
124
|
+
$$subfield: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
$$field: string;
|
|
127
|
+
$$subfield?: string[] | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
$$field: string;
|
|
130
|
+
$$subfield?: string[] | undefined;
|
|
131
|
+
}>, "many">>;
|
|
122
132
|
}, "strip", z.ZodTypeAny, {
|
|
123
133
|
boost: number;
|
|
124
134
|
days: number;
|
|
125
135
|
pivot?: number | undefined;
|
|
136
|
+
alsoMatchAgainst?: {
|
|
137
|
+
$$field: string;
|
|
138
|
+
$$subfield?: string[] | undefined;
|
|
139
|
+
}[] | undefined;
|
|
126
140
|
}, {
|
|
127
141
|
days: number;
|
|
128
142
|
boost?: number | undefined;
|
|
129
143
|
pivot?: number | undefined;
|
|
144
|
+
alsoMatchAgainst?: {
|
|
145
|
+
$$field: string;
|
|
146
|
+
$$subfield?: string[] | undefined;
|
|
147
|
+
}[] | undefined;
|
|
130
148
|
}>;
|
|
131
149
|
}>, "strip", z.ZodTypeAny, {
|
|
132
150
|
type: "dateRange";
|
|
@@ -134,6 +152,10 @@ declare const DateRangeMatcher: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
134
152
|
boost: number;
|
|
135
153
|
days: number;
|
|
136
154
|
pivot?: number | undefined;
|
|
155
|
+
alsoMatchAgainst?: {
|
|
156
|
+
$$field: string;
|
|
157
|
+
$$subfield?: string[] | undefined;
|
|
158
|
+
}[] | undefined;
|
|
137
159
|
};
|
|
138
160
|
fieldId: string;
|
|
139
161
|
}, {
|
|
@@ -142,6 +164,10 @@ declare const DateRangeMatcher: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
142
164
|
days: number;
|
|
143
165
|
boost?: number | undefined;
|
|
144
166
|
pivot?: number | undefined;
|
|
167
|
+
alsoMatchAgainst?: {
|
|
168
|
+
$$field: string;
|
|
169
|
+
$$subfield?: string[] | undefined;
|
|
170
|
+
}[] | undefined;
|
|
145
171
|
};
|
|
146
172
|
fieldId: string;
|
|
147
173
|
}>;
|
|
@@ -1768,13 +1768,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1768
1768
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1769
1769
|
}, {
|
|
1770
1770
|
type: z.ZodLiteral<"DATE">;
|
|
1771
|
-
defaultValue: z.ZodOptional<z.
|
|
1772
|
-
$$now: z.ZodLiteral<true>;
|
|
1773
|
-
}, "strip", z.ZodTypeAny, {
|
|
1774
|
-
$$now: true;
|
|
1775
|
-
}, {
|
|
1776
|
-
$$now: true;
|
|
1777
|
-
}>, z.ZodString]>>;
|
|
1771
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1778
1772
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
1779
1773
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
1780
1774
|
id: string;
|
|
@@ -1831,9 +1825,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1831
1825
|
hideLabel?: boolean | undefined;
|
|
1832
1826
|
uncorrectable?: boolean | undefined;
|
|
1833
1827
|
analytics?: boolean | undefined;
|
|
1834
|
-
defaultValue?: string |
|
|
1835
|
-
$$now: true;
|
|
1836
|
-
} | undefined;
|
|
1828
|
+
defaultValue?: string | undefined;
|
|
1837
1829
|
configuration?: {
|
|
1838
1830
|
notice?: TranslationConfig | undefined;
|
|
1839
1831
|
} | undefined;
|
|
@@ -1898,9 +1890,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1898
1890
|
hideLabel?: boolean | undefined;
|
|
1899
1891
|
uncorrectable?: boolean | undefined;
|
|
1900
1892
|
analytics?: boolean | undefined;
|
|
1901
|
-
defaultValue?: string |
|
|
1902
|
-
$$now: true;
|
|
1903
|
-
} | undefined;
|
|
1893
|
+
defaultValue?: string | undefined;
|
|
1904
1894
|
configuration?: {
|
|
1905
1895
|
notice?: {
|
|
1906
1896
|
id: string;
|
|
@@ -2275,13 +2265,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2275
2265
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2276
2266
|
}, {
|
|
2277
2267
|
type: z.ZodLiteral<"TIME">;
|
|
2278
|
-
defaultValue: z.ZodOptional<z.
|
|
2279
|
-
$$now: z.ZodLiteral<true>;
|
|
2280
|
-
}, "strip", z.ZodTypeAny, {
|
|
2281
|
-
$$now: true;
|
|
2282
|
-
}, {
|
|
2283
|
-
$$now: true;
|
|
2284
|
-
}>, z.ZodString]>>;
|
|
2268
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
2285
2269
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
2286
2270
|
use12HourFormat: z.ZodOptional<z.ZodBoolean>;
|
|
2287
2271
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
@@ -2341,9 +2325,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2341
2325
|
hideLabel?: boolean | undefined;
|
|
2342
2326
|
uncorrectable?: boolean | undefined;
|
|
2343
2327
|
analytics?: boolean | undefined;
|
|
2344
|
-
defaultValue?: string |
|
|
2345
|
-
$$now: true;
|
|
2346
|
-
} | undefined;
|
|
2328
|
+
defaultValue?: string | undefined;
|
|
2347
2329
|
configuration?: {
|
|
2348
2330
|
notice?: TranslationConfig | undefined;
|
|
2349
2331
|
use12HourFormat?: boolean | undefined;
|
|
@@ -2409,9 +2391,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2409
2391
|
hideLabel?: boolean | undefined;
|
|
2410
2392
|
uncorrectable?: boolean | undefined;
|
|
2411
2393
|
analytics?: boolean | undefined;
|
|
2412
|
-
defaultValue?: string |
|
|
2413
|
-
$$now: true;
|
|
2414
|
-
} | undefined;
|
|
2394
|
+
defaultValue?: string | undefined;
|
|
2415
2395
|
configuration?: {
|
|
2416
2396
|
notice?: {
|
|
2417
2397
|
id: string;
|
|
@@ -38,7 +38,6 @@ export declare const AgeUpdateValue: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
|
38
38
|
asOfDateRef: string;
|
|
39
39
|
}>>>;
|
|
40
40
|
export declare const TimeValue: z.ZodString;
|
|
41
|
-
export type TimeValue = z.infer<typeof TimeValue>;
|
|
42
41
|
export declare const DatetimeValue: z.ZodString;
|
|
43
42
|
export declare const SelectDateRangeValue: z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>;
|
|
44
43
|
export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodObject<{
|
|
@@ -38,7 +38,6 @@ __export(conditionals_exports, {
|
|
|
38
38
|
isFieldReference: () => isFieldReference,
|
|
39
39
|
never: () => never,
|
|
40
40
|
not: () => not,
|
|
41
|
-
now: () => now,
|
|
42
41
|
or: () => or,
|
|
43
42
|
user: () => user
|
|
44
43
|
});
|
|
@@ -107,15 +106,6 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
107
106
|
return newObj;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
// ../commons/src/events/serializers/date/serializer.ts
|
|
111
|
-
var import_zod2 = require("zod");
|
|
112
|
-
var SerializedNowDateTime = import_zod2.z.object({
|
|
113
|
-
$$now: import_zod2.z.literal(true)
|
|
114
|
-
});
|
|
115
|
-
function todayDateTimeValueSerializer() {
|
|
116
|
-
return { $$now: true };
|
|
117
|
-
}
|
|
118
|
-
|
|
119
109
|
// ../commons/src/conditionals/conditionals.ts
|
|
120
110
|
function defineConditional(schema) {
|
|
121
111
|
const schemaWithooutIDRef = omitKeyDeep(schema, "$id");
|
|
@@ -189,7 +179,6 @@ function wrapToPathOptional(condition, path) {
|
|
|
189
179
|
};
|
|
190
180
|
}, condition);
|
|
191
181
|
}
|
|
192
|
-
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
193
182
|
var user = Object.assign(userSerializer, {
|
|
194
183
|
hasScope: (scope) => defineConditional({
|
|
195
184
|
type: "object",
|