@nira-opencrvs/toolkit 1.9.11-rc.1f36427

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.
Files changed (77) hide show
  1. package/README.md +70 -0
  2. package/build.sh +56 -0
  3. package/dist/api/index.d.ts +11 -0
  4. package/dist/api/index.d.ts.map +1 -0
  5. package/dist/api/index.js +52 -0
  6. package/dist/commons/api/router.d.ts +4125 -0
  7. package/dist/commons/conditionals/conditionals.d.ts +824 -0
  8. package/dist/commons/conditionals/index.d.ts +2 -0
  9. package/dist/commons/conditionals/validate.d.ts +101 -0
  10. package/dist/commons/events/ActionConfig.d.ts +1609 -0
  11. package/dist/commons/events/ActionDocument.d.ts +2180 -0
  12. package/dist/commons/events/ActionInput.d.ts +1229 -0
  13. package/dist/commons/events/ActionType.d.ts +52 -0
  14. package/dist/commons/events/AdvancedSearchConfig.d.ts +1538 -0
  15. package/dist/commons/events/CompositeFieldValue.d.ts +280 -0
  16. package/dist/commons/events/Conditional.d.ts +55 -0
  17. package/dist/commons/events/Constants.d.ts +3 -0
  18. package/dist/commons/events/CountryConfigQueryInput.d.ts +4784 -0
  19. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  20. package/dist/commons/events/DeduplicationConfig.d.ts +233 -0
  21. package/dist/commons/events/Draft.d.ts +118 -0
  22. package/dist/commons/events/DynamicFieldValue.d.ts +139 -0
  23. package/dist/commons/events/EventConfig.d.ts +2255 -0
  24. package/dist/commons/events/EventConfigInput.d.ts +10 -0
  25. package/dist/commons/events/EventDocument.d.ts +1457 -0
  26. package/dist/commons/events/EventIndex.d.ts +1134 -0
  27. package/dist/commons/events/EventInput.d.ts +13 -0
  28. package/dist/commons/events/EventMetadata.d.ts +413 -0
  29. package/dist/commons/events/FieldConfig.d.ts +12935 -0
  30. package/dist/commons/events/FieldType.d.ts +55 -0
  31. package/dist/commons/events/FieldTypeMapping.d.ts +1289 -0
  32. package/dist/commons/events/FieldValue.d.ts +512 -0
  33. package/dist/commons/events/FileUtils.d.ts +4 -0
  34. package/dist/commons/events/FormConfig.d.ts +755 -0
  35. package/dist/commons/events/PageConfig.d.ts +342 -0
  36. package/dist/commons/events/PlainDate.d.ts +19 -0
  37. package/dist/commons/events/SummaryConfig.d.ts +170 -0
  38. package/dist/commons/events/TemplateConfig.d.ts +66 -0
  39. package/dist/commons/events/TranslationConfig.d.ts +15 -0
  40. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  41. package/dist/commons/events/WorkqueueConfig.d.ts +7957 -0
  42. package/dist/commons/events/deduplication.d.ts +69 -0
  43. package/dist/commons/events/defineConfig.d.ts +234 -0
  44. package/dist/commons/events/event.d.ts +80 -0
  45. package/dist/commons/events/field.d.ts +514 -0
  46. package/dist/commons/events/index.d.ts +45 -0
  47. package/dist/commons/events/locations.d.ts +24 -0
  48. package/dist/commons/events/scopes.d.ts +55 -0
  49. package/dist/commons/events/serializer.d.ts +2 -0
  50. package/dist/commons/events/state/availableActions.d.ts +6 -0
  51. package/dist/commons/events/state/flags.d.ts +4 -0
  52. package/dist/commons/events/state/index.d.ts +119 -0
  53. package/dist/commons/events/state/utils.d.ts +311 -0
  54. package/dist/commons/events/test.utils.d.ts +248 -0
  55. package/dist/commons/events/transactions.d.ts +2 -0
  56. package/dist/commons/events/utils.d.ts +486 -0
  57. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  58. package/dist/commons/notification/UserNotifications.d.ts +762 -0
  59. package/dist/commons/notification/index.d.ts +2 -0
  60. package/dist/conditionals/index.d.ts +2 -0
  61. package/dist/conditionals/index.d.ts.map +1 -0
  62. package/dist/conditionals/index.js +689 -0
  63. package/dist/events/deduplication.d.ts +69 -0
  64. package/dist/events/deduplication.d.ts.map +1 -0
  65. package/dist/events/deduplication.js +101 -0
  66. package/dist/events/index.d.ts +2 -0
  67. package/dist/events/index.d.ts.map +1 -0
  68. package/dist/events/index.js +9327 -0
  69. package/dist/notification/index.d.ts +2 -0
  70. package/dist/notification/index.d.ts.map +1 -0
  71. package/dist/notification/index.js +6674 -0
  72. package/dist/scopes/index.d.ts +385 -0
  73. package/dist/scopes/index.d.ts.map +1 -0
  74. package/dist/scopes/index.js +349 -0
  75. package/package.json +40 -0
  76. package/tsconfig.json +27 -0
  77. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,349 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/scopes/index.ts
