@opencrvs/toolkit 1.9.6-rc.e1907dc → 1.9.6-rc.f572bca
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/FieldConfig.d.ts +6 -45
- package/dist/commons/events/TemplateConfig.d.ts +0 -2
- package/dist/conditionals/index.js +0 -15
- package/dist/events/index.js +454 -474
- package/dist/notification/index.js +473 -491
- 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.
|
|
@@ -1768,21 +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
|
-
$$date: z.ZodOptional<z.ZodLiteral<"now">>;
|
|
1773
|
-
$$time: z.ZodOptional<z.ZodLiteral<"now">>;
|
|
1774
|
-
}, "strip", z.ZodTypeAny, {
|
|
1775
|
-
$$date?: "now" | undefined;
|
|
1776
|
-
$$time?: "now" | undefined;
|
|
1777
|
-
}, {
|
|
1778
|
-
$$date?: "now" | undefined;
|
|
1779
|
-
$$time?: "now" | undefined;
|
|
1780
|
-
}>, {
|
|
1781
|
-
$$date: "now";
|
|
1782
|
-
}, {
|
|
1783
|
-
$$date?: "now" | undefined;
|
|
1784
|
-
$$time?: "now" | undefined;
|
|
1785
|
-
}>, z.ZodString]>>;
|
|
1771
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1786
1772
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
1787
1773
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
1788
1774
|
id: string;
|
|
@@ -1839,9 +1825,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1839
1825
|
hideLabel?: boolean | undefined;
|
|
1840
1826
|
uncorrectable?: boolean | undefined;
|
|
1841
1827
|
analytics?: boolean | undefined;
|
|
1842
|
-
defaultValue?: string |
|
|
1843
|
-
$$date: "now";
|
|
1844
|
-
} | undefined;
|
|
1828
|
+
defaultValue?: string | undefined;
|
|
1845
1829
|
configuration?: {
|
|
1846
1830
|
notice?: TranslationConfig | undefined;
|
|
1847
1831
|
} | undefined;
|
|
@@ -1906,10 +1890,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1906
1890
|
hideLabel?: boolean | undefined;
|
|
1907
1891
|
uncorrectable?: boolean | undefined;
|
|
1908
1892
|
analytics?: boolean | undefined;
|
|
1909
|
-
defaultValue?: string |
|
|
1910
|
-
$$date?: "now" | undefined;
|
|
1911
|
-
$$time?: "now" | undefined;
|
|
1912
|
-
} | undefined;
|
|
1893
|
+
defaultValue?: string | undefined;
|
|
1913
1894
|
configuration?: {
|
|
1914
1895
|
notice?: {
|
|
1915
1896
|
id: string;
|
|
@@ -2284,21 +2265,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2284
2265
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2285
2266
|
}, {
|
|
2286
2267
|
type: z.ZodLiteral<"TIME">;
|
|
2287
|
-
defaultValue: z.ZodOptional<z.
|
|
2288
|
-
$$date: z.ZodOptional<z.ZodLiteral<"now">>;
|
|
2289
|
-
$$time: z.ZodOptional<z.ZodLiteral<"now">>;
|
|
2290
|
-
}, "strip", z.ZodTypeAny, {
|
|
2291
|
-
$$date?: "now" | undefined;
|
|
2292
|
-
$$time?: "now" | undefined;
|
|
2293
|
-
}, {
|
|
2294
|
-
$$date?: "now" | undefined;
|
|
2295
|
-
$$time?: "now" | undefined;
|
|
2296
|
-
}>, {
|
|
2297
|
-
$$time: "now";
|
|
2298
|
-
}, {
|
|
2299
|
-
$$date?: "now" | undefined;
|
|
2300
|
-
$$time?: "now" | undefined;
|
|
2301
|
-
}>, z.ZodString]>>;
|
|
2268
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
2302
2269
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
2303
2270
|
use12HourFormat: z.ZodOptional<z.ZodBoolean>;
|
|
2304
2271
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
@@ -2358,9 +2325,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2358
2325
|
hideLabel?: boolean | undefined;
|
|
2359
2326
|
uncorrectable?: boolean | undefined;
|
|
2360
2327
|
analytics?: boolean | undefined;
|
|
2361
|
-
defaultValue?: string |
|
|
2362
|
-
$$time: "now";
|
|
2363
|
-
} | undefined;
|
|
2328
|
+
defaultValue?: string | undefined;
|
|
2364
2329
|
configuration?: {
|
|
2365
2330
|
notice?: TranslationConfig | undefined;
|
|
2366
2331
|
use12HourFormat?: boolean | undefined;
|
|
@@ -2426,10 +2391,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2426
2391
|
hideLabel?: boolean | undefined;
|
|
2427
2392
|
uncorrectable?: boolean | undefined;
|
|
2428
2393
|
analytics?: boolean | undefined;
|
|
2429
|
-
defaultValue?: string |
|
|
2430
|
-
$$date?: "now" | undefined;
|
|
2431
|
-
$$time?: "now" | undefined;
|
|
2432
|
-
} | undefined;
|
|
2394
|
+
defaultValue?: string | undefined;
|
|
2433
2395
|
configuration?: {
|
|
2434
2396
|
notice?: {
|
|
2435
2397
|
id: string;
|
|
@@ -2440,7 +2402,6 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2440
2402
|
} | undefined;
|
|
2441
2403
|
}>;
|
|
2442
2404
|
export type TimeField = z.infer<typeof TimeField>;
|
|
2443
|
-
export type TimeField2 = z.input<typeof TimeField>;
|
|
2444
2405
|
declare const DateRangeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
2445
2406
|
id: z.ZodEffects<z.ZodString, string, string>;
|
|
2446
2407
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
@@ -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,19 +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
|
-
$$date: import_zod2.z.literal("now").optional(),
|
|
114
|
-
$$time: import_zod2.z.literal("now").optional()
|
|
115
|
-
});
|
|
116
|
-
function todayDateTimeValueSerializer() {
|
|
117
|
-
return {
|
|
118
|
-
$$date: "now",
|
|
119
|
-
$$time: "now"
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
109
|
// ../commons/src/conditionals/conditionals.ts
|
|
124
110
|
function defineConditional(schema) {
|
|
125
111
|
const schemaWithooutIDRef = omitKeyDeep(schema, "$id");
|
|
@@ -193,7 +179,6 @@ function wrapToPathOptional(condition, path) {
|
|
|
193
179
|
};
|
|
194
180
|
}, condition);
|
|
195
181
|
}
|
|
196
|
-
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
197
182
|
var user = Object.assign(userSerializer, {
|
|
198
183
|
hasScope: (scope) => defineConditional({
|
|
199
184
|
type: "object",
|