@opencrvs/toolkit 1.9.12-rc.d350fab → 1.9.12-rc.dcd12a4
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/api/router.d.ts +14 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +258 -0
- package/dist/commons/events/EventConfig.d.ts +170 -0
- package/dist/commons/events/FieldConfig.d.ts +444 -10
- package/dist/commons/events/defineConfig.d.ts +14 -0
- package/dist/commons/events/utils.d.ts +14 -0
- package/dist/events/index.js +15 -4
- package/dist/notification/index.js +15 -4
- package/package.json +1 -1
|
@@ -554,6 +554,13 @@ export declare function getEventConfigById(eventConfigs: EventConfig[], id: stri
|
|
|
554
554
|
options?: {
|
|
555
555
|
value: string;
|
|
556
556
|
label: string | import("./TranslationConfig").TranslationConfig;
|
|
557
|
+
conditionals?: ({
|
|
558
|
+
type: "SHOW";
|
|
559
|
+
conditional: import(".").JSONSchema;
|
|
560
|
+
} | {
|
|
561
|
+
type: "ENABLE";
|
|
562
|
+
conditional: import(".").JSONSchema;
|
|
563
|
+
})[] | undefined;
|
|
557
564
|
}[] | undefined;
|
|
558
565
|
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
559
566
|
conditionals?: ({
|
|
@@ -582,6 +589,13 @@ export declare function getEventConfigById(eventConfigs: EventConfig[], id: stri
|
|
|
582
589
|
options?: {
|
|
583
590
|
value: string;
|
|
584
591
|
label: string | import("./TranslationConfig").TranslationConfig;
|
|
592
|
+
conditionals?: ({
|
|
593
|
+
type: "SHOW";
|
|
594
|
+
conditional: import(".").JSONSchema;
|
|
595
|
+
} | {
|
|
596
|
+
type: "ENABLE";
|
|
597
|
+
conditional: import(".").JSONSchema;
|
|
598
|
+
})[] | undefined;
|
|
585
599
|
}[] | undefined;
|
|
586
600
|
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
587
601
|
conditionals?: ({
|
package/dist/events/index.js
CHANGED
|
@@ -2182,7 +2182,8 @@ var File = BaseField.extend({
|
|
|
2182
2182
|
}).describe("File upload");
|
|
2183
2183
|
var SelectOption = import_zod17.z.object({
|
|
2184
2184
|
value: import_zod17.z.string().describe("The value of the option"),
|
|
2185
|
-
label: import_zod17.z.union([import_zod17.z.string(), TranslationConfig]).describe("The label of the option")
|
|
2185
|
+
label: import_zod17.z.union([import_zod17.z.string(), TranslationConfig]).describe("The label of the option"),
|
|
2186
|
+
conditionals: import_zod17.z.array(ActionConditional).default([]).optional()
|
|
2186
2187
|
});
|
|
2187
2188
|
var NumberWithUnitField = BaseField.extend({
|
|
2188
2189
|
type: import_zod17.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
@@ -2285,7 +2286,10 @@ var Checkbox = BaseField.extend({
|
|
|
2285
2286
|
}).describe("Boolean checkbox field");
|
|
2286
2287
|
var Country = BaseField.extend({
|
|
2287
2288
|
type: import_zod17.z.literal(FieldType.COUNTRY),
|
|
2288
|
-
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
|
+
)
|
|
2289
2293
|
}).describe("Country select field");
|
|
2290
2294
|
var AdministrativeAreas = import_zod17.z.enum([
|
|
2291
2295
|
"ADMIN_STRUCTURE",
|
|
@@ -2333,12 +2337,19 @@ var Office = BaseField.extend({
|
|
|
2333
2337
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
2334
2338
|
administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
|
|
2335
2339
|
});
|
|
2340
|
+
var DomesticAddressField = BaseField.pick({
|
|
2341
|
+
id: true,
|
|
2342
|
+
required: true,
|
|
2343
|
+
conditionals: true
|
|
2344
|
+
}).transform((config) => ({
|
|
2345
|
+
...config,
|
|
2346
|
+
type: config.id === "country" ? FieldType.COUNTRY : FieldType.ADMINISTRATIVE_AREA
|
|
2347
|
+
})).openapi({ effectType: "input", type: "object" });
|
|
2336
2348
|
var Address = BaseField.extend({
|
|
2337
2349
|
type: import_zod17.z.literal(FieldType.ADDRESS),
|
|
2338
2350
|
configuration: import_zod17.z.object({
|
|
2339
2351
|
lineSeparator: import_zod17.z.string().optional(),
|
|
2340
|
-
fields: import_zod17.z.array(
|
|
2341
|
-
administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
2352
|
+
fields: import_zod17.z.array(DomesticAddressField).optional(),
|
|
2342
2353
|
streetAddressForm: import_zod17.z.array(
|
|
2343
2354
|
import_zod17.z.object({
|
|
2344
2355
|
id: import_zod17.z.string(),
|
|
@@ -1688,7 +1688,8 @@ var File = BaseField.extend({
|
|
|
1688
1688
|
}).describe("File upload");
|
|
1689
1689
|
var SelectOption = import_zod17.z.object({
|
|
1690
1690
|
value: import_zod17.z.string().describe("The value of the option"),
|
|
1691
|
-
label: import_zod17.z.union([import_zod17.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1691
|
+
label: import_zod17.z.union([import_zod17.z.string(), TranslationConfig]).describe("The label of the option"),
|
|
1692
|
+
conditionals: import_zod17.z.array(ActionConditional).default([]).optional()
|
|
1692
1693
|
});
|
|
1693
1694
|
var NumberWithUnitField = BaseField.extend({
|
|
1694
1695
|
type: import_zod17.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
@@ -1791,7 +1792,10 @@ var Checkbox = BaseField.extend({
|
|
|
1791
1792
|
}).describe("Boolean checkbox field");
|
|
1792
1793
|
var Country = BaseField.extend({
|
|
1793
1794
|
type: import_zod17.z.literal(FieldType.COUNTRY),
|
|
1794
|
-
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
|
+
)
|
|
1795
1799
|
}).describe("Country select field");
|
|
1796
1800
|
var AdministrativeAreas = import_zod17.z.enum([
|
|
1797
1801
|
"ADMIN_STRUCTURE",
|
|
@@ -1839,12 +1843,19 @@ var Office = BaseField.extend({
|
|
|
1839
1843
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1840
1844
|
administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
|
|
1841
1845
|
});
|
|
1846
|
+
var DomesticAddressField = BaseField.pick({
|
|
1847
|
+
id: true,
|
|
1848
|
+
required: true,
|
|
1849
|
+
conditionals: true
|
|
1850
|
+
}).transform((config) => ({
|
|
1851
|
+
...config,
|
|
1852
|
+
type: config.id === "country" ? FieldType.COUNTRY : FieldType.ADMINISTRATIVE_AREA
|
|
1853
|
+
})).openapi({ effectType: "input", type: "object" });
|
|
1842
1854
|
var Address = BaseField.extend({
|
|
1843
1855
|
type: import_zod17.z.literal(FieldType.ADDRESS),
|
|
1844
1856
|
configuration: import_zod17.z.object({
|
|
1845
1857
|
lineSeparator: import_zod17.z.string().optional(),
|
|
1846
|
-
fields: import_zod17.z.array(
|
|
1847
|
-
administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
1858
|
+
fields: import_zod17.z.array(DomesticAddressField).optional(),
|
|
1848
1859
|
streetAddressForm: import_zod17.z.array(
|
|
1849
1860
|
import_zod17.z.object({
|
|
1850
1861
|
id: import_zod17.z.string(),
|