@opencrvs/toolkit 1.9.6-rc.7b05346 → 1.9.6-rc.8a2de14
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/conditionals/conditionals.d.ts +5 -0
- package/dist/commons/events/FieldConfig.d.ts +45 -6
- package/dist/commons/events/TemplateConfig.d.ts +2 -0
- package/dist/conditionals/index.js +15 -0
- package/dist/events/index.js +474 -454
- package/dist/notification/index.js +491 -473
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
|
@@ -361,6 +361,7 @@ __export(events_exports, {
|
|
|
361
361
|
mergeDrafts: () => mergeDrafts,
|
|
362
362
|
never: () => never,
|
|
363
363
|
not: () => not,
|
|
364
|
+
now: () => now,
|
|
364
365
|
omitHiddenAnnotationFields: () => omitHiddenAnnotationFields,
|
|
365
366
|
omitHiddenFields: () => omitHiddenFields,
|
|
366
367
|
omitHiddenPaginatedFields: () => omitHiddenPaginatedFields,
|
|
@@ -385,7 +386,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
385
386
|
var BIRTH_EVENT = "birth";
|
|
386
387
|
|
|
387
388
|
// ../commons/src/events/ActionConfig.ts
|
|
388
|
-
var
|
|
389
|
+
var import_zod20 = require("zod");
|
|
389
390
|
|
|
390
391
|
// ../commons/src/events/TranslationConfig.ts
|
|
391
392
|
var import_zod = require("zod");
|
|
@@ -508,7 +509,7 @@ function isMetaAction(actionType) {
|
|
|
508
509
|
}
|
|
509
510
|
|
|
510
511
|
// ../commons/src/events/FieldConfig.ts
|
|
511
|
-
var
|
|
512
|
+
var import_zod16 = require("zod");
|
|
512
513
|
|
|
513
514
|
// ../commons/src/events/Conditional.ts
|
|
514
515
|
var import_zod3 = require("zod");
|
|
@@ -1905,9 +1906,22 @@ var SearchScopeAccessLevels = {
|
|
|
1905
1906
|
ALL: "all"
|
|
1906
1907
|
};
|
|
1907
1908
|
|
|
1909
|
+
// ../commons/src/events/serializers/date/serializer.ts
|
|
1910
|
+
var import_zod15 = require("zod");
|
|
1911
|
+
var SerializedNowDateTime = import_zod15.z.object({
|
|
1912
|
+
$$date: import_zod15.z.literal("now").optional(),
|
|
1913
|
+
$$time: import_zod15.z.literal("now").optional()
|
|
1914
|
+
});
|
|
1915
|
+
function todayDateTimeValueSerializer() {
|
|
1916
|
+
return {
|
|
1917
|
+
$$date: "now",
|
|
1918
|
+
$$time: "now"
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1908
1922
|
// ../commons/src/events/FieldConfig.ts
|
|
1909
|
-
(0, import_zod_openapi6.extendZodWithOpenApi)(
|
|
1910
|
-
var FieldId =
|
|
1923
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod16.z);
|
|
1924
|
+
var FieldId = import_zod16.z.string().refine(
|
|
1911
1925
|
/*
|
|
1912
1926
|
* Disallow underscores '_' in field ids.
|
|
1913
1927
|
* Why? Theres two reasons:
|
|
@@ -1920,160 +1934,164 @@ var FieldId = import_zod15.z.string().refine(
|
|
|
1920
1934
|
message: `id: '${val}' must not contain underscores '_'`
|
|
1921
1935
|
})
|
|
1922
1936
|
).describe("Unique identifier for the field");
|
|
1923
|
-
var FieldReference =
|
|
1937
|
+
var FieldReference = import_zod16.z.object({
|
|
1924
1938
|
$$field: FieldId,
|
|
1925
|
-
$$subfield:
|
|
1939
|
+
$$subfield: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
|
1926
1940
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1927
1941
|
)
|
|
1928
1942
|
}).describe("Reference to a field by its ID");
|
|
1929
|
-
var ValidationConfig =
|
|
1943
|
+
var ValidationConfig = import_zod16.z.object({
|
|
1930
1944
|
validator: Conditional,
|
|
1931
1945
|
message: TranslationConfig
|
|
1932
1946
|
});
|
|
1933
|
-
var requiredSchema =
|
|
1934
|
-
|
|
1935
|
-
|
|
1947
|
+
var requiredSchema = import_zod16.z.union([
|
|
1948
|
+
import_zod16.z.boolean(),
|
|
1949
|
+
import_zod16.z.object({
|
|
1936
1950
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1937
1951
|
})
|
|
1938
1952
|
]).default(false).optional();
|
|
1939
|
-
var BaseField =
|
|
1953
|
+
var BaseField = import_zod16.z.object({
|
|
1940
1954
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1941
1955
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1942
|
-
parent: FieldReference.or(
|
|
1956
|
+
parent: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
|
|
1943
1957
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1944
1958
|
),
|
|
1945
1959
|
required: requiredSchema.describe(
|
|
1946
1960
|
"Indicates whether the field is mandatory."
|
|
1947
1961
|
),
|
|
1948
|
-
conditionals:
|
|
1962
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional().describe(
|
|
1949
1963
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1950
1964
|
),
|
|
1951
|
-
secured:
|
|
1965
|
+
secured: import_zod16.z.boolean().default(false).optional().describe(
|
|
1952
1966
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1953
1967
|
),
|
|
1954
1968
|
placeholder: TranslationConfig.optional(),
|
|
1955
|
-
validation:
|
|
1969
|
+
validation: import_zod16.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1956
1970
|
helperText: TranslationConfig.optional(),
|
|
1957
|
-
hideLabel:
|
|
1958
|
-
uncorrectable:
|
|
1971
|
+
hideLabel: import_zod16.z.boolean().default(false).optional(),
|
|
1972
|
+
uncorrectable: import_zod16.z.boolean().default(false).optional().describe(
|
|
1959
1973
|
"Indicates whether the field can be modified during record correction."
|
|
1960
1974
|
),
|
|
1961
|
-
value: FieldReference.or(
|
|
1975
|
+
value: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
|
|
1962
1976
|
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
1963
1977
|
),
|
|
1964
|
-
analytics:
|
|
1978
|
+
analytics: import_zod16.z.boolean().default(false).optional().describe(
|
|
1965
1979
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1966
1980
|
)
|
|
1967
1981
|
}).describe("Common properties shared across all field types.");
|
|
1968
1982
|
var Divider = BaseField.extend({
|
|
1969
|
-
type:
|
|
1983
|
+
type: import_zod16.z.literal(FieldType.DIVIDER)
|
|
1970
1984
|
});
|
|
1971
1985
|
var TextField = BaseField.extend({
|
|
1972
|
-
type:
|
|
1973
|
-
defaultValue:
|
|
1974
|
-
configuration:
|
|
1975
|
-
maxLength:
|
|
1976
|
-
type:
|
|
1986
|
+
type: import_zod16.z.literal(FieldType.TEXT),
|
|
1987
|
+
defaultValue: import_zod16.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1988
|
+
configuration: import_zod16.z.object({
|
|
1989
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1990
|
+
type: import_zod16.z.enum(["text", "password"]).optional(),
|
|
1977
1991
|
prefix: TranslationConfig.optional(),
|
|
1978
1992
|
postfix: TranslationConfig.optional()
|
|
1979
1993
|
}).default({ type: "text" }).optional()
|
|
1980
1994
|
}).describe("Text input");
|
|
1981
1995
|
var NumberField = BaseField.extend({
|
|
1982
|
-
type:
|
|
1996
|
+
type: import_zod16.z.literal(FieldType.NUMBER),
|
|
1983
1997
|
defaultValue: NumberFieldValue.optional(),
|
|
1984
|
-
configuration:
|
|
1985
|
-
min:
|
|
1986
|
-
max:
|
|
1998
|
+
configuration: import_zod16.z.object({
|
|
1999
|
+
min: import_zod16.z.number().optional().describe("Minimum value"),
|
|
2000
|
+
max: import_zod16.z.number().optional().describe("Maximum value"),
|
|
1987
2001
|
prefix: TranslationConfig.optional(),
|
|
1988
2002
|
postfix: TranslationConfig.optional()
|
|
1989
2003
|
}).optional()
|
|
1990
2004
|
}).describe("Number input");
|
|
1991
2005
|
var TextAreaField = BaseField.extend({
|
|
1992
|
-
type:
|
|
2006
|
+
type: import_zod16.z.literal(FieldType.TEXTAREA),
|
|
1993
2007
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1994
|
-
configuration:
|
|
1995
|
-
maxLength:
|
|
1996
|
-
rows:
|
|
1997
|
-
cols:
|
|
2008
|
+
configuration: import_zod16.z.object({
|
|
2009
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
2010
|
+
rows: import_zod16.z.number().optional().describe("Number of visible text lines"),
|
|
2011
|
+
cols: import_zod16.z.number().optional().describe("Number of visible columns"),
|
|
1998
2012
|
prefix: TranslationConfig.optional(),
|
|
1999
2013
|
postfix: TranslationConfig.optional()
|
|
2000
2014
|
}).default({ rows: 4 }).optional()
|
|
2001
2015
|
}).describe("Multiline text input");
|
|
2002
|
-
var ImageMimeType =
|
|
2016
|
+
var ImageMimeType = import_zod16.z.enum([
|
|
2003
2017
|
"image/png",
|
|
2004
2018
|
"image/jpg",
|
|
2005
2019
|
"image/jpeg",
|
|
2006
2020
|
"image/svg+xml"
|
|
2007
2021
|
]);
|
|
2008
|
-
var DocumentMimeType =
|
|
2022
|
+
var DocumentMimeType = import_zod16.z.enum([
|
|
2009
2023
|
"application/pdf",
|
|
2010
2024
|
"application/msword",
|
|
2011
2025
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2012
2026
|
"application/vnd.oasis.opendocument.text"
|
|
2013
2027
|
]);
|
|
2014
|
-
var MimeType =
|
|
2028
|
+
var MimeType = import_zod16.z.enum([
|
|
2015
2029
|
...ImageMimeType.options,
|
|
2016
2030
|
...DocumentMimeType.options
|
|
2017
2031
|
]);
|
|
2018
2032
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
2019
2033
|
var SignatureField = BaseField.extend({
|
|
2020
|
-
type:
|
|
2034
|
+
type: import_zod16.z.literal(FieldType.SIGNATURE),
|
|
2021
2035
|
signaturePromptLabel: TranslationConfig.describe(
|
|
2022
2036
|
"Title of the signature modal"
|
|
2023
2037
|
),
|
|
2024
2038
|
defaultValue: SignatureFieldValue.optional(),
|
|
2025
|
-
configuration:
|
|
2026
|
-
maxFileSize:
|
|
2039
|
+
configuration: import_zod16.z.object({
|
|
2040
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2027
2041
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
2028
2042
|
}).default({
|
|
2029
2043
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2030
2044
|
})
|
|
2031
2045
|
}).describe("Signature input field");
|
|
2032
2046
|
var EmailField = BaseField.extend({
|
|
2033
|
-
type:
|
|
2034
|
-
configuration:
|
|
2035
|
-
maxLength:
|
|
2047
|
+
type: import_zod16.z.literal(FieldType.EMAIL),
|
|
2048
|
+
configuration: import_zod16.z.object({
|
|
2049
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text")
|
|
2036
2050
|
}).default({ maxLength: 10 }).optional(),
|
|
2037
2051
|
defaultValue: NonEmptyTextValue.optional()
|
|
2038
2052
|
});
|
|
2039
2053
|
var DateField = BaseField.extend({
|
|
2040
|
-
type:
|
|
2041
|
-
defaultValue:
|
|
2042
|
-
|
|
2054
|
+
type: import_zod16.z.literal(FieldType.DATE),
|
|
2055
|
+
defaultValue: SerializedNowDateTime.transform(() => ({
|
|
2056
|
+
$$date: "now"
|
|
2057
|
+
})).or(DateValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default date value(yyyy-MM-dd)"),
|
|
2058
|
+
configuration: import_zod16.z.object({
|
|
2043
2059
|
notice: TranslationConfig.describe(
|
|
2044
2060
|
"Text to display above the date input"
|
|
2045
2061
|
).optional()
|
|
2046
2062
|
}).optional()
|
|
2047
2063
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
2048
2064
|
var AgeField = BaseField.extend({
|
|
2049
|
-
type:
|
|
2065
|
+
type: import_zod16.z.literal(FieldType.AGE),
|
|
2050
2066
|
defaultValue: NumberFieldValue.optional(),
|
|
2051
|
-
configuration:
|
|
2067
|
+
configuration: import_zod16.z.object({
|
|
2052
2068
|
asOfDate: FieldReference,
|
|
2053
2069
|
prefix: TranslationConfig.optional(),
|
|
2054
2070
|
postfix: TranslationConfig.optional()
|
|
2055
2071
|
})
|
|
2056
2072
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
2057
2073
|
var TimeField = BaseField.extend({
|
|
2058
|
-
type:
|
|
2059
|
-
defaultValue:
|
|
2060
|
-
|
|
2061
|
-
|
|
2074
|
+
type: import_zod16.z.literal(FieldType.TIME),
|
|
2075
|
+
defaultValue: SerializedNowDateTime.transform(() => ({
|
|
2076
|
+
$$time: "now"
|
|
2077
|
+
})).or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
|
|
2078
|
+
configuration: import_zod16.z.object({
|
|
2079
|
+
use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
2062
2080
|
notice: TranslationConfig.describe(
|
|
2063
2081
|
"Text to display above the time input"
|
|
2064
2082
|
).optional()
|
|
2065
2083
|
}).optional()
|
|
2066
2084
|
}).describe("A single date input (HH-mm)");
|
|
2067
2085
|
var DateRangeField = BaseField.extend({
|
|
2068
|
-
type:
|
|
2086
|
+
type: import_zod16.z.literal(FieldType.DATE_RANGE),
|
|
2069
2087
|
defaultValue: DateRangeFieldValue.optional(),
|
|
2070
|
-
configuration:
|
|
2088
|
+
configuration: import_zod16.z.object({
|
|
2071
2089
|
notice: TranslationConfig.describe(
|
|
2072
2090
|
"Text to display above the date input"
|
|
2073
2091
|
).optional()
|
|
2074
2092
|
}).optional()
|
|
2075
2093
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
2076
|
-
var HtmlFontVariant =
|
|
2094
|
+
var HtmlFontVariant = import_zod16.z.enum([
|
|
2077
2095
|
"reg12",
|
|
2078
2096
|
"reg14",
|
|
2079
2097
|
"reg16",
|
|
@@ -2083,34 +2101,34 @@ var HtmlFontVariant = import_zod15.z.enum([
|
|
|
2083
2101
|
"h2",
|
|
2084
2102
|
"h1"
|
|
2085
2103
|
]);
|
|
2086
|
-
var ParagraphConfiguration =
|
|
2087
|
-
styles:
|
|
2104
|
+
var ParagraphConfiguration = import_zod16.z.object({
|
|
2105
|
+
styles: import_zod16.z.object({
|
|
2088
2106
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
2089
2107
|
"Font variant to use for the paragraph text"
|
|
2090
2108
|
),
|
|
2091
|
-
hint:
|
|
2109
|
+
hint: import_zod16.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
2092
2110
|
}).optional()
|
|
2093
2111
|
}).default({});
|
|
2094
2112
|
var Paragraph = BaseField.extend({
|
|
2095
|
-
type:
|
|
2113
|
+
type: import_zod16.z.literal(FieldType.PARAGRAPH),
|
|
2096
2114
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2097
2115
|
configuration: ParagraphConfiguration
|
|
2098
2116
|
}).describe("A read-only HTML <p> paragraph");
|
|
2099
2117
|
var PageHeader = BaseField.extend({
|
|
2100
|
-
type:
|
|
2118
|
+
type: import_zod16.z.literal(FieldType.PAGE_HEADER),
|
|
2101
2119
|
defaultValue: NonEmptyTextValue.optional()
|
|
2102
2120
|
}).describe("A read-only header component for form pages");
|
|
2103
2121
|
var File = BaseField.extend({
|
|
2104
|
-
type:
|
|
2122
|
+
type: import_zod16.z.literal(FieldType.FILE),
|
|
2105
2123
|
defaultValue: FileFieldValue.optional(),
|
|
2106
|
-
configuration:
|
|
2107
|
-
maxFileSize:
|
|
2124
|
+
configuration: import_zod16.z.object({
|
|
2125
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2108
2126
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
2109
|
-
maxImageSize:
|
|
2110
|
-
targetSize:
|
|
2127
|
+
maxImageSize: import_zod16.z.object({
|
|
2128
|
+
targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
|
|
2111
2129
|
}).optional(),
|
|
2112
|
-
style:
|
|
2113
|
-
width:
|
|
2130
|
+
style: import_zod16.z.object({
|
|
2131
|
+
width: import_zod16.z.enum(["full", "auto"]).optional().describe(
|
|
2114
2132
|
"Whether the file upload button should take the full width of the container or not"
|
|
2115
2133
|
)
|
|
2116
2134
|
}).optional(),
|
|
@@ -2119,46 +2137,46 @@ var File = BaseField.extend({
|
|
|
2119
2137
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2120
2138
|
})
|
|
2121
2139
|
}).describe("File upload");
|
|
2122
|
-
var SelectOption =
|
|
2123
|
-
value:
|
|
2124
|
-
label:
|
|
2140
|
+
var SelectOption = import_zod16.z.object({
|
|
2141
|
+
value: import_zod16.z.string().describe("The value of the option"),
|
|
2142
|
+
label: import_zod16.z.union([import_zod16.z.string(), TranslationConfig]).describe("The label of the option")
|
|
2125
2143
|
});
|
|
2126
2144
|
var NumberWithUnitField = BaseField.extend({
|
|
2127
|
-
type:
|
|
2145
|
+
type: import_zod16.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
2128
2146
|
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
2129
|
-
options:
|
|
2130
|
-
configuration:
|
|
2131
|
-
min:
|
|
2132
|
-
max:
|
|
2147
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
2148
|
+
configuration: import_zod16.z.object({
|
|
2149
|
+
min: import_zod16.z.number().optional().describe("Minimum value of the number field"),
|
|
2150
|
+
max: import_zod16.z.number().optional().describe("Maximum value of the number field"),
|
|
2133
2151
|
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
2134
2152
|
"Placeholder for the number field"
|
|
2135
2153
|
)
|
|
2136
2154
|
}).optional()
|
|
2137
2155
|
}).describe("Number with unit input");
|
|
2138
2156
|
var RadioGroup = BaseField.extend({
|
|
2139
|
-
type:
|
|
2157
|
+
type: import_zod16.z.literal(FieldType.RADIO_GROUP),
|
|
2140
2158
|
defaultValue: TextValue.optional(),
|
|
2141
|
-
options:
|
|
2142
|
-
configuration:
|
|
2143
|
-
styles:
|
|
2144
|
-
size:
|
|
2159
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
2160
|
+
configuration: import_zod16.z.object({
|
|
2161
|
+
styles: import_zod16.z.object({
|
|
2162
|
+
size: import_zod16.z.enum(["NORMAL", "LARGE"]).optional()
|
|
2145
2163
|
}).optional()
|
|
2146
2164
|
}).optional()
|
|
2147
2165
|
}).describe("Grouped radio options");
|
|
2148
2166
|
var BulletList = BaseField.extend({
|
|
2149
|
-
type:
|
|
2167
|
+
type: import_zod16.z.literal(FieldType.BULLET_LIST),
|
|
2150
2168
|
defaultValue: TextValue.optional(),
|
|
2151
|
-
items:
|
|
2152
|
-
configuration:
|
|
2153
|
-
styles:
|
|
2169
|
+
items: import_zod16.z.array(TranslationConfig).describe("A list of items"),
|
|
2170
|
+
configuration: import_zod16.z.object({
|
|
2171
|
+
styles: import_zod16.z.object({
|
|
2154
2172
|
fontVariant: HtmlFontVariant.optional()
|
|
2155
2173
|
}).optional()
|
|
2156
2174
|
}).default({})
|
|
2157
2175
|
}).describe("A list of bullet points");
|
|
2158
2176
|
var Select = BaseField.extend({
|
|
2159
|
-
type:
|
|
2177
|
+
type: import_zod16.z.literal(FieldType.SELECT),
|
|
2160
2178
|
defaultValue: TextValue.optional(),
|
|
2161
|
-
options:
|
|
2179
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
2162
2180
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
2163
2181
|
`
|
|
2164
2182
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -2170,34 +2188,34 @@ var Select = BaseField.extend({
|
|
|
2170
2188
|
`
|
|
2171
2189
|
)
|
|
2172
2190
|
}).describe("Select input");
|
|
2173
|
-
var SelectDateRangeOption =
|
|
2191
|
+
var SelectDateRangeOption = import_zod16.z.object({
|
|
2174
2192
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
2175
2193
|
label: TranslationConfig.describe("The label of the option")
|
|
2176
2194
|
});
|
|
2177
2195
|
var SelectDateRangeField = BaseField.extend({
|
|
2178
|
-
type:
|
|
2196
|
+
type: import_zod16.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
2179
2197
|
defaultValue: SelectDateRangeValue.optional(),
|
|
2180
|
-
options:
|
|
2198
|
+
options: import_zod16.z.array(SelectDateRangeOption).describe("A list of options")
|
|
2181
2199
|
}).describe("Select input with date range options");
|
|
2182
|
-
var NameConfig =
|
|
2183
|
-
firstname:
|
|
2184
|
-
middlename:
|
|
2185
|
-
surname:
|
|
2200
|
+
var NameConfig = import_zod16.z.object({
|
|
2201
|
+
firstname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2202
|
+
middlename: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2203
|
+
surname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
2186
2204
|
});
|
|
2187
2205
|
var NameField = BaseField.extend({
|
|
2188
|
-
type:
|
|
2189
|
-
defaultValue:
|
|
2206
|
+
type: import_zod16.z.literal(FieldType.NAME),
|
|
2207
|
+
defaultValue: import_zod16.z.object({
|
|
2190
2208
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2191
2209
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2192
2210
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
2193
2211
|
}).optional(),
|
|
2194
|
-
configuration:
|
|
2212
|
+
configuration: import_zod16.z.object({
|
|
2195
2213
|
name: NameConfig.default({
|
|
2196
2214
|
firstname: { required: true },
|
|
2197
2215
|
surname: { required: true }
|
|
2198
2216
|
}).optional(),
|
|
2199
|
-
order:
|
|
2200
|
-
maxLength:
|
|
2217
|
+
order: import_zod16.z.array(import_zod16.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
2218
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
2201
2219
|
prefix: TranslationConfig.optional(),
|
|
2202
2220
|
postfix: TranslationConfig.optional()
|
|
2203
2221
|
}).default({
|
|
@@ -2209,51 +2227,51 @@ var NameField = BaseField.extend({
|
|
|
2209
2227
|
}).describe("Name input field");
|
|
2210
2228
|
var PhoneField = BaseField.extend({
|
|
2211
2229
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2212
|
-
type:
|
|
2230
|
+
type: import_zod16.z.literal(FieldType.PHONE)
|
|
2213
2231
|
}).describe("Phone input field");
|
|
2214
2232
|
var IdField = BaseField.extend({
|
|
2215
2233
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2216
|
-
type:
|
|
2234
|
+
type: import_zod16.z.literal(FieldType.ID)
|
|
2217
2235
|
}).describe("ID input field");
|
|
2218
2236
|
var Checkbox = BaseField.extend({
|
|
2219
|
-
type:
|
|
2237
|
+
type: import_zod16.z.literal(FieldType.CHECKBOX),
|
|
2220
2238
|
defaultValue: CheckboxFieldValue.default(false)
|
|
2221
2239
|
}).describe("Boolean checkbox field");
|
|
2222
2240
|
var Country = BaseField.extend({
|
|
2223
|
-
type:
|
|
2241
|
+
type: import_zod16.z.literal(FieldType.COUNTRY),
|
|
2224
2242
|
defaultValue: NonEmptyTextValue.optional()
|
|
2225
2243
|
}).describe("Country select field");
|
|
2226
|
-
var AdministrativeAreas =
|
|
2244
|
+
var AdministrativeAreas = import_zod16.z.enum([
|
|
2227
2245
|
"ADMIN_STRUCTURE",
|
|
2228
2246
|
"HEALTH_FACILITY",
|
|
2229
2247
|
"CRVS_OFFICE"
|
|
2230
2248
|
]);
|
|
2231
|
-
var AdministrativeAreaConfiguration =
|
|
2232
|
-
partOf:
|
|
2233
|
-
$declaration:
|
|
2249
|
+
var AdministrativeAreaConfiguration = import_zod16.z.object({
|
|
2250
|
+
partOf: import_zod16.z.object({
|
|
2251
|
+
$declaration: import_zod16.z.string()
|
|
2234
2252
|
}).optional().describe("Parent location"),
|
|
2235
2253
|
type: AdministrativeAreas
|
|
2236
2254
|
}).describe("Administrative area options");
|
|
2237
2255
|
var AdministrativeArea = BaseField.extend({
|
|
2238
|
-
type:
|
|
2256
|
+
type: import_zod16.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2239
2257
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2240
2258
|
configuration: AdministrativeAreaConfiguration
|
|
2241
2259
|
}).describe("Administrative area input field e.g. facility, office");
|
|
2242
2260
|
var LocationInput = BaseField.extend({
|
|
2243
|
-
type:
|
|
2261
|
+
type: import_zod16.z.literal(FieldType.LOCATION),
|
|
2244
2262
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2245
|
-
configuration:
|
|
2246
|
-
searchableResource:
|
|
2263
|
+
configuration: import_zod16.z.object({
|
|
2264
|
+
searchableResource: import_zod16.z.array(import_zod16.z.enum(["locations", "facilities", "offices"]))
|
|
2247
2265
|
})
|
|
2248
2266
|
}).describe("Input field for a location");
|
|
2249
2267
|
var FileUploadWithOptions = BaseField.extend({
|
|
2250
|
-
type:
|
|
2251
|
-
options:
|
|
2268
|
+
type: import_zod16.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2269
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
2252
2270
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2253
|
-
configuration:
|
|
2254
|
-
maxFileSize:
|
|
2255
|
-
maxImageSize:
|
|
2256
|
-
targetSize:
|
|
2271
|
+
configuration: import_zod16.z.object({
|
|
2272
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2273
|
+
maxImageSize: import_zod16.z.object({
|
|
2274
|
+
targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
|
|
2257
2275
|
}).optional(),
|
|
2258
2276
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
2259
2277
|
}).default({
|
|
@@ -2261,93 +2279,93 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2261
2279
|
})
|
|
2262
2280
|
});
|
|
2263
2281
|
var Facility = BaseField.extend({
|
|
2264
|
-
type:
|
|
2282
|
+
type: import_zod16.z.literal(FieldType.FACILITY),
|
|
2265
2283
|
defaultValue: NonEmptyTextValue.optional()
|
|
2266
2284
|
}).describe("Input field for a facility");
|
|
2267
2285
|
var Office = BaseField.extend({
|
|
2268
|
-
type:
|
|
2286
|
+
type: import_zod16.z.literal(FieldType.OFFICE),
|
|
2269
2287
|
defaultValue: NonEmptyTextValue.optional()
|
|
2270
2288
|
}).describe("Input field for an office");
|
|
2271
2289
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
2272
|
-
administrativeArea:
|
|
2290
|
+
administrativeArea: import_zod16.z.union([UUID, SerializedUserField]).optional()
|
|
2273
2291
|
});
|
|
2274
2292
|
var Address = BaseField.extend({
|
|
2275
|
-
type:
|
|
2276
|
-
configuration:
|
|
2277
|
-
lineSeparator:
|
|
2278
|
-
fields:
|
|
2279
|
-
administrativeLevels:
|
|
2280
|
-
streetAddressForm:
|
|
2281
|
-
|
|
2282
|
-
id:
|
|
2293
|
+
type: import_zod16.z.literal(FieldType.ADDRESS),
|
|
2294
|
+
configuration: import_zod16.z.object({
|
|
2295
|
+
lineSeparator: import_zod16.z.string().optional(),
|
|
2296
|
+
fields: import_zod16.z.array(import_zod16.z.enum(["country", "administrativeArea"])).optional(),
|
|
2297
|
+
administrativeLevels: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
2298
|
+
streetAddressForm: import_zod16.z.array(
|
|
2299
|
+
import_zod16.z.object({
|
|
2300
|
+
id: import_zod16.z.string(),
|
|
2283
2301
|
required: requiredSchema,
|
|
2284
2302
|
label: TranslationConfig,
|
|
2285
|
-
type:
|
|
2286
|
-
conditionals:
|
|
2303
|
+
type: import_zod16.z.literal(FieldType.TEXT),
|
|
2304
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional(),
|
|
2287
2305
|
parent: FieldReference.optional()
|
|
2288
2306
|
})
|
|
2289
2307
|
).optional()
|
|
2290
2308
|
}).optional(),
|
|
2291
2309
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2292
2310
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
2293
|
-
var StaticDataEntry =
|
|
2294
|
-
id:
|
|
2311
|
+
var StaticDataEntry = import_zod16.z.object({
|
|
2312
|
+
id: import_zod16.z.string().describe("ID for the data entry."),
|
|
2295
2313
|
label: TranslationConfig,
|
|
2296
|
-
value: TranslationConfig.or(
|
|
2314
|
+
value: TranslationConfig.or(import_zod16.z.string()).or(FieldReference)
|
|
2297
2315
|
}).describe("Static data entry");
|
|
2298
|
-
var DataEntry =
|
|
2316
|
+
var DataEntry = import_zod16.z.union([StaticDataEntry, import_zod16.z.object({ fieldId: import_zod16.z.string() })]).describe(
|
|
2299
2317
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
2300
2318
|
);
|
|
2301
2319
|
var DataField = BaseField.extend({
|
|
2302
|
-
type:
|
|
2303
|
-
configuration:
|
|
2320
|
+
type: import_zod16.z.literal(FieldType.DATA),
|
|
2321
|
+
configuration: import_zod16.z.object({
|
|
2304
2322
|
subtitle: TranslationConfig.optional(),
|
|
2305
|
-
data:
|
|
2323
|
+
data: import_zod16.z.array(DataEntry)
|
|
2306
2324
|
})
|
|
2307
2325
|
}).describe("Data field for displaying read-only data");
|
|
2308
2326
|
var ButtonField = BaseField.extend({
|
|
2309
|
-
type:
|
|
2327
|
+
type: import_zod16.z.literal(FieldType.BUTTON),
|
|
2310
2328
|
defaultValue: ButtonFieldValue.optional(),
|
|
2311
|
-
configuration:
|
|
2312
|
-
icon:
|
|
2329
|
+
configuration: import_zod16.z.object({
|
|
2330
|
+
icon: import_zod16.z.string().optional().describe(
|
|
2313
2331
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
2314
2332
|
),
|
|
2315
|
-
loading:
|
|
2333
|
+
loading: import_zod16.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2316
2334
|
text: TranslationConfig.describe("Text to display on the button")
|
|
2317
2335
|
})
|
|
2318
2336
|
}).describe("Generic button without any built-in functionality");
|
|
2319
2337
|
var AlphaPrintButton = BaseField.extend({
|
|
2320
|
-
type:
|
|
2321
|
-
configuration:
|
|
2322
|
-
template:
|
|
2338
|
+
type: import_zod16.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
2339
|
+
configuration: import_zod16.z.object({
|
|
2340
|
+
template: import_zod16.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
2323
2341
|
buttonLabel: TranslationConfig.optional().describe(
|
|
2324
2342
|
"Label for the print button"
|
|
2325
2343
|
)
|
|
2326
2344
|
})
|
|
2327
2345
|
}).describe("Print button field for printing certificates");
|
|
2328
2346
|
var HttpField = BaseField.extend({
|
|
2329
|
-
type:
|
|
2347
|
+
type: import_zod16.z.literal(FieldType.HTTP),
|
|
2330
2348
|
defaultValue: HttpFieldValue.optional(),
|
|
2331
|
-
configuration:
|
|
2349
|
+
configuration: import_zod16.z.object({
|
|
2332
2350
|
trigger: FieldReference,
|
|
2333
|
-
url:
|
|
2334
|
-
method:
|
|
2335
|
-
headers:
|
|
2336
|
-
body:
|
|
2337
|
-
errorValue:
|
|
2338
|
-
params:
|
|
2339
|
-
timeout:
|
|
2351
|
+
url: import_zod16.z.string().describe("URL to send the HTTP request to"),
|
|
2352
|
+
method: import_zod16.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
2353
|
+
headers: import_zod16.z.record(import_zod16.z.string()).optional(),
|
|
2354
|
+
body: import_zod16.z.record(import_zod16.z.any()).optional(),
|
|
2355
|
+
errorValue: import_zod16.z.any().optional().describe("Value to set if the request fails"),
|
|
2356
|
+
params: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.union([import_zod16.z.string(), FieldReference])).optional(),
|
|
2357
|
+
timeout: import_zod16.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2340
2358
|
})
|
|
2341
2359
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
2342
2360
|
var SearchField = HttpField.extend({
|
|
2343
|
-
type:
|
|
2361
|
+
type: import_zod16.z.literal(FieldType.SEARCH),
|
|
2344
2362
|
configuration: SearchQuery.pick({
|
|
2345
2363
|
query: true,
|
|
2346
2364
|
limit: true,
|
|
2347
2365
|
offset: true
|
|
2348
2366
|
}).extend({
|
|
2349
2367
|
validation: ValidationConfig,
|
|
2350
|
-
indicators:
|
|
2368
|
+
indicators: import_zod16.z.object({
|
|
2351
2369
|
loading: TranslationConfig.optional().describe(
|
|
2352
2370
|
"Text to display while the search is in progress"
|
|
2353
2371
|
),
|
|
@@ -2362,7 +2380,7 @@ var SearchField = HttpField.extend({
|
|
|
2362
2380
|
),
|
|
2363
2381
|
confirmButton: TranslationConfig.optional(),
|
|
2364
2382
|
clearButton: TranslationConfig.optional(),
|
|
2365
|
-
clearModal:
|
|
2383
|
+
clearModal: import_zod16.z.object({
|
|
2366
2384
|
title: TranslationConfig.optional(),
|
|
2367
2385
|
description: TranslationConfig.optional(),
|
|
2368
2386
|
cancel: TranslationConfig.optional(),
|
|
@@ -2373,17 +2391,17 @@ var SearchField = HttpField.extend({
|
|
|
2373
2391
|
})
|
|
2374
2392
|
});
|
|
2375
2393
|
var LinkButtonField = BaseField.extend({
|
|
2376
|
-
type:
|
|
2377
|
-
configuration:
|
|
2378
|
-
url:
|
|
2394
|
+
type: import_zod16.z.literal(FieldType.LINK_BUTTON),
|
|
2395
|
+
configuration: import_zod16.z.object({
|
|
2396
|
+
url: import_zod16.z.string().describe("URL to open"),
|
|
2379
2397
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2380
|
-
icon:
|
|
2398
|
+
icon: import_zod16.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2381
2399
|
})
|
|
2382
2400
|
}).describe("Button that opens a link");
|
|
2383
2401
|
var VerificationStatus = BaseField.extend({
|
|
2384
|
-
type:
|
|
2402
|
+
type: import_zod16.z.literal(FieldType.VERIFICATION_STATUS),
|
|
2385
2403
|
defaultValue: VerificationStatusValue.optional(),
|
|
2386
|
-
configuration:
|
|
2404
|
+
configuration: import_zod16.z.object({
|
|
2387
2405
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2388
2406
|
description: TranslationConfig.describe(
|
|
2389
2407
|
"Explaining text on the banner in form."
|
|
@@ -2391,38 +2409,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
2391
2409
|
})
|
|
2392
2410
|
});
|
|
2393
2411
|
var QueryParamReaderField = BaseField.extend({
|
|
2394
|
-
type:
|
|
2395
|
-
configuration:
|
|
2396
|
-
pickParams:
|
|
2412
|
+
type: import_zod16.z.literal(FieldType.QUERY_PARAM_READER),
|
|
2413
|
+
configuration: import_zod16.z.object({
|
|
2414
|
+
pickParams: import_zod16.z.array(import_zod16.z.string()).describe("List of query parameters to read from the URL")
|
|
2397
2415
|
})
|
|
2398
2416
|
}).describe(
|
|
2399
2417
|
"A field that maps URL query params into form values and clears them afterward"
|
|
2400
2418
|
);
|
|
2401
2419
|
var QrReaderField = BaseField.extend({
|
|
2402
|
-
type:
|
|
2420
|
+
type: import_zod16.z.literal(FieldType.QR_READER),
|
|
2403
2421
|
defaultValue: QrReaderFieldValue.optional(),
|
|
2404
|
-
configuration:
|
|
2405
|
-
validator:
|
|
2422
|
+
configuration: import_zod16.z.object({
|
|
2423
|
+
validator: import_zod16.z.custom(
|
|
2406
2424
|
(val) => typeof val === "object" && val !== null
|
|
2407
2425
|
)
|
|
2408
2426
|
}).optional()
|
|
2409
2427
|
});
|
|
2410
2428
|
var IdReaderField = BaseField.extend({
|
|
2411
|
-
type:
|
|
2429
|
+
type: import_zod16.z.literal(FieldType.ID_READER),
|
|
2412
2430
|
defaultValue: IdReaderFieldValue.optional(),
|
|
2413
|
-
methods:
|
|
2414
|
-
|
|
2431
|
+
methods: import_zod16.z.array(
|
|
2432
|
+
import_zod16.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2415
2433
|
)
|
|
2416
2434
|
});
|
|
2417
2435
|
var LoaderField = BaseField.extend({
|
|
2418
|
-
type:
|
|
2419
|
-
configuration:
|
|
2436
|
+
type: import_zod16.z.literal(FieldType.LOADER),
|
|
2437
|
+
configuration: import_zod16.z.object({
|
|
2420
2438
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2421
2439
|
})
|
|
2422
2440
|
}).describe(
|
|
2423
2441
|
"A non-interactive field that indicates an in progress operation in form"
|
|
2424
2442
|
);
|
|
2425
|
-
var FieldConfig =
|
|
2443
|
+
var FieldConfig = import_zod16.z.discriminatedUnion("type", [
|
|
2426
2444
|
Address,
|
|
2427
2445
|
TextField,
|
|
2428
2446
|
NumberField,
|
|
@@ -2467,27 +2485,27 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
|
2467
2485
|
description: "Form field configuration",
|
|
2468
2486
|
ref: "FieldConfig"
|
|
2469
2487
|
});
|
|
2470
|
-
var AnyFileField =
|
|
2488
|
+
var AnyFileField = import_zod16.z.discriminatedUnion("type", [
|
|
2471
2489
|
SignatureField,
|
|
2472
2490
|
File,
|
|
2473
2491
|
FileUploadWithOptions
|
|
2474
2492
|
]);
|
|
2475
2493
|
|
|
2476
2494
|
// ../commons/src/events/FormConfig.ts
|
|
2477
|
-
var
|
|
2495
|
+
var import_zod18 = require("zod");
|
|
2478
2496
|
|
|
2479
2497
|
// ../commons/src/events/PageConfig.ts
|
|
2480
|
-
var
|
|
2498
|
+
var import_zod17 = require("zod");
|
|
2481
2499
|
var import_zod_openapi7 = require("zod-openapi");
|
|
2482
|
-
(0, import_zod_openapi7.extendZodWithOpenApi)(
|
|
2483
|
-
var PageTypes =
|
|
2484
|
-
var PageConfigBase =
|
|
2485
|
-
id:
|
|
2500
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod17.z);
|
|
2501
|
+
var PageTypes = import_zod17.z.enum(["FORM", "VERIFICATION"]);
|
|
2502
|
+
var PageConfigBase = import_zod17.z.object({
|
|
2503
|
+
id: import_zod17.z.string().describe("Unique identifier for the page"),
|
|
2486
2504
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2487
|
-
requireCompletionToContinue:
|
|
2505
|
+
requireCompletionToContinue: import_zod17.z.boolean().default(false).describe(
|
|
2488
2506
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2489
2507
|
),
|
|
2490
|
-
fields:
|
|
2508
|
+
fields: import_zod17.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2491
2509
|
conditional: Conditional.optional().describe(
|
|
2492
2510
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2493
2511
|
)
|
|
@@ -2496,13 +2514,13 @@ var PageConfigBase = import_zod16.z.object({
|
|
|
2496
2514
|
ref: "FormPageConfig"
|
|
2497
2515
|
});
|
|
2498
2516
|
var FormPageConfig = PageConfigBase.extend({
|
|
2499
|
-
type:
|
|
2517
|
+
type: import_zod17.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2500
2518
|
});
|
|
2501
|
-
var VerificationActionConfig =
|
|
2502
|
-
verify:
|
|
2503
|
-
cancel:
|
|
2519
|
+
var VerificationActionConfig = import_zod17.z.object({
|
|
2520
|
+
verify: import_zod17.z.object({ label: TranslationConfig }),
|
|
2521
|
+
cancel: import_zod17.z.object({
|
|
2504
2522
|
label: TranslationConfig,
|
|
2505
|
-
confirmation:
|
|
2523
|
+
confirmation: import_zod17.z.object({
|
|
2506
2524
|
title: TranslationConfig,
|
|
2507
2525
|
body: TranslationConfig
|
|
2508
2526
|
})
|
|
@@ -2512,33 +2530,33 @@ var VerificationActionConfig = import_zod16.z.object({
|
|
|
2512
2530
|
ref: "VerificationActionConfig"
|
|
2513
2531
|
});
|
|
2514
2532
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2515
|
-
type:
|
|
2533
|
+
type: import_zod17.z.literal(PageTypes.enum.VERIFICATION),
|
|
2516
2534
|
actions: VerificationActionConfig
|
|
2517
2535
|
});
|
|
2518
|
-
var PageConfig =
|
|
2536
|
+
var PageConfig = import_zod17.z.discriminatedUnion("type", [
|
|
2519
2537
|
FormPageConfig,
|
|
2520
2538
|
VerificationPageConfig
|
|
2521
2539
|
]);
|
|
2522
2540
|
|
|
2523
2541
|
// ../commons/src/events/FormConfig.ts
|
|
2524
|
-
var DeclarationFormConfig =
|
|
2542
|
+
var DeclarationFormConfig = import_zod18.z.object({
|
|
2525
2543
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2526
|
-
pages:
|
|
2544
|
+
pages: import_zod18.z.array(FormPageConfig)
|
|
2527
2545
|
}).describe("Configuration of the declaration form.");
|
|
2528
|
-
var ActionFormConfig =
|
|
2546
|
+
var ActionFormConfig = import_zod18.z.object({
|
|
2529
2547
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2530
|
-
pages:
|
|
2548
|
+
pages: import_zod18.z.array(PageConfig)
|
|
2531
2549
|
}).describe(
|
|
2532
2550
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2533
2551
|
);
|
|
2534
|
-
var FormConfig =
|
|
2552
|
+
var FormConfig = import_zod18.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2535
2553
|
|
|
2536
2554
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2537
|
-
var
|
|
2555
|
+
var import_zod19 = require("zod");
|
|
2538
2556
|
var import_zod_openapi8 = require("zod-openapi");
|
|
2539
|
-
(0, import_zod_openapi8.extendZodWithOpenApi)(
|
|
2540
|
-
var FieldReference2 =
|
|
2541
|
-
var Matcher =
|
|
2557
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod19.z);
|
|
2558
|
+
var FieldReference2 = import_zod19.z.string();
|
|
2559
|
+
var Matcher = import_zod19.z.object({
|
|
2542
2560
|
/**
|
|
2543
2561
|
* Reference to the field used in matching.
|
|
2544
2562
|
*
|
|
@@ -2546,68 +2564,68 @@ var Matcher = import_zod18.z.object({
|
|
|
2546
2564
|
* be used as the origin date to calculate the distance from.
|
|
2547
2565
|
*/
|
|
2548
2566
|
fieldId: FieldReference2,
|
|
2549
|
-
options:
|
|
2550
|
-
boost:
|
|
2567
|
+
options: import_zod19.z.object({
|
|
2568
|
+
boost: import_zod19.z.number().optional()
|
|
2551
2569
|
}).optional().default({
|
|
2552
2570
|
boost: 1
|
|
2553
2571
|
})
|
|
2554
2572
|
});
|
|
2555
2573
|
var FuzzyMatcher = Matcher.extend({
|
|
2556
|
-
type:
|
|
2557
|
-
options:
|
|
2574
|
+
type: import_zod19.z.literal("fuzzy"),
|
|
2575
|
+
options: import_zod19.z.object({
|
|
2558
2576
|
/**
|
|
2559
2577
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2560
2578
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2561
2579
|
* Names of length >7 characters = 2 edits allowed
|
|
2562
2580
|
*/
|
|
2563
|
-
fuzziness:
|
|
2564
|
-
boost:
|
|
2581
|
+
fuzziness: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).optional().default("AUTO:4,7"),
|
|
2582
|
+
boost: import_zod19.z.number().optional().default(1)
|
|
2565
2583
|
}).optional().default({
|
|
2566
2584
|
fuzziness: "AUTO:4,7",
|
|
2567
2585
|
boost: 1
|
|
2568
2586
|
})
|
|
2569
2587
|
});
|
|
2570
2588
|
var StrictMatcher = Matcher.extend({
|
|
2571
|
-
type:
|
|
2572
|
-
options:
|
|
2573
|
-
boost:
|
|
2589
|
+
type: import_zod19.z.literal("strict"),
|
|
2590
|
+
options: import_zod19.z.object({
|
|
2591
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2574
2592
|
/**
|
|
2575
2593
|
* The constant value to be present in the field for both records
|
|
2576
2594
|
*/
|
|
2577
|
-
value:
|
|
2595
|
+
value: import_zod19.z.string().optional()
|
|
2578
2596
|
}).optional().default({
|
|
2579
2597
|
boost: 1
|
|
2580
2598
|
})
|
|
2581
2599
|
});
|
|
2582
2600
|
var DateRangeMatcher = Matcher.extend({
|
|
2583
|
-
type:
|
|
2584
|
-
options:
|
|
2601
|
+
type: import_zod19.z.literal("dateRange"),
|
|
2602
|
+
options: import_zod19.z.object({
|
|
2585
2603
|
/**
|
|
2586
2604
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2587
2605
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2588
2606
|
*/
|
|
2589
|
-
pivot:
|
|
2590
|
-
days:
|
|
2591
|
-
boost:
|
|
2607
|
+
pivot: import_zod19.z.number().optional(),
|
|
2608
|
+
days: import_zod19.z.number(),
|
|
2609
|
+
boost: import_zod19.z.number().optional().default(1)
|
|
2592
2610
|
})
|
|
2593
2611
|
});
|
|
2594
|
-
var Not =
|
|
2595
|
-
type:
|
|
2612
|
+
var Not = import_zod19.z.object({
|
|
2613
|
+
type: import_zod19.z.literal("not"),
|
|
2596
2614
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2597
|
-
clause:
|
|
2615
|
+
clause: import_zod19.z.lazy(() => Clause)
|
|
2598
2616
|
});
|
|
2599
|
-
var And =
|
|
2600
|
-
type:
|
|
2617
|
+
var And = import_zod19.z.object({
|
|
2618
|
+
type: import_zod19.z.literal("and"),
|
|
2601
2619
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2602
|
-
clauses:
|
|
2620
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2603
2621
|
});
|
|
2604
|
-
var Or =
|
|
2605
|
-
type:
|
|
2622
|
+
var Or = import_zod19.z.object({
|
|
2623
|
+
type: import_zod19.z.literal("or"),
|
|
2606
2624
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2607
|
-
clauses:
|
|
2625
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2608
2626
|
});
|
|
2609
|
-
var Clause =
|
|
2610
|
-
() =>
|
|
2627
|
+
var Clause = import_zod19.z.lazy(
|
|
2628
|
+
() => import_zod19.z.discriminatedUnion("type", [
|
|
2611
2629
|
Not,
|
|
2612
2630
|
And,
|
|
2613
2631
|
Or,
|
|
@@ -2618,22 +2636,22 @@ var Clause = import_zod18.z.lazy(
|
|
|
2618
2636
|
).openapi({
|
|
2619
2637
|
ref: "Clause"
|
|
2620
2638
|
});
|
|
2621
|
-
var DeduplicationConfig =
|
|
2622
|
-
id:
|
|
2639
|
+
var DeduplicationConfig = import_zod19.z.object({
|
|
2640
|
+
id: import_zod19.z.string(),
|
|
2623
2641
|
label: TranslationConfig,
|
|
2624
2642
|
query: Clause
|
|
2625
2643
|
});
|
|
2626
2644
|
|
|
2627
2645
|
// ../commons/src/events/ActionConfig.ts
|
|
2628
2646
|
var import_zod_openapi9 = require("zod-openapi");
|
|
2629
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(
|
|
2630
|
-
var DeclarationReviewConfig =
|
|
2647
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod20.z);
|
|
2648
|
+
var DeclarationReviewConfig = import_zod20.z.object({
|
|
2631
2649
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2632
|
-
fields:
|
|
2650
|
+
fields: import_zod20.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2633
2651
|
}).describe(
|
|
2634
2652
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2635
2653
|
);
|
|
2636
|
-
var ActionConfigBase =
|
|
2654
|
+
var ActionConfigBase = import_zod20.z.object({
|
|
2637
2655
|
label: TranslationConfig.describe("Human readable description of the action")
|
|
2638
2656
|
});
|
|
2639
2657
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
@@ -2641,66 +2659,66 @@ var DeclarationActionBase = ActionConfigBase.extend({
|
|
|
2641
2659
|
deduplication: DeduplicationConfig.optional()
|
|
2642
2660
|
});
|
|
2643
2661
|
var ReadActionConfig = ActionConfigBase.merge(
|
|
2644
|
-
|
|
2645
|
-
type:
|
|
2662
|
+
import_zod20.z.object({
|
|
2663
|
+
type: import_zod20.z.literal(ActionType.READ),
|
|
2646
2664
|
review: DeclarationReviewConfig.describe(
|
|
2647
2665
|
"Configuration of the review page for read-only view."
|
|
2648
2666
|
)
|
|
2649
2667
|
})
|
|
2650
2668
|
);
|
|
2651
2669
|
var DeclareConfig = DeclarationActionBase.merge(
|
|
2652
|
-
|
|
2653
|
-
type:
|
|
2670
|
+
import_zod20.z.object({
|
|
2671
|
+
type: import_zod20.z.literal(ActionType.DECLARE)
|
|
2654
2672
|
})
|
|
2655
2673
|
);
|
|
2656
2674
|
var ValidateConfig = DeclarationActionBase.merge(
|
|
2657
|
-
|
|
2658
|
-
type:
|
|
2675
|
+
import_zod20.z.object({
|
|
2676
|
+
type: import_zod20.z.literal(ActionType.VALIDATE)
|
|
2659
2677
|
})
|
|
2660
2678
|
);
|
|
2661
2679
|
var RegisterConfig = DeclarationActionBase.merge(
|
|
2662
|
-
|
|
2663
|
-
type:
|
|
2680
|
+
import_zod20.z.object({
|
|
2681
|
+
type: import_zod20.z.literal(ActionType.REGISTER)
|
|
2664
2682
|
})
|
|
2665
2683
|
);
|
|
2666
2684
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2667
|
-
|
|
2668
|
-
type:
|
|
2685
|
+
import_zod20.z.object({
|
|
2686
|
+
type: import_zod20.z.literal(ActionType.REJECT)
|
|
2669
2687
|
})
|
|
2670
2688
|
);
|
|
2671
2689
|
var ArchiveConfig = ActionConfigBase.merge(
|
|
2672
|
-
|
|
2673
|
-
type:
|
|
2690
|
+
import_zod20.z.object({
|
|
2691
|
+
type: import_zod20.z.literal(ActionType.ARCHIVE)
|
|
2674
2692
|
})
|
|
2675
2693
|
);
|
|
2676
2694
|
var DeleteConfig = ActionConfigBase.merge(
|
|
2677
|
-
|
|
2678
|
-
type:
|
|
2695
|
+
import_zod20.z.object({
|
|
2696
|
+
type: import_zod20.z.literal(ActionType.DELETE)
|
|
2679
2697
|
})
|
|
2680
2698
|
);
|
|
2681
2699
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2682
|
-
|
|
2683
|
-
type:
|
|
2700
|
+
import_zod20.z.object({
|
|
2701
|
+
type: import_zod20.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2684
2702
|
printForm: ActionFormConfig
|
|
2685
2703
|
})
|
|
2686
2704
|
);
|
|
2687
2705
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2688
|
-
|
|
2689
|
-
type:
|
|
2706
|
+
import_zod20.z.object({
|
|
2707
|
+
type: import_zod20.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2690
2708
|
correctionForm: ActionFormConfig
|
|
2691
2709
|
})
|
|
2692
2710
|
);
|
|
2693
2711
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2694
|
-
|
|
2695
|
-
type:
|
|
2712
|
+
import_zod20.z.object({
|
|
2713
|
+
type: import_zod20.z.literal(ActionType.REJECT_CORRECTION)
|
|
2696
2714
|
})
|
|
2697
2715
|
);
|
|
2698
2716
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2699
|
-
|
|
2700
|
-
type:
|
|
2717
|
+
import_zod20.z.object({
|
|
2718
|
+
type: import_zod20.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2701
2719
|
})
|
|
2702
2720
|
);
|
|
2703
|
-
var ActionConfig =
|
|
2721
|
+
var ActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2704
2722
|
/*
|
|
2705
2723
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2706
2724
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2721,87 +2739,87 @@ var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
|
2721
2739
|
]).describe(
|
|
2722
2740
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2723
2741
|
).openapi({ ref: "ActionConfig" });
|
|
2724
|
-
var DeclarationActionConfig =
|
|
2742
|
+
var DeclarationActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2725
2743
|
DeclareConfig,
|
|
2726
2744
|
ValidateConfig,
|
|
2727
2745
|
RegisterConfig
|
|
2728
2746
|
]);
|
|
2729
2747
|
|
|
2730
2748
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2731
|
-
var
|
|
2732
|
-
var FontFamily =
|
|
2733
|
-
normal:
|
|
2734
|
-
bold:
|
|
2735
|
-
italics:
|
|
2736
|
-
bolditalics:
|
|
2749
|
+
var import_zod21 = require("zod");
|
|
2750
|
+
var FontFamily = import_zod21.z.object({
|
|
2751
|
+
normal: import_zod21.z.string(),
|
|
2752
|
+
bold: import_zod21.z.string(),
|
|
2753
|
+
italics: import_zod21.z.string(),
|
|
2754
|
+
bolditalics: import_zod21.z.string()
|
|
2737
2755
|
});
|
|
2738
|
-
var CertificateConfig =
|
|
2739
|
-
id:
|
|
2740
|
-
event:
|
|
2741
|
-
isV2Template:
|
|
2756
|
+
var CertificateConfig = import_zod21.z.object({
|
|
2757
|
+
id: import_zod21.z.string(),
|
|
2758
|
+
event: import_zod21.z.string(),
|
|
2759
|
+
isV2Template: import_zod21.z.boolean().optional(),
|
|
2742
2760
|
label: TranslationConfig,
|
|
2743
|
-
isDefault:
|
|
2744
|
-
fee:
|
|
2745
|
-
onTime:
|
|
2746
|
-
late:
|
|
2747
|
-
delayed:
|
|
2761
|
+
isDefault: import_zod21.z.boolean(),
|
|
2762
|
+
fee: import_zod21.z.object({
|
|
2763
|
+
onTime: import_zod21.z.number(),
|
|
2764
|
+
late: import_zod21.z.number(),
|
|
2765
|
+
delayed: import_zod21.z.number()
|
|
2748
2766
|
}),
|
|
2749
|
-
svgUrl:
|
|
2750
|
-
fonts:
|
|
2751
|
-
conditionals:
|
|
2767
|
+
svgUrl: import_zod21.z.string(),
|
|
2768
|
+
fonts: import_zod21.z.record(FontFamily).optional(),
|
|
2769
|
+
conditionals: import_zod21.z.array(ShowConditional).optional()
|
|
2752
2770
|
});
|
|
2753
2771
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2754
|
-
hash:
|
|
2755
|
-
svg:
|
|
2772
|
+
hash: import_zod21.z.string().optional(),
|
|
2773
|
+
svg: import_zod21.z.string()
|
|
2756
2774
|
});
|
|
2757
2775
|
|
|
2758
2776
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2759
|
-
var
|
|
2760
|
-
var LanguageConfig =
|
|
2761
|
-
lang:
|
|
2777
|
+
var import_zod22 = require("zod");
|
|
2778
|
+
var LanguageConfig = import_zod22.z.object({
|
|
2779
|
+
lang: import_zod22.z.string(),
|
|
2762
2780
|
/**
|
|
2763
2781
|
* client.csv contents
|
|
2764
2782
|
*/
|
|
2765
|
-
messages:
|
|
2783
|
+
messages: import_zod22.z.record(import_zod22.z.string())
|
|
2766
2784
|
});
|
|
2767
2785
|
|
|
2768
2786
|
// ../commons/src/events/EventConfig.ts
|
|
2769
|
-
var
|
|
2787
|
+
var import_zod27 = require("zod");
|
|
2770
2788
|
|
|
2771
2789
|
// ../commons/src/events/SummaryConfig.ts
|
|
2772
|
-
var
|
|
2773
|
-
var BaseField2 =
|
|
2790
|
+
var import_zod23 = require("zod");
|
|
2791
|
+
var BaseField2 = import_zod23.z.object({
|
|
2774
2792
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2775
2793
|
"Default message displayed when the field value is empty."
|
|
2776
2794
|
),
|
|
2777
|
-
conditionals:
|
|
2795
|
+
conditionals: import_zod23.z.array(ShowConditional).default([]).optional()
|
|
2778
2796
|
});
|
|
2779
2797
|
var ReferenceField = BaseField2.extend({
|
|
2780
|
-
fieldId:
|
|
2798
|
+
fieldId: import_zod23.z.string(),
|
|
2781
2799
|
label: TranslationConfig.optional().describe(
|
|
2782
2800
|
"Overrides the default label from the referenced field when provided."
|
|
2783
2801
|
)
|
|
2784
2802
|
}).describe("Field referencing existing event data by field ID.");
|
|
2785
2803
|
var Field = BaseField2.extend({
|
|
2786
|
-
id:
|
|
2804
|
+
id: import_zod23.z.string().describe("Identifier of the summary field."),
|
|
2787
2805
|
value: TranslationConfig.describe(
|
|
2788
2806
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2789
2807
|
),
|
|
2790
2808
|
label: TranslationConfig
|
|
2791
2809
|
}).describe("Custom field defined for the summary view.");
|
|
2792
|
-
var SummaryConfig =
|
|
2793
|
-
fields:
|
|
2810
|
+
var SummaryConfig = import_zod23.z.object({
|
|
2811
|
+
fields: import_zod23.z.array(import_zod23.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2794
2812
|
}).describe("Configuration of the event summary section.");
|
|
2795
2813
|
|
|
2796
2814
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2797
|
-
var
|
|
2798
|
-
var MatchType =
|
|
2799
|
-
var BaseField3 =
|
|
2800
|
-
config:
|
|
2815
|
+
var import_zod24 = require("zod");
|
|
2816
|
+
var MatchType = import_zod24.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2817
|
+
var BaseField3 = import_zod24.z.object({
|
|
2818
|
+
config: import_zod24.z.object({
|
|
2801
2819
|
type: MatchType.describe(
|
|
2802
2820
|
"Determines the search type of field. How to match value."
|
|
2803
2821
|
),
|
|
2804
|
-
searchFields:
|
|
2822
|
+
searchFields: import_zod24.z.array(import_zod24.z.string()).optional().describe(
|
|
2805
2823
|
`
|
|
2806
2824
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2807
2825
|
All specified fields will be combined using OR logic.
|
|
@@ -2811,7 +2829,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2811
2829
|
`
|
|
2812
2830
|
)
|
|
2813
2831
|
}),
|
|
2814
|
-
type:
|
|
2832
|
+
type: import_zod24.z.nativeEnum(FieldType).optional().describe(
|
|
2815
2833
|
`
|
|
2816
2834
|
Explicitly specify the field type for searchFields.
|
|
2817
2835
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2825,7 +2843,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2825
2843
|
This is required when searchFields is defined.
|
|
2826
2844
|
`
|
|
2827
2845
|
),
|
|
2828
|
-
options:
|
|
2846
|
+
options: import_zod24.z.array(SelectOption).optional(),
|
|
2829
2847
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2830
2848
|
`
|
|
2831
2849
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2846,7 +2864,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2846
2864
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2847
2865
|
`
|
|
2848
2866
|
),
|
|
2849
|
-
conditionals:
|
|
2867
|
+
conditionals: import_zod24.z.array(FieldConditional).default([]).optional().describe(
|
|
2850
2868
|
`
|
|
2851
2869
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2852
2870
|
|
|
@@ -2860,20 +2878,20 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2860
2878
|
are always rendered in the advanced search form.
|
|
2861
2879
|
`
|
|
2862
2880
|
),
|
|
2863
|
-
validations:
|
|
2881
|
+
validations: import_zod24.z.array(ValidationConfig).default([]).optional().describe(
|
|
2864
2882
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2865
2883
|
)
|
|
2866
2884
|
});
|
|
2867
|
-
var SearchQueryParams =
|
|
2868
|
-
eventType:
|
|
2885
|
+
var SearchQueryParams = import_zod24.z.object({
|
|
2886
|
+
eventType: import_zod24.z.string().optional().describe(
|
|
2869
2887
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2870
2888
|
)
|
|
2871
2889
|
}).catchall(FieldValue);
|
|
2872
2890
|
var FieldConfigSchema = BaseField3.extend({
|
|
2873
|
-
fieldId:
|
|
2874
|
-
fieldType:
|
|
2891
|
+
fieldId: import_zod24.z.string(),
|
|
2892
|
+
fieldType: import_zod24.z.literal("field")
|
|
2875
2893
|
});
|
|
2876
|
-
var EventFieldIdInput =
|
|
2894
|
+
var EventFieldIdInput = import_zod24.z.enum([
|
|
2877
2895
|
"trackingId",
|
|
2878
2896
|
"status",
|
|
2879
2897
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2882,7 +2900,7 @@ var EventFieldIdInput = import_zod23.z.enum([
|
|
|
2882
2900
|
"updatedAt"
|
|
2883
2901
|
]);
|
|
2884
2902
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2885
|
-
var EventFieldId =
|
|
2903
|
+
var EventFieldId = import_zod24.z.enum([
|
|
2886
2904
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2887
2905
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2888
2906
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2892,29 +2910,29 @@ var EventFieldId = import_zod23.z.enum([
|
|
|
2892
2910
|
]);
|
|
2893
2911
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2894
2912
|
fieldId: EventFieldId,
|
|
2895
|
-
fieldType:
|
|
2913
|
+
fieldType: import_zod24.z.literal("event")
|
|
2896
2914
|
});
|
|
2897
|
-
var AdvancedSearchField =
|
|
2915
|
+
var AdvancedSearchField = import_zod24.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2898
2916
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2899
2917
|
if (!data.label) {
|
|
2900
2918
|
ctx.addIssue({
|
|
2901
|
-
code:
|
|
2919
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2902
2920
|
message: "label is required when config.searchFields is defined.",
|
|
2903
2921
|
path: ["label"]
|
|
2904
2922
|
});
|
|
2905
2923
|
}
|
|
2906
2924
|
if (!data.type) {
|
|
2907
2925
|
ctx.addIssue({
|
|
2908
|
-
code:
|
|
2926
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2909
2927
|
message: "type is required when config.searchFields is defined.",
|
|
2910
2928
|
path: ["type"]
|
|
2911
2929
|
});
|
|
2912
2930
|
}
|
|
2913
2931
|
}
|
|
2914
2932
|
});
|
|
2915
|
-
var AdvancedSearchConfig =
|
|
2933
|
+
var AdvancedSearchConfig = import_zod24.z.object({
|
|
2916
2934
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2917
|
-
fields:
|
|
2935
|
+
fields: import_zod24.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2918
2936
|
});
|
|
2919
2937
|
|
|
2920
2938
|
// ../commons/src/events/utils.ts
|
|
@@ -2923,14 +2941,14 @@ var import_lodash = require("lodash");
|
|
|
2923
2941
|
// ../commons/src/conditionals/validate.ts
|
|
2924
2942
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2925
2943
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2926
|
-
var
|
|
2944
|
+
var import_zod26 = require("zod");
|
|
2927
2945
|
var import_date_fns = require("date-fns");
|
|
2928
2946
|
|
|
2929
2947
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2930
|
-
var
|
|
2948
|
+
var import_zod25 = require("zod");
|
|
2931
2949
|
function getDynamicNameValue(field3) {
|
|
2932
2950
|
const nameConfiguration = field3.configuration?.name;
|
|
2933
|
-
return
|
|
2951
|
+
return import_zod25.z.object({
|
|
2934
2952
|
firstname: nameConfiguration?.firstname?.required ? NonEmptyTextValue : TextValue,
|
|
2935
2953
|
surname: nameConfiguration?.surname?.required ? NonEmptyTextValue : TextValue,
|
|
2936
2954
|
middlename: nameConfiguration?.middlename?.required ? NonEmptyTextValue : TextValue.optional()
|
|
@@ -3230,9 +3248,9 @@ var ajv = new import__.default({
|
|
|
3230
3248
|
strict: false
|
|
3231
3249
|
// Allow minContains and other newer features
|
|
3232
3250
|
});
|
|
3233
|
-
var DataContext =
|
|
3234
|
-
rootData:
|
|
3235
|
-
$leafAdminStructureLocationIds:
|
|
3251
|
+
var DataContext = import_zod26.z.object({
|
|
3252
|
+
rootData: import_zod26.z.object({
|
|
3253
|
+
$leafAdminStructureLocationIds: import_zod26.z.array(import_zod26.z.object({ id: UUID }))
|
|
3236
3254
|
})
|
|
3237
3255
|
});
|
|
3238
3256
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -3600,7 +3618,7 @@ function areCertificateConditionsMet(conditions, values) {
|
|
|
3600
3618
|
}
|
|
3601
3619
|
|
|
3602
3620
|
// ../commons/src/utils.ts
|
|
3603
|
-
var
|
|
3621
|
+
var z27 = __toESM(require("zod"));
|
|
3604
3622
|
function getOrThrow(x, message) {
|
|
3605
3623
|
if (x === void 0 || x === null) {
|
|
3606
3624
|
throw new Error(message);
|
|
@@ -3610,11 +3628,11 @@ function getOrThrow(x, message) {
|
|
|
3610
3628
|
function joinValues(values, separator = " ") {
|
|
3611
3629
|
return values.filter((value) => !!value).join(separator).trim();
|
|
3612
3630
|
}
|
|
3613
|
-
var FullNameV1 =
|
|
3614
|
-
|
|
3615
|
-
use:
|
|
3616
|
-
family:
|
|
3617
|
-
given:
|
|
3631
|
+
var FullNameV1 = z27.array(
|
|
3632
|
+
z27.object({
|
|
3633
|
+
use: z27.string(),
|
|
3634
|
+
family: z27.string(),
|
|
3635
|
+
given: z27.array(z27.string())
|
|
3618
3636
|
})
|
|
3619
3637
|
);
|
|
3620
3638
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -3960,9 +3978,9 @@ function aggregateActionDeclarations(event2) {
|
|
|
3960
3978
|
|
|
3961
3979
|
// ../commons/src/events/EventConfig.ts
|
|
3962
3980
|
var import_zod_openapi10 = require("zod-openapi");
|
|
3963
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
|
3964
|
-
var EventConfig =
|
|
3965
|
-
id:
|
|
3981
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod27.z);
|
|
3982
|
+
var EventConfig = import_zod27.z.object({
|
|
3983
|
+
id: import_zod27.z.string().describe(
|
|
3966
3984
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
3967
3985
|
),
|
|
3968
3986
|
dateOfEvent: FieldReference.optional().describe(
|
|
@@ -3980,13 +3998,13 @@ var EventConfig = import_zod26.z.object({
|
|
|
3980
3998
|
label: TranslationConfig.describe(
|
|
3981
3999
|
"Human-readable label for the event type."
|
|
3982
4000
|
),
|
|
3983
|
-
actions:
|
|
4001
|
+
actions: import_zod27.z.array(ActionConfig).describe(
|
|
3984
4002
|
"Configuration of system-defined actions associated with the event."
|
|
3985
4003
|
),
|
|
3986
4004
|
declaration: DeclarationFormConfig.describe(
|
|
3987
4005
|
"Configuration of the form used to gather event data."
|
|
3988
4006
|
),
|
|
3989
|
-
advancedSearch:
|
|
4007
|
+
advancedSearch: import_zod27.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
3990
4008
|
"Configuration of fields available in the advanced search feature."
|
|
3991
4009
|
)
|
|
3992
4010
|
}).superRefine((event2, ctx) => {
|
|
@@ -4050,7 +4068,7 @@ var definePage = (page) => PageConfig.parse(page);
|
|
|
4050
4068
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
4051
4069
|
|
|
4052
4070
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
4053
|
-
var
|
|
4071
|
+
var import_zod31 = require("zod");
|
|
4054
4072
|
|
|
4055
4073
|
// ../commons/src/conditionals/conditionals.ts
|
|
4056
4074
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -4126,6 +4144,7 @@ function wrapToPathOptional(condition, path) {
|
|
|
4126
4144
|
};
|
|
4127
4145
|
}, condition);
|
|
4128
4146
|
}
|
|
4147
|
+
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
4129
4148
|
var user = Object.assign(userSerializer, {
|
|
4130
4149
|
hasScope: (scope) => defineConditional({
|
|
4131
4150
|
type: "object",
|
|
@@ -4804,17 +4823,17 @@ var event = Object.assign(eventFn, {
|
|
|
4804
4823
|
});
|
|
4805
4824
|
|
|
4806
4825
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
4807
|
-
var
|
|
4826
|
+
var import_zod28 = require("zod");
|
|
4808
4827
|
var WorkqueueColumnKeysArray = [
|
|
4809
4828
|
...EventMetadataKeysArray,
|
|
4810
4829
|
"title",
|
|
4811
4830
|
"outbox"
|
|
4812
4831
|
];
|
|
4813
|
-
var WorkqueueColumnKeys =
|
|
4814
|
-
var WorkqueueColumnValue =
|
|
4832
|
+
var WorkqueueColumnKeys = import_zod28.z.enum(WorkqueueColumnKeysArray);
|
|
4833
|
+
var WorkqueueColumnValue = import_zod28.z.object({
|
|
4815
4834
|
$event: WorkqueueColumnKeys
|
|
4816
4835
|
});
|
|
4817
|
-
var WorkqueueColumn =
|
|
4836
|
+
var WorkqueueColumn = import_zod28.z.object({
|
|
4818
4837
|
label: TranslationConfig,
|
|
4819
4838
|
value: WorkqueueColumnValue
|
|
4820
4839
|
});
|
|
@@ -4825,57 +4844,57 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
4825
4844
|
}
|
|
4826
4845
|
|
|
4827
4846
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
4828
|
-
var
|
|
4829
|
-
var SerializableExact =
|
|
4830
|
-
type:
|
|
4831
|
-
term:
|
|
4847
|
+
var import_zod29 = require("zod");
|
|
4848
|
+
var SerializableExact = import_zod29.z.object({
|
|
4849
|
+
type: import_zod29.z.literal("exact"),
|
|
4850
|
+
term: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
4832
4851
|
});
|
|
4833
|
-
var SerializableWithin =
|
|
4834
|
-
type:
|
|
4835
|
-
location:
|
|
4852
|
+
var SerializableWithin = import_zod29.z.object({
|
|
4853
|
+
type: import_zod29.z.literal("within"),
|
|
4854
|
+
location: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
4836
4855
|
});
|
|
4837
|
-
var SerializedQueryExpression =
|
|
4838
|
-
eventType:
|
|
4839
|
-
status:
|
|
4840
|
-
createdAt:
|
|
4841
|
-
updatedAt:
|
|
4842
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
4843
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
4844
|
-
|
|
4856
|
+
var SerializedQueryExpression = import_zod29.z.object({
|
|
4857
|
+
eventType: import_zod29.z.string(),
|
|
4858
|
+
status: import_zod29.z.optional(import_zod29.z.union([AnyOfStatus, ExactStatus])),
|
|
4859
|
+
createdAt: import_zod29.z.optional(DateCondition),
|
|
4860
|
+
updatedAt: import_zod29.z.optional(DateCondition),
|
|
4861
|
+
"legalStatuses.REGISTERED.createdAt": import_zod29.z.optional(DateCondition),
|
|
4862
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod29.z.optional(
|
|
4863
|
+
import_zod29.z.union([Within, Exact])
|
|
4845
4864
|
),
|
|
4846
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
4847
|
-
createdAtLocation:
|
|
4848
|
-
|
|
4865
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod29.z.optional(Exact),
|
|
4866
|
+
createdAtLocation: import_zod29.z.optional(
|
|
4867
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
4849
4868
|
),
|
|
4850
|
-
updatedAtLocation:
|
|
4851
|
-
|
|
4869
|
+
updatedAtLocation: import_zod29.z.optional(
|
|
4870
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
4852
4871
|
),
|
|
4853
|
-
assignedTo:
|
|
4854
|
-
createdBy:
|
|
4872
|
+
assignedTo: import_zod29.z.optional(SerializableExact),
|
|
4873
|
+
createdBy: import_zod29.z.optional(SerializableExact),
|
|
4855
4874
|
createdByUserType: ExactUserType,
|
|
4856
|
-
updatedBy:
|
|
4857
|
-
trackingId:
|
|
4858
|
-
flags:
|
|
4875
|
+
updatedBy: import_zod29.z.optional(SerializableExact),
|
|
4876
|
+
trackingId: import_zod29.z.optional(Exact),
|
|
4877
|
+
flags: import_zod29.z.optional(ContainsFlags),
|
|
4859
4878
|
data: QueryInput
|
|
4860
4879
|
}).partial();
|
|
4861
|
-
var Or2 =
|
|
4862
|
-
type:
|
|
4863
|
-
clauses:
|
|
4880
|
+
var Or2 = import_zod29.z.object({
|
|
4881
|
+
type: import_zod29.z.literal("or"),
|
|
4882
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
4864
4883
|
});
|
|
4865
|
-
var And2 =
|
|
4866
|
-
type:
|
|
4867
|
-
clauses:
|
|
4884
|
+
var And2 = import_zod29.z.object({
|
|
4885
|
+
type: import_zod29.z.literal("and"),
|
|
4886
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
4868
4887
|
});
|
|
4869
|
-
var CountryConfigQueryType =
|
|
4870
|
-
var CountryConfigQueryInputType =
|
|
4888
|
+
var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
|
|
4889
|
+
var CountryConfigQueryInputType = import_zod29.z.union([
|
|
4871
4890
|
SerializedQueryExpression,
|
|
4872
4891
|
And2,
|
|
4873
4892
|
Or2
|
|
4874
4893
|
]);
|
|
4875
4894
|
|
|
4876
4895
|
// ../commons/src/icons.ts
|
|
4877
|
-
var
|
|
4878
|
-
var AvailableIcons =
|
|
4896
|
+
var import_zod30 = require("zod");
|
|
4897
|
+
var AvailableIcons = import_zod30.z.enum([
|
|
4879
4898
|
"Archived",
|
|
4880
4899
|
"Assigned",
|
|
4881
4900
|
"Certified",
|
|
@@ -4996,23 +5015,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
4996
5015
|
value: event.field("updatedAt")
|
|
4997
5016
|
}
|
|
4998
5017
|
]);
|
|
4999
|
-
var WorkqueueActionsWithDefault =
|
|
5018
|
+
var WorkqueueActionsWithDefault = import_zod31.z.enum([
|
|
5000
5019
|
...workqueueActions.options,
|
|
5001
5020
|
"DEFAULT"
|
|
5002
5021
|
]);
|
|
5003
|
-
var WorkqueueConfig =
|
|
5004
|
-
slug:
|
|
5022
|
+
var WorkqueueConfig = import_zod31.z.object({
|
|
5023
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
5005
5024
|
name: TranslationConfig.describe(
|
|
5006
5025
|
"Title of the workflow (both in navigation and on the page)"
|
|
5007
5026
|
),
|
|
5008
5027
|
query: CountryConfigQueryType,
|
|
5009
|
-
actions:
|
|
5010
|
-
|
|
5028
|
+
actions: import_zod31.z.array(
|
|
5029
|
+
import_zod31.z.object({
|
|
5011
5030
|
type: WorkqueueActionsWithDefault,
|
|
5012
|
-
conditionals:
|
|
5031
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
5013
5032
|
})
|
|
5014
5033
|
),
|
|
5015
|
-
columns:
|
|
5034
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5016
5035
|
icon: AvailableIcons,
|
|
5017
5036
|
emptyMessage: TranslationConfig.optional()
|
|
5018
5037
|
}).describe("Configuration for workqueue.");
|
|
@@ -5020,19 +5039,19 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5020
5039
|
query: true,
|
|
5021
5040
|
columns: true
|
|
5022
5041
|
});
|
|
5023
|
-
var WorkqueueConfigInput =
|
|
5024
|
-
slug:
|
|
5042
|
+
var WorkqueueConfigInput = import_zod31.z.object({
|
|
5043
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
5025
5044
|
name: TranslationConfig.describe(
|
|
5026
5045
|
"Title of the workflow (both in navigation and on the page)"
|
|
5027
5046
|
),
|
|
5028
5047
|
query: CountryConfigQueryInputType,
|
|
5029
|
-
actions:
|
|
5030
|
-
|
|
5048
|
+
actions: import_zod31.z.array(
|
|
5049
|
+
import_zod31.z.object({
|
|
5031
5050
|
type: WorkqueueActionsWithDefault,
|
|
5032
|
-
conditionals:
|
|
5051
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
5033
5052
|
})
|
|
5034
5053
|
),
|
|
5035
|
-
columns:
|
|
5054
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5036
5055
|
icon: AvailableIcons,
|
|
5037
5056
|
emptyMessage: TranslationConfig.optional()
|
|
5038
5057
|
});
|
|
@@ -5044,10 +5063,10 @@ function defineWorkqueue(workqueueInput) {
|
|
|
5044
5063
|
function defineWorkqueues(workqueues) {
|
|
5045
5064
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
|
5046
5065
|
}
|
|
5047
|
-
var WorkqueueCountInput =
|
|
5048
|
-
|
|
5066
|
+
var WorkqueueCountInput = import_zod31.z.array(
|
|
5067
|
+
import_zod31.z.object({ slug: import_zod31.z.string(), query: QueryType })
|
|
5049
5068
|
);
|
|
5050
|
-
var WorkqueueCountOutput =
|
|
5069
|
+
var WorkqueueCountOutput = import_zod31.z.record(import_zod31.z.string(), import_zod31.z.number());
|
|
5051
5070
|
|
|
5052
5071
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
5053
5072
|
var defaultWorkqueueColumns = [
|
|
@@ -5070,45 +5089,45 @@ var defaultWorkqueueColumns = [
|
|
|
5070
5089
|
];
|
|
5071
5090
|
|
|
5072
5091
|
// ../commons/src/events/Draft.ts
|
|
5073
|
-
var
|
|
5092
|
+
var import_zod33 = require("zod");
|
|
5074
5093
|
|
|
5075
5094
|
// ../commons/src/events/ActionInput.ts
|
|
5076
|
-
var
|
|
5095
|
+
var import_zod32 = require("zod");
|
|
5077
5096
|
var import_zod_openapi11 = require("zod-openapi");
|
|
5078
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
5079
|
-
var BaseActionInput =
|
|
5097
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
|
|
5098
|
+
var BaseActionInput = import_zod32.z.object({
|
|
5080
5099
|
eventId: UUID,
|
|
5081
|
-
transactionId:
|
|
5100
|
+
transactionId: import_zod32.z.string(),
|
|
5082
5101
|
declaration: ActionUpdate.default({}),
|
|
5083
5102
|
annotation: ActionUpdate.optional(),
|
|
5084
5103
|
originalActionId: UUID.optional(),
|
|
5085
5104
|
// should not be part of base action.
|
|
5086
|
-
keepAssignment:
|
|
5105
|
+
keepAssignment: import_zod32.z.boolean().optional(),
|
|
5087
5106
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
5088
5107
|
createdAtLocation: CreatedAtLocation.describe(
|
|
5089
5108
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
5090
5109
|
)
|
|
5091
5110
|
});
|
|
5092
5111
|
var CreateActionInput = BaseActionInput.merge(
|
|
5093
|
-
|
|
5094
|
-
type:
|
|
5112
|
+
import_zod32.z.object({
|
|
5113
|
+
type: import_zod32.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
5095
5114
|
createdAtLocation: CreatedAtLocation
|
|
5096
5115
|
})
|
|
5097
5116
|
);
|
|
5098
5117
|
var RegisterActionInput = BaseActionInput.merge(
|
|
5099
|
-
|
|
5100
|
-
type:
|
|
5101
|
-
registrationNumber:
|
|
5118
|
+
import_zod32.z.object({
|
|
5119
|
+
type: import_zod32.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
5120
|
+
registrationNumber: import_zod32.z.string().optional()
|
|
5102
5121
|
})
|
|
5103
5122
|
).strict();
|
|
5104
5123
|
var ValidateActionInput = BaseActionInput.merge(
|
|
5105
|
-
|
|
5106
|
-
type:
|
|
5124
|
+
import_zod32.z.object({
|
|
5125
|
+
type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
5107
5126
|
})
|
|
5108
5127
|
);
|
|
5109
5128
|
var NotifyActionInput = BaseActionInput.merge(
|
|
5110
|
-
|
|
5111
|
-
type:
|
|
5129
|
+
import_zod32.z.object({
|
|
5130
|
+
type: import_zod32.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
5112
5131
|
})
|
|
5113
5132
|
).openapi({
|
|
5114
5133
|
default: {
|
|
@@ -5120,86 +5139,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
5120
5139
|
}
|
|
5121
5140
|
});
|
|
5122
5141
|
var DeclareActionInput = BaseActionInput.merge(
|
|
5123
|
-
|
|
5124
|
-
type:
|
|
5142
|
+
import_zod32.z.object({
|
|
5143
|
+
type: import_zod32.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
5125
5144
|
})
|
|
5126
5145
|
);
|
|
5127
5146
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
5128
|
-
|
|
5129
|
-
type:
|
|
5147
|
+
import_zod32.z.object({
|
|
5148
|
+
type: import_zod32.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
5130
5149
|
content: PrintContent.optional()
|
|
5131
5150
|
})
|
|
5132
5151
|
);
|
|
5133
5152
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
5134
|
-
|
|
5135
|
-
type:
|
|
5153
|
+
import_zod32.z.object({
|
|
5154
|
+
type: import_zod32.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
5136
5155
|
content: ReasonContent
|
|
5137
5156
|
})
|
|
5138
5157
|
);
|
|
5139
5158
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
5140
|
-
|
|
5141
|
-
type:
|
|
5142
|
-
content:
|
|
5143
|
-
duplicates:
|
|
5159
|
+
import_zod32.z.object({
|
|
5160
|
+
type: import_zod32.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
5161
|
+
content: import_zod32.z.object({
|
|
5162
|
+
duplicates: import_zod32.z.array(PotentialDuplicate)
|
|
5144
5163
|
})
|
|
5145
5164
|
})
|
|
5146
5165
|
);
|
|
5147
5166
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
5148
|
-
|
|
5149
|
-
type:
|
|
5150
|
-
content:
|
|
5167
|
+
import_zod32.z.object({
|
|
5168
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
5169
|
+
content: import_zod32.z.object({
|
|
5151
5170
|
duplicateOf: UUID
|
|
5152
5171
|
}).optional()
|
|
5153
5172
|
})
|
|
5154
5173
|
);
|
|
5155
5174
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
5156
|
-
|
|
5157
|
-
type:
|
|
5175
|
+
import_zod32.z.object({
|
|
5176
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
5158
5177
|
})
|
|
5159
5178
|
);
|
|
5160
5179
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
5161
|
-
|
|
5162
|
-
type:
|
|
5180
|
+
import_zod32.z.object({
|
|
5181
|
+
type: import_zod32.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
5163
5182
|
content: ReasonContent
|
|
5164
5183
|
})
|
|
5165
5184
|
);
|
|
5166
5185
|
var AssignActionInput = BaseActionInput.merge(
|
|
5167
|
-
|
|
5168
|
-
type:
|
|
5169
|
-
assignedTo:
|
|
5186
|
+
import_zod32.z.object({
|
|
5187
|
+
type: import_zod32.z.literal(ActionType.ASSIGN),
|
|
5188
|
+
assignedTo: import_zod32.z.string()
|
|
5170
5189
|
})
|
|
5171
5190
|
);
|
|
5172
5191
|
var UnassignActionInput = BaseActionInput.merge(
|
|
5173
|
-
|
|
5174
|
-
type:
|
|
5175
|
-
assignedTo:
|
|
5192
|
+
import_zod32.z.object({
|
|
5193
|
+
type: import_zod32.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
5194
|
+
assignedTo: import_zod32.z.literal(null).default(null)
|
|
5176
5195
|
})
|
|
5177
5196
|
);
|
|
5178
5197
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
5179
|
-
|
|
5180
|
-
type:
|
|
5198
|
+
import_zod32.z.object({
|
|
5199
|
+
type: import_zod32.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
5181
5200
|
})
|
|
5182
5201
|
);
|
|
5183
5202
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
5184
|
-
|
|
5185
|
-
requestId:
|
|
5186
|
-
type:
|
|
5203
|
+
import_zod32.z.object({
|
|
5204
|
+
requestId: import_zod32.z.string(),
|
|
5205
|
+
type: import_zod32.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
5187
5206
|
content: ReasonContent
|
|
5188
5207
|
})
|
|
5189
5208
|
);
|
|
5190
5209
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
5191
|
-
|
|
5192
|
-
requestId:
|
|
5193
|
-
type:
|
|
5210
|
+
import_zod32.z.object({
|
|
5211
|
+
requestId: import_zod32.z.string(),
|
|
5212
|
+
type: import_zod32.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
5194
5213
|
})
|
|
5195
5214
|
);
|
|
5196
5215
|
var ReadActionInput = BaseActionInput.merge(
|
|
5197
|
-
|
|
5198
|
-
type:
|
|
5216
|
+
import_zod32.z.object({
|
|
5217
|
+
type: import_zod32.z.literal(ActionType.READ).default(ActionType.READ)
|
|
5199
5218
|
})
|
|
5200
5219
|
);
|
|
5201
|
-
var DeleteActionInput =
|
|
5202
|
-
var ActionInput =
|
|
5220
|
+
var DeleteActionInput = import_zod32.z.object({ eventId: UUID });
|
|
5221
|
+
var ActionInput = import_zod32.z.discriminatedUnion("type", [
|
|
5203
5222
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
5204
5223
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
5205
5224
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
@@ -5234,11 +5253,11 @@ var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
|
5234
5253
|
});
|
|
5235
5254
|
|
|
5236
5255
|
// ../commons/src/events/Draft.ts
|
|
5237
|
-
var Draft =
|
|
5256
|
+
var Draft = import_zod33.z.object({
|
|
5238
5257
|
id: UUID,
|
|
5239
5258
|
eventId: UUID,
|
|
5240
|
-
transactionId:
|
|
5241
|
-
createdAt:
|
|
5259
|
+
transactionId: import_zod33.z.string(),
|
|
5260
|
+
createdAt: import_zod33.z.string().datetime(),
|
|
5242
5261
|
action: ActionBase.extend({
|
|
5243
5262
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
5244
5263
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -5247,7 +5266,7 @@ var Draft = import_zod32.z.object({
|
|
|
5247
5266
|
);
|
|
5248
5267
|
var DraftInput = BaseActionInput.extend({
|
|
5249
5268
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
5250
|
-
status:
|
|
5269
|
+
status: import_zod33.z.enum([
|
|
5251
5270
|
ActionStatus.Requested,
|
|
5252
5271
|
ActionStatus.Accepted,
|
|
5253
5272
|
ActionStatus.Rejected
|
|
@@ -5255,26 +5274,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
5255
5274
|
});
|
|
5256
5275
|
|
|
5257
5276
|
// ../commons/src/events/EventInput.ts
|
|
5258
|
-
var
|
|
5277
|
+
var import_zod34 = require("zod");
|
|
5259
5278
|
var import_uuid10 = require("uuid");
|
|
5260
|
-
var EventInput =
|
|
5261
|
-
transactionId:
|
|
5262
|
-
type:
|
|
5279
|
+
var EventInput = import_zod34.z.object({
|
|
5280
|
+
transactionId: import_zod34.z.string(),
|
|
5281
|
+
type: import_zod34.z.string()
|
|
5263
5282
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
5264
5283
|
|
|
5265
5284
|
// ../commons/src/events/EventDocument.ts
|
|
5266
|
-
var
|
|
5285
|
+
var import_zod35 = require("zod");
|
|
5267
5286
|
var import_zod_openapi12 = require("zod-openapi");
|
|
5268
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
5269
|
-
var EventDocument =
|
|
5287
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
|
|
5288
|
+
var EventDocument = import_zod35.z.object({
|
|
5270
5289
|
id: UUID.describe("Unique identifier of the event."),
|
|
5271
|
-
type:
|
|
5272
|
-
createdAt:
|
|
5273
|
-
updatedAt:
|
|
5290
|
+
type: import_zod35.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
5291
|
+
createdAt: import_zod35.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
5292
|
+
updatedAt: import_zod35.z.string().datetime().describe(
|
|
5274
5293
|
"Timestamp of the last update, excluding changes from actions."
|
|
5275
5294
|
),
|
|
5276
|
-
actions:
|
|
5277
|
-
trackingId:
|
|
5295
|
+
actions: import_zod35.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
5296
|
+
trackingId: import_zod35.z.string().describe(
|
|
5278
5297
|
"System-generated tracking identifier used to look up the event."
|
|
5279
5298
|
)
|
|
5280
5299
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -8127,9 +8146,9 @@ var digitalIdentityEvent = defineConfig({
|
|
|
8127
8146
|
});
|
|
8128
8147
|
|
|
8129
8148
|
// ../commons/src/events/test.utils.ts
|
|
8130
|
-
var
|
|
8149
|
+
var import_zod36 = require("zod");
|
|
8131
8150
|
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
|
8132
|
-
var TestUserRole =
|
|
8151
|
+
var TestUserRole = import_zod36.z.enum([
|
|
8133
8152
|
"FIELD_AGENT",
|
|
8134
8153
|
"LOCAL_REGISTRAR",
|
|
8135
8154
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -8888,7 +8907,8 @@ function isFieldValueWithoutTemplates(value) {
|
|
|
8888
8907
|
if (isTemplateVariable(value)) {
|
|
8889
8908
|
return false;
|
|
8890
8909
|
}
|
|
8891
|
-
if (typeof value === "object" && value !== null &&
|
|
8910
|
+
if (typeof value === "object" && value !== null && // template variable can exist in both keys and values of an object
|
|
8911
|
+
(Object.values(value).some((val) => isTemplateVariable(val)) || Object.keys(value).some((val) => isTemplateVariable(val)))) {
|
|
8892
8912
|
return false;
|
|
8893
8913
|
}
|
|
8894
8914
|
return true;
|
|
@@ -9174,16 +9194,16 @@ function getFilePathsFromEvent(event2) {
|
|
|
9174
9194
|
}
|
|
9175
9195
|
|
|
9176
9196
|
// ../commons/src/events/locations.ts
|
|
9177
|
-
var
|
|
9178
|
-
var LocationType =
|
|
9197
|
+
var import_zod37 = require("zod");
|
|
9198
|
+
var LocationType = import_zod37.z.enum([
|
|
9179
9199
|
"ADMIN_STRUCTURE",
|
|
9180
9200
|
"CRVS_OFFICE",
|
|
9181
9201
|
"HEALTH_FACILITY"
|
|
9182
9202
|
]);
|
|
9183
|
-
var Location =
|
|
9203
|
+
var Location = import_zod37.z.object({
|
|
9184
9204
|
id: UUID,
|
|
9185
|
-
name:
|
|
9205
|
+
name: import_zod37.z.string(),
|
|
9186
9206
|
parentId: UUID.nullable(),
|
|
9187
|
-
validUntil:
|
|
9207
|
+
validUntil: import_zod37.z.string().datetime().nullable(),
|
|
9188
9208
|
locationType: LocationType.nullable()
|
|
9189
9209
|
});
|