@opencrvs/toolkit 1.9.4-rc.793f834 → 1.9.4-rc.f09603b

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 +28204 -2149
  2. package/dist/commons/conditionals/conditionals.d.ts +10 -1
  3. package/dist/commons/conditionals/validate.d.ts +11 -4
  4. package/dist/commons/events/ActionConfig.d.ts +23416 -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 +27 -176
  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 +931 -4169
  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 +18663 -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 +197 -967
  21. package/dist/commons/events/EventInput.d.ts +2 -8
  22. package/dist/commons/events/EventMetadata.d.ts +106 -346
  23. package/dist/commons/events/FieldConfig.d.ts +4267 -11782
  24. package/dist/commons/events/FieldType.d.ts +20 -4
  25. package/dist/commons/events/FieldTypeMapping.d.ts +181 -813
  26. package/dist/commons/events/FieldValue.d.ts +83 -356
  27. package/dist/commons/events/Flag.d.ts +70 -0
  28. package/dist/commons/events/FormConfig.d.ts +13140 -721
  29. package/dist/commons/events/PageConfig.d.ts +8780 -319
  30. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  31. package/dist/commons/events/TemplateConfig.d.ts +3 -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 +1691 -7156
  35. package/dist/commons/events/deduplication.d.ts +3 -3
  36. package/dist/commons/events/defineConfig.d.ts +25626 -150
  37. package/dist/commons/events/event.d.ts +4 -4
  38. package/dist/commons/events/index.d.ts +1 -0
  39. package/dist/commons/events/locations.d.ts +15 -19
  40. package/dist/commons/events/scopes.d.ts +5 -4
  41. package/dist/commons/events/state/availableActions.d.ts +2 -1
  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 +51339 -362
  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 +38 -5
  51. package/dist/events/deduplication.d.ts +3 -3
  52. package/dist/events/index.js +1810 -1550
  53. package/dist/notification/index.d.ts.map +1 -1
  54. package/dist/notification/index.js +1430 -1412
  55. package/dist/scopes/index.d.ts +167 -132
  56. package/dist/scopes/index.d.ts.map +1 -1
  57. package/dist/scopes/index.js +133 -94
  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";
@@ -62,168 +62,189 @@ export declare const SCOPES: {
62
62
  readonly CONFIG_UPDATE_ALL: "config.update:all";
63
63
  readonly USER_DATA_SEEDING: "user.data-seeding";
64
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">]>]>;
65
+ 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">]>;
66
+ 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.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
67
  declare const SearchScope: z.ZodObject<{
68
68
  type: z.ZodLiteral<"search">;
69
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
- }>;
70
+ event: z.ZodArray<z.ZodString>;
71
+ access: z.ZodArray<z.ZodEnum<{
72
+ "my-jurisdiction": "my-jurisdiction";
73
+ all: "all";
74
+ }>>;
75
+ }, z.core.$strip>;
76
+ }, z.core.$strip>;
92
77
  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"]>;
78
+ export declare const RecordScopeType: z.ZodEnum<{
79
+ "record.unassign-others": "record.unassign-others";
80
+ "record.register": "record.register";
81
+ "record.read": "record.read";
82
+ "record.create": "record.create";
83
+ "record.declare": "record.declare";
84
+ "record.notify": "record.notify";
85
+ "record.declared.edit": "record.declared.edit";
86
+ "record.declared.reject": "record.declared.reject";
87
+ "record.declared.archive": "record.declared.archive";
88
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
89
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
90
+ "record.registered.request-correction": "record.registered.request-correction";
91
+ "record.registered.correct": "record.registered.correct";
92
+ }>;
94
93
  export type RecordScopeType = z.infer<typeof RecordScopeType>;
95
94
  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[];
95
+ type: z.ZodEnum<{
96
+ "record.unassign-others": "record.unassign-others";
97
+ "record.register": "record.register";
98
+ "record.read": "record.read";
99
+ "record.create": "record.create";
100
+ "record.declare": "record.declare";
101
+ "record.notify": "record.notify";
102
+ "record.declared.edit": "record.declared.edit";
103
+ "record.declared.reject": "record.declared.reject";
104
+ "record.declared.archive": "record.declared.archive";
105
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
106
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
107
+ "record.registered.request-correction": "record.registered.request-correction";
108
+ "record.registered.correct": "record.registered.correct";
103
109
  }>;
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
- }>;
110
+ options: z.ZodObject<{
111
+ event: z.ZodArray<z.ZodString>;
112
+ }, z.core.$strip>;
113
+ }, z.core.$strip>;
115
114
  export type RecordScope = z.infer<typeof RecordScope>;
