@opencrvs/toolkit 1.9.6-rc.d73f8b6 → 1.9.6-rc.d8db314

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,19 +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.ZodUnion<[z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
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
- }>, z.ZodLiteral<"$$date">]>, z.ZodLiteral<"$$time">]>, "$$date", "$$date" | "$$time" | {
1781
- $$date?: "now" | undefined;
1782
- $$time?: "now" | undefined;
1783
- }>, z.ZodString]>>;
1771
+ defaultValue: z.ZodOptional<z.ZodString>;
1784
1772
  configuration: z.ZodOptional<z.ZodObject<{
1785
1773
  notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
1786
1774
  id: string;
@@ -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" | undefined;
1907
- $$time?: "now" | undefined;
1908
- } | undefined;
1893
+ defaultValue?: string | undefined;
1909
1894
  configuration?: {
1910
1895
  notice?: {
1911
1896
  id: string;
@@ -2280,19 +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.ZodUnion<[z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
2284
- $$date: z.ZodOptional<z.ZodLiteral<"now">>;
2285
- $$time: z.ZodOptional<z.ZodLiteral<"now">>;
2286
- }, "strip", z.ZodTypeAny, {
2287
- $$date?: "now" | undefined;
2288
- $$time?: "now" | undefined;
2289
- }, {
2290
- $$date?: "now" | undefined;
2291
- $$time?: "now" | undefined;
2292
- }>, z.ZodLiteral<"$$date">]>, z.ZodLiteral<"$$time">]>, "$$time", "$$date" | "$$time" | {
2293
- $$date?: "now" | undefined;
2294
- $$time?: "now" | undefined;
2295
- }>, z.ZodString]>>;
2268
+ defaultValue: z.ZodOptional<z.ZodString>;
2296
2269
  configuration: z.ZodOptional<z.ZodObject<{
2297
2270
  use12HourFormat: z.ZodOptional<z.ZodBoolean>;
2298
2271
  notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
@@ -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" | undefined;
2423
- $$time?: "now" | undefined;
2424
- } | undefined;
2394
+ defaultValue?: string | undefined;
2425
2395
  configuration?: {
2426
2396
  notice?: {
2427
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<{
@@ -8,8 +8,6 @@ import { FieldValue } from './FieldValue';
8
8
  * Available system variables for configuration.
9
9
  */
10
10
  export type SystemVariables = {
11
- $$date: string;
12
- $$time: string;
13
11
  user: {
14
12
  id: string;
15
13
  province?: 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").optional(),
114
- $$time: import_zod2.z.literal("now").optional()
115
- }).or(import_zod2.z.literal("$$date")).or(import_zod2.z.literal("$$time"));
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",