21
+ var scopes_exports = {};
22
+ __export(scopes_exports, {
23
+ ActionScopes: () => ActionScopes,
24
+ RecordScope: () => RecordScope,
25
+ RecordScopeType: () => RecordScopeType,
26
+ SCOPES: () => SCOPES,
27
+ SearchScopes: () => SearchScopes,
28
+ findScope: () => findScope,
29
+ getAuthorizedEventsFromScopes: () => getAuthorizedEventsFromScopes,
30
+ parseConfigurableScope: () => parseConfigurableScope,
31
+ parseLiteralScope: () => parseLiteralScope,
32
+ scopes: () => scopes,
33
+ stringifyScope: () => stringifyScope
34
+ });
35
+ module.exports = __toCommonJS(scopes_exports);
36
+
37
+ // ../commons/src/scopes.ts
38
+ var import_zod = require("zod");
39
+ var SCOPES = {
40
+ // TODO v1.8 legacy scopes
41
+ BYPASSRATELIMIT: "bypassratelimit",
42
+ REGISTER: "register",
43
+ DEMO: "demo",
44
+ CONFIG: "config",
45
+ // systems / integrations
46
+ WEBHOOK: "webhook",
47
+ NATIONALID: "nationalId",
48
+ NOTIFICATION_API: "notification-api",
49
+ RECORDSEARCH: "recordsearch",
50
+ RECORD_IMPORT: "record.import",
51
+ RECORD_EXPORT: "record.export",
52
+ RECORD_REINDEX: "record.reindex",
53
+ // declare
54
+ RECORD_DECLARE_BIRTH: "record.declare-birth",
55
+ RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
56
+ RECORD_DECLARE_DEATH: "record.declare-death",
57
+ RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction",
58
+ RECORD_DECLARE_MARRIAGE: "record.declare-marriage",
59
+ RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction",
60
+ RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete",
61
+ // @todo: should this record be removed from events v2?
62
+ RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review",
63
+ RECORD_UNASSIGN_OTHERS: "record.unassign-others",
64
+ // validate
65
+ RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval",
66
+ RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates",
67
+ RECORD_DECLARATION_EDIT: "record.declaration-edit",
68
+ RECORD_REVIEW_DUPLICATES: "record.review-duplicates",
69
+ RECORD_DECLARATION_ARCHIVE: "record.declaration-archive",
70
+ RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate",
71
+ // register
72
+ RECORD_REGISTER: "record.register",
73
+ /**
74
+ * This scope is used to **print and **issue certified copies of a record
75
+ * after it has been registered. Previously Registrars had this permission.
76
+ */
77
+ RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies",
78
+ // correct
79
+ RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction",
80
+ RECORD_REGISTRATION_CORRECT: "record.registration-correct",
81
+ RECORD_CONFIRM_REGISTRATION: "record.confirm-registration",
82
+ RECORD_REJECT_REGISTRATION: "record.reject-registration",
83
+ // search
84
+ SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction",
85
+ SEARCH_BIRTH: "search.birth",
86
+ SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction",
87
+ SEARCH_DEATH: "search.death",
88
+ SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction",
89
+ SEARCH_MARRIAGE: "search.marriage",
90
+ // audit v1.8
91
+ RECORD_READ: "record.read",
92
+ // profile
93
+ PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature",
94
+ // performance
95
+ PERFORMANCE_READ: "performance.read",
96
+ PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards",
97
+ PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export",
98
+ // organisation
99
+ ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all",
100
+ ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office",
101
+ ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction",
102
+ // user
103
+ USER_READ: "user.read:all",
104
+ USER_READ_MY_OFFICE: "user.read:my-office",
105
+ USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction",
106
+ USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit",
107
+ //v1.8
108
+ USER_CREATE: "user.create:all",
109
+ USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction",
110
+ USER_UPDATE: "user.update:all",
111
+ USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction",
112
+ // config
113
+ CONFIG_UPDATE_ALL: "config.update:all",
114
+ // data seeding
115
+ USER_DATA_SEEDING: "user.data-seeding"
116
+ };
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)
122
+ ]);
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)
128
+ ]);
129
+ var InternalOperationsScopes = import_zod.z.union([
130
+ import_zod.z.literal(SCOPES.RECORD_REINDEX),
131
+ import_zod.z.literal(SCOPES.RECORD_IMPORT)
132
+ ]);
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)
142
+ ]);
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)
151
+ ]);
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)
158
+ ]);
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)
166
+ ]);
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)
172
+ ]);
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)
177
+ ]);
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)
187
+ ]);
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([
191
+ LegacyScopes,
192
+ IntegrationScopes,
193
+ UnassignScope,
194
+ DeclareScopes,
195
+ ValidateScopes,
196
+ RegisterScope,
197
+ import_zod.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
198
+ CorrectionScopes,
199
+ SearchScopes,
200
+ AuditScopes,
201
+ import_zod.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
202
+ PerformanceScopes,
203
+ OrganisationScopes,
204
+ UserScopes,
205
+ ConfigScope,
206
+ DataSeedingScope,
207
+ InternalOperationsScopes
208
+ ]);
209
+ var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
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())
215
+ })
216
+ });
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())
221
+ })
222
+ });
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())
227
+ })
228
+ });
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)
234
+ })
235
+ });
236
+ var PrintCertifiedCopiesScope = import_zod.z.object({
237
+ type: import_zod.z.literal("record.registered.print-certified-copies"),
238
+ options: import_zod.z.object({
239
+ event: import_zod.z.array(import_zod.z.string()).describe("Event type, e.g. birth, death"),
240
+ templates: import_zod.z.array(import_zod.z.string()).optional().describe(
241
+ "Template IDs for certified copies. If not provided, all templates will be used."
242
+ )
243
+ })
244
+ });
245
+ var RecordScopeType = import_zod.z.enum([
246
+ "record.create",
247
+ "record.read",
248
+ "record.declare",
249
+ "record.notify",
250
+ "record.declared.validate",
251
+ "record.declared.reject",
252
+ "record.declared.archive",
253
+ "record.declared.review-duplicates",
254
+ "record.register",
255
+ "record.registered.request-correction",
256
+ "record.registered.correct",
257
+ "record.unassign-others"
258
+ ]);
259
+ var RecordScope = import_zod.z.object({
260
+ type: RecordScopeType,
261
+ options: import_zod.z.object({
262
+ event: import_zod.z.array(import_zod.z.string()).describe("Event type, e.g. birth, death")
263
+ })
264
+ }).describe(
265
+ "Scopes used to check user's permission to perform actions on a record."
266
+ );
267
+ var ConfigurableRawScopes = import_zod.z.discriminatedUnion("type", [
268
+ SearchScope,
269
+ PrintCertifiedCopiesScope,
270
+ CreateUserScope,
271
+ EditUserScope,
272
+ WorkqueueScope,
273
+ RecordScope
274
+ ]);
275
+ function flattenAndMergeScopes(scopes2) {
276
+ if (scopes2.length === 0) return null;
277
+ const type = scopes2[0].type;
278
+ const mergedOptions = {};
279
+ for (const scope of scopes2) {
280
+ const entries = Object.entries(scope.options);
281
+ if (entries.length < 2) continue;
282
+ const sourceValues = entries[0][1];
283
+ const targetValues = entries[1][1];
284
+ for (let i = 0; i < sourceValues.length; i++) {
285
+ mergedOptions[sourceValues[i]] = targetValues[i];
286
+ }
287
+ }
288
+ return { type, options: mergedOptions };
289
+ }
290
+ function findScope(scopes2, scopeType) {
291
+ const parsedScopes = scopes2.map(parseConfigurableScope);
292
+ const searchScopes = parsedScopes.filter((scope) => scope?.type === "search");
293
+ const otherScopes = parsedScopes.filter((scope) => scope?.type !== "search");
294
+ const mergedSearchScope = flattenAndMergeScopes(searchScopes);
295
+ return [...otherScopes, mergedSearchScope].find(
296
+ (scope) => scope?.type === scopeType
297
+ );
298
+ }
299
+ function getScopeOptions(rawOptions) {
300
+ return rawOptions.split(",").reduce((acc, option) => {
301
+ const [key, value] = option.split("=");
302
+ acc[key] = value.split("|");
303
+ return acc;
304
+ }, {});
305
+ }
306
+ function parseConfigurableScope(scope) {
307
+ const maybeConfigurableScope = rawConfigurableScope.safeParse(scope);
308
+ if (!maybeConfigurableScope.success) {
309
+ return;
310
+ }
311
+ const rawScope = maybeConfigurableScope.data;
312
+ const [, type, rawOptions] = rawScope.match(rawConfigurableScopeRegex) ?? [];
313
+ const options = getScopeOptions(rawOptions);
314
+ const parsedScope = {
315
+ type,
316
+ options
317
+ };
318
+ const result = ConfigurableRawScopes.safeParse(parsedScope);
319
+ return result.success ? result.data : void 0;
320
+ }
321
+ function parseLiteralScope(scope) {
322
+ const maybeLiteralScope = LiteralScopes.safeParse(scope);
323
+ if (maybeLiteralScope.success) {
324
+ return {
325
+ type: maybeLiteralScope.data
326
+ };
327
+ }
328
+ return;
329
+ }
330
+ function stringifyScope(scope) {
331
+ const options = Object.entries(scope.options).map(([key, value]) => `${key}=${value.join("|")}`).join(",");
332
+ return `${scope.type}[${options}]`;
333
+ }
334
+ function getAuthorizedEventsFromScopes(scopes2) {
335
+ return scopes2.flatMap(({ options }) => {
336
+ if (options && "event" in options) {
337
+ return options.event;
338
+ }
339
+ return void 0;
340
+ }).filter((event) => event !== void 0).filter((event, index, self) => self.indexOf(event) === index);
341
+ }
342
+ var scopes = Object.values(SCOPES);
343
+ var ActionScopes = import_zod.z.union([
344
+ DeclareScopes,
345
+ ValidateScopes,
346
+ RegisterScope,
347
+ import_zod.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
348
+ CorrectionScopes
349
+ ]);
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@nira-opencrvs/toolkit",
3
+ "version": "1.9.11-rc.1f36427",
4
+ "description": "OpenCRVS toolkit for building country configurations",
5
+ "license": "MPL-2.0",
6
+ "exports": {
7
+ "./lib": "./dist/lib.js",
8
+ "./api": "./dist/api/index.js",
9
+ "./events": "./dist/events/index.js",
10
+ "./scopes": "./dist/scopes/index.js",
11
+ "./events/deduplication": "./dist/events/deduplication.js",
12
+ "./conditionals": "./dist/conditionals/index.js",
13
+ "./notification": "./dist/notification/index.js"
14
+ },
15
+ "scripts": {
16
+ "build": "./build.sh",
17
+ "build:all": "lerna run build --include-dependencies --scope @nira-opencrvs/toolkit && ./build.sh"
18
+ },
19
+ "dependencies": {
20
+ "uuid": "^9.0.0",
21
+ "ajv": "^8.17.1",
22
+ "ajv-formats": "^3.0.1",
23
+ "object-hash": "^3.0.0",
24
+ "superjson": "1.9.0-0",
25
+ "@trpc/client": "11.4.3",
26
+ "@trpc/server": "11.4.3",
27
+ "zod-openapi": "^4.2.4"
28
+ },
29
+ "devDependencies": {
30
+ "@types/uuid": "^9.0.3",
31
+ "esbuild": "^0.24.0",
32
+ "typescript": "^5.6.3",
33
+ "@opencrvs/events": "^1.9.0",
34
+ "@types/object-hash": "^3.0.6"
35
+ },
36
+ "moduleNameMapper": {
37
+ "@opencrvs/commons/events": "@opencrvs/commons/build/dist/common/events/index.js",
38
+ "@opencrvs/commons/scopes": "@opencrvs/commons/build/dist/common/scopes.js"
39
+ }
40
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["esnext"],
4
+ "target": "es2016",
5
+ "module": "node16",
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "declaration": true,
11
+ "declarationMap": true,
12
+ "rootDir": "./src",
13
+ "outDir": "dist",
14
+ "paths": {
15
+ "@opencrvs/commons/conditionals": [
16
+ "../commons/src/conditionals/conditionals.ts"
17
+ ],
18
+ "@opencrvs/commons/scopes": ["../commons/src/scopes.ts"],
19
+ "@opencrvs/commons/events": ["../commons/src/events/index.ts"],
20
+ "@opencrvs/commons/events/deduplication": ["../commons/src/events/deduplication.ts"],
21
+ "@opencrvs/commons/notification": ["../commons/src/notification/index.ts"]
22
+ }
23
+ },
24
+ "references": [{ "path": "../commons/tsconfig-commonjs.json" }],
25
+ "include": ["src/**/*.ts"],
26
+ "exclude": ["**/node_modules/**", "dist"]
27
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/api/index.ts","./src/conditionals/index.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"5.6.3"}