@opencrvs/toolkit 1.9.12-rc.ad2ea34 → 1.9.12-rc.b38f7ff

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,6 +6383,33 @@ 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">>;
6386
6413
  }>, "strip", z.ZodTypeAny, {
6387
6414
  type: "COUNTRY";
6388
6415
  id: string;
@@ -6425,6 +6452,16 @@ declare const Country: z.ZodObject<z.objectUtil.extendShape<{
6425
6452
  uncorrectable?: boolean | undefined;
6426
6453
  analytics?: boolean | undefined;
6427
6454
  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;
6428
6465
  }, {
6429
6466
  type: "COUNTRY";
6430
6467
  id: string;
@@ -6487,6 +6524,16 @@ declare const Country: z.ZodObject<z.objectUtil.extendShape<{
6487
6524
  uncorrectable?: boolean | undefined;
6488
6525
  analytics?: boolean | undefined;
6489
6526
  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;
6490
6537
  }>;
6491
6538
  export type Country = z.infer<typeof Country>;
6492
6539
  export declare const AdministrativeAreas: z.ZodEnum<["ADMIN_STRUCTURE", "HEALTH_FACILITY", "CRVS_OFFICE"]>;
@@ -7872,169 +7919,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
7872
7919
  type: z.ZodLiteral<"ADDRESS">;
7873
7920
  configuration: z.ZodOptional<z.ZodObject<{
7874
7921
  lineSeparator: z.ZodOptional<z.ZodString>;
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">>;
7922
+ fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["country", "administrativeArea"]>, "many">>;
7923
+ administrativeLevels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8038
7924
  streetAddressForm: z.ZodOptional<z.ZodArray<z.ZodObject<{
8039
7925
  id: z.ZodString;
8040
7926
  required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
@@ -8122,23 +8008,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8122
8008
  }>, "many">>;
8123
8009
  }, "strip", z.ZodTypeAny, {
8124
8010
  lineSeparator?: 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;
8011
+ fields?: ("country" | "administrativeArea")[] | undefined;
8012
+ administrativeLevels?: string[] | undefined;
8142
8013
  streetAddressForm?: {
8143
8014
  type: "TEXT";
8144
8015
  id: string;
@@ -8163,26 +8034,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8163
8034
  }[] | undefined;
8164
8035
  }, {
8165
8036
  lineSeparator?: 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;
8037
+ fields?: ("country" | "administrativeArea")[] | undefined;
8038
+ administrativeLevels?: string[] | undefined;
8186
8039
  streetAddressForm?: {
8187
8040
  type: "TEXT";
8188
8041
  id: string;
@@ -8300,23 +8153,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8300
8153
  } | undefined;
8301
8154
  configuration?: {
8302
8155
  lineSeparator?: 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;
8156
+ fields?: ("country" | "administrativeArea")[] | undefined;
8157
+ administrativeLevels?: string[] | undefined;
8320
8158
  streetAddressForm?: {
8321
8159
  type: "TEXT";
8322
8160
  id: string;
@@ -8412,26 +8250,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
8412
8250
  } | undefined;
8413
8251
  configuration?: {
8414
8252
  lineSeparator?: 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;
8253
+ fields?: ("country" | "administrativeArea")[] | undefined;
8254
+ administrativeLevels?: string[] | undefined;
8435
8255
  streetAddressForm?: {
8436
8256
  type: "TEXT";
8437
8257
  id: string;
@@ -2286,7 +2286,10 @@ 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()
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
+ )
2290
2293
  }).describe("Country select field");
2291
2294
  var AdministrativeAreas = import_zod17.z.enum([
2292
2295
  "ADMIN_STRUCTURE",
@@ -2334,19 +2337,12 @@ var Office = BaseField.extend({
2334
2337
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
2335
2338
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
2336
2339
  });
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" });
2345
2340
  var Address = BaseField.extend({
2346
2341
  type: import_zod17.z.literal(FieldType.ADDRESS),
2347
2342
  configuration: import_zod17.z.object({
2348
2343
  lineSeparator: import_zod17.z.string().optional(),
2349
- fields: import_zod17.z.array(DomesticAddressField).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(),
2350
2346
  streetAddressForm: import_zod17.z.array(
2351
2347
  import_zod17.z.object({
2352
2348
  id: import_zod17.z.string(),
@@ -1792,7 +1792,10 @@ 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()
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
+ )
1796
1799
  }).describe("Country select field");
1797
1800
  var AdministrativeAreas = import_zod17.z.enum([
1798
1801
  "ADMIN_STRUCTURE",
@@ -1840,19 +1843,12 @@ var Office = BaseField.extend({
1840
1843
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1841
1844
  administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
1842
1845
  });
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" });
1851
1846
  var Address = BaseField.extend({
1852
1847
  type: import_zod17.z.literal(FieldType.ADDRESS),
1853
1848
  configuration: import_zod17.z.object({
1854
1849
  lineSeparator: import_zod17.z.string().optional(),
1855
- fields: import_zod17.z.array(DomesticAddressField).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(),
1856
1852
  streetAddressForm: import_zod17.z.array(
1857
1853
  import_zod17.z.object({
1858
1854
  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.ad2ea34",
3
+ "version": "1.9.12-rc.b38f7ff",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {