@opencrvs/toolkit 1.9.6-rc.cd4bb81 → 1.9.6-rc.d5ae78e

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.
@@ -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,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;
@@ -26,6 +26,10 @@ export declare function field(fieldId: string): {
26
26
  days: number;
27
27
  boost?: number | undefined;
28
28
  pivot?: number | undefined;
29
+ alsoMatchAgainst?: {
30
+ $$field: string;
31
+ $$subfield?: string[] | undefined;
32
+ }[] | undefined;
29
33
  };
30
34
  };
31
35
  };
@@ -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",
@@ -26,6 +26,10 @@ export declare function field(fieldId: string): {
26
26
  days: number;
27
27
  boost?: number | undefined;
28
28
  pivot?: number | undefined;
29
+ alsoMatchAgainst?: {
30
+ $$field: string;
31
+ $$subfield?: string[] | undefined;
32
+ }[] | undefined;
29
33
  };
30
34
  };
31
35
  };