@opencrvs/toolkit 1.9.12-rc.990e21c → 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.
@@ -6383,33 +6383,6 @@ declare const Country: z.ZodObject<z.objectUtil.extendShape<{
6383
6383
  }, {
6384
6384
  type: z.ZodLiteral<"COUNTRY">;
6385
6385
  defaultValue: z.ZodOptional<z.ZodString>;
6386
- optionOverrides: z.ZodOptional<z.ZodArray<z.ZodObject<Omit<{
6387
- value: z.ZodString;
6388
- label: z.ZodUnion<[z.ZodString, z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
6389
- id: string;
6390
- description: string;
6391
- defaultMessage: string;
6392
- }>]>;
6393
- conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").ActionConditionalType[]>, "many">>>;
6394
- }, "label">, "strip", z.ZodTypeAny, {
6395
- value: string;
6396
- conditionals?: ({
6397
- type: "SHOW";
6398
- conditional: JSONSchema;
6399
- } | {
6400
- type: "ENABLE";
6401
- conditional: JSONSchema;
6402
- })[] | undefined;
6403
- }, {
6404
- value: string;
6405
- conditionals?: ({
6406
- type: "SHOW";
6407
- conditional: JSONSchema;
6408
- } | {
6409
- type: "ENABLE";
6410
- conditional: JSONSchema;
6411
- })[] | undefined;
6412
- }>, "many">>;
6413
6386
  }>, "strip", z.ZodTypeAny, {
6414
6387
  type: "COUNTRY";
6415
6388
  id: string;
@@ -6452,16 +6425,6 @@ declare const Country: z.ZodObject<z.objectUtil.extendShape<{
6452
6425
  uncorrectable?: boolean | undefined;
6453
6426
  analytics?: boolean | undefined;
6454
6427
  defaultValue?: string | undefined;
6455
- optionOverrides?: {
6456
- value: string;
6457
- conditionals?: ({
6458
- type: "SHOW";
6459
- conditional: JSONSchema;
6460
- } | {
6461
- type: "ENABLE";
6462
- conditional: JSONSchema;
6463
- })[] | undefined;
6464
- }[] | undefined;
6465
6428
  }, {
6466
6429
  type: "COUNTRY";
6467
6430
  id: string;
@@ -6524,16 +6487,6 @@ declare const Country: z.ZodObject<z.objectUtil.extendShape<{
6524
6487
  uncorrectable?: boolean | undefined;
6525
6488
  analytics?: boolean | undefined;
6526
6489
  defaultValue?: string | undefined;
6527
- optionOverrides?: {
6528
- value: string;
6529
- conditionals?: ({
6530
- type: "SHOW";
6531
- conditional: JSONSchema;
6532
- } | {
6533
- type: "ENABLE";
6534
- conditional: JSONSchema;
6535
- })[] | undefined;
6536
- }[] | undefined;
6537
6490
  }>;
6538
6491
  export type Country = z.infer<typeof Country>;
6539
6492
  export declare const AdministrativeAreas: z.ZodEnum<["ADMIN_STRUCTURE", "HEALTH_FACILITY", "CRVS_OFFICE"]>;
@@ -7919,8 +7872,169 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7919
7872
  type: z.ZodLiteral<"ADDRESS">;
7920
7873
  configuration: z.ZodOptional<z.ZodObject<{
7921
7874
  lineSeparator: z.ZodOptional<z.ZodString>;
7922
- fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["country", "administrativeArea"]>, "many">>;
7923
- 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">>;
7924
8038
  streetAddressForm: z.ZodOptional<z.ZodArray<z.ZodObject<{
7925
8039
  id: z.ZodString;
7926
8040
  required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
@@ -8008,8 +8122,23 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8008
8122
  }>, "many">>;
8009
8123
  }, "strip", z.ZodTypeAny, {
8010
8124
  lineSeparator?: string | undefined;
8011
- fields?: ("country" | "administrativeArea")[] | undefined;
8012
- 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;
8013
8142
  streetAddressForm?: {
8014
8143
  type: "TEXT";
8015
8144
  id: string;
@@ -8034,8 +8163,26 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8034
8163
  }[] | undefined;
8035
8164
  }, {
8036
8165
  lineSeparator?: string | undefined;
8037
- fields?: ("country" | "administrativeArea")[] | undefined;
8038
- 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;
8039
8186
  streetAddressForm?: {
8040
8187
  type: "TEXT";
8041
8188
  id: string;
@@ -8153,8 +8300,23 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8153
8300
  } | undefined;
8154
8301
  configuration?: {
8155
8302
  lineSeparator?: string | undefined;
8156
- fields?: ("country" | "administrativeArea")[] | undefined;
8157
- 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;
8158
8320
  streetAddressForm?: {
8159
8321
  type: "TEXT";
8160
8322
  id: string;
@@ -8250,8 +8412,26 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8250
8412
  } | undefined;
8251
8413
  configuration?: {
8252
8414
  lineSeparator?: string | undefined;
8253
- fields?: ("country" | "administrativeArea")[] | undefined;
8254
- 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;
8255
8435
  streetAddressForm?: {
8256
8436
  type: "TEXT";
8257
8437
  id: string;
@@ -2286,10 +2286,7 @@ var Checkbox = BaseField.extend({
2286
2286
  }).describe("Boolean checkbox field");
2287
2287
  var Country = BaseField.extend({
2288
2288
  type: import_zod17.z.literal(FieldType.COUNTRY),
2289
- defaultValue: NonEmptyTextValue.optional(),
2290
- optionOverrides: import_zod17.z.array(SelectOption.omit({ label: true })).optional().describe(
2291
- "Conditionals for specific countries. Countries not listed are always shown and enabled."
2292
- )
2289
+ defaultValue: NonEmptyTextValue.optional()
2293
2290
  }).describe("Country select field");
2294
2291
  var AdministrativeAreas = import_zod17.z.enum([
2295
2292
  "ADMIN_STRUCTURE",
@@ -2337,12 +2334,19 @@ var Office = BaseField.extend({
2337
2334
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
2338
2335
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
2339
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" });
2340
2345
  var Address = BaseField.extend({
2341
2346
  type: import_zod17.z.literal(FieldType.ADDRESS),
2342
2347
  configuration: import_zod17.z.object({
2343
2348
  lineSeparator: import_zod17.z.string().optional(),
2344
- fields: import_zod17.z.array(import_zod17.z.enum(["country", "administrativeArea"])).optional(),
2345
- administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
2349
+ fields: import_zod17.z.array(DomesticAddressField).optional(),
2346
2350
  streetAddressForm: import_zod17.z.array(
2347
2351
  import_zod17.z.object({
2348
2352
  id: import_zod17.z.string(),
@@ -1792,10 +1792,7 @@ var Checkbox = BaseField.extend({
1792
1792
  }).describe("Boolean checkbox field");
1793
1793
  var Country = BaseField.extend({
1794
1794
  type: import_zod17.z.literal(FieldType.COUNTRY),
1795
- defaultValue: NonEmptyTextValue.optional(),
1796
- optionOverrides: import_zod17.z.array(SelectOption.omit({ label: true })).optional().describe(
1797
- "Conditionals for specific countries. Countries not listed are always shown and enabled."
1798
- )
1795
+ defaultValue: NonEmptyTextValue.optional()
1799
1796
  }).describe("Country select field");
1800
1797
  var AdministrativeAreas = import_zod17.z.enum([
1801
1798
  "ADMIN_STRUCTURE",
@@ -1843,12 +1840,19 @@ var Office = BaseField.extend({
1843
1840
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1844
1841
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
1845
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" });
1846
1851
  var Address = BaseField.extend({
1847
1852
  type: import_zod17.z.literal(FieldType.ADDRESS),
1848
1853
  configuration: import_zod17.z.object({
1849
1854
  lineSeparator: import_zod17.z.string().optional(),
1850
- fields: import_zod17.z.array(import_zod17.z.enum(["country", "administrativeArea"])).optional(),
1851
- administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
1855
+ fields: import_zod17.z.array(DomesticAddressField).optional(),
1852
1856
  streetAddressForm: import_zod17.z.array(
1853
1857
  import_zod17.z.object({
1854
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.990e21c",
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": {