@nira-opencrvs/toolkit 1.9.11-rc.39d8d68 → 1.9.11-rc.72fc8df

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.
@@ -3667,6 +3667,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
3667
3667
  primaryOfficeId: string & import("zod").BRAND<"UUID">;
3668
3668
  signature?: string | undefined;
3669
3669
  device?: string | undefined;
3670
+ data?: Record<string, string> | undefined;
3670
3671
  fullHonorificName?: string | undefined;
3671
3672
  avatar?: string | undefined;
3672
3673
  } | {
@@ -3695,6 +3696,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
3695
3696
  primaryOfficeId: string & import("zod").BRAND<"UUID">;
3696
3697
  signature?: string | undefined;
3697
3698
  device?: string | undefined;
3699
+ data?: Record<string, string> | undefined;
3698
3700
  fullHonorificName?: string | undefined;
3699
3701
  avatar?: string | undefined;
3700
3702
  } | {
@@ -79,6 +79,12 @@ export declare const user: typeof userSerializer & {
79
79
  $location: string;
80
80
  };
81
81
  };
82
+ data: (fieldName: string) => {
83
+ $userDataField: string;
84
+ toJSON(): {
85
+ $userDataField: string;
86
+ };
87
+ };
82
88
  };
83
89
  export declare function isFieldReference(value: unknown): value is FieldReference;
84
90
  export declare function isEventFieldReference(value: unknown): value is FieldReference;
@@ -546,6 +546,12 @@ export declare const TextField: z.ZodObject<z.objectUtil.extendShape<{
546
546
  }, {
547
547
  $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
548
548
  $location?: string | undefined;
549
+ }>, z.ZodObject<{
550
+ $userDataField: z.ZodString;
551
+ }, "strip", z.ZodTypeAny, {
552
+ $userDataField: string;
553
+ }, {
554
+ $userDataField: string;
549
555
  }>]>>;
550
556
  configuration: z.ZodOptional<z.ZodDefault<z.ZodObject<{
551
557
  maxLength: z.ZodOptional<z.ZodNumber>;
@@ -623,6 +629,8 @@ export declare const TextField: z.ZodObject<z.objectUtil.extendShape<{
623
629
  defaultValue?: string | {
624
630
  $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
625
631
  $location?: string | undefined;
632
+ } | {
633
+ $userDataField: string;
626
634
  } | undefined;
627
635
  configuration?: {
628
636
  type?: "text" | "password" | undefined;
@@ -694,6 +702,8 @@ export declare const TextField: z.ZodObject<z.objectUtil.extendShape<{
694
702
  defaultValue?: string | {
695
703
  $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
696
704
  $location?: string | undefined;
705
+ } | {
706
+ $userDataField: string;
697
707
  } | undefined;
698
708
  configuration?: {
699
709
  type?: "text" | "password" | undefined;
@@ -7273,7 +7283,22 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
7273
7283
  analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7274
7284
  }, {
7275
7285
  type: z.ZodLiteral<"FACILITY">;
7276
- defaultValue: z.ZodOptional<z.ZodString>;
7286
+ defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
7287
+ $userField: z.ZodEnum<["id", "name", "role", "fullHonorificName", "device", "firstname", "middlename", "surname", "district", "province", "primaryOfficeId"]>;
7288
+ $location: z.ZodOptional<z.ZodString>;
7289
+ }, "strip", z.ZodTypeAny, {
7290
+ $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
7291
+ $location?: string | undefined;
7292
+ }, {
7293
+ $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
7294
+ $location?: string | undefined;
7295
+ }>, z.ZodObject<{
7296
+ $userDataField: z.ZodString;
7297
+ }, "strip", z.ZodTypeAny, {
7298
+ $userDataField: string;
7299
+ }, {
7300
+ $userDataField: string;
7301
+ }>]>>;
7277
7302
  }>, "strip", z.ZodTypeAny, {
7278
7303
  type: "FACILITY";
7279
7304
  id: string;
@@ -7315,7 +7340,12 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
7315
7340
  hideLabel?: boolean | undefined;
7316
7341
  uncorrectable?: boolean | undefined;
7317
7342
  analytics?: boolean | undefined;
7318
- defaultValue?: string | undefined;
7343
+ defaultValue?: string | {
7344
+ $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
7345
+ $location?: string | undefined;
7346
+ } | {
7347
+ $userDataField: string;
7348
+ } | undefined;
7319
7349
  }, {
7320
7350
  type: "FACILITY";
7321
7351
  id: string;
@@ -7377,7 +7407,12 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
7377
7407
  hideLabel?: boolean | undefined;
7378
7408
  uncorrectable?: boolean | undefined;
7379
7409
  analytics?: boolean | undefined;
7380
- defaultValue?: string | undefined;
7410
+ defaultValue?: string | {
7411
+ $userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
7412
+ $location?: string | undefined;
7413
+ } | {
7414
+ $userDataField: string;
7415
+ } | undefined;
7381
7416
  }>;
7382
7417
  export type Facility = z.infer<typeof Facility>;
7383
7418
  declare const Office: z.ZodObject<z.objectUtil.extendShape<{
@@ -22,6 +22,7 @@ export type SystemVariables = {
22
22
  device?: string;
23
23
  avatar?: string;
24
24
  signature?: string;
25
+ data?: Record<string, string>;
25
26
  };
26
27
  $window: {
27
28
  location: {
@@ -82,6 +82,17 @@ function userSerializer(userField) {
82
82
  }
83
83
  };
84
84
  }
85
+ var SerializedUserDataField = import_zod.z.object({
86
+ $userDataField: import_zod.z.string()
87
+ });
88
+ function userDataSerializer(key) {
89
+ return {
90
+ $userDataField: key,
91
+ toJSON() {
92
+ return { $userDataField: key };
93
+ }
94
+ };
95
+ }
85
96
 
86
97
  // ../commons/src/utils.ts
87
98
  var z2 = __toESM(require("zod"));
@@ -242,7 +253,8 @@ var user = Object.assign(userSerializer, {
242
253
  $user: {
243
254
  $location: adminLevelId
244
255
  }
245
- })
256
+ }),
257
+ data: (fieldName) => userDataSerializer(fieldName)
246
258
  });
