@opencrvs/toolkit 1.9.12-rc.52c5c27 → 1.9.12-rc.d350fab

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.
@@ -7741,174 +7741,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7741
7741
  type: z.ZodLiteral<"ADDRESS">;
7742
7742
  configuration: z.ZodOptional<z.ZodObject<{
7743
7743
  lineSeparator: z.ZodOptional<z.ZodString>;
7744
- fields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodObject<z.objectUtil.extendShape<Pick<{
7745
- id: z.ZodEffects<z.ZodString, string, string>;
7746
- label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7747
- id: string;
7748
- description: string;
7749
- defaultMessage: string;
7750
- }>;
7751
- parent: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7752
- $$field: z.ZodEffects<z.ZodString, string, string>;
7753
- $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7754
- }, "strip", z.ZodTypeAny, {
7755
- $$field: string;
7756
- $$subfield: string[];
7757
- }, {
7758
- $$field: string;
7759
- $$subfield?: string[] | undefined;
7760
- }>, z.ZodArray<z.ZodObject<{
7761
- $$field: z.ZodEffects<z.ZodString, string, string>;
7762
- $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7763
- }, "strip", z.ZodTypeAny, {
7764
- $$field: string;
7765
- $$subfield: string[];
7766
- }, {
7767
- $$field: string;
7768
- $$subfield?: string[] | undefined;
7769
- }>, "many">]>>;
7770
- required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
7771
- message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7772
- id: string;
7773
- description: string;
7774
- defaultMessage: string;
7775
- }>;
7776
- }, "strip", z.ZodTypeAny, {
7777
- message: TranslationConfig;
7778
- }, {
7779
- message: {
7780
- id: string;
7781
- description: string;
7782
- defaultMessage: string;
7783
- };
7784
- }>]>>>;
7785
- conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>;
7786
- secured: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7787
- placeholder: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7788
- id: string;
7789
- description: string;
7790
- defaultMessage: string;
7791
- }>>;
7792
- validation: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
7793
- validator: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
7794
- message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7795
- id: string;
7796
- description: string;
7797
- defaultMessage: string;
7798
- }>;
7799
- }, "strip", z.ZodTypeAny, {
7800
- message: TranslationConfig;
7801
- validator: JSONSchema;
7802
- }, {
7803
- message: {
7804
- id: string;
7805
- description: string;
7806
- defaultMessage: string;
7807
- };
7808
- validator: JSONSchema;
7809
- }>, "many">>>;
7810
- helperText: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7811
- id: string;
7812
- description: string;
7813
- defaultMessage: string;
7814
- }>>;
7815
- hideLabel: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7816
- uncorrectable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7817
- value: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7818
- $$field: z.ZodEffects<z.ZodString, string, string>;
7819
- $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7820
- }, "strip", z.ZodTypeAny, {
7821
- $$field: string;
7822
- $$subfield: string[];
7823
- }, {
7824
- $$field: string;
7825
- $$subfield?: string[] | undefined;
7826
- }>, z.ZodArray<z.ZodObject<{
7827
- $$field: z.ZodEffects<z.ZodString, string, string>;
7828
- $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7829
- }, "strip", z.ZodTypeAny, {
7830
- $$field: string;
7831
- $$subfield: string[];
7832
- }, {
7833
- $$field: string;
7834
- $$subfield?: string[] | undefined;
7835
- }>, "many">]>>;
7836
- analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7837
- }, "id" | "required" | "conditionals">, {
7838
- type: z.ZodUnion<[z.ZodLiteral<"ADMINISTRATIVE_AREA">, z.ZodLiteral<"COUNTRY">]>;
7839
- }>, "strip", z.ZodTypeAny, {
7840
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
7841
- id: string;
7842
- required?: boolean | {
7843
- message: TranslationConfig;
7844
- } | undefined;
7845
- conditionals?: ({
7846
- type: "SHOW";
7847
- conditional: JSONSchema;
7848
- } | {
7849
- type: "ENABLE";
7850
- conditional: JSONSchema;
7851
- } | {
7852
- type: "DISPLAY_ON_REVIEW";
7853
- conditional: JSONSchema;
7854
- })[] | undefined;
7855
- }, {
7856
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
7857
- id: string;
7858
- required?: boolean | {
7859
- message: {
7860
- id: string;
7861
- description: string;
7862
- defaultMessage: string;
7863
- };
7864
- } | undefined;
7865
- conditionals?: ({
7866
- type: "SHOW";
7867
- conditional: JSONSchema;
7868
- } | {
7869
- type: "ENABLE";
7870
- conditional: JSONSchema;
7871
- } | {
7872
- type: "DISPLAY_ON_REVIEW";
7873
- conditional: JSONSchema;
7874
- })[] | undefined;
7875
- }>]>, {
7876
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
7877
- id: string;
7878
- required?: boolean | {
7879
- message: TranslationConfig;
7880
- } | undefined;
7881
- conditionals?: ({
7882
- type: "SHOW";
7883
- conditional: JSONSchema;
7884
- } | {
7885
- type: "ENABLE";
7886
- conditional: JSONSchema;
7887
- } | {
7888
- type: "DISPLAY_ON_REVIEW";
7889
- conditional: JSONSchema;
7890
- })[] | undefined;
7891
- }, string | {
7892
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
7893
- id: string;
7894
- required?: boolean | {
7895
- message: {
7896
- id: string;
7897
- description: string;
7898
- defaultMessage: string;
7899
- };
7900
- } | undefined;
7901
- conditionals?: ({
7902
- type: "SHOW";
7903
- conditional: JSONSchema;
7904
- } | {
7905
- type: "ENABLE";
7906
- conditional: JSONSchema;
7907
- } | {
7908
- type: "DISPLAY_ON_REVIEW";
7909
- conditional: JSONSchema;
7910
- })[] | undefined;
7911
- }>, "many">>;
7744
+ fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["country", "administrativeArea"]>, "many">>;
7745
+ administrativeLevels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7912
7746
  streetAddressForm: z.ZodOptional<z.ZodArray<z.ZodObject<{
7913
7747
  id: z.ZodString;
7914
7748
  required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
@@ -7996,23 +7830,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7996
7830
  }>, "many">>;
