@opencrvs/toolkit 1.9.6-rc.78b4928 → 1.9.6-rc.aa529c3
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.
|
@@ -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,16 +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.ZodLiteral<"now">;
|
|
1773
|
-
$$time: z.ZodLiteral<"now">;
|
|
1774
|
-
}, "strip", z.ZodTypeAny, {
|
|
1775
|
-
$$date: "now";
|
|
1776
|
-
$$time: "now";
|
|
1777
|
-
}, {
|
|
1778
|
-
$$date: "now";
|
|
1779
|
-
$$time: "now";
|
|
1780
|
-
}>, z.ZodString]>>;
|
|
1771
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1781
1772
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
1782
1773
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
1783
1774
|
id: string;
|
|
@@ -1834,10 +1825,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1834
1825
|
hideLabel?: boolean | undefined;
|
|
1835
1826
|
uncorrectable?: boolean | undefined;
|
|
1836
1827
|
analytics?: boolean | undefined;
|
|
1837
|
-
defaultValue?: string |
|
|
1838
|
-
$$date: "now";
|
|
1839
|
-
$$time: "now";
|
|
1840
|
-
} | undefined;
|
|
1828
|
+
defaultValue?: string | undefined;
|
|
1841
1829
|
configuration?: {
|
|
1842
1830
|
notice?: TranslationConfig | undefined;
|
|
1843
1831
|
} | undefined;
|
|
@@ -1902,10 +1890,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1902
1890
|
hideLabel?: boolean | undefined;
|
|
1903
1891
|
uncorrectable?: boolean | undefined;
|
|
1904
1892
|
analytics?: boolean | undefined;
|
|
1905
|
-
defaultValue?: string |
|
|
1906
|
-
$$date: "now";
|
|
1907
|
-
$$time: "now";
|
|
1908
|
-
} | undefined;
|
|
1893
|
+
defaultValue?: string | undefined;
|
|
1909
1894
|
configuration?: {
|
|
1910
1895
|
notice?: {
|
|
1911
1896
|
id: string;
|
|
@@ -2280,16 +2265,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2280
2265
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2281
2266
|
}, {
|
|
2282
2267
|
type: z.ZodLiteral<"TIME">;
|
|
2283
|
-
defaultValue: z.ZodOptional<z.
|
|
2284
|
-
$$date: z.ZodLiteral<"now">;
|
|
2285
|
-
$$time: z.ZodLiteral<"now">;
|
|
2286
|
-
}, "strip", z.ZodTypeAny, {
|
|
2287
|
-
$$date: "now";
|
|
2288
|
-
$$time: "now";
|
|
2289
|
-
}, {
|
|
2290
|
-
$$date: "now";
|
|
2291
|
-
$$time: "now";
|
|
2292
|
-
}>, z.ZodString]>>;
|
|
2268
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
2293
2269
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
2294
2270
|
use12HourFormat: z.ZodOptional<z.ZodBoolean>;
|
|
2295
2271
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
@@ -2349,10 +2325,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2349
2325
|
hideLabel?: boolean | undefined;
|
|
2350
2326
|
uncorrectable?: boolean | undefined;
|
|
2351
2327
|
analytics?: boolean | undefined;
|
|
2352
|
-
defaultValue?: string |
|
|
2353
|
-
$$date: "now";
|
|
2354
|
-
$$time: "now";
|
|
2355
|
-
} | undefined;
|
|
2328
|
+
defaultValue?: string | undefined;
|
|
2356
2329
|
configuration?: {
|
|
2357
2330
|
notice?: TranslationConfig | undefined;
|
|
2358
2331
|
use12HourFormat?: boolean | undefined;
|
|
@@ -2418,10 +2391,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2418
2391
|
hideLabel?: boolean | undefined;
|
|
2419
2392
|
uncorrectable?: boolean | undefined;
|
|
2420
2393
|
analytics?: boolean | undefined;
|
|
2421
|
-
defaultValue?: string |
|
|
2422
|
-
$$date: "now";
|
|
2423
|
-
$$time: "now";
|
|
2424
|
-
} | undefined;
|
|
2394
|
+
defaultValue?: string | undefined;
|
|
2425
2395
|
configuration?: {
|
|
2426
2396
|
notice?: {
|
|
2427
2397
|
id: string;
|
|
@@ -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"),
|
|
114
|
-
$$time: import_zod2.z.literal("now")
|
|
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",
|