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