7997
7831
  }, "strip", z.ZodTypeAny, {
7998
7832
  lineSeparator?: string | undefined;
7999
- fields?: {
8000
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8001
- id: string;
8002
- required?: boolean | {
8003
- message: TranslationConfig;
8004
- } | undefined;
8005
- conditionals?: ({
8006
- type: "SHOW";
8007
- conditional: JSONSchema;
8008
- } | {
8009
- type: "ENABLE";
8010
- conditional: JSONSchema;
8011
- } | {
8012
- type: "DISPLAY_ON_REVIEW";
8013
- conditional: JSONSchema;
8014
- })[] | undefined;
8015
- }[] | undefined;
7833
+ fields?: ("country" | "administrativeArea")[] | undefined;
7834
+ administrativeLevels?: string[] | undefined;
8016
7835
  streetAddressForm?: {
8017
7836
  type: "TEXT";
8018
7837
  id: string;
@@ -8037,27 +7856,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8037
7856
  }[] | undefined;
8038
7857
  }, {
8039
7858
  lineSeparator?: string | undefined;
8040
- fields?: (string | {
8041
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8042
- id: string;
8043
- required?: boolean | {
8044
- message: {
8045
- id: string;
8046
- description: string;
8047
- defaultMessage: string;
8048
- };
8049
- } | undefined;
8050
- conditionals?: ({
8051
- type: "SHOW";
8052
- conditional: JSONSchema;
8053
- } | {
8054
- type: "ENABLE";
8055
- conditional: JSONSchema;
8056
- } | {
8057
- type: "DISPLAY_ON_REVIEW";
8058
- conditional: JSONSchema;
8059
- })[] | undefined;
8060
- })[] | undefined;
7859
+ fields?: ("country" | "administrativeArea")[] | undefined;
7860
+ administrativeLevels?: string[] | undefined;
8061
7861
  streetAddressForm?: {
8062
7862
  type: "TEXT";
8063
7863
  id: string;
@@ -8175,23 +7975,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8175
7975
  } | undefined;
8176
7976
  configuration?: {
8177
7977
  lineSeparator?: string | undefined;
8178
- fields?: {
8179
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8180
- id: string;
8181
- required?: boolean | {
8182
- message: TranslationConfig;
8183
- } | undefined;
8184
- conditionals?: ({
8185
- type: "SHOW";
8186
- conditional: JSONSchema;
8187
- } | {
8188
- type: "ENABLE";
8189
- conditional: JSONSchema;
8190
- } | {
8191
- type: "DISPLAY_ON_REVIEW";
8192
- conditional: JSONSchema;
8193
- })[] | undefined;
8194
- }[] | undefined;
7978
+ fields?: ("country" | "administrativeArea")[] | undefined;
7979
+ administrativeLevels?: string[] | undefined;
8195
7980
  streetAddressForm?: {
8196
7981
  type: "TEXT";
8197
7982
  id: string;
@@ -8287,27 +8072,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8287
8072
  } | undefined;
8288
8073
  configuration?: {
8289
8074
  lineSeparator?: string | undefined;
8290
- fields?: (string | {
8291
- type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8292
- id: string;
8293
- required?: boolean | {
8294
- message: {
8295
- id: string;
8296
- description: string;
8297
- defaultMessage: string;
8298
- };
8299
- } | undefined;
8300
- conditionals?: ({
8301
- type: "SHOW";
8302
- conditional: JSONSchema;
8303
- } | {
8304
- type: "ENABLE";
8305
- conditional: JSONSchema;
8306
- } | {
8307
- type: "DISPLAY_ON_REVIEW";
8308
- conditional: JSONSchema;
8309
- })[] | undefined;
8310
- })[] | undefined;
8075
+ fields?: ("country" | "administrativeArea")[] | undefined;
8076
+ administrativeLevels?: string[] | undefined;
8311
8077
  streetAddressForm?: {
8312
8078
  type: "TEXT";
8313
8079
  id: string;
@@ -2333,33 +2333,12 @@ var Office = BaseField.extend({
2333
2333
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
2334
2334
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
2335
2335
  });
2336
- var DomesticAddressField = import_zod17.z.string().or(
2337
- BaseField.pick({
2338
- id: true,
2339
- required: true,
2340
- conditionals: true
2341
- }).extend({
2342
- type: import_zod17.z.union([
2343
- import_zod17.z.literal(FieldType.ADMINISTRATIVE_AREA),
2344
- import_zod17.z.literal(FieldType.COUNTRY)
2345
- ])
2346
- })
2347
- ).transform((val) => {
2348
- if (typeof val === "string") {
2349
- return {
2350
- id: val,
2351
- type: val === "country" ? FieldType.COUNTRY : FieldType.ADMINISTRATIVE_AREA,
2352
- required: true,
2353
- conditionals: []
2354
- };
2355
- }
2356
- return val;
2357
- }).openapi({ effectType: "input", type: "string" });
2358
2336
  var Address = BaseField.extend({
2359
2337
  type: import_zod17.z.literal(FieldType.ADDRESS),
2360
2338
  configuration: import_zod17.z.object({
2361
2339
  lineSeparator: import_zod17.z.string().optional(),
2362
- fields: import_zod17.z.array(DomesticAddressField).optional(),
2340
+ fields: import_zod17.z.array(import_zod17.z.enum(["country", "administrativeArea"])).optional(),
2341
+ administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
2363
2342
  streetAddressForm: import_zod17.z.array(
2364
2343
  import_zod17.z.object({
2365
2344
  id: import_zod17.z.string(),
@@ -1839,33 +1839,12 @@ var Office = BaseField.extend({
1839
1839
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1840
1840
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
1841
1841
  });
1842
- var DomesticAddressField = import_zod17.z.string().or(
1843
- BaseField.pick({
1844
- id: true,
1845
- required: true,
1846
- conditionals: true
1847
- }).extend({
1848
- type: import_zod17.z.union([
1849
- import_zod17.z.literal(FieldType.ADMINISTRATIVE_AREA),
1850
- import_zod17.z.literal(FieldType.COUNTRY)
1851
- ])
1852
- })
1853
- ).transform((val) => {
1854
- if (typeof val === "string") {
1855
- return {
1856
- id: val,
1857
- type: val === "country" ? FieldType.COUNTRY : FieldType.ADMINISTRATIVE_AREA,
1858
- required: true,
1859
- conditionals: []
1860
- };
1861
- }
1862
- return val;
1863
- }).openapi({ effectType: "input", type: "string" });
1864
1842
  var Address = BaseField.extend({
1865
1843
  type: import_zod17.z.literal(FieldType.ADDRESS),
1866
1844
  configuration: import_zod17.z.object({
1867
1845
  lineSeparator: import_zod17.z.string().optional(),
1868
- fields: import_zod17.z.array(DomesticAddressField).optional(),
1846
+ fields: import_zod17.z.array(import_zod17.z.enum(["country", "administrativeArea"])).optional(),
1847
+ administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
1869
1848
  streetAddressForm: import_zod17.z.array(
1870
1849
  import_zod17.z.object({
1871
1850
  id: import_zod17.z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.12-rc.52c5c27",
3
+ "version": "1.9.12-rc.d350fab",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {