@opencrvs/toolkit 1.9.6-rc.afa6d94 → 1.9.6-rc.b319824

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 (58) hide show
  1. package/dist/commons/api/router.d.ts +29384 -2317
  2. package/dist/commons/conditionals/conditionals.d.ts +15 -1
  3. package/dist/commons/conditionals/validate.d.ts +11 -4
  4. package/dist/commons/events/ActionConfig.d.ts +24973 -1552
  5. package/dist/commons/events/ActionDocument.d.ts +803 -1856
  6. package/dist/commons/events/ActionInput.d.ts +277 -1073
  7. package/dist/commons/events/ActionType.d.ts +86 -9
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +228 -1238
  9. package/dist/commons/events/CompositeFieldValue.d.ts +29 -190
  10. package/dist/commons/events/Conditional.d.ts +26 -38
  11. package/dist/commons/events/Constants.d.ts +1 -1
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +1195 -4223
  13. package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
  14. package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
  15. package/dist/commons/events/Draft.d.ts +70 -105
  16. package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
  17. package/dist/commons/events/EventConfig.d.ts +19932 -2120
  18. package/dist/commons/events/EventConfigInput.d.ts +1 -1
  19. package/dist/commons/events/EventDocument.d.ts +320 -1332
  20. package/dist/commons/events/EventIndex.d.ts +193 -980
  21. package/dist/commons/events/EventInput.d.ts +2 -8
  22. package/dist/commons/events/EventMetadata.d.ts +106 -347
  23. package/dist/commons/events/FieldConfig.d.ts +4526 -12285
  24. package/dist/commons/events/FieldType.d.ts +20 -4
  25. package/dist/commons/events/FieldTypeMapping.d.ts +195 -881
  26. package/dist/commons/events/FieldValue.d.ts +88 -396
  27. package/dist/commons/events/Flag.d.ts +67 -0
  28. package/dist/commons/events/FormConfig.d.ts +13980 -721
  29. package/dist/commons/events/PageConfig.d.ts +9340 -319
  30. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  31. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  32. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  33. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  34. package/dist/commons/events/WorkqueueConfig.d.ts +1867 -7176
  35. package/dist/commons/events/deduplication.d.ts +3 -3
  36. package/dist/commons/events/defineConfig.d.ts +26563 -147
  37. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  38. package/dist/commons/events/index.d.ts +1 -0
  39. package/dist/commons/events/locations.d.ts +26 -19
  40. package/dist/commons/events/scopes.d.ts +5 -4
  41. package/dist/commons/events/state/availableActions.d.ts +0 -2
  42. package/dist/commons/events/state/flags.d.ts +21 -3
  43. package/dist/commons/events/state/index.d.ts +23 -19
  44. package/dist/commons/events/state/utils.d.ts +130 -112
  45. package/dist/commons/events/test.utils.d.ts +17 -8
  46. package/dist/commons/events/transactions.d.ts +1 -1
  47. package/dist/commons/events/utils.d.ts +53164 -367
  48. package/dist/commons/notification/UserNotifications.d.ts +55 -636
  49. package/dist/conditionals/index.d.ts.map +1 -1
  50. package/dist/conditionals/index.js +53 -8
  51. package/dist/events/deduplication.d.ts +3 -3
  52. package/dist/events/index.js +1993 -1706
  53. package/dist/notification/index.d.ts.map +1 -1
  54. package/dist/notification/index.js +1655 -1564
  55. package/dist/scopes/index.d.ts +173 -133
  56. package/dist/scopes/index.d.ts.map +1 -1
  57. package/dist/scopes/index.js +138 -95
  58. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod/v4';
2
2
  import { SearchScopeAccessLevels } from './events';