116
- declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
115
+ export declare const CustomActionScope: z.ZodObject<{
116
+ type: z.ZodLiteral<"record.custom-action">;
117
+ options: z.ZodObject<{
118
+ event: z.ZodArray<z.ZodString>;
119
+ customActionType: z.ZodArray<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ }, z.core.$strip>;
122
+ export type CustomActionScope = z.infer<typeof CustomActionScope>;
123
+ declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<[z.ZodObject<{
117
124
  type: z.ZodLiteral<"search">;
118
125
  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<{
126
+ event: z.ZodArray<z.ZodString>;
127
+ access: z.ZodArray<z.ZodEnum<{
128
+ "my-jurisdiction": "my-jurisdiction";
129
+ all: "all";
130
+ }>>;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>, z.ZodObject<{
141
133
  type: z.ZodLiteral<"user.create">;
142
134
  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<{
135
+ role: z.ZodArray<z.ZodString>;
136
+ }, z.core.$strip>;
137
+ }, z.core.$strip>, z.ZodObject<{
160
138
  type: z.ZodLiteral<"user.edit">;
161
139
  options: z.ZodObject<{
162
- role: z.ZodArray<z.ZodString, "many">;
163
- }, "strip", z.ZodTypeAny, {
164
- role: string[];
165
- }, {
166
- role: string[];
140
+ role: z.ZodArray<z.ZodString>;
141
+ }, z.core.$strip>;
142
+ }, z.core.$strip>, z.ZodObject<{
143
+ type: z.ZodLiteral<"workqueue">;
144
+ options: z.ZodObject<{
145
+ id: z.ZodArray<z.ZodString>;
146
+ }, z.core.$strip>;
147
+ }, z.core.$strip>, z.ZodObject<{
148
+ type: z.ZodEnum<{
149
+ "record.unassign-others": "record.unassign-others";
150
+ "record.register": "record.register";
151
+ "record.read": "record.read";
152
+ "record.create": "record.create";
153
+ "record.declare": "record.declare";
154
+ "record.notify": "record.notify";
155
+ "record.declared.edit": "record.declared.edit";
156
+ "record.declared.reject": "record.declared.reject";
157
+ "record.declared.archive": "record.declared.archive";
158
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
159
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
160
+ "record.registered.request-correction": "record.registered.request-correction";
161
+ "record.registered.correct": "record.registered.correct";
167
162
  }>;
168
- }, "strip", z.ZodTypeAny, {
169
- type: "user.edit";
163
+ options: z.ZodObject<{
164
+ event: z.ZodArray<z.ZodString>;
165
+ }, z.core.$strip>;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ type: z.ZodLiteral<"record.custom-action">;
168
+ options: z.ZodObject<{
169
+ event: z.ZodArray<z.ZodString>;
170
+ customActionType: z.ZodArray<z.ZodString>;
171
+ }, z.core.$strip>;
172
+ }, z.core.$strip>], "type">;
173
+ export declare const ConfigurableActionScopes: z.ZodDiscriminatedUnion<[z.ZodObject<{
174
+ type: z.ZodEnum<{
175
+ "record.unassign-others": "record.unassign-others";
176
+ "record.register": "record.register";
177
+ "record.read": "record.read";
178
+ "record.create": "record.create";
179
+ "record.declare": "record.declare";
180
+ "record.notify": "record.notify";
181
+ "record.declared.edit": "record.declared.edit";
182
+ "record.declared.reject": "record.declared.reject";
183
+ "record.declared.archive": "record.declared.archive";
184
+ "record.declared.review-duplicates": "record.declared.review-duplicates";
185
+ "record.registered.print-certified-copies": "record.registered.print-certified-copies";
186
+ "record.registered.request-correction": "record.registered.request-correction";
187
+ "record.registered.correct": "record.registered.correct";
188
+ }>;
189
+ options: z.ZodObject<{
190
+ event: z.ZodArray<z.ZodString>;
191
+ }, z.core.$strip>;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ type: z.ZodLiteral<"record.custom-action">;
194
+ options: z.ZodObject<{
195
+ event: z.ZodArray<z.ZodString>;
196
+ customActionType: z.ZodArray<z.ZodString>;
197
+ }, z.core.$strip>;
198
+ }, z.core.$strip>], "type">;
199
+ export type ConfigurableRawScopes = z.infer<typeof ConfigurableRawScopes>;
200
+ export type ConfigurableScopeType = ConfigurableRawScopes['type'];
201
+ type FlattenedSearchScope = {
202
+ type: 'search';
203
+ options: Record<string, SearchScopeAccessLevels>;
204
+ };
205
+ export type ConfigurableScopes = Exclude<ConfigurableRawScopes, {
206
+ type: 'search';
207
+ }> | FlattenedSearchScope;
208
+ export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{
209
+ type: "user.create";
170
210
  options: {
171
211
  role: string[];
172
212
  };
173
213
  }, {
214
+ type: T;
215
+ }> | Extract<{
174
216
  type: "user.edit";
175
217
  options: {
176
218
  role: string[];
177
219
  };
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
220
  }, {
221
+ type: T;
222
+ }> | Extract<{
193
223
  type: "workqueue";
194
224
  options: {
195
225
  id: string[];
196
226
  };
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";
227
+ }, {
228
+ type: T;
229
+ }> | Extract<{
230
+ type: "record.unassign-others" | "record.register" | "record.read" | "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
231
  options: {
209
232
  event: string[];
210
233
  };
211
234
  }, {
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";
235
+ type: T;
236
+ }> | Extract<{
237
+ type: "record.custom-action";
213
238
  options: {
214
239
  event: string[];
240
+ customActionType: string[];
215
241
  };
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<{
242
+ }, {
243
+ type: T;
244
+ }> | Extract<FlattenedSearchScope, {
245
+ type: T;
246
+ }> | undefined;
247
+ export declare function findScopes<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): (Extract<{
227
248
  type: "user.create";
228
249
  options: {
229
250
  role: string[];
@@ -245,15 +266,23 @@ export declare function findScope<T extends ConfigurableScopeType>(scopes: strin
245
266
  }, {
246
267
  type: T;
247
268
  }> | 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";
269
+ type: "record.unassign-others" | "record.register" | "record.read" | "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
270
  options: {
250
271
  event: string[];
251
272
  };
252
273
  }, {
253
274
  type: T;
275
+ }> | Extract<{
276
+ type: "record.custom-action";
277
+ options: {
278
+ event: string[];
279
+ customActionType: string[];
280
+ };
281
+ }, {
282
+ type: T;
254
283
  }> | Extract<FlattenedSearchScope, {
255
284
  type: T;
256
- }> | undefined;
285
+ }>)[];
257
286
  /**
258
287
  * Parses a configurable scope string into a ConfigurableRawScopes object.
259
288
  * @param {string} scope - The scope string to parse
@@ -284,9 +313,15 @@ export declare function parseConfigurableScope(scope: string): {
284
313
  id: string[];
285
314
  };
286
315
  } | {
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";
316
+ type: "record.unassign-others" | "record.register" | "record.read" | "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";
317
+ options: {
318
+ event: string[];
319
+ };
320
+ } | {
321
+ type: "record.custom-action";
288
322
  options: {
289
323
  event: string[];
324
+ customActionType: string[];
290
325
  };
291
326
  } | undefined;
292
327
  export declare function parseLiteralScope(scope: string): {
@@ -315,7 +350,7 @@ export declare const scopes: Scope[];
315
350
  export type ParsedScopes = NonNullable<ReturnType<typeof parseConfigurableScope>>;
316
351
  export type RawScopes = z.infer<typeof LiteralScopes> | (string & {});
317
352
  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">]>]>;
353
+ 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
354
  export type ActionScopes = z.infer<typeof ActionScopes>;
320
355
  export {};
321
356
  //# 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"}