@opencrvs/toolkit 1.9.3-rc.da977ad → 1.9.3-rc.e47111c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commons/api/router.d.ts +2428 -28200
- package/dist/commons/conditionals/conditionals.d.ts +1 -10
- package/dist/commons/conditionals/validate.d.ts +4 -11
- package/dist/commons/events/ActionConfig.d.ts +1547 -23121
- package/dist/commons/events/ActionDocument.d.ts +1849 -840
- package/dist/commons/events/ActionInput.d.ts +1066 -290
- package/dist/commons/events/ActionType.d.ts +8 -91
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1244 -222
- package/dist/commons/events/CompositeFieldValue.d.ts +198 -25
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4169 -931
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +150 -15
- package/dist/commons/events/Draft.d.ts +105 -72
- package/dist/commons/events/DynamicFieldValue.d.ts +91 -7
- package/dist/commons/events/EventConfig.d.ts +2122 -18321
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +1326 -336
- package/dist/commons/events/EventIndex.d.ts +967 -197
- package/dist/commons/events/EventInput.d.ts +8 -2
- package/dist/commons/events/EventMetadata.d.ts +346 -106
- package/dist/commons/events/FieldConfig.d.ts +12051 -4164
- package/dist/commons/events/FieldType.d.ts +5 -9
- package/dist/commons/events/FieldTypeMapping.d.ts +896 -172
- package/dist/commons/events/FieldValue.d.ts +405 -84
- package/dist/commons/events/FormConfig.d.ts +721 -12876
- package/dist/commons/events/PageConfig.d.ts +319 -8604
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7080 -1619
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +163 -25171
- package/dist/commons/events/event.d.ts +4 -4
- package/dist/commons/events/index.d.ts +0 -1
- package/dist/commons/events/locations.d.ts +19 -15
- package/dist/commons/events/scopes.d.ts +1 -3
- package/dist/commons/events/state/availableActions.d.ts +1 -2
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +19 -23
- package/dist/commons/events/state/utils.d.ts +110 -142
- package/dist/commons/events/test.utils.d.ts +6 -23
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +385 -50384
- package/dist/commons/notification/UserNotifications.d.ts +636 -55
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +5 -38
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1748 -1811
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1662 -1496
- package/dist/scopes/index.d.ts +138 -138
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +93 -123
- package/package.json +5 -5
- package/dist/commons/events/Flag.d.ts +0 -70
package/dist/scopes/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,22 +15,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/scopes/index.ts
|
|
31
21
|
var scopes_exports = {};
|
|
32
22
|
__export(scopes_exports, {
|
|
33
23
|
ActionScopes: () => ActionScopes,
|
|
34
|
-
ConfigurableActionScopes: () => ConfigurableActionScopes,
|
|
35
|
-
CustomActionScope: () => CustomActionScope,
|
|
36
24
|
RecordScope: () => RecordScope,
|
|
37
25
|
RecordScopeType: () => RecordScopeType,
|
|
38
26
|
SCOPES: () => SCOPES,
|
|
@@ -45,10 +33,9 @@ __export(scopes_exports, {
|
|
|
45
33
|
stringifyScope: () => stringifyScope
|
|
46
34
|
});
|
|
47
35
|
module.exports = __toCommonJS(scopes_exports);
|
|
48
|
-
var z2 = __toESM(require("zod/v4"));
|
|
49
36
|
|
|
50
37
|
// ../commons/src/scopes.ts
|
|
51
|
-
var
|
|
38
|
+
var import_zod = require("zod");
|
|
52
39
|
var SCOPES = {
|
|
53
40
|
// TODO v1.8 legacy scopes
|
|
54
41
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -127,91 +114,91 @@ var SCOPES = {
|
|
|
127
114
|
// data seeding
|
|
128
115
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
129
116
|
};
|
|
130
|
-
var LegacyScopes = z.union([
|
|
131
|
-
z.literal(SCOPES.BYPASSRATELIMIT),
|
|
132
|
-
z.literal(SCOPES.REGISTER),
|
|
133
|
-
z.literal(SCOPES.DEMO),
|
|
134
|
-
z.literal(SCOPES.CONFIG)
|
|
117
|
+
var LegacyScopes = import_zod.z.union([
|
|
118
|
+
import_zod.z.literal(SCOPES.BYPASSRATELIMIT),
|
|
119
|
+
import_zod.z.literal(SCOPES.REGISTER),
|
|
120
|
+
import_zod.z.literal(SCOPES.DEMO),
|
|
121
|
+
import_zod.z.literal(SCOPES.CONFIG)
|
|
135
122
|
]);
|
|
136
|
-
var IntegrationScopes = z.union([
|
|
137
|
-
z.literal(SCOPES.WEBHOOK),
|
|
138
|
-
z.literal(SCOPES.NATIONALID),
|
|
139
|
-
z.literal(SCOPES.NOTIFICATION_API),
|
|
140
|
-
z.literal(SCOPES.RECORDSEARCH)
|
|
123
|
+
var IntegrationScopes = import_zod.z.union([
|
|
124
|
+
import_zod.z.literal(SCOPES.WEBHOOK),
|
|
125
|
+
import_zod.z.literal(SCOPES.NATIONALID),
|
|
126
|
+
import_zod.z.literal(SCOPES.NOTIFICATION_API),
|
|
127
|
+
import_zod.z.literal(SCOPES.RECORDSEARCH)
|
|
141
128
|
]);
|
|
142
|
-
var InternalOperationsScopes = z.union([
|
|
143
|
-
z.literal(SCOPES.RECORD_REINDEX),
|
|
144
|
-
z.literal(SCOPES.RECORD_IMPORT)
|
|
129
|
+
var InternalOperationsScopes = import_zod.z.union([
|
|
130
|
+
import_zod.z.literal(SCOPES.RECORD_REINDEX),
|
|
131
|
+
import_zod.z.literal(SCOPES.RECORD_IMPORT)
|
|
145
132
|
]);
|
|
146
|
-
var DeclareScopes = z.union([
|
|
147
|
-
z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
148
|
-
z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
149
|
-
z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
150
|
-
z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
151
|
-
z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
152
|
-
z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
153
|
-
z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
154
|
-
z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
133
|
+
var DeclareScopes = import_zod.z.union([
|
|
134
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
135
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
136
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
137
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
138
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
139
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
140
|
+
import_zod.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
141
|
+
import_zod.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
155
142
|
]);
|
|
156
|
-
var UnassignScope = z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
157
|
-
var ValidateScopes = z.union([
|
|
158
|
-
z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
159
|
-
z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
160
|
-
z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
161
|
-
z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
162
|
-
z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
163
|
-
z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
143
|
+
var UnassignScope = import_zod.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
144
|
+
var ValidateScopes = import_zod.z.union([
|
|
145
|
+
import_zod.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
146
|
+
import_zod.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
147
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
148
|
+
import_zod.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
149
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
150
|
+
import_zod.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
164
151
|
]);
|
|
165
|
-
var RegisterScope = z.literal(SCOPES.RECORD_REGISTER);
|
|
166
|
-
var CorrectionScopes = z.union([
|
|
167
|
-
z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
168
|
-
z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
169
|
-
z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
170
|
-
z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
152
|
+
var RegisterScope = import_zod.z.literal(SCOPES.RECORD_REGISTER);
|
|
153
|
+
var CorrectionScopes = import_zod.z.union([
|
|
154
|
+
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
155
|
+
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
156
|
+
import_zod.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
157
|
+
import_zod.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
171
158
|
]);
|
|
172
|
-
var SearchScopes = z.union([
|
|
173
|
-
z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
174
|
-
z.literal(SCOPES.SEARCH_BIRTH),
|
|
175
|
-
z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
176
|
-
z.literal(SCOPES.SEARCH_DEATH),
|
|
177
|
-
z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
178
|
-
z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
159
|
+
var SearchScopes = import_zod.z.union([
|
|
160
|
+
import_zod.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
161
|
+
import_zod.z.literal(SCOPES.SEARCH_BIRTH),
|
|
162
|
+
import_zod.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
163
|
+
import_zod.z.literal(SCOPES.SEARCH_DEATH),
|
|
164
|
+
import_zod.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
165
|
+
import_zod.z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
179
166
|
]);
|
|
180
|
-
var AuditScopes = z.literal(SCOPES.RECORD_READ);
|
|
181
|
-
var PerformanceScopes = z.union([
|
|
182
|
-
z.literal(SCOPES.PERFORMANCE_READ),
|
|
183
|
-
z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
184
|
-
z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
167
|
+
var AuditScopes = import_zod.z.literal(SCOPES.RECORD_READ);
|
|
168
|
+
var PerformanceScopes = import_zod.z.union([
|
|
169
|
+
import_zod.z.literal(SCOPES.PERFORMANCE_READ),
|
|
170
|
+
import_zod.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
171
|
+
import_zod.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
185
172
|
]);
|
|
186
|
-
var OrganisationScopes = z.union([
|
|
187
|
-
z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
188
|
-
z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
189
|
-
z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
173
|
+
var OrganisationScopes = import_zod.z.union([
|
|
174
|
+
import_zod.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
175
|
+
import_zod.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
176
|
+
import_zod.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
190
177
|
]);
|
|
191
|
-
var UserScopes = z.union([
|
|
192
|
-
z.literal(SCOPES.USER_READ),
|
|
193
|
-
z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
194
|
-
z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
195
|
-
z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
196
|
-
z.literal(SCOPES.USER_CREATE),
|
|
197
|
-
z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
198
|
-
z.literal(SCOPES.USER_UPDATE),
|
|
199
|
-
z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
178
|
+
var UserScopes = import_zod.z.union([
|
|
179
|
+
import_zod.z.literal(SCOPES.USER_READ),
|
|
180
|
+
import_zod.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
181
|
+
import_zod.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
182
|
+
import_zod.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
183
|
+
import_zod.z.literal(SCOPES.USER_CREATE),
|
|
184
|
+
import_zod.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
185
|
+
import_zod.z.literal(SCOPES.USER_UPDATE),
|
|
186
|
+
import_zod.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
200
187
|
]);
|
|
201
|
-
var ConfigScope = z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
202
|
-
var DataSeedingScope = z.literal(SCOPES.USER_DATA_SEEDING);
|
|
203
|
-
var LiteralScopes = z.union([
|
|
188
|
+
var ConfigScope = import_zod.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
189
|
+
var DataSeedingScope = import_zod.z.literal(SCOPES.USER_DATA_SEEDING);
|
|
190
|
+
var LiteralScopes = import_zod.z.union([
|
|
204
191
|
LegacyScopes,
|
|
205
192
|
IntegrationScopes,
|
|
206
193
|
UnassignScope,
|
|
207
194
|
DeclareScopes,
|
|
208
195
|
ValidateScopes,
|
|
209
196
|
RegisterScope,
|
|
210
|
-
z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
197
|
+
import_zod.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
211
198
|
CorrectionScopes,
|
|
212
199
|
SearchScopes,
|
|
213
200
|
AuditScopes,
|
|
214
|
-
z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
201
|
+
import_zod.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
215
202
|
PerformanceScopes,
|
|
216
203
|
OrganisationScopes,
|
|
217
204
|
UserScopes,
|
|
@@ -220,38 +207,37 @@ var LiteralScopes = z.union([
|
|
|
220
207
|
InternalOperationsScopes
|
|
221
208
|
]);
|
|
222
209
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
223
|
-
var rawConfigurableScope = z.string().regex(rawConfigurableScopeRegex);
|
|
224
|
-
var CreateUserScope = z.object({
|
|
225
|
-
type: z.literal("user.create"),
|
|
226
|
-
options: z.object({
|
|
227
|
-
role: z.array(z.string())
|
|
210
|
+
var rawConfigurableScope = import_zod.z.string().regex(rawConfigurableScopeRegex);
|
|
211
|
+
var CreateUserScope = import_zod.z.object({
|
|
212
|
+
type: import_zod.z.literal("user.create"),
|
|
213
|
+
options: import_zod.z.object({
|
|
214
|
+
role: import_zod.z.array(import_zod.z.string())
|
|
228
215
|
})
|
|
229
216
|
});
|
|
230
|
-
var EditUserScope = z.object({
|
|
231
|
-
type: z.literal("user.edit"),
|
|
232
|
-
options: z.object({
|
|
233
|
-
role: z.array(z.string())
|
|
217
|
+
var EditUserScope = import_zod.z.object({
|
|
218
|
+
type: import_zod.z.literal("user.edit"),
|
|
219
|
+
options: import_zod.z.object({
|
|
220
|
+
role: import_zod.z.array(import_zod.z.string())
|
|
234
221
|
})
|
|
235
222
|
});
|
|
236
|
-
var WorkqueueScope = z.object({
|
|
237
|
-
type: z.literal("workqueue"),
|
|
238
|
-
options: z.object({
|
|
239
|
-
id: z.array(z.string())
|
|
223
|
+
var WorkqueueScope = import_zod.z.object({
|
|
224
|
+
type: import_zod.z.literal("workqueue"),
|
|
225
|
+
options: import_zod.z.object({
|
|
226
|
+
id: import_zod.z.array(import_zod.z.string())
|
|
240
227
|
})
|
|
241
228
|
});
|
|
242
|
-
var SearchScope = z.object({
|
|
243
|
-
type: z.literal("search"),
|
|
244
|
-
options: z.object({
|
|
245
|
-
event: z.array(z.string()).length(1),
|
|
246
|
-
access: z.array(z.enum(["my-jurisdiction", "all"])).length(1)
|
|
229
|
+
var SearchScope = import_zod.z.object({
|
|
230
|
+
type: import_zod.z.literal("search"),
|
|
231
|
+
options: import_zod.z.object({
|
|
232
|
+
event: import_zod.z.array(import_zod.z.string()).length(1),
|
|
233
|
+
access: import_zod.z.array(import_zod.z.enum(["my-jurisdiction", "all"])).length(1)
|
|
247
234
|
})
|
|
248
235
|
});
|
|
249
|
-
var RecordScopeType = z.enum([
|
|
236
|
+
var RecordScopeType = import_zod.z.enum([
|
|
250
237
|
"record.create",
|
|
251
238
|
"record.read",
|
|
252
239
|
"record.declare",
|
|
253
240
|
"record.notify",
|
|
254
|
-
"record.declared.edit",
|
|
255
241
|
"record.declared.validate",
|
|
256
242
|
"record.declared.reject",
|
|
257
243
|
"record.declared.archive",
|
|
@@ -262,33 +248,20 @@ var RecordScopeType = z.enum([
|
|
|
262
248
|
"record.registered.correct",
|
|
263
249
|
"record.unassign-others"
|
|
264
250
|
]);
|
|
265
|
-
var RecordScope = z.object({
|
|
251
|
+
var RecordScope = import_zod.z.object({
|
|
266
252
|
type: RecordScopeType,
|
|
267
|
-
options: z.object({
|
|
268
|
-
event: z.array(z.string()).describe("Event type, e.g. birth, death")
|
|
253
|
+
options: import_zod.z.object({
|
|
254
|
+
event: import_zod.z.array(import_zod.z.string()).describe("Event type, e.g. birth, death")
|
|
269
255
|
})
|
|
270
256
|
}).describe(
|
|
271
257
|
"Scopes used to check user's permission to perform actions on a record."
|
|
272
258
|
);
|
|
273
|
-
var
|
|
274
|
-
type: z.literal("record.custom-action"),
|
|
275
|
-
options: z.object({
|
|
276
|
-
event: z.array(z.string()).describe("Allowed event type, e.g. birth, death"),
|
|
277
|
-
customActionType: z.array(z.string()).describe("Allowed custom action types")
|
|
278
|
-
})
|
|
279
|
-
});
|
|
280
|
-
var ConfigurableRawScopes = z.discriminatedUnion("type", [
|
|
259
|
+
var ConfigurableRawScopes = import_zod.z.discriminatedUnion("type", [
|
|
281
260
|
SearchScope,
|
|
282
261
|
CreateUserScope,
|
|
283
262
|
EditUserScope,
|
|
284
263
|
WorkqueueScope,
|
|
285
|
-
RecordScope
|
|
286
|
-
CustomActionScope
|
|
287
|
-
]);
|
|
288
|
-
var ConfigurableActionScopes = z.discriminatedUnion("type", [
|
|
289
|
-
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
|
|
290
|
-
RecordScope,
|
|
291
|
-
CustomActionScope
|
|
264
|
+
RecordScope
|
|
292
265
|
]);
|
|
293
266
|
function flattenAndMergeScopes(scopes2) {
|
|
294
267
|
if (scopes2.length === 0) return null;
|
|
@@ -358,13 +331,10 @@ function getAuthorizedEventsFromScopes(scopes2) {
|
|
|
358
331
|
}).filter((event) => event !== void 0).filter((event, index, self) => self.indexOf(event) === index);
|
|
359
332
|
}
|
|
360
333
|
var scopes = Object.values(SCOPES);
|
|
361
|
-
var ActionScopes = z.union([
|
|
334
|
+
var ActionScopes = import_zod.z.union([
|
|
362
335
|
DeclareScopes,
|
|
363
336
|
ValidateScopes,
|
|
364
337
|
RegisterScope,
|
|
365
|
-
z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
338
|
+
import_zod.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
366
339
|
CorrectionScopes
|
|
367
340
|
]);
|
|
368
|
-
|
|
369
|
-
// src/scopes/index.ts
|
|
370
|
-
z2.globalRegistry.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencrvs/toolkit",
|
|
3
|
-
"version": "1.9.3-rc.
|
|
3
|
+
"version": "1.9.3-rc.e47111c",
|
|
4
4
|
"description": "OpenCRVS toolkit for building country configurations",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"exports": {
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"build:all": "lerna run build --include-dependencies --scope @opencrvs/toolkit && ./build.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"
|
|
21
|
-
"@trpc/server": "11.4.3",
|
|
20
|
+
"uuid": "^9.0.0",
|
|
22
21
|
"ajv": "^8.17.1",
|
|
23
22
|
"ajv-formats": "^3.0.1",
|
|
24
23
|
"object-hash": "^3.0.0",
|
|
25
24
|
"superjson": "1.9.0-0",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
25
|
+
"@trpc/client": "11.4.3",
|
|
26
|
+
"@trpc/server": "11.4.3",
|
|
27
|
+
"zod-openapi": "^4.2.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/uuid": "^9.0.3",
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod/v4';
|
|
2
|
-
export declare const InherentFlags: {
|
|
3
|
-
readonly PENDING_CERTIFICATION: "pending-certification";
|
|
4
|
-
readonly INCOMPLETE: "incomplete";
|
|
5
|
-
readonly REJECTED: "rejected";
|
|
6
|
-
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
7
|
-
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
8
|
-
/**
|
|
9
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
10
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
11
|
-
*
|
|
12
|
-
* We only use this flag to determine that a DECLARE or REGISTER action is allowed next.
|
|
13
|
-
*/
|
|
14
|
-
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
15
|
-
};
|
|
16
|
-
export type InherentFlags = (typeof InherentFlags)[keyof typeof InherentFlags];
|
|
17
|
-
export declare const ActionFlag: z.ZodString;
|
|
18
|
-
export type ActionFlag = z.infer<typeof ActionFlag>;
|
|
19
|
-
/** Custom flag identifier defined by the country config. These may not match any InherentFlags or ActionFlag patterns. */
|
|
20
|
-
export declare const CustomFlag: z.ZodString;
|
|
21
|
-
export type CustomFlag = z.infer<typeof CustomFlag>;
|
|
22
|
-
export declare const Flag: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
23
|
-
readonly PENDING_CERTIFICATION: "pending-certification";
|
|
24
|
-
readonly INCOMPLETE: "incomplete";
|
|
25
|
-
readonly REJECTED: "rejected";
|
|
26
|
-
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
27
|
-
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
28
|
-
/**
|
|
29
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
30
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
31
|
-
*
|
|
32
|
-
* We only use this flag to determine that a DECLARE or REGISTER action is allowed next.
|
|
33
|
-
*/
|
|
34
|
-
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
35
|
-
}>]>, z.ZodString]>;
|
|
36
|
-
export type Flag = z.infer<typeof Flag>;
|
|
37
|
-
/**
|
|
38
|
-
* Configuration of a custom flag that can be associated with a certain event type.
|
|
39
|
-
*/
|
|
40
|
-
export declare const FlagConfig: z.ZodObject<{
|
|
41
|
-
id: z.ZodString;
|
|
42
|
-
requiresAction: z.ZodBoolean;
|
|
43
|
-
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
44
|
-
}, z.core.$strip>;
|
|
45
|
-
export type FlagConfig = z.infer<typeof FlagConfig>;
|
|
46
|
-
/**
|
|
47
|
-
* Configuration for a flag action, which is executed when the action is performed.
|
|
48
|
-
*/
|
|
49
|
-
export declare const ActionFlagConfig: z.ZodObject<{
|
|
50
|
-
id: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
51
|
-
readonly PENDING_CERTIFICATION: "pending-certification";
|
|
52
|
-
readonly INCOMPLETE: "incomplete";
|
|
53
|
-
readonly REJECTED: "rejected";
|
|
54
|
-
readonly CORRECTION_REQUESTED: "correction-requested";
|
|
55
|
-
readonly POTENTIAL_DUPLICATE: "potential-duplicate";
|
|
56
|
-
/**
|
|
57
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
58
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
59
|
-
*
|
|
60
|
-
* We only use this flag to determine that a DECLARE or REGISTER action is allowed next.
|
|
61
|
-
*/
|
|
62
|
-
readonly EDIT_IN_PROGRESS: "edit-in-progress";
|
|
63
|
-
}>]>, z.ZodString]>;
|
|
64
|
-
operation: z.ZodEnum<{
|
|
65
|
-
add: "add";
|
|
66
|
-
remove: "remove";
|
|
67
|
-
}>;
|
|
68
|
-
conditional: z.ZodOptional<z.ZodAny>;
|
|
69
|
-
}, z.core.$strip>;
|
|
70
|
-
//# sourceMappingURL=Flag.d.ts.map
|