@opencrvs/toolkit 1.9.12-rc.94eeba2 → 1.9.12-rc.ad2ea34

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.
@@ -7872,8 +7872,169 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7872
7872
  type: z.ZodLiteral<"ADDRESS">;
7873
7873
  configuration: z.ZodOptional<z.ZodObject<{
7874
7874
  lineSeparator: z.ZodOptional<z.ZodString>;
7875
- fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["country", "administrativeArea"]>, "many">>;
7876
- administrativeLevels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7875
+ fields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<Pick<{
7876
+ id: z.ZodEffects<z.ZodString, string, string>;
7877
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7878
+ id: string;
7879
+ description: string;
7880
+ defaultMessage: string;
7881
+ }>;
7882
+ parent: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7883
+ $$field: z.ZodEffects<z.ZodString, string, string>;
7884
+ $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7885
+ }, "strip", z.ZodTypeAny, {
7886
+ $$field: string;
7887
+ $$subfield: string[];
7888
+ }, {
7889
+ $$field: string;
7890
+ $$subfield?: string[] | undefined;
7891
+ }>, z.ZodArray<z.ZodObject<{
7892
+ $$field: z.ZodEffects<z.ZodString, string, string>;
7893
+ $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7894
+ }, "strip", z.ZodTypeAny, {
7895
+ $$field: string;
7896
+ $$subfield: string[];
7897
+ }, {
7898
+ $$field: string;
7899
+ $$subfield?: string[] | undefined;
7900
+ }>, "many">]>>;
7901
+ required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
7902
+ message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7903
+ id: string;
7904
+ description: string;
7905
+ defaultMessage: string;
7906
+ }>;
7907
+ }, "strip", z.ZodTypeAny, {
7908
+ message: TranslationConfig;
7909
+ }, {
7910
+ message: {
7911
+ id: string;
7912
+ description: string;
7913
+ defaultMessage: string;
7914
+ };
7915
+ }>]>>>;
7916
+ conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>;
7917
+ secured: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7918
+ placeholder: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7919
+ id: string;
7920
+ description: string;
7921
+ defaultMessage: string;
7922
+ }>>;
7923
+ validation: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
7924
+ validator: z.ZodType<JSONSchema, z.ZodTypeDef, JSONSchema>;
7925
+ message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7926
+ id: string;
7927
+ description: string;
7928
+ defaultMessage: string;
7929
+ }>;
7930
+ }, "strip", z.ZodTypeAny, {
7931
+ message: TranslationConfig;
7932
+ validator: JSONSchema;
7933
+ }, {
7934
+ message: {
7935
+ id: string;
7936
+ description: string;
7937
+ defaultMessage: string;
7938
+ };
7939
+ validator: JSONSchema;
7940
+ }>, "many">>>;
7941
+ helperText: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
7942
+ id: string;
7943
+ description: string;
7944
+ defaultMessage: string;
7945
+ }>>;
7946
+ hideLabel: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7947
+ uncorrectable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7948
+ value: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7949
+ $$field: z.ZodEffects<z.ZodString, string, string>;
7950
+ $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7951
+ }, "strip", z.ZodTypeAny, {
7952
+ $$field: string;
7953
+ $$subfield: string[];
7954
+ }, {
7955
+ $$field: string;
7956
+ $$subfield?: string[] | undefined;
7957
+ }>, z.ZodArray<z.ZodObject<{
7958
+ $$field: z.ZodEffects<z.ZodString, string, string>;
7959
+ $$subfield: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7960
+ }, "strip", z.ZodTypeAny, {
7961
+ $$field: string;
7962
+ $$subfield: string[];
7963
+ }, {
7964
+ $$field: string;
7965
+ $$subfield?: string[] | undefined;
7966
+ }>, "many">]>>;
7967
+ analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
7968
+ }, "id" | "required" | "conditionals">, "strip", z.ZodTypeAny, {
7969
+ id: string;
7970
+ required?: boolean | {
7971
+ message: TranslationConfig;
7972
+ } | undefined;
7973
+ conditionals?: ({
7974
+ type: "SHOW";
7975
+ conditional: JSONSchema;
7976
+ } | {
7977
+ type: "ENABLE";
7978
+ conditional: JSONSchema;
7979
+ } | {
7980
+ type: "DISPLAY_ON_REVIEW";
7981
+ conditional: JSONSchema;
7982
+ })[] | undefined;
7983
+ }, {
7984
+ id: string;
7985
+ required?: boolean | {
7986
+ message: {
7987
+ id: string;
7988
+ description: string;
7989
+ defaultMessage: string;
7990
+ };
7991
+ } | undefined;
7992
+ conditionals?: ({
7993
+ type: "SHOW";
7994
+ conditional: JSONSchema;
7995
+ } | {
7996
+ type: "ENABLE";
7997
+ conditional: JSONSchema;
7998
+ } | {
7999
+ type: "DISPLAY_ON_REVIEW";
8000
+ conditional: JSONSchema;
8001
+ })[] | undefined;
8002
+ }>, {
8003
+ type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8004
+ id: string;
8005
+ required?: boolean | {
8006
+ message: TranslationConfig;
8007
+ } | undefined;
8008
+ conditionals?: ({
8009
+ type: "SHOW";
8010
+ conditional: JSONSchema;
8011
+ } | {
8012
+ type: "ENABLE";
8013
+ conditional: JSONSchema;
8014
+ } | {
8015
+ type: "DISPLAY_ON_REVIEW";
8016
+ conditional: JSONSchema;
8017
+ })[] | undefined;
8018
+ }, {
8019
+ id: string;
8020
+ required?: boolean | {
8021
+ message: {
8022
+ id: string;
8023
+ description: string;
8024
+ defaultMessage: string;
8025
+ };
8026
+ } | undefined;
8027
+ conditionals?: ({
8028
+ type: "SHOW";
8029
+ conditional: JSONSchema;
8030
+ } | {
8031
+ type: "ENABLE";
8032
+ conditional: JSONSchema;
8033
+ } | {
8034
+ type: "DISPLAY_ON_REVIEW";
8035
+ conditional: JSONSchema;
8036
+ })[] | undefined;
8037
+ }>, "many">>;
7877
8038
  streetAddressForm: z.ZodOptional<z.ZodArray<z.ZodObject<{
7878
8039
  id: z.ZodString;
7879
8040
  required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
@@ -7961,8 +8122,23 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7961
8122
  }>, "many">>;