247
259
  function isFieldReference(value) {
248
260
  return typeof value === "object" && value !== null && "$$field" in value;
@@ -922,6 +922,17 @@ function userSerializer(userField) {
922
922
  }
923
923
  };
924
924
  }
925
+ var SerializedUserDataField = import_zod10.z.object({
926
+ $userDataField: import_zod10.z.string()
927
+ });
928
+ function userDataSerializer(key) {
929
+ return {
930
+ $userDataField: key,
931
+ toJSON() {
932
+ return { $userDataField: key };
933
+ }
934
+ };
935
+ }
925
936
 
926
937
  // ../commons/src/events/EventIndex.ts
927
938
  var import_zod15 = require("zod");
@@ -2019,7 +2030,7 @@ var Divider = BaseField.extend({
2019
2030
  });
2020
2031
  var TextField = BaseField.extend({
2021
2032
  type: import_zod17.z.literal(FieldType.TEXT),
2022
- defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
2033
+ defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional(),
2023
2034
  configuration: import_zod17.z.object({
2024
2035
  maxLength: import_zod17.z.number().optional().describe("Maximum length of the text"),
2025
2036
  type: import_zod17.z.enum(["text", "password"]).optional(),
@@ -2314,7 +2325,7 @@ var FileUploadWithOptions = BaseField.extend({
2314
2325
  });
2315
2326
  var Facility = BaseField.extend({
2316
2327
  type: import_zod17.z.literal(FieldType.FACILITY),
2317
- defaultValue: NonEmptyTextValue.optional()
2328
+ defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional()
2318
2329
  }).describe("Input field for a facility");
2319
2330
  var Office = BaseField.extend({
2320
2331
  type: import_zod17.z.literal(FieldType.OFFICE),
@@ -4157,7 +4168,8 @@ var user = Object.assign(userSerializer, {
4157
4168
  $user: {
4158
4169
  $location: adminLevelId
4159
4170
  }
4160
- })
4171
+ }),
4172
+ data: (fieldName) => userDataSerializer(fieldName)
4161
4173
  });
4162
4174
  function isFieldReference(value) {
4163
4175
  return typeof value === "object" && value !== null && "$$field" in value;
@@ -569,6 +569,17 @@ function userSerializer(userField) {
569
569
  }
570
570
  };
571
571
  }
572
+ var SerializedUserDataField = import_zod10.z.object({
573
+ $userDataField: import_zod10.z.string()
574
+ });
575
+ function userDataSerializer(key) {
576
+ return {
577
+ $userDataField: key,
578
+ toJSON() {
579
+ return { $userDataField: key };
580
+ }
581
+ };
582
+ }
572
583
 
573
584
  // ../commons/src/events/EventIndex.ts
574
585
  var import_zod15 = require("zod");
@@ -1531,7 +1542,7 @@ var Divider = BaseField.extend({
1531
1542
  });
1532
1543
  var TextField = BaseField.extend({
1533
1544
  type: import_zod17.z.literal(FieldType.TEXT),
1534
- defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
1545
+ defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional(),
1535
1546
  configuration: import_zod17.z.object({
1536
1547
  maxLength: import_zod17.z.number().optional().describe("Maximum length of the text"),
1537
1548
  type: import_zod17.z.enum(["text", "password"]).optional(),
@@ -1826,7 +1837,7 @@ var FileUploadWithOptions = BaseField.extend({
1826
1837
  });
1827
1838
  var Facility = BaseField.extend({
1828
1839
  type: import_zod17.z.literal(FieldType.FACILITY),
1829
- defaultValue: NonEmptyTextValue.optional()
1840
+ defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional()
1830
1841
  }).describe("Input field for a facility");
1831
1842
  var Office = BaseField.extend({
1832
1843
  type: import_zod17.z.literal(FieldType.OFFICE),
@@ -2764,7 +2775,8 @@ var user = Object.assign(userSerializer, {
2764
2775
  $user: {
2765
2776
  $location: adminLevelId
2766
2777
  }
2767
- })
2778
+ }),
2779
+ data: (fieldName) => userDataSerializer(fieldName)
2768
2780
  });
2769
2781
  function isFieldReference(value) {
2770
2782
  return typeof value === "object" && value !== null && "$$field" in value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nira-opencrvs/toolkit",
3
- "version": "1.9.11-rc.39d8d68",
3
+ "version": "1.9.11-rc.72fc8df",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {