@opencrvs/toolkit 1.9.12-rc.8753d72 → 1.9.12-rc.941e086
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 +599 -10
- package/dist/commons/events/defineConfig.d.ts +14 -0
- package/dist/commons/events/utils.d.ts +14 -0
- package/dist/events/index.js +20 -4
- package/dist/notification/index.js +20 -4
- package/package.json +1 -1
|
@@ -176,6 +176,13 @@ export declare const defineConfig: (config: EventConfigInput) => {
|
|
|
176
176
|
options?: {
|
|
177
177
|
value: string;
|
|
178
178
|
label: string | import("./TranslationConfig").TranslationConfig;
|
|
179
|
+
conditionals?: ({
|
|
180
|
+
type: "SHOW";
|
|
181
|
+
conditional: import(".").JSONSchema;
|
|
182
|
+
} | {
|
|
183
|
+
type: "ENABLE";
|
|
184
|
+
conditional: import(".").JSONSchema;
|
|
185
|
+
})[] | undefined;
|
|
179
186
|
}[] | undefined;
|
|
180
187
|
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
181
188
|
conditionals?: ({
|
|
@@ -204,6 +211,13 @@ export declare const defineConfig: (config: EventConfigInput) => {
|
|
|
204
211
|
options?: {
|
|
205
212
|
value: string;
|
|
206
213
|
label: string | import("./TranslationConfig").TranslationConfig;
|
|
214
|
+
conditionals?: ({
|
|
215
|
+
type: "SHOW";
|
|
216
|
+
conditional: import(".").JSONSchema;
|
|
217
|
+
} | {
|
|
218
|
+
type: "ENABLE";
|
|
219
|
+
conditional: import(".").JSONSchema;
|
|
220
|
+
})[] | undefined;
|
|
207
221
|
}[] | undefined;
|
|
208
222
|
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
209
223
|
conditionals?: ({
|
|
@@ -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,24 @@ var Office = BaseField.extend({
|
|
|
2333
2337
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
2334
2338
|
administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
|
|
2335
2339
|
});
|
|
2340
|
+
var commonDomesticFieldProps = {
|
|
2341
|
+
id: true,
|
|
2342
|
+
type: true,
|
|
2343
|
+
label: true,
|
|
2344
|
+
conditionals: true,
|
|
2345
|
+
required: true
|
|
2346
|
+
};
|
|
2347
|
+
var DomesticAddressField = Country.partial().pick({
|
|
2348
|
+
...commonDomesticFieldProps,
|
|
2349
|
+
optionOverrides: true
|
|
2350
|
+
}).required({ id: true, type: true }).or(
|
|
2351
|
+
AdministrativeArea.partial().pick(commonDomesticFieldProps).required({ id: true, type: true })
|
|
2352
|
+
);
|
|
2336
2353
|
var Address = BaseField.extend({
|
|
2337
2354
|
type: import_zod17.z.literal(FieldType.ADDRESS),
|
|
2338
2355
|
configuration: import_zod17.z.object({
|
|
2339
2356
|
lineSeparator: import_zod17.z.string().optional(),
|
|
2340
|
-
fields: import_zod17.z.array(
|
|
2341
|
-
administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
2357
|
+
fields: import_zod17.z.array(DomesticAddressField).optional(),
|
|
2342
2358
|
streetAddressForm: import_zod17.z.array(
|
|
2343
2359
|
import_zod17.z.object({
|
|
2344
2360
|
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,24 @@ var Office = BaseField.extend({
|
|
|
1839
1843
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1840
1844
|
administrativeArea: import_zod17.z.union([UUID, SerializedUserField]).optional()
|
|
1841
1845
|
});
|
|
1846
|
+
var commonDomesticFieldProps = {
|
|
1847
|
+
id: true,
|
|
1848
|
+
type: true,
|
|
1849
|
+
label: true,
|
|
1850
|
+
conditionals: true,
|
|
1851
|
+
required: true
|
|
1852
|
+
};
|
|
1853
|
+
var DomesticAddressField = Country.partial().pick({
|
|
1854
|
+
...commonDomesticFieldProps,
|
|
1855
|
+
optionOverrides: true
|
|
1856
|
+
}).required({ id: true, type: true }).or(
|
|
1857
|
+
AdministrativeArea.partial().pick(commonDomesticFieldProps).required({ id: true, type: true })
|
|
1858
|
+
);
|
|
1842
1859
|
var Address = BaseField.extend({
|
|
1843
1860
|
type: import_zod17.z.literal(FieldType.ADDRESS),
|
|
1844
1861
|
configuration: import_zod17.z.object({
|
|
1845
1862
|
lineSeparator: import_zod17.z.string().optional(),
|
|
1846
|
-
fields: import_zod17.z.array(
|
|
1847
|
-
administrativeLevels: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
1863
|
+
fields: import_zod17.z.array(DomesticAddressField).optional(),
|
|
1848
1864
|
streetAddressForm: import_zod17.z.array(
|
|
1849
1865
|
import_zod17.z.object({
|
|
1850
1866
|
id: import_zod17.z.string(),
|