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