7962
8123
  }, "strip", z.ZodTypeAny, {
7963
8124
  lineSeparator?: string | undefined;
7964
- fields?: ("country" | "administrativeArea")[] | undefined;
7965
- administrativeLevels?: string[] | undefined;
8125
+ fields?: {
8126
+ type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8127
+ id: string;
8128
+ required?: boolean | {
8129
+ message: TranslationConfig;
8130
+ } | undefined;
8131
+ conditionals?: ({
8132
+ type: "SHOW";
8133
+ conditional: JSONSchema;
8134
+ } | {
8135
+ type: "ENABLE";
8136
+ conditional: JSONSchema;
8137
+ } | {
8138
+ type: "DISPLAY_ON_REVIEW";
8139
+ conditional: JSONSchema;
8140
+ })[] | undefined;
8141
+ }[] | undefined;
7966
8142
  streetAddressForm?: {
7967
8143
  type: "TEXT";
7968
8144
  id: string;
@@ -7987,8 +8163,26 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7987
8163
  }[] | undefined;
7988
8164
  }, {
7989
8165
  lineSeparator?: string | undefined;
7990
- fields?: ("country" | "administrativeArea")[] | undefined;
7991
- administrativeLevels?: string[] | undefined;
8166
+ fields?: {
8167
+ id: string;
8168
+ required?: boolean | {
8169
+ message: {
8170
+ id: string;
8171
+ description: string;
8172
+ defaultMessage: string;
8173
+ };
8174
+ } | undefined;
8175
+ conditionals?: ({
8176
+ type: "SHOW";
8177
+ conditional: JSONSchema;
8178
+ } | {
8179
+ type: "ENABLE";
8180
+ conditional: JSONSchema;
8181
+ } | {
8182
+ type: "DISPLAY_ON_REVIEW";
8183
+ conditional: JSONSchema;
8184
+ })[] | undefined;
8185
+ }[] | undefined;
7992
8186
  streetAddressForm?: {
7993
8187
  type: "TEXT";
7994
8188
  id: string;
@@ -8106,8 +8300,23 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8106
8300
  } | undefined;
8107
8301
  configuration?: {
8108
8302
  lineSeparator?: string | undefined;
8109
- fields?: ("country" | "administrativeArea")[] | undefined;
8110
- administrativeLevels?: string[] | undefined;
8303
+ fields?: {
8304
+ type: "COUNTRY" | "ADMINISTRATIVE_AREA";
8305
+ id: string;
8306
+ required?: boolean | {
8307
+ message: TranslationConfig;
8308
+ } | undefined;
8309
+ conditionals?: ({
8310
+ type: "SHOW";
8311
+ conditional: JSONSchema;
8312
+ } | {
8313
+ type: "ENABLE";
8314
+ conditional: JSONSchema;
8315
+ } | {
8316
+ type: "DISPLAY_ON_REVIEW";
8317
+ conditional: JSONSchema;
8318
+ })[] | undefined;
8319
+ }[] | undefined;
8111
8320
  streetAddressForm?: {
8112
8321
  type: "TEXT";
8113
8322
  id: string;
@@ -8203,8 +8412,26 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8203
8412
  } | undefined;
8204
8413
  configuration?: {
8205
8414
  lineSeparator?: string | undefined;
8206
- fields?: ("country" | "administrativeArea")[] | undefined;
8207
- administrativeLevels?: string[] | undefined;
8415
+ fields?: {
8416
+ id: string;
8417
+ required?: boolean | {
8418
+ message: {
8419
+ id: string;
8420
+ description: string;
8421
+ defaultMessage: string;
8422
+ };
8423
+ } | undefined;
8424
+ conditionals?: ({
8425
+ type: "SHOW";
8426
+ conditional: JSONSchema;
8427
+ } | {
8428
+ type: "ENABLE";
8429
+ conditional: JSONSchema;
8430
+ } | {
8431
+ type: "DISPLAY_ON_REVIEW";
8432
+ conditional: JSONSchema;
8433
+ })[] | undefined;
8434
+ }[] | undefined;
8208
8435
  streetAddressForm?: {
8209
8436
  type: "TEXT";
8210
8437
  id: string;
@@ -2334,12 +2334,19 @@ var Office = BaseField.extend({
2334
2334
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
2335
2335
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
2336
2336
  });
2337
+ var DomesticAddressField = BaseField.pick({
2338
+ id: true,
2339
+ required: true,
2340
+ conditionals: true
2341
+ }).transform((config) => ({
2342
+ ...config,
2343
+ type: config.id === "country" ? FieldType.COUNTRY : FieldType.ADMINISTRATIVE_AREA
2344
+ })).openapi({ effectType: "input", type: "object" });
2337
2345
  var Address = BaseField.extend({
2338
2346
  type: import_zod17.z.literal(FieldType.ADDRESS),
2339
2347
  configuration: import_zod17.z.object({
2340
2348
  lineSeparator: import_zod17.z.string().optional(),
2341
- fields: import_zod17.z.array(import_zod17.z.enum(["country", "administrativeArea"])).optional(),
2342
- administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
2349
+ fields: import_zod17.z.array(DomesticAddressField).optional(),
2343
2350
  streetAddressForm: import_zod17.z.array(
2344
2351
  import_zod17.z.object({
2345
2352
  id: import_zod17.z.string(),
@@ -1840,12 +1840,19 @@ var Office = BaseField.extend({
1840
1840
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1841
1841
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
1842
1842
  });
1843
+ var DomesticAddressField = BaseField.pick({
1844
+ id: true,
1845
+ required: true,
1846
+ conditionals: true
1847
+ }).transform((config) => ({
1848
+ ...config,
1849
+ type: config.id === "country" ? FieldType.COUNTRY : FieldType.ADMINISTRATIVE_AREA
1850
+ })).openapi({ effectType: "input", type: "object" });
1843
1851
  var Address = BaseField.extend({
1844
1852
  type: import_zod17.z.literal(FieldType.ADDRESS),
1845
1853
  configuration: import_zod17.z.object({
1846
1854
  lineSeparator: import_zod17.z.string().optional(),
1847
- fields: import_zod17.z.array(import_zod17.z.enum(["country", "administrativeArea"])).optional(),
1848
- administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
1855
+ fields: import_zod17.z.array(DomesticAddressField).optional(),
1849
1856
  streetAddressForm: import_zod17.z.array(
1850
1857
  import_zod17.z.object({
1851
1858
  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.94eeba2",
3
+ "version": "1.9.12-rc.ad2ea34",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {