@opencrvs/toolkit 1.9.7-rc.47e0d0f → 1.9.7-rc.480775d

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