@opencrvs/toolkit 2.1.0-beta → 2.1.0-beta.2
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/README.md +2 -12
- package/create-countryconfig/index.js +21 -27
- package/dist/application-config/index.js +16 -14
- package/dist/authentication/index.js +6 -2
- package/dist/cli.js +43 -68
- package/dist/commons/api/router.d.ts +6 -42
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/ActionConfig.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
- package/dist/commons/events/FieldConfig.d.ts +16 -5
- package/dist/commons/events/FormConfig.d.ts +6 -0
- package/dist/commons/events/PageConfig.d.ts +4 -0
- package/dist/commons/events/utils.d.ts +4 -0
- package/dist/conditionals/index.js +6 -2
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/setup-environment.js +19 -21
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +3 -8
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +4 -0
- package/dist/environment/utils.d.ts +0 -12
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/index.js +37 -14
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/notification/index.js +20 -14
- package/dist/scopes/index.d.ts +108 -0
- package/dist/scopes/index.js +6 -2
- package/dist/translations/check.d.ts +2 -0
- package/dist/translations/check.d.ts.map +1 -1
- package/dist/translations/check.js +9 -4
- package/dist/verify/endpoints.js +1 -1
- package/opencrvs-toolkit-2.1.0-beta.2.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-beta.tgz +0 -0
package/dist/events/index.js
CHANGED
|
@@ -825,7 +825,9 @@ var userRole = z7.preprocess(
|
|
|
825
825
|
).describe("User role, e.g. admin, field agent");
|
|
826
826
|
var scopeOptionsPlaceEvent = z7.object({
|
|
827
827
|
event: scopeByEvent,
|
|
828
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
828
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
829
|
+
createdBy: UserFilter.optional(),
|
|
830
|
+
createdIn: JurisdictionFilter.optional()
|
|
829
831
|
}).describe("Options applicable to all record scopes.");
|
|
830
832
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
831
833
|
notifiedIn: JurisdictionFilter.optional(),
|
|
@@ -868,7 +870,9 @@ var AllScopeOptions = z7.object({
|
|
|
868
870
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
869
871
|
var ResolvedScopeOptionsPlaceEvent = z7.object({
|
|
870
872
|
event: scopeByEvent,
|
|
871
|
-
placeOfEvent: UUID.nullish()
|
|
873
|
+
placeOfEvent: UUID.nullish(),
|
|
874
|
+
createdBy: z7.string().optional(),
|
|
875
|
+
createdIn: UUID.nullish()
|
|
872
876
|
}).describe(
|
|
873
877
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
874
878
|
);
|
|
@@ -2843,9 +2847,6 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
2843
2847
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
2844
2848
|
type: AdministrativeAreas,
|
|
2845
2849
|
allowedLocations: AllowedLocations,
|
|
2846
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2847
|
-
"List every historical name a location has had as a separate, selectable option."
|
|
2848
|
-
),
|
|
2849
2850
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2850
2851
|
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2851
2852
|
),
|
|
@@ -2863,9 +2864,6 @@ var LocationInput = BaseField.extend({
|
|
|
2863
2864
|
configuration: import_v43.default.object({
|
|
2864
2865
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2865
2866
|
allowedLocations: AllowedLocations,
|
|
2866
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2867
|
-
"List every historical name a location has had as a separate, selectable option."
|
|
2868
|
-
),
|
|
2869
2867
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2870
2868
|
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2871
2869
|
),
|
|
@@ -2899,7 +2897,6 @@ var Facility = BaseField.extend({
|
|
|
2899
2897
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2900
2898
|
configuration: import_v43.default.object({
|
|
2901
2899
|
allowedLocations: AllowedLocations,
|
|
2902
|
-
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2903
2900
|
activeOnly: import_v43.default.boolean().optional(),
|
|
2904
2901
|
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2905
2902
|
}).optional()
|
|
@@ -2909,7 +2906,6 @@ var Office = BaseField.extend({
|
|
|
2909
2906
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2910
2907
|
configuration: import_v43.default.object({
|
|
2911
2908
|
allowedLocations: AllowedLocations,
|
|
2912
|
-
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2913
2909
|
activeOnly: import_v43.default.boolean().optional(),
|
|
2914
2910
|
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2915
2911
|
}).optional()
|
|
@@ -2946,9 +2942,6 @@ var Address = BaseField.extend({
|
|
|
2946
2942
|
})
|
|
2947
2943
|
).optional(),
|
|
2948
2944
|
allowedLocations: AllowedLocations,
|
|
2949
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2950
|
-
"List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
|
|
2951
|
-
),
|
|
2952
2945
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2953
2946
|
"Offer only admin areas that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded. Propagated to the embedded admin-area selectors."
|
|
2954
2947
|
),
|
|
@@ -3009,10 +3002,19 @@ var ButtonField = BaseField.extend({
|
|
|
3009
3002
|
description: "A generic button that can be used to trigger an action",
|
|
3010
3003
|
id: "ButtonField"
|
|
3011
3004
|
});
|
|
3005
|
+
var FieldGroupConfiguration = import_v43.default.object({
|
|
3006
|
+
separator: import_v43.default.string().optional().describe(
|
|
3007
|
+
'Joins the subfield values when the group is rendered as output, e.g. ", ". Defaults to one subfield per line.'
|
|
3008
|
+
),
|
|
3009
|
+
hideEmptyFields: import_v43.default.boolean().default(false).optional().describe(
|
|
3010
|
+
"Leaves subfields without a value out of the output. Pair it with a separator so the separator does not double up around the gaps."
|
|
3011
|
+
)
|
|
3012
|
+
});
|
|
3012
3013
|
var FieldGroup = BaseField.extend({
|
|
3013
3014
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
3014
3015
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3015
|
-
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
3016
|
+
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig)),
|
|
3017
|
+
configuration: FieldGroupConfiguration.optional()
|
|
3016
3018
|
}).meta({
|
|
3017
3019
|
description: "A group of fields that are displayed together",
|
|
3018
3020
|
id: "FieldGroup"
|
|
@@ -3266,6 +3268,9 @@ var PageConfigBase = z22.object({
|
|
|
3266
3268
|
requireCompletionToContinue: z22.boolean().default(false).describe(
|
|
3267
3269
|
"If true, all required fields must be filled before continuing to the next page"
|
|
3268
3270
|
),
|
|
3271
|
+
showClearButton: z22.boolean().optional().describe(
|
|
3272
|
+
'If true, a "Clear" button is shown at the top of the page allowing the user to reset all fields on the page to their default state'
|
|
3273
|
+
),
|
|
3269
3274
|
fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
3270
3275
|
conditional: Conditional.optional().describe(
|
|
3271
3276
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
@@ -8218,6 +8223,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
8218
8223
|
defaultMessage: "Who is applying for the membership?",
|
|
8219
8224
|
description: "This is the title of the section"
|
|
8220
8225
|
},
|
|
8226
|
+
showClearButton: true,
|
|
8221
8227
|
fields: [
|
|
8222
8228
|
{
|
|
8223
8229
|
id: "applicant.name",
|
|
@@ -10051,6 +10057,23 @@ function canAccessEventWithScope(event2, scope, user2, customActionType) {
|
|
|
10051
10057
|
)) {
|
|
10052
10058
|
return false;
|
|
10053
10059
|
}
|
|
10060
|
+
if (opts?.createdBy === UserFilter.enum.user && event2.createdBy !== user2.id) {
|
|
10061
|
+
return false;
|
|
10062
|
+
}
|
|
10063
|
+
if (opts?.createdIn === JurisdictionFilter.enum.location && !matchesJurisdictionFilter(
|
|
10064
|
+
event2.createdAtLocation,
|
|
10065
|
+
JurisdictionFilter.enum.location,
|
|
10066
|
+
user2
|
|
10067
|
+
)) {
|
|
10068
|
+
return false;
|
|
10069
|
+
}
|
|
10070
|
+
if (opts?.createdIn === JurisdictionFilter.enum.administrativeArea && !matchesJurisdictionFilter(
|
|
10071
|
+
event2.createdAtLocation,
|
|
10072
|
+
JurisdictionFilter.enum.administrativeArea,
|
|
10073
|
+
user2
|
|
10074
|
+
)) {
|
|
10075
|
+
return false;
|
|
10076
|
+
}
|
|
10054
10077
|
if (scopeUsesDeclaredOptions(scope)) {
|
|
10055
10078
|
const { options } = scope;
|
|
10056
10079
|
if (options?.status && (!event2.status || !options.status.includes(event2.status))) {
|
|
@@ -56,7 +56,7 @@ exports.main = main;
|
|
|
56
56
|
* so `git merge-base HEAD upstream/develop` typically returns nothing.
|
|
57
57
|
* - With no merge-base, a 3-way merge degenerates to a 2-way diff against
|
|
58
58
|
* an empty file — every line that differs becomes a conflict.
|
|
59
|
-
* - `release
|
|
59
|
+
* - `release/1.9.15` is the latest 1.9.x release on upstream and is a
|
|
60
60
|
* near-perfect representation of "what `infrastructure/` looked like
|
|
61
61
|
* before v2.0", regardless of whether the fork's git history reaches it.
|
|
62
62
|
* - For files the country config never modified relative to that baseline,
|
|
@@ -81,7 +81,7 @@ exports.main = main;
|
|
|
81
81
|
* sides changed a binary file, the result will be invalid and a warning
|
|
82
82
|
* is printed.
|
|
83
83
|
* - Forks that are on a much older 1.9.x and never merged later 1.9 patches
|
|
84
|
-
* may see a few extra conflicts on files where 1.9.x → release
|
|
84
|
+
* may see a few extra conflicts on files where 1.9.x → release/1.9.15
|
|
85
85
|
* patches and v1.9 → v2.0 changes textually overlap.
|
|
86
86
|
*/
|
|
87
87
|
const child_process_1 = require("child_process");
|
|
@@ -97,7 +97,7 @@ const INFRASTRUCTURE_DIR = 'infrastructure';
|
|
|
97
97
|
// Synthetic merge-base: the tip of upstream's latest 1.9.x release line.
|
|
98
98
|
// We use this branch's content as the "common ancestor" for every file,
|
|
99
99
|
// since most country forks don't share git history with upstream.
|
|
100
|
-
const BASE_BRANCH = 'release
|
|
100
|
+
const BASE_BRANCH = 'release/1.9.15';
|
|
101
101
|
/**
|
|
102
102
|
* Reads `git show <ref>:<path>` as a Uint8Array (binary-safe).
|
|
103
103
|
* Returns `null` if the path doesn't exist at that ref.
|
|
@@ -381,7 +381,9 @@ var userRole = z7.preprocess(
|
|
|
381
381
|
).describe("User role, e.g. admin, field agent");
|
|
382
382
|
var scopeOptionsPlaceEvent = z7.object({
|
|
383
383
|
event: scopeByEvent,
|
|
384
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
384
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
385
|
+
createdBy: UserFilter.optional(),
|
|
386
|
+
createdIn: JurisdictionFilter.optional()
|
|
385
387
|
}).describe("Options applicable to all record scopes.");
|
|
386
388
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
387
389
|
notifiedIn: JurisdictionFilter.optional(),
|
|
@@ -424,7 +426,9 @@ var AllScopeOptions = z7.object({
|
|
|
424
426
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
425
427
|
var ResolvedScopeOptionsPlaceEvent = z7.object({
|
|
426
428
|
event: scopeByEvent,
|
|
427
|
-
placeOfEvent: UUID.nullish()
|
|
429
|
+
placeOfEvent: UUID.nullish(),
|
|
430
|
+
createdBy: z7.string().optional(),
|
|
431
|
+
createdIn: UUID.nullish()
|
|
428
432
|
}).describe(
|
|
429
433
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
430
434
|
);
|
|
@@ -2244,9 +2248,6 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
2244
2248
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
2245
2249
|
type: AdministrativeAreas,
|
|
2246
2250
|
allowedLocations: AllowedLocations,
|
|
2247
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2248
|
-
"List every historical name a location has had as a separate, selectable option."
|
|
2249
|
-
),
|
|
2250
2251
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2251
2252
|
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2252
2253
|
),
|
|
@@ -2264,9 +2265,6 @@ var LocationInput = BaseField.extend({
|
|
|
2264
2265
|
configuration: import_v43.default.object({
|
|
2265
2266
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2266
2267
|
allowedLocations: AllowedLocations,
|
|
2267
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2268
|
-
"List every historical name a location has had as a separate, selectable option."
|
|
2269
|
-
),
|
|
2270
2268
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2271
2269
|
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2272
2270
|
),
|
|
@@ -2300,7 +2298,6 @@ var Facility = BaseField.extend({
|
|
|
2300
2298
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2301
2299
|
configuration: import_v43.default.object({
|
|
2302
2300
|
allowedLocations: AllowedLocations,
|
|
2303
|
-
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2304
2301
|
activeOnly: import_v43.default.boolean().optional(),
|
|
2305
2302
|
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2306
2303
|
}).optional()
|
|
@@ -2310,7 +2307,6 @@ var Office = BaseField.extend({
|
|
|
2310
2307
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2311
2308
|
configuration: import_v43.default.object({
|
|
2312
2309
|
allowedLocations: AllowedLocations,
|
|
2313
|
-
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2314
2310
|
activeOnly: import_v43.default.boolean().optional(),
|
|
2315
2311
|
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2316
2312
|
}).optional()
|
|
@@ -2347,9 +2343,6 @@ var Address = BaseField.extend({
|
|
|
2347
2343
|
})
|
|
2348
2344
|
).optional(),
|
|
2349
2345
|
allowedLocations: AllowedLocations,
|
|
2350
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2351
|
-
"List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
|
|
2352
|
-
),
|
|
2353
2346
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2354
2347
|
"Offer only admin areas that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded. Propagated to the embedded admin-area selectors."
|
|
2355
2348
|
),
|
|
@@ -2410,10 +2403,19 @@ var ButtonField = BaseField.extend({
|
|
|
2410
2403
|
description: "A generic button that can be used to trigger an action",
|
|
2411
2404
|
id: "ButtonField"
|
|
2412
2405
|
});
|
|
2406
|
+
var FieldGroupConfiguration = import_v43.default.object({
|
|
2407
|
+
separator: import_v43.default.string().optional().describe(
|
|
2408
|
+
'Joins the subfield values when the group is rendered as output, e.g. ", ". Defaults to one subfield per line.'
|
|
2409
|
+
),
|
|
2410
|
+
hideEmptyFields: import_v43.default.boolean().default(false).optional().describe(
|
|
2411
|
+
"Leaves subfields without a value out of the output. Pair it with a separator so the separator does not double up around the gaps."
|
|
2412
|
+
)
|
|
2413
|
+
});
|
|
2413
2414
|
var FieldGroup = BaseField.extend({
|
|
2414
2415
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2415
2416
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2416
|
-
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2417
|
+
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig)),
|
|
2418
|
+
configuration: FieldGroupConfiguration.optional()
|
|
2417
2419
|
}).meta({
|
|
2418
2420
|
description: "A group of fields that are displayed together",
|
|
2419
2421
|
id: "FieldGroup"
|
|
@@ -2667,6 +2669,9 @@ var PageConfigBase = z22.object({
|
|
|
2667
2669
|
requireCompletionToContinue: z22.boolean().default(false).describe(
|
|
2668
2670
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2669
2671
|
),
|
|
2672
|
+
showClearButton: z22.boolean().optional().describe(
|
|
2673
|
+
'If true, a "Clear" button is shown at the top of the page allowing the user to reset all fields on the page to their default state'
|
|
2674
|
+
),
|
|
2670
2675
|
fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2671
2676
|
conditional: Conditional.optional().describe(
|
|
2672
2677
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
@@ -5885,6 +5890,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5885
5890
|
defaultMessage: "Who is applying for the membership?",
|
|
5886
5891
|
description: "This is the title of the section"
|
|
5887
5892
|
},
|
|
5893
|
+
showClearButton: true,
|
|
5888
5894
|
fields: [
|
|
5889
5895
|
{
|
|
5890
5896
|
id: "applicant.name",
|
package/dist/scopes/index.d.ts
CHANGED
|
@@ -42,6 +42,14 @@ declare const AllScopeOptions: z.ZodObject<{
|
|
|
42
42
|
all: "all";
|
|
43
43
|
location: "location";
|
|
44
44
|
}>>;
|
|
45
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
user: "user";
|
|
47
|
+
}>>;
|
|
48
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
administrativeArea: "administrativeArea";
|
|
50
|
+
all: "all";
|
|
51
|
+
location: "location";
|
|
52
|
+
}>>;
|
|
45
53
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
46
54
|
administrativeArea: "administrativeArea";
|
|
47
55
|
all: "all";
|
|
@@ -107,6 +115,8 @@ declare const AllScopeOptions: z.ZodObject<{
|
|
|
107
115
|
type AllScopeOptions = z.infer<typeof AllScopeOptions>;
|
|
108
116
|
export declare const ScopeOptionKey: z.ZodEnum<{
|
|
109
117
|
accessLevel: "accessLevel";
|
|
118
|
+
createdBy: "createdBy";
|
|
119
|
+
createdIn: "createdIn";
|
|
110
120
|
declaredBy: "declaredBy";
|
|
111
121
|
declaredIn: "declaredIn";
|
|
112
122
|
event: "event";
|
|
@@ -154,6 +164,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
154
164
|
all: "all";
|
|
155
165
|
location: "location";
|
|
156
166
|
}>>;
|
|
167
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
168
|
+
user: "user";
|
|
169
|
+
}>>;
|
|
170
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
171
|
+
administrativeArea: "administrativeArea";
|
|
172
|
+
all: "all";
|
|
173
|
+
location: "location";
|
|
174
|
+
}>>;
|
|
157
175
|
}, z.core.$strip>>;
|
|
158
176
|
}, z.core.$strip>, z.ZodObject<{
|
|
159
177
|
type: z.ZodEnum<{
|
|
@@ -170,6 +188,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
170
188
|
all: "all";
|
|
171
189
|
location: "location";
|
|
172
190
|
}>>;
|
|
191
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
192
|
+
user: "user";
|
|
193
|
+
}>>;
|
|
194
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
195
|
+
administrativeArea: "administrativeArea";
|
|
196
|
+
all: "all";
|
|
197
|
+
location: "location";
|
|
198
|
+
}>>;
|
|
173
199
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
174
200
|
administrativeArea: "administrativeArea";
|
|
175
201
|
all: "all";
|
|
@@ -210,6 +236,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
210
236
|
all: "all";
|
|
211
237
|
location: "location";
|
|
212
238
|
}>>;
|
|
239
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
240
|
+
user: "user";
|
|
241
|
+
}>>;
|
|
242
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
243
|
+
administrativeArea: "administrativeArea";
|
|
244
|
+
all: "all";
|
|
245
|
+
location: "location";
|
|
246
|
+
}>>;
|
|
213
247
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
214
248
|
administrativeArea: "administrativeArea";
|
|
215
249
|
all: "all";
|
|
@@ -274,6 +308,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
274
308
|
all: "all";
|
|
275
309
|
location: "location";
|
|
276
310
|
}>>;
|
|
311
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
312
|
+
user: "user";
|
|
313
|
+
}>>;
|
|
314
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
315
|
+
administrativeArea: "administrativeArea";
|
|
316
|
+
all: "all";
|
|
317
|
+
location: "location";
|
|
318
|
+
}>>;
|
|
277
319
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
278
320
|
administrativeArea: "administrativeArea";
|
|
279
321
|
all: "all";
|
|
@@ -339,6 +381,14 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
339
381
|
all: "all";
|
|
340
382
|
location: "location";
|
|
341
383
|
}>>;
|
|
384
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
385
|
+
user: "user";
|
|
386
|
+
}>>;
|
|
387
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
388
|
+
administrativeArea: "administrativeArea";
|
|
389
|
+
all: "all";
|
|
390
|
+
location: "location";
|
|
391
|
+
}>>;
|
|
342
392
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
343
393
|
administrativeArea: "administrativeArea";
|
|
344
394
|
all: "all";
|
|
@@ -467,6 +517,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
467
517
|
options: z.ZodOptional<z.ZodObject<{
|
|
468
518
|
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
469
519
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
520
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
521
|
+
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
470
522
|
}, z.core.$strip>>;
|
|
471
523
|
}, z.core.$strip>, z.ZodObject<{
|
|
472
524
|
type: z.ZodEnum<{
|
|
@@ -479,6 +531,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
479
531
|
options: z.ZodOptional<z.ZodObject<{
|
|
480
532
|
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
481
533
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
534
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
535
|
+
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
482
536
|
notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
483
537
|
notifiedBy: z.ZodOptional<z.ZodString>;
|
|
484
538
|
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -496,6 +550,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
496
550
|
options: z.ZodOptional<z.ZodObject<{
|
|
497
551
|
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
498
552
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
553
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
554
|
+
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
499
555
|
notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
500
556
|
notifiedBy: z.ZodOptional<z.ZodString>;
|
|
501
557
|
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -531,6 +587,8 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
531
587
|
options: z.ZodOptional<z.ZodObject<{
|
|
532
588
|
event: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
533
589
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
590
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
591
|
+
createdIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
534
592
|
notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
535
593
|
notifiedBy: z.ZodOptional<z.ZodString>;
|
|
536
594
|
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -598,6 +656,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
598
656
|
all: "all";
|
|
599
657
|
location: "location";
|
|
600
658
|
}>>;
|
|
659
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
660
|
+
user: "user";
|
|
661
|
+
}>>;
|
|
662
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
663
|
+
administrativeArea: "administrativeArea";
|
|
664
|
+
all: "all";
|
|
665
|
+
location: "location";
|
|
666
|
+
}>>;
|
|
601
667
|
}, z.core.$strip>>;
|
|
602
668
|
}, z.core.$strip>, z.ZodObject<{
|
|
603
669
|
type: z.ZodEnum<{
|
|
@@ -614,6 +680,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
614
680
|
all: "all";
|
|
615
681
|
location: "location";
|
|
616
682
|
}>>;
|
|
683
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
684
|
+
user: "user";
|
|
685
|
+
}>>;
|
|
686
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
687
|
+
administrativeArea: "administrativeArea";
|
|
688
|
+
all: "all";
|
|
689
|
+
location: "location";
|
|
690
|
+
}>>;
|
|
617
691
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
618
692
|
administrativeArea: "administrativeArea";
|
|
619
693
|
all: "all";
|
|
@@ -654,6 +728,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
654
728
|
all: "all";
|
|
655
729
|
location: "location";
|
|
656
730
|
}>>;
|
|
731
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
732
|
+
user: "user";
|
|
733
|
+
}>>;
|
|
734
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
735
|
+
administrativeArea: "administrativeArea";
|
|
736
|
+
all: "all";
|
|
737
|
+
location: "location";
|
|
738
|
+
}>>;
|
|
657
739
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
658
740
|
administrativeArea: "administrativeArea";
|
|
659
741
|
all: "all";
|
|
@@ -718,6 +800,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
718
800
|
all: "all";
|
|
719
801
|
location: "location";
|
|
720
802
|
}>>;
|
|
803
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
804
|
+
user: "user";
|
|
805
|
+
}>>;
|
|
806
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
807
|
+
administrativeArea: "administrativeArea";
|
|
808
|
+
all: "all";
|
|
809
|
+
location: "location";
|
|
810
|
+
}>>;
|
|
721
811
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
722
812
|
administrativeArea: "administrativeArea";
|
|
723
813
|
all: "all";
|
|
@@ -783,6 +873,14 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
783
873
|
all: "all";
|
|
784
874
|
location: "location";
|
|
785
875
|
}>>;
|
|
876
|
+
createdBy: z.ZodOptional<z.ZodEnum<{
|
|
877
|
+
user: "user";
|
|
878
|
+
}>>;
|
|
879
|
+
createdIn: z.ZodOptional<z.ZodEnum<{
|
|
880
|
+
administrativeArea: "administrativeArea";
|
|
881
|
+
all: "all";
|
|
882
|
+
location: "location";
|
|
883
|
+
}>>;
|
|
786
884
|
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
787
885
|
administrativeArea: "administrativeArea";
|
|
788
886
|
all: "all";
|
|
@@ -952,12 +1050,16 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
952
1050
|
options?: {
|
|
953
1051
|
event?: string[] | undefined;
|
|
954
1052
|
placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
|
|
1053
|
+
createdBy?: "user" | undefined;
|
|
1054
|
+
createdIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
955
1055
|
} | undefined;
|
|
956
1056
|
} | {
|
|
957
1057
|
type: "record.archive" | "record.edit" | "record.register" | "record.reject" | "record.unarchive";
|
|
958
1058
|
options?: {
|
|
959
1059
|
event?: string[] | undefined;
|
|
960
1060
|
placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
|
|
1061
|
+
createdBy?: "user" | undefined;
|
|
1062
|
+
createdIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
961
1063
|
notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
962
1064
|
notifiedBy?: "user" | undefined;
|
|
963
1065
|
declaredIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
@@ -969,6 +1071,8 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
969
1071
|
options?: {
|
|
970
1072
|
event?: string[] | undefined;
|
|
971
1073
|
placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
|
|
1074
|
+
createdBy?: "user" | undefined;
|
|
1075
|
+
createdIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
972
1076
|
notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
973
1077
|
notifiedBy?: "user" | undefined;
|
|
974
1078
|
declaredIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
@@ -987,6 +1091,8 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
987
1091
|
options?: {
|
|
988
1092
|
event?: string[] | undefined;
|
|
989
1093
|
placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
|
|
1094
|
+
createdBy?: "user" | undefined;
|
|
1095
|
+
createdIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
990
1096
|
notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
991
1097
|
notifiedBy?: "user" | undefined;
|
|
992
1098
|
declaredIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
@@ -1006,6 +1112,8 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
1006
1112
|
options?: {
|
|
1007
1113
|
event?: string[] | undefined;
|
|
1008
1114
|
placeOfEvent?: "administrativeArea" | "all" | "location" | undefined;
|
|
1115
|
+
createdBy?: "user" | undefined;
|
|
1116
|
+
createdIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
1009
1117
|
notifiedIn?: "administrativeArea" | "all" | "location" | undefined;
|
|
1010
1118
|
notifiedBy?: "user" | undefined;
|
|
1011
1119
|
declaredIn?: "administrativeArea" | "all" | "location" | undefined;
|
package/dist/scopes/index.js
CHANGED
|
@@ -415,7 +415,9 @@ var userRole = z8.preprocess(
|
|
|
415
415
|
).describe("User role, e.g. admin, field agent");
|
|
416
416
|
var scopeOptionsPlaceEvent = z8.object({
|
|
417
417
|
event: scopeByEvent,
|
|
418
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
418
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
419
|
+
createdBy: UserFilter.optional(),
|
|
420
|
+
createdIn: JurisdictionFilter.optional()
|
|
419
421
|
}).describe("Options applicable to all record scopes.");
|
|
420
422
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
421
423
|
notifiedIn: JurisdictionFilter.optional(),
|
|
@@ -458,7 +460,9 @@ var AllScopeOptions = z8.object({
|
|
|
458
460
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
459
461
|
var ResolvedScopeOptionsPlaceEvent = z8.object({
|
|
460
462
|
event: scopeByEvent,
|
|
461
|
-
placeOfEvent: UUID.nullish()
|
|
463
|
+
placeOfEvent: UUID.nullish(),
|
|
464
|
+
createdBy: z8.string().optional(),
|
|
465
|
+
createdIn: UUID.nullish()
|
|
462
466
|
}).describe(
|
|
463
467
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
464
468
|
);
|
|
@@ -14,6 +14,8 @@ export declare function check(cwd: string): CheckResult;
|
|
|
14
14
|
/**
|
|
15
15
|
* Adds a row per missing message, filling in only English — the rest is copy
|
|
16
16
|
* somebody has to write. Returns the ids added.
|
|
17
|
+
*
|
|
18
|
+
* Creates countryconfig.csv if it doesn't exist yet.
|
|
17
19
|
*/
|
|
18
20
|
export declare function writeMissing(cwd: string, missing: Message[]): string[];
|
|
19
21
|
//# sourceMappingURL=check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/translations/check.ts"],"names":[],"mappings":"AAwCA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAgED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAyB9C;AAED
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/translations/check.ts"],"names":[],"mappings":"AAwCA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAgED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAyB9C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAwB3D"}
|
|
@@ -107,12 +107,17 @@ function check(cwd) {
|
|
|
107
107
|
/**
|
|
108
108
|
* Adds a row per missing message, filling in only English — the rest is copy
|
|
109
109
|
* somebody has to write. Returns the ids added.
|
|
110
|
+
*
|
|
111
|
+
* Creates countryconfig.csv if it doesn't exist yet.
|
|
110
112
|
*/
|
|
111
113
|
function writeMissing(cwd, missing) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
var _a;
|
|
115
|
+
const file = (_a = (0, csv_1.readCsvFile)(path_1.default.join(cwd, OWN_FILE))) !== null && _a !== void 0 ? _a : {
|
|
116
|
+
header: 'id,description,en',
|
|
117
|
+
body: [],
|
|
118
|
+
newline: '\n',
|
|
119
|
+
trailingNewline: true
|
|
120
|
+
};
|
|
116
121
|
const columns = file.header.split(',');
|
|
117
122
|
const rows = missing.map((message) => (0, csv_1.toCsvLine)(columns.map((column) => {
|
|
118
123
|
if (column === 'id')
|
package/dist/verify/endpoints.js
CHANGED
|
@@ -231,7 +231,7 @@ function securedDetail(status) {
|
|
|
231
231
|
if (status === 'error') {
|
|
232
232
|
return `${describeStatus(status)} — request failed`;
|
|
233
233
|
}
|
|
234
|
-
return `${describeStatus(status)} — INSECURE:
|
|
234
|
+
return `${describeStatus(status)} — INSECURE: ensure this endpoint requires authentication!`;
|
|
235
235
|
}
|
|
236
236
|
function runVerifyEndpoints() {
|
|
237
237
|
return __awaiter(this, arguments, void 0, function* (target = DEFAULT_TARGET_URL) {
|
|
Binary file
|