@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,385 @@
1
+ import { z } from 'zod';
2
+ import { SearchScopeAccessLevels } from './events';
3
+ export declare const SCOPES: {
4
+ readonly BYPASSRATELIMIT: "bypassratelimit";
5
+ readonly REGISTER: "register";
6
+ readonly DEMO: "demo";
7
+ readonly CONFIG: "config";
8
+ readonly WEBHOOK: "webhook";
9
+ readonly NATIONALID: "nationalId";
10
+ readonly NOTIFICATION_API: "notification-api";
11
+ readonly RECORDSEARCH: "recordsearch";
12
+ readonly RECORD_IMPORT: "record.import";
13
+ readonly RECORD_EXPORT: "record.export";
14
+ readonly RECORD_REINDEX: "record.reindex";
15
+ readonly RECORD_DECLARE_BIRTH: "record.declare-birth";
16
+ readonly RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction";
17
+ readonly RECORD_DECLARE_DEATH: "record.declare-death";
18
+ readonly RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction";
19
+ readonly RECORD_DECLARE_MARRIAGE: "record.declare-marriage";
20
+ readonly RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction";
21
+ readonly RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete";
22
+ readonly RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review";
23
+ readonly RECORD_UNASSIGN_OTHERS: "record.unassign-others";
24
+ readonly RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval";
25
+ readonly RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates";
26
+ readonly RECORD_DECLARATION_EDIT: "record.declaration-edit";
27
+ readonly RECORD_REVIEW_DUPLICATES: "record.review-duplicates";
28
+ readonly RECORD_DECLARATION_ARCHIVE: "record.declaration-archive";
29
+ readonly RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate";
30
+ readonly RECORD_REGISTER: "record.register";
31
+ /**
32
+ * This scope is used to **print and **issue certified copies of a record
33
+ * after it has been registered. Previously Registrars had this permission.
34
+ */
35
+ readonly RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies";
36
+ readonly RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction";
37
+ readonly RECORD_REGISTRATION_CORRECT: "record.registration-correct";
38
+ readonly RECORD_CONFIRM_REGISTRATION: "record.confirm-registration";
39
+ readonly RECORD_REJECT_REGISTRATION: "record.reject-registration";
40
+ readonly SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction";
41
+ readonly SEARCH_BIRTH: "search.birth";
42
+ readonly SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction";
43
+ readonly SEARCH_DEATH: "search.death";
44
+ readonly SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction";
45
+ readonly SEARCH_MARRIAGE: "search.marriage";
46
+ readonly RECORD_READ: "record.read";
47
+ readonly PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature";
48
+ readonly PERFORMANCE_READ: "performance.read";
49
+ readonly PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards";
50
+ readonly PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export";
51
+ readonly ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all";
52
+ readonly ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office";
53
+ readonly ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction";
54
+ readonly USER_READ: "user.read:all";
55
+ readonly USER_READ_MY_OFFICE: "user.read:my-office";
56
+ readonly USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction";
57
+ readonly USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit";
58
+ readonly USER_CREATE: "user.create:all";
59
+ readonly USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction";
60
+ readonly USER_UPDATE: "user.update:all";
61
+ readonly USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction";
62
+ readonly CONFIG_UPDATE_ALL: "config.update:all";
63
+ readonly USER_DATA_SEEDING: "user.data-seeding";
64
+ };
65
+ export declare const SearchScopes: z.ZodUnion<[z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>;
66
+ declare const LiteralScopes: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"register">, z.ZodLiteral<"demo">, z.ZodLiteral<"config">]>, z.ZodUnion<[z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">]>, z.ZodLiteral<"record.unassign-others">, z.ZodUnion<[z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">]>, z.ZodUnion<[z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">]>, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodUnion<[z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>, z.ZodUnion<[z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>, z.ZodLiteral<"record.read">, z.ZodLiteral<"profile.electronic-signature">, z.ZodUnion<[z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">]>, z.ZodUnion<[z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">]>, z.ZodUnion<[z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">]>, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">, z.ZodUnion<[z.ZodLiteral<"record.reindex">, z.ZodLiteral<"record.import">]>]>;
67
+ declare const SearchScope: z.ZodObject<{
68
+ type: z.ZodLiteral<"search">;
69
+ options: z.ZodObject<{
70
+ event: z.ZodArray<z.ZodString, "many">;
71
+ access: z.ZodArray<z.ZodEnum<["my-jurisdiction", "all"]>, "many">;
72
+ }, "strip", z.ZodTypeAny, {
73
+ event: string[];
74
+ access: ("my-jurisdiction" | "all")[];
75
+ }, {
76
+ event: string[];
77
+ access: ("my-jurisdiction" | "all")[];
78
+ }>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ type: "search";
81
+ options: {
82
+ event: string[];
83
+ access: ("my-jurisdiction" | "all")[];
84
+ };
85
+ }, {
86
+ type: "search";
87
+ options: {
88
+ event: string[];
89
+ access: ("my-jurisdiction" | "all")[];
90
+ };
91
+ }>;
92
+ declare const PrintCertifiedCopiesScope: z.ZodObject<{
93
+ type: z.ZodLiteral<"record.registered.print-certified-copies">;
94
+ options: z.ZodObject<{
95
+ event: z.ZodArray<z.ZodString, "many">;
96
+ templates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ event: string[];
99
+ templates?: string[] | undefined;
100
+ }, {
101
+ event: string[];
102
+ templates?: string[] | undefined;
103
+ }>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ type: "record.registered.print-certified-copies";
106
+ options: {
107
+ event: string[];
108
+ templates?: string[] | undefined;
109
+ };
110
+ }, {
111
+ type: "record.registered.print-certified-copies";
112
+ options: {
113
+ event: string[];
114
+ templates?: string[] | undefined;
115
+ };
116
+ }>;
117
+ export type SearchScope = z.infer<typeof SearchScope>;
118
+ export type PrintCertifiedCopiesScope = z.infer<typeof PrintCertifiedCopiesScope>;
119
+ export declare const RecordScopeType: z.ZodEnum<["record.create", "record.read", "record.declare", "record.notify", "record.declared.validate", "record.declared.reject", "record.declared.archive", "record.declared.review-duplicates", "record.register", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
120
+ export type RecordScopeType = z.infer<typeof RecordScopeType>;
121
+ export declare const RecordScope: z.ZodObject<{
122
+ type: z.ZodEnum<["record.create", "record.read", "record.declare", "record.notify", "record.declared.validate", "record.declared.reject", "record.declared.archive", "record.declared.review-duplicates", "record.register", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
123
+ options: z.ZodObject<{
124
+ event: z.ZodArray<z.ZodString, "many">;
125
+ }, "strip", z.ZodTypeAny, {
126
+ event: string[];
127
+ }, {
128
+ event: string[];
129
+ }>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
132
+ options: {
133
+ event: string[];
134
+ };
135
+ }, {
136
+ type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
137
+ options: {
138
+ event: string[];
139
+ };
140
+ }>;
141
+ export type RecordScope = z.infer<typeof RecordScope>;
142
+ declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
143
+ type: z.ZodLiteral<"search">;
144
+ options: z.ZodObject<{
145
+ event: z.ZodArray<z.ZodString, "many">;
146
+ access: z.ZodArray<z.ZodEnum<["my-jurisdiction", "all"]>, "many">;
147
+ }, "strip", z.ZodTypeAny, {
148
+ event: string[];
149
+ access: ("my-jurisdiction" | "all")[];
150
+ }, {
151
+ event: string[];
152
+ access: ("my-jurisdiction" | "all")[];
153
+ }>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ type: "search";
156
+ options: {
157
+ event: string[];
158
+ access: ("my-jurisdiction" | "all")[];
159
+ };
160
+ }, {
161
+ type: "search";
162
+ options: {
163
+ event: string[];
164
+ access: ("my-jurisdiction" | "all")[];
165
+ };
166
+ }>, z.ZodObject<{
167
+ type: z.ZodLiteral<"record.registered.print-certified-copies">;
168
+ options: z.ZodObject<{
169
+ event: z.ZodArray<z.ZodString, "many">;
170
+ templates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ event: string[];
173
+ templates?: string[] | undefined;
174
+ }, {
175
+ event: string[];
176
+ templates?: string[] | undefined;
177
+ }>;
178
+ }, "strip", z.ZodTypeAny, {
179
+ type: "record.registered.print-certified-copies";
180
+ options: {
181
+ event: string[];
182
+ templates?: string[] | undefined;
183
+ };
184
+ }, {
185
+ type: "record.registered.print-certified-copies";
186
+ options: {
187
+ event: string[];
188
+ templates?: string[] | undefined;
189
+ };
190
+ }>, z.ZodObject<{
191
+ type: z.ZodLiteral<"user.create">;
192
+ options: z.ZodObject<{
193
+ role: z.ZodArray<z.ZodString, "many">;
194
+ }, "strip", z.ZodTypeAny, {
195
+ role: string[];
196
+ }, {
197
+ role: string[];
198
+ }>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ type: "user.create";
201
+ options: {
202
+ role: string[];
203
+ };
204
+ }, {
205
+ type: "user.create";
206
+ options: {
207
+ role: string[];
208
+ };
209
+ }>, z.ZodObject<{
210
+ type: z.ZodLiteral<"user.edit">;
211
+ options: z.ZodObject<{
212
+ role: z.ZodArray<z.ZodString, "many">;
213
+ }, "strip", z.ZodTypeAny, {
214
+ role: string[];
215
+ }, {
216
+ role: string[];
217
+ }>;
218
+ }, "strip", z.ZodTypeAny, {
219
+ type: "user.edit";
220
+ options: {
221
+ role: string[];
222
+ };
223
+ }, {
224
+ type: "user.edit";
225
+ options: {
226
+ role: string[];
227
+ };
228
+ }>, z.ZodObject<{
229
+ type: z.ZodLiteral<"workqueue">;
230
+ options: z.ZodObject<{
231
+ id: z.ZodArray<z.ZodString, "many">;
232
+ }, "strip", z.ZodTypeAny, {
233
+ id: string[];
234
+ }, {
235
+ id: string[];
236
+ }>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ type: "workqueue";
239
+ options: {
240
+ id: string[];
241
+ };
242
+ }, {
243
+ type: "workqueue";
244
+ options: {
245
+ id: string[];
246
+ };
247
+ }>, z.ZodObject<{
248
+ type: z.ZodEnum<["record.create", "record.read", "record.declare", "record.notify", "record.declared.validate", "record.declared.reject", "record.declared.archive", "record.declared.review-duplicates", "record.register", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
249
+ options: z.ZodObject<{
250
+ event: z.ZodArray<z.ZodString, "many">;
251
+ }, "strip", z.ZodTypeAny, {
252
+ event: string[];
253
+ }, {
254
+ event: string[];
255
+ }>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
258
+ options: {
259
+ event: string[];
260
+ };
261
+ }, {
262
+ type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
263
+ options: {
264
+ event: string[];
265
+ };
266
+ }>]>;
267
+ type ConfigurableRawScopes = z.infer<typeof ConfigurableRawScopes>;
268
+ export type ConfigurableScopeType = ConfigurableRawScopes['type'];
269
+ type FlattenedSearchScope = {
270
+ type: 'search';
271
+ options: Record<string, SearchScopeAccessLevels>;
272
+ };
273
+ export type ConfigurableScopes = Exclude<ConfigurableRawScopes, {
274
+ type: 'search';
275
+ }> | FlattenedSearchScope;
276
+ export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{
277
+ type: "record.registered.print-certified-copies";
278
+ options: {
279
+ event: string[];
280
+ templates?: string[] | undefined;
281
+ };
282
+ }, {
283
+ type: T;
284
+ }> | Extract<{
285
+ type: "user.create";
286
+ options: {
287
+ role: string[];
288
+ };
289
+ }, {
290
+ type: T;
291
+ }> | Extract<{
292
+ type: "user.edit";
293
+ options: {
294
+ role: string[];
295
+ };
296
+ }, {
297
+ type: T;
298
+ }> | Extract<{
299
+ type: "workqueue";
300
+ options: {
301
+ id: string[];
302
+ };
303
+ }, {
304
+ type: T;
305
+ }> | Extract<{
306
+ type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
307
+ options: {
308
+ event: string[];
309
+ };
310
+ }, {
311
+ type: T;
312
+ }> | Extract<FlattenedSearchScope, {
313
+ type: T;
314
+ }> | undefined;
315
+ /**
316
+ * Parses a configurable scope string into a ConfigurableRawScopes object.
317
+ * @param {string} scope - The scope string to parse
318
+ * @returns {ConfigurableRawScopes | undefined} The parsed scope object if valid, undefined otherwise
319
+ * @example
320
+ * parseScope("user.create[role=field-agent|registration-agent]")
321
+ * // Returns: { type: "user.create", options: { role: ["field-agent", "registration-agent"] } }
322
+ */
323
+ export declare function parseConfigurableScope(scope: string): {
324
+ type: "record.registered.print-certified-copies";
325
+ options: {
326
+ event: string[];
327
+ templates?: string[] | undefined;
328
+ };
329
+ } | {
330
+ type: "search";
331
+ options: {
332
+ event: string[];
333
+ access: ("my-jurisdiction" | "all")[];
334
+ };
335
+ } | {
336
+ type: "user.create";
337
+ options: {
338
+ role: string[];
339
+ };
340
+ } | {
341
+ type: "user.edit";
342
+ options: {
343
+ role: string[];
344
+ };
345
+ } | {
346
+ type: "workqueue";
347
+ options: {
348
+ id: string[];
349
+ };
350
+ } | {
351
+ type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
352
+ options: {
353
+ event: string[];
354
+ };
355
+ } | undefined;
356
+ export declare function parseLiteralScope(scope: string): {
357
+ type: "bypassratelimit" | "register" | "demo" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.import" | "record.reindex" | "record.declare-birth" | "record.declare-birth:my-jurisdiction" | "record.declare-death" | "record.declare-death:my-jurisdiction" | "record.declare-marriage" | "record.declare-marriage:my-jurisdiction" | "record.declaration-submit-incomplete" | "record.declaration-submit-for-review" | "record.unassign-others" | "record.declaration-submit-for-approval" | "record.declaration-submit-for-updates" | "record.declaration-edit" | "record.review-duplicates" | "record.declaration-archive" | "record.declaration-reinstate" | "record.register" | "record.registration-print&issue-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "record.confirm-registration" | "record.reject-registration" | "search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage" | "record.read" | "profile.electronic-signature" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "organisation.read-locations:all" | "organisation.read-locations:my-office" | "organisation.read-locations:my-jurisdiction" | "user.read:all" | "user.read:my-office" | "user.read:my-jurisdiction" | "user.read:only-my-audit" | "user.create:all" | "user.create:my-jurisdiction" | "user.update:all" | "user.update:my-jurisdiction" | "config.update:all" | "user.data-seeding";
358
+ } | undefined;
359
+ /**
360
+ * Stringifies a ConfigurableScopes object into a scope string.
361
+ * @param {ConfigurableScopes} scope - The scope object to stringify
362
+ * @returns {string} The stringified scope in format "type[key1=value1|value2,key2=value3|value4]"
363
+ * @example
364
+ * stringifyScope({
365
+ * type: "record.notify",
366
+ * options: { event: ["birth", "tennis-club-membership"] }
367
+ * })
368
+ * // Returns: "record.notify[event=birth|tennis-club-membership]"
369
+ */
370
+ export declare function stringifyScope(scope: z.infer<typeof ConfigurableRawScopes>): string;
371
+ /**
372
+ * Extracts authorized event identifiers (e.g. birth, death) from the provided configurable scopes.
373
+ *
374
+ * @param scopes - Array of configurable scopes with options
375
+ * @returns Array of authorized event identifiers
376
+ */
377
+ export declare function getAuthorizedEventsFromScopes(scopes: ConfigurableScopes[]): string[];
378
+ export declare const scopes: Scope[];
379
+ export type ParsedScopes = NonNullable<ReturnType<typeof parseConfigurableScope>>;
380
+ export type RawScopes = z.infer<typeof LiteralScopes> | (string & {});
381
+ export type Scope = RawScopes;
382
+ export declare const ActionScopes: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">]>, z.ZodUnion<[z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">]>, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodUnion<[z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>]>;
383
+ export type ActionScopes = z.infer<typeof ActionScopes>;
384
+ export {};
385
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAUA,cAAc,0BAA0B,CAAA"}