3
3
  export declare const SCOPES: {
4
4
  readonly BYPASSRATELIMIT: "bypassratelimit";
@@ -59,171 +59,197 @@ export declare const SCOPES: {
59
59
  readonly USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction";
60
60
  readonly USER_UPDATE: "user.update:all";
61
61
  readonly USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction";
62
+ readonly DASHBOARD_VIEW: "dashboard.view";
62
63
  readonly CONFIG_UPDATE_ALL: "config.update:all";
63
64
  readonly USER_DATA_SEEDING: "user.data-seeding";
64
65
  };
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">]>]>;
66
+ export declare const SearchScopes: z.ZodUnion<readonly [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">]>;
67
+ declare const LiteralScopes: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"register">, z.ZodLiteral<"demo">, z.ZodLiteral<"config">]>, z.ZodUnion<readonly [z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">]>, z.ZodLiteral<"record.unassign-others">, z.ZodUnion<readonly [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<readonly [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<readonly [z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>, z.ZodUnion<readonly [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.ZodLiteral<"dashboard.view">, z.ZodUnion<readonly [z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">]>, z.ZodUnion<readonly [z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">]>, z.ZodUnion<readonly [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<readonly [z.ZodLiteral<"record.reindex">, z.ZodLiteral<"record.import">]>]>;
67
68
  declare const SearchScope: z.ZodObject<{
68
69
  type: z.ZodLiteral<"search">;
69
70
  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
- }>;
71
+ event: z.ZodArray<z.ZodString>;
72
+ access: z.ZodArray<z.ZodEnum<{
73
+ "my-jurisdiction": "my-jurisdiction";
74
+ all: "all";
75
+ }>>;
76
+ }, z.core.$strip>;
77
+ }, z.core.$strip>;
92
78
  export type SearchScope = z.infer<typeof SearchScope>;
93
- 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.print-certified-copies", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
79
+ export declare const RecordScopeType: z.ZodEnum<{
80
+ "record.unassign-others": "record.unassign-others";
81
+ "record.register": "record.register";
82
+ "record.read": "record.read";
83
+ "dashboard.view": "dashboard.view";
84
+ "record.create": "record.create";
85
+ "record.declare": "record.declare";
86
+ "record.notify": "record.notify";
87
+ "record.declared.edit": "record.declared.edit";
88
+ "record.declared.reject": "record.declared.reject";
89
+ "record.declared.archive": "record.declared.archive";
90
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
91
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
92
+ "record.registered.request-correction": "record.registered.request-correction";
93
+ "record.registered.correct": "record.registered.correct";
94
+ }>;
94
95
  export type RecordScopeType = z.infer<typeof RecordScopeType>;
95
96
  export declare const RecordScope: z.ZodObject<{
96
- 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.print-certified-copies", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
97
- options: z.ZodObject<{
98
- event: z.ZodArray<z.ZodString, "many">;
99
- }, "strip", z.ZodTypeAny, {
100
- event: string[];
101
- }, {
102
- event: string[];
97
+ type: z.ZodEnum<{
98
+ "record.unassign-others": "record.unassign-others";
99
+ "record.register": "record.register";
100
+ "record.read": "record.read";
101
+ "dashboard.view": "dashboard.view";
102
+ "record.create": "record.create";
103
+ "record.declare": "record.declare";
104
+ "record.notify": "record.notify";
105
+ "record.declared.edit": "record.declared.edit";
106
+ "record.declared.reject": "record.declared.reject";
107
+ "record.declared.archive": "record.declared.archive";
108
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
109
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
110
+ "record.registered.request-correction": "record.registered.request-correction";
111
+ "record.registered.correct": "record.registered.correct";
103
112
  }>;
104
- }, "strip", z.ZodTypeAny, {
105
- 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.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
106
- options: {
107
- event: string[];
108
- };
109
- }, {
110
- 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.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
111
- options: {
112
- event: string[];
113
- };
114
- }>;
113
+ options: z.ZodObject<{
114
+ event: z.ZodArray<z.ZodString>;
115
+ }, z.core.$strip>;
116
+ }, z.core.$strip>;
115
117
  export type RecordScope = z.infer<typeof RecordScope>;
116
- declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
118
+ export declare const CustomActionScope: z.ZodObject<{
119
+ type: z.ZodLiteral<"record.custom-action">;
120
+ options: z.ZodObject<{
121
+ event: z.ZodArray<z.ZodString>;
122
+ customActionType: z.ZodArray<z.ZodString>;
123
+ }, z.core.$strip>;
124
+ }, z.core.$strip>;
125
+ export type CustomActionScope = z.infer<typeof CustomActionScope>;
126
+ declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<[z.ZodObject<{
117
127
  type: z.ZodLiteral<"search">;
118
128
  options: z.ZodObject<{
119
- event: z.ZodArray<z.ZodString, "many">;
120
- access: z.ZodArray<z.ZodEnum<["my-jurisdiction", "all"]>, "many">;
121
- }, "strip", z.ZodTypeAny, {
122
- event: string[];
123
- access: ("my-jurisdiction" | "all")[];
124
- }, {
125
- event: string[];
126
- access: ("my-jurisdiction" | "all")[];
127
- }>;
128
- }, "strip", z.ZodTypeAny, {
129
- type: "search";
130
- options: {
131
- event: string[];
132
- access: ("my-jurisdiction" | "all")[];
133
- };
134
- }, {
135
- type: "search";
136
- options: {
137
- event: string[];
138
- access: ("my-jurisdiction" | "all")[];
139
- };
140
- }>, z.ZodObject<{
129
+ event: z.ZodArray<z.ZodString>;
130
+ access: z.ZodArray<z.ZodEnum<{
131
+ "my-jurisdiction": "my-jurisdiction";
132
+ all: "all";
133
+ }>>;
134
+ }, z.core.$strip>;
135
+ }, z.core.$strip>, z.ZodObject<{
141
136
  type: z.ZodLiteral<"user.create">;
142
137
  options: z.ZodObject<{
143
- role: z.ZodArray<z.ZodString, "many">;
144
- }, "strip", z.ZodTypeAny, {
145
- role: string[];
146
- }, {
147
- role: string[];
148
- }>;
149
- }, "strip", z.ZodTypeAny, {
150
- type: "user.create";
151
- options: {
152
- role: string[];
153
- };
154
- }, {
155
- type: "user.create";
156
- options: {
157
- role: string[];
158
- };
159
- }>, z.ZodObject<{
138
+ role: z.ZodArray<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ }, z.core.$strip>, z.ZodObject<{
160
141
  type: z.ZodLiteral<"user.edit">;
161
142
  options: z.ZodObject<{
162
- role: z.ZodArray<z.ZodString, "many">;
163
- }, "strip", z.ZodTypeAny, {
164
- role: string[];
165
- }, {
166
- role: string[];
143
+ role: z.ZodArray<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ }, z.core.$strip>, z.ZodObject<{
146
+ type: z.ZodLiteral<"workqueue">;
147
+ options: z.ZodObject<{
148
+ id: z.ZodArray<z.ZodString>;
149
+ }, z.core.$strip>;
150
+ }, z.core.$strip>, z.ZodObject<{
151
+ type: z.ZodEnum<{
152
+ "record.unassign-others": "record.unassign-others";
153
+ "record.register": "record.register";
154
+ "record.read": "record.read";
155
+ "dashboard.view": "dashboard.view";
156
+ "record.create": "record.create";
157
+ "record.declare": "record.declare";
158
+ "record.notify": "record.notify";
159
+ "record.declared.edit": "record.declared.edit";
160
+ "record.declared.reject": "record.declared.reject";
161
+ "record.declared.archive": "record.declared.archive";
162
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
163
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
164
+ "record.registered.request-correction": "record.registered.request-correction";
165
+ "record.registered.correct": "record.registered.correct";
167
166
  }>;
168
- }, "strip", z.ZodTypeAny, {
169
- type: "user.edit";
167
+ options: z.ZodObject<{
168
+ event: z.ZodArray<z.ZodString>;
169
+ }, z.core.$strip>;
170
+ }, z.core.$strip>, z.ZodObject<{
171
+ type: z.ZodLiteral<"record.custom-action">;
172
+ options: z.ZodObject<{
173
+ event: z.ZodArray<z.ZodString>;
174
+ customActionType: z.ZodArray<z.ZodString>;
175
+ }, z.core.$strip>;
176
+ }, z.core.$strip>], "type">;
177
+ export declare const ConfigurableActionScopes: z.ZodDiscriminatedUnion<[z.ZodObject<{
178
+ type: z.ZodEnum<{
179
+ "record.unassign-others": "record.unassign-others";
180
+ "record.register": "record.register";
181
+ "record.read": "record.read";
182
+ "dashboard.view": "dashboard.view";
183
+ "record.create": "record.create";
184
+ "record.declare": "record.declare";
185
+ "record.notify": "record.notify";
186
+ "record.declared.edit": "record.declared.edit";
187
+ "record.declared.reject": "record.declared.reject";
188
+ "record.declared.archive": "record.declared.archive";
189
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
190
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
191
+ "record.registered.request-correction": "record.registered.request-correction";
192
+ "record.registered.correct": "record.registered.correct";
193
+ }>;
194
+ options: z.ZodObject<{
195
+ event: z.ZodArray<z.ZodString>;
196
+ }, z.core.$strip>;
197
+ }, z.core.$strip>, z.ZodObject<{
198
+ type: z.ZodLiteral<"record.custom-action">;
199
+ options: z.ZodObject<{
200
+ event: z.ZodArray<z.ZodString>;
201
+ customActionType: z.ZodArray<z.ZodString>;
202
+ }, z.core.$strip>;
203
+ }, z.core.$strip>], "type">;
204
+ export type ConfigurableRawScopes = z.infer<typeof ConfigurableRawScopes>;
205
+ export type ConfigurableScopeType = ConfigurableRawScopes['type'];
206
+ type FlattenedSearchScope = {
207
+ type: 'search';
208
+ options: Record<string, SearchScopeAccessLevels>;
209
+ };
210
+ export type ConfigurableScopes = Exclude<ConfigurableRawScopes, {
211
+ type: 'search';
212
+ }> | FlattenedSearchScope;
213
+ export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{
214
+ type: "user.create";
170
215
  options: {
171
216
  role: string[];
172
217
  };
173
218
  }, {
219
+ type: T;
220
+ }> | Extract<{
174
221
  type: "user.edit";
175
222
  options: {
176
223
  role: string[];
177
224
  };
178
- }>, z.ZodObject<{
179
- type: z.ZodLiteral<"workqueue">;
180
- options: z.ZodObject<{
181
- id: z.ZodArray<z.ZodString, "many">;
182
- }, "strip", z.ZodTypeAny, {
183
- id: string[];
184
- }, {
185
- id: string[];
186
- }>;
187
- }, "strip", z.ZodTypeAny, {
188
- type: "workqueue";
189
- options: {
190
- id: string[];
191
- };
192
225
  }, {
226
+ type: T;
227
+ }> | Extract<{
193
228
  type: "workqueue";
194
229
  options: {
195
230
  id: string[];
196
231
  };
197
- }>, z.ZodObject<{
198
- 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.print-certified-copies", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
199
- options: z.ZodObject<{
200
- event: z.ZodArray<z.ZodString, "many">;
201
- }, "strip", z.ZodTypeAny, {
202
- event: string[];
203
- }, {
204
- event: string[];
205
- }>;
206
- }, "strip", z.ZodTypeAny, {
207
- 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.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
232
+ }, {
233
+ type: T;
234
+ }> | Extract<{
235
+ type: "record.unassign-others" | "record.register" | "record.read" | "dashboard.view" | "record.create" | "record.declare" | "record.notify" | "record.declared.edit" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
208
236
  options: {
209
237
  event: string[];
210
238
  };
211
239
  }, {
212
- 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.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
240
+ type: T;
241
+ }> | Extract<{
242
+ type: "record.custom-action";
213
243
  options: {
214
244
  event: string[];
245
+ customActionType: string[];
215
246
  };
216
- }>]>;
217
- type ConfigurableRawScopes = z.infer<typeof ConfigurableRawScopes>;
218
- export type ConfigurableScopeType = ConfigurableRawScopes['type'];
219
- type FlattenedSearchScope = {
220
- type: 'search';
221
- options: Record<string, SearchScopeAccessLevels>;
222
- };
223
- export type ConfigurableScopes = Exclude<ConfigurableRawScopes, {
224
- type: 'search';
225
- }> | FlattenedSearchScope;
226
- export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{
247
+ }, {
248
+ type: T;
249
+ }> | Extract<FlattenedSearchScope, {
250
+ type: T;
251
+ }> | undefined;
252
+ export declare function findScopes<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): (Extract<{
227
253
  type: "user.create";
228
254
  options: {
229
255
  role: string[];
@@ -245,15 +271,23 @@ export declare function findScope<T extends ConfigurableScopeType>(scopes: strin
245
271
  }, {
246
272
  type: T;
247
273
  }> | Extract<{
248
- 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.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
274
+ type: "record.unassign-others" | "record.register" | "record.read" | "dashboard.view" | "record.create" | "record.declare" | "record.notify" | "record.declared.edit" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
249
275
  options: {
250
276
  event: string[];
251
277
  };
252
278
  }, {
253
279
  type: T;
280
+ }> | Extract<{
281
+ type: "record.custom-action";
282
+ options: {
283
+ event: string[];
284
+ customActionType: string[];
285
+ };
286
+ }, {
287
+ type: T;
254
288
  }> | Extract<FlattenedSearchScope, {
255
289
  type: T;
256
- }> | undefined;
290
+ }>)[];
257
291
  /**
258
292
  * Parses a configurable scope string into a ConfigurableRawScopes object.
259
293
  * @param {string} scope - The scope string to parse
@@ -284,13 +318,19 @@ export declare function parseConfigurableScope(scope: string): {
284
318
  id: string[];
285
319
  };
286
320
  } | {
287
- 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.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
321
+ type: "record.unassign-others" | "record.register" | "record.read" | "dashboard.view" | "record.create" | "record.declare" | "record.notify" | "record.declared.edit" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.print-certified-copies" | "record.registered.request-correction" | "record.registered.correct";
322
+ options: {
323
+ event: string[];
324
+ };
325
+ } | {
326
+ type: "record.custom-action";
288
327
  options: {
289
328
  event: string[];
329
+ customActionType: string[];
290
330
  };
291
331
  } | undefined;
292
332
  export declare function parseLiteralScope(scope: string): {
293
- 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";
333
+ 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" | "dashboard.view" | "config.update:all" | "user.data-seeding";
294
334
  } | undefined;
295
335
  /**
296
336
  * Stringifies a ConfigurableScopes object into a scope string.
@@ -315,7 +355,7 @@ export declare const scopes: Scope[];
315
355
  export type ParsedScopes = NonNullable<ReturnType<typeof parseConfigurableScope>>;
316
356
  export type RawScopes = z.infer<typeof LiteralScopes> | (string & {});
317
357
  export type Scope = RawScopes;
318
- 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">]>]>;
358
+ export declare const ActionScopes: z.ZodUnion<readonly [z.ZodUnion<readonly [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<readonly [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<readonly [z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>]>;
319
359
  export type ActionScopes = z.infer<typeof ActionScopes>;
320
360
  export {};
321
361
  //# sourceMappingURL=scopes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAUA,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAA"}