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