@opencrvs/toolkit 1.9.12-rc.d350fab → 1.9.12-rc.fd4afc3
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.
- package/dist/commons/events/FieldConfig.d.ts +244 -10
- package/dist/events/index.js +23 -2
- package/dist/notification/index.js +23 -2
- package/package.json +1 -1
|
@@ -7741,8 +7741,174 @@ 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.
|
|
7745
|
-
|
|
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">>;
|
|
7746
7912
|
streetAddressForm: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7747
7913
|
id: z.ZodString;
|
|
7748
7914
|
required: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
@@ -7830,8 +7996,23 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7830
7996
|
}>, "many">>;
|
|
7831
7997
|
}, "strip", z.ZodTypeAny, {
|
|
7832
7998
|
lineSeparator?: string | undefined;
|
|
7833
|
-
fields?:
|
|
7834
|
-
|
|
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;
|
|
7835
8016
|
streetAddressForm?: {
|
|
7836
8017
|
type: "TEXT";
|
|
7837
8018
|
id: string;
|
|
@@ -7856,8 +8037,27 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7856
8037
|
}[] | undefined;
|
|
7857
8038
|
}, {
|
|
7858
8039
|
lineSeparator?: string | undefined;
|
|
7859
|
-
fields?: (
|
|
7860
|
-
|
|
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;
|
|
7861
8061
|
streetAddressForm?: {
|
|
7862
8062
|
type: "TEXT";
|
|
7863
8063
|
id: string;
|
|
@@ -7975,8 +8175,23 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7975
8175
|
} | undefined;
|
|
7976
8176
|
configuration?: {
|
|
7977
8177
|
lineSeparator?: string | undefined;
|
|
7978
|
-
fields?:
|
|
7979
|
-
|
|
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;
|
|
7980
8195
|
streetAddressForm?: {
|
|
7981
8196
|
type: "TEXT";
|
|
7982
8197
|
id: string;
|
|
@@ -8072,8 +8287,27 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
8072
8287
|
} | undefined;
|
|
8073
8288
|
configuration?: {
|
|
8074
8289
|
lineSeparator?: string | undefined;
|
|
8075
|
-
fields?: (
|
|
8076
|
-
|
|
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;
|
|
8077
8311
|
streetAddressForm?: {
|
|
8078
8312
|
type: "TEXT";
|
|
8079
8313
|
id: string;
|
package/dist/events/index.js
CHANGED
|
@@ -2333,12 +2333,33 @@ 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" });
|
|
2336
2358
|
var Address = BaseField.extend({
|
|
2337
2359
|
type: import_zod17.z.literal(FieldType.ADDRESS),
|
|
2338
2360
|
configuration: import_zod17.z.object({
|
|
2339
2361
|
lineSeparator: import_zod17.z.string().optional(),
|
|
2340
|
-
fields: import_zod17.z.array(
|
|
2341
|
-
administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
2362
|
+
fields: import_zod17.z.array(DomesticAddressField).optional(),
|
|
2342
2363
|
streetAddressForm: import_zod17.z.array(
|
|
2343
2364
|
import_zod17.z.object({
|
|
2344
2365
|
id: import_zod17.z.string(),
|
|
@@ -1839,12 +1839,33 @@ 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" });
|
|
1842
1864
|
var Address = BaseField.extend({
|
|
1843
1865
|
type: import_zod17.z.literal(FieldType.ADDRESS),
|
|
1844
1866
|
configuration: import_zod17.z.object({
|
|
1845
1867
|
lineSeparator: import_zod17.z.string().optional(),
|
|
1846
|
-
fields: import_zod17.z.array(
|
|
1847
|
-
administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
1868
|
+
fields: import_zod17.z.array(DomesticAddressField).optional(),
|
|
1848
1869
|
streetAddressForm: import_zod17.z.array(
|
|
1849
1870
|
import_zod17.z.object({
|
|
1850
1871
|
id: import_zod17.z.string(),
|