@opencrvs/toolkit 1.9.4-rc.0e695b2 → 1.9.4-rc.469f912
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.
- package/dist/commons/api/router.d.ts +2440 -28495
- package/dist/commons/conditionals/conditionals.d.ts +1 -10
- package/dist/commons/conditionals/validate.d.ts +4 -11
- package/dist/commons/events/ActionConfig.d.ts +1552 -23416
- package/dist/commons/events/ActionDocument.d.ts +1856 -803
- package/dist/commons/events/ActionInput.d.ts +1073 -277
- package/dist/commons/events/ActionType.d.ts +9 -86
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1238 -228
- package/dist/commons/events/CompositeFieldValue.d.ts +176 -27
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4169 -931
- package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
- package/dist/commons/events/DeduplicationConfig.d.ts +150 -15
- package/dist/commons/events/Draft.d.ts +105 -70
- package/dist/commons/events/DynamicFieldValue.d.ts +91 -7
- package/dist/commons/events/EventConfig.d.ts +2120 -18663
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +1332 -320
- package/dist/commons/events/EventIndex.d.ts +967 -197
- package/dist/commons/events/EventInput.d.ts +8 -2
- package/dist/commons/events/EventMetadata.d.ts +346 -106
- package/dist/commons/events/FieldConfig.d.ts +11774 -4259
- package/dist/commons/events/FieldType.d.ts +4 -20
- package/dist/commons/events/FieldTypeMapping.d.ts +813 -181
- package/dist/commons/events/FieldValue.d.ts +356 -83
- package/dist/commons/events/FormConfig.d.ts +721 -13140
- package/dist/commons/events/PageConfig.d.ts +319 -8780
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7080 -1615
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +163 -25639
- package/dist/commons/events/event.d.ts +4 -4
- package/dist/commons/events/index.d.ts +0 -1
- package/dist/commons/events/locations.d.ts +19 -15
- package/dist/commons/events/scopes.d.ts +4 -5
- package/dist/commons/events/state/availableActions.d.ts +1 -2
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +19 -23
- package/dist/commons/events/state/utils.d.ts +112 -130
- package/dist/commons/events/test.utils.d.ts +8 -17
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +373 -51350
- package/dist/commons/notification/UserNotifications.d.ts +636 -55
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +5 -38
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +1545 -1805
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1412 -1430
- package/dist/scopes/index.d.ts +132 -167
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +94 -133
- package/package.json +5 -5
- package/dist/commons/events/Flag.d.ts +0 -70
package/dist/scopes/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { SearchScopeAccessLevels } from './events';
|
|
3
3
|
export declare const SCOPES: {
|
|
4
4
|
readonly BYPASSRATELIMIT: "bypassratelimit";
|
|
@@ -62,189 +62,168 @@ 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<
|
|
66
|
-
declare const LiteralScopes: z.ZodUnion<
|
|
65
|
+
export declare const SearchScopes: z.ZodUnion<[z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>;
|
|
66
|
+
declare const LiteralScopes: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"register">, z.ZodLiteral<"demo">, z.ZodLiteral<"config">]>, z.ZodUnion<[z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">]>, z.ZodLiteral<"record.unassign-others">, z.ZodUnion<[z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">]>, z.ZodUnion<[z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">]>, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodUnion<[z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>, z.ZodUnion<[z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">]>, z.ZodLiteral<"record.read">, z.ZodLiteral<"profile.electronic-signature">, z.ZodUnion<[z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">]>, z.ZodUnion<[z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">]>, z.ZodUnion<[z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">]>, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">, z.ZodUnion<[z.ZodLiteral<"record.reindex">, z.ZodLiteral<"record.import">]>]>;
|
|
67
67
|
declare const SearchScope: z.ZodObject<{
|
|
68
68
|
type: z.ZodLiteral<"search">;
|
|
69
69
|
options: z.ZodObject<{
|
|
70
|
-
event: z.ZodArray<z.ZodString>;
|
|
71
|
-
access: z.ZodArray<z.ZodEnum<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"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
|
+
};
|
|
92
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"]>;
|
|
93
94
|
export type RecordScopeType = z.infer<typeof RecordScopeType>;
|
|
94
95
|
export declare const RecordScope: z.ZodObject<{
|
|
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";
|
|
109
|
-
}>;
|
|
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"]>;
|
|
110
97
|
options: z.ZodObject<{
|
|
111
|
-
event: z.ZodArray<z.ZodString>;
|
|
112
|
-
}, z.
|
|
113
|
-
|
|
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
|
+
}>;
|
|
114
115
|
export type RecordScope = z.infer<typeof RecordScope>;
|
|
115
|
-
|
|
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<{
|
|
116
|
+
declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
124
117
|
type: z.ZodLiteral<"search">;
|
|
125
118
|
options: z.ZodObject<{
|
|
126
|
-
event: z.ZodArray<z.ZodString>;
|
|
127
|
-
access: z.ZodArray<z.ZodEnum<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
options: z.ZodObject<{
|
|
135
|
-
role: z.ZodArray<z.ZodString>;
|
|
136
|
-
}, z.core.$strip>;
|
|
137
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
138
|
-
type: z.ZodLiteral<"user.edit">;
|
|
139
|
-
options: z.ZodObject<{
|
|
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";
|
|
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")[];
|
|
162
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">;
|
|
163
142
|
options: z.ZodObject<{
|
|
164
|
-
|
|
165
|
-
}, z.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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";
|
|
143
|
+
role: z.ZodArray<z.ZodString, "many">;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
role: string[];
|
|
146
|
+
}, {
|
|
147
|
+
role: string[];
|
|
188
148
|
}>;
|
|
189
|
-
|
|
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<{
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
150
|
type: "user.create";
|
|
210
151
|
options: {
|
|
211
152
|
role: string[];
|
|
212
153
|
};
|
|
213
154
|
}, {
|
|
214
|
-
type:
|
|
215
|
-
|
|
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, {
|
|
216
169
|
type: "user.edit";
|
|
217
170
|
options: {
|
|
218
171
|
role: string[];
|
|
219
172
|
};
|
|
220
173
|
}, {
|
|
221
|
-
type:
|
|
222
|
-
|
|
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, {
|
|
223
188
|
type: "workqueue";
|
|
224
189
|
options: {
|
|
225
190
|
id: string[];
|
|
226
191
|
};
|
|
227
192
|
}, {
|
|
228
|
-
type:
|
|
229
|
-
|
|
230
|
-
|
|
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";
|
|
231
208
|
options: {
|
|
232
209
|
event: string[];
|
|
233
210
|
};
|
|
234
211
|
}, {
|
|
235
|
-
type:
|
|
236
|
-
}> | Extract<{
|
|
237
|
-
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";
|
|
238
213
|
options: {
|
|
239
214
|
event: string[];
|
|
240
|
-
customActionType: string[];
|
|
241
215
|
};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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<{
|
|
248
227
|
type: "user.create";
|
|
249
228
|
options: {
|
|
250
229
|
role: string[];
|
|
@@ -266,23 +245,15 @@ export declare function findScopes<T extends ConfigurableScopeType>(scopes: stri
|
|
|
266
245
|
}, {
|
|
267
246
|
type: T;
|
|
268
247
|
}> | Extract<{
|
|
269
|
-
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.
|
|
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";
|
|
270
249
|
options: {
|
|
271
250
|
event: string[];
|
|
272
251
|
};
|
|
273
252
|
}, {
|
|
274
253
|
type: T;
|
|
275
|
-
}> | Extract<{
|
|
276
|
-
type: "record.custom-action";
|
|
277
|
-
options: {
|
|
278
|
-
event: string[];
|
|
279
|
-
customActionType: string[];
|
|
280
|
-
};
|
|
281
|
-
}, {
|
|
282
|
-
type: T;
|
|
283
254
|
}> | Extract<FlattenedSearchScope, {
|
|
284
255
|
type: T;
|
|
285
|
-
}>
|
|
256
|
+
}> | undefined;
|
|
286
257
|
/**
|
|
287
258
|
* Parses a configurable scope string into a ConfigurableRawScopes object.
|
|
288
259
|
* @param {string} scope - The scope string to parse
|
|
@@ -313,15 +284,9 @@ export declare function parseConfigurableScope(scope: string): {
|
|
|
313
284
|
id: string[];
|
|
314
285
|
};
|
|
315
286
|
} | {
|
|
316
|
-
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.
|
|
317
|
-
options: {
|
|
318
|
-
event: string[];
|
|
319
|
-
};
|
|
320
|
-
} | {
|
|
321
|
-
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";
|
|
322
288
|
options: {
|
|
323
289
|
event: string[];
|
|
324
|
-
customActionType: string[];
|
|
325
290
|
};
|
|
326
291
|
} | undefined;
|
|
327
292
|
export declare function parseLiteralScope(scope: string): {
|
|
@@ -350,7 +315,7 @@ export declare const scopes: Scope[];
|
|
|
350
315
|
export type ParsedScopes = NonNullable<ReturnType<typeof parseConfigurableScope>>;
|
|
351
316
|
export type RawScopes = z.infer<typeof LiteralScopes> | (string & {});
|
|
352
317
|
export type Scope = RawScopes;
|
|
353
|
-
export declare const ActionScopes: z.ZodUnion<
|
|
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">]>]>;
|
|
354
319
|
export type ActionScopes = z.infer<typeof ActionScopes>;
|
|
355
320
|
export {};
|
|
356
321
|
//# sourceMappingURL=scopes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAUA,cAAc,0BAA0B,CAAA"}
|