@opencrvs/toolkit 1.9.12-rc.f5ca5e6 → 1.9.12-rc.f77e9ca
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/build.sh +8 -0
- package/dist/application-config/index.js +2045 -41
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3237 -0
- package/dist/commons/api/router.d.ts +423 -191
- package/dist/commons/application-config/index.d.ts +13 -16
- package/dist/commons/conditionals/conditionals.d.ts +8 -8
- package/dist/commons/events/ActionDocument.d.ts +196 -196
- package/dist/commons/events/ActionInput.d.ts +113 -113
- package/dist/commons/events/ActionType.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/AuditLog.d.ts +345 -163
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/CountryConfigQueryInput.d.ts +461 -190
- package/dist/commons/events/Draft.d.ts +9 -9
- package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
- package/dist/commons/events/EventDocument.d.ts +80 -80
- package/dist/commons/events/EventIndex.d.ts +35 -27
- package/dist/commons/events/EventInput.d.ts +1 -1
- package/dist/commons/events/EventMetadata.d.ts +19 -19
- package/dist/commons/events/FieldConfig.d.ts +285 -69
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +98 -72
- package/dist/commons/events/FieldValue.d.ts +54 -26
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +7 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +443 -199
- package/dist/commons/events/defineConfig.d.ts +0 -4
- package/dist/commons/events/locations.d.ts +4 -4
- package/dist/commons/events/scopes.d.ts +4 -3
- package/dist/commons/events/state/index.d.ts +2 -2
- package/dist/commons/events/state/utils.d.ts +1 -1
- package/dist/commons/events/test.utils.d.ts +2 -2
- package/dist/commons/events/utils.d.ts +3 -175
- package/dist/commons/notification/UserNotifications.d.ts +6 -1
- package/dist/conditionals/index.js +74 -359
- package/dist/events/index.js +1197 -1263
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +829 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
- package/dist/migrations/v2.0/index.d.ts +7 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -0
- package/dist/migrations/v2.0/index.js +3176 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-scopes.js +282 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +237 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-demo-scope.js +75 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.js +78 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-api-paths.js +188 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
- package/dist/notification/index.js +1003 -1134
- package/dist/scopes/index.d.ts +389 -152
- package/dist/scopes/index.js +128 -322
- package/opencrvs-toolkit-1.9.12-rc.f77e9ca.tgz +0 -0
- package/package.json +11 -7
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-1.9.12-rc.f5ca5e6.tgz +0 -0
|
@@ -38,7 +38,7 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var
|
|
41
|
+
var z45 = __toESM(require("zod/v4"));
|
|
42
42
|
|
|
43
43
|
// ../commons/src/url.ts
|
|
44
44
|
function joinUrl(base, path) {
|
|
@@ -47,111 +47,231 @@ function joinUrl(base, path) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// ../commons/src/events/AuditLog.ts
|
|
50
|
+
var z5 = __toESM(require("zod/v4"));
|
|
51
|
+
|
|
52
|
+
// ../commons/src/authentication.ts
|
|
53
|
+
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
54
|
+
var z3 = __toESM(require("zod/v4"));
|
|
55
|
+
|
|
56
|
+
// ../commons/src/scopes.ts
|
|
57
|
+
var z2 = __toESM(require("zod/v4"));
|
|
58
|
+
var qs = __toESM(require("qs"));
|
|
59
|
+
|
|
60
|
+
// ../commons/src/uuid.ts
|
|
61
|
+
var import_uuid = require("uuid");
|
|
50
62
|
var z = __toESM(require("zod/v4"));
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
63
|
+
var UUID = z.uuid().brand("UUID");
|
|
64
|
+
function getUUID() {
|
|
65
|
+
return (0, import_uuid.v4)();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ../commons/src/scopes.ts
|
|
69
|
+
var JurisdictionFilter = z2.enum(["administrativeArea", "location", "all"]).describe(
|
|
70
|
+
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
71
|
+
);
|
|
72
|
+
var UserFilter = z2.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
73
|
+
var RecordScopeTypeV2 = z2.enum([
|
|
74
|
+
"record.search",
|
|
75
|
+
"record.create",
|
|
76
|
+
"record.read",
|
|
77
|
+
"record.declare",
|
|
78
|
+
"record.notify",
|
|
79
|
+
"record.edit",
|
|
80
|
+
"record.reject",
|
|
81
|
+
"record.archive",
|
|
82
|
+
"record.review-duplicates",
|
|
83
|
+
"record.register",
|
|
84
|
+
"record.print-certified-copies",
|
|
85
|
+
"record.request-correction",
|
|
86
|
+
"record.correct",
|
|
87
|
+
"record.unassign-others",
|
|
88
|
+
"record.custom-action"
|
|
89
|
+
]);
|
|
90
|
+
var PlainScopeType = z2.enum([
|
|
91
|
+
// Misc. system scopes
|
|
92
|
+
"bypassratelimit",
|
|
93
|
+
"record.reindex",
|
|
94
|
+
"user.data-seeding",
|
|
95
|
+
"integration.create",
|
|
96
|
+
"record.import",
|
|
97
|
+
"config.update-all",
|
|
98
|
+
"attachment.upload",
|
|
99
|
+
"profile.electronic-signature",
|
|
100
|
+
"user.read-only-my-audit",
|
|
101
|
+
// Performance dashboard
|
|
102
|
+
"performance.read",
|
|
103
|
+
"performance.read-dashboards",
|
|
104
|
+
"performance.vital-statistics-export",
|
|
105
|
+
// Scopes used exclusively by countryconfig integration token
|
|
106
|
+
"record.confirm-registration",
|
|
107
|
+
"record.reject-registration"
|
|
108
|
+
]);
|
|
109
|
+
var scopeByEvent = z2.preprocess(
|
|
110
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
111
|
+
z2.array(z2.string()).optional()
|
|
112
|
+
).describe("Event type, e.g. birth, death");
|
|
113
|
+
var scopeOptionsPlaceEvent = z2.object({
|
|
114
|
+
event: scopeByEvent,
|
|
115
|
+
placeOfEvent: JurisdictionFilter.optional()
|
|
116
|
+
}).describe("Options applicable to all record scopes.");
|
|
117
|
+
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
118
|
+
declaredIn: JurisdictionFilter.optional(),
|
|
119
|
+
declaredBy: UserFilter.optional()
|
|
120
|
+
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
121
|
+
var AllRecordScopeOptions = scopeOptionsDeclared.extend({
|
|
122
|
+
registeredIn: JurisdictionFilter.optional(),
|
|
123
|
+
registeredBy: UserFilter.optional()
|
|
124
|
+
}).describe(
|
|
125
|
+
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
126
|
+
);
|
|
127
|
+
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
128
|
+
customActionTypes: z2.preprocess(
|
|
129
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
130
|
+
z2.array(z2.string()).optional()
|
|
131
|
+
).describe("Allowed custom action types")
|
|
132
|
+
});
|
|
133
|
+
var AccessLevelOptions = z2.object({
|
|
134
|
+
accessLevel: JurisdictionFilter.optional()
|
|
135
|
+
});
|
|
136
|
+
var WorkqueueOrDashboardOptions = z2.object({
|
|
137
|
+
ids: z2.preprocess(
|
|
138
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
139
|
+
z2.array(z2.string())
|
|
140
|
+
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
141
|
+
});
|
|
142
|
+
var AllScopeOptions = z2.object({
|
|
143
|
+
...AllRecordScopeOptions.shape,
|
|
144
|
+
...AccessLevelOptions.shape,
|
|
145
|
+
...WorkqueueOrDashboardOptions.shape
|
|
146
|
+
});
|
|
147
|
+
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
148
|
+
var ResolvedScopeOptionsPlaceEvent = z2.object({
|
|
149
|
+
event: scopeByEvent,
|
|
150
|
+
placeOfEvent: UUID.nullish()
|
|
151
|
+
}).describe(
|
|
152
|
+
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
153
|
+
);
|
|
154
|
+
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
155
|
+
declaredIn: UUID.nullish(),
|
|
156
|
+
declaredBy: z2.string().optional()
|
|
157
|
+
}).describe(
|
|
158
|
+
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
159
|
+
);
|
|
160
|
+
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
161
|
+
registeredIn: UUID.nullish(),
|
|
162
|
+
registeredBy: z2.string().optional()
|
|
163
|
+
}).describe(
|
|
164
|
+
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
165
|
+
);
|
|
166
|
+
var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
|
|
167
|
+
"record.create",
|
|
168
|
+
"record.declare",
|
|
169
|
+
"record.notify"
|
|
170
|
+
]);
|
|
171
|
+
var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
172
|
+
"record.edit",
|
|
173
|
+
"record.reject",
|
|
174
|
+
"record.archive",
|
|
175
|
+
"record.review-duplicates",
|
|
176
|
+
"record.register"
|
|
177
|
+
]);
|
|
178
|
+
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
179
|
+
"record.search",
|
|
180
|
+
"record.read",
|
|
181
|
+
"record.request-correction",
|
|
182
|
+
"record.correct",
|
|
183
|
+
"record.unassign-others"
|
|
184
|
+
]);
|
|
185
|
+
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
186
|
+
templates: z2.preprocess(
|
|
187
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
188
|
+
z2.array(z2.string()).optional()
|
|
189
|
+
).describe(
|
|
190
|
+
"Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
|
|
191
|
+
)
|
|
192
|
+
});
|
|
193
|
+
var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
194
|
+
z2.object({
|
|
195
|
+
type: ScopesWithPlaceEventOptions,
|
|
196
|
+
options: scopeOptionsPlaceEvent.optional()
|
|
88
197
|
}),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
responseSummary: z.object({})
|
|
198
|
+
z2.object({
|
|
199
|
+
type: ScopesWithDeclaredOptions,
|
|
200
|
+
options: scopeOptionsDeclared.optional()
|
|
93
201
|
}),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
responseSummary: z.object({})
|
|
202
|
+
z2.object({
|
|
203
|
+
type: ScopesWithFullOptions,
|
|
204
|
+
options: AllRecordScopeOptions.optional()
|
|
98
205
|
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
responseSummary: z.object({})
|
|
206
|
+
z2.object({
|
|
207
|
+
type: z2.literal("record.custom-action"),
|
|
208
|
+
options: CustomActionScopeOptions.optional()
|
|
103
209
|
}),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
210
|
+
z2.object({
|
|
211
|
+
type: z2.literal("record.print-certified-copies"),
|
|
212
|
+
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
213
|
+
})
|
|
214
|
+
]).describe(
|
|
215
|
+
"Scopes used to check user's permission to perform actions on a record."
|
|
216
|
+
);
|
|
217
|
+
var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
|
|
218
|
+
z2.object({
|
|
219
|
+
type: ScopesWithPlaceEventOptions,
|
|
220
|
+
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
108
221
|
}),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
responseSummary: z.object({})
|
|
222
|
+
z2.object({
|
|
223
|
+
type: ScopesWithDeclaredOptions,
|
|
224
|
+
options: ResolvedScopeOptionsDeclared.optional()
|
|
113
225
|
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
responseSummary: z.object({ phoneNumber: z.string() })
|
|
226
|
+
z2.object({
|
|
227
|
+
type: ScopesWithFullOptions,
|
|
228
|
+
options: ResolvedScopeOptionsFull.optional()
|
|
118
229
|
}),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
230
|
+
z2.object({
|
|
231
|
+
type: z2.literal("record.print-certified-copies"),
|
|
232
|
+
options: ResolvedScopeOptionsFull.extend({
|
|
233
|
+
templates: z2.array(z2.string()).optional()
|
|
234
|
+
}).optional()
|
|
235
|
+
})
|
|
236
|
+
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
237
|
+
var SystemScopeType = z2.enum([
|
|
238
|
+
"organisation.read-locations",
|
|
239
|
+
"user.read",
|
|
240
|
+
"user.create",
|
|
241
|
+
"user.edit"
|
|
242
|
+
]);
|
|
243
|
+
var Scope = z2.discriminatedUnion("type", [
|
|
244
|
+
z2.object({ type: PlainScopeType }),
|
|
245
|
+
...RecordScopeV2.options,
|
|
246
|
+
z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
247
|
+
z2.object({
|
|
248
|
+
type: z2.literal("workqueue"),
|
|
249
|
+
options: WorkqueueOrDashboardOptions
|
|
123
250
|
}),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
responseSummary: z.object({})
|
|
251
|
+
z2.object({
|
|
252
|
+
type: z2.literal("dashboard.view"),
|
|
253
|
+
options: WorkqueueOrDashboardOptions
|
|
128
254
|
})
|
|
129
255
|
]);
|
|
256
|
+
var ScopeType = z2.enum([
|
|
257
|
+
...SystemScopeType.options,
|
|
258
|
+
...RecordScopeTypeV2.options,
|
|
259
|
+
...PlainScopeType.options,
|
|
260
|
+
"workqueue",
|
|
261
|
+
"dashboard.view"
|
|
262
|
+
]);
|
|
263
|
+
var EncodedScope = z2.string().brand("EncodedScope");
|
|
264
|
+
var DEFAULT_SCOPE_OPTIONS = {
|
|
265
|
+
placeOfEvent: JurisdictionFilter.enum.all,
|
|
266
|
+
accessLevel: JurisdictionFilter.enum.all
|
|
267
|
+
};
|
|
130
268
|
|
|
131
|
-
// ../commons/src/
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
// ../commons/src/events/ActionConfig.ts
|
|
136
|
-
var z25 = __toESM(require("zod/v4"));
|
|
137
|
-
|
|
138
|
-
// ../commons/src/events/TranslationConfig.ts
|
|
139
|
-
var z2 = __toESM(require("zod/v4"));
|
|
140
|
-
var TranslationConfig = z2.object({
|
|
141
|
-
id: z2.string().describe(
|
|
142
|
-
"The identifier of the translation referred in translation CSV files"
|
|
143
|
-
),
|
|
144
|
-
defaultMessage: z2.string().describe("Default translation message"),
|
|
145
|
-
description: z2.string().describe(
|
|
146
|
-
"Describe the translation for a translator to be able to identify it."
|
|
147
|
-
)
|
|
148
|
-
}).meta({
|
|
149
|
-
description: "Translation configuration",
|
|
150
|
-
id: "TranslationConfig"
|
|
151
|
-
});
|
|
269
|
+
// ../commons/src/authentication.ts
|
|
270
|
+
var TokenUserType = z3.enum(["user", "system"]);
|
|
271
|
+
var TokenWithBearer = z3.string().regex(/^Bearer\s/);
|
|
152
272
|
|
|
153
273
|
// ../commons/src/events/ActionType.ts
|
|
154
|
-
var
|
|
274
|
+
var z4 = __toESM(require("zod/v4"));
|
|
155
275
|
var ActionType = {
|
|
156
276
|
// Pre-declaration actions
|
|
157
277
|
DELETE: "DELETE",
|
|
@@ -193,7 +313,7 @@ var ConfirmableActions = [
|
|
|
193
313
|
ActionType.REJECT_CORRECTION,
|
|
194
314
|
ActionType.CUSTOM
|
|
195
315
|
];
|
|
196
|
-
var ActionTypes =
|
|
316
|
+
var ActionTypes = z4.enum([
|
|
197
317
|
"DELETE",
|
|
198
318
|
"CREATE",
|
|
199
319
|
"NOTIFY",
|
|
@@ -257,12 +377,225 @@ var META_ACTIONS = [
|
|
|
257
377
|
ActionType.READ
|
|
258
378
|
];
|
|
259
379
|
|
|
380
|
+
// ../commons/src/events/AuditLog.ts
|
|
381
|
+
var AuditLogEntryBase = z5.object({
|
|
382
|
+
id: z5.string(),
|
|
383
|
+
clientId: z5.string(),
|
|
384
|
+
clientType: TokenUserType,
|
|
385
|
+
createdAt: z5.string()
|
|
386
|
+
});
|
|
387
|
+
var EventCreateEntrySchema = AuditLogEntryBase.extend({
|
|
388
|
+
operation: z5.literal("event.create"),
|
|
389
|
+
requestData: z5.object({
|
|
390
|
+
transactionId: z5.string(),
|
|
391
|
+
type: z5.string(),
|
|
392
|
+
createdAtLocation: z5.string().nullable()
|
|
393
|
+
}),
|
|
394
|
+
responseSummary: z5.object({
|
|
395
|
+
eventId: z5.string(),
|
|
396
|
+
trackingId: z5.string()
|
|
397
|
+
})
|
|
398
|
+
});
|
|
399
|
+
var EventGetEntrySchema = AuditLogEntryBase.extend({
|
|
400
|
+
operation: z5.literal("event.get"),
|
|
401
|
+
requestData: z5.object({ eventId: z5.string() }),
|
|
402
|
+
responseSummary: z5.object({
|
|
403
|
+
eventType: z5.string(),
|
|
404
|
+
trackingId: z5.string()
|
|
405
|
+
})
|
|
406
|
+
});
|
|
407
|
+
var EventSearchEntrySchema = AuditLogEntryBase.extend({
|
|
408
|
+
operation: z5.literal("event.search"),
|
|
409
|
+
clientType: z5.literal("system"),
|
|
410
|
+
requestData: z5.object({
|
|
411
|
+
query: z5.record(z5.string(), z5.unknown()).nullable(),
|
|
412
|
+
limit: z5.number().nullable(),
|
|
413
|
+
offset: z5.number().nullable()
|
|
414
|
+
}),
|
|
415
|
+
responseSummary: z5.object({
|
|
416
|
+
total: z5.number(),
|
|
417
|
+
eventIds: z5.array(z5.string())
|
|
418
|
+
})
|
|
419
|
+
});
|
|
420
|
+
var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
421
|
+
operation: z5.enum([
|
|
422
|
+
"event.actions.notify.request",
|
|
423
|
+
"event.actions.declare.request",
|
|
424
|
+
"event.actions.register.request",
|
|
425
|
+
"event.actions.reject.request",
|
|
426
|
+
"event.actions.validate.request",
|
|
427
|
+
"event.actions.edit.request",
|
|
428
|
+
"event.actions.assign.request",
|
|
429
|
+
"event.actions.unassign.request",
|
|
430
|
+
"event.actions.read.request",
|
|
431
|
+
"event.actions.archive.request",
|
|
432
|
+
"event.actions.reinstate.request",
|
|
433
|
+
"event.actions.print_certificate.request",
|
|
434
|
+
"event.actions.correction.request.request",
|
|
435
|
+
"event.actions.correction.approve.request",
|
|
436
|
+
"event.actions.correction.reject.request",
|
|
437
|
+
"event.actions.mark_as_duplicate.request",
|
|
438
|
+
"event.actions.mark_as_not_duplicate.request"
|
|
439
|
+
]),
|
|
440
|
+
requestData: z5.object({
|
|
441
|
+
eventId: z5.string(),
|
|
442
|
+
actionType: z5.string(),
|
|
443
|
+
eventType: z5.string(),
|
|
444
|
+
trackingId: z5.string(),
|
|
445
|
+
transactionId: z5.string()
|
|
446
|
+
})
|
|
447
|
+
});
|
|
448
|
+
var EventCustomActionEntrySchema = AuditLogEntryBase.extend({
|
|
449
|
+
operation: z5.literal("event.actions.custom.request"),
|
|
450
|
+
requestData: z5.object({
|
|
451
|
+
eventId: z5.string(),
|
|
452
|
+
actionType: z5.literal(ActionType.CUSTOM),
|
|
453
|
+
customAction: z5.string(),
|
|
454
|
+
eventType: z5.string(),
|
|
455
|
+
trackingId: z5.string(),
|
|
456
|
+
transactionId: z5.string()
|
|
457
|
+
})
|
|
458
|
+
});
|
|
459
|
+
var IntegrationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
460
|
+
operation: z5.literal("integrations.create"),
|
|
461
|
+
requestData: z5.object({ name: z5.string(), scopes: z5.array(z5.string()) }),
|
|
462
|
+
responseSummary: z5.object({ clientId: z5.string() })
|
|
463
|
+
});
|
|
464
|
+
var IntegrationRefreshTokenEntrySchema = AuditLogEntryBase.extend({
|
|
465
|
+
operation: z5.literal("integrations.refreshToken"),
|
|
466
|
+
requestData: z5.object({ clientId: z5.string() }),
|
|
467
|
+
responseSummary: z5.object({ clientId: z5.string() })
|
|
468
|
+
});
|
|
469
|
+
var IntegrationDeactivateEntrySchema = AuditLogEntryBase.extend({
|
|
470
|
+
operation: z5.literal("integrations.deactivate"),
|
|
471
|
+
requestData: z5.object({ id: z5.string() }),
|
|
472
|
+
responseSummary: z5.object({ id: z5.string(), status: z5.string() })
|
|
473
|
+
});
|
|
474
|
+
var IntegrationActivateEntrySchema = AuditLogEntryBase.extend({
|
|
475
|
+
operation: z5.literal("integrations.activate"),
|
|
476
|
+
requestData: z5.object({ id: z5.string() }),
|
|
477
|
+
responseSummary: z5.object({ id: z5.string(), status: z5.string() })
|
|
478
|
+
});
|
|
479
|
+
var IntegrationDeleteEntrySchema = AuditLogEntryBase.extend({
|
|
480
|
+
operation: z5.literal("integrations.delete"),
|
|
481
|
+
requestData: z5.object({ id: z5.string() }),
|
|
482
|
+
responseSummary: z5.object({ id: z5.string(), name: z5.string() })
|
|
483
|
+
});
|
|
484
|
+
var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
485
|
+
operation: z5.literal("integrations.refreshSecret"),
|
|
486
|
+
requestData: z5.object({ id: z5.string() }),
|
|
487
|
+
responseSummary: z5.object({ clientId: z5.string() })
|
|
488
|
+
});
|
|
489
|
+
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
490
|
+
operation: z5.literal("attachments.upload"),
|
|
491
|
+
requestData: z5.object({
|
|
492
|
+
transactionId: z5.string(),
|
|
493
|
+
path: z5.string().nullable()
|
|
494
|
+
}),
|
|
495
|
+
responseSummary: z5.object({ fileUrl: z5.string() })
|
|
496
|
+
});
|
|
497
|
+
var subjectOnly = z5.object({ subjectId: z5.string() });
|
|
498
|
+
var subjectWithReason = z5.object({
|
|
499
|
+
subjectId: z5.string(),
|
|
500
|
+
reason: z5.string(),
|
|
501
|
+
comment: z5.string().optional()
|
|
502
|
+
});
|
|
503
|
+
var UserCreateEntrySchema = AuditLogEntryBase.extend({
|
|
504
|
+
operation: z5.literal("user.create_user"),
|
|
505
|
+
requestData: z5.object({
|
|
506
|
+
subjectId: z5.string(),
|
|
507
|
+
role: z5.string(),
|
|
508
|
+
primaryOfficeId: z5.string()
|
|
509
|
+
})
|
|
510
|
+
});
|
|
511
|
+
var UserReasonEntrySchema = AuditLogEntryBase.extend({
|
|
512
|
+
operation: z5.enum(["user.deactivate", "user.reactivate"]),
|
|
513
|
+
requestData: subjectWithReason
|
|
514
|
+
});
|
|
515
|
+
var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
516
|
+
operation: z5.enum([
|
|
517
|
+
"user.edit_user",
|
|
518
|
+
"user.logged_in",
|
|
519
|
+
"user.logged_out",
|
|
520
|
+
"user.password_changed",
|
|
521
|
+
"user.password_reset",
|
|
522
|
+
"user.password_reset_by_admin",
|
|
523
|
+
"user.username_reminder",
|
|
524
|
+
"user.username_reminder_by_admin"
|
|
525
|
+
]),
|
|
526
|
+
requestData: subjectOnly
|
|
527
|
+
});
|
|
528
|
+
var UserEmailChangedEntrySchema = AuditLogEntryBase.extend({
|
|
529
|
+
operation: z5.literal("user.email_address_changed"),
|
|
530
|
+
requestData: subjectOnly,
|
|
531
|
+
responseSummary: z5.object({ email: z5.string() })
|
|
532
|
+
});
|
|
533
|
+
var UserPhoneChangedEntrySchema = AuditLogEntryBase.extend({
|
|
534
|
+
operation: z5.literal("user.phone_number_changed"),
|
|
535
|
+
requestData: subjectOnly,
|
|
536
|
+
responseSummary: z5.object({ phoneNumber: z5.string() })
|
|
537
|
+
});
|
|
538
|
+
var userBaseOmit = {
|
|
539
|
+
id: true,
|
|
540
|
+
clientId: true,
|
|
541
|
+
clientType: true,
|
|
542
|
+
createdAt: true
|
|
543
|
+
};
|
|
544
|
+
var UserAuditRecordInput = z5.discriminatedUnion("operation", [
|
|
545
|
+
UserCreateEntrySchema.omit(userBaseOmit),
|
|
546
|
+
UserReasonEntrySchema.omit(userBaseOmit),
|
|
547
|
+
UserSubjectOnlyEntrySchema.omit(userBaseOmit),
|
|
548
|
+
UserEmailChangedEntrySchema.omit(userBaseOmit),
|
|
549
|
+
UserPhoneChangedEntrySchema.omit(userBaseOmit)
|
|
550
|
+
]);
|
|
551
|
+
var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
|
|
552
|
+
EventCreateEntrySchema,
|
|
553
|
+
EventGetEntrySchema,
|
|
554
|
+
EventSearchEntrySchema,
|
|
555
|
+
EventActionEntrySchema,
|
|
556
|
+
EventCustomActionEntrySchema,
|
|
557
|
+
IntegrationCreateEntrySchema,
|
|
558
|
+
IntegrationRefreshTokenEntrySchema,
|
|
559
|
+
IntegrationDeactivateEntrySchema,
|
|
560
|
+
IntegrationActivateEntrySchema,
|
|
561
|
+
IntegrationDeleteEntrySchema,
|
|
562
|
+
IntegrationRefreshSecretEntrySchema,
|
|
563
|
+
AttachmentUploadEntrySchema,
|
|
564
|
+
UserCreateEntrySchema,
|
|
565
|
+
UserReasonEntrySchema,
|
|
566
|
+
UserSubjectOnlyEntrySchema,
|
|
567
|
+
UserEmailChangedEntrySchema,
|
|
568
|
+
UserPhoneChangedEntrySchema
|
|
569
|
+
]);
|
|
570
|
+
|
|
571
|
+
// ../commons/src/events/Constants.ts
|
|
572
|
+
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
573
|
+
var CHILD_ONBOARDING_EVENT = "child-onboarding";
|
|
574
|
+
|
|
575
|
+
// ../commons/src/events/ActionConfig.ts
|
|
576
|
+
var z24 = __toESM(require("zod/v4"));
|
|
577
|
+
|
|
578
|
+
// ../commons/src/events/TranslationConfig.ts
|
|
579
|
+
var z6 = __toESM(require("zod/v4"));
|
|
580
|
+
var TranslationConfig = z6.object({
|
|
581
|
+
id: z6.string().describe(
|
|
582
|
+
"The identifier of the translation referred in translation CSV files"
|
|
583
|
+
),
|
|
584
|
+
defaultMessage: z6.string().describe("Default translation message"),
|
|
585
|
+
description: z6.string().describe(
|
|
586
|
+
"Describe the translation for a translator to be able to identify it."
|
|
587
|
+
)
|
|
588
|
+
}).meta({
|
|
589
|
+
description: "Translation configuration",
|
|
590
|
+
id: "TranslationConfig"
|
|
591
|
+
});
|
|
592
|
+
|
|
260
593
|
// ../commons/src/events/FieldConfig.ts
|
|
261
594
|
var import_v43 = __toESM(require("zod/v4"));
|
|
262
595
|
|
|
263
596
|
// ../commons/src/events/Conditional.ts
|
|
264
|
-
var
|
|
265
|
-
var Conditional =
|
|
597
|
+
var z7 = __toESM(require("zod/v4"));
|
|
598
|
+
var Conditional = z7.any().describe("JSONSchema").meta({
|
|
266
599
|
description: "JSON schema conditional configuration",
|
|
267
600
|
id: "Conditional"
|
|
268
601
|
});
|
|
@@ -271,31 +604,31 @@ var ConditionalType = {
|
|
|
271
604
|
ENABLE: "ENABLE",
|
|
272
605
|
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
273
606
|
};
|
|
274
|
-
var ShowConditional =
|
|
275
|
-
type:
|
|
607
|
+
var ShowConditional = z7.object({
|
|
608
|
+
type: z7.literal(ConditionalType.SHOW),
|
|
276
609
|
conditional: Conditional
|
|
277
610
|
}).describe(
|
|
278
611
|
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
279
612
|
);
|
|
280
|
-
var EnableConditional =
|
|
281
|
-
type:
|
|
613
|
+
var EnableConditional = z7.object({
|
|
614
|
+
type: z7.literal(ConditionalType.ENABLE),
|
|
282
615
|
conditional: Conditional
|
|
283
616
|
}).describe(
|
|
284
617
|
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
285
618
|
);
|
|
286
|
-
var ActionConditional =
|
|
619
|
+
var ActionConditional = z7.discriminatedUnion("type", [
|
|
287
620
|
// Action can be shown / hidden
|
|
288
621
|
ShowConditional,
|
|
289
622
|
// Action can be shown to the user in the list but as disabled
|
|
290
623
|
EnableConditional
|
|
291
624
|
]);
|
|
292
|
-
var DisplayOnReviewConditional =
|
|
293
|
-
type:
|
|
625
|
+
var DisplayOnReviewConditional = z7.object({
|
|
626
|
+
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
294
627
|
conditional: Conditional
|
|
295
628
|
}).describe(
|
|
296
629
|
"If 'DISPLAY_ON_REVIEW' conditional is defined, the component is shown on the review page only if both the 'DISPLAY_ON_REVIEW' and 'SHOW' conditions are met. This should only be used for fields within declaration forms, as they are the only ones with review pages."
|
|
297
630
|
);
|
|
298
|
-
var FieldConditional =
|
|
631
|
+
var FieldConditional = z7.discriminatedUnion("type", [
|
|
299
632
|
// Field input can be shown / hidden
|
|
300
633
|
ShowConditional,
|
|
301
634
|
// Field input can be shown to the user but as disabled
|
|
@@ -308,7 +641,7 @@ var FieldConditional = z4.discriminatedUnion("type", [
|
|
|
308
641
|
});
|
|
309
642
|
|
|
310
643
|
// ../commons/src/events/FieldType.ts
|
|
311
|
-
var
|
|
644
|
+
var z8 = __toESM(require("zod/v4"));
|
|
312
645
|
var FieldType = {
|
|
313
646
|
NAME: "NAME",
|
|
314
647
|
PHONE: "PHONE",
|
|
@@ -348,6 +681,7 @@ var FieldType = {
|
|
|
348
681
|
SIGNATURE: "SIGNATURE",
|
|
349
682
|
DATA: "DATA",
|
|
350
683
|
BUTTON: "BUTTON",
|
|
684
|
+
AUTOCOMPLETE: "AUTOCOMPLETE",
|
|
351
685
|
SEARCH: "SEARCH",
|
|
352
686
|
ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON",
|
|
353
687
|
HTTP: "HTTP",
|
|
@@ -371,7 +705,7 @@ var FieldType = {
|
|
|
371
705
|
*/
|
|
372
706
|
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
373
707
|
};
|
|
374
|
-
var FileFieldType =
|
|
708
|
+
var FileFieldType = z8.enum([
|
|
375
709
|
FieldType.FILE,
|
|
376
710
|
FieldType.FILE_WITH_OPTIONS,
|
|
377
711
|
FieldType.SIGNATURE
|
|
@@ -402,154 +736,159 @@ var FieldTypesToHideInReview = [
|
|
|
402
736
|
];
|
|
403
737
|
|
|
404
738
|
// ../commons/src/events/FieldValue.ts
|
|
405
|
-
var
|
|
739
|
+
var z12 = __toESM(require("zod/v4"));
|
|
406
740
|
|
|
407
741
|
// ../commons/src/documents.ts
|
|
408
|
-
var
|
|
409
|
-
var FullDocumentUrl =
|
|
742
|
+
var z9 = __toESM(require("zod/v4"));
|
|
743
|
+
var FullDocumentUrl = z9.string().brand("FullDocumentUrl").describe(
|
|
410
744
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
|
|
411
745
|
);
|
|
412
|
-
var FullDocumentPath =
|
|
746
|
+
var FullDocumentPath = z9.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
413
747
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
414
748
|
);
|
|
415
|
-
var DocumentPath =
|
|
749
|
+
var DocumentPath = z9.string().brand("DocumentPath").describe(
|
|
416
750
|
"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
|
|
417
751
|
);
|
|
418
752
|
|
|
419
753
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
420
|
-
var
|
|
754
|
+
var z10 = __toESM(require("zod/v4"));
|
|
421
755
|
var AddressType = {
|
|
422
756
|
DOMESTIC: "DOMESTIC",
|
|
423
757
|
INTERNATIONAL: "INTERNATIONAL"
|
|
424
758
|
};
|
|
425
|
-
var FileFieldValue =
|
|
759
|
+
var FileFieldValue = z10.object({
|
|
426
760
|
path: DocumentPath,
|
|
427
|
-
originalFilename:
|
|
428
|
-
type:
|
|
429
|
-
});
|
|
430
|
-
var NameFieldValue =
|
|
431
|
-
firstname:
|
|
432
|
-
surname:
|
|
433
|
-
middlename:
|
|
434
|
-
});
|
|
435
|
-
var NameFieldUpdateValue =
|
|
436
|
-
firstname:
|
|
437
|
-
surname:
|
|
438
|
-
middlename:
|
|
439
|
-
}).or(
|
|
440
|
-
var StreetLevelDetailsValue =
|
|
441
|
-
var StreetLevelDetailsUpdateValue =
|
|
442
|
-
var BaseAddressFieldValue =
|
|
443
|
-
country:
|
|
761
|
+
originalFilename: z10.string(),
|
|
762
|
+
type: z10.string()
|
|
763
|
+
});
|
|
764
|
+
var NameFieldValue = z10.object({
|
|
765
|
+
firstname: z10.string(),
|
|
766
|
+
surname: z10.string(),
|
|
767
|
+
middlename: z10.string().optional()
|
|
768
|
+
});
|
|
769
|
+
var NameFieldUpdateValue = z10.object({
|
|
770
|
+
firstname: z10.string().nullish(),
|
|
771
|
+
surname: z10.string().nullish(),
|
|
772
|
+
middlename: z10.string().nullish()
|
|
773
|
+
}).or(z10.null()).or(z10.undefined());
|
|
774
|
+
var StreetLevelDetailsValue = z10.record(z10.string(), z10.string()).optional();
|
|
775
|
+
var StreetLevelDetailsUpdateValue = z10.record(z10.string(), z10.string().nullable()).nullish();
|
|
776
|
+
var BaseAddressFieldValue = z10.object({
|
|
777
|
+
country: z10.string(),
|
|
444
778
|
streetLevelDetails: StreetLevelDetailsValue
|
|
445
779
|
});
|
|
446
|
-
var BaseAddressFieldUpdateValue =
|
|
447
|
-
country:
|
|
780
|
+
var BaseAddressFieldUpdateValue = z10.object({
|
|
781
|
+
country: z10.string().nullish(),
|
|
448
782
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
449
783
|
});
|
|
450
784
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
451
|
-
addressType:
|
|
452
|
-
administrativeArea:
|
|
785
|
+
addressType: z10.literal(AddressType.DOMESTIC),
|
|
786
|
+
administrativeArea: z10.string().uuid()
|
|
453
787
|
});
|
|
454
788
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
455
|
-
addressType:
|
|
789
|
+
addressType: z10.literal(AddressType.INTERNATIONAL)
|
|
456
790
|
});
|
|
457
|
-
var AddressFieldValue =
|
|
791
|
+
var AddressFieldValue = z10.discriminatedUnion("addressType", [
|
|
458
792
|
DomesticAddressFieldValue,
|
|
459
793
|
InternationalAddressFieldValue
|
|
460
794
|
]);
|
|
461
795
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
462
|
-
addressType:
|
|
463
|
-
administrativeArea:
|
|
796
|
+
addressType: z10.literal(AddressType.DOMESTIC),
|
|
797
|
+
administrativeArea: z10.string().uuid().nullish()
|
|
464
798
|
/* Leaf level admin structure */
|
|
465
799
|
});
|
|
466
800
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
467
801
|
{
|
|
468
|
-
addressType:
|
|
802
|
+
addressType: z10.literal(AddressType.INTERNATIONAL)
|
|
469
803
|
}
|
|
470
804
|
);
|
|
471
|
-
var AddressFieldUpdateValue =
|
|
805
|
+
var AddressFieldUpdateValue = z10.discriminatedUnion("addressType", [
|
|
472
806
|
DomesticAddressUpdateFieldValue,
|
|
473
807
|
InternationalAddressUpdateFieldValue
|
|
474
808
|
]).nullish();
|
|
475
|
-
var FileFieldValueWithOption =
|
|
809
|
+
var FileFieldValueWithOption = z10.object({
|
|
476
810
|
path: DocumentPath,
|
|
477
|
-
originalFilename:
|
|
478
|
-
type:
|
|
479
|
-
option:
|
|
480
|
-
});
|
|
481
|
-
var FileFieldWithOptionValue =
|
|
482
|
-
var HttpFieldValue =
|
|
483
|
-
loading:
|
|
484
|
-
error:
|
|
485
|
-
data:
|
|
486
|
-
});
|
|
487
|
-
var HttpFieldUpdateValue =
|
|
488
|
-
loading:
|
|
489
|
-
error:
|
|
490
|
-
data:
|
|
491
|
-
}).or(
|
|
492
|
-
var QueryParamReaderFieldValue =
|
|
493
|
-
data:
|
|
494
|
-
updatedAt:
|
|
811
|
+
originalFilename: z10.string(),
|
|
812
|
+
type: z10.string(),
|
|
813
|
+
option: z10.string()
|
|
814
|
+
});
|
|
815
|
+
var FileFieldWithOptionValue = z10.array(FileFieldValueWithOption);
|
|
816
|
+
var HttpFieldValue = z10.object({
|
|
817
|
+
loading: z10.boolean(),
|
|
818
|
+
error: z10.object({ statusCode: z10.number(), message: z10.string() }).nullish(),
|
|
819
|
+
data: z10.any()
|
|
820
|
+
});
|
|
821
|
+
var HttpFieldUpdateValue = z10.object({
|
|
822
|
+
loading: z10.boolean().nullish(),
|
|
823
|
+
error: z10.object({ statusCode: z10.number(), message: z10.string() }).nullish(),
|
|
824
|
+
data: z10.any().nullish()
|
|
825
|
+
}).or(z10.null()).or(z10.undefined());
|
|
826
|
+
var QueryParamReaderFieldValue = z10.object({
|
|
827
|
+
data: z10.record(z10.string(), z10.string()),
|
|
828
|
+
updatedAt: z10.iso.datetime()
|
|
495
829
|
}).nullish();
|
|
496
|
-
var QueryParamReaderFieldUpdateValue =
|
|
497
|
-
data:
|
|
830
|
+
var QueryParamReaderFieldUpdateValue = z10.object({
|
|
831
|
+
data: z10.record(z10.string(), z10.string())
|
|
498
832
|
});
|
|
499
|
-
var ReadDataValue =
|
|
500
|
-
data:
|
|
833
|
+
var ReadDataValue = z10.object({
|
|
834
|
+
data: z10.any()
|
|
501
835
|
});
|
|
502
836
|
var QrReaderFieldValue = ReadDataValue;
|
|
503
837
|
var IdReaderFieldValue = ReadDataValue;
|
|
504
|
-
var NumberWithUnitFieldValue =
|
|
505
|
-
numericValue:
|
|
506
|
-
unit:
|
|
838
|
+
var NumberWithUnitFieldValue = z10.object({
|
|
839
|
+
numericValue: z10.number(),
|
|
840
|
+
unit: z10.string()
|
|
507
841
|
});
|
|
508
|
-
var NumberWithUnitFieldUpdateValue =
|
|
509
|
-
numericValue:
|
|
510
|
-
unit:
|
|
842
|
+
var NumberWithUnitFieldUpdateValue = z10.object({
|
|
843
|
+
numericValue: z10.number().optional(),
|
|
844
|
+
unit: z10.string().optional()
|
|
511
845
|
});
|
|
512
|
-
var CustomFieldValue =
|
|
846
|
+
var CustomFieldValue = z10.unknown().brand("CustomFieldValue");
|
|
513
847
|
|
|
514
848
|
// ../commons/src/events/PlainDate.ts
|
|
515
849
|
var import_zod = require("zod");
|
|
516
850
|
var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
|
|
517
851
|
|
|
518
852
|
// ../commons/src/events/FieldValue.ts
|
|
519
|
-
var TextValue =
|
|
520
|
-
var HiddenFieldValue =
|
|
853
|
+
var TextValue = z12.string();
|
|
854
|
+
var HiddenFieldValue = z12.string();
|
|
521
855
|
var NonEmptyTextValue = TextValue.min(1);
|
|
522
|
-
var DateValue =
|
|
523
|
-
var AgeValue =
|
|
524
|
-
age:
|
|
525
|
-
asOfDateRef:
|
|
856
|
+
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
857
|
+
var AgeValue = z12.object({
|
|
858
|
+
age: z12.number(),
|
|
859
|
+
asOfDateRef: z12.string()
|
|
526
860
|
});
|
|
527
861
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
528
|
-
var
|
|
529
|
-
|
|
530
|
-
|
|
862
|
+
var AutocompleteValue = z12.object({
|
|
863
|
+
label: z12.string(),
|
|
864
|
+
value: z12.string()
|
|
865
|
+
});
|
|
866
|
+
var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
|
|
867
|
+
var TimeValue = z12.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
868
|
+
var DatetimeValue = z12.iso.datetime();
|
|
869
|
+
var SelectDateRangeValue = z12.enum([
|
|
531
870
|
"last7Days",
|
|
532
871
|
"last30Days",
|
|
533
872
|
"last90Days",
|
|
534
873
|
"last365Days"
|
|
535
874
|
]);
|
|
536
|
-
var DateRangeFieldValue =
|
|
875
|
+
var DateRangeFieldValue = z12.object({
|
|
537
876
|
start: PlainDate,
|
|
538
877
|
end: PlainDate
|
|
539
878
|
}).or(PlainDate).describe(
|
|
540
879
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
541
880
|
);
|
|
542
|
-
var EmailValue =
|
|
543
|
-
var CheckboxFieldValue =
|
|
544
|
-
var NumberFieldValue =
|
|
545
|
-
var ButtonFieldValue =
|
|
546
|
-
var VerificationStatusValue =
|
|
881
|
+
var EmailValue = z12.email();
|
|
882
|
+
var CheckboxFieldValue = z12.boolean();
|
|
883
|
+
var NumberFieldValue = z12.number();
|
|
884
|
+
var ButtonFieldValue = z12.number();
|
|
885
|
+
var VerificationStatusValue = z12.enum([
|
|
547
886
|
"verified",
|
|
548
887
|
"authenticated",
|
|
549
888
|
"failed",
|
|
550
889
|
"pending"
|
|
551
890
|
]);
|
|
552
|
-
var LeafFieldValues =
|
|
891
|
+
var LeafFieldValues = z12.union([
|
|
553
892
|
AddressFieldValue,
|
|
554
893
|
TextValue,
|
|
555
894
|
PlainDate,
|
|
@@ -571,13 +910,15 @@ var LeafFieldValues = z9.union([
|
|
|
571
910
|
IdReaderFieldValue,
|
|
572
911
|
NumberWithUnitFieldValue,
|
|
573
912
|
NumberWithUnitFieldUpdateValue,
|
|
574
|
-
CustomFieldValue
|
|
913
|
+
CustomFieldValue,
|
|
914
|
+
AutocompleteValue,
|
|
915
|
+
AutocompleteUpdateValue
|
|
575
916
|
]);
|
|
576
|
-
var FieldGroupValue =
|
|
577
|
-
var DataFieldValue =
|
|
578
|
-
data:
|
|
917
|
+
var FieldGroupValue = z12.record(z12.string(), LeafFieldValues);
|
|
918
|
+
var DataFieldValue = z12.object({
|
|
919
|
+
data: z12.record(z12.string(), LeafFieldValues)
|
|
579
920
|
}).nullish();
|
|
580
|
-
var FieldValue =
|
|
921
|
+
var FieldValue = z12.union([
|
|
581
922
|
LeafFieldValues,
|
|
582
923
|
DataFieldValue,
|
|
583
924
|
FieldGroupValue
|
|
@@ -608,7 +949,7 @@ function schemaPriority(schema) {
|
|
|
608
949
|
return idx === -1 ? 9999 : idx;
|
|
609
950
|
}
|
|
610
951
|
function safeUnion(schemas) {
|
|
611
|
-
return
|
|
952
|
+
return z12.any().superRefine((val, ctx) => {
|
|
612
953
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
613
954
|
if (successful.length === 1) {
|
|
614
955
|
return;
|
|
@@ -653,21 +994,14 @@ var FieldUpdateValue = safeUnion([
|
|
|
653
994
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
654
995
|
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
655
996
|
CustomFieldValue.describe("CustomFieldValue"),
|
|
656
|
-
HiddenFieldValue.describe("HiddenFieldValue")
|
|
997
|
+
HiddenFieldValue.describe("HiddenFieldValue"),
|
|
998
|
+
AutocompleteUpdateValue.describe("AutocompleteUpdateValue")
|
|
657
999
|
]);
|
|
658
1000
|
|
|
659
|
-
// ../commons/src/uuid.ts
|
|
660
|
-
var import_uuid = require("uuid");
|
|
661
|
-
var z10 = __toESM(require("zod/v4"));
|
|
662
|
-
var UUID = z10.uuid().brand("UUID");
|
|
663
|
-
function getUUID() {
|
|
664
|
-
return (0, import_uuid.v4)();
|
|
665
|
-
}
|
|
666
|
-
|
|
667
1001
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
668
|
-
var
|
|
669
|
-
var SerializedUserField =
|
|
670
|
-
$userField:
|
|
1002
|
+
var z13 = __toESM(require("zod/v4"));
|
|
1003
|
+
var SerializedUserField = z13.object({
|
|
1004
|
+
$userField: z13.enum([
|
|
671
1005
|
"id",
|
|
672
1006
|
"name",
|
|
673
1007
|
"role",
|
|
@@ -681,7 +1015,7 @@ var SerializedUserField = z11.object({
|
|
|
681
1015
|
"primaryOfficeId",
|
|
682
1016
|
"administrativeAreaId"
|
|
683
1017
|
]),
|
|
684
|
-
$location:
|
|
1018
|
+
$location: z13.string().optional()
|
|
685
1019
|
});
|
|
686
1020
|
function userSerializer(userField) {
|
|
687
1021
|
return {
|
|
@@ -704,514 +1038,14 @@ function userSerializer(userField) {
|
|
|
704
1038
|
var import_v4 = require("zod/v4");
|
|
705
1039
|
|
|
706
1040
|
// ../commons/src/events/EventMetadata.ts
|
|
707
|
-
var
|
|
1041
|
+
var z16 = __toESM(require("zod/v4"));
|
|
708
1042
|
|
|
709
1043
|
// ../commons/src/events/ActionDocument.ts
|
|
710
|
-
var z15 = __toESM(require("zod/v4"));
|
|
711
|
-
|
|
712
|
-
// ../commons/src/authentication.ts
|
|
713
|
-
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
714
1044
|
var z14 = __toESM(require("zod/v4"));
|
|
715
|
-
|
|
716
|
-
// ../commons/src/scopes.ts
|
|
717
|
-
var z13 = __toESM(require("zod/v4"));
|
|
718
|
-
var qs = __toESM(require("qs"));
|
|
719
|
-
|
|
720
|
-
// ../commons/src/scopes.deprecated.do-not-use.ts
|
|
721
|
-
var z12 = __toESM(require("zod/v4"));
|
|
722
|
-
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
723
|
-
var rawConfigurableScope = z12.string().regex(rawConfigurableScopeRegex);
|
|
724
|
-
var SearchScope = z12.object({
|
|
725
|
-
type: z12.literal("search"),
|
|
726
|
-
options: z12.object({
|
|
727
|
-
event: z12.array(z12.string()).length(1),
|
|
728
|
-
access: z12.array(z12.enum(["my-jurisdiction", "all"])).length(1)
|
|
729
|
-
})
|
|
730
|
-
});
|
|
731
|
-
var CreateUserScope = z12.object({
|
|
732
|
-
type: z12.literal("user.create"),
|
|
733
|
-
options: z12.object({
|
|
734
|
-
role: z12.array(z12.string())
|
|
735
|
-
})
|
|
736
|
-
});
|
|
737
|
-
var EditUserScope = z12.object({
|
|
738
|
-
type: z12.literal("user.edit"),
|
|
739
|
-
options: z12.object({
|
|
740
|
-
role: z12.array(z12.string())
|
|
741
|
-
})
|
|
742
|
-
});
|
|
743
|
-
var WorkqueueScope = z12.object({
|
|
744
|
-
type: z12.literal("workqueue"),
|
|
745
|
-
options: z12.object({
|
|
746
|
-
id: z12.array(z12.string())
|
|
747
|
-
})
|
|
748
|
-
});
|
|
749
|
-
var PrintCertifiedCopiesScope = z12.object({
|
|
750
|
-
type: z12.literal("record.registered.print-certified-copies"),
|
|
751
|
-
options: z12.object({
|
|
752
|
-
event: z12.array(z12.string()).describe("Event type, e.g. birth, death"),
|
|
753
|
-
templates: z12.array(z12.string()).optional().describe(
|
|
754
|
-
"Template IDs for certified copies. If not provided, all templates will be used."
|
|
755
|
-
)
|
|
756
|
-
})
|
|
757
|
-
});
|
|
758
|
-
var LegacyRecordScope = z12.object({
|
|
759
|
-
type: z12.enum([
|
|
760
|
-
"record.create",
|
|
761
|
-
"record.read",
|
|
762
|
-
"record.declare",
|
|
763
|
-
"record.notify",
|
|
764
|
-
"record.declared.edit",
|
|
765
|
-
"record.declared.validate",
|
|
766
|
-
"record.declared.reject",
|
|
767
|
-
"record.declared.archive",
|
|
768
|
-
"record.declared.review-duplicates",
|
|
769
|
-
"record.register",
|
|
770
|
-
"record.registered.request-correction",
|
|
771
|
-
"record.registered.correct",
|
|
772
|
-
"record.unassign-others"
|
|
773
|
-
]),
|
|
774
|
-
options: z12.object({
|
|
775
|
-
event: z12.array(z12.string()).describe("Event type, e.g. birth, death")
|
|
776
|
-
})
|
|
777
|
-
}).describe(
|
|
778
|
-
"Scopes used to check user's permission to perform actions on a record."
|
|
779
|
-
);
|
|
780
|
-
var ConfigurableRawScopes = z12.discriminatedUnion("type", [
|
|
781
|
-
SearchScope,
|
|
782
|
-
LegacyRecordScope,
|
|
783
|
-
PrintCertifiedCopiesScope,
|
|
784
|
-
CreateUserScope,
|
|
785
|
-
EditUserScope,
|
|
786
|
-
WorkqueueScope
|
|
787
|
-
]);
|
|
788
|
-
|
|
789
|
-
// ../commons/src/scopes.ts
|
|
790
|
-
var SCOPES = {
|
|
791
|
-
// TODO v1.8 legacy scopes
|
|
792
|
-
BYPASSRATELIMIT: "bypassratelimit",
|
|
793
|
-
REGISTER: "register",
|
|
794
|
-
DEMO: "demo",
|
|
795
|
-
CONFIG: "config",
|
|
796
|
-
// systems / integrations
|
|
797
|
-
WEBHOOK: "webhook",
|
|
798
|
-
NATIONALID: "nationalId",
|
|
799
|
-
NOTIFICATION_API: "notification-api",
|
|
800
|
-
RECORDSEARCH: "recordsearch",
|
|
801
|
-
RECORD_IMPORT: "record.import",
|
|
802
|
-
RECORD_EXPORT: "record.export",
|
|
803
|
-
RECORD_REINDEX: "record.reindex",
|
|
804
|
-
INTEGRATION_CREATE: "integration.create",
|
|
805
|
-
// declare
|
|
806
|
-
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
807
|
-
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
808
|
-
RECORD_DECLARE_DEATH: "record.declare-death",
|
|
809
|
-
RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction",
|
|
810
|
-
RECORD_DECLARE_MARRIAGE: "record.declare-marriage",
|
|
811
|
-
RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction",
|
|
812
|
-
RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete",
|
|
813
|
-
// @todo: should this record be removed from events v2?
|
|
814
|
-
RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review",
|
|
815
|
-
RECORD_UNASSIGN_OTHERS: "record.unassign-others",
|
|
816
|
-
// validate
|
|
817
|
-
RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval",
|
|
818
|
-
RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates",
|
|
819
|
-
RECORD_DECLARATION_EDIT: "record.declaration-edit",
|
|
820
|
-
RECORD_REVIEW_DUPLICATES: "record.review-duplicates",
|
|
821
|
-
RECORD_DECLARATION_ARCHIVE: "record.declaration-archive",
|
|
822
|
-
RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate",
|
|
823
|
-
// register
|
|
824
|
-
RECORD_REGISTER: "record.register",
|
|
825
|
-
/**
|
|
826
|
-
* This scope is used to **print and **issue certified copies of a record
|
|
827
|
-
* after it has been registered. Previously Registrars had this permission.
|
|
828
|
-
*/
|
|
829
|
-
RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies",
|
|
830
|
-
// correct
|
|
831
|
-
RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction",
|
|
832
|
-
RECORD_REGISTRATION_CORRECT: "record.registration-correct",
|
|
833
|
-
RECORD_CONFIRM_REGISTRATION: "record.confirm-registration",
|
|
834
|
-
RECORD_REJECT_REGISTRATION: "record.reject-registration",
|
|
835
|
-
// search
|
|
836
|
-
SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction",
|
|
837
|
-
SEARCH_BIRTH: "search.birth",
|
|
838
|
-
SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction",
|
|
839
|
-
SEARCH_DEATH: "search.death",
|
|
840
|
-
SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction",
|
|
841
|
-
SEARCH_MARRIAGE: "search.marriage",
|
|
842
|
-
// audit v1.8
|
|
843
|
-
RECORD_READ: "record.read",
|
|
844
|
-
// profile
|
|
845
|
-
PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature",
|
|
846
|
-
// performance
|
|
847
|
-
PERFORMANCE_READ: "performance.read",
|
|
848
|
-
PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards",
|
|
849
|
-
PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export",
|
|
850
|
-
// organisation
|
|
851
|
-
ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all",
|
|
852
|
-
ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office",
|
|
853
|
-
ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction",
|
|
854
|
-
// user
|
|
855
|
-
USER_READ: "user.read:all",
|
|
856
|
-
USER_READ_MY_OFFICE: "user.read:my-office",
|
|
857
|
-
USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction",
|
|
858
|
-
USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit",
|
|
859
|
-
//v1.8
|
|
860
|
-
USER_CREATE: "user.create:all",
|
|
861
|
-
USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction",
|
|
862
|
-
USER_UPDATE: "user.update:all",
|
|
863
|
-
USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction",
|
|
864
|
-
// config
|
|
865
|
-
CONFIG_UPDATE_ALL: "config.update:all",
|
|
866
|
-
// data seeding
|
|
867
|
-
USER_DATA_SEEDING: "user.data-seeding",
|
|
868
|
-
// attachment
|
|
869
|
-
ATTACHMENT_UPLOAD: "attachment.upload"
|
|
870
|
-
};
|
|
871
|
-
var LegacyScopes = z13.union([
|
|
872
|
-
z13.literal(SCOPES.BYPASSRATELIMIT),
|
|
873
|
-
z13.literal(SCOPES.REGISTER),
|
|
874
|
-
z13.literal(SCOPES.DEMO),
|
|
875
|
-
z13.literal(SCOPES.CONFIG)
|
|
876
|
-
]);
|
|
877
|
-
var IntegrationScopes = z13.union([
|
|
878
|
-
z13.literal(SCOPES.WEBHOOK),
|
|
879
|
-
z13.literal(SCOPES.NATIONALID),
|
|
880
|
-
z13.literal(SCOPES.NOTIFICATION_API),
|
|
881
|
-
z13.literal(SCOPES.RECORDSEARCH),
|
|
882
|
-
z13.literal(SCOPES.INTEGRATION_CREATE)
|
|
883
|
-
]);
|
|
884
|
-
var InternalOperationsScopes = z13.union([
|
|
885
|
-
z13.literal(SCOPES.RECORD_REINDEX),
|
|
886
|
-
z13.literal(SCOPES.RECORD_IMPORT)
|
|
887
|
-
]);
|
|
888
|
-
var PerformanceScopes = z13.union([
|
|
889
|
-
z13.literal(SCOPES.PERFORMANCE_READ),
|
|
890
|
-
z13.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
891
|
-
z13.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
892
|
-
]);
|
|
893
|
-
var OrganisationScopes = z13.union([
|
|
894
|
-
z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
895
|
-
z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
896
|
-
z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
897
|
-
]);
|
|
898
|
-
var UserScopes = z13.union([
|
|
899
|
-
z13.literal(SCOPES.USER_READ),
|
|
900
|
-
z13.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
901
|
-
z13.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
902
|
-
z13.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
903
|
-
z13.literal(SCOPES.USER_CREATE),
|
|
904
|
-
z13.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
905
|
-
z13.literal(SCOPES.USER_UPDATE),
|
|
906
|
-
z13.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
907
|
-
]);
|
|
908
|
-
var ConfigScope = z13.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
909
|
-
var DataSeedingScope = z13.literal(SCOPES.USER_DATA_SEEDING);
|
|
910
|
-
var AttachmentScope = z13.literal(SCOPES.ATTACHMENT_UPLOAD);
|
|
911
|
-
var LiteralScopes = z13.union([
|
|
912
|
-
LegacyScopes,
|
|
913
|
-
IntegrationScopes,
|
|
914
|
-
z13.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
915
|
-
z13.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
916
|
-
PerformanceScopes,
|
|
917
|
-
OrganisationScopes,
|
|
918
|
-
UserScopes,
|
|
919
|
-
ConfigScope,
|
|
920
|
-
DataSeedingScope,
|
|
921
|
-
InternalOperationsScopes,
|
|
922
|
-
AttachmentScope
|
|
923
|
-
]);
|
|
924
|
-
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
925
|
-
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
926
|
-
);
|
|
927
|
-
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
928
|
-
var RecordScopeTypeV2 = z13.enum([
|
|
929
|
-
"record.search",
|
|
930
|
-
"record.create",
|
|
931
|
-
"record.read",
|
|
932
|
-
"record.declare",
|
|
933
|
-
"record.notify",
|
|
934
|
-
"record.edit",
|
|
935
|
-
"record.reject",
|
|
936
|
-
"record.archive",
|
|
937
|
-
"record.review-duplicates",
|
|
938
|
-
"record.register",
|
|
939
|
-
"record.print-certified-copies",
|
|
940
|
-
"record.request-correction",
|
|
941
|
-
"record.correct",
|
|
942
|
-
"record.unassign-others",
|
|
943
|
-
"record.custom-action"
|
|
944
|
-
]);
|
|
945
|
-
var scopeByEvent = z13.preprocess(
|
|
946
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
947
|
-
z13.array(z13.string()).optional()
|
|
948
|
-
).describe("Event type, e.g. birth, death");
|
|
949
|
-
var scopeOptionsPlaceEvent = z13.object({
|
|
950
|
-
event: scopeByEvent,
|
|
951
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
952
|
-
}).describe("Options applicable to all record scopes.");
|
|
953
|
-
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
954
|
-
declaredIn: JurisdictionFilter.optional(),
|
|
955
|
-
declaredBy: UserFilter.optional()
|
|
956
|
-
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
957
|
-
var ScopeOptionsFull = scopeOptionsDeclared.extend({
|
|
958
|
-
registeredIn: JurisdictionFilter.optional(),
|
|
959
|
-
registeredBy: UserFilter.optional()
|
|
960
|
-
}).describe(
|
|
961
|
-
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
962
|
-
);
|
|
963
|
-
var CustomActionScopeOptions = ScopeOptionsFull.extend({
|
|
964
|
-
customActionTypes: z13.preprocess(
|
|
965
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
966
|
-
z13.array(z13.string()).optional()
|
|
967
|
-
).describe("Allowed custom action types")
|
|
968
|
-
});
|
|
969
|
-
var ScopeOptionKey = ScopeOptionsFull.keyof();
|
|
970
|
-
var ResolvedScopeOptionsPlaceEvent = z13.object({
|
|
971
|
-
event: scopeByEvent,
|
|
972
|
-
placeOfEvent: UUID.nullish()
|
|
973
|
-
}).describe(
|
|
974
|
-
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
975
|
-
);
|
|
976
|
-
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
977
|
-
declaredIn: UUID.nullish(),
|
|
978
|
-
declaredBy: z13.string().optional()
|
|
979
|
-
}).describe(
|
|
980
|
-
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
981
|
-
);
|
|
982
|
-
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
983
|
-
registeredIn: UUID.nullish(),
|
|
984
|
-
registeredBy: z13.string().optional()
|
|
985
|
-
}).describe(
|
|
986
|
-
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
987
|
-
);
|
|
988
|
-
var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
|
|
989
|
-
"record.create",
|
|
990
|
-
"record.declare",
|
|
991
|
-
"record.notify"
|
|
992
|
-
]);
|
|
993
|
-
var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
994
|
-
"record.edit",
|
|
995
|
-
"record.reject",
|
|
996
|
-
"record.archive",
|
|
997
|
-
"record.review-duplicates",
|
|
998
|
-
"record.register"
|
|
999
|
-
]);
|
|
1000
|
-
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
1001
|
-
"record.search",
|
|
1002
|
-
"record.read",
|
|
1003
|
-
"record.request-correction",
|
|
1004
|
-
"record.correct",
|
|
1005
|
-
"record.unassign-others"
|
|
1006
|
-
]);
|
|
1007
|
-
var ScopeOptionsPrintCertifiedCopies = ScopeOptionsFull.extend({
|
|
1008
|
-
templates: z13.preprocess(
|
|
1009
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
1010
|
-
z13.array(z13.string()).optional()
|
|
1011
|
-
).describe(
|
|
1012
|
-
"Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
|
|
1013
|
-
)
|
|
1014
|
-
});
|
|
1015
|
-
var RecordScopeV2 = z13.discriminatedUnion("type", [
|
|
1016
|
-
z13.object({
|
|
1017
|
-
type: ScopesWithPlaceEventOptions,
|
|
1018
|
-
options: scopeOptionsPlaceEvent.optional()
|
|
1019
|
-
}),
|
|
1020
|
-
z13.object({
|
|
1021
|
-
type: ScopesWithDeclaredOptions,
|
|
1022
|
-
options: scopeOptionsDeclared.optional()
|
|
1023
|
-
}),
|
|
1024
|
-
z13.object({
|
|
1025
|
-
type: ScopesWithFullOptions,
|
|
1026
|
-
options: ScopeOptionsFull.optional()
|
|
1027
|
-
}),
|
|
1028
|
-
z13.object({
|
|
1029
|
-
type: z13.literal("record.custom-action"),
|
|
1030
|
-
options: CustomActionScopeOptions.optional()
|
|
1031
|
-
}),
|
|
1032
|
-
z13.object({
|
|
1033
|
-
type: z13.literal("record.print-certified-copies"),
|
|
1034
|
-
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
1035
|
-
})
|
|
1036
|
-
]).describe(
|
|
1037
|
-
"Scopes used to check user's permission to perform actions on a record."
|
|
1038
|
-
);
|
|
1039
|
-
var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
|
|
1040
|
-
z13.object({
|
|
1041
|
-
type: ScopesWithPlaceEventOptions,
|
|
1042
|
-
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
1043
|
-
}),
|
|
1044
|
-
z13.object({
|
|
1045
|
-
type: ScopesWithDeclaredOptions,
|
|
1046
|
-
options: ResolvedScopeOptionsDeclared.optional()
|
|
1047
|
-
}),
|
|
1048
|
-
z13.object({
|
|
1049
|
-
type: ScopesWithFullOptions,
|
|
1050
|
-
options: ResolvedScopeOptionsFull.optional()
|
|
1051
|
-
}),
|
|
1052
|
-
z13.object({
|
|
1053
|
-
type: z13.literal("record.print-certified-copies"),
|
|
1054
|
-
options: ResolvedScopeOptionsFull.extend({
|
|
1055
|
-
templates: z13.array(z13.string()).optional()
|
|
1056
|
-
}).optional()
|
|
1057
|
-
})
|
|
1058
|
-
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
1059
|
-
var flattenScope = (scope) => ({
|
|
1060
|
-
type: scope.type,
|
|
1061
|
-
...scope.options
|
|
1062
|
-
});
|
|
1063
|
-
var encodeScope = (scope) => {
|
|
1064
|
-
const flattened = flattenScope(scope);
|
|
1065
|
-
return qs.stringify(flattened, {
|
|
1066
|
-
arrayFormat: "comma",
|
|
1067
|
-
allowDots: true,
|
|
1068
|
-
addQueryPrefix: false,
|
|
1069
|
-
encode: false
|
|
1070
|
-
});
|
|
1071
|
-
};
|
|
1072
|
-
var DEFAULT_SCOPE_OPTIONS = {
|
|
1073
|
-
placeOfEvent: JurisdictionFilter.enum.all
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
// ../commons/src/authentication.ts
|
|
1077
|
-
var DEFAULT_ROLES_DEFINITION = [
|
|
1078
|
-
{
|
|
1079
|
-
id: "FIELD_AGENT",
|
|
1080
|
-
label: {
|
|
1081
|
-
defaultMessage: "Field Agent",
|
|
1082
|
-
description: "Name for user role Field Agent",
|
|
1083
|
-
id: "userRole.fieldAgent"
|
|
1084
|
-
},
|
|
1085
|
-
scopes: [
|
|
1086
|
-
encodeScope({
|
|
1087
|
-
type: "record.create",
|
|
1088
|
-
options: {
|
|
1089
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1090
|
-
}
|
|
1091
|
-
}),
|
|
1092
|
-
encodeScope({
|
|
1093
|
-
type: "record.declare",
|
|
1094
|
-
options: {
|
|
1095
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1096
|
-
}
|
|
1097
|
-
})
|
|
1098
|
-
]
|
|
1099
|
-
},
|
|
1100
|
-
{
|
|
1101
|
-
id: "REGISTRATION_AGENT",
|
|
1102
|
-
label: {
|
|
1103
|
-
defaultMessage: "Registration Agent",
|
|
1104
|
-
description: "Name for user role Registration Agent",
|
|
1105
|
-
id: "userRole.registrationAgent"
|
|
1106
|
-
},
|
|
1107
|
-
scopes: [
|
|
1108
|
-
encodeScope({
|
|
1109
|
-
type: "record.create",
|
|
1110
|
-
options: {
|
|
1111
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1112
|
-
}
|
|
1113
|
-
}),
|
|
1114
|
-
encodeScope({
|
|
1115
|
-
type: "record.declare",
|
|
1116
|
-
options: {
|
|
1117
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1118
|
-
}
|
|
1119
|
-
}),
|
|
1120
|
-
SCOPES.PERFORMANCE_READ,
|
|
1121
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1122
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1123
|
-
SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
|
|
1124
|
-
]
|
|
1125
|
-
},
|
|
1126
|
-
{
|
|
1127
|
-
id: "LOCAL_REGISTRAR",
|
|
1128
|
-
label: {
|
|
1129
|
-
defaultMessage: "Local Registrar",
|
|
1130
|
-
description: "Name for user role Local Registrar",
|
|
1131
|
-
id: "userRole.localRegistrar"
|
|
1132
|
-
},
|
|
1133
|
-
scopes: [
|
|
1134
|
-
encodeScope({
|
|
1135
|
-
type: "record.create",
|
|
1136
|
-
options: {
|
|
1137
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1138
|
-
}
|
|
1139
|
-
}),
|
|
1140
|
-
encodeScope({
|
|
1141
|
-
type: "record.declare",
|
|
1142
|
-
options: {
|
|
1143
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1144
|
-
}
|
|
1145
|
-
}),
|
|
1146
|
-
encodeScope({
|
|
1147
|
-
type: "record.review-duplicates",
|
|
1148
|
-
options: {
|
|
1149
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
1150
|
-
}
|
|
1151
|
-
}),
|
|
1152
|
-
SCOPES.PERFORMANCE_READ,
|
|
1153
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1154
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1155
|
-
SCOPES.PROFILE_ELECTRONIC_SIGNATURE,
|
|
1156
|
-
SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
|
|
1157
|
-
]
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
id: "LOCAL_SYSTEM_ADMIN",
|
|
1161
|
-
label: {
|
|
1162
|
-
defaultMessage: "Local System Admin",
|
|
1163
|
-
description: "Name for user role Local System Admin",
|
|
1164
|
-
id: "userRole.localSystemAdmin"
|
|
1165
|
-
},
|
|
1166
|
-
scopes: [
|
|
1167
|
-
SCOPES.USER_READ_MY_OFFICE,
|
|
1168
|
-
SCOPES.USER_CREATE_MY_JURISDICTION,
|
|
1169
|
-
SCOPES.USER_UPDATE_MY_JURISDICTION,
|
|
1170
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1171
|
-
SCOPES.PERFORMANCE_READ,
|
|
1172
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1173
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
1174
|
-
]
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
id: "NATIONAL_SYSTEM_ADMIN",
|
|
1178
|
-
label: {
|
|
1179
|
-
defaultMessage: "National System Admin",
|
|
1180
|
-
description: "Name for user role National System Admin",
|
|
1181
|
-
id: "userRole.nationalSystemAdmin"
|
|
1182
|
-
},
|
|
1183
|
-
scopes: [
|
|
1184
|
-
SCOPES.USER_CREATE,
|
|
1185
|
-
SCOPES.USER_READ,
|
|
1186
|
-
SCOPES.USER_UPDATE,
|
|
1187
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
1188
|
-
SCOPES.PERFORMANCE_READ,
|
|
1189
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1190
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
1191
|
-
]
|
|
1192
|
-
},
|
|
1193
|
-
{
|
|
1194
|
-
id: "PERFORMANCE_MANAGER",
|
|
1195
|
-
label: {
|
|
1196
|
-
defaultMessage: "Performance Manager",
|
|
1197
|
-
description: "Name for user role Performance Manager",
|
|
1198
|
-
id: "userRole.performanceManager"
|
|
1199
|
-
},
|
|
1200
|
-
scopes: [
|
|
1201
|
-
SCOPES.PERFORMANCE_READ,
|
|
1202
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
1203
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
1204
|
-
]
|
|
1205
|
-
}
|
|
1206
|
-
];
|
|
1207
|
-
var TokenUserType = z14.enum(["user", "system"]);
|
|
1208
|
-
var TokenWithBearer = z14.string().regex(/^Bearer\s/);
|
|
1209
|
-
|
|
1210
|
-
// ../commons/src/events/ActionDocument.ts
|
|
1211
|
-
var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
|
|
1045
|
+
var ActionUpdate = z14.record(z14.string(), FieldUpdateValue).describe(
|
|
1212
1046
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1213
1047
|
);
|
|
1214
|
-
var EventState =
|
|
1048
|
+
var EventState = z14.record(z14.string(), FieldValue).describe(
|
|
1215
1049
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1216
1050
|
);
|
|
1217
1051
|
var ActionStatus = {
|
|
@@ -1219,15 +1053,15 @@ var ActionStatus = {
|
|
|
1219
1053
|
Accepted: "Accepted",
|
|
1220
1054
|
Rejected: "Rejected"
|
|
1221
1055
|
};
|
|
1222
|
-
var ActionBase =
|
|
1056
|
+
var ActionBase = z14.object({
|
|
1223
1057
|
id: UUID.describe("Unique identifier of the action."),
|
|
1224
|
-
transactionId:
|
|
1058
|
+
transactionId: z14.string().describe("Unique identifier of the transaction."),
|
|
1225
1059
|
createdByUserType: TokenUserType.describe(
|
|
1226
1060
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1227
1061
|
),
|
|
1228
|
-
createdAt:
|
|
1229
|
-
createdBy:
|
|
1230
|
-
createdByRole:
|
|
1062
|
+
createdAt: z14.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1063
|
+
createdBy: z14.string().describe("Identifier of the user who created the action."),
|
|
1064
|
+
createdByRole: z14.string().optional().describe("Role of the user who created the action."),
|
|
1231
1065
|
createdBySignature: DocumentPath.nullish().describe(
|
|
1232
1066
|
"Reference to the signature of the user who created the action."
|
|
1233
1067
|
),
|
|
@@ -1239,7 +1073,7 @@ var ActionBase = z15.object({
|
|
|
1239
1073
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1240
1074
|
),
|
|
1241
1075
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1242
|
-
status:
|
|
1076
|
+
status: z14.enum([
|
|
1243
1077
|
ActionStatus.Requested,
|
|
1244
1078
|
ActionStatus.Accepted,
|
|
1245
1079
|
ActionStatus.Rejected
|
|
@@ -1251,132 +1085,132 @@ var ActionBase = z15.object({
|
|
|
1251
1085
|
)
|
|
1252
1086
|
});
|
|
1253
1087
|
var AssignedAction = ActionBase.extend(
|
|
1254
|
-
|
|
1255
|
-
type:
|
|
1256
|
-
assignedTo:
|
|
1088
|
+
z14.object({
|
|
1089
|
+
type: z14.literal(ActionType.ASSIGN),
|
|
1090
|
+
assignedTo: z14.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1257
1091
|
// TODO move into 'content' property
|
|
1258
1092
|
}).shape
|
|
1259
1093
|
);
|
|
1260
1094
|
var UnassignedAction = ActionBase.extend(
|
|
1261
|
-
|
|
1262
|
-
type:
|
|
1095
|
+
z14.object({
|
|
1096
|
+
type: z14.literal(ActionType.UNASSIGN)
|
|
1263
1097
|
}).shape
|
|
1264
1098
|
);
|
|
1265
1099
|
var RegisterAction = ActionBase.extend(
|
|
1266
|
-
|
|
1267
|
-
type:
|
|
1268
|
-
registrationNumber:
|
|
1100
|
+
z14.object({
|
|
1101
|
+
type: z14.literal(ActionType.REGISTER),
|
|
1102
|
+
registrationNumber: z14.string().optional().describe(
|
|
1269
1103
|
"Registration number of the event. Always present for accepted registrations."
|
|
1270
1104
|
)
|
|
1271
1105
|
// TODO move into 'content' property
|
|
1272
1106
|
}).shape
|
|
1273
1107
|
);
|
|
1274
1108
|
var DeclareAction = ActionBase.extend(
|
|
1275
|
-
|
|
1276
|
-
type:
|
|
1109
|
+
z14.object({
|
|
1110
|
+
type: z14.literal(ActionType.DECLARE)
|
|
1277
1111
|
}).shape
|
|
1278
1112
|
);
|
|
1279
|
-
var ReasonContent =
|
|
1280
|
-
reason:
|
|
1113
|
+
var ReasonContent = z14.object({
|
|
1114
|
+
reason: z14.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1281
1115
|
"Message describing the reason for rejecting or archiving the event."
|
|
1282
1116
|
)
|
|
1283
1117
|
});
|
|
1284
1118
|
var RejectAction = ActionBase.extend(
|
|
1285
|
-
|
|
1286
|
-
type:
|
|
1119
|
+
z14.object({
|
|
1120
|
+
type: z14.literal(ActionType.REJECT),
|
|
1287
1121
|
content: ReasonContent
|
|
1288
1122
|
}).shape
|
|
1289
1123
|
);
|
|
1290
|
-
var PotentialDuplicate =
|
|
1124
|
+
var PotentialDuplicate = z14.object({
|
|
1291
1125
|
id: UUID,
|
|
1292
|
-
trackingId:
|
|
1126
|
+
trackingId: z14.string()
|
|
1293
1127
|
});
|
|
1294
1128
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
1295
|
-
|
|
1296
|
-
type:
|
|
1297
|
-
content:
|
|
1298
|
-
duplicates:
|
|
1129
|
+
z14.object({
|
|
1130
|
+
type: z14.literal(ActionType.DUPLICATE_DETECTED),
|
|
1131
|
+
content: z14.object({
|
|
1132
|
+
duplicates: z14.array(PotentialDuplicate)
|
|
1299
1133
|
})
|
|
1300
1134
|
}).shape
|
|
1301
1135
|
);
|
|
1302
1136
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1303
|
-
|
|
1304
|
-
type:
|
|
1137
|
+
z14.object({
|
|
1138
|
+
type: z14.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1305
1139
|
}).shape
|
|
1306
1140
|
);
|
|
1307
1141
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1308
|
-
|
|
1309
|
-
type:
|
|
1310
|
-
content:
|
|
1142
|
+
z14.object({
|
|
1143
|
+
type: z14.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1144
|
+
content: z14.object({
|
|
1311
1145
|
duplicateOf: UUID
|
|
1312
1146
|
}).optional()
|
|
1313
1147
|
}).shape
|
|
1314
1148
|
);
|
|
1315
1149
|
var ArchiveAction = ActionBase.extend(
|
|
1316
|
-
|
|
1317
|
-
type:
|
|
1150
|
+
z14.object({
|
|
1151
|
+
type: z14.literal(ActionType.ARCHIVE),
|
|
1318
1152
|
content: ReasonContent
|
|
1319
1153
|
}).shape
|
|
1320
1154
|
);
|
|
1321
1155
|
var CreatedAction = ActionBase.extend(
|
|
1322
|
-
|
|
1323
|
-
type:
|
|
1156
|
+
z14.object({
|
|
1157
|
+
type: z14.literal(ActionType.CREATE)
|
|
1324
1158
|
}).shape
|
|
1325
1159
|
);
|
|
1326
1160
|
var NotifiedAction = ActionBase.extend(
|
|
1327
|
-
|
|
1328
|
-
type:
|
|
1161
|
+
z14.object({
|
|
1162
|
+
type: z14.literal(ActionType.NOTIFY)
|
|
1329
1163
|
}).shape
|
|
1330
1164
|
);
|
|
1331
1165
|
var EditAction = ActionBase.extend(
|
|
1332
|
-
|
|
1333
|
-
type:
|
|
1334
|
-
content:
|
|
1335
|
-
comment:
|
|
1166
|
+
z14.object({
|
|
1167
|
+
type: z14.literal(ActionType.EDIT),
|
|
1168
|
+
content: z14.object({
|
|
1169
|
+
comment: z14.string().describe("Comment for the edit action.").optional()
|
|
1336
1170
|
})
|
|
1337
1171
|
}).shape
|
|
1338
1172
|
);
|
|
1339
|
-
var PrintContent =
|
|
1340
|
-
templateId:
|
|
1173
|
+
var PrintContent = z14.object({
|
|
1174
|
+
templateId: z14.string().optional()
|
|
1341
1175
|
});
|
|
1342
1176
|
var PrintCertificateAction = ActionBase.extend(
|
|
1343
|
-
|
|
1344
|
-
type:
|
|
1177
|
+
z14.object({
|
|
1178
|
+
type: z14.literal(ActionType.PRINT_CERTIFICATE),
|
|
1345
1179
|
content: PrintContent.optional().nullable()
|
|
1346
1180
|
}).shape
|
|
1347
1181
|
);
|
|
1348
1182
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1349
|
-
|
|
1350
|
-
type:
|
|
1183
|
+
z14.object({
|
|
1184
|
+
type: z14.literal(ActionType.REQUEST_CORRECTION)
|
|
1351
1185
|
}).shape
|
|
1352
1186
|
);
|
|
1353
1187
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1354
|
-
|
|
1355
|
-
type:
|
|
1356
|
-
requestId:
|
|
1188
|
+
z14.object({
|
|
1189
|
+
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1190
|
+
requestId: z14.string()
|
|
1357
1191
|
// TODO move into 'content' property
|
|
1358
1192
|
}).shape
|
|
1359
1193
|
);
|
|
1360
1194
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1361
|
-
|
|
1362
|
-
type:
|
|
1363
|
-
requestId:
|
|
1195
|
+
z14.object({
|
|
1196
|
+
type: z14.literal(ActionType.REJECT_CORRECTION),
|
|
1197
|
+
requestId: z14.string(),
|
|
1364
1198
|
// TODO move into 'content' property
|
|
1365
1199
|
content: ReasonContent
|
|
1366
1200
|
}).shape
|
|
1367
1201
|
);
|
|
1368
1202
|
var ReadAction = ActionBase.extend(
|
|
1369
|
-
|
|
1370
|
-
type:
|
|
1203
|
+
z14.object({
|
|
1204
|
+
type: z14.literal(ActionType.READ)
|
|
1371
1205
|
}).shape
|
|
1372
1206
|
);
|
|
1373
1207
|
var CustomAction = ActionBase.merge(
|
|
1374
|
-
|
|
1375
|
-
type:
|
|
1376
|
-
customActionType:
|
|
1208
|
+
z14.object({
|
|
1209
|
+
type: z14.literal(ActionType.CUSTOM),
|
|
1210
|
+
customActionType: z14.string()
|
|
1377
1211
|
})
|
|
1378
1212
|
);
|
|
1379
|
-
var ActionDocument =
|
|
1213
|
+
var ActionDocument = z14.discriminatedUnion("type", [
|
|
1380
1214
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1381
1215
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1382
1216
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1402,15 +1236,15 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1402
1236
|
declaration: true,
|
|
1403
1237
|
annotation: true
|
|
1404
1238
|
}).extend(
|
|
1405
|
-
|
|
1406
|
-
type:
|
|
1407
|
-
status:
|
|
1239
|
+
z14.object({
|
|
1240
|
+
type: z14.enum(ConfirmableActions),
|
|
1241
|
+
status: z14.literal(ActionStatus.Rejected)
|
|
1408
1242
|
}).shape
|
|
1409
1243
|
);
|
|
1410
|
-
var Action =
|
|
1244
|
+
var Action = z14.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1411
1245
|
|
|
1412
1246
|
// ../commons/src/events/Flag.ts
|
|
1413
|
-
var
|
|
1247
|
+
var z15 = __toESM(require("zod/v4"));
|
|
1414
1248
|
var InherentFlags = {
|
|
1415
1249
|
INCOMPLETE: "incomplete",
|
|
1416
1250
|
REJECTED: "rejected",
|
|
@@ -1424,7 +1258,7 @@ var InherentFlags = {
|
|
|
1424
1258
|
*/
|
|
1425
1259
|
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1426
1260
|
};
|
|
1427
|
-
var ActionFlag =
|
|
1261
|
+
var ActionFlag = z15.string().regex(
|
|
1428
1262
|
new RegExp(
|
|
1429
1263
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1430
1264
|
ActionStatus
|
|
@@ -1432,73 +1266,73 @@ var ActionFlag = z16.string().regex(
|
|
|
1432
1266
|
),
|
|
1433
1267
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1434
1268
|
);
|
|
1435
|
-
var CustomFlag =
|
|
1269
|
+
var CustomFlag = z15.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1436
1270
|
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1437
1271
|
InherentFlags
|
|
1438
1272
|
).join(", ")}`
|
|
1439
1273
|
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1440
1274
|
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1441
1275
|
}).describe("Custom flag identifier defined by the country config.");
|
|
1442
|
-
var Flag = ActionFlag.or(
|
|
1443
|
-
var FlagConfig =
|
|
1276
|
+
var Flag = ActionFlag.or(z15.enum(InherentFlags)).or(CustomFlag);
|
|
1277
|
+
var FlagConfig = z15.object({
|
|
1444
1278
|
id: CustomFlag,
|
|
1445
|
-
requiresAction:
|
|
1279
|
+
requiresAction: z15.boolean().describe(
|
|
1446
1280
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1447
1281
|
),
|
|
1448
1282
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1449
1283
|
});
|
|
1450
|
-
var ActionFlagConfig =
|
|
1284
|
+
var ActionFlagConfig = z15.object({
|
|
1451
1285
|
id: Flag,
|
|
1452
|
-
operation:
|
|
1286
|
+
operation: z15.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1453
1287
|
conditional: Conditional.optional().describe(
|
|
1454
1288
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1455
1289
|
)
|
|
1456
1290
|
});
|
|
1457
1291
|
|
|
1458
1292
|
// ../commons/src/events/EventMetadata.ts
|
|
1459
|
-
var EventStatus =
|
|
1293
|
+
var EventStatus = z16.enum([
|
|
1460
1294
|
"CREATED",
|
|
1461
1295
|
"NOTIFIED",
|
|
1462
1296
|
"DECLARED",
|
|
1463
1297
|
"REGISTERED",
|
|
1464
1298
|
"ARCHIVED"
|
|
1465
1299
|
]);
|
|
1466
|
-
var ZodDate =
|
|
1467
|
-
var ZodDateTime =
|
|
1468
|
-
var ActionCreationMetadata =
|
|
1469
|
-
createdAt:
|
|
1470
|
-
createdBy:
|
|
1300
|
+
var ZodDate = z16.iso.date();
|
|
1301
|
+
var ZodDateTime = z16.string().datetime();
|
|
1302
|
+
var ActionCreationMetadata = z16.object({
|
|
1303
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1304
|
+
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1471
1305
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1472
1306
|
createdAtLocation: UUID.nullish().describe(
|
|
1473
1307
|
"Location of the user who created the action request."
|
|
1474
1308
|
),
|
|
1475
|
-
createdByUserType:
|
|
1476
|
-
acceptedAt:
|
|
1477
|
-
createdByRole:
|
|
1478
|
-
createdBySignature:
|
|
1309
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1310
|
+
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1311
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation."),
|
|
1312
|
+
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1479
1313
|
});
|
|
1480
1314
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1481
|
-
registrationNumber:
|
|
1315
|
+
registrationNumber: z16.string().describe(
|
|
1482
1316
|
"Registration number of the event. Always present for accepted registrations."
|
|
1483
1317
|
)
|
|
1484
1318
|
});
|
|
1485
|
-
var LegalStatuses =
|
|
1319
|
+
var LegalStatuses = z16.object({
|
|
1486
1320
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1487
1321
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1488
1322
|
});
|
|
1489
|
-
var EventMetadata =
|
|
1323
|
+
var EventMetadata = z16.object({
|
|
1490
1324
|
id: UUID,
|
|
1491
|
-
type:
|
|
1325
|
+
type: z16.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1492
1326
|
status: EventStatus,
|
|
1493
1327
|
legalStatuses: LegalStatuses.describe(
|
|
1494
1328
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1495
1329
|
),
|
|
1496
|
-
createdAt:
|
|
1330
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1497
1331
|
dateOfEvent: ZodDate.nullish(),
|
|
1498
1332
|
placeOfEvent: UUID.nullish(),
|
|
1499
|
-
createdBy:
|
|
1500
|
-
createdByUserType:
|
|
1501
|
-
updatedByUserRole:
|
|
1333
|
+
createdBy: z16.string().describe("ID of the user who created the event."),
|
|
1334
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1335
|
+
updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
|
|
1502
1336
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1503
1337
|
createdAtLocation: UUID.nullish().describe(
|
|
1504
1338
|
"Location of the user who created the event."
|
|
@@ -1509,18 +1343,18 @@ var EventMetadata = z17.object({
|
|
|
1509
1343
|
updatedAtLocation: UUID.nullish().describe(
|
|
1510
1344
|
"Location of the user who last changed the status."
|
|
1511
1345
|
),
|
|
1512
|
-
updatedAt:
|
|
1346
|
+
updatedAt: z16.iso.datetime().describe(
|
|
1513
1347
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1514
1348
|
),
|
|
1515
|
-
assignedTo:
|
|
1516
|
-
updatedBy:
|
|
1517
|
-
trackingId:
|
|
1349
|
+
assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1350
|
+
updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
|
|
1351
|
+
trackingId: z16.string().describe(
|
|
1518
1352
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1519
1353
|
),
|
|
1520
|
-
potentialDuplicates:
|
|
1354
|
+
potentialDuplicates: z16.array(PotentialDuplicate).describe(
|
|
1521
1355
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1522
1356
|
),
|
|
1523
|
-
flags:
|
|
1357
|
+
flags: z16.array(Flag)
|
|
1524
1358
|
});
|
|
1525
1359
|
var EventMetadataKeysArray = [
|
|
1526
1360
|
"id",
|
|
@@ -1541,8 +1375,8 @@ var EventMetadataKeysArray = [
|
|
|
1541
1375
|
"legalStatuses",
|
|
1542
1376
|
"flags"
|
|
1543
1377
|
];
|
|
1544
|
-
var EventMetadataKeys =
|
|
1545
|
-
var EventMetadataDateFieldIdInput =
|
|
1378
|
+
var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
1379
|
+
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1546
1380
|
"createdAt",
|
|
1547
1381
|
"updatedAt",
|
|
1548
1382
|
"legalStatuses.DECLARED.createdAt",
|
|
@@ -1550,7 +1384,7 @@ var EventMetadataDateFieldIdInput = z17.enum([
|
|
|
1550
1384
|
"legalStatuses.REGISTERED.createdAt",
|
|
1551
1385
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1552
1386
|
]);
|
|
1553
|
-
var EventMetadataDateFieldId =
|
|
1387
|
+
var EventMetadataDateFieldId = z16.enum([
|
|
1554
1388
|
"event.createdAt",
|
|
1555
1389
|
"event.updatedAt",
|
|
1556
1390
|
"event.legalStatuses.DECLARED.createdAt",
|
|
@@ -1658,8 +1492,8 @@ var QueryExpression = import_v4.z.object({
|
|
|
1658
1492
|
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1659
1493
|
"legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
|
|
1660
1494
|
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1661
|
-
createdAtLocation: import_v4.z.optional(Within),
|
|
1662
|
-
updatedAtLocation: import_v4.z.optional(Within),
|
|
1495
|
+
createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1496
|
+
updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1663
1497
|
assignedTo: import_v4.z.optional(Exact),
|
|
1664
1498
|
createdByUserType: import_v4.z.optional(ExactUserType),
|
|
1665
1499
|
updatedByUserRole: import_v4.z.optional(Exact),
|
|
@@ -1752,7 +1586,7 @@ function todayDateTimeValueSerializer() {
|
|
|
1752
1586
|
// ../commons/src/users/userReferences.ts
|
|
1753
1587
|
var import_v42 = __toESM(require("zod/v4"));
|
|
1754
1588
|
var ScopeOptionReference = import_v42.default.object({
|
|
1755
|
-
$scope:
|
|
1589
|
+
$scope: ScopeType,
|
|
1756
1590
|
$option: ScopeOptionKey
|
|
1757
1591
|
});
|
|
1758
1592
|
var JurisdictionReference = import_v42.default.object({
|
|
@@ -1996,17 +1830,14 @@ var ImageViewField = BaseField.extend({
|
|
|
1996
1830
|
}).describe("A read-only image component for form pages");
|
|
1997
1831
|
var Paragraph = BaseField.extend({
|
|
1998
1832
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1999
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2000
1833
|
configuration: ParagraphConfiguration
|
|
2001
1834
|
}).describe("A read-only HTML <p> paragraph");
|
|
2002
1835
|
var Heading = BaseField.extend({
|
|
2003
1836
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
2004
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2005
1837
|
configuration: HeadingConfiguration
|
|
2006
1838
|
}).describe("A read-only heading component for form pages");
|
|
2007
1839
|
var PageHeader = BaseField.extend({
|
|
2008
|
-
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2009
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1840
|
+
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2010
1841
|
}).describe("A read-only header component for form pages");
|
|
2011
1842
|
var File = BaseField.extend({
|
|
2012
1843
|
type: import_v43.default.literal(FieldType.FILE),
|
|
@@ -2056,7 +1887,6 @@ var RadioGroup = BaseField.extend({
|
|
|
2056
1887
|
}).describe("Grouped radio options");
|
|
2057
1888
|
var BulletList = BaseField.extend({
|
|
2058
1889
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
2059
|
-
defaultValue: TextValue.optional(),
|
|
2060
1890
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
2061
1891
|
configuration: import_v43.default.object({
|
|
2062
1892
|
styles: import_v43.default.object({
|
|
@@ -2238,16 +2068,32 @@ var DataField = BaseField.extend({
|
|
|
2238
2068
|
data: import_v43.default.array(DataEntry)
|
|
2239
2069
|
})
|
|
2240
2070
|
}).describe("Data field for displaying read-only data");
|
|
2071
|
+
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2072
|
+
var ButtonType = import_v43.default.enum([
|
|
2073
|
+
"primary",
|
|
2074
|
+
"secondary",
|
|
2075
|
+
"tertiary",
|
|
2076
|
+
"positive",
|
|
2077
|
+
"negative",
|
|
2078
|
+
"secondaryNegative",
|
|
2079
|
+
"icon",
|
|
2080
|
+
"iconPrimary"
|
|
2081
|
+
]);
|
|
2082
|
+
var TextColor = import_v43.default.enum(["primary", "copy"]);
|
|
2083
|
+
var TextVariant = import_v43.default.enum(["bold14", "reg14"]);
|
|
2084
|
+
var ButtonConfiguration = import_v43.default.object({
|
|
2085
|
+
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit."),
|
|
2086
|
+
loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2087
|
+
buttonSize: ButtonSize.optional().describe("Size of the button."),
|
|
2088
|
+
buttonType: ButtonType.optional().describe("Type of the button."),
|
|
2089
|
+
textColor: TextColor.optional().describe("Color of the text."),
|
|
2090
|
+
textVariant: TextVariant.optional().describe("Variant of the text."),
|
|
2091
|
+
text: TranslationConfig.describe("Text to display on the button")
|
|
2092
|
+
});
|
|
2241
2093
|
var ButtonField = BaseField.extend({
|
|
2242
2094
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2243
2095
|
defaultValue: ButtonFieldValue.optional(),
|
|
2244
|
-
configuration:
|
|
2245
|
-
icon: import_v43.default.string().optional().describe(
|
|
2246
|
-
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
2247
|
-
),
|
|
2248
|
-
loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2249
|
-
text: TranslationConfig.describe("Text to display on the button")
|
|
2250
|
-
})
|
|
2096
|
+
configuration: ButtonConfiguration
|
|
2251
2097
|
}).describe("Generic button without any built-in functionality");
|
|
2252
2098
|
var FieldGroup = BaseField.extend({
|
|
2253
2099
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
@@ -2279,6 +2125,19 @@ var HttpField = BaseField.extend({
|
|
|
2279
2125
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2280
2126
|
})
|
|
2281
2127
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
2128
|
+
var AutocompleteField = BaseField.extend({
|
|
2129
|
+
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2130
|
+
configuration: import_v43.default.object({
|
|
2131
|
+
url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
|
|
2132
|
+
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2133
|
+
defaultOptions: import_v43.default.array(
|
|
2134
|
+
import_v43.default.object({
|
|
2135
|
+
label: import_v43.default.string(),
|
|
2136
|
+
value: import_v43.default.string()
|
|
2137
|
+
})
|
|
2138
|
+
).optional()
|
|
2139
|
+
})
|
|
2140
|
+
}).describe("Autocomplete input field");
|
|
2282
2141
|
var SearchField = HttpField.extend({
|
|
2283
2142
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2284
2143
|
configuration: SearchQuery.pick({
|
|
@@ -2364,8 +2223,11 @@ var CustomField = BaseField.extend({
|
|
|
2364
2223
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2365
2224
|
configuration: import_v43.default.unknown().optional()
|
|
2366
2225
|
});
|
|
2226
|
+
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2367
2227
|
var LoaderField = BaseField.extend({
|
|
2368
2228
|
type: import_v43.default.literal(FieldType.LOADER),
|
|
2229
|
+
variant: FieldStyleVariant.default("default").optional(),
|
|
2230
|
+
hideLabel: import_v43.default.boolean().default(true).optional().describe("Loader field does not show a label by default"),
|
|
2369
2231
|
configuration: import_v43.default.object({
|
|
2370
2232
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2371
2233
|
})
|
|
@@ -2422,6 +2284,7 @@ var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
|
2422
2284
|
ButtonField,
|
|
2423
2285
|
AlphaPrintButton,
|
|
2424
2286
|
HttpField,
|
|
2287
|
+
AutocompleteField,
|
|
2425
2288
|
LinkButtonField,
|
|
2426
2289
|
VerificationStatus,
|
|
2427
2290
|
QrReaderField,
|
|
@@ -2443,18 +2306,18 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2443
2306
|
]);
|
|
2444
2307
|
|
|
2445
2308
|
// ../commons/src/events/FormConfig.ts
|
|
2446
|
-
var
|
|
2309
|
+
var z22 = __toESM(require("zod/v4"));
|
|
2447
2310
|
|
|
2448
2311
|
// ../commons/src/events/PageConfig.ts
|
|
2449
|
-
var
|
|
2450
|
-
var PageTypes =
|
|
2451
|
-
var PageConfigBase =
|
|
2452
|
-
id:
|
|
2312
|
+
var z21 = __toESM(require("zod/v4"));
|
|
2313
|
+
var PageTypes = z21.enum(["FORM", "VERIFICATION"]);
|
|
2314
|
+
var PageConfigBase = z21.object({
|
|
2315
|
+
id: z21.string().describe("Unique identifier for the page"),
|
|
2453
2316
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2454
|
-
requireCompletionToContinue:
|
|
2317
|
+
requireCompletionToContinue: z21.boolean().default(false).describe(
|
|
2455
2318
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2456
2319
|
),
|
|
2457
|
-
fields:
|
|
2320
|
+
fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2458
2321
|
conditional: Conditional.optional().describe(
|
|
2459
2322
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2460
2323
|
)
|
|
@@ -2463,13 +2326,13 @@ var PageConfigBase = z22.object({
|
|
|
2463
2326
|
id: "FormPageConfig"
|
|
2464
2327
|
});
|
|
2465
2328
|
var FormPageConfig = PageConfigBase.extend({
|
|
2466
|
-
type:
|
|
2329
|
+
type: z21.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2467
2330
|
});
|
|
2468
|
-
var VerificationActionConfig =
|
|
2469
|
-
verify:
|
|
2470
|
-
cancel:
|
|
2331
|
+
var VerificationActionConfig = z21.object({
|
|
2332
|
+
verify: z21.object({ label: TranslationConfig }),
|
|
2333
|
+
cancel: z21.object({
|
|
2471
2334
|
label: TranslationConfig,
|
|
2472
|
-
confirmation:
|
|
2335
|
+
confirmation: z21.object({
|
|
2473
2336
|
title: TranslationConfig,
|
|
2474
2337
|
body: TranslationConfig
|
|
2475
2338
|
})
|
|
@@ -2479,31 +2342,31 @@ var VerificationActionConfig = z22.object({
|
|
|
2479
2342
|
id: "VerificationActionConfig"
|
|
2480
2343
|
});
|
|
2481
2344
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2482
|
-
type:
|
|
2345
|
+
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2483
2346
|
actions: VerificationActionConfig
|
|
2484
2347
|
});
|
|
2485
|
-
var PageConfig =
|
|
2348
|
+
var PageConfig = z21.discriminatedUnion("type", [
|
|
2486
2349
|
FormPageConfig,
|
|
2487
2350
|
VerificationPageConfig
|
|
2488
2351
|
]);
|
|
2489
2352
|
|
|
2490
2353
|
// ../commons/src/events/FormConfig.ts
|
|
2491
|
-
var DeclarationFormConfig =
|
|
2354
|
+
var DeclarationFormConfig = z22.object({
|
|
2492
2355
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2493
|
-
pages:
|
|
2356
|
+
pages: z22.array(FormPageConfig)
|
|
2494
2357
|
}).describe("Configuration of the declaration form.");
|
|
2495
|
-
var ActionFormConfig =
|
|
2358
|
+
var ActionFormConfig = z22.object({
|
|
2496
2359
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2497
|
-
pages:
|
|
2360
|
+
pages: z22.array(PageConfig)
|
|
2498
2361
|
}).describe(
|
|
2499
2362
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2500
2363
|
);
|
|
2501
|
-
var FormConfig =
|
|
2364
|
+
var FormConfig = z22.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2502
2365
|
|
|
2503
2366
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2504
|
-
var
|
|
2505
|
-
var FieldReference2 =
|
|
2506
|
-
var Matcher =
|
|
2367
|
+
var z23 = __toESM(require("zod/v4"));
|
|
2368
|
+
var FieldReference2 = z23.string();
|
|
2369
|
+
var Matcher = z23.object({
|
|
2507
2370
|
/**
|
|
2508
2371
|
* Reference to the field used in matching.
|
|
2509
2372
|
*
|
|
@@ -2511,23 +2374,23 @@ var Matcher = z24.object({
|
|
|
2511
2374
|
* be used as the origin date to calculate the distance from.
|
|
2512
2375
|
*/
|
|
2513
2376
|
fieldId: FieldReference2,
|
|
2514
|
-
options:
|
|
2515
|
-
boost:
|
|
2377
|
+
options: z23.object({
|
|
2378
|
+
boost: z23.number().optional(),
|
|
2516
2379
|
matchAgainst: FieldReference2.optional()
|
|
2517
2380
|
}).optional().default({
|
|
2518
2381
|
boost: 1
|
|
2519
2382
|
})
|
|
2520
2383
|
});
|
|
2521
2384
|
var FuzzyMatcher = Matcher.extend({
|
|
2522
|
-
type:
|
|
2523
|
-
options:
|
|
2385
|
+
type: z23.literal("fuzzy"),
|
|
2386
|
+
options: z23.object({
|
|
2524
2387
|
/**
|
|
2525
2388
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2526
2389
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2527
2390
|
* Names of length >7 characters = 2 edits allowed
|
|
2528
2391
|
*/
|
|
2529
|
-
fuzziness:
|
|
2530
|
-
boost:
|
|
2392
|
+
fuzziness: z23.union([z23.string(), z23.number()]).optional().default("AUTO:4,7"),
|
|
2393
|
+
boost: z23.number().optional().default(1),
|
|
2531
2394
|
matchAgainst: FieldReference2.optional()
|
|
2532
2395
|
}).optional().default({
|
|
2533
2396
|
fuzziness: "AUTO:4,7",
|
|
@@ -2535,48 +2398,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
2535
2398
|
})
|
|
2536
2399
|
});
|
|
2537
2400
|
var StrictMatcher = Matcher.extend({
|
|
2538
|
-
type:
|
|
2539
|
-
options:
|
|
2540
|
-
boost:
|
|
2401
|
+
type: z23.literal("strict"),
|
|
2402
|
+
options: z23.object({
|
|
2403
|
+
boost: z23.number().optional().default(1),
|
|
2541
2404
|
/**
|
|
2542
2405
|
* The constant value to be present in the field for both records
|
|
2543
2406
|
*/
|
|
2544
|
-
value:
|
|
2407
|
+
value: z23.string().optional(),
|
|
2545
2408
|
matchAgainst: FieldReference2.optional()
|
|
2546
2409
|
}).optional().default({
|
|
2547
2410
|
boost: 1
|
|
2548
2411
|
})
|
|
2549
2412
|
});
|
|
2550
2413
|
var DateRangeMatcher = Matcher.extend({
|
|
2551
|
-
type:
|
|
2552
|
-
options:
|
|
2414
|
+
type: z23.literal("dateRange"),
|
|
2415
|
+
options: z23.object({
|
|
2553
2416
|
/**
|
|
2554
2417
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2555
2418
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2556
2419
|
*/
|
|
2557
|
-
pivot:
|
|
2558
|
-
days:
|
|
2559
|
-
boost:
|
|
2420
|
+
pivot: z23.number().optional(),
|
|
2421
|
+
days: z23.number(),
|
|
2422
|
+
boost: z23.number().optional().default(1),
|
|
2560
2423
|
matchAgainst: FieldReference2.optional()
|
|
2561
2424
|
})
|
|
2562
2425
|
});
|
|
2563
|
-
var Not =
|
|
2564
|
-
type:
|
|
2426
|
+
var Not = z23.object({
|
|
2427
|
+
type: z23.literal("not"),
|
|
2565
2428
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2566
|
-
clause:
|
|
2429
|
+
clause: z23.lazy(() => Clause)
|
|
2567
2430
|
});
|
|
2568
|
-
var And =
|
|
2569
|
-
type:
|
|
2431
|
+
var And = z23.object({
|
|
2432
|
+
type: z23.literal("and"),
|
|
2570
2433
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2571
|
-
clauses:
|
|
2434
|
+
clauses: z23.lazy(() => Clause.array())
|
|
2572
2435
|
});
|
|
2573
|
-
var Or =
|
|
2574
|
-
type:
|
|
2436
|
+
var Or = z23.object({
|
|
2437
|
+
type: z23.literal("or"),
|
|
2575
2438
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2576
|
-
clauses:
|
|
2439
|
+
clauses: z23.lazy(() => Clause.array())
|
|
2577
2440
|
});
|
|
2578
|
-
var Clause =
|
|
2579
|
-
() =>
|
|
2441
|
+
var Clause = z23.lazy(
|
|
2442
|
+
() => z23.discriminatedUnion("type", [
|
|
2580
2443
|
Not,
|
|
2581
2444
|
And,
|
|
2582
2445
|
Or,
|
|
@@ -2587,22 +2450,22 @@ var Clause = z24.lazy(
|
|
|
2587
2450
|
).meta({
|
|
2588
2451
|
id: "Clause"
|
|
2589
2452
|
});
|
|
2590
|
-
var DeduplicationConfig =
|
|
2591
|
-
id:
|
|
2453
|
+
var DeduplicationConfig = z23.object({
|
|
2454
|
+
id: z23.string(),
|
|
2592
2455
|
label: TranslationConfig,
|
|
2593
2456
|
query: Clause
|
|
2594
2457
|
});
|
|
2595
2458
|
|
|
2596
2459
|
// ../commons/src/events/ActionConfig.ts
|
|
2597
|
-
var DeclarationReviewConfig =
|
|
2460
|
+
var DeclarationReviewConfig = z24.object({
|
|
2598
2461
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2599
|
-
fields:
|
|
2462
|
+
fields: z24.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2600
2463
|
}).describe(
|
|
2601
2464
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2602
2465
|
);
|
|
2603
|
-
var ActionConfigBase =
|
|
2466
|
+
var ActionConfigBase = z24.object({
|
|
2604
2467
|
label: TranslationConfig.describe("Human readable description of the action"),
|
|
2605
|
-
flags:
|
|
2468
|
+
flags: z24.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
2606
2469
|
supportingCopy: TranslationConfig.optional().describe(
|
|
2607
2470
|
"Text displayed on the confirmation dialog"
|
|
2608
2471
|
),
|
|
@@ -2613,28 +2476,28 @@ var ActionConfigBase = z25.object({
|
|
|
2613
2476
|
* "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."
|
|
2614
2477
|
* for EventConfig.d.ts.
|
|
2615
2478
|
*/
|
|
2616
|
-
icon:
|
|
2617
|
-
conditionals:
|
|
2479
|
+
icon: z24.string().describe("Icon representing the action").optional(),
|
|
2480
|
+
conditionals: z24.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
2618
2481
|
});
|
|
2619
2482
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2620
2483
|
deduplication: DeduplicationConfig.optional()
|
|
2621
2484
|
});
|
|
2622
2485
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2623
|
-
|
|
2624
|
-
type:
|
|
2486
|
+
z24.object({
|
|
2487
|
+
type: z24.literal(ActionType.READ),
|
|
2625
2488
|
review: DeclarationReviewConfig.describe(
|
|
2626
2489
|
"Configuration of the review page for read-only view."
|
|
2627
2490
|
),
|
|
2628
|
-
conditionals:
|
|
2491
|
+
conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2629
2492
|
}).shape
|
|
2630
2493
|
);
|
|
2631
2494
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2632
|
-
|
|
2633
|
-
type:
|
|
2495
|
+
z24.object({
|
|
2496
|
+
type: z24.literal(ActionType.DECLARE),
|
|
2634
2497
|
review: DeclarationReviewConfig.describe(
|
|
2635
2498
|
"Configuration of the review page fields."
|
|
2636
2499
|
),
|
|
2637
|
-
dialogCopy:
|
|
2500
|
+
dialogCopy: z24.object({
|
|
2638
2501
|
notify: TranslationConfig.describe(
|
|
2639
2502
|
"Confirmation text for the notify action"
|
|
2640
2503
|
),
|
|
@@ -2648,14 +2511,14 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2648
2511
|
}).shape
|
|
2649
2512
|
);
|
|
2650
2513
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2651
|
-
|
|
2652
|
-
type:
|
|
2514
|
+
z24.object({
|
|
2515
|
+
type: z24.literal(ActionType.ARCHIVE)
|
|
2653
2516
|
}).shape
|
|
2654
2517
|
);
|
|
2655
2518
|
var EditActionConfig = ActionConfigBase.extend(
|
|
2656
|
-
|
|
2657
|
-
type:
|
|
2658
|
-
dialogCopy:
|
|
2519
|
+
z24.object({
|
|
2520
|
+
type: z24.literal(ActionType.EDIT),
|
|
2521
|
+
dialogCopy: z24.object({
|
|
2659
2522
|
notify: TranslationConfig.describe(
|
|
2660
2523
|
"Confirmation text for the notify with edits action"
|
|
2661
2524
|
),
|
|
@@ -2669,33 +2532,33 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2669
2532
|
}).shape
|
|
2670
2533
|
);
|
|
2671
2534
|
var RejectConfig = ActionConfigBase.extend(
|
|
2672
|
-
|
|
2673
|
-
type:
|
|
2535
|
+
z24.object({
|
|
2536
|
+
type: z24.literal(ActionType.REJECT)
|
|
2674
2537
|
}).shape
|
|
2675
2538
|
);
|
|
2676
2539
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2677
|
-
|
|
2678
|
-
type:
|
|
2540
|
+
z24.object({
|
|
2541
|
+
type: z24.literal(ActionType.REGISTER)
|
|
2679
2542
|
}).shape
|
|
2680
2543
|
);
|
|
2681
2544
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
2682
|
-
|
|
2683
|
-
type:
|
|
2545
|
+
z24.object({
|
|
2546
|
+
type: z24.literal(ActionType.PRINT_CERTIFICATE),
|
|
2684
2547
|
printForm: ActionFormConfig
|
|
2685
2548
|
}).shape
|
|
2686
2549
|
);
|
|
2687
2550
|
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
2688
|
-
|
|
2689
|
-
type:
|
|
2551
|
+
z24.object({
|
|
2552
|
+
type: z24.literal(ActionType.REQUEST_CORRECTION),
|
|
2690
2553
|
correctionForm: ActionFormConfig
|
|
2691
2554
|
}).shape
|
|
2692
2555
|
);
|
|
2693
2556
|
var CustomActionConfig = ActionConfigBase.merge(
|
|
2694
|
-
|
|
2695
|
-
type:
|
|
2696
|
-
customActionType:
|
|
2557
|
+
z24.object({
|
|
2558
|
+
type: z24.literal(ActionType.CUSTOM),
|
|
2559
|
+
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
2697
2560
|
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
2698
|
-
form:
|
|
2561
|
+
form: z24.array(FieldConfig).describe(
|
|
2699
2562
|
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
2700
2563
|
),
|
|
2701
2564
|
auditHistoryLabel: TranslationConfig.describe(
|
|
@@ -2703,7 +2566,7 @@ var CustomActionConfig = ActionConfigBase.merge(
|
|
|
2703
2566
|
)
|
|
2704
2567
|
})
|
|
2705
2568
|
);
|
|
2706
|
-
var ActionConfig =
|
|
2569
|
+
var ActionConfig = z24.discriminatedUnion("type", [
|
|
2707
2570
|
/*
|
|
2708
2571
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2709
2572
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2725,86 +2588,86 @@ var ActionConfig = z25.discriminatedUnion("type", [
|
|
|
2725
2588
|
var actionConfigTypes = new Set(
|
|
2726
2589
|
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
2727
2590
|
);
|
|
2728
|
-
var DeclarationActionConfig =
|
|
2591
|
+
var DeclarationActionConfig = z24.discriminatedUnion("type", [
|
|
2729
2592
|
DeclareConfig,
|
|
2730
2593
|
RegisterConfig
|
|
2731
2594
|
]);
|
|
2732
2595
|
|
|
2733
2596
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2734
|
-
var
|
|
2735
|
-
var FontFamily =
|
|
2736
|
-
normal:
|
|
2737
|
-
bold:
|
|
2738
|
-
italics:
|
|
2739
|
-
bolditalics:
|
|
2740
|
-
});
|
|
2741
|
-
var CertificateConfig =
|
|
2742
|
-
id:
|
|
2743
|
-
event:
|
|
2744
|
-
isV2Template:
|
|
2597
|
+
var z25 = __toESM(require("zod/v4"));
|
|
2598
|
+
var FontFamily = z25.object({
|
|
2599
|
+
normal: z25.string(),
|
|
2600
|
+
bold: z25.string(),
|
|
2601
|
+
italics: z25.string(),
|
|
2602
|
+
bolditalics: z25.string()
|
|
2603
|
+
});
|
|
2604
|
+
var CertificateConfig = z25.object({
|
|
2605
|
+
id: z25.string(),
|
|
2606
|
+
event: z25.string(),
|
|
2607
|
+
isV2Template: z25.boolean().optional(),
|
|
2745
2608
|
label: TranslationConfig,
|
|
2746
|
-
isDefault:
|
|
2747
|
-
fee:
|
|
2748
|
-
onTime:
|
|
2749
|
-
late:
|
|
2750
|
-
delayed:
|
|
2609
|
+
isDefault: z25.boolean(),
|
|
2610
|
+
fee: z25.object({
|
|
2611
|
+
onTime: z25.number(),
|
|
2612
|
+
late: z25.number(),
|
|
2613
|
+
delayed: z25.number()
|
|
2751
2614
|
}),
|
|
2752
|
-
svgUrl:
|
|
2753
|
-
fonts:
|
|
2754
|
-
conditionals:
|
|
2615
|
+
svgUrl: z25.string(),
|
|
2616
|
+
fonts: z25.record(z25.string(), FontFamily).optional(),
|
|
2617
|
+
conditionals: z25.array(ShowConditional).optional()
|
|
2755
2618
|
});
|
|
2756
2619
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2757
|
-
hash:
|
|
2758
|
-
svg:
|
|
2620
|
+
hash: z25.string().optional(),
|
|
2621
|
+
svg: z25.string()
|
|
2759
2622
|
});
|
|
2760
2623
|
|
|
2761
2624
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2762
|
-
var
|
|
2763
|
-
var LanguageConfig =
|
|
2764
|
-
lang:
|
|
2625
|
+
var z26 = __toESM(require("zod/v4"));
|
|
2626
|
+
var LanguageConfig = z26.object({
|
|
2627
|
+
lang: z26.string(),
|
|
2765
2628
|
/**
|
|
2766
2629
|
* client.csv contents
|
|
2767
2630
|
*/
|
|
2768
|
-
messages:
|
|
2631
|
+
messages: z26.record(z26.string(), z26.string())
|
|
2769
2632
|
});
|
|
2770
2633
|
|
|
2771
2634
|
// ../commons/src/events/EventConfig.ts
|
|
2772
|
-
var
|
|
2635
|
+
var z33 = __toESM(require("zod/v4"));
|
|
2773
2636
|
|
|
2774
2637
|
// ../commons/src/events/SummaryConfig.ts
|
|
2775
|
-
var
|
|
2776
|
-
var BaseField2 =
|
|
2638
|
+
var z27 = __toESM(require("zod/v4"));
|
|
2639
|
+
var BaseField2 = z27.object({
|
|
2777
2640
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2778
2641
|
"Default message displayed when the field value is empty."
|
|
2779
2642
|
),
|
|
2780
|
-
conditionals:
|
|
2643
|
+
conditionals: z27.array(ShowConditional).default([]).optional()
|
|
2781
2644
|
});
|
|
2782
2645
|
var ReferenceField = BaseField2.extend({
|
|
2783
|
-
fieldId:
|
|
2646
|
+
fieldId: z27.string(),
|
|
2784
2647
|
label: TranslationConfig.optional().describe(
|
|
2785
2648
|
"Overrides the default label from the referenced field when provided."
|
|
2786
2649
|
)
|
|
2787
2650
|
}).describe("Field referencing existing event data by field ID.");
|
|
2788
2651
|
var Field = BaseField2.extend({
|
|
2789
|
-
id:
|
|
2652
|
+
id: z27.string().describe("Identifier of the summary field."),
|
|
2790
2653
|
value: TranslationConfig.describe(
|
|
2791
2654
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2792
2655
|
),
|
|
2793
2656
|
label: TranslationConfig
|
|
2794
2657
|
}).describe("Custom field defined for the summary view.");
|
|
2795
|
-
var SummaryConfig =
|
|
2796
|
-
fields:
|
|
2658
|
+
var SummaryConfig = z27.object({
|
|
2659
|
+
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2797
2660
|
}).describe("Configuration of the event summary section.");
|
|
2798
2661
|
|
|
2799
2662
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2800
|
-
var
|
|
2801
|
-
var MatchType =
|
|
2802
|
-
var BaseField3 =
|
|
2803
|
-
config:
|
|
2663
|
+
var z28 = __toESM(require("zod/v4"));
|
|
2664
|
+
var MatchType = z28.enum(["fuzzy", "exact", "range", "within"]);
|
|
2665
|
+
var BaseField3 = z28.object({
|
|
2666
|
+
config: z28.object({
|
|
2804
2667
|
type: MatchType.describe(
|
|
2805
2668
|
"Determines the search type of field. How to match value."
|
|
2806
2669
|
),
|
|
2807
|
-
searchFields:
|
|
2670
|
+
searchFields: z28.array(z28.string()).optional().describe(
|
|
2808
2671
|
`
|
|
2809
2672
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2810
2673
|
All specified fields will be combined using OR logic.
|
|
@@ -2814,7 +2677,7 @@ var BaseField3 = z29.object({
|
|
|
2814
2677
|
`
|
|
2815
2678
|
)
|
|
2816
2679
|
}),
|
|
2817
|
-
type:
|
|
2680
|
+
type: z28.nativeEnum(FieldType).optional().describe(
|
|
2818
2681
|
`
|
|
2819
2682
|
Explicitly specify the field type for searchFields.
|
|
2820
2683
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2828,7 +2691,7 @@ var BaseField3 = z29.object({
|
|
|
2828
2691
|
This is required when searchFields is defined.
|
|
2829
2692
|
`
|
|
2830
2693
|
),
|
|
2831
|
-
options:
|
|
2694
|
+
options: z28.array(SelectOption).optional(),
|
|
2832
2695
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2833
2696
|
`
|
|
2834
2697
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2849,7 +2712,7 @@ var BaseField3 = z29.object({
|
|
|
2849
2712
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2850
2713
|
`
|
|
2851
2714
|
),
|
|
2852
|
-
conditionals:
|
|
2715
|
+
conditionals: z28.array(FieldConditional).optional().describe(
|
|
2853
2716
|
`
|
|
2854
2717
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2855
2718
|
|
|
@@ -2863,20 +2726,20 @@ var BaseField3 = z29.object({
|
|
|
2863
2726
|
are always rendered in the advanced search form.
|
|
2864
2727
|
`
|
|
2865
2728
|
),
|
|
2866
|
-
validations:
|
|
2729
|
+
validations: z28.array(ValidationConfig).optional().describe(
|
|
2867
2730
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2868
2731
|
)
|
|
2869
2732
|
});
|
|
2870
|
-
var SearchQueryParams =
|
|
2871
|
-
eventType:
|
|
2733
|
+
var SearchQueryParams = z28.object({
|
|
2734
|
+
eventType: z28.string().optional().describe(
|
|
2872
2735
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2873
2736
|
)
|
|
2874
2737
|
}).catchall(FieldValue);
|
|
2875
2738
|
var FieldConfigSchema = BaseField3.extend({
|
|
2876
|
-
fieldId:
|
|
2877
|
-
fieldType:
|
|
2739
|
+
fieldId: z28.string(),
|
|
2740
|
+
fieldType: z28.literal("field")
|
|
2878
2741
|
});
|
|
2879
|
-
var EventFieldIdInput =
|
|
2742
|
+
var EventFieldIdInput = z28.enum([
|
|
2880
2743
|
"trackingId",
|
|
2881
2744
|
"status",
|
|
2882
2745
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2885,7 +2748,7 @@ var EventFieldIdInput = z29.enum([
|
|
|
2885
2748
|
"updatedAt"
|
|
2886
2749
|
]);
|
|
2887
2750
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2888
|
-
var EventFieldId =
|
|
2751
|
+
var EventFieldId = z28.enum([
|
|
2889
2752
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2890
2753
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2891
2754
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2895,29 +2758,29 @@ var EventFieldId = z29.enum([
|
|
|
2895
2758
|
]);
|
|
2896
2759
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2897
2760
|
fieldId: EventFieldId,
|
|
2898
|
-
fieldType:
|
|
2761
|
+
fieldType: z28.literal("event")
|
|
2899
2762
|
});
|
|
2900
|
-
var AdvancedSearchField =
|
|
2763
|
+
var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2901
2764
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2902
2765
|
if (!data.label) {
|
|
2903
2766
|
ctx.addIssue({
|
|
2904
|
-
code:
|
|
2767
|
+
code: z28.ZodIssueCode.custom,
|
|
2905
2768
|
message: "label is required when config.searchFields is defined.",
|
|
2906
2769
|
path: ["label"]
|
|
2907
2770
|
});
|
|
2908
2771
|
}
|
|
2909
2772
|
if (!data.type) {
|
|
2910
2773
|
ctx.addIssue({
|
|
2911
|
-
code:
|
|
2774
|
+
code: z28.ZodIssueCode.custom,
|
|
2912
2775
|
message: "type is required when config.searchFields is defined.",
|
|
2913
2776
|
path: ["type"]
|
|
2914
2777
|
});
|
|
2915
2778
|
}
|
|
2916
2779
|
}
|
|
2917
2780
|
});
|
|
2918
|
-
var AdvancedSearchConfig =
|
|
2781
|
+
var AdvancedSearchConfig = z28.object({
|
|
2919
2782
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2920
|
-
fields:
|
|
2783
|
+
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2921
2784
|
});
|
|
2922
2785
|
|
|
2923
2786
|
// ../commons/src/events/utils.ts
|
|
@@ -2926,14 +2789,14 @@ var import_lodash = require("lodash");
|
|
|
2926
2789
|
// ../commons/src/conditionals/validate.ts
|
|
2927
2790
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2928
2791
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2929
|
-
var
|
|
2792
|
+
var z31 = __toESM(require("zod/v4"));
|
|
2930
2793
|
var import_date_fns = require("date-fns");
|
|
2931
2794
|
|
|
2932
2795
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
2933
|
-
var
|
|
2796
|
+
var z30 = __toESM(require("zod/v4"));
|
|
2934
2797
|
|
|
2935
2798
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2936
|
-
var
|
|
2799
|
+
var z29 = __toESM(require("zod/v4"));
|
|
2937
2800
|
|
|
2938
2801
|
// ../commons/src/conditionals/validate.ts
|
|
2939
2802
|
var ajv = new import__.default({
|
|
@@ -2942,9 +2805,9 @@ var ajv = new import__.default({
|
|
|
2942
2805
|
strict: false
|
|
2943
2806
|
// Allow minContains and other newer features
|
|
2944
2807
|
});
|
|
2945
|
-
var DataContext =
|
|
2946
|
-
rootData:
|
|
2947
|
-
$leafAdminStructureLocationIds:
|
|
2808
|
+
var DataContext = z31.object({
|
|
2809
|
+
rootData: z31.object({
|
|
2810
|
+
$leafAdminStructureLocationIds: z31.array(z31.object({ id: UUID }))
|
|
2948
2811
|
})
|
|
2949
2812
|
});
|
|
2950
2813
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -3021,13 +2884,13 @@ ajv.addKeyword({
|
|
|
3021
2884
|
});
|
|
3022
2885
|
|
|
3023
2886
|
// ../commons/src/utils.ts
|
|
3024
|
-
var
|
|
2887
|
+
var z32 = __toESM(require("zod/v4"));
|
|
3025
2888
|
var _ = __toESM(require("lodash"));
|
|
3026
|
-
var FullNameV1 =
|
|
3027
|
-
|
|
3028
|
-
use:
|
|
3029
|
-
family:
|
|
3030
|
-
given:
|
|
2889
|
+
var FullNameV1 = z32.array(
|
|
2890
|
+
z32.object({
|
|
2891
|
+
use: z32.string(),
|
|
2892
|
+
family: z32.string(),
|
|
2893
|
+
given: z32.array(z32.string())
|
|
3031
2894
|
})
|
|
3032
2895
|
);
|
|
3033
2896
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -3761,11 +3624,11 @@ function validateActionOrder(event2, ctx) {
|
|
|
3761
3624
|
}
|
|
3762
3625
|
|
|
3763
3626
|
// ../commons/src/events/EventConfig.ts
|
|
3764
|
-
var EventFieldReference =
|
|
3627
|
+
var EventFieldReference = z33.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
3765
3628
|
"Reference to a field defined in the event metadata, using the field id."
|
|
3766
3629
|
);
|
|
3767
|
-
var _EventConfigBase =
|
|
3768
|
-
id:
|
|
3630
|
+
var _EventConfigBase = z33.object({
|
|
3631
|
+
id: z33.string().describe(
|
|
3769
3632
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
3770
3633
|
),
|
|
3771
3634
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -3784,19 +3647,19 @@ var _EventConfigBase = z34.object({
|
|
|
3784
3647
|
"Summary information displayed in the event overview."
|
|
3785
3648
|
),
|
|
3786
3649
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3787
|
-
actions:
|
|
3650
|
+
actions: z33.array(ActionConfig).describe(
|
|
3788
3651
|
"Configuration of system-defined actions associated with the event."
|
|
3789
3652
|
),
|
|
3790
|
-
actionOrder:
|
|
3653
|
+
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3791
3654
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
3792
3655
|
),
|
|
3793
3656
|
declaration: DeclarationFormConfig.describe(
|
|
3794
3657
|
"Configuration of the form used to gather event data."
|
|
3795
3658
|
),
|
|
3796
|
-
advancedSearch:
|
|
3659
|
+
advancedSearch: z33.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
3797
3660
|
"Configuration of fields available in the advanced search feature."
|
|
3798
3661
|
),
|
|
3799
|
-
flags:
|
|
3662
|
+
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3800
3663
|
"Configuration of flags associated with the actions of this event type."
|
|
3801
3664
|
)
|
|
3802
3665
|
});
|
|
@@ -3816,7 +3679,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
3816
3679
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
3817
3680
|
|
|
3818
3681
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3819
|
-
var
|
|
3682
|
+
var z37 = __toESM(require("zod/v4"));
|
|
3820
3683
|
|
|
3821
3684
|
// ../commons/src/searchConfigs.ts
|
|
3822
3685
|
function createSearchConfig(baseField) {
|
|
@@ -4017,17 +3880,17 @@ var event = Object.assign(eventFn, {
|
|
|
4017
3880
|
});
|
|
4018
3881
|
|
|
4019
3882
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
4020
|
-
var
|
|
3883
|
+
var z34 = __toESM(require("zod/v4"));
|
|
4021
3884
|
var WorkqueueColumnKeysArray = [
|
|
4022
3885
|
...EventMetadataKeysArray,
|
|
4023
3886
|
"title",
|
|
4024
3887
|
"outbox"
|
|
4025
3888
|
];
|
|
4026
|
-
var WorkqueueColumnKeys =
|
|
4027
|
-
var WorkqueueColumnValue =
|
|
3889
|
+
var WorkqueueColumnKeys = z34.enum(WorkqueueColumnKeysArray);
|
|
3890
|
+
var WorkqueueColumnValue = z34.object({
|
|
4028
3891
|
$event: WorkqueueColumnKeys
|
|
4029
3892
|
});
|
|
4030
|
-
var WorkqueueColumn =
|
|
3893
|
+
var WorkqueueColumn = z34.object({
|
|
4031
3894
|
label: TranslationConfig,
|
|
4032
3895
|
value: WorkqueueColumnValue
|
|
4033
3896
|
});
|
|
@@ -4038,55 +3901,59 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
4038
3901
|
}
|
|
4039
3902
|
|
|
4040
3903
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
4041
|
-
var
|
|
4042
|
-
var SerializableExact =
|
|
4043
|
-
type:
|
|
4044
|
-
term:
|
|
4045
|
-
});
|
|
4046
|
-
var SerializableWithin =
|
|
4047
|
-
type:
|
|
4048
|
-
location:
|
|
4049
|
-
});
|
|
4050
|
-
var SerializedQueryExpression =
|
|
4051
|
-
eventType:
|
|
4052
|
-
status:
|
|
4053
|
-
createdAt:
|
|
4054
|
-
updatedAt:
|
|
4055
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
4056
|
-
"legalStatuses.DECLARED.createdByRole":
|
|
4057
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
4058
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
4059
|
-
"legalStatuses.REGISTERED.createdByRole":
|
|
4060
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
4061
|
-
createdAtLocation:
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
3904
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3905
|
+
var SerializableExact = z35.object({
|
|
3906
|
+
type: z35.literal("exact"),
|
|
3907
|
+
term: z35.union([z35.string(), SerializedUserField])
|
|
3908
|
+
});
|
|
3909
|
+
var SerializableWithin = z35.object({
|
|
3910
|
+
type: z35.literal("within"),
|
|
3911
|
+
location: z35.union([z35.string(), SerializedUserField])
|
|
3912
|
+
});
|
|
3913
|
+
var SerializedQueryExpression = z35.object({
|
|
3914
|
+
eventType: z35.string(),
|
|
3915
|
+
status: z35.optional(z35.union([AnyOfStatus, ExactStatus])),
|
|
3916
|
+
createdAt: z35.optional(DateCondition),
|
|
3917
|
+
updatedAt: z35.optional(DateCondition),
|
|
3918
|
+
"legalStatuses.DECLARED.createdAtLocation": z35.optional(SerializableWithin),
|
|
3919
|
+
"legalStatuses.DECLARED.createdByRole": z35.optional(AnyOf),
|
|
3920
|
+
"legalStatuses.REGISTERED.createdAt": z35.optional(DateCondition),
|
|
3921
|
+
"legalStatuses.REGISTERED.createdAtLocation": z35.optional(SerializableWithin),
|
|
3922
|
+
"legalStatuses.REGISTERED.createdByRole": z35.optional(AnyOf),
|
|
3923
|
+
"legalStatuses.REGISTERED.registrationNumber": z35.optional(Exact),
|
|
3924
|
+
createdAtLocation: z35.optional(
|
|
3925
|
+
z35.union([SerializableWithin, SerializableExact])
|
|
3926
|
+
),
|
|
3927
|
+
updatedAtLocation: z35.optional(
|
|
3928
|
+
z35.union([SerializableWithin, SerializableExact])
|
|
3929
|
+
),
|
|
3930
|
+
updatedByUserRole: z35.optional(SerializableExact),
|
|
3931
|
+
assignedTo: z35.optional(SerializableExact),
|
|
3932
|
+
createdBy: z35.optional(SerializableExact),
|
|
4066
3933
|
createdByUserType: ExactUserType,
|
|
4067
|
-
updatedBy:
|
|
4068
|
-
trackingId:
|
|
4069
|
-
flags:
|
|
3934
|
+
updatedBy: z35.optional(SerializableExact),
|
|
3935
|
+
trackingId: z35.optional(Exact),
|
|
3936
|
+
flags: z35.optional(ContainsFlags),
|
|
4070
3937
|
data: QueryInput
|
|
4071
3938
|
}).partial();
|
|
4072
|
-
var Or2 =
|
|
4073
|
-
type:
|
|
4074
|
-
clauses:
|
|
3939
|
+
var Or2 = z35.object({
|
|
3940
|
+
type: z35.literal("or"),
|
|
3941
|
+
clauses: z35.array(SerializedQueryExpression)
|
|
4075
3942
|
});
|
|
4076
|
-
var And2 =
|
|
4077
|
-
type:
|
|
4078
|
-
clauses:
|
|
3943
|
+
var And2 = z35.object({
|
|
3944
|
+
type: z35.literal("and"),
|
|
3945
|
+
clauses: z35.array(SerializedQueryExpression)
|
|
4079
3946
|
});
|
|
4080
|
-
var CountryConfigQueryType =
|
|
4081
|
-
var CountryConfigQueryInputType =
|
|
3947
|
+
var CountryConfigQueryType = z35.discriminatedUnion("type", [And2, Or2]);
|
|
3948
|
+
var CountryConfigQueryInputType = z35.union([
|
|
4082
3949
|
SerializedQueryExpression,
|
|
4083
3950
|
And2,
|
|
4084
3951
|
Or2
|
|
4085
3952
|
]);
|
|
4086
3953
|
|
|
4087
3954
|
// ../commons/src/icons.ts
|
|
4088
|
-
var
|
|
4089
|
-
var AvailableIcons =
|
|
3955
|
+
var z36 = __toESM(require("zod/v4"));
|
|
3956
|
+
var AvailableIcons = z36.enum([
|
|
4090
3957
|
"Archived",
|
|
4091
3958
|
"Assigned",
|
|
4092
3959
|
"Briefcase",
|
|
@@ -4211,16 +4078,16 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
4211
4078
|
value: event.field("updatedAt")
|
|
4212
4079
|
}
|
|
4213
4080
|
]);
|
|
4214
|
-
var WorkqueueConfig =
|
|
4215
|
-
slug:
|
|
4081
|
+
var WorkqueueConfig = z37.object({
|
|
4082
|
+
slug: z37.string().describe("Determines the url of the workqueue."),
|
|
4216
4083
|
name: TranslationConfig.describe(
|
|
4217
4084
|
"Title of the workflow (both in navigation and on the page)"
|
|
4218
4085
|
),
|
|
4219
4086
|
query: CountryConfigQueryType,
|
|
4220
|
-
action:
|
|
4087
|
+
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4221
4088
|
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
4222
4089
|
),
|
|
4223
|
-
columns:
|
|
4090
|
+
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4224
4091
|
icon: AvailableIcons,
|
|
4225
4092
|
emptyMessage: TranslationConfig.optional()
|
|
4226
4093
|
}).describe("Configuration for workqueue.");
|
|
@@ -4228,23 +4095,23 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4228
4095
|
query: true,
|
|
4229
4096
|
columns: true
|
|
4230
4097
|
});
|
|
4231
|
-
var WorkqueueConfigInput =
|
|
4232
|
-
slug:
|
|
4098
|
+
var WorkqueueConfigInput = z37.object({
|
|
4099
|
+
slug: z37.string().describe("Determines the url of the workqueue."),
|
|
4233
4100
|
name: TranslationConfig.describe(
|
|
4234
4101
|
"Title of the workflow (both in navigation and on the page)"
|
|
4235
4102
|
),
|
|
4236
4103
|
query: CountryConfigQueryInputType,
|
|
4237
|
-
action:
|
|
4104
|
+
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4238
4105
|
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
4239
4106
|
),
|
|
4240
|
-
columns:
|
|
4107
|
+
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4241
4108
|
icon: AvailableIcons,
|
|
4242
4109
|
emptyMessage: TranslationConfig.optional()
|
|
4243
4110
|
});
|
|
4244
|
-
var WorkqueueCountInput =
|
|
4245
|
-
|
|
4111
|
+
var WorkqueueCountInput = z37.array(
|
|
4112
|
+
z37.object({ slug: z37.string(), query: QueryType })
|
|
4246
4113
|
);
|
|
4247
|
-
var WorkqueueCountOutput =
|
|
4114
|
+
var WorkqueueCountOutput = z37.record(z37.string(), z37.number());
|
|
4248
4115
|
|
|
4249
4116
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
4250
4117
|
var defaultWorkqueueColumns = [
|
|
@@ -4267,18 +4134,18 @@ var defaultWorkqueueColumns = [
|
|
|
4267
4134
|
];
|
|
4268
4135
|
|
|
4269
4136
|
// ../commons/src/events/Draft.ts
|
|
4270
|
-
var
|
|
4137
|
+
var z39 = __toESM(require("zod/v4"));
|
|
4271
4138
|
|
|
4272
4139
|
// ../commons/src/events/ActionInput.ts
|
|
4273
|
-
var
|
|
4274
|
-
var BaseActionInput =
|
|
4140
|
+
var z38 = __toESM(require("zod/v4"));
|
|
4141
|
+
var BaseActionInput = z38.object({
|
|
4275
4142
|
eventId: UUID,
|
|
4276
|
-
transactionId:
|
|
4143
|
+
transactionId: z38.string(),
|
|
4277
4144
|
declaration: ActionUpdate.default({}),
|
|
4278
4145
|
annotation: ActionUpdate.optional(),
|
|
4279
4146
|
originalActionId: UUID.optional(),
|
|
4280
4147
|
// should not be part of base action.
|
|
4281
|
-
keepAssignment:
|
|
4148
|
+
keepAssignment: z38.boolean().optional(),
|
|
4282
4149
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4283
4150
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4284
4151
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4286,8 +4153,8 @@ var BaseActionInput = z39.object({
|
|
|
4286
4153
|
)
|
|
4287
4154
|
});
|
|
4288
4155
|
var CreateActionInput = BaseActionInput.extend(
|
|
4289
|
-
|
|
4290
|
-
type:
|
|
4156
|
+
z38.object({
|
|
4157
|
+
type: z38.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
4291
4158
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4292
4159
|
createdAtLocation: UUID.nullish().describe(
|
|
4293
4160
|
"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."
|
|
@@ -4295,14 +4162,14 @@ var CreateActionInput = BaseActionInput.extend(
|
|
|
4295
4162
|
}).shape
|
|
4296
4163
|
);
|
|
4297
4164
|
var RegisterActionInput = BaseActionInput.extend(
|
|
4298
|
-
|
|
4299
|
-
type:
|
|
4300
|
-
registrationNumber:
|
|
4165
|
+
z38.strictObject({
|
|
4166
|
+
type: z38.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
4167
|
+
registrationNumber: z38.string().optional()
|
|
4301
4168
|
}).shape
|
|
4302
4169
|
);
|
|
4303
4170
|
var NotifyActionInput = BaseActionInput.extend(
|
|
4304
|
-
|
|
4305
|
-
type:
|
|
4171
|
+
z38.object({
|
|
4172
|
+
type: z38.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
|
|
4306
4173
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4307
4174
|
createdAtLocation: UUID.nullish().describe(
|
|
4308
4175
|
"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."
|
|
@@ -4318,100 +4185,100 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
4318
4185
|
}
|
|
4319
4186
|
});
|
|
4320
4187
|
var DeclareActionInput = BaseActionInput.extend(
|
|
4321
|
-
|
|
4322
|
-
type:
|
|
4188
|
+
z38.object({
|
|
4189
|
+
type: z38.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
4323
4190
|
}).shape
|
|
4324
4191
|
);
|
|
4325
4192
|
var EditActionInput = BaseActionInput.extend(
|
|
4326
|
-
|
|
4327
|
-
type:
|
|
4328
|
-
content:
|
|
4329
|
-
comment:
|
|
4193
|
+
z38.object({
|
|
4194
|
+
type: z38.literal(ActionType.EDIT).default(ActionType.EDIT),
|
|
4195
|
+
content: z38.object({
|
|
4196
|
+
comment: z38.string().describe("Comment for the edit action.").optional()
|
|
4330
4197
|
})
|
|
4331
4198
|
}).shape
|
|
4332
4199
|
);
|
|
4333
4200
|
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
4334
|
-
|
|
4335
|
-
type:
|
|
4201
|
+
z38.object({
|
|
4202
|
+
type: z38.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
4336
4203
|
content: PrintContent.optional()
|
|
4337
4204
|
}).shape
|
|
4338
4205
|
);
|
|
4339
4206
|
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
4340
|
-
|
|
4341
|
-
type:
|
|
4207
|
+
z38.object({
|
|
4208
|
+
type: z38.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
4342
4209
|
content: ReasonContent
|
|
4343
4210
|
}).shape
|
|
4344
4211
|
);
|
|
4345
4212
|
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
4346
|
-
|
|
4347
|
-
type:
|
|
4348
|
-
content:
|
|
4349
|
-
duplicates:
|
|
4213
|
+
z38.object({
|
|
4214
|
+
type: z38.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
4215
|
+
content: z38.object({
|
|
4216
|
+
duplicates: z38.array(PotentialDuplicate)
|
|
4350
4217
|
})
|
|
4351
4218
|
}).shape
|
|
4352
4219
|
);
|
|
4353
4220
|
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
4354
|
-
|
|
4355
|
-
type:
|
|
4356
|
-
content:
|
|
4221
|
+
z38.object({
|
|
4222
|
+
type: z38.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
4223
|
+
content: z38.object({
|
|
4357
4224
|
duplicateOf: UUID
|
|
4358
4225
|
}).optional()
|
|
4359
4226
|
}).shape
|
|
4360
4227
|
);
|
|
4361
4228
|
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
4362
|
-
|
|
4363
|
-
type:
|
|
4229
|
+
z38.object({
|
|
4230
|
+
type: z38.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
4364
4231
|
}).shape
|
|
4365
4232
|
);
|
|
4366
4233
|
var ArchiveActionInput = BaseActionInput.extend(
|
|
4367
|
-
|
|
4368
|
-
type:
|
|
4234
|
+
z38.object({
|
|
4235
|
+
type: z38.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
4369
4236
|
content: ReasonContent
|
|
4370
4237
|
}).shape
|
|
4371
4238
|
);
|
|
4372
4239
|
var AssignActionInput = BaseActionInput.extend(
|
|
4373
|
-
|
|
4374
|
-
type:
|
|
4375
|
-
assignedTo:
|
|
4240
|
+
z38.object({
|
|
4241
|
+
type: z38.literal(ActionType.ASSIGN),
|
|
4242
|
+
assignedTo: z38.string()
|
|
4376
4243
|
}).shape
|
|
4377
4244
|
);
|
|
4378
4245
|
var UnassignActionInput = BaseActionInput.extend(
|
|
4379
|
-
|
|
4380
|
-
type:
|
|
4381
|
-
assignedTo:
|
|
4246
|
+
z38.object({
|
|
4247
|
+
type: z38.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
4248
|
+
assignedTo: z38.literal(null).default(null)
|
|
4382
4249
|
}).shape
|
|
4383
4250
|
);
|
|
4384
4251
|
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
4385
|
-
|
|
4386
|
-
type:
|
|
4252
|
+
z38.object({
|
|
4253
|
+
type: z38.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
4387
4254
|
}).shape
|
|
4388
4255
|
);
|
|
4389
4256
|
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
4390
|
-
|
|
4391
|
-
requestId:
|
|
4392
|
-
type:
|
|
4257
|
+
z38.object({
|
|
4258
|
+
requestId: z38.string(),
|
|
4259
|
+
type: z38.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
4393
4260
|
content: ReasonContent
|
|
4394
4261
|
}).shape
|
|
4395
4262
|
);
|
|
4396
4263
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4397
|
-
|
|
4398
|
-
requestId:
|
|
4399
|
-
type:
|
|
4264
|
+
z38.object({
|
|
4265
|
+
requestId: z38.string(),
|
|
4266
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4400
4267
|
}).shape
|
|
4401
4268
|
);
|
|
4402
4269
|
var ReadActionInput = BaseActionInput.extend(
|
|
4403
|
-
|
|
4404
|
-
type:
|
|
4270
|
+
z38.object({
|
|
4271
|
+
type: z38.literal(ActionType.READ).default(ActionType.READ)
|
|
4405
4272
|
}).shape
|
|
4406
4273
|
);
|
|
4407
|
-
var DeleteActionInput =
|
|
4274
|
+
var DeleteActionInput = z38.object({ eventId: UUID });
|
|
4408
4275
|
var CustomActionInput = BaseActionInput.extend(
|
|
4409
|
-
|
|
4410
|
-
type:
|
|
4411
|
-
customActionType:
|
|
4276
|
+
z38.object({
|
|
4277
|
+
type: z38.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
4278
|
+
customActionType: z38.string().describe("Name of the custom action.")
|
|
4412
4279
|
}).shape
|
|
4413
4280
|
);
|
|
4414
|
-
var ActionInput =
|
|
4281
|
+
var ActionInput = z38.discriminatedUnion("type", [
|
|
4415
4282
|
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
4416
4283
|
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
4417
4284
|
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
@@ -4447,11 +4314,11 @@ var ActionInput = z39.discriminatedUnion("type", [
|
|
|
4447
4314
|
});
|
|
4448
4315
|
|
|
4449
4316
|
// ../commons/src/events/Draft.ts
|
|
4450
|
-
var Draft =
|
|
4317
|
+
var Draft = z39.object({
|
|
4451
4318
|
id: UUID,
|
|
4452
4319
|
eventId: UUID,
|
|
4453
|
-
transactionId:
|
|
4454
|
-
createdAt:
|
|
4320
|
+
transactionId: z39.string(),
|
|
4321
|
+
createdAt: z39.string().datetime(),
|
|
4455
4322
|
action: ActionBase.extend({
|
|
4456
4323
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
4457
4324
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -4460,7 +4327,7 @@ var Draft = z40.object({
|
|
|
4460
4327
|
);
|
|
4461
4328
|
var DraftInput = BaseActionInput.extend({
|
|
4462
4329
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4463
|
-
status:
|
|
4330
|
+
status: z39.enum([
|
|
4464
4331
|
ActionStatus.Requested,
|
|
4465
4332
|
ActionStatus.Accepted,
|
|
4466
4333
|
ActionStatus.Rejected
|
|
@@ -4468,27 +4335,27 @@ var DraftInput = BaseActionInput.extend({
|
|
|
4468
4335
|
});
|
|
4469
4336
|
|
|
4470
4337
|
// ../commons/src/events/EventInput.ts
|
|
4471
|
-
var
|
|
4338
|
+
var z40 = __toESM(require("zod/v4"));
|
|
4472
4339
|
var import_uuid10 = require("uuid");
|
|
4473
|
-
var EventInput =
|
|
4474
|
-
transactionId:
|
|
4475
|
-
type:
|
|
4340
|
+
var EventInput = z40.object({
|
|
4341
|
+
transactionId: z40.string(),
|
|
4342
|
+
type: z40.string(),
|
|
4476
4343
|
createdAtLocation: UUID.nullish().describe(
|
|
4477
4344
|
"Location where the event occurred. Required for system users."
|
|
4478
4345
|
)
|
|
4479
4346
|
}).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
4480
4347
|
|
|
4481
4348
|
// ../commons/src/events/EventDocument.ts
|
|
4482
|
-
var
|
|
4483
|
-
var EventDocument =
|
|
4349
|
+
var z41 = __toESM(require("zod/v4"));
|
|
4350
|
+
var EventDocument = z41.object({
|
|
4484
4351
|
id: UUID.describe("Unique identifier of the event."),
|
|
4485
|
-
type:
|
|
4486
|
-
createdAt:
|
|
4487
|
-
updatedAt:
|
|
4352
|
+
type: z41.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
4353
|
+
createdAt: z41.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
4354
|
+
updatedAt: z41.string().datetime().describe(
|
|
4488
4355
|
"Timestamp of the last update, excluding changes from actions."
|
|
4489
4356
|
),
|
|
4490
|
-
actions:
|
|
4491
|
-
trackingId:
|
|
4357
|
+
actions: z41.array(Action).describe("Ordered list of actions associated with the event."),
|
|
4358
|
+
trackingId: z41.string().describe(
|
|
4492
4359
|
"System-generated tracking identifier used to look up the event."
|
|
4493
4360
|
)
|
|
4494
4361
|
}).meta({ id: "EventDocument" });
|
|
@@ -4501,6 +4368,7 @@ var import_lodash2 = require("lodash");
|
|
|
4501
4368
|
var updateActions = ActionTypes.extract([
|
|
4502
4369
|
ActionType.CREATE,
|
|
4503
4370
|
ActionType.NOTIFY,
|
|
4371
|
+
ActionType.EDIT,
|
|
4504
4372
|
ActionType.DECLARE,
|
|
4505
4373
|
ActionType.REGISTER,
|
|
4506
4374
|
ActionType.REJECT,
|
|
@@ -4520,7 +4388,8 @@ var IGNORED_EVENT_TYPES = [
|
|
|
4520
4388
|
"tennis-club-membership",
|
|
4521
4389
|
"library-membership",
|
|
4522
4390
|
"child-onboarding",
|
|
4523
|
-
"digital-identity"
|
|
4391
|
+
"digital-identity",
|
|
4392
|
+
"event-with-optional-address"
|
|
4524
4393
|
];
|
|
4525
4394
|
function warnOnConfigurationIssues(config) {
|
|
4526
4395
|
const eventId = config.id;
|
|
@@ -6932,8 +6801,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6932
6801
|
});
|
|
6933
6802
|
|
|
6934
6803
|
// ../commons/src/events/test.utils.ts
|
|
6935
|
-
var
|
|
6936
|
-
var TestUserRole =
|
|
6804
|
+
var z42 = __toESM(require("zod/v4"));
|
|
6805
|
+
var TestUserRole = z42.enum([
|
|
6937
6806
|
"FIELD_AGENT",
|
|
6938
6807
|
"LOCAL_REGISTRAR",
|
|
6939
6808
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6949,26 +6818,26 @@ var TestUserRole = z43.enum([
|
|
|
6949
6818
|
var import_lodash6 = require("lodash");
|
|
6950
6819
|
|
|
6951
6820
|
// ../commons/src/events/locations.ts
|
|
6952
|
-
var
|
|
6953
|
-
var LocationTypeV1 =
|
|
6821
|
+
var z43 = __toESM(require("zod/v4"));
|
|
6822
|
+
var LocationTypeV1 = z43.enum([
|
|
6954
6823
|
"ADMIN_STRUCTURE",
|
|
6955
6824
|
"CRVS_OFFICE",
|
|
6956
6825
|
"HEALTH_FACILITY"
|
|
6957
6826
|
]);
|
|
6958
|
-
var AdministrativeArea =
|
|
6827
|
+
var AdministrativeArea = z43.object({
|
|
6959
6828
|
id: UUID,
|
|
6960
|
-
name:
|
|
6961
|
-
externalId:
|
|
6829
|
+
name: z43.string(),
|
|
6830
|
+
externalId: z43.string().nullish(),
|
|
6962
6831
|
parentId: UUID.nullable(),
|
|
6963
|
-
validUntil:
|
|
6832
|
+
validUntil: z43.iso.datetime().nullable()
|
|
6964
6833
|
});
|
|
6965
|
-
var Location =
|
|
6834
|
+
var Location = z43.object({
|
|
6966
6835
|
id: UUID,
|
|
6967
|
-
name:
|
|
6968
|
-
externalId:
|
|
6836
|
+
name: z43.string(),
|
|
6837
|
+
externalId: z43.string().nullish(),
|
|
6969
6838
|
administrativeAreaId: UUID.nullable(),
|
|
6970
|
-
validUntil:
|
|
6971
|
-
locationType:
|
|
6839
|
+
validUntil: z43.iso.datetime().nullable(),
|
|
6840
|
+
locationType: z43.string().nullable()
|
|
6972
6841
|
});
|
|
6973
6842
|
|
|
6974
6843
|
// ../commons/src/events/scopes.ts
|
|
@@ -6978,7 +6847,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
6978
6847
|
[ActionType.NOTIFY]: ["record.notify"],
|
|
6979
6848
|
[ActionType.DECLARE]: ["record.declare", "record.register"],
|
|
6980
6849
|
[ActionType.EDIT]: ["record.edit"],
|
|
6981
|
-
[ActionType.DELETE]: ["record.declare"],
|
|
6850
|
+
[ActionType.DELETE]: ["record.declare", "record.notify"],
|
|
6982
6851
|
[ActionType.REGISTER]: ["record.register"],
|
|
6983
6852
|
[ActionType.PRINT_CERTIFICATE]: ["record.print-certified-copies"],
|
|
6984
6853
|
[ActionType.REQUEST_CORRECTION]: [
|
|
@@ -7055,7 +6924,7 @@ var ACTION_FILTERS = {
|
|
|
7055
6924
|
var import_lodash7 = require("lodash");
|
|
7056
6925
|
|
|
7057
6926
|
// ../commons/src/notification/UserNotifications.ts
|
|
7058
|
-
var
|
|
6927
|
+
var z44 = __toESM(require("zod/v4"));
|
|
7059
6928
|
var TriggerEvent = {
|
|
7060
6929
|
USER_CREATED: "user-created",
|
|
7061
6930
|
USER_UPDATED: "user-updated",
|
|
@@ -7067,50 +6936,50 @@ var TriggerEvent = {
|
|
|
7067
6936
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
7068
6937
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
7069
6938
|
};
|
|
7070
|
-
var Recipient =
|
|
6939
|
+
var Recipient = z44.object({
|
|
7071
6940
|
name: NameFieldValue.optional(),
|
|
7072
|
-
mobile:
|
|
7073
|
-
email:
|
|
7074
|
-
bcc:
|
|
6941
|
+
mobile: z44.string().optional(),
|
|
6942
|
+
email: z44.string().optional(),
|
|
6943
|
+
bcc: z44.array(z44.string()).optional()
|
|
7075
6944
|
});
|
|
7076
|
-
var BasePayload =
|
|
6945
|
+
var BasePayload = z44.object({
|
|
7077
6946
|
recipient: Recipient
|
|
7078
6947
|
});
|
|
7079
6948
|
var TriggerPayload = {
|
|
7080
6949
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
7081
|
-
username:
|
|
7082
|
-
temporaryPassword:
|
|
6950
|
+
username: z44.string(),
|
|
6951
|
+
temporaryPassword: z44.string()
|
|
7083
6952
|
}),
|
|
7084
6953
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
7085
|
-
oldUsername:
|
|
7086
|
-
newUsername:
|
|
6954
|
+
oldUsername: z44.string(),
|
|
6955
|
+
newUsername: z44.string()
|
|
7087
6956
|
}),
|
|
7088
6957
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
7089
|
-
username:
|
|
6958
|
+
username: z44.string()
|
|
7090
6959
|
}),
|
|
7091
6960
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
7092
|
-
code:
|
|
6961
|
+
code: z44.string()
|
|
7093
6962
|
}),
|
|
7094
6963
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
7095
|
-
temporaryPassword:
|
|
7096
|
-
admin:
|
|
7097
|
-
id:
|
|
6964
|
+
temporaryPassword: z44.string(),
|
|
6965
|
+
admin: z44.object({
|
|
6966
|
+
id: z44.string(),
|
|
7098
6967
|
name: NameFieldValue,
|
|
7099
|
-
role:
|
|
6968
|
+
role: z44.string()
|
|
7100
6969
|
})
|
|
7101
6970
|
}),
|
|
7102
6971
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
7103
|
-
code:
|
|
6972
|
+
code: z44.string()
|
|
7104
6973
|
}),
|
|
7105
6974
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
7106
|
-
subject:
|
|
7107
|
-
body:
|
|
6975
|
+
subject: z44.string(),
|
|
6976
|
+
body: z44.string()
|
|
7108
6977
|
}),
|
|
7109
6978
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
7110
|
-
code:
|
|
6979
|
+
code: z44.string()
|
|
7111
6980
|
}),
|
|
7112
6981
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
7113
|
-
code:
|
|
6982
|
+
code: z44.string()
|
|
7114
6983
|
})
|
|
7115
6984
|
};
|
|
7116
6985
|
async function triggerUserEventNotification({
|
|
@@ -7134,4 +7003,4 @@ function parseUserEventTrigger(event2, body) {
|
|
|
7134
7003
|
}
|
|
7135
7004
|
|
|
7136
7005
|
// src/notification/index.ts
|
|
7137
|
-
|
|
7006
|
+
z45.globalRegistry.clear();
|