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