@xylex-group/athena 2.6.0 → 2.7.0
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/README.md +1 -1
- package/dist/browser.cjs +837 -114
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +7 -7
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +837 -114
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +830 -107
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +3 -3
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +830 -107
- package/dist/cli/index.js.map +1 -1
- package/dist/cookies.cjs +10 -3
- package/dist/cookies.cjs.map +1 -1
- package/dist/cookies.js +10 -3
- package/dist/cookies.js.map +1 -1
- package/dist/index.cjs +837 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +837 -114
- package/dist/index.js.map +1 -1
- package/dist/model-form-AKYrgede.d.ts +2772 -0
- package/dist/model-form-ehfqLuG7.d.cts +2772 -0
- package/dist/{pipeline-Ce3pTw5h.d.ts → pipeline-BUsR9XlO.d.ts} +1 -1
- package/dist/{pipeline-D1ZYeoH7.d.cts → pipeline-BfCWSRYl.d.cts} +1 -1
- package/dist/react-email-BQzmXBDE.d.cts +304 -0
- package/dist/react-email-BrVRp80B.d.ts +304 -0
- package/dist/react.cjs +178 -71
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +22 -5
- package/dist/react.d.ts +22 -5
- package/dist/react.js +92 -5
- package/dist/react.js.map +1 -1
- package/dist/{types-CUuo4NDi.d.cts → types-BSIsyss1.d.cts} +1 -1
- package/dist/{types-DSX6AT5B.d.cts → types-BsyRW49r.d.cts} +1 -1
- package/dist/{types-DSX6AT5B.d.ts → types-BsyRW49r.d.ts} +1 -1
- package/dist/{types-DapchQY5.d.ts → types-t_TVqnmp.d.ts} +1 -1
- package/package.json +193 -193
- package/dist/model-form-BaHWi3gm.d.cts +0 -1383
- package/dist/model-form-Dh6gWjL0.d.ts +0 -1383
- package/dist/react-email-B8O1Jeff.d.cts +0 -1230
- package/dist/react-email-CDEF0jij.d.ts +0 -1230
|
@@ -0,0 +1,2772 @@
|
|
|
1
|
+
import { i as AthenaJsonValue, a as AthenaGatewayCallOptions, g as AthenaJsonObject, j as AthenaRpcCallOptions, W as AthenaGatewayEndpointPath, X as AthenaGatewayMethod, Y as AthenaConditionValue, Z as AthenaConditionArrayValue, R as RegistryDef, D as DatabaseDef, F as SchemaDef, J as AnyModelDef, x as ModelDef, C as ModelRelationMetadata, E as RowOf, o as BackendConfig, p as BackendType, e as AthenaGatewayErrorDetails, A as AthenaConditionCastType, _ as AthenaConditionOperator, b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, d as AthenaGatewayErrorCode, P as AthenaGatewayResponse, q as InsertOf, U as UpdateOf } from './types-BsyRW49r.js';
|
|
2
|
+
|
|
3
|
+
type AthenaAuthMethod = 'GET' | 'POST';
|
|
4
|
+
type AthenaAuthCredentials = 'omit' | 'same-origin' | 'include';
|
|
5
|
+
type AthenaAuthQueryPrimitive = string | number | boolean;
|
|
6
|
+
type AthenaAuthQueryValue = AthenaAuthQueryPrimitive | AthenaAuthQueryPrimitive[] | null | undefined;
|
|
7
|
+
type AthenaAuthEndpointPath = '/sign-in/social' | '/sign-in/email' | '/sign-in/username' | '/sign-up/email' | '/get-session' | '/sign-out' | '/forget-password' | '/reset-password' | '/verify-email' | '/send-verification-email' | '/change-email' | '/change-email/verify' | '/change-password' | '/set-password' | '/update-user' | '/delete-user' | '/delete-user/verify' | '/delete-user/callback' | '/email-list' | '/email/list' | '/list-sessions' | '/revoke-session' | '/revoke-sessions' | '/revoke-other-sessions' | '/link-social' | '/list-accounts' | '/unlink-account' | '/refresh-token' | '/get-access-token' | '/two-factor/get-totp-uri' | '/two-factor/verify-totp' | '/two-factor/send-otp' | '/two-factor/verify-otp' | '/two-factor/verify-backup-code' | '/two-factor/generate-backup-codes' | '/two-factor/enable' | '/two-factor/disable' | '/passkey/generate-register-options' | '/passkey/generate-authenticate-options' | '/passkey/verify-registration' | '/passkey/verify-authentication' | '/passkey/list-user-passkeys' | '/passkey/delete-passkey' | '/passkey/update-passkey' | '/.well-known/webauthn' | '/admin/set-role' | '/admin/list-users' | '/admin/list-user-sessions' | '/admin/create-user' | '/admin/unban-user' | '/admin/ban-user' | '/admin/impersonate-user' | '/admin/stop-impersonating' | '/admin/revoke-user-session' | '/admin/revoke-user-sessions' | '/admin/remove-user' | '/admin/set-user-password' | '/admin/has-permission' | '/admin/api-key/create' | '/admin/athena-client/create' | '/admin/athena-client/list' | '/admin/audit-log/list' | '/admin/email/get' | '/admin/email/create' | '/admin/email/update' | '/admin/email/delete' | '/admin/email-failure/list' | '/admin/email-failure/get' | '/admin/email-failure/create' | '/admin/email-failure/update' | '/admin/email-failure/delete' | '/admin/email-template/get' | '/admin/email-template/create' | '/admin/email-template/delete' | '/admin/email-template/list' | '/admin/email-template/update' | '/admin/email/list' | '/api-key/create' | '/api-key/get' | '/api-key/update' | '/api-key/delete' | '/api-key/list' | '/api-key/verify' | '/api-key/delete-all-expired-api-keys' | '/organization/create' | '/organization/check-slug' | '/organization/list' | '/organization/set-active' | '/organization/get-full-organization' | '/organization/update' | '/organization/delete' | '/organization/invite-member' | '/organization/accept-invitation' | '/organization/cancel-invitation' | '/organization/reject-invitation' | '/organization/get-invitation' | '/organization/list-invitations' | '/organization/list-user-invitations' | '/organization/list-members' | '/organization/remove-member' | '/organization/update-member-role' | '/organization/get-active-member' | '/organization/leave' | '/organization/has-permission' | `/callback/${string}` | '/health' | '/ok' | '/error' | `/reset-password/${string}`;
|
|
8
|
+
type AthenaAuthErrorCode = 'NETWORK_ERROR' | 'HTTP_ERROR' | 'INVALID_JSON' | 'UNKNOWN_ERROR';
|
|
9
|
+
interface AthenaAuthErrorDetails {
|
|
10
|
+
code: AthenaAuthErrorCode;
|
|
11
|
+
message: string;
|
|
12
|
+
status: number;
|
|
13
|
+
endpoint?: AthenaAuthEndpointPath;
|
|
14
|
+
method?: AthenaAuthMethod;
|
|
15
|
+
requestId?: string;
|
|
16
|
+
hint?: string;
|
|
17
|
+
cause?: string;
|
|
18
|
+
}
|
|
19
|
+
interface AthenaAuthResult<T = unknown> {
|
|
20
|
+
ok: boolean;
|
|
21
|
+
status: number;
|
|
22
|
+
data: T | null;
|
|
23
|
+
error: string | null;
|
|
24
|
+
errorDetails?: AthenaAuthErrorDetails | null;
|
|
25
|
+
raw: unknown;
|
|
26
|
+
}
|
|
27
|
+
interface AthenaAuthUser {
|
|
28
|
+
id: string;
|
|
29
|
+
email: string;
|
|
30
|
+
name?: string | null;
|
|
31
|
+
image?: string | null;
|
|
32
|
+
emailVerified?: boolean;
|
|
33
|
+
createdAt?: string;
|
|
34
|
+
updatedAt?: string;
|
|
35
|
+
username?: string | null;
|
|
36
|
+
displayUsername?: string | null;
|
|
37
|
+
twoFactorEnabled?: boolean;
|
|
38
|
+
role?: string | null;
|
|
39
|
+
banned?: boolean;
|
|
40
|
+
banReason?: string | null;
|
|
41
|
+
banExpires?: string | null;
|
|
42
|
+
}
|
|
43
|
+
interface AthenaAuthSession {
|
|
44
|
+
id: string;
|
|
45
|
+
expiresAt?: string;
|
|
46
|
+
token?: string;
|
|
47
|
+
createdAt?: string;
|
|
48
|
+
updatedAt?: string;
|
|
49
|
+
ipAddress?: string | null;
|
|
50
|
+
userAgent?: string | null;
|
|
51
|
+
userId?: string;
|
|
52
|
+
impersonatedBy?: string | null;
|
|
53
|
+
activeOrganizationId?: string | null;
|
|
54
|
+
}
|
|
55
|
+
interface AthenaAuthSessionResponse {
|
|
56
|
+
session: AthenaAuthSession;
|
|
57
|
+
user: AthenaAuthUser;
|
|
58
|
+
}
|
|
59
|
+
interface AthenaAuthOrganization {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
slug: string;
|
|
63
|
+
logo?: string | null;
|
|
64
|
+
metadata?: Record<string, unknown> | null;
|
|
65
|
+
createdAt?: string;
|
|
66
|
+
updatedAt?: string;
|
|
67
|
+
}
|
|
68
|
+
interface AthenaAuthOrganizationMember {
|
|
69
|
+
id: string;
|
|
70
|
+
organizationId?: string;
|
|
71
|
+
userId?: string;
|
|
72
|
+
role?: string | string[] | null;
|
|
73
|
+
createdAt?: string;
|
|
74
|
+
updatedAt?: string;
|
|
75
|
+
user?: AthenaAuthUser;
|
|
76
|
+
}
|
|
77
|
+
interface AthenaAuthOrganizationInvitation {
|
|
78
|
+
id: string;
|
|
79
|
+
email?: string;
|
|
80
|
+
role?: string | string[] | null;
|
|
81
|
+
organizationId?: string;
|
|
82
|
+
inviterId?: string;
|
|
83
|
+
teamId?: string | null;
|
|
84
|
+
status?: string;
|
|
85
|
+
expiresAt?: string;
|
|
86
|
+
createdAt?: string;
|
|
87
|
+
updatedAt?: string;
|
|
88
|
+
}
|
|
89
|
+
interface AthenaEmailSignInRequest {
|
|
90
|
+
email: string;
|
|
91
|
+
password: string;
|
|
92
|
+
callbackURL?: string;
|
|
93
|
+
rememberMe?: boolean;
|
|
94
|
+
}
|
|
95
|
+
interface AthenaUsernameSignInRequest {
|
|
96
|
+
username: string;
|
|
97
|
+
password: string;
|
|
98
|
+
rememberMe?: boolean;
|
|
99
|
+
}
|
|
100
|
+
interface AthenaSocialSignInRequest {
|
|
101
|
+
provider: string;
|
|
102
|
+
callbackURL?: string;
|
|
103
|
+
newUserCallbackURL?: string;
|
|
104
|
+
errorCallbackURL?: string;
|
|
105
|
+
disableRedirect?: boolean;
|
|
106
|
+
idToken?: string;
|
|
107
|
+
scopes?: string[] | string;
|
|
108
|
+
requestSignUp?: boolean;
|
|
109
|
+
loginHint?: string;
|
|
110
|
+
}
|
|
111
|
+
interface AthenaEmailSignUpRequest {
|
|
112
|
+
name: string;
|
|
113
|
+
email: string;
|
|
114
|
+
password: string;
|
|
115
|
+
callbackURL?: string;
|
|
116
|
+
}
|
|
117
|
+
interface AthenaAuthSignInResponse {
|
|
118
|
+
redirect: false;
|
|
119
|
+
token: string;
|
|
120
|
+
url?: string | null;
|
|
121
|
+
user: AthenaAuthUser;
|
|
122
|
+
}
|
|
123
|
+
interface AthenaAuthSocialRedirectResponse {
|
|
124
|
+
url: string;
|
|
125
|
+
redirect: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface AthenaAuthSignOutResponse {
|
|
128
|
+
success: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface AthenaAuthStatusResponse {
|
|
131
|
+
status: boolean;
|
|
132
|
+
}
|
|
133
|
+
interface AthenaAuthRevokeSessionRequest {
|
|
134
|
+
token: string;
|
|
135
|
+
}
|
|
136
|
+
interface AthenaForgetPasswordRequest {
|
|
137
|
+
email: string;
|
|
138
|
+
redirectTo?: string;
|
|
139
|
+
}
|
|
140
|
+
interface AthenaResetPasswordRequest {
|
|
141
|
+
newPassword: string;
|
|
142
|
+
token?: string;
|
|
143
|
+
}
|
|
144
|
+
interface AthenaVerifyEmailRequest {
|
|
145
|
+
token: string;
|
|
146
|
+
callbackURL?: string;
|
|
147
|
+
}
|
|
148
|
+
interface AthenaSendVerificationEmailRequest {
|
|
149
|
+
email: string;
|
|
150
|
+
callbackURL?: string;
|
|
151
|
+
}
|
|
152
|
+
interface AthenaChangeEmailRequest {
|
|
153
|
+
newEmail: string;
|
|
154
|
+
callbackURL?: string;
|
|
155
|
+
}
|
|
156
|
+
interface AthenaChangePasswordRequest {
|
|
157
|
+
newPassword: string;
|
|
158
|
+
currentPassword: string;
|
|
159
|
+
revokeOtherSessions?: boolean;
|
|
160
|
+
}
|
|
161
|
+
interface AthenaUpdateUserRequest {
|
|
162
|
+
name?: string;
|
|
163
|
+
image?: string;
|
|
164
|
+
}
|
|
165
|
+
interface AthenaDeleteUserRequest {
|
|
166
|
+
callbackURL?: string;
|
|
167
|
+
password?: string;
|
|
168
|
+
token?: string;
|
|
169
|
+
}
|
|
170
|
+
interface AthenaDeleteUserCallbackRequest {
|
|
171
|
+
token?: string;
|
|
172
|
+
callbackURL?: string;
|
|
173
|
+
}
|
|
174
|
+
interface AthenaDeleteUserResponse {
|
|
175
|
+
success: boolean;
|
|
176
|
+
message?: string;
|
|
177
|
+
}
|
|
178
|
+
interface AthenaAuthEmailChangeResponse {
|
|
179
|
+
status: boolean;
|
|
180
|
+
message?: string | null;
|
|
181
|
+
}
|
|
182
|
+
interface AthenaLinkSocialRequest {
|
|
183
|
+
provider: string;
|
|
184
|
+
callbackURL?: string;
|
|
185
|
+
scopes?: string[] | string;
|
|
186
|
+
}
|
|
187
|
+
interface AthenaUnlinkAccountRequest {
|
|
188
|
+
providerId: string;
|
|
189
|
+
accountId?: string;
|
|
190
|
+
}
|
|
191
|
+
interface AthenaOAuthAccountTokenRequest {
|
|
192
|
+
providerId: string;
|
|
193
|
+
accountId?: string;
|
|
194
|
+
userId?: string;
|
|
195
|
+
}
|
|
196
|
+
interface AthenaOAuthTokenBundle {
|
|
197
|
+
tokenType?: string;
|
|
198
|
+
idToken?: string;
|
|
199
|
+
accessToken?: string;
|
|
200
|
+
refreshToken?: string;
|
|
201
|
+
accessTokenExpiresAt?: string;
|
|
202
|
+
refreshTokenExpiresAt?: string;
|
|
203
|
+
}
|
|
204
|
+
interface AthenaAuthLinkedAccount {
|
|
205
|
+
id: string;
|
|
206
|
+
provider?: string;
|
|
207
|
+
accountId?: string;
|
|
208
|
+
scopes?: string[];
|
|
209
|
+
createdAt?: string;
|
|
210
|
+
updatedAt?: string;
|
|
211
|
+
}
|
|
212
|
+
type AthenaAuthPermissionSet = Record<string, unknown> | string[];
|
|
213
|
+
type AthenaAuthLooseRecord = Record<string, unknown>;
|
|
214
|
+
type AthenaAuthReactEmailProps = Record<string, unknown>;
|
|
215
|
+
interface AthenaSetPasswordRequest {
|
|
216
|
+
newPassword: string;
|
|
217
|
+
}
|
|
218
|
+
interface AthenaAuthTokenQuery {
|
|
219
|
+
token: string;
|
|
220
|
+
}
|
|
221
|
+
interface AthenaAuthTokenVerificationResponse {
|
|
222
|
+
status: boolean;
|
|
223
|
+
message: string;
|
|
224
|
+
}
|
|
225
|
+
interface AthenaAuthEmailListQuery {
|
|
226
|
+
limit?: number;
|
|
227
|
+
offset?: number;
|
|
228
|
+
}
|
|
229
|
+
interface AthenaAuthEmailListResponse {
|
|
230
|
+
total: number;
|
|
231
|
+
limit: number;
|
|
232
|
+
offset: number;
|
|
233
|
+
emails: AthenaAuthLooseRecord[];
|
|
234
|
+
}
|
|
235
|
+
interface AthenaAuthHealthResponse {
|
|
236
|
+
status?: string;
|
|
237
|
+
service?: string;
|
|
238
|
+
version?: string;
|
|
239
|
+
}
|
|
240
|
+
interface AthenaAuthOkResponse {
|
|
241
|
+
ok: boolean;
|
|
242
|
+
}
|
|
243
|
+
interface AthenaAuthErrorResponse {
|
|
244
|
+
message: string;
|
|
245
|
+
}
|
|
246
|
+
interface AthenaAuthCallbackProviderRequest {
|
|
247
|
+
provider: string;
|
|
248
|
+
code: string;
|
|
249
|
+
state: string;
|
|
250
|
+
}
|
|
251
|
+
interface AthenaAuthCallbackProviderResponse {
|
|
252
|
+
token?: string;
|
|
253
|
+
user?: AthenaAuthLooseRecord;
|
|
254
|
+
}
|
|
255
|
+
interface AthenaTwoFactorGetTotpUriRequest {
|
|
256
|
+
password: string;
|
|
257
|
+
}
|
|
258
|
+
interface AthenaTwoFactorGetTotpUriResponse {
|
|
259
|
+
totpURI?: string;
|
|
260
|
+
}
|
|
261
|
+
interface AthenaTwoFactorVerifyTotpRequest {
|
|
262
|
+
code: string;
|
|
263
|
+
trustDevice?: string;
|
|
264
|
+
}
|
|
265
|
+
interface AthenaTwoFactorVerifyTotpResponse {
|
|
266
|
+
status?: boolean;
|
|
267
|
+
}
|
|
268
|
+
interface AthenaTwoFactorVerifyOtpRequest {
|
|
269
|
+
code: string;
|
|
270
|
+
trustDevice?: string;
|
|
271
|
+
}
|
|
272
|
+
interface AthenaTwoFactorVerifyOtpResponse {
|
|
273
|
+
token: string;
|
|
274
|
+
user: AthenaAuthUser;
|
|
275
|
+
}
|
|
276
|
+
interface AthenaTwoFactorVerifyBackupCodeRequest {
|
|
277
|
+
code: string;
|
|
278
|
+
disableSession?: string;
|
|
279
|
+
trustDevice?: string;
|
|
280
|
+
}
|
|
281
|
+
interface AthenaTwoFactorSessionSnapshot {
|
|
282
|
+
token: string;
|
|
283
|
+
userId: string;
|
|
284
|
+
createdAt: string;
|
|
285
|
+
expiresAt: string;
|
|
286
|
+
}
|
|
287
|
+
interface AthenaTwoFactorVerifyBackupCodeResponse {
|
|
288
|
+
user: AthenaAuthUser;
|
|
289
|
+
session: AthenaTwoFactorSessionSnapshot;
|
|
290
|
+
}
|
|
291
|
+
interface AthenaTwoFactorGenerateBackupCodesRequest {
|
|
292
|
+
password: string;
|
|
293
|
+
}
|
|
294
|
+
interface AthenaTwoFactorGenerateBackupCodesResponse {
|
|
295
|
+
status: true;
|
|
296
|
+
backupCodes: string[];
|
|
297
|
+
}
|
|
298
|
+
interface AthenaTwoFactorEnableRequest {
|
|
299
|
+
password: string;
|
|
300
|
+
issuer?: string;
|
|
301
|
+
}
|
|
302
|
+
interface AthenaTwoFactorEnableResponse {
|
|
303
|
+
totpURI?: string;
|
|
304
|
+
backupCodes?: string[];
|
|
305
|
+
}
|
|
306
|
+
interface AthenaTwoFactorDisableRequest {
|
|
307
|
+
password: string;
|
|
308
|
+
}
|
|
309
|
+
interface AthenaTwoFactorDisableResponse {
|
|
310
|
+
status?: boolean;
|
|
311
|
+
}
|
|
312
|
+
interface AthenaPasskeyCredentialDescriptor {
|
|
313
|
+
id?: string;
|
|
314
|
+
type?: string;
|
|
315
|
+
transports?: string[];
|
|
316
|
+
}
|
|
317
|
+
interface AthenaPasskeyPublicKeyCredentialParam {
|
|
318
|
+
type?: string;
|
|
319
|
+
alg?: number;
|
|
320
|
+
}
|
|
321
|
+
interface AthenaPasskeyUserDescriptor {
|
|
322
|
+
id?: string;
|
|
323
|
+
name?: string;
|
|
324
|
+
displayName?: string;
|
|
325
|
+
}
|
|
326
|
+
interface AthenaPasskeyRelyingParty {
|
|
327
|
+
name?: string;
|
|
328
|
+
id?: string;
|
|
329
|
+
}
|
|
330
|
+
interface AthenaPasskeyAuthenticatorSelection {
|
|
331
|
+
authenticatorAttachment?: string;
|
|
332
|
+
requireResidentKey?: boolean;
|
|
333
|
+
userVerification?: string;
|
|
334
|
+
}
|
|
335
|
+
interface AthenaPasskeyOptionsResponse {
|
|
336
|
+
challenge?: string;
|
|
337
|
+
rp?: AthenaPasskeyRelyingParty;
|
|
338
|
+
user?: AthenaPasskeyUserDescriptor;
|
|
339
|
+
timeout?: number;
|
|
340
|
+
allowCredentials?: AthenaPasskeyCredentialDescriptor[];
|
|
341
|
+
excludeCredentials?: AthenaPasskeyCredentialDescriptor[];
|
|
342
|
+
pubKeyCredParams?: AthenaPasskeyPublicKeyCredentialParam[];
|
|
343
|
+
userVerification?: string;
|
|
344
|
+
authenticatorSelection?: AthenaPasskeyAuthenticatorSelection;
|
|
345
|
+
attestation?: string;
|
|
346
|
+
extensions?: AthenaAuthLooseRecord;
|
|
347
|
+
}
|
|
348
|
+
interface AthenaPasskeyRecord {
|
|
349
|
+
id: string;
|
|
350
|
+
name?: string | null;
|
|
351
|
+
publicKey?: string;
|
|
352
|
+
userId: string;
|
|
353
|
+
credentialID?: string;
|
|
354
|
+
counter?: number;
|
|
355
|
+
deviceType?: string;
|
|
356
|
+
backedUp?: boolean;
|
|
357
|
+
transports?: string;
|
|
358
|
+
createdAt?: string;
|
|
359
|
+
}
|
|
360
|
+
interface AthenaPasskeyVerifyRegistrationRequest {
|
|
361
|
+
response: string;
|
|
362
|
+
name?: string;
|
|
363
|
+
}
|
|
364
|
+
interface AthenaPasskeyVerifyAuthenticationRequest {
|
|
365
|
+
response: string;
|
|
366
|
+
}
|
|
367
|
+
interface AthenaPasskeyVerifyAuthenticationResponse {
|
|
368
|
+
session: AthenaAuthSession;
|
|
369
|
+
user: AthenaAuthUser;
|
|
370
|
+
}
|
|
371
|
+
interface AthenaPasskeyDeleteRequest {
|
|
372
|
+
id: string;
|
|
373
|
+
}
|
|
374
|
+
interface AthenaPasskeyDeleteResponse {
|
|
375
|
+
status: boolean;
|
|
376
|
+
}
|
|
377
|
+
interface AthenaPasskeyUpdateRequest {
|
|
378
|
+
id: string;
|
|
379
|
+
name: string;
|
|
380
|
+
}
|
|
381
|
+
interface AthenaPasskeyUpdateResponse {
|
|
382
|
+
passkey: AthenaPasskeyRecord;
|
|
383
|
+
}
|
|
384
|
+
interface AthenaAdminSetRoleRequest {
|
|
385
|
+
userId: string;
|
|
386
|
+
role: string;
|
|
387
|
+
}
|
|
388
|
+
interface AthenaAdminCreateUserRequest {
|
|
389
|
+
email: string;
|
|
390
|
+
password: string;
|
|
391
|
+
name: string;
|
|
392
|
+
role?: string;
|
|
393
|
+
data?: string;
|
|
394
|
+
}
|
|
395
|
+
interface AthenaAdminTargetUserRequest {
|
|
396
|
+
userId: string;
|
|
397
|
+
}
|
|
398
|
+
interface AthenaAdminBanUserRequest extends AthenaAdminTargetUserRequest {
|
|
399
|
+
banReason?: string;
|
|
400
|
+
banExpiresIn?: string;
|
|
401
|
+
}
|
|
402
|
+
type AthenaAuthSearchOperator = 'contains' | 'starts_with' | 'ends_with';
|
|
403
|
+
type AthenaAuthFilterOperator = 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with';
|
|
404
|
+
type AthenaAdminListUsersSearchOperator = AthenaAuthSearchOperator;
|
|
405
|
+
type AthenaAdminListUsersFilterOperator = AthenaAuthFilterOperator;
|
|
406
|
+
interface AthenaAdminListUsersQuery {
|
|
407
|
+
searchValue?: string;
|
|
408
|
+
searchField?: string;
|
|
409
|
+
searchOperator?: AthenaAdminListUsersSearchOperator;
|
|
410
|
+
limit?: number | string;
|
|
411
|
+
offset?: number | string;
|
|
412
|
+
sortBy?: string;
|
|
413
|
+
sortDirection?: string;
|
|
414
|
+
filterField?: string;
|
|
415
|
+
filterValue?: string;
|
|
416
|
+
filterOperator?: AthenaAdminListUsersFilterOperator;
|
|
417
|
+
}
|
|
418
|
+
interface AthenaAdminListUsersResponse {
|
|
419
|
+
users: AthenaAuthUser[];
|
|
420
|
+
total: number;
|
|
421
|
+
limit?: number;
|
|
422
|
+
offset?: number;
|
|
423
|
+
}
|
|
424
|
+
interface AthenaAdminListUserSessionsRequest {
|
|
425
|
+
userId: string;
|
|
426
|
+
}
|
|
427
|
+
interface AthenaAdminListUserSessionsResponse {
|
|
428
|
+
sessions: AthenaAuthSession[];
|
|
429
|
+
}
|
|
430
|
+
interface AthenaAdminImpersonateResponse {
|
|
431
|
+
session: AthenaAuthSession;
|
|
432
|
+
user: AthenaAuthUser;
|
|
433
|
+
}
|
|
434
|
+
interface AthenaAdminStopImpersonatingRequest {
|
|
435
|
+
userId?: string;
|
|
436
|
+
}
|
|
437
|
+
interface AthenaAdminRevokeUserSessionRequest {
|
|
438
|
+
sessionToken: string;
|
|
439
|
+
userId: string;
|
|
440
|
+
sessionId?: string;
|
|
441
|
+
}
|
|
442
|
+
interface AthenaAdminRevokeUserSessionsRequest {
|
|
443
|
+
userId: string;
|
|
444
|
+
}
|
|
445
|
+
interface AthenaAdminSetUserPasswordRequest {
|
|
446
|
+
userId: string;
|
|
447
|
+
newPassword: string;
|
|
448
|
+
}
|
|
449
|
+
interface AthenaAdminUserResponse {
|
|
450
|
+
user: AthenaAuthUser;
|
|
451
|
+
}
|
|
452
|
+
interface AthenaAdminSuccessResponse {
|
|
453
|
+
success: boolean;
|
|
454
|
+
}
|
|
455
|
+
interface AthenaAdminHasPermissionRequest {
|
|
456
|
+
permission?: AthenaAuthPermissionSet;
|
|
457
|
+
permissions: AthenaAuthPermissionSet;
|
|
458
|
+
}
|
|
459
|
+
interface AthenaAdminHasPermissionResponse {
|
|
460
|
+
success: boolean;
|
|
461
|
+
error?: string;
|
|
462
|
+
}
|
|
463
|
+
interface AthenaAdminApiKeyCreateRequest {
|
|
464
|
+
name?: string;
|
|
465
|
+
expiresIn?: number;
|
|
466
|
+
athenaClientName?: string;
|
|
467
|
+
permissions?: AthenaAuthLooseRecord;
|
|
468
|
+
metadata?: AthenaAuthLooseRecord;
|
|
469
|
+
}
|
|
470
|
+
interface AthenaAdminApiKeyCreateResponse {
|
|
471
|
+
key?: string;
|
|
472
|
+
apiKey?: AthenaAuthLooseRecord;
|
|
473
|
+
}
|
|
474
|
+
interface AthenaAdminAthenaClientCreateRequest {
|
|
475
|
+
clientName: string;
|
|
476
|
+
description?: string;
|
|
477
|
+
isActive?: boolean;
|
|
478
|
+
pgUriEnvVar?: string;
|
|
479
|
+
metadata?: AthenaAuthLooseRecord;
|
|
480
|
+
}
|
|
481
|
+
interface AthenaAdminAthenaClientListResponse {
|
|
482
|
+
athenaClients?: AthenaAuthLooseRecord[];
|
|
483
|
+
}
|
|
484
|
+
interface AthenaAdminAuditLogListQuery {
|
|
485
|
+
limit?: number;
|
|
486
|
+
offset?: number;
|
|
487
|
+
actorUserId?: string;
|
|
488
|
+
action?: string;
|
|
489
|
+
targetType?: string;
|
|
490
|
+
targetId?: string;
|
|
491
|
+
success?: boolean;
|
|
492
|
+
createdAfter?: string;
|
|
493
|
+
createdBefore?: string;
|
|
494
|
+
}
|
|
495
|
+
interface AthenaAdminAuditLogListResponse {
|
|
496
|
+
total?: number;
|
|
497
|
+
limit?: number;
|
|
498
|
+
offset?: number;
|
|
499
|
+
auditLogs?: AthenaAuthLooseRecord[];
|
|
500
|
+
}
|
|
501
|
+
interface AthenaAdminEmailListQuery {
|
|
502
|
+
limit?: number;
|
|
503
|
+
offset?: number;
|
|
504
|
+
recipientEmail?: string;
|
|
505
|
+
provider?: string;
|
|
506
|
+
flow?: string;
|
|
507
|
+
subjectContains?: string;
|
|
508
|
+
createdAfter?: string;
|
|
509
|
+
createdBefore?: string;
|
|
510
|
+
}
|
|
511
|
+
interface AthenaAdminEmailListResponse {
|
|
512
|
+
total?: number;
|
|
513
|
+
limit?: number;
|
|
514
|
+
offset?: number;
|
|
515
|
+
emails?: AthenaAuthLooseRecord[];
|
|
516
|
+
}
|
|
517
|
+
interface AthenaAdminEmailGetQuery {
|
|
518
|
+
id: string;
|
|
519
|
+
}
|
|
520
|
+
interface AthenaAdminEmailGetResponse {
|
|
521
|
+
email?: AthenaAuthLooseRecord;
|
|
522
|
+
}
|
|
523
|
+
interface AthenaAuthReactEmailRenderInput {
|
|
524
|
+
/**
|
|
525
|
+
* React email element instance (for example: `<WelcomeEmail {...props} />`).
|
|
526
|
+
*/
|
|
527
|
+
element?: unknown;
|
|
528
|
+
/**
|
|
529
|
+
* React email component function. Use with `props` when you prefer component + props inputs.
|
|
530
|
+
*/
|
|
531
|
+
component?: AthenaAuthReactEmailComponent;
|
|
532
|
+
/**
|
|
533
|
+
* Props passed to `component` when `element` is omitted.
|
|
534
|
+
*/
|
|
535
|
+
props?: AthenaAuthReactEmailProps;
|
|
536
|
+
/**
|
|
537
|
+
* When true, run `pretty(...)` on rendered HTML when available.
|
|
538
|
+
*/
|
|
539
|
+
pretty?: boolean;
|
|
540
|
+
/**
|
|
541
|
+
* Override plain-text output. If omitted, text is auto-derived when possible.
|
|
542
|
+
*/
|
|
543
|
+
text?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Disable derived plain-text generation. Defaults to `true`.
|
|
546
|
+
*/
|
|
547
|
+
includePlainText?: boolean;
|
|
548
|
+
}
|
|
549
|
+
type AthenaAuthReactEmailComponent<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> = (props: TProps) => unknown;
|
|
550
|
+
interface AthenaAuthReactEmailRenderOptions {
|
|
551
|
+
pretty?: boolean;
|
|
552
|
+
includePlainText?: boolean;
|
|
553
|
+
}
|
|
554
|
+
type AthenaAuthReactEmailEventPhase = 'render:start' | 'render:success' | 'render:error';
|
|
555
|
+
interface AthenaAuthReactEmailRenderEvent {
|
|
556
|
+
phase: AthenaAuthReactEmailEventPhase;
|
|
557
|
+
timestamp: string;
|
|
558
|
+
route?: string;
|
|
559
|
+
durationMs?: number;
|
|
560
|
+
message?: string;
|
|
561
|
+
error?: string;
|
|
562
|
+
}
|
|
563
|
+
interface AthenaAuthReactEmailConfig {
|
|
564
|
+
/**
|
|
565
|
+
* Optional default render settings used when request payloads omit `pretty` or `includePlainText`.
|
|
566
|
+
*/
|
|
567
|
+
defaults?: AthenaAuthReactEmailRenderOptions;
|
|
568
|
+
/**
|
|
569
|
+
* Optional observer for render lifecycle events.
|
|
570
|
+
*/
|
|
571
|
+
observe?: (event: AthenaAuthReactEmailRenderEvent) => void;
|
|
572
|
+
}
|
|
573
|
+
interface AthenaAdminEmailCreateRequest {
|
|
574
|
+
recipientEmail: string;
|
|
575
|
+
subject: string;
|
|
576
|
+
fromAddress: string;
|
|
577
|
+
fromName?: string;
|
|
578
|
+
textBody?: string;
|
|
579
|
+
htmlBody?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Optional React Email render input. When provided, `htmlBody` is derived automatically.
|
|
582
|
+
*/
|
|
583
|
+
react?: AthenaAuthReactEmailRenderInput;
|
|
584
|
+
provider: string;
|
|
585
|
+
flow?: string;
|
|
586
|
+
metadata?: AthenaAuthLooseRecord;
|
|
587
|
+
}
|
|
588
|
+
interface AthenaAdminEmailUpdateRequest {
|
|
589
|
+
id: string;
|
|
590
|
+
recipientEmail?: string;
|
|
591
|
+
subject?: string;
|
|
592
|
+
fromAddress?: string;
|
|
593
|
+
fromName?: string | null;
|
|
594
|
+
textBody?: string | null;
|
|
595
|
+
htmlBody?: string | null;
|
|
596
|
+
/**
|
|
597
|
+
* Optional React Email render input. When provided, `htmlBody` is derived automatically.
|
|
598
|
+
*/
|
|
599
|
+
react?: AthenaAuthReactEmailRenderInput;
|
|
600
|
+
provider?: string;
|
|
601
|
+
flow?: string | null;
|
|
602
|
+
metadata?: AthenaAuthLooseRecord;
|
|
603
|
+
}
|
|
604
|
+
interface AthenaAdminEmailUpdateResponse {
|
|
605
|
+
email?: AthenaAuthLooseRecord;
|
|
606
|
+
}
|
|
607
|
+
interface AthenaAdminEmailDeleteRequest {
|
|
608
|
+
id: string;
|
|
609
|
+
}
|
|
610
|
+
interface AthenaAdminEmailFailureListQuery {
|
|
611
|
+
limit?: number;
|
|
612
|
+
offset?: number;
|
|
613
|
+
recipientEmail?: string;
|
|
614
|
+
provider?: string;
|
|
615
|
+
flow?: string;
|
|
616
|
+
resolved?: boolean;
|
|
617
|
+
createdAfter?: string;
|
|
618
|
+
createdBefore?: string;
|
|
619
|
+
}
|
|
620
|
+
interface AthenaAdminEmailFailureListResponse {
|
|
621
|
+
total?: number;
|
|
622
|
+
limit?: number;
|
|
623
|
+
offset?: number;
|
|
624
|
+
emailSendFailures?: AthenaAuthLooseRecord[];
|
|
625
|
+
}
|
|
626
|
+
interface AthenaAdminEmailFailureGetQuery {
|
|
627
|
+
id: string;
|
|
628
|
+
}
|
|
629
|
+
interface AthenaAdminEmailFailureGetResponse {
|
|
630
|
+
emailSendFailure?: AthenaAuthLooseRecord;
|
|
631
|
+
}
|
|
632
|
+
interface AthenaAdminEmailFailureCreateRequest {
|
|
633
|
+
userId?: string;
|
|
634
|
+
recipientEmail: string;
|
|
635
|
+
flow: string;
|
|
636
|
+
provider?: string;
|
|
637
|
+
errorMessage: string;
|
|
638
|
+
metadata?: AthenaAuthLooseRecord;
|
|
639
|
+
}
|
|
640
|
+
interface AthenaAdminEmailFailureUpdateRequest {
|
|
641
|
+
id: string;
|
|
642
|
+
resolved?: boolean;
|
|
643
|
+
resolutionNote?: string | null;
|
|
644
|
+
metadata?: AthenaAuthLooseRecord;
|
|
645
|
+
}
|
|
646
|
+
interface AthenaAdminEmailFailureUpdateResponse {
|
|
647
|
+
emailSendFailure?: AthenaAuthLooseRecord;
|
|
648
|
+
}
|
|
649
|
+
interface AthenaAdminEmailFailureDeleteRequest {
|
|
650
|
+
id: string;
|
|
651
|
+
}
|
|
652
|
+
interface AthenaAdminEmailTemplateListQuery {
|
|
653
|
+
limit?: number;
|
|
654
|
+
offset?: number;
|
|
655
|
+
templateKey?: string;
|
|
656
|
+
locale?: string;
|
|
657
|
+
isActive?: boolean;
|
|
658
|
+
}
|
|
659
|
+
interface AthenaAdminEmailTemplateListResponse {
|
|
660
|
+
total?: number;
|
|
661
|
+
limit?: number;
|
|
662
|
+
offset?: number;
|
|
663
|
+
emailTemplates?: AthenaAuthLooseRecord[];
|
|
664
|
+
}
|
|
665
|
+
interface AthenaAdminEmailTemplateCreateRequest {
|
|
666
|
+
templateKey: string;
|
|
667
|
+
locale?: string;
|
|
668
|
+
subjectTemplate: string;
|
|
669
|
+
textTemplate?: string;
|
|
670
|
+
htmlTemplate?: string;
|
|
671
|
+
/**
|
|
672
|
+
* Optional React Email render input. When provided, `htmlTemplate` is derived automatically.
|
|
673
|
+
*/
|
|
674
|
+
react?: AthenaAuthReactEmailRenderInput;
|
|
675
|
+
variables?: string[];
|
|
676
|
+
isActive?: boolean;
|
|
677
|
+
metadata?: AthenaAuthLooseRecord;
|
|
678
|
+
}
|
|
679
|
+
interface AthenaAdminEmailTemplateUpdateRequest {
|
|
680
|
+
id: string;
|
|
681
|
+
templateKey?: string;
|
|
682
|
+
locale?: string;
|
|
683
|
+
subjectTemplate?: string;
|
|
684
|
+
textTemplate?: string | null;
|
|
685
|
+
htmlTemplate?: string | null;
|
|
686
|
+
/**
|
|
687
|
+
* Optional React Email render input. When provided, `htmlTemplate` is derived automatically.
|
|
688
|
+
*/
|
|
689
|
+
react?: AthenaAuthReactEmailRenderInput;
|
|
690
|
+
variables?: string[];
|
|
691
|
+
isActive?: boolean;
|
|
692
|
+
metadata?: AthenaAuthLooseRecord;
|
|
693
|
+
}
|
|
694
|
+
interface AthenaAdminEmailTemplateDeleteRequest {
|
|
695
|
+
id: string;
|
|
696
|
+
}
|
|
697
|
+
interface AthenaAdminEmailTemplateGetQuery {
|
|
698
|
+
id: string;
|
|
699
|
+
}
|
|
700
|
+
interface AthenaAdminEmailTemplateGetResponse {
|
|
701
|
+
emailTemplate?: AthenaAuthLooseRecord;
|
|
702
|
+
}
|
|
703
|
+
interface AthenaApiKeyCreateRequest {
|
|
704
|
+
name?: string;
|
|
705
|
+
expiresIn: string;
|
|
706
|
+
userId?: string;
|
|
707
|
+
prefix?: string;
|
|
708
|
+
remaining: string;
|
|
709
|
+
metadata?: string;
|
|
710
|
+
refillAmount?: string;
|
|
711
|
+
refillInterval?: string;
|
|
712
|
+
rateLimitTimeWindow?: string;
|
|
713
|
+
rateLimitMax?: string;
|
|
714
|
+
rateLimitEnabled?: string;
|
|
715
|
+
permissions?: string;
|
|
716
|
+
}
|
|
717
|
+
interface AthenaApiKeyRecord {
|
|
718
|
+
id: string;
|
|
719
|
+
name?: string | null;
|
|
720
|
+
start?: string | null;
|
|
721
|
+
prefix?: string | null;
|
|
722
|
+
userId: string;
|
|
723
|
+
refillInterval?: number | null;
|
|
724
|
+
refillAmount?: number | null;
|
|
725
|
+
lastRefillAt?: string | null;
|
|
726
|
+
enabled: boolean;
|
|
727
|
+
rateLimitEnabled: boolean;
|
|
728
|
+
rateLimitTimeWindow?: number | null;
|
|
729
|
+
rateLimitMax?: number | null;
|
|
730
|
+
requestCount: number;
|
|
731
|
+
remaining?: number | null;
|
|
732
|
+
lastRequest?: string | null;
|
|
733
|
+
expiresAt?: string | null;
|
|
734
|
+
createdAt: string;
|
|
735
|
+
updatedAt: string;
|
|
736
|
+
metadata?: AthenaAuthLooseRecord | null;
|
|
737
|
+
permissions?: string | null;
|
|
738
|
+
key?: string;
|
|
739
|
+
}
|
|
740
|
+
interface AthenaApiKeyGetQuery {
|
|
741
|
+
id?: string;
|
|
742
|
+
}
|
|
743
|
+
interface AthenaApiKeyUpdateRequest {
|
|
744
|
+
keyId: string;
|
|
745
|
+
userId?: string;
|
|
746
|
+
name?: string;
|
|
747
|
+
enabled?: string;
|
|
748
|
+
remaining?: string;
|
|
749
|
+
refillAmount?: string;
|
|
750
|
+
refillInterval?: string;
|
|
751
|
+
metadata?: string;
|
|
752
|
+
expiresIn: string;
|
|
753
|
+
rateLimitEnabled?: string;
|
|
754
|
+
rateLimitTimeWindow?: string;
|
|
755
|
+
rateLimitMax?: string;
|
|
756
|
+
permissions: string;
|
|
757
|
+
}
|
|
758
|
+
interface AthenaApiKeyDeleteRequest {
|
|
759
|
+
keyId: string;
|
|
760
|
+
}
|
|
761
|
+
interface AthenaApiKeyVerifyRequest {
|
|
762
|
+
key: string;
|
|
763
|
+
permissions?: AthenaAuthLooseRecord;
|
|
764
|
+
}
|
|
765
|
+
interface AthenaApiKeyVerifyResponse {
|
|
766
|
+
valid?: boolean;
|
|
767
|
+
error?: {
|
|
768
|
+
message?: string;
|
|
769
|
+
code?: string;
|
|
770
|
+
} | null;
|
|
771
|
+
key?: AthenaAuthLooseRecord | null;
|
|
772
|
+
}
|
|
773
|
+
interface AthenaApiKeyDeleteAllExpiredResponse {
|
|
774
|
+
deleted?: number;
|
|
775
|
+
}
|
|
776
|
+
interface AthenaAuthOrganizationCreateRequest {
|
|
777
|
+
name: string;
|
|
778
|
+
slug: string;
|
|
779
|
+
logo?: string;
|
|
780
|
+
metadata?: Record<string, unknown>;
|
|
781
|
+
userId?: string;
|
|
782
|
+
keepCurrentActiveOrganization?: boolean;
|
|
783
|
+
}
|
|
784
|
+
interface AthenaAuthOrganizationCheckSlugRequest {
|
|
785
|
+
slug: string;
|
|
786
|
+
}
|
|
787
|
+
interface AthenaAuthOrganizationSetActiveRequest {
|
|
788
|
+
organizationId?: string | null;
|
|
789
|
+
organizationSlug?: string | null;
|
|
790
|
+
}
|
|
791
|
+
interface AthenaAuthOrganizationGetFullQuery {
|
|
792
|
+
organizationId?: string;
|
|
793
|
+
organizationSlug?: string;
|
|
794
|
+
membersLimit?: number;
|
|
795
|
+
}
|
|
796
|
+
interface AthenaAuthOrganizationUpdateRequest {
|
|
797
|
+
data: {
|
|
798
|
+
name?: string;
|
|
799
|
+
slug?: string;
|
|
800
|
+
logo?: string;
|
|
801
|
+
metadata?: Record<string, unknown> | null;
|
|
802
|
+
};
|
|
803
|
+
organizationId?: string;
|
|
804
|
+
}
|
|
805
|
+
interface AthenaAuthOrganizationDeleteRequest {
|
|
806
|
+
organizationId: string;
|
|
807
|
+
}
|
|
808
|
+
interface AthenaAuthOrganizationInviteMemberRequest {
|
|
809
|
+
email: string;
|
|
810
|
+
role: string | string[];
|
|
811
|
+
organizationId?: string;
|
|
812
|
+
resend?: boolean;
|
|
813
|
+
teamId?: string;
|
|
814
|
+
}
|
|
815
|
+
interface AthenaAuthOrganizationInvitationActionRequest {
|
|
816
|
+
invitationId: string;
|
|
817
|
+
}
|
|
818
|
+
interface AthenaAuthOrganizationGetInvitationQuery {
|
|
819
|
+
id: string;
|
|
820
|
+
}
|
|
821
|
+
interface AthenaAuthOrganizationListInvitationsQuery {
|
|
822
|
+
organizationId?: string;
|
|
823
|
+
}
|
|
824
|
+
interface AthenaAuthOrganizationListUserInvitationsQuery {
|
|
825
|
+
email?: string;
|
|
826
|
+
}
|
|
827
|
+
type AthenaAuthOrganizationListMembersFilterOperator = AthenaAuthFilterOperator;
|
|
828
|
+
interface AthenaAuthOrganizationListMembersQuery {
|
|
829
|
+
organizationId?: string;
|
|
830
|
+
limit?: number;
|
|
831
|
+
offset?: number;
|
|
832
|
+
sortBy?: string;
|
|
833
|
+
sortDirection?: 'asc' | 'desc';
|
|
834
|
+
filterField?: string;
|
|
835
|
+
filterOperator?: AthenaAuthOrganizationListMembersFilterOperator;
|
|
836
|
+
filterValue?: string | number | boolean | string[] | number[];
|
|
837
|
+
}
|
|
838
|
+
interface AthenaAuthOrganizationRemoveMemberRequest {
|
|
839
|
+
memberIdOrEmail: string;
|
|
840
|
+
organizationId?: string;
|
|
841
|
+
}
|
|
842
|
+
interface AthenaAuthOrganizationUpdateMemberRoleRequest {
|
|
843
|
+
role: string | string[];
|
|
844
|
+
memberId: string;
|
|
845
|
+
organizationId?: string;
|
|
846
|
+
}
|
|
847
|
+
interface AthenaAuthOrganizationLeaveRequest {
|
|
848
|
+
organizationId: string;
|
|
849
|
+
}
|
|
850
|
+
interface AthenaAuthRequestInput {
|
|
851
|
+
endpoint: AthenaAuthEndpointPath;
|
|
852
|
+
method?: AthenaAuthMethod;
|
|
853
|
+
body?: unknown;
|
|
854
|
+
query?: Record<string, AthenaAuthQueryValue>;
|
|
855
|
+
fetchOptions?: AthenaAuthCallOptions;
|
|
856
|
+
}
|
|
857
|
+
interface AthenaAuthCallOptions {
|
|
858
|
+
baseUrl?: string;
|
|
859
|
+
apiKey?: string;
|
|
860
|
+
bearerToken?: string;
|
|
861
|
+
headers?: Record<string, string>;
|
|
862
|
+
credentials?: AthenaAuthCredentials;
|
|
863
|
+
signal?: AbortSignal;
|
|
864
|
+
}
|
|
865
|
+
interface AthenaAuthFetchCompatibleInput {
|
|
866
|
+
fetchOptions?: AthenaAuthCallOptions;
|
|
867
|
+
}
|
|
868
|
+
interface AthenaAuthClientConfig extends AthenaAuthCallOptions {
|
|
869
|
+
fetch?: typeof fetch;
|
|
870
|
+
reactEmail?: AthenaAuthReactEmailConfig;
|
|
871
|
+
}
|
|
872
|
+
interface AthenaAuthEmailTemplateDefinition<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> {
|
|
873
|
+
component: AthenaAuthReactEmailComponent<TProps>;
|
|
874
|
+
templateKey?: string;
|
|
875
|
+
subjectTemplate?: string;
|
|
876
|
+
defaults?: AthenaAuthReactEmailRenderOptions;
|
|
877
|
+
}
|
|
878
|
+
interface AthenaAuthEmailTemplateReactOverrides {
|
|
879
|
+
pretty?: boolean;
|
|
880
|
+
text?: string;
|
|
881
|
+
includePlainText?: boolean;
|
|
882
|
+
}
|
|
883
|
+
interface AthenaAuthEmailTemplateCreateFromDefinitionInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> extends Omit<AthenaAdminEmailTemplateCreateRequest, 'react' | 'htmlTemplate' | 'textTemplate' | 'variables' | 'templateKey' | 'subjectTemplate'> {
|
|
884
|
+
props: TProps;
|
|
885
|
+
templateKey?: string;
|
|
886
|
+
subjectTemplate?: string;
|
|
887
|
+
react?: AthenaAuthEmailTemplateReactOverrides;
|
|
888
|
+
}
|
|
889
|
+
interface AthenaAuthEmailTemplateUpdateFromDefinitionInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> extends Omit<AthenaAdminEmailTemplateUpdateRequest, 'react' | 'htmlTemplate' | 'textTemplate' | 'variables'> {
|
|
890
|
+
props: TProps;
|
|
891
|
+
react?: AthenaAuthEmailTemplateReactOverrides;
|
|
892
|
+
}
|
|
893
|
+
interface AthenaAuthEmailTemplateBuilder<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps> {
|
|
894
|
+
component: AthenaAuthReactEmailComponent<TProps>;
|
|
895
|
+
react: (props: TProps, overrides?: AthenaAuthEmailTemplateReactOverrides) => AthenaAuthReactEmailRenderInput;
|
|
896
|
+
toTemplateCreate: (input: AthenaAuthEmailTemplateCreateFromDefinitionInput<TProps>) => AthenaAdminEmailTemplateCreateRequest;
|
|
897
|
+
toTemplateUpdate: (input: AthenaAuthEmailTemplateUpdateFromDefinitionInput<TProps>) => AthenaAdminEmailTemplateUpdateRequest;
|
|
898
|
+
}
|
|
899
|
+
type AthenaAuthGenericInput = AthenaAuthFetchCompatibleInput & Record<string, unknown>;
|
|
900
|
+
type AthenaAuthGenericQueryInput = AthenaAuthFetchCompatibleInput & {
|
|
901
|
+
query?: Record<string, AthenaAuthQueryValue>;
|
|
902
|
+
};
|
|
903
|
+
type AthenaAuthResetPasswordBinding = ((input: AthenaResetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>) & {
|
|
904
|
+
token: (input: {
|
|
905
|
+
token: string;
|
|
906
|
+
callbackURL?: string;
|
|
907
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
908
|
+
token?: string;
|
|
909
|
+
}>>;
|
|
910
|
+
};
|
|
911
|
+
type AthenaAuthSessionRevokeBinding = (input: (AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput) | (AthenaAuthRevokeSessionRequest[] & AthenaAuthFetchCompatibleInput), options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
912
|
+
type AthenaAuthAdminUserSessionRevokeBinding = (input: (AthenaAdminRevokeUserSessionRequest & AthenaAuthFetchCompatibleInput) | (AthenaAdminRevokeUserSessionsRequest & AthenaAuthFetchCompatibleInput) | ({
|
|
913
|
+
sessions: AthenaAdminRevokeUserSessionRequest[];
|
|
914
|
+
} & AthenaAuthFetchCompatibleInput) | ((AthenaAdminRevokeUserSessionRequest & AthenaAuthFetchCompatibleInput)[]), options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
915
|
+
interface AthenaAuthOrganizationBindings {
|
|
916
|
+
/** Create an organization. Route: `POST /organization/create`. */
|
|
917
|
+
create: (input: AthenaAuthOrganizationCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization>>;
|
|
918
|
+
/** Update an organization. Route: `POST /organization/update`. */
|
|
919
|
+
update: (input: AthenaAuthOrganizationUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization>>;
|
|
920
|
+
/** Delete an organization. Route: `POST /organization/delete`. */
|
|
921
|
+
delete: (input: AthenaAuthOrganizationDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
922
|
+
/** Set active organization for current session. Route: `POST /organization/set-active`. */
|
|
923
|
+
setActive: (input: AthenaAuthOrganizationSetActiveRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
924
|
+
/** List organizations visible to the current user. Route: `GET /organization/list`. */
|
|
925
|
+
list: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization[]>>;
|
|
926
|
+
/** Get organization details including related members/invitations. Route: `GET /organization/get-full-organization`. */
|
|
927
|
+
getFull: (input?: {
|
|
928
|
+
query?: AthenaAuthOrganizationGetFullQuery;
|
|
929
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
930
|
+
organization: AthenaAuthOrganization;
|
|
931
|
+
members?: AthenaAuthOrganizationMember[];
|
|
932
|
+
invitations?: AthenaAuthOrganizationInvitation[];
|
|
933
|
+
}>>;
|
|
934
|
+
/** Check if an organization slug is available. Route: `POST /organization/check-slug`. */
|
|
935
|
+
checkSlug: (input: AthenaAuthOrganizationCheckSlugRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
936
|
+
available: boolean;
|
|
937
|
+
}>>;
|
|
938
|
+
/** Leave an organization. Route: `POST /organization/leave`. */
|
|
939
|
+
leave: (input: AthenaAuthOrganizationLeaveRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
940
|
+
/** List invitations for the current user. Route: `GET /organization/list-user-invitations`. */
|
|
941
|
+
listUserInvitations: (input?: {
|
|
942
|
+
query?: AthenaAuthOrganizationListUserInvitationsQuery;
|
|
943
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation[]>>;
|
|
944
|
+
/** Check organization-level permissions for the current principal. Route: `POST /organization/has-permission`. */
|
|
945
|
+
hasPermission: (input: AthenaAdminHasPermissionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminHasPermissionResponse>>;
|
|
946
|
+
invitation: {
|
|
947
|
+
/** Cancel an organization invitation. Route: `POST /organization/cancel-invitation`. */
|
|
948
|
+
cancel: (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
949
|
+
/** Accept an organization invitation. Route: `POST /organization/accept-invitation`. */
|
|
950
|
+
accept: (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
951
|
+
/** Get an invitation by id. Route: `GET /organization/get-invitation`. */
|
|
952
|
+
get: (input: {
|
|
953
|
+
query: AthenaAuthOrganizationGetInvitationQuery;
|
|
954
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation>>;
|
|
955
|
+
/** Reject an organization invitation. Route: `POST /organization/reject-invitation`. */
|
|
956
|
+
reject: (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
957
|
+
/** List invitations for an organization. Route: `GET /organization/list-invitations`. */
|
|
958
|
+
list: (input?: {
|
|
959
|
+
query?: AthenaAuthOrganizationListInvitationsQuery;
|
|
960
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation[]>>;
|
|
961
|
+
};
|
|
962
|
+
member: {
|
|
963
|
+
/** Remove an organization member. Route: `POST /organization/remove-member`. */
|
|
964
|
+
remove: (input: AthenaAuthOrganizationRemoveMemberRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
965
|
+
/** Update a member role. Route: `POST /organization/update-member-role`. */
|
|
966
|
+
updateRole: (input: AthenaAuthOrganizationUpdateMemberRoleRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
967
|
+
/** Invite a member to an organization. Route: `POST /organization/invite-member`. */
|
|
968
|
+
invite: (input: AthenaAuthOrganizationInviteMemberRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation>>;
|
|
969
|
+
/** Get the active organization member context for the current session. Route: `GET /organization/get-active-member`. */
|
|
970
|
+
getActive: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationMember>>;
|
|
971
|
+
/** List organization members. Route: `GET /organization/list-members`. */
|
|
972
|
+
list: (input?: {
|
|
973
|
+
query?: AthenaAuthOrganizationListMembersQuery;
|
|
974
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationMember[]>>;
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
interface AthenaAuthBindings {
|
|
978
|
+
/** Get current session. Route: `GET /get-session`. */
|
|
979
|
+
getSession: AthenaAuthSdkClient['getSession'];
|
|
980
|
+
/** Sign out current session. Route: `POST /sign-out`. */
|
|
981
|
+
signOut: AthenaAuthSdkClient['signOut'];
|
|
982
|
+
/** Trigger password reset email flow. Route: `POST /forget-password`. */
|
|
983
|
+
forgetPassword: AthenaAuthSdkClient['forgetPassword'];
|
|
984
|
+
/** Reset password (`POST /reset-password`) and token resolver (`GET /reset-password/{token}`). */
|
|
985
|
+
resetPassword: AthenaAuthResetPasswordBinding;
|
|
986
|
+
/** Set password for the current authenticated user. Route: `POST /set-password`. */
|
|
987
|
+
setPassword: (input: AthenaSetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
988
|
+
/** Verify email token. Route: `GET /verify-email`. */
|
|
989
|
+
verifyEmail: AthenaAuthSdkClient['verifyEmail'];
|
|
990
|
+
/** Send verification email. Route: `POST /send-verification-email`. */
|
|
991
|
+
sendVerificationEmail: AthenaAuthSdkClient['sendVerificationEmail'];
|
|
992
|
+
/** Start change-email flow. Route: `POST /change-email`. */
|
|
993
|
+
changeEmail: AthenaAuthSdkClient['changeEmail'];
|
|
994
|
+
/** Verify pending email change. Route: `GET /change-email/verify`. */
|
|
995
|
+
changeEmailVerify: (input: {
|
|
996
|
+
query: AthenaAuthTokenQuery;
|
|
997
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthTokenVerificationResponse>>;
|
|
998
|
+
/** Verify pending delete-user flow. Route: `GET /delete-user/verify`. */
|
|
999
|
+
deleteUserVerify: (input: {
|
|
1000
|
+
query: AthenaAuthTokenQuery;
|
|
1001
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthTokenVerificationResponse>>;
|
|
1002
|
+
/** Change current user password. Route: `POST /change-password`. */
|
|
1003
|
+
changePassword: AthenaAuthSdkClient['changePassword'];
|
|
1004
|
+
user: {
|
|
1005
|
+
/** Update current user profile fields. Route: `POST /update-user`. */
|
|
1006
|
+
update: AthenaAuthSdkClient['updateUser'];
|
|
1007
|
+
/** Delete current user. Route: `POST /delete-user`. */
|
|
1008
|
+
delete: AthenaAuthSdkClient['deleteUser'];
|
|
1009
|
+
email: {
|
|
1010
|
+
/**
|
|
1011
|
+
* List email identities for current user.
|
|
1012
|
+
* Routes: primary `GET /email/list`; falls back to `GET /email-list` on `404`.
|
|
1013
|
+
*/
|
|
1014
|
+
list: (input?: {
|
|
1015
|
+
query?: AthenaAuthEmailListQuery;
|
|
1016
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailListResponse>>;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
session: {
|
|
1020
|
+
/** List user sessions. Route: `GET /list-sessions`. */
|
|
1021
|
+
list: AthenaAuthSdkClient['listSessions'];
|
|
1022
|
+
/** Revoke one or multiple sessions; collapses to `/revoke-session` or `/revoke-sessions` by payload shape. */
|
|
1023
|
+
revoke: AthenaAuthSessionRevokeBinding;
|
|
1024
|
+
/** Revoke all other sessions for current user. Route: `POST /revoke-other-sessions`. */
|
|
1025
|
+
revokeOther: AthenaAuthSdkClient['revokeOtherSessions'];
|
|
1026
|
+
};
|
|
1027
|
+
social: {
|
|
1028
|
+
/** Link a social provider to current user. Route: `POST /link-social`. */
|
|
1029
|
+
link: AthenaAuthSdkClient['linkSocial'];
|
|
1030
|
+
};
|
|
1031
|
+
account: {
|
|
1032
|
+
/** List linked provider accounts. Route: `GET /list-accounts`. */
|
|
1033
|
+
list: AthenaAuthSdkClient['listAccounts'];
|
|
1034
|
+
/** Unlink a provider account. Route: `POST /unlink-account`. */
|
|
1035
|
+
unlink: AthenaAuthSdkClient['unlinkAccount'];
|
|
1036
|
+
};
|
|
1037
|
+
deleteUser: {
|
|
1038
|
+
/** Callback endpoint for delete-user verification flows. Route: `GET /delete-user/callback`. */
|
|
1039
|
+
callback: AthenaAuthSdkClient['deleteUserCallback'];
|
|
1040
|
+
};
|
|
1041
|
+
/** Refresh provider token. Route: `POST /refresh-token`. */
|
|
1042
|
+
refreshToken: AthenaAuthSdkClient['refreshToken'];
|
|
1043
|
+
/** Get provider access token. Route: `POST /get-access-token`. */
|
|
1044
|
+
getAccessToken: AthenaAuthSdkClient['getAccessToken'];
|
|
1045
|
+
/** Auth health route. Primary `GET /health`; falls back to `GET /ok` on `404`. */
|
|
1046
|
+
health: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthHealthResponse>>;
|
|
1047
|
+
/** Health route passthrough. Route: `GET /ok`. */
|
|
1048
|
+
ok: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOkResponse>>;
|
|
1049
|
+
/** Error route passthrough. Route: `GET /error`. */
|
|
1050
|
+
error: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthErrorResponse | string>>;
|
|
1051
|
+
twoFactor: {
|
|
1052
|
+
/** Get TOTP URI for setup. Route: `POST /two-factor/get-totp-uri`. */
|
|
1053
|
+
getTotpUri: (input: AthenaTwoFactorGetTotpUriRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorGetTotpUriResponse>>;
|
|
1054
|
+
/** Verify TOTP code. Route: `POST /two-factor/verify-totp`. */
|
|
1055
|
+
verifyTotp: (input: AthenaTwoFactorVerifyTotpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyTotpResponse>>;
|
|
1056
|
+
/** Send one-time passcode (OTP). Route: `POST /two-factor/send-otp`. */
|
|
1057
|
+
sendOtp: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1058
|
+
/** Verify OTP code. Route: `POST /two-factor/verify-otp`. */
|
|
1059
|
+
verifyOtp: (input: AthenaTwoFactorVerifyOtpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyOtpResponse>>;
|
|
1060
|
+
/** Verify backup code. Route: `POST /two-factor/verify-backup-code`. */
|
|
1061
|
+
verifyBackupCode: (input: AthenaTwoFactorVerifyBackupCodeRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyBackupCodeResponse>>;
|
|
1062
|
+
/** Generate backup codes. Route: `POST /two-factor/generate-backup-codes`. */
|
|
1063
|
+
generateBackupCodes: (input: AthenaTwoFactorGenerateBackupCodesRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorGenerateBackupCodesResponse>>;
|
|
1064
|
+
/** Enable two-factor auth. Route: `POST /two-factor/enable`. */
|
|
1065
|
+
enable: (input: AthenaTwoFactorEnableRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorEnableResponse>>;
|
|
1066
|
+
/** Disable two-factor auth. Route: `POST /two-factor/disable`. */
|
|
1067
|
+
disable: (input: AthenaTwoFactorDisableRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorDisableResponse>>;
|
|
1068
|
+
};
|
|
1069
|
+
passkey: {
|
|
1070
|
+
/** Generate WebAuthn registration options. Route: `GET /passkey/generate-register-options`. */
|
|
1071
|
+
generateRegisterOptions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyOptionsResponse>>;
|
|
1072
|
+
/** Generate WebAuthn authentication options. Route: `POST /passkey/generate-authenticate-options`. */
|
|
1073
|
+
generateAuthenticateOptions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyOptionsResponse>>;
|
|
1074
|
+
/** Verify passkey registration response. Route: `POST /passkey/verify-registration`. */
|
|
1075
|
+
verifyRegistration: (input: AthenaPasskeyVerifyRegistrationRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyRecord>>;
|
|
1076
|
+
/** Verify passkey authentication response. Route: `POST /passkey/verify-authentication`. */
|
|
1077
|
+
verifyAuthentication: (input: AthenaPasskeyVerifyAuthenticationRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyVerifyAuthenticationResponse>>;
|
|
1078
|
+
/** List current user's passkeys. Route: `GET /passkey/list-user-passkeys`. */
|
|
1079
|
+
listUserPasskeys: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyRecord[]>>;
|
|
1080
|
+
/** Delete a passkey. Route: `POST /passkey/delete-passkey`. */
|
|
1081
|
+
deletePasskey: (input: AthenaPasskeyDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyDeleteResponse>>;
|
|
1082
|
+
/** Update a passkey metadata record. Route: `POST /passkey/update-passkey`. */
|
|
1083
|
+
updatePasskey: (input: AthenaPasskeyUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyUpdateResponse>>;
|
|
1084
|
+
/** Return related origins for WebAuthn. Route: `GET /.well-known/webauthn`. */
|
|
1085
|
+
getRelatedOrigins: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
1086
|
+
origins?: string[];
|
|
1087
|
+
}>>;
|
|
1088
|
+
};
|
|
1089
|
+
admin: {
|
|
1090
|
+
role: {
|
|
1091
|
+
/** Set a user role. Route: `POST /admin/set-role`. */
|
|
1092
|
+
set: (input: AthenaAdminSetRoleRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
|
|
1093
|
+
};
|
|
1094
|
+
user: {
|
|
1095
|
+
/** List users. Route: `GET /admin/list-users`. */
|
|
1096
|
+
list: (input?: {
|
|
1097
|
+
query?: AthenaAdminListUsersQuery;
|
|
1098
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminListUsersResponse>>;
|
|
1099
|
+
/** Create user. Route: `POST /admin/create-user`. */
|
|
1100
|
+
create: (input: AthenaAdminCreateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
|
|
1101
|
+
/** Unban user. Route: `POST /admin/unban-user`. */
|
|
1102
|
+
unban: (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
|
|
1103
|
+
/** Ban user. Route: `POST /admin/ban-user`. */
|
|
1104
|
+
ban: (input: AthenaAdminBanUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>>;
|
|
1105
|
+
/** Start impersonation. Route: `POST /admin/impersonate-user`. */
|
|
1106
|
+
impersonate: (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminImpersonateResponse>>;
|
|
1107
|
+
/** Stop impersonation. Route: `POST /admin/stop-impersonating`. */
|
|
1108
|
+
stopImpersonating: (input?: AthenaAdminStopImpersonatingRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
|
|
1109
|
+
/** Remove user. Route: `POST /admin/remove-user`. */
|
|
1110
|
+
remove: (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1111
|
+
/** Set user password. Route: `POST /admin/set-user-password`. */
|
|
1112
|
+
setPassword: (input: AthenaAdminSetUserPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1113
|
+
session: {
|
|
1114
|
+
/** List sessions for a target user. Route: `POST /admin/list-user-sessions`. */
|
|
1115
|
+
list: (input: AthenaAdminListUserSessionsRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminListUserSessionsResponse>>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Revoke one or multiple sessions; collapses to `/admin/revoke-user-session` or
|
|
1118
|
+
* `/admin/revoke-user-sessions`. `userId` is required and plural payloads must share one `userId`.
|
|
1119
|
+
*/
|
|
1120
|
+
revoke: AthenaAuthAdminUserSessionRevokeBinding;
|
|
1121
|
+
};
|
|
1122
|
+
};
|
|
1123
|
+
/** Check permission under admin policy. Route: `POST /admin/has-permission`. */
|
|
1124
|
+
hasPermission: (input: AthenaAdminHasPermissionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminHasPermissionResponse>>;
|
|
1125
|
+
apiKey: {
|
|
1126
|
+
/** Create admin-scoped API key. Route: `POST /admin/api-key/create`. */
|
|
1127
|
+
create: (input?: AthenaAdminApiKeyCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminApiKeyCreateResponse>>;
|
|
1128
|
+
};
|
|
1129
|
+
athenaClient: {
|
|
1130
|
+
/** Create Athena client credentials. Route: `POST /admin/athena-client/create`. */
|
|
1131
|
+
create: (input: AthenaAdminAthenaClientCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
|
|
1132
|
+
/** List Athena client credentials. Route: `GET /admin/athena-client/list`. */
|
|
1133
|
+
list: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminAthenaClientListResponse>>;
|
|
1134
|
+
};
|
|
1135
|
+
auditLog: {
|
|
1136
|
+
/** List auth audit events. Route: `GET /admin/audit-log/list`. */
|
|
1137
|
+
list: (input?: {
|
|
1138
|
+
query?: AthenaAdminAuditLogListQuery;
|
|
1139
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminAuditLogListResponse>>;
|
|
1140
|
+
};
|
|
1141
|
+
email: {
|
|
1142
|
+
/** List emails. Route: `GET /admin/email/list`. */
|
|
1143
|
+
list: (input?: {
|
|
1144
|
+
query?: AthenaAdminEmailListQuery;
|
|
1145
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailListResponse>>;
|
|
1146
|
+
/** Get a specific email record. Route: `GET /admin/email/get`. */
|
|
1147
|
+
get: (input: {
|
|
1148
|
+
query: AthenaAdminEmailGetQuery;
|
|
1149
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailGetResponse>>;
|
|
1150
|
+
/** Create an email record. Route: `POST /admin/email/create`. */
|
|
1151
|
+
create: (input: AthenaAdminEmailCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1152
|
+
/** Update an email record. Route: `POST /admin/email/update`. */
|
|
1153
|
+
update: (input: AthenaAdminEmailUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailUpdateResponse>>;
|
|
1154
|
+
/** Delete an email record. Route: `POST /admin/email/delete`. */
|
|
1155
|
+
delete: (input: AthenaAdminEmailDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1156
|
+
failure: {
|
|
1157
|
+
/** List email failure records. Route: `GET /admin/email-failure/list`. */
|
|
1158
|
+
list: (input?: {
|
|
1159
|
+
query?: AthenaAdminEmailFailureListQuery;
|
|
1160
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureListResponse>>;
|
|
1161
|
+
/** Get an email failure record. Route: `GET /admin/email-failure/get`. */
|
|
1162
|
+
get: (input: {
|
|
1163
|
+
query: AthenaAdminEmailFailureGetQuery;
|
|
1164
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureGetResponse>>;
|
|
1165
|
+
/** Create an email failure record. Route: `POST /admin/email-failure/create`. */
|
|
1166
|
+
create: (input: AthenaAdminEmailFailureCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1167
|
+
/** Update an email failure record. Route: `POST /admin/email-failure/update`. */
|
|
1168
|
+
update: (input: AthenaAdminEmailFailureUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureUpdateResponse>>;
|
|
1169
|
+
/** Delete an email failure record. Route: `POST /admin/email-failure/delete`. */
|
|
1170
|
+
delete: (input: AthenaAdminEmailFailureDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1171
|
+
};
|
|
1172
|
+
template: {
|
|
1173
|
+
/** List email templates. Route: `GET /admin/email-template/list`. */
|
|
1174
|
+
list: (input?: {
|
|
1175
|
+
query?: AthenaAdminEmailTemplateListQuery;
|
|
1176
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateListResponse>>;
|
|
1177
|
+
/** Get email template by ID. Route: `GET /admin/email-template/get`. */
|
|
1178
|
+
get: (input: {
|
|
1179
|
+
query: AthenaAdminEmailTemplateGetQuery;
|
|
1180
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateGetResponse>>;
|
|
1181
|
+
/** Create email template. Route: `POST /admin/email-template/create`. */
|
|
1182
|
+
create: (input: AthenaAdminEmailTemplateCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
|
|
1183
|
+
/** Update email template. Route: `POST /admin/email-template/update`. */
|
|
1184
|
+
update: (input: AthenaAdminEmailTemplateUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
|
|
1185
|
+
/** Delete email template. Route: `POST /admin/email-template/delete`. */
|
|
1186
|
+
delete: (input: AthenaAdminEmailTemplateDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
emailTemplate: {
|
|
1190
|
+
/** Get email template by ID. Route: `GET /admin/email-template/get`. */
|
|
1191
|
+
get: (input: {
|
|
1192
|
+
query: AthenaAdminEmailTemplateGetQuery;
|
|
1193
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateGetResponse>>;
|
|
1194
|
+
/** Create email template. Route: `POST /admin/email-template/create`. */
|
|
1195
|
+
create: (input: AthenaAdminEmailTemplateCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
|
|
1196
|
+
/** Delete email template. Route: `POST /admin/email-template/delete`. */
|
|
1197
|
+
delete: (input: AthenaAdminEmailTemplateDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1198
|
+
/** List email templates. Route: `GET /admin/email-template/list`. */
|
|
1199
|
+
list: (input?: {
|
|
1200
|
+
query?: AthenaAdminEmailTemplateListQuery;
|
|
1201
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateListResponse>>;
|
|
1202
|
+
/** Update email template. Route: `POST /admin/email-template/update`. */
|
|
1203
|
+
update: (input: AthenaAdminEmailTemplateUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>>;
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
apiKey: {
|
|
1207
|
+
/** Create API key. Route: `POST /api-key/create`. */
|
|
1208
|
+
create: (input: AthenaApiKeyCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>>;
|
|
1209
|
+
/** Get API key metadata. Route: `GET /api-key/get`. */
|
|
1210
|
+
get: (input?: {
|
|
1211
|
+
query?: AthenaApiKeyGetQuery;
|
|
1212
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>>;
|
|
1213
|
+
/** Update API key metadata. Route: `POST /api-key/update`. */
|
|
1214
|
+
update: (input: AthenaApiKeyUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>>;
|
|
1215
|
+
/** Delete API key. Route: `POST /api-key/delete`. */
|
|
1216
|
+
delete: (input: AthenaApiKeyDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>>;
|
|
1217
|
+
/** List API keys. Route: `GET /api-key/list`. */
|
|
1218
|
+
list: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord[]>>;
|
|
1219
|
+
/** Verify an API key. Route: `POST /api-key/verify`. */
|
|
1220
|
+
verify: (input: AthenaApiKeyVerifyRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyVerifyResponse>>;
|
|
1221
|
+
/** Delete all expired API keys. Route: `POST /api-key/delete-all-expired-api-keys`. */
|
|
1222
|
+
deleteAllExpired: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyDeleteAllExpiredResponse>>;
|
|
1223
|
+
};
|
|
1224
|
+
signIn: {
|
|
1225
|
+
/** Sign in with email and password. Route: `POST /sign-in/email`. */
|
|
1226
|
+
email: AthenaAuthSdkClient['signIn']['email'];
|
|
1227
|
+
/** Sign in with username and password. Route: `POST /sign-in/username`. */
|
|
1228
|
+
username: AthenaAuthSdkClient['signIn']['username'];
|
|
1229
|
+
/** Sign in with social provider. Route: `POST /sign-in/social`. */
|
|
1230
|
+
social: AthenaAuthSdkClient['signIn']['social'];
|
|
1231
|
+
};
|
|
1232
|
+
signUp: {
|
|
1233
|
+
/** Sign up with email/password identity. Route: `POST /sign-up/email`. */
|
|
1234
|
+
email: AthenaAuthSdkClient['signUp']['email'];
|
|
1235
|
+
};
|
|
1236
|
+
/** Organization plugin helper surface. Routes: `/organization/*`. */
|
|
1237
|
+
organization: AthenaAuthOrganizationBindings;
|
|
1238
|
+
callback: {
|
|
1239
|
+
/** OAuth provider callback passthrough. Route: `GET /callback/{provider}`. */
|
|
1240
|
+
provider: (input: AthenaAuthCallbackProviderRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthCallbackProviderResponse>>;
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
interface AthenaAuthSdkClient {
|
|
1244
|
+
baseUrl: string;
|
|
1245
|
+
request: <T = unknown>(input: AthenaAuthRequestInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<T>>;
|
|
1246
|
+
signIn: {
|
|
1247
|
+
email: (input: AthenaEmailSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
1248
|
+
username: (input: AthenaUsernameSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
1249
|
+
social: (input: AthenaSocialSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse | AthenaAuthSignInResponse>>;
|
|
1250
|
+
};
|
|
1251
|
+
signUp: {
|
|
1252
|
+
email: (input: AthenaEmailSignUpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
1253
|
+
};
|
|
1254
|
+
signOut: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
|
|
1255
|
+
logout: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
|
|
1256
|
+
getSession: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSessionResponse>>;
|
|
1257
|
+
listSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSession[]>>;
|
|
1258
|
+
revokeSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1259
|
+
clearSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1260
|
+
revokeSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1261
|
+
clearSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1262
|
+
revokeOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1263
|
+
clearOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1264
|
+
forgetPassword: (input: AthenaForgetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1265
|
+
resetPassword: (input: AthenaResetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1266
|
+
resolveResetPasswordToken: (input: {
|
|
1267
|
+
token: string;
|
|
1268
|
+
callbackURL?: string;
|
|
1269
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
1270
|
+
token?: string;
|
|
1271
|
+
}>>;
|
|
1272
|
+
verifyEmail: (input: AthenaVerifyEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
1273
|
+
user: AthenaAuthUser;
|
|
1274
|
+
status: boolean;
|
|
1275
|
+
}>>;
|
|
1276
|
+
sendVerificationEmail: (input: AthenaSendVerificationEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1277
|
+
changeEmail: (input: AthenaChangeEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailChangeResponse>>;
|
|
1278
|
+
changePassword: (input: AthenaChangePasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
1279
|
+
token?: string | null;
|
|
1280
|
+
user: AthenaAuthUser;
|
|
1281
|
+
}>>;
|
|
1282
|
+
updateUser: (input: AthenaUpdateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1283
|
+
deleteUser: (input?: AthenaDeleteUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
|
|
1284
|
+
deleteUserCallback: (input?: AthenaDeleteUserCallbackRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
|
|
1285
|
+
linkSocial: (input: AthenaLinkSocialRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse>>;
|
|
1286
|
+
listAccounts: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLinkedAccount[]>>;
|
|
1287
|
+
unlinkAccount: (input: AthenaUnlinkAccountRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
1288
|
+
refreshToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
|
|
1289
|
+
getAccessToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
|
|
1290
|
+
organization: AthenaAuthOrganizationBindings;
|
|
1291
|
+
auth: AthenaAuthBindings;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
type AthenaErrorKind = 'unique_violation' | 'not_found' | 'validation' | 'auth' | 'rate_limit' | 'transient' | 'unknown';
|
|
1295
|
+
declare const AthenaErrorKind: {
|
|
1296
|
+
readonly UniqueViolation: "unique_violation";
|
|
1297
|
+
readonly NotFound: "not_found";
|
|
1298
|
+
readonly Validation: "validation";
|
|
1299
|
+
readonly Auth: "auth";
|
|
1300
|
+
readonly RateLimit: "rate_limit";
|
|
1301
|
+
readonly Transient: "transient";
|
|
1302
|
+
readonly Unknown: "unknown";
|
|
1303
|
+
};
|
|
1304
|
+
type AthenaErrorCode = 'UNIQUE_VIOLATION' | 'NOT_FOUND' | 'VALIDATION_FAILED' | 'AUTH_UNAUTHORIZED' | 'AUTH_FORBIDDEN' | 'RATE_LIMITED' | 'NETWORK_UNAVAILABLE' | 'TRANSIENT_FAILURE' | 'HTTP_FAILURE' | 'UNKNOWN';
|
|
1305
|
+
declare const AthenaErrorCode: {
|
|
1306
|
+
readonly UniqueViolation: "UNIQUE_VIOLATION";
|
|
1307
|
+
readonly NotFound: "NOT_FOUND";
|
|
1308
|
+
readonly ValidationFailed: "VALIDATION_FAILED";
|
|
1309
|
+
readonly AuthUnauthorized: "AUTH_UNAUTHORIZED";
|
|
1310
|
+
readonly AuthForbidden: "AUTH_FORBIDDEN";
|
|
1311
|
+
readonly RateLimited: "RATE_LIMITED";
|
|
1312
|
+
readonly NetworkUnavailable: "NETWORK_UNAVAILABLE";
|
|
1313
|
+
readonly TransientFailure: "TRANSIENT_FAILURE";
|
|
1314
|
+
readonly HttpFailure: "HTTP_FAILURE";
|
|
1315
|
+
readonly Unknown: "UNKNOWN";
|
|
1316
|
+
};
|
|
1317
|
+
type AthenaErrorCategory = 'transport' | 'client' | 'server' | 'database' | 'unknown';
|
|
1318
|
+
declare const AthenaErrorCategory: {
|
|
1319
|
+
readonly Transport: "transport";
|
|
1320
|
+
readonly Client: "client";
|
|
1321
|
+
readonly Server: "server";
|
|
1322
|
+
readonly Database: "database";
|
|
1323
|
+
readonly Unknown: "unknown";
|
|
1324
|
+
};
|
|
1325
|
+
interface AthenaOperationContext {
|
|
1326
|
+
table?: string;
|
|
1327
|
+
operation?: string;
|
|
1328
|
+
identity?: string | Record<string, unknown>;
|
|
1329
|
+
}
|
|
1330
|
+
interface NormalizedAthenaError {
|
|
1331
|
+
kind: AthenaErrorKind;
|
|
1332
|
+
code: AthenaErrorCode;
|
|
1333
|
+
category: AthenaErrorCategory;
|
|
1334
|
+
retryable: boolean;
|
|
1335
|
+
status?: number;
|
|
1336
|
+
constraint?: string;
|
|
1337
|
+
table?: string;
|
|
1338
|
+
operation?: string;
|
|
1339
|
+
message: string;
|
|
1340
|
+
raw: unknown;
|
|
1341
|
+
}
|
|
1342
|
+
interface AthenaErrorInput {
|
|
1343
|
+
code: AthenaErrorCode;
|
|
1344
|
+
kind: AthenaErrorKind;
|
|
1345
|
+
category: AthenaErrorCategory;
|
|
1346
|
+
message: string;
|
|
1347
|
+
status?: number;
|
|
1348
|
+
retryable?: boolean;
|
|
1349
|
+
requestId?: string;
|
|
1350
|
+
context?: AthenaOperationContext;
|
|
1351
|
+
raw?: unknown;
|
|
1352
|
+
}
|
|
1353
|
+
interface UnwrapOptions {
|
|
1354
|
+
allowNull?: boolean;
|
|
1355
|
+
context?: AthenaOperationContext;
|
|
1356
|
+
}
|
|
1357
|
+
interface UnwrapOneOptions extends UnwrapOptions {
|
|
1358
|
+
requireExactlyOne?: boolean;
|
|
1359
|
+
}
|
|
1360
|
+
interface IntCoercionOptions {
|
|
1361
|
+
strictBigInt?: boolean;
|
|
1362
|
+
min?: number;
|
|
1363
|
+
max?: number;
|
|
1364
|
+
}
|
|
1365
|
+
type RetryBackoffStrategy = 'linear' | 'exponential' | ((attempt: number, error: unknown) => number);
|
|
1366
|
+
interface RetryConfig {
|
|
1367
|
+
retries: number;
|
|
1368
|
+
baseDelayMs?: number;
|
|
1369
|
+
maxDelayMs?: number;
|
|
1370
|
+
backoff?: RetryBackoffStrategy;
|
|
1371
|
+
jitter?: boolean | number;
|
|
1372
|
+
shouldRetry?: (error: unknown, attempt: number) => boolean | Promise<boolean>;
|
|
1373
|
+
}
|
|
1374
|
+
interface RequireAffectedOptions {
|
|
1375
|
+
min?: number;
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Parses a string-based boolean flag with a deterministic fallback.
|
|
1379
|
+
*
|
|
1380
|
+
* Accepts common truthy/falsey token variants used by env vars and CLI flags.
|
|
1381
|
+
*/
|
|
1382
|
+
declare function parseBooleanFlag(rawValue: string | undefined, fallback: boolean): boolean;
|
|
1383
|
+
declare class AthenaError extends Error {
|
|
1384
|
+
readonly code: AthenaErrorCode;
|
|
1385
|
+
readonly kind: AthenaErrorKind;
|
|
1386
|
+
readonly category: AthenaErrorCategory;
|
|
1387
|
+
readonly status?: number;
|
|
1388
|
+
readonly retryable: boolean;
|
|
1389
|
+
readonly requestId?: string;
|
|
1390
|
+
readonly context?: AthenaOperationContext;
|
|
1391
|
+
readonly raw?: unknown;
|
|
1392
|
+
constructor(input: AthenaErrorInput);
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Returns `true` when a result is successful (`2xx` status and no `error`).
|
|
1396
|
+
*/
|
|
1397
|
+
declare function isOk<T>(result: AthenaResult<T>): boolean;
|
|
1398
|
+
/**
|
|
1399
|
+
* Normalizes any Athena failure shape into a stable, typed error envelope.
|
|
1400
|
+
*
|
|
1401
|
+
* Accepts `AthenaResult`, `AthenaGatewayError`, native `Error`, or unknown values.
|
|
1402
|
+
* Optional `context` can override inferred table/operation metadata for clearer diagnostics.
|
|
1403
|
+
*/
|
|
1404
|
+
declare function normalizeAthenaError(resultOrError: unknown, context?: AthenaOperationContext): NormalizedAthenaError;
|
|
1405
|
+
/**
|
|
1406
|
+
* Unwraps a successful result into a row array.
|
|
1407
|
+
*
|
|
1408
|
+
* - Throws on failed results.
|
|
1409
|
+
* - Converts `null` data to an empty array.
|
|
1410
|
+
* - Wraps scalar data in a single-element array.
|
|
1411
|
+
*/
|
|
1412
|
+
declare function unwrapRows<T>(result: AthenaResult<T[] | T | null>, options?: UnwrapOptions): T[];
|
|
1413
|
+
/**
|
|
1414
|
+
* Unwraps successful result data from `AthenaResult<T | null>`.
|
|
1415
|
+
*
|
|
1416
|
+
* By default, `null` data throws. Pass `{ allowNull: true }` to permit nullable payloads.
|
|
1417
|
+
*/
|
|
1418
|
+
declare function unwrap<T>(result: AthenaResult<T | null>, options: UnwrapOptions & {
|
|
1419
|
+
allowNull: true;
|
|
1420
|
+
}): T | null;
|
|
1421
|
+
declare function unwrap<T>(result: AthenaResult<T | null>, options?: UnwrapOptions): T;
|
|
1422
|
+
/**
|
|
1423
|
+
* Unwraps the first row from a successful result that may contain arrays/scalars/null.
|
|
1424
|
+
*
|
|
1425
|
+
* - Throws on failed results.
|
|
1426
|
+
* - Throws when no row exists unless `allowNull: true` is provided.
|
|
1427
|
+
* - Optionally enforces exact cardinality via `requireExactlyOne`.
|
|
1428
|
+
*/
|
|
1429
|
+
declare function unwrapOne<T>(result: AthenaResult<T[] | T | null>, options: UnwrapOneOptions & {
|
|
1430
|
+
allowNull: true;
|
|
1431
|
+
}): T | null;
|
|
1432
|
+
declare function unwrapOne<T>(result: AthenaResult<T[] | T | null>, options?: UnwrapOneOptions): T;
|
|
1433
|
+
/**
|
|
1434
|
+
* Asserts that an Athena result is successful.
|
|
1435
|
+
*
|
|
1436
|
+
* Returns the original result for fluent composition and throws `AthenaGatewayError` on failure.
|
|
1437
|
+
*/
|
|
1438
|
+
declare function requireSuccess<T>(result: AthenaResult<T>, context?: AthenaOperationContext): AthenaResult<T>;
|
|
1439
|
+
/**
|
|
1440
|
+
* Enforces mutation postconditions based on `result.count`.
|
|
1441
|
+
*
|
|
1442
|
+
* - Validates success first.
|
|
1443
|
+
* - Requires a non-null count in the response.
|
|
1444
|
+
* - Validates `count >= min` (default: `1`).
|
|
1445
|
+
*
|
|
1446
|
+
* Useful for guaranteeing that critical writes actually affected rows.
|
|
1447
|
+
*/
|
|
1448
|
+
declare function requireAffected<T>(result: AthenaResult<T>, options?: RequireAffectedOptions, context?: AthenaOperationContext): number;
|
|
1449
|
+
/**
|
|
1450
|
+
* Safely coerces `unknown` values into finite integers.
|
|
1451
|
+
*
|
|
1452
|
+
* Returns `null` when coercion fails or bounds/strict bigint checks are violated.
|
|
1453
|
+
*/
|
|
1454
|
+
declare function coerceInt(value: unknown, options?: IntCoercionOptions): number | null;
|
|
1455
|
+
/**
|
|
1456
|
+
* Strict integer assertion wrapper around `coerceInt`.
|
|
1457
|
+
*
|
|
1458
|
+
* Throws a `TypeError` with the provided label when coercion fails.
|
|
1459
|
+
*/
|
|
1460
|
+
declare function assertInt(value: unknown, label?: string, options?: IntCoercionOptions): number;
|
|
1461
|
+
/**
|
|
1462
|
+
* Retries an async operation with configurable backoff and retry policy.
|
|
1463
|
+
*
|
|
1464
|
+
* `retries` represents additional attempts after the first failure.
|
|
1465
|
+
* By default, transient and rate-limit errors are retried.
|
|
1466
|
+
*/
|
|
1467
|
+
declare function withRetry<T>(config: RetryConfig, fn: () => Promise<T>): Promise<T>;
|
|
1468
|
+
|
|
1469
|
+
type AthenaRowShape$2 = Record<string, AthenaJsonValue | undefined>;
|
|
1470
|
+
type AthenaUpsertOptions<Update> = AthenaGatewayCallOptions & {
|
|
1471
|
+
updateBody?: Update;
|
|
1472
|
+
onConflict?: string | string[];
|
|
1473
|
+
};
|
|
1474
|
+
interface AthenaDbModule {
|
|
1475
|
+
from<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update>;
|
|
1476
|
+
select<Row = AthenaRowShape$2, SelectedRow = Row>(table: string, columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, SelectedRow>;
|
|
1477
|
+
insert<Row = AthenaRowShape$2, Insert = Partial<Row>>(table: string, values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
1478
|
+
insert<Row = AthenaRowShape$2, Insert = Partial<Row>>(table: string, values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
1479
|
+
upsert<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert, options?: AthenaUpsertOptions<Update>): MutationQuery<Row>;
|
|
1480
|
+
upsert<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert[], options?: AthenaUpsertOptions<Update>): MutationQuery<Row[]>;
|
|
1481
|
+
update<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
1482
|
+
delete<Row = AthenaRowShape$2>(table: string, options?: AthenaGatewayCallOptions & {
|
|
1483
|
+
resourceId?: string;
|
|
1484
|
+
}): MutationQuery<Row | null>;
|
|
1485
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
1486
|
+
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
type AthenaStorageTemplateValue = string | number | boolean | null | undefined;
|
|
1490
|
+
type AthenaStorageTemplateVars = Record<string, AthenaStorageTemplateValue>;
|
|
1491
|
+
type AthenaStorageEnv = Record<string, string | undefined>;
|
|
1492
|
+
type AthenaStorageUploadHeaders = ConstructorParameters<typeof Headers>[0];
|
|
1493
|
+
type AthenaStoragePrefixPath = string | ((context: AthenaStoragePathContext) => string | null | undefined);
|
|
1494
|
+
interface AthenaStoragePathContext {
|
|
1495
|
+
vars: AthenaStorageTemplateVars;
|
|
1496
|
+
env: AthenaStorageEnv;
|
|
1497
|
+
organizationId?: string;
|
|
1498
|
+
organization_id?: string;
|
|
1499
|
+
userId?: string;
|
|
1500
|
+
user_id?: string;
|
|
1501
|
+
resourceId?: string;
|
|
1502
|
+
resource_id?: string;
|
|
1503
|
+
}
|
|
1504
|
+
interface AthenaStorageFileConfig {
|
|
1505
|
+
/**
|
|
1506
|
+
* Prefix applied by high-level file helpers before storage keys are sent to Athena.
|
|
1507
|
+
* Supports tokens such as `{organization_id}`, `{organizationId}`, `{env.NODE_ENV}`,
|
|
1508
|
+
* and `${ATHENA_STORAGE_PREFIX}`.
|
|
1509
|
+
*/
|
|
1510
|
+
prefixPath?: AthenaStoragePrefixPath;
|
|
1511
|
+
vars?: AthenaStorageTemplateVars;
|
|
1512
|
+
env?: AthenaStorageEnv;
|
|
1513
|
+
}
|
|
1514
|
+
type AthenaStorageUploadSource = Blob | ArrayBuffer | Uint8Array;
|
|
1515
|
+
interface AthenaStorageUploadConstraints {
|
|
1516
|
+
maxFiles?: number;
|
|
1517
|
+
allowedExtensions?: readonly string[];
|
|
1518
|
+
extensions?: readonly string[];
|
|
1519
|
+
maxFileSizeMb?: number;
|
|
1520
|
+
maxFileSizeBytes?: number;
|
|
1521
|
+
}
|
|
1522
|
+
interface AthenaStorageUploadProgress {
|
|
1523
|
+
phase: 'preparing' | 'uploading' | 'complete';
|
|
1524
|
+
fileIndex: number;
|
|
1525
|
+
fileCount: number;
|
|
1526
|
+
fileName: string;
|
|
1527
|
+
loaded: number;
|
|
1528
|
+
total: number;
|
|
1529
|
+
percent: number;
|
|
1530
|
+
aggregateLoaded: number;
|
|
1531
|
+
aggregateTotal: number;
|
|
1532
|
+
aggregatePercent: number;
|
|
1533
|
+
}
|
|
1534
|
+
type AthenaStorageUploadProgressHandler = (progress: AthenaStorageUploadProgress) => void;
|
|
1535
|
+
interface AthenaStorageFileUploadInput extends AthenaStorageUploadConstraints {
|
|
1536
|
+
s3_id: string;
|
|
1537
|
+
bucket?: string;
|
|
1538
|
+
files: AthenaStorageUploadSource | ArrayLike<AthenaStorageUploadSource> | readonly AthenaStorageUploadSource[];
|
|
1539
|
+
storage_key?: string;
|
|
1540
|
+
storageKey?: string;
|
|
1541
|
+
storageKeyTemplate?: string;
|
|
1542
|
+
prefixPath?: AthenaStoragePrefixPath;
|
|
1543
|
+
fileName?: string;
|
|
1544
|
+
name?: string;
|
|
1545
|
+
original_name?: string;
|
|
1546
|
+
resource_id?: string;
|
|
1547
|
+
resourceId?: string;
|
|
1548
|
+
organization_id?: string;
|
|
1549
|
+
organizationId?: string;
|
|
1550
|
+
user_id?: string;
|
|
1551
|
+
userId?: string;
|
|
1552
|
+
mime_type?: string;
|
|
1553
|
+
content_type?: string;
|
|
1554
|
+
public?: boolean;
|
|
1555
|
+
metadata?: Record<string, unknown>;
|
|
1556
|
+
vars?: AthenaStorageTemplateVars;
|
|
1557
|
+
env?: AthenaStorageEnv;
|
|
1558
|
+
uploadHeaders?: AthenaStorageUploadHeaders;
|
|
1559
|
+
onProgress?: AthenaStorageUploadProgressHandler;
|
|
1560
|
+
}
|
|
1561
|
+
interface AthenaStorageUploadedFile {
|
|
1562
|
+
file: ManagedFileRecord;
|
|
1563
|
+
upload: StorageUploadUrlResponse['upload'];
|
|
1564
|
+
source: AthenaStorageUploadSource;
|
|
1565
|
+
fileName: string;
|
|
1566
|
+
storage_key: string;
|
|
1567
|
+
response: Response;
|
|
1568
|
+
}
|
|
1569
|
+
interface AthenaStorageFileUploadResult {
|
|
1570
|
+
files: AthenaStorageUploadedFile[];
|
|
1571
|
+
count: number;
|
|
1572
|
+
}
|
|
1573
|
+
interface AthenaStorageFileListInput extends Omit<ListStorageFilesRequest, 'prefix'> {
|
|
1574
|
+
prefix?: string;
|
|
1575
|
+
prefixPath?: AthenaStoragePrefixPath;
|
|
1576
|
+
vars?: AthenaStorageTemplateVars;
|
|
1577
|
+
env?: AthenaStorageEnv;
|
|
1578
|
+
organization_id?: string;
|
|
1579
|
+
organizationId?: string;
|
|
1580
|
+
user_id?: string;
|
|
1581
|
+
userId?: string;
|
|
1582
|
+
resource_id?: string;
|
|
1583
|
+
resourceId?: string;
|
|
1584
|
+
}
|
|
1585
|
+
interface AthenaStorageFileDownloadInput extends GetStorageFileUrlQuery {
|
|
1586
|
+
fileId?: string;
|
|
1587
|
+
fileIds?: readonly string[];
|
|
1588
|
+
}
|
|
1589
|
+
type AthenaStorageFileDeleteInput = string | readonly string[];
|
|
1590
|
+
interface AthenaStorageFileModule {
|
|
1591
|
+
upload(input: AthenaStorageFileUploadInput, options?: AthenaStorageCallOptions): Promise<AthenaStorageFileUploadResult>;
|
|
1592
|
+
download(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response>;
|
|
1593
|
+
download(fileIds: readonly string[], query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response[]>;
|
|
1594
|
+
download(input: AthenaStorageFileDownloadInput, options?: AthenaStorageBinaryCallOptions): Promise<Response | Response[]>;
|
|
1595
|
+
list(input: AthenaStorageFileListInput, options?: AthenaStorageCallOptions): Promise<StorageListFilesResponse>;
|
|
1596
|
+
delete(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
1597
|
+
delete(fileIds: readonly string[], options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse[]>;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
declare const storageSdkManifest: {
|
|
1601
|
+
readonly namespace: "storage";
|
|
1602
|
+
readonly basePath: "/storage";
|
|
1603
|
+
readonly envelopeKinds: {
|
|
1604
|
+
readonly raw: "response body is the payload";
|
|
1605
|
+
readonly athena: "response body is { status, message, data }";
|
|
1606
|
+
};
|
|
1607
|
+
readonly methods: readonly [{
|
|
1608
|
+
readonly name: "listStorageCatalogs";
|
|
1609
|
+
readonly method: "GET";
|
|
1610
|
+
readonly path: "/storage/catalogs";
|
|
1611
|
+
readonly responseEnvelope: "raw";
|
|
1612
|
+
readonly responseType: "{ data: S3CatalogItem[] }";
|
|
1613
|
+
}, {
|
|
1614
|
+
readonly name: "createStorageCatalog";
|
|
1615
|
+
readonly method: "POST";
|
|
1616
|
+
readonly path: "/storage/catalogs";
|
|
1617
|
+
readonly requestType: "CreateStorageCatalogRequest";
|
|
1618
|
+
readonly responseEnvelope: "raw";
|
|
1619
|
+
readonly responseType: "S3CatalogItem";
|
|
1620
|
+
}, {
|
|
1621
|
+
readonly name: "updateStorageCatalog";
|
|
1622
|
+
readonly method: "PATCH";
|
|
1623
|
+
readonly path: "/storage/catalogs/{id}";
|
|
1624
|
+
readonly pathParams: readonly ["id"];
|
|
1625
|
+
readonly requestType: "UpdateStorageCatalogRequest";
|
|
1626
|
+
readonly responseEnvelope: "raw";
|
|
1627
|
+
readonly responseType: "S3CatalogItem";
|
|
1628
|
+
}, {
|
|
1629
|
+
readonly name: "deleteStorageCatalog";
|
|
1630
|
+
readonly method: "DELETE";
|
|
1631
|
+
readonly path: "/storage/catalogs/{id}";
|
|
1632
|
+
readonly pathParams: readonly ["id"];
|
|
1633
|
+
readonly responseEnvelope: "raw";
|
|
1634
|
+
readonly responseType: "{ id: string; deleted: boolean }";
|
|
1635
|
+
}, {
|
|
1636
|
+
readonly name: "listStorageCredentials";
|
|
1637
|
+
readonly method: "GET";
|
|
1638
|
+
readonly path: "/storage/credentials";
|
|
1639
|
+
readonly responseEnvelope: "raw";
|
|
1640
|
+
readonly responseType: "{ data: S3CredentialListItem[] }";
|
|
1641
|
+
}, {
|
|
1642
|
+
readonly name: "createStorageUploadUrl";
|
|
1643
|
+
readonly method: "POST";
|
|
1644
|
+
readonly path: "/storage/files/upload-url";
|
|
1645
|
+
readonly requestType: "CreateStorageUploadUrlRequest";
|
|
1646
|
+
readonly responseEnvelope: "athena";
|
|
1647
|
+
readonly responseType: "StorageUploadUrlResponse";
|
|
1648
|
+
}, {
|
|
1649
|
+
readonly name: "createStorageUploadUrls";
|
|
1650
|
+
readonly method: "POST";
|
|
1651
|
+
readonly path: "/storage/files/upload-urls";
|
|
1652
|
+
readonly requestType: "CreateStorageUploadUrlsRequest";
|
|
1653
|
+
readonly responseEnvelope: "athena";
|
|
1654
|
+
readonly responseType: "StorageBatchUploadUrlResponse";
|
|
1655
|
+
}, {
|
|
1656
|
+
readonly name: "listStorageFiles";
|
|
1657
|
+
readonly method: "POST";
|
|
1658
|
+
readonly path: "/storage/files/list";
|
|
1659
|
+
readonly requestType: "ListStorageFilesRequest";
|
|
1660
|
+
readonly responseEnvelope: "athena";
|
|
1661
|
+
readonly responseType: "StorageListFilesResponse";
|
|
1662
|
+
}, {
|
|
1663
|
+
readonly name: "getStorageFile";
|
|
1664
|
+
readonly method: "GET";
|
|
1665
|
+
readonly path: "/storage/files/{file_id}";
|
|
1666
|
+
readonly pathParams: readonly ["file_id"];
|
|
1667
|
+
readonly responseEnvelope: "athena";
|
|
1668
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1669
|
+
}, {
|
|
1670
|
+
readonly name: "getStorageFileUrl";
|
|
1671
|
+
readonly method: "GET";
|
|
1672
|
+
readonly path: "/storage/files/{file_id}/url";
|
|
1673
|
+
readonly pathParams: readonly ["file_id"];
|
|
1674
|
+
readonly queryParams: readonly ["purpose"];
|
|
1675
|
+
readonly responseEnvelope: "athena";
|
|
1676
|
+
readonly responseType: "PresignedFileUrlResponse";
|
|
1677
|
+
}, {
|
|
1678
|
+
readonly name: "getStorageFileProxy";
|
|
1679
|
+
readonly method: "GET";
|
|
1680
|
+
readonly path: "/storage/files/{file_id}/proxy";
|
|
1681
|
+
readonly pathParams: readonly ["file_id"];
|
|
1682
|
+
readonly queryParams: readonly ["purpose"];
|
|
1683
|
+
readonly responseEnvelope: "raw";
|
|
1684
|
+
readonly responseType: "Response";
|
|
1685
|
+
readonly binary: true;
|
|
1686
|
+
}, {
|
|
1687
|
+
readonly name: "updateStorageFile";
|
|
1688
|
+
readonly method: "PATCH";
|
|
1689
|
+
readonly path: "/storage/files/{file_id}";
|
|
1690
|
+
readonly pathParams: readonly ["file_id"];
|
|
1691
|
+
readonly requestType: "UpdateStorageFileRequest";
|
|
1692
|
+
readonly responseEnvelope: "athena";
|
|
1693
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1694
|
+
}, {
|
|
1695
|
+
readonly name: "deleteStorageFile";
|
|
1696
|
+
readonly method: "DELETE";
|
|
1697
|
+
readonly path: "/storage/files/{file_id}";
|
|
1698
|
+
readonly pathParams: readonly ["file_id"];
|
|
1699
|
+
readonly responseEnvelope: "athena";
|
|
1700
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1701
|
+
}, {
|
|
1702
|
+
readonly name: "setStorageFileVisibility";
|
|
1703
|
+
readonly method: "PATCH";
|
|
1704
|
+
readonly path: "/storage/files/{file_id}/visibility";
|
|
1705
|
+
readonly pathParams: readonly ["file_id"];
|
|
1706
|
+
readonly requestType: "SetStorageFileVisibilityRequest";
|
|
1707
|
+
readonly responseEnvelope: "athena";
|
|
1708
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1709
|
+
}, {
|
|
1710
|
+
readonly name: "deleteStorageFolder";
|
|
1711
|
+
readonly method: "POST";
|
|
1712
|
+
readonly path: "/storage/folders/delete";
|
|
1713
|
+
readonly requestType: "DeleteStorageFolderRequest";
|
|
1714
|
+
readonly responseEnvelope: "athena";
|
|
1715
|
+
readonly responseType: "StorageFolderMutationResponse";
|
|
1716
|
+
}, {
|
|
1717
|
+
readonly name: "moveStorageFolder";
|
|
1718
|
+
readonly method: "POST";
|
|
1719
|
+
readonly path: "/storage/folders/move";
|
|
1720
|
+
readonly requestType: "MoveStorageFolderRequest";
|
|
1721
|
+
readonly responseEnvelope: "athena";
|
|
1722
|
+
readonly responseType: "StorageFolderMutationResponse";
|
|
1723
|
+
}];
|
|
1724
|
+
};
|
|
1725
|
+
interface S3CatalogItem {
|
|
1726
|
+
id: string;
|
|
1727
|
+
name: string;
|
|
1728
|
+
endpoint?: string | null;
|
|
1729
|
+
region?: string | null;
|
|
1730
|
+
bucket: string;
|
|
1731
|
+
provider: string;
|
|
1732
|
+
force_path_style: boolean;
|
|
1733
|
+
default_prefix?: string | null;
|
|
1734
|
+
public_base_url?: string | null;
|
|
1735
|
+
is_active: boolean;
|
|
1736
|
+
metadata: Record<string, unknown>;
|
|
1737
|
+
created_at: string;
|
|
1738
|
+
updated_at: string;
|
|
1739
|
+
}
|
|
1740
|
+
interface S3CredentialListItem {
|
|
1741
|
+
id: string;
|
|
1742
|
+
s3_id: string;
|
|
1743
|
+
name: string;
|
|
1744
|
+
endpoint?: string | null;
|
|
1745
|
+
region?: string | null;
|
|
1746
|
+
bucket: string;
|
|
1747
|
+
provider: string;
|
|
1748
|
+
access_key: string;
|
|
1749
|
+
is_active: boolean;
|
|
1750
|
+
created_at: string;
|
|
1751
|
+
rotated_at?: string | null;
|
|
1752
|
+
}
|
|
1753
|
+
interface ManagedFileRecord {
|
|
1754
|
+
id: string;
|
|
1755
|
+
name: string;
|
|
1756
|
+
original_name?: string | null;
|
|
1757
|
+
file_name?: string | null;
|
|
1758
|
+
url?: string | null;
|
|
1759
|
+
bucket: string;
|
|
1760
|
+
s3_id?: string | null;
|
|
1761
|
+
prefix_path?: string | null;
|
|
1762
|
+
size_bytes?: number | null;
|
|
1763
|
+
mime_type?: string | null;
|
|
1764
|
+
content_type?: string | null;
|
|
1765
|
+
resource_id?: string | null;
|
|
1766
|
+
organization_id?: string | null;
|
|
1767
|
+
created_by_user_id?: string | null;
|
|
1768
|
+
uploaded_by_user_id?: string | null;
|
|
1769
|
+
checksum_sha256?: string | null;
|
|
1770
|
+
metadata: Record<string, unknown>;
|
|
1771
|
+
created_at: string;
|
|
1772
|
+
updated_at: string;
|
|
1773
|
+
storage_key: string;
|
|
1774
|
+
extension?: string | null;
|
|
1775
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1776
|
+
is_public: boolean;
|
|
1777
|
+
status: string;
|
|
1778
|
+
deleted_at?: string | null;
|
|
1779
|
+
}
|
|
1780
|
+
interface PresignedFileUrlResponse {
|
|
1781
|
+
file_id: string;
|
|
1782
|
+
bucket: string;
|
|
1783
|
+
storage_key: string;
|
|
1784
|
+
purpose: string;
|
|
1785
|
+
url: string;
|
|
1786
|
+
expires_at: string;
|
|
1787
|
+
expires_at_epoch_seconds: number;
|
|
1788
|
+
expires_in: number;
|
|
1789
|
+
cache_hit: boolean;
|
|
1790
|
+
cache_layer: string;
|
|
1791
|
+
}
|
|
1792
|
+
interface CreateStorageCatalogRequest {
|
|
1793
|
+
name: string;
|
|
1794
|
+
endpoint: string;
|
|
1795
|
+
region: string;
|
|
1796
|
+
bucket: string;
|
|
1797
|
+
provider?: string;
|
|
1798
|
+
force_path_style?: boolean;
|
|
1799
|
+
default_prefix?: string;
|
|
1800
|
+
public_base_url?: string;
|
|
1801
|
+
access_key_id: string;
|
|
1802
|
+
secret_key: string;
|
|
1803
|
+
session_token?: string;
|
|
1804
|
+
metadata?: Record<string, unknown>;
|
|
1805
|
+
}
|
|
1806
|
+
interface UpdateStorageCatalogRequest {
|
|
1807
|
+
name?: string;
|
|
1808
|
+
endpoint?: string;
|
|
1809
|
+
region?: string;
|
|
1810
|
+
bucket?: string;
|
|
1811
|
+
provider?: string;
|
|
1812
|
+
force_path_style?: boolean;
|
|
1813
|
+
default_prefix?: string | null;
|
|
1814
|
+
public_base_url?: string | null;
|
|
1815
|
+
access_key_id?: string;
|
|
1816
|
+
secret_key?: string;
|
|
1817
|
+
session_token?: string;
|
|
1818
|
+
is_active?: boolean;
|
|
1819
|
+
metadata?: Record<string, unknown>;
|
|
1820
|
+
}
|
|
1821
|
+
interface CreateStorageUploadUrlRequest {
|
|
1822
|
+
s3_id: string;
|
|
1823
|
+
bucket?: string;
|
|
1824
|
+
storage_key: string;
|
|
1825
|
+
name?: string;
|
|
1826
|
+
original_name?: string;
|
|
1827
|
+
resource_id?: string;
|
|
1828
|
+
mime_type?: string;
|
|
1829
|
+
content_type?: string;
|
|
1830
|
+
size_bytes?: number;
|
|
1831
|
+
file_id?: string;
|
|
1832
|
+
public?: boolean;
|
|
1833
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1834
|
+
metadata?: Record<string, unknown>;
|
|
1835
|
+
}
|
|
1836
|
+
interface CreateStorageUploadUrlsRequest {
|
|
1837
|
+
files: CreateStorageUploadUrlRequest[];
|
|
1838
|
+
}
|
|
1839
|
+
interface StorageUploadUrlResponse {
|
|
1840
|
+
file: ManagedFileRecord;
|
|
1841
|
+
upload: PresignedFileUrlResponse;
|
|
1842
|
+
}
|
|
1843
|
+
interface StorageBatchUploadUrlResponse {
|
|
1844
|
+
files: StorageUploadUrlResponse[];
|
|
1845
|
+
}
|
|
1846
|
+
interface ListStorageFilesRequest {
|
|
1847
|
+
s3_id: string;
|
|
1848
|
+
prefix: string;
|
|
1849
|
+
}
|
|
1850
|
+
interface StorageListFilesResponse {
|
|
1851
|
+
files: ManagedFileRecord[];
|
|
1852
|
+
count: number;
|
|
1853
|
+
}
|
|
1854
|
+
interface UpdateStorageFileRequest {
|
|
1855
|
+
storage_key: string;
|
|
1856
|
+
bucket?: string;
|
|
1857
|
+
}
|
|
1858
|
+
interface SetStorageFileVisibilityRequest {
|
|
1859
|
+
public?: boolean;
|
|
1860
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1861
|
+
}
|
|
1862
|
+
interface DeleteStorageFolderRequest {
|
|
1863
|
+
s3_id: string;
|
|
1864
|
+
prefix: string;
|
|
1865
|
+
}
|
|
1866
|
+
interface MoveStorageFolderRequest {
|
|
1867
|
+
s3_id: string;
|
|
1868
|
+
from_prefix: string;
|
|
1869
|
+
to_prefix: string;
|
|
1870
|
+
}
|
|
1871
|
+
interface StorageFileMutationResponse {
|
|
1872
|
+
file: ManagedFileRecord;
|
|
1873
|
+
}
|
|
1874
|
+
interface StorageFolderMutationResponse {
|
|
1875
|
+
s3_id: string;
|
|
1876
|
+
prefix: string;
|
|
1877
|
+
processed_files: number;
|
|
1878
|
+
}
|
|
1879
|
+
interface StorageFileMutationManyResponse {
|
|
1880
|
+
files: ManagedFileRecord[];
|
|
1881
|
+
count: number;
|
|
1882
|
+
}
|
|
1883
|
+
interface StorageFilePermissionRecord {
|
|
1884
|
+
id: string;
|
|
1885
|
+
file_id: string;
|
|
1886
|
+
principal_type: 'user' | 'organization' | 'team' | 'role';
|
|
1887
|
+
principal_id: string;
|
|
1888
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1889
|
+
granted_by_user_id?: string | null;
|
|
1890
|
+
created_at: string;
|
|
1891
|
+
expires_at?: string | null;
|
|
1892
|
+
revoked_at?: string | null;
|
|
1893
|
+
metadata: Record<string, unknown>;
|
|
1894
|
+
}
|
|
1895
|
+
interface StoragePermissionListResponse {
|
|
1896
|
+
permissions: StorageFilePermissionRecord[];
|
|
1897
|
+
count: number;
|
|
1898
|
+
}
|
|
1899
|
+
interface StoragePermissionCheckResponse {
|
|
1900
|
+
allowed: boolean;
|
|
1901
|
+
permission: string;
|
|
1902
|
+
}
|
|
1903
|
+
interface StorageAuditEventRecord {
|
|
1904
|
+
id: string;
|
|
1905
|
+
operation: string;
|
|
1906
|
+
file_id?: string | null;
|
|
1907
|
+
s3_id?: string | null;
|
|
1908
|
+
bucket?: string | null;
|
|
1909
|
+
storage_key?: string | null;
|
|
1910
|
+
actor_user_id?: string | null;
|
|
1911
|
+
organization_id?: string | null;
|
|
1912
|
+
status: 'success' | 'error';
|
|
1913
|
+
error?: string | null;
|
|
1914
|
+
metadata: Record<string, unknown>;
|
|
1915
|
+
created_at: string;
|
|
1916
|
+
}
|
|
1917
|
+
interface StorageAuditListResponse {
|
|
1918
|
+
events: StorageAuditEventRecord[];
|
|
1919
|
+
count: number;
|
|
1920
|
+
}
|
|
1921
|
+
interface ConfirmStorageUploadRequest {
|
|
1922
|
+
size_bytes?: number;
|
|
1923
|
+
content_type?: string;
|
|
1924
|
+
checksum_sha256?: string;
|
|
1925
|
+
metadata?: Record<string, unknown>;
|
|
1926
|
+
}
|
|
1927
|
+
interface SearchStorageFilesRequest {
|
|
1928
|
+
query?: string;
|
|
1929
|
+
limit?: number;
|
|
1930
|
+
}
|
|
1931
|
+
interface DeleteManyStorageFilesRequest {
|
|
1932
|
+
file_ids: string[];
|
|
1933
|
+
}
|
|
1934
|
+
interface UpdateManyStorageFilesRequest {
|
|
1935
|
+
file_ids: string[];
|
|
1936
|
+
storage_key: string;
|
|
1937
|
+
bucket?: string;
|
|
1938
|
+
}
|
|
1939
|
+
interface SetManyStorageFileVisibilityRequest {
|
|
1940
|
+
file_ids: string[];
|
|
1941
|
+
public?: boolean;
|
|
1942
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1943
|
+
}
|
|
1944
|
+
interface CopyStorageFileRequest {
|
|
1945
|
+
storage_key: string;
|
|
1946
|
+
bucket?: string;
|
|
1947
|
+
file_name?: string;
|
|
1948
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1949
|
+
metadata?: Record<string, unknown>;
|
|
1950
|
+
}
|
|
1951
|
+
interface ListStorageFoldersRequest {
|
|
1952
|
+
s3_id: string;
|
|
1953
|
+
prefix: string;
|
|
1954
|
+
}
|
|
1955
|
+
interface TreeStorageFoldersRequest {
|
|
1956
|
+
s3_id: string;
|
|
1957
|
+
prefix: string;
|
|
1958
|
+
}
|
|
1959
|
+
interface StoragePermissionListRequest {
|
|
1960
|
+
file_id: string;
|
|
1961
|
+
}
|
|
1962
|
+
interface StoragePermissionGrantRequest {
|
|
1963
|
+
file_id: string;
|
|
1964
|
+
principal_type: 'user' | 'organization' | 'team' | 'role';
|
|
1965
|
+
principal_id: string;
|
|
1966
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1967
|
+
expires_at?: string;
|
|
1968
|
+
metadata?: Record<string, unknown>;
|
|
1969
|
+
}
|
|
1970
|
+
interface StoragePermissionRevokeRequest {
|
|
1971
|
+
file_id: string;
|
|
1972
|
+
principal_type: 'user' | 'organization' | 'team' | 'role';
|
|
1973
|
+
principal_id: string;
|
|
1974
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1975
|
+
}
|
|
1976
|
+
interface StoragePermissionCheckRequest {
|
|
1977
|
+
file_id: string;
|
|
1978
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1979
|
+
}
|
|
1980
|
+
interface StorageMultipartCreateRequest {
|
|
1981
|
+
file_id: string;
|
|
1982
|
+
content_type?: string;
|
|
1983
|
+
}
|
|
1984
|
+
interface StorageMultipartSignPartRequest {
|
|
1985
|
+
file_id: string;
|
|
1986
|
+
upload_id: string;
|
|
1987
|
+
part_number: number;
|
|
1988
|
+
}
|
|
1989
|
+
interface StorageMultipartCompletePartInput {
|
|
1990
|
+
part_number: number;
|
|
1991
|
+
etag: string;
|
|
1992
|
+
}
|
|
1993
|
+
interface StorageMultipartCompleteRequest {
|
|
1994
|
+
file_id: string;
|
|
1995
|
+
upload_id: string;
|
|
1996
|
+
parts: StorageMultipartCompletePartInput[];
|
|
1997
|
+
}
|
|
1998
|
+
interface StorageMultipartAbortRequest {
|
|
1999
|
+
file_id: string;
|
|
2000
|
+
upload_id: string;
|
|
2001
|
+
}
|
|
2002
|
+
interface StorageMultipartListPartsRequest {
|
|
2003
|
+
file_id: string;
|
|
2004
|
+
upload_id: string;
|
|
2005
|
+
}
|
|
2006
|
+
interface StorageObjectFolderCreateRequest {
|
|
2007
|
+
endpoint: string;
|
|
2008
|
+
region: string;
|
|
2009
|
+
access_key_id: string;
|
|
2010
|
+
secret_key: string;
|
|
2011
|
+
bucket: string;
|
|
2012
|
+
prefix: string;
|
|
2013
|
+
}
|
|
2014
|
+
interface StorageObjectFolderDeleteRequest extends StorageObjectFolderCreateRequest {
|
|
2015
|
+
}
|
|
2016
|
+
interface StorageObjectFolderRenameRequest extends Omit<StorageObjectFolderCreateRequest, 'prefix'> {
|
|
2017
|
+
from_prefix: string;
|
|
2018
|
+
to_prefix: string;
|
|
2019
|
+
}
|
|
2020
|
+
interface StorageObjectBaseRequest {
|
|
2021
|
+
endpoint: string;
|
|
2022
|
+
region: string;
|
|
2023
|
+
access_key_id: string;
|
|
2024
|
+
secret_key: string;
|
|
2025
|
+
bucket: string;
|
|
2026
|
+
}
|
|
2027
|
+
interface StorageObjectRequest extends StorageObjectBaseRequest {
|
|
2028
|
+
key: string;
|
|
2029
|
+
}
|
|
2030
|
+
interface StorageObjectCopyRequest extends StorageObjectBaseRequest {
|
|
2031
|
+
source_key: string;
|
|
2032
|
+
destination_key: string;
|
|
2033
|
+
destination_bucket?: string;
|
|
2034
|
+
}
|
|
2035
|
+
interface StorageObjectPublicUrlRequest extends StorageObjectRequest {
|
|
2036
|
+
public_base_url?: string;
|
|
2037
|
+
force_path_style?: boolean;
|
|
2038
|
+
}
|
|
2039
|
+
interface StorageListObjectsRequest extends StorageObjectBaseRequest {
|
|
2040
|
+
prefix?: string;
|
|
2041
|
+
delimiter?: string;
|
|
2042
|
+
continuation_token?: string;
|
|
2043
|
+
max_keys?: number;
|
|
2044
|
+
}
|
|
2045
|
+
interface StorageUpdateObjectRequest extends StorageObjectRequest {
|
|
2046
|
+
acl?: string;
|
|
2047
|
+
content_type?: string;
|
|
2048
|
+
cache_control?: string;
|
|
2049
|
+
content_disposition?: string;
|
|
2050
|
+
content_encoding?: string;
|
|
2051
|
+
content_language?: string;
|
|
2052
|
+
metadata?: Record<string, string>;
|
|
2053
|
+
}
|
|
2054
|
+
interface StoragePresignUploadRequest extends StorageObjectRequest {
|
|
2055
|
+
content_type?: string;
|
|
2056
|
+
}
|
|
2057
|
+
interface StorageBucketCorsRequest extends StorageObjectBaseRequest {
|
|
2058
|
+
}
|
|
2059
|
+
interface StorageBucketCorsRuleInput {
|
|
2060
|
+
allowed_origins: string[];
|
|
2061
|
+
allowed_methods: string[];
|
|
2062
|
+
allowed_headers?: string[];
|
|
2063
|
+
expose_headers?: string[];
|
|
2064
|
+
max_age_seconds?: number;
|
|
2065
|
+
}
|
|
2066
|
+
interface StorageSetBucketCorsRequest extends StorageBucketCorsRequest {
|
|
2067
|
+
rules: StorageBucketCorsRuleInput[];
|
|
2068
|
+
}
|
|
2069
|
+
interface StorageAuditQueryRequest {
|
|
2070
|
+
file_id?: string;
|
|
2071
|
+
limit?: number;
|
|
2072
|
+
offset?: number;
|
|
2073
|
+
}
|
|
2074
|
+
interface AthenaEnvelope<T> {
|
|
2075
|
+
status: string;
|
|
2076
|
+
message: string;
|
|
2077
|
+
data: T;
|
|
2078
|
+
}
|
|
2079
|
+
type StorageFileAccessPurpose = 'read' | 'download' | 'stream';
|
|
2080
|
+
interface GetStorageFileUrlQuery {
|
|
2081
|
+
purpose?: StorageFileAccessPurpose | (string & {});
|
|
2082
|
+
}
|
|
2083
|
+
type AthenaStorageErrorHandler = (error: AthenaStorageError) => void | Promise<void>;
|
|
2084
|
+
interface AthenaStorageClientConfig extends AthenaStorageFileConfig {
|
|
2085
|
+
onError?: AthenaStorageErrorHandler;
|
|
2086
|
+
}
|
|
2087
|
+
interface AthenaStorageCallOptions extends AthenaGatewayCallOptions {
|
|
2088
|
+
signal?: AbortSignal;
|
|
2089
|
+
onError?: AthenaStorageErrorHandler;
|
|
2090
|
+
}
|
|
2091
|
+
type AthenaStorageBinaryCallOptions = AthenaStorageCallOptions;
|
|
2092
|
+
type AthenaStorageErrorCode = 'INVALID_URL' | 'NETWORK_ERROR' | 'HTTP_ERROR' | 'INVALID_JSON' | 'INVALID_ATHENA_ENVELOPE' | 'UNKNOWN_ERROR';
|
|
2093
|
+
declare const AthenaStorageErrorCode: {
|
|
2094
|
+
readonly InvalidUrl: "INVALID_URL";
|
|
2095
|
+
readonly NetworkError: "NETWORK_ERROR";
|
|
2096
|
+
readonly HttpError: "HTTP_ERROR";
|
|
2097
|
+
readonly InvalidJson: "INVALID_JSON";
|
|
2098
|
+
readonly InvalidAthenaEnvelope: "INVALID_ATHENA_ENVELOPE";
|
|
2099
|
+
readonly UnknownError: "UNKNOWN_ERROR";
|
|
2100
|
+
};
|
|
2101
|
+
interface AthenaStorageErrorDetails {
|
|
2102
|
+
code: AthenaStorageErrorCode;
|
|
2103
|
+
athenaCode: AthenaErrorCode;
|
|
2104
|
+
kind: AthenaErrorKind;
|
|
2105
|
+
category: AthenaErrorCategory;
|
|
2106
|
+
retryable: boolean;
|
|
2107
|
+
message: string;
|
|
2108
|
+
status: number;
|
|
2109
|
+
endpoint: AthenaGatewayEndpointPath;
|
|
2110
|
+
method: AthenaGatewayMethod;
|
|
2111
|
+
requestId?: string;
|
|
2112
|
+
hint?: string;
|
|
2113
|
+
cause?: string;
|
|
2114
|
+
raw: unknown;
|
|
2115
|
+
}
|
|
2116
|
+
interface AthenaStorageErrorInput {
|
|
2117
|
+
code: AthenaStorageErrorCode;
|
|
2118
|
+
message: string;
|
|
2119
|
+
status: number;
|
|
2120
|
+
endpoint: AthenaGatewayEndpointPath;
|
|
2121
|
+
method: AthenaGatewayMethod;
|
|
2122
|
+
raw?: unknown;
|
|
2123
|
+
requestId?: string;
|
|
2124
|
+
hint?: string;
|
|
2125
|
+
cause?: unknown;
|
|
2126
|
+
}
|
|
2127
|
+
declare class AthenaStorageError extends Error {
|
|
2128
|
+
readonly code: AthenaStorageErrorCode;
|
|
2129
|
+
readonly athenaCode: AthenaErrorCode;
|
|
2130
|
+
readonly kind: AthenaErrorKind;
|
|
2131
|
+
readonly category: AthenaErrorCategory;
|
|
2132
|
+
readonly retryable: boolean;
|
|
2133
|
+
readonly status: number;
|
|
2134
|
+
readonly endpoint: AthenaGatewayEndpointPath;
|
|
2135
|
+
readonly method: AthenaGatewayMethod;
|
|
2136
|
+
readonly requestId?: string;
|
|
2137
|
+
readonly hint?: string;
|
|
2138
|
+
readonly causeDetail?: string;
|
|
2139
|
+
readonly raw: unknown;
|
|
2140
|
+
readonly normalized: NormalizedAthenaError;
|
|
2141
|
+
readonly __athenaNormalizedError: NormalizedAthenaError;
|
|
2142
|
+
constructor(input: AthenaStorageErrorInput);
|
|
2143
|
+
toDetails(): AthenaStorageErrorDetails;
|
|
2144
|
+
}
|
|
2145
|
+
interface AthenaStorageBaseModule {
|
|
2146
|
+
listStorageCatalogs(options?: AthenaStorageCallOptions): Promise<{
|
|
2147
|
+
data: S3CatalogItem[];
|
|
2148
|
+
}>;
|
|
2149
|
+
createStorageCatalog(input: CreateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2150
|
+
updateStorageCatalog(id: string, input: UpdateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2151
|
+
deleteStorageCatalog(id: string, options?: AthenaStorageCallOptions): Promise<{
|
|
2152
|
+
id: string;
|
|
2153
|
+
deleted: boolean;
|
|
2154
|
+
}>;
|
|
2155
|
+
listStorageCredentials(options?: AthenaStorageCallOptions): Promise<{
|
|
2156
|
+
data: S3CredentialListItem[];
|
|
2157
|
+
}>;
|
|
2158
|
+
createStorageUploadUrl(input: CreateStorageUploadUrlRequest, options?: AthenaStorageCallOptions): Promise<StorageUploadUrlResponse>;
|
|
2159
|
+
createStorageUploadUrls(input: CreateStorageUploadUrlsRequest, options?: AthenaStorageCallOptions): Promise<StorageBatchUploadUrlResponse>;
|
|
2160
|
+
listStorageFiles(input: ListStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageListFilesResponse>;
|
|
2161
|
+
getStorageFile(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2162
|
+
getStorageFileUrl(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageCallOptions): Promise<PresignedFileUrlResponse>;
|
|
2163
|
+
getStorageFileProxy(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response>;
|
|
2164
|
+
updateStorageFile(fileId: string, input: UpdateStorageFileRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2165
|
+
deleteStorageFile(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2166
|
+
setStorageFileVisibility(fileId: string, input: SetStorageFileVisibilityRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2167
|
+
deleteStorageFolder(input: DeleteStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2168
|
+
moveStorageFolder(input: MoveStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2169
|
+
}
|
|
2170
|
+
type AthenaStoragePutBody = Blob | ArrayBuffer | Uint8Array | ReadableStream<Uint8Array>;
|
|
2171
|
+
interface AthenaStoragePutOptions {
|
|
2172
|
+
headers?: Record<string, string>;
|
|
2173
|
+
signal?: AbortSignal;
|
|
2174
|
+
}
|
|
2175
|
+
interface AthenaStorageManagedUpload extends PresignedFileUrlResponse {
|
|
2176
|
+
method: 'PUT';
|
|
2177
|
+
headers: Record<string, string>;
|
|
2178
|
+
expiresAt: string;
|
|
2179
|
+
put(body: AthenaStoragePutBody, options?: AthenaStoragePutOptions): Promise<Response>;
|
|
2180
|
+
}
|
|
2181
|
+
interface StorageUploadUrlResponseWithPut extends Omit<StorageUploadUrlResponse, 'upload'> {
|
|
2182
|
+
upload: AthenaStorageManagedUpload;
|
|
2183
|
+
}
|
|
2184
|
+
interface StorageBatchUploadUrlResponseWithPut {
|
|
2185
|
+
files: StorageUploadUrlResponseWithPut[];
|
|
2186
|
+
}
|
|
2187
|
+
interface AthenaStorageFileUploadRequest {
|
|
2188
|
+
s3_id?: string;
|
|
2189
|
+
s3Id?: string;
|
|
2190
|
+
bucket?: string;
|
|
2191
|
+
storage_key?: string;
|
|
2192
|
+
storageKey?: string;
|
|
2193
|
+
name?: string;
|
|
2194
|
+
fileName?: string;
|
|
2195
|
+
original_name?: string;
|
|
2196
|
+
originalName?: string;
|
|
2197
|
+
resource_id?: string;
|
|
2198
|
+
resourceId?: string;
|
|
2199
|
+
mime_type?: string;
|
|
2200
|
+
mimeType?: string;
|
|
2201
|
+
content_type?: string;
|
|
2202
|
+
contentType?: string;
|
|
2203
|
+
size_bytes?: number;
|
|
2204
|
+
sizeBytes?: number;
|
|
2205
|
+
file_id?: string;
|
|
2206
|
+
fileId?: string;
|
|
2207
|
+
public?: boolean;
|
|
2208
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
2209
|
+
metadata?: Record<string, unknown>;
|
|
2210
|
+
}
|
|
2211
|
+
interface AthenaStorageFileUploadManyRequest {
|
|
2212
|
+
files: AthenaStorageFileUploadRequest[];
|
|
2213
|
+
}
|
|
2214
|
+
interface AthenaStorageFileNamespace extends AthenaStorageFileModule {
|
|
2215
|
+
upload(input: AthenaStorageFileUploadRequest, options?: AthenaStorageCallOptions): Promise<StorageUploadUrlResponseWithPut>;
|
|
2216
|
+
upload(input: Parameters<AthenaStorageFileModule['upload']>[0], options?: AthenaStorageCallOptions): ReturnType<AthenaStorageFileModule['upload']>;
|
|
2217
|
+
uploadMany(input: AthenaStorageFileUploadManyRequest, options?: AthenaStorageCallOptions): Promise<StorageBatchUploadUrlResponseWithPut>;
|
|
2218
|
+
confirmUpload(fileId: string, input?: ConfirmStorageUploadRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2219
|
+
uploadBinary(fileId: string, body: AthenaStoragePutBody, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2220
|
+
search(input: SearchStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageListFilesResponse>;
|
|
2221
|
+
get(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2222
|
+
update(fileId: string, input: UpdateStorageFileRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2223
|
+
deleteMany(input: DeleteManyStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationManyResponse>;
|
|
2224
|
+
updateMany(input: UpdateManyStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationManyResponse>;
|
|
2225
|
+
restore(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2226
|
+
purge(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2227
|
+
copy(fileId: string, input: CopyStorageFileRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2228
|
+
url(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageCallOptions): Promise<PresignedFileUrlResponse>;
|
|
2229
|
+
publicUrl(fileId: string, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2230
|
+
proxy(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response>;
|
|
2231
|
+
visibility: {
|
|
2232
|
+
set(fileId: string, input: SetStorageFileVisibilityRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2233
|
+
setMany(input: SetManyStorageFileVisibilityRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationManyResponse>;
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
interface AthenaStorageCredentialsNamespace {
|
|
2237
|
+
list(options?: AthenaStorageCallOptions): Promise<{
|
|
2238
|
+
data: S3CredentialListItem[];
|
|
2239
|
+
}>;
|
|
2240
|
+
}
|
|
2241
|
+
interface AthenaStorageCatalogNamespace {
|
|
2242
|
+
list(options?: AthenaStorageCallOptions): Promise<{
|
|
2243
|
+
data: S3CatalogItem[];
|
|
2244
|
+
}>;
|
|
2245
|
+
create(input: CreateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2246
|
+
update(id: string, input: UpdateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2247
|
+
delete(id: string, options?: AthenaStorageCallOptions): Promise<{
|
|
2248
|
+
id: string;
|
|
2249
|
+
deleted: boolean;
|
|
2250
|
+
}>;
|
|
2251
|
+
}
|
|
2252
|
+
interface AthenaStorageFolderNamespace {
|
|
2253
|
+
list(input: ListStorageFoldersRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2254
|
+
tree(input: TreeStorageFoldersRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2255
|
+
delete(input: DeleteStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2256
|
+
move(input: MoveStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2257
|
+
}
|
|
2258
|
+
interface AthenaStoragePermissionNamespace {
|
|
2259
|
+
list(input: StoragePermissionListRequest, options?: AthenaStorageCallOptions): Promise<StoragePermissionListResponse>;
|
|
2260
|
+
grant(input: StoragePermissionGrantRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2261
|
+
revoke(input: StoragePermissionRevokeRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2262
|
+
check(input: StoragePermissionCheckRequest, options?: AthenaStorageCallOptions): Promise<StoragePermissionCheckResponse>;
|
|
2263
|
+
}
|
|
2264
|
+
interface AthenaStorageObjectFolderNamespace {
|
|
2265
|
+
create(input: StorageObjectFolderCreateRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2266
|
+
delete(input: StorageObjectFolderDeleteRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2267
|
+
rename(input: StorageObjectFolderRenameRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2268
|
+
}
|
|
2269
|
+
interface AthenaStorageObjectNamespace {
|
|
2270
|
+
list(input: StorageListObjectsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2271
|
+
head(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2272
|
+
exists(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2273
|
+
validate(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2274
|
+
update(input: StorageUpdateObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2275
|
+
copy(input: StorageObjectCopyRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2276
|
+
url(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2277
|
+
publicUrl(input: StorageObjectPublicUrlRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2278
|
+
delete(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2279
|
+
uploadUrl(input: StoragePresignUploadRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2280
|
+
folder: AthenaStorageObjectFolderNamespace;
|
|
2281
|
+
}
|
|
2282
|
+
interface AthenaStorageBucketCorsNamespace {
|
|
2283
|
+
get(input: StorageBucketCorsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2284
|
+
set(input: StorageSetBucketCorsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2285
|
+
delete(input: StorageBucketCorsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2286
|
+
}
|
|
2287
|
+
interface AthenaStorageBucketNamespace {
|
|
2288
|
+
list(input: Omit<StorageObjectBaseRequest, 'bucket'>, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2289
|
+
create(input: StorageObjectBaseRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2290
|
+
delete(input: StorageObjectBaseRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2291
|
+
cors: AthenaStorageBucketCorsNamespace;
|
|
2292
|
+
}
|
|
2293
|
+
interface AthenaStorageMultipartNamespace {
|
|
2294
|
+
create(input: StorageMultipartCreateRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2295
|
+
signPart(input: StorageMultipartSignPartRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2296
|
+
complete(input: StorageMultipartCompleteRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2297
|
+
abort(input: StorageMultipartAbortRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2298
|
+
listParts(input: StorageMultipartListPartsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2299
|
+
}
|
|
2300
|
+
interface AthenaStorageAuditNamespace {
|
|
2301
|
+
list(input: StorageAuditQueryRequest, options?: AthenaStorageCallOptions): Promise<StorageAuditListResponse>;
|
|
2302
|
+
}
|
|
2303
|
+
interface AthenaStorageModule extends AthenaStorageBaseModule {
|
|
2304
|
+
credentials: AthenaStorageCredentialsNamespace;
|
|
2305
|
+
catalog: AthenaStorageCatalogNamespace;
|
|
2306
|
+
file: AthenaStorageFileNamespace;
|
|
2307
|
+
folder: AthenaStorageFolderNamespace;
|
|
2308
|
+
permission: AthenaStoragePermissionNamespace;
|
|
2309
|
+
object: AthenaStorageObjectNamespace;
|
|
2310
|
+
bucket: AthenaStorageBucketNamespace;
|
|
2311
|
+
multipart: AthenaStorageMultipartNamespace;
|
|
2312
|
+
audit: AthenaStorageAuditNamespace;
|
|
2313
|
+
delete: AthenaStorageFileModule['delete'];
|
|
2314
|
+
}
|
|
2315
|
+
declare function createAthenaStorageError(input: AthenaStorageErrorInput): AthenaStorageError;
|
|
2316
|
+
|
|
2317
|
+
type AthenaRowShape$1 = Record<string, AthenaJsonValue | undefined>;
|
|
2318
|
+
type FilterColumnKey$1<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
2319
|
+
type ResolvedFilterColumnKey$1<Row> = [FilterColumnKey$1<Row>] extends [never] ? string : FilterColumnKey$1<Row>;
|
|
2320
|
+
type AthenaFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'contains' | 'containedBy';
|
|
2321
|
+
type AthenaWherePrimitive = AthenaConditionValue;
|
|
2322
|
+
type AthenaWhereOperatorInput = {
|
|
2323
|
+
eq?: AthenaConditionValue;
|
|
2324
|
+
neq?: AthenaConditionValue;
|
|
2325
|
+
gt?: AthenaConditionValue;
|
|
2326
|
+
gte?: AthenaConditionValue;
|
|
2327
|
+
lt?: AthenaConditionValue;
|
|
2328
|
+
lte?: AthenaConditionValue;
|
|
2329
|
+
like?: AthenaConditionValue;
|
|
2330
|
+
ilike?: AthenaConditionValue;
|
|
2331
|
+
is?: AthenaConditionValue;
|
|
2332
|
+
in?: AthenaConditionArrayValue;
|
|
2333
|
+
contains?: AthenaConditionArrayValue;
|
|
2334
|
+
containedBy?: AthenaConditionArrayValue;
|
|
2335
|
+
};
|
|
2336
|
+
type AthenaWhereColumnInput<Row = AthenaRowShape$1> = Partial<Record<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereOperatorInput>>;
|
|
2337
|
+
type AthenaBooleanSafeOperator = Exclude<AthenaFilterOperator, 'in' | 'contains' | 'containedBy'>;
|
|
2338
|
+
type AthenaWhereBooleanSafeOperatorInput = Partial<Record<AthenaBooleanSafeOperator, AthenaConditionValue>>;
|
|
2339
|
+
type AthenaWhereBooleanNotOperatorInput = {
|
|
2340
|
+
[K in AthenaBooleanSafeOperator]: {
|
|
2341
|
+
[P in K]: AthenaConditionValue;
|
|
2342
|
+
} & Partial<Record<Exclude<AthenaBooleanSafeOperator, K>, never>>;
|
|
2343
|
+
}[AthenaBooleanSafeOperator];
|
|
2344
|
+
type AthenaStrictBooleanOperand<Keys extends string, Value> = {
|
|
2345
|
+
[K in Keys]: {
|
|
2346
|
+
[P in K]: Value;
|
|
2347
|
+
} & Partial<Record<Exclude<Keys, K>, never>>;
|
|
2348
|
+
}[Keys];
|
|
2349
|
+
type AthenaNonEmptyArray<T> = [T, ...T[]];
|
|
2350
|
+
type AthenaWhereBooleanOperand<Row = AthenaRowShape$1> = string extends ResolvedFilterColumnKey$1<Row> ? AthenaWhereColumnInput<Row> : AthenaStrictBooleanOperand<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereBooleanSafeOperatorInput>;
|
|
2351
|
+
type AthenaWhereNotOperand<Row = AthenaRowShape$1> = string extends ResolvedFilterColumnKey$1<Row> ? AthenaWhereColumnInput<Row> : AthenaStrictBooleanOperand<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereBooleanNotOperatorInput>;
|
|
2352
|
+
type AthenaWhere<Row = AthenaRowShape$1> = AthenaWhereColumnInput<Row> & {
|
|
2353
|
+
or?: string extends ResolvedFilterColumnKey$1<Row> ? Array<AthenaWhereColumnInput<Row>> : AthenaNonEmptyArray<AthenaWhereBooleanOperand<Row>>;
|
|
2354
|
+
not?: AthenaWhereNotOperand<Row>;
|
|
2355
|
+
};
|
|
2356
|
+
interface AthenaRelationSelectNode<TSelect extends AthenaSelectShape = AthenaSelectShape> {
|
|
2357
|
+
select: TSelect;
|
|
2358
|
+
as?: string;
|
|
2359
|
+
via?: string;
|
|
2360
|
+
schema?: string;
|
|
2361
|
+
}
|
|
2362
|
+
type AthenaSelectShape = Record<string, true | AthenaRelationSelectNode<AthenaSelectShape>>;
|
|
2363
|
+
type AthenaAllowedRelationSelectNodeKey = 'select' | 'as' | 'via' | 'schema';
|
|
2364
|
+
type AthenaValidatedRelationSelectNode<TNode> = TNode extends {
|
|
2365
|
+
select: infer TChild;
|
|
2366
|
+
} ? Exclude<keyof TNode, AthenaAllowedRelationSelectNodeKey> extends never ? TNode extends {
|
|
2367
|
+
schema: string;
|
|
2368
|
+
via: string;
|
|
2369
|
+
} ? never : TChild extends Record<string, unknown> ? {
|
|
2370
|
+
[K in keyof TNode]: K extends 'select' ? AthenaValidatedSelectShape<TChild> : K extends AthenaAllowedRelationSelectNodeKey ? TNode[K] : never;
|
|
2371
|
+
} : never : never : never;
|
|
2372
|
+
type AthenaValidatedSelectShape<TSelect> = {
|
|
2373
|
+
[K in keyof TSelect]: TSelect[K] extends true ? true : AthenaValidatedRelationSelectNode<TSelect[K]>;
|
|
2374
|
+
};
|
|
2375
|
+
type GenericRegistryDef = RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>;
|
|
2376
|
+
type AthenaOrderByDirectionInput = 'asc' | 'desc' | 'ascending' | 'descending' | boolean | {
|
|
2377
|
+
ascending?: boolean;
|
|
2378
|
+
};
|
|
2379
|
+
type AthenaOrderBy<Row = AthenaRowShape$1> = {
|
|
2380
|
+
column: ResolvedFilterColumnKey$1<Row>;
|
|
2381
|
+
ascending?: boolean;
|
|
2382
|
+
} | Partial<Record<ResolvedFilterColumnKey$1<Row>, AthenaOrderByDirectionInput>>;
|
|
2383
|
+
interface AthenaFindManyOptions<Row = AthenaRowShape$1, TSelect extends AthenaSelectShape = AthenaSelectShape> {
|
|
2384
|
+
select: TSelect;
|
|
2385
|
+
where?: AthenaWhere<Row>;
|
|
2386
|
+
orderBy?: AthenaOrderBy<Row>;
|
|
2387
|
+
limit?: number;
|
|
2388
|
+
}
|
|
2389
|
+
type AthenaModelContext<TRegistry extends GenericRegistryDef = GenericRegistryDef, TDatabase extends string = string, TSchema extends string = string, TModel extends AnyModelDef = AnyModelDef> = {
|
|
2390
|
+
registry: TRegistry;
|
|
2391
|
+
database: TDatabase;
|
|
2392
|
+
schema: TSchema;
|
|
2393
|
+
model: TModel;
|
|
2394
|
+
};
|
|
2395
|
+
type Simplify<T> = {
|
|
2396
|
+
[K in keyof T]: T[K];
|
|
2397
|
+
} & {};
|
|
2398
|
+
type ContextRegistry<TContext> = TContext extends AthenaModelContext<infer TRegistry, string, string, AnyModelDef> ? TRegistry : never;
|
|
2399
|
+
type ContextDatabase<TContext> = TContext extends AthenaModelContext<GenericRegistryDef, infer TDatabase, string, AnyModelDef> ? TDatabase : never;
|
|
2400
|
+
type ContextModel<TContext> = TContext extends AthenaModelContext<GenericRegistryDef, string, string, infer TModel> ? TModel : never;
|
|
2401
|
+
type ModelMetaOf<TContext> = ContextModel<TContext> extends ModelDef<unknown, unknown, unknown, infer TMeta> ? TMeta : never;
|
|
2402
|
+
type ModelRelationsOf<TContext> = NonNullable<ModelMetaOf<TContext>['relations']>;
|
|
2403
|
+
type SelectedResultKey<TKey extends string, TValue> = TValue extends {
|
|
2404
|
+
as: infer TAlias extends string;
|
|
2405
|
+
} ? TAlias : TKey;
|
|
2406
|
+
type ScalarSelectionResult<Row, TSelect extends AthenaSelectShape> = {
|
|
2407
|
+
[TKey in Extract<keyof TSelect, string> as TSelect[TKey] extends true ? TKey : never]-?: TKey extends keyof NonNullable<Row> ? NonNullable<Row>[TKey] : unknown;
|
|
2408
|
+
};
|
|
2409
|
+
type RelationByKey<TContext, TKey extends string> = TKey extends keyof ModelRelationsOf<TContext> ? ModelRelationsOf<TContext>[TKey] : never;
|
|
2410
|
+
type RelationByVia<TContext, TVia extends string> = {
|
|
2411
|
+
[TKey in keyof ModelRelationsOf<TContext>]: ModelRelationsOf<TContext>[TKey] extends infer TRelation ? TRelation extends ModelRelationMetadata ? TVia extends TRelation['sourceColumns'][number] ? TRelation : never : never : never;
|
|
2412
|
+
}[keyof ModelRelationsOf<TContext>];
|
|
2413
|
+
type ResolvedRelation<TContext, TKey extends string, TValue> = RelationByKey<TContext, TKey> extends never ? TValue extends {
|
|
2414
|
+
via: infer TVia extends string;
|
|
2415
|
+
} ? RelationByVia<TContext, TVia> : never : RelationByKey<TContext, TKey>;
|
|
2416
|
+
type TargetDatabaseName<TContext, TRelation extends ModelRelationMetadata> = TRelation['targetDatabase'] extends string ? TRelation['targetDatabase'] : ContextDatabase<TContext>;
|
|
2417
|
+
type ResolveTargetModel<TContext, TRelation extends ModelRelationMetadata> = ContextRegistry<TContext> extends infer TRegistry ? TRegistry extends GenericRegistryDef ? TargetDatabaseName<TContext, TRelation> extends keyof TRegistry & string ? TRelation['targetSchema'] extends keyof TRegistry[TargetDatabaseName<TContext, TRelation>]['schemas'] & string ? TRelation['targetModel'] extends keyof TRegistry[TargetDatabaseName<TContext, TRelation>]['schemas'][TRelation['targetSchema']]['models'] & string ? TRegistry[TargetDatabaseName<TContext, TRelation>]['schemas'][TRelation['targetSchema']]['models'][TRelation['targetModel']] : never : never : never : never : never;
|
|
2418
|
+
type RelationResultValue<TRelation extends ModelRelationMetadata, TValue, TContext> = TValue extends AthenaRelationSelectNode<infer TChildSelect> ? ResolveTargetModel<TContext, TRelation> extends infer TTargetModel ? TTargetModel extends AnyModelDef ? TRelation['kind'] extends 'one-to-many' | 'many-to-many' ? Array<AthenaFindManyResult<RowOf<TTargetModel>, TChildSelect, AthenaModelContext<ContextRegistry<TContext>, TargetDatabaseName<TContext, TRelation>, TRelation['targetSchema'], TTargetModel>>> : AthenaFindManyResult<RowOf<TTargetModel>, TChildSelect, AthenaModelContext<ContextRegistry<TContext>, TargetDatabaseName<TContext, TRelation>, TRelation['targetSchema'], TTargetModel>> | null : unknown : unknown : never;
|
|
2419
|
+
type RelationSelectionResult<TContext, TSelect extends AthenaSelectShape> = {
|
|
2420
|
+
[TKey in Extract<keyof TSelect, string> as TSelect[TKey] extends AthenaRelationSelectNode<AthenaSelectShape> ? SelectedResultKey<TKey, TSelect[TKey]> : never]-?: ResolvedRelation<TContext, TKey, TSelect[TKey]> extends infer TRelation ? TRelation extends ModelRelationMetadata ? RelationResultValue<TRelation, TSelect[TKey], TContext> : unknown : unknown;
|
|
2421
|
+
};
|
|
2422
|
+
type AthenaFindManyResult<Row, TSelect extends AthenaSelectShape, TContext = unknown> = Simplify<ScalarSelectionResult<Row, TSelect> & RelationSelectionResult<TContext, TSelect>>;
|
|
2423
|
+
|
|
2424
|
+
interface AthenaResult<T> {
|
|
2425
|
+
data: T | null;
|
|
2426
|
+
error: AthenaResultError | null;
|
|
2427
|
+
statusText?: string | null;
|
|
2428
|
+
/**
|
|
2429
|
+
* @deprecated Prefer `error?.gatewayCode`, `error?.hint`, and related fields on `error`.
|
|
2430
|
+
*/
|
|
2431
|
+
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
2432
|
+
status: number;
|
|
2433
|
+
count?: number | null;
|
|
2434
|
+
raw: unknown;
|
|
2435
|
+
}
|
|
2436
|
+
interface AthenaResultError {
|
|
2437
|
+
message: string;
|
|
2438
|
+
code: string | null;
|
|
2439
|
+
athenaCode: NormalizedAthenaError['code'];
|
|
2440
|
+
gatewayCode?: AthenaGatewayErrorDetails['code'] | null;
|
|
2441
|
+
kind: NormalizedAthenaError['kind'];
|
|
2442
|
+
category: NormalizedAthenaError['category'];
|
|
2443
|
+
retryable: boolean;
|
|
2444
|
+
details: unknown | null;
|
|
2445
|
+
hint: string | null;
|
|
2446
|
+
status: number;
|
|
2447
|
+
statusText: string | null;
|
|
2448
|
+
constraint?: string;
|
|
2449
|
+
table?: string;
|
|
2450
|
+
operation?: string;
|
|
2451
|
+
endpoint?: AthenaGatewayErrorDetails['endpoint'];
|
|
2452
|
+
method?: AthenaGatewayErrorDetails['method'];
|
|
2453
|
+
requestId?: string;
|
|
2454
|
+
cause?: string;
|
|
2455
|
+
raw: unknown;
|
|
2456
|
+
}
|
|
2457
|
+
interface AthenaClientExperimentalOptions {
|
|
2458
|
+
/**
|
|
2459
|
+
* @deprecated Failed `AthenaResult` values now include normalized structured `error`
|
|
2460
|
+
* envelopes by default. This flag is retained as a no-op compatibility switch.
|
|
2461
|
+
*/
|
|
2462
|
+
enableErrorNormalization?: boolean;
|
|
2463
|
+
/**
|
|
2464
|
+
* Retry retryable read failures (`select`, `findMany`, `query`) with a fixed internal policy.
|
|
2465
|
+
*
|
|
2466
|
+
* Applies two additional attempts with exponential backoff and jitter.
|
|
2467
|
+
*/
|
|
2468
|
+
retryReads?: boolean;
|
|
2469
|
+
/**
|
|
2470
|
+
* Emit execution diagnostics for every query/mutation/RPC invocation.
|
|
2471
|
+
* Includes payload, synthesized SQL, full outcome, and best-effort callsite metadata.
|
|
2472
|
+
*/
|
|
2473
|
+
traceQueries?: boolean | AthenaQueryTraceOptions;
|
|
2474
|
+
/**
|
|
2475
|
+
* Send the original `findMany(...)` AST body for clean object-select reads.
|
|
2476
|
+
* This requires gateway support and falls back to legacy compiled transport
|
|
2477
|
+
* when a chain carries filter/pagination state that the AST payload cannot
|
|
2478
|
+
* represent losslessly yet.
|
|
2479
|
+
*/
|
|
2480
|
+
findManyAst?: boolean;
|
|
2481
|
+
/**
|
|
2482
|
+
* Expose the experimental `client.storage.*` bindings for Athena storage APIs.
|
|
2483
|
+
*/
|
|
2484
|
+
athenaStorageBackend?: boolean;
|
|
2485
|
+
/**
|
|
2486
|
+
* Optional storage SDK runtime hooks. Only used when `athenaStorageBackend` is enabled.
|
|
2487
|
+
*/
|
|
2488
|
+
storage?: AthenaStorageClientConfig;
|
|
2489
|
+
}
|
|
2490
|
+
interface AthenaQueryTraceOptions {
|
|
2491
|
+
/**
|
|
2492
|
+
* Custom sink for trace events. Defaults to console.info.
|
|
2493
|
+
*/
|
|
2494
|
+
logger?: (event: AthenaQueryTraceEvent) => void;
|
|
2495
|
+
}
|
|
2496
|
+
interface AthenaQueryTraceCallsite {
|
|
2497
|
+
filePath: string;
|
|
2498
|
+
fileName: string;
|
|
2499
|
+
line: number;
|
|
2500
|
+
column: number;
|
|
2501
|
+
frame?: string;
|
|
2502
|
+
functionName?: string;
|
|
2503
|
+
}
|
|
2504
|
+
interface AthenaQueryTraceEvent {
|
|
2505
|
+
timestamp: string;
|
|
2506
|
+
durationMs: number;
|
|
2507
|
+
operation: 'select' | 'insert' | 'upsert' | 'update' | 'delete' | 'rpc' | 'query';
|
|
2508
|
+
endpoint: '/gateway/fetch' | '/gateway/insert' | '/gateway/update' | '/gateway/delete' | '/gateway/rpc' | '/gateway/query' | `/rpc/${string}`;
|
|
2509
|
+
table?: string;
|
|
2510
|
+
functionName?: string;
|
|
2511
|
+
sql: string;
|
|
2512
|
+
payload: unknown;
|
|
2513
|
+
options?: AthenaGatewayCallOptions | AthenaRpcCallOptions;
|
|
2514
|
+
callsite: AthenaQueryTraceCallsite | null;
|
|
2515
|
+
outcome?: {
|
|
2516
|
+
status: number;
|
|
2517
|
+
error: AthenaResultError | null;
|
|
2518
|
+
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
2519
|
+
count?: number | null;
|
|
2520
|
+
data: unknown;
|
|
2521
|
+
raw: unknown;
|
|
2522
|
+
};
|
|
2523
|
+
thrownError?: unknown;
|
|
2524
|
+
}
|
|
2525
|
+
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
2526
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
2527
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
2528
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
2529
|
+
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
2530
|
+
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
2531
|
+
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
2532
|
+
single(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
2533
|
+
maybeSingle(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
2534
|
+
then<TResult1 = AthenaResult<Result>, TResult2 = never>(onfulfilled?: ((value: AthenaResult<Result>) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
2535
|
+
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | undefined | null): Promise<AthenaResult<Result> | TResult>;
|
|
2536
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<AthenaResult<Result>>;
|
|
2537
|
+
}
|
|
2538
|
+
interface OrderOptions {
|
|
2539
|
+
ascending?: boolean;
|
|
2540
|
+
}
|
|
2541
|
+
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
2542
|
+
interface FilterChain<Self, Row> {
|
|
2543
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2544
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
2545
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
2546
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
2547
|
+
range(from: number, to: number): Self;
|
|
2548
|
+
limit(count: number): Self;
|
|
2549
|
+
offset(count: number): Self;
|
|
2550
|
+
currentPage(value: number): Self;
|
|
2551
|
+
pageSize(value: number): Self;
|
|
2552
|
+
totalPages(value: number): Self;
|
|
2553
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
2554
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2555
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2556
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2557
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2558
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2559
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2560
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2561
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2562
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
2563
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
2564
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
2565
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
2566
|
+
or(expression: string): Self;
|
|
2567
|
+
}
|
|
2568
|
+
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
2569
|
+
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
2570
|
+
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2571
|
+
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2572
|
+
}
|
|
2573
|
+
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
2574
|
+
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
2575
|
+
}
|
|
2576
|
+
interface RpcFilterChain<Self> {
|
|
2577
|
+
eq(column: string, value: AthenaConditionValue): Self;
|
|
2578
|
+
neq(column: string, value: AthenaConditionValue): Self;
|
|
2579
|
+
gt(column: string, value: AthenaConditionValue): Self;
|
|
2580
|
+
gte(column: string, value: AthenaConditionValue): Self;
|
|
2581
|
+
lt(column: string, value: AthenaConditionValue): Self;
|
|
2582
|
+
lte(column: string, value: AthenaConditionValue): Self;
|
|
2583
|
+
like(column: string, value: AthenaConditionValue): Self;
|
|
2584
|
+
ilike(column: string, value: AthenaConditionValue): Self;
|
|
2585
|
+
is(column: string, value: AthenaConditionValue): Self;
|
|
2586
|
+
in(column: string, values: AthenaConditionArrayValue): Self;
|
|
2587
|
+
}
|
|
2588
|
+
interface RpcOrderOptions {
|
|
2589
|
+
ascending?: boolean;
|
|
2590
|
+
}
|
|
2591
|
+
interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, PromiseLike<AthenaResult<Row[]>> {
|
|
2592
|
+
select(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<Row[]>>;
|
|
2593
|
+
single<T = Row>(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
2594
|
+
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
2595
|
+
order(column: string, options?: RpcOrderOptions): RpcQueryBuilder<Row>;
|
|
2596
|
+
limit(count: number): RpcQueryBuilder<Row>;
|
|
2597
|
+
offset(count: number): RpcQueryBuilder<Row>;
|
|
2598
|
+
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
2599
|
+
}
|
|
2600
|
+
interface AthenaFromOptions {
|
|
2601
|
+
schema?: string;
|
|
2602
|
+
}
|
|
2603
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>, TContext = unknown> extends FilterChain<TableQueryBuilder<Row, Insert, Update, TContext>, Row> {
|
|
2604
|
+
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
2605
|
+
findMany<const TSelect extends AthenaSelectShape>(options: AthenaFindManyOptions<Row, TSelect> & {
|
|
2606
|
+
select: AthenaValidatedSelectShape<TSelect>;
|
|
2607
|
+
}): Promise<AthenaResult<Array<AthenaFindManyResult<Row, TSelect, TContext>>>>;
|
|
2608
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
2609
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
2610
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
2611
|
+
updateBody?: Update;
|
|
2612
|
+
onConflict?: string | string[];
|
|
2613
|
+
}): MutationQuery<Row>;
|
|
2614
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
2615
|
+
updateBody?: Update;
|
|
2616
|
+
onConflict?: string | string[];
|
|
2617
|
+
}): MutationQuery<Row[]>;
|
|
2618
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
2619
|
+
delete(options?: AthenaGatewayCallOptions & {
|
|
2620
|
+
resourceId?: string;
|
|
2621
|
+
}): MutationQuery<Row | null>;
|
|
2622
|
+
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2623
|
+
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2624
|
+
reset(): TableQueryBuilder<Row, Insert, Update, TContext>;
|
|
2625
|
+
}
|
|
2626
|
+
interface AthenaSdkClient {
|
|
2627
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update>;
|
|
2628
|
+
db: AthenaDbModule;
|
|
2629
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
2630
|
+
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
2631
|
+
verifyConnection(options?: AthenaGatewayConnectionOptions): Promise<AthenaGatewayConnectionResult>;
|
|
2632
|
+
}
|
|
2633
|
+
interface AthenaSdkClientWithAuth extends AthenaSdkClient {
|
|
2634
|
+
auth: AthenaAuthBindings;
|
|
2635
|
+
}
|
|
2636
|
+
interface AthenaSdkClientWithStorage extends AthenaSdkClientWithAuth {
|
|
2637
|
+
storage: AthenaStorageModule;
|
|
2638
|
+
}
|
|
2639
|
+
interface AthenaCreateClientOptions extends Pick<AthenaGatewayCallOptions, 'client' | 'headers' | 'backend'> {
|
|
2640
|
+
auth?: AthenaAuthClientConfig;
|
|
2641
|
+
experimental?: AthenaClientExperimentalOptions;
|
|
2642
|
+
}
|
|
2643
|
+
interface AthenaCreateClientOptionsWithStorage extends AthenaCreateClientOptions {
|
|
2644
|
+
experimental: AthenaClientExperimentalOptions & {
|
|
2645
|
+
athenaStorageBackend: true;
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
interface AthenaClientBuilder<StorageEnabled extends boolean = false> {
|
|
2649
|
+
/** Set the gateway base URL. */
|
|
2650
|
+
url(url: string): AthenaClientBuilder<StorageEnabled>;
|
|
2651
|
+
/** Set the API key used for all requests. */
|
|
2652
|
+
key(apiKey: string): AthenaClientBuilder<StorageEnabled>;
|
|
2653
|
+
/** Set the default backend routing strategy. */
|
|
2654
|
+
backend(backend: BackendConfig | BackendType): AthenaClientBuilder<StorageEnabled>;
|
|
2655
|
+
/** Set the default Athena client routing key. */
|
|
2656
|
+
client(clientName: string): AthenaClientBuilder<StorageEnabled>;
|
|
2657
|
+
/** Attach static headers to every request. */
|
|
2658
|
+
headers(headers: Record<string, string>): AthenaClientBuilder<StorageEnabled>;
|
|
2659
|
+
/** Configure Athena Auth client behavior for `client.auth.*` methods. */
|
|
2660
|
+
auth(config: AthenaAuthClientConfig): AthenaClientBuilder<StorageEnabled>;
|
|
2661
|
+
/** Configure experimental client options and narrow the built client when storage is enabled. */
|
|
2662
|
+
experimental(options: AthenaClientExperimentalOptions & {
|
|
2663
|
+
athenaStorageBackend: true;
|
|
2664
|
+
}): AthenaClientBuilder<true>;
|
|
2665
|
+
experimental(options: AthenaClientExperimentalOptions): AthenaClientBuilder<StorageEnabled>;
|
|
2666
|
+
/** Apply createClient options and narrow the built client when storage is enabled. */
|
|
2667
|
+
options(options: AthenaCreateClientOptionsWithStorage): AthenaClientBuilder<true>;
|
|
2668
|
+
options(options: AthenaCreateClientOptions): AthenaClientBuilder<StorageEnabled>;
|
|
2669
|
+
/** Build the immutable Athena SDK client. */
|
|
2670
|
+
build(): StorageEnabled extends true ? AthenaSdkClientWithStorage : AthenaSdkClientWithAuth;
|
|
2671
|
+
}
|
|
2672
|
+
/** Canonical Athena client factory with builder-based configuration. */
|
|
2673
|
+
declare class AthenaClient {
|
|
2674
|
+
/** Create a fluent builder for a strongly-typed Athena SDK client. */
|
|
2675
|
+
static builder(): AthenaClientBuilder<false>;
|
|
2676
|
+
/** Build a client from process environment variables. */
|
|
2677
|
+
static fromEnvironment(): AthenaSdkClientWithAuth;
|
|
2678
|
+
}
|
|
2679
|
+
/** Create client (convenience wrapper; use AthenaClient.builder() for full control) */
|
|
2680
|
+
declare function createClient(url: string, apiKey: string, options: AthenaCreateClientOptionsWithStorage): AthenaSdkClientWithStorage;
|
|
2681
|
+
declare function createClient(url: string, apiKey: string, options?: AthenaCreateClientOptions): AthenaSdkClientWithAuth;
|
|
2682
|
+
|
|
2683
|
+
interface AthenaGatewayErrorInput {
|
|
2684
|
+
code: AthenaGatewayErrorCode;
|
|
2685
|
+
message: string;
|
|
2686
|
+
status?: number;
|
|
2687
|
+
endpoint?: AthenaGatewayEndpointPath;
|
|
2688
|
+
method?: AthenaGatewayMethod;
|
|
2689
|
+
requestId?: string;
|
|
2690
|
+
hint?: string;
|
|
2691
|
+
cause?: string;
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* Canonical error for gateway failures.
|
|
2695
|
+
* Holds request context and machine-readable classification.
|
|
2696
|
+
*/
|
|
2697
|
+
declare class AthenaGatewayError extends Error {
|
|
2698
|
+
readonly code: AthenaGatewayErrorCode;
|
|
2699
|
+
readonly status: number;
|
|
2700
|
+
readonly endpoint?: AthenaGatewayEndpointPath;
|
|
2701
|
+
readonly method?: AthenaGatewayMethod;
|
|
2702
|
+
readonly requestId?: string;
|
|
2703
|
+
readonly hint?: string;
|
|
2704
|
+
readonly causeDetail?: string;
|
|
2705
|
+
constructor(input: AthenaGatewayErrorInput);
|
|
2706
|
+
toDetails(): AthenaGatewayErrorDetails;
|
|
2707
|
+
static fromResponse<T>(response: AthenaGatewayResponse<T>, fallback: Omit<AthenaGatewayErrorInput, 'code' | 'message' | 'status'>): AthenaGatewayError;
|
|
2708
|
+
}
|
|
2709
|
+
declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
|
|
2710
|
+
|
|
2711
|
+
type ModelFormNullishMode = 'empty-string' | 'undefined' | 'null';
|
|
2712
|
+
type NullishValueByMode = {
|
|
2713
|
+
'empty-string': '';
|
|
2714
|
+
undefined: undefined;
|
|
2715
|
+
null: null;
|
|
2716
|
+
};
|
|
2717
|
+
type MapNullableToFormValue<TField, TMode extends ModelFormNullishMode> = null extends TField ? Exclude<TField, null> | NullishValueByMode[TMode] : TField;
|
|
2718
|
+
/**
|
|
2719
|
+
* Form value shape derived from a model insert payload.
|
|
2720
|
+
* Nullable fields are remapped to the selected nullish representation.
|
|
2721
|
+
*/
|
|
2722
|
+
type ModelFormValues<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = {
|
|
2723
|
+
[K in keyof InsertOf<TModel>]: MapNullableToFormValue<InsertOf<TModel>[K], TMode>;
|
|
2724
|
+
};
|
|
2725
|
+
/**
|
|
2726
|
+
* Default value shape for form initialization.
|
|
2727
|
+
*/
|
|
2728
|
+
type ModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = Partial<ModelFormValues<TModel, TMode>>;
|
|
2729
|
+
interface ToModelFormDefaultsOptions<TMode extends ModelFormNullishMode = 'empty-string'> {
|
|
2730
|
+
/**
|
|
2731
|
+
* Controls how nullable model values are represented in form defaults.
|
|
2732
|
+
* - `empty-string` (default): `null -> ""`
|
|
2733
|
+
* - `undefined`: `null -> undefined`
|
|
2734
|
+
* - `null`: keeps `null`
|
|
2735
|
+
*/
|
|
2736
|
+
nullishMode?: TMode;
|
|
2737
|
+
}
|
|
2738
|
+
interface ToModelPayloadOptions {
|
|
2739
|
+
/**
|
|
2740
|
+
* Converts `""` into `null` for nullable model fields.
|
|
2741
|
+
* Defaults to `true`.
|
|
2742
|
+
*/
|
|
2743
|
+
emptyStringAsNull?: boolean;
|
|
2744
|
+
/**
|
|
2745
|
+
* Omits `undefined` keys from the outgoing payload.
|
|
2746
|
+
* Defaults to `true`.
|
|
2747
|
+
*/
|
|
2748
|
+
stripUndefined?: boolean;
|
|
2749
|
+
}
|
|
2750
|
+
/**
|
|
2751
|
+
* Normalizes model data into form-safe defaults using model nullability metadata.
|
|
2752
|
+
*/
|
|
2753
|
+
declare function toModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'>(model: TModel, values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
2754
|
+
/**
|
|
2755
|
+
* Normalizes form values back into model-compatible insert/update payloads.
|
|
2756
|
+
*/
|
|
2757
|
+
declare function toModelPayload<TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
2758
|
+
/**
|
|
2759
|
+
* Runtime form adapter bound to a model contract.
|
|
2760
|
+
*/
|
|
2761
|
+
interface ModelFormAdapter<TModel extends AnyModelDef> {
|
|
2762
|
+
model: TModel;
|
|
2763
|
+
toDefaults<TMode extends ModelFormNullishMode = 'empty-string'>(values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
2764
|
+
toInsert(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
2765
|
+
toUpdate(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<UpdateOf<TModel>>;
|
|
2766
|
+
}
|
|
2767
|
+
/**
|
|
2768
|
+
* Creates a small model-aware adapter for form defaults and payload normalization.
|
|
2769
|
+
*/
|
|
2770
|
+
declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
|
|
2771
|
+
|
|
2772
|
+
export { type AthenaClientExperimentalOptions as $, type AthenaAdminListUsersFilterOperator as A, type AthenaAuthQueryValue as B, type AthenaAuthReactEmailComponent as C, type AthenaAuthReactEmailConfig as D, type AthenaAuthReactEmailEventPhase as E, type AthenaAuthReactEmailProps as F, type AthenaAuthReactEmailRenderEvent as G, type AthenaAuthReactEmailRenderInput as H, type AthenaAuthReactEmailRenderOptions as I, type AthenaAuthRequestInput as J, type AthenaAuthResetPasswordBinding as K, type AthenaAuthResult as L, type AthenaAuthRevokeSessionRequest as M, type AthenaAuthSdkClient as N, type AthenaAuthSearchOperator as O, type AthenaAuthSession as P, type AthenaAuthSessionResponse as Q, type AthenaAuthSessionRevokeBinding as R, type AthenaAuthSignInResponse as S, type AthenaAuthSignOutResponse as T, type AthenaAuthSocialRedirectResponse as U, type AthenaAuthStatusResponse as V, type AthenaAuthUser as W, type AthenaChangeEmailRequest as X, type AthenaChangePasswordRequest as Y, AthenaClient as Z, type AthenaClientBuilder as _, type AthenaAdminListUsersQuery as a, type AthenaUnlinkAccountRequest as a$, type AthenaCreateClientOptions as a0, type AthenaCreateClientOptionsWithStorage as a1, type AthenaDbModule as a2, type AthenaDeleteUserCallbackRequest as a3, type AthenaDeleteUserRequest as a4, type AthenaDeleteUserResponse as a5, type AthenaEmailSignInRequest as a6, type AthenaEmailSignUpRequest as a7, type AthenaEnvelope as a8, AthenaError as a9, type AthenaSocialSignInRequest as aA, type AthenaStorageBinaryCallOptions as aB, type AthenaStorageCallOptions as aC, type AthenaStorageClientConfig as aD, type AthenaStorageEnv as aE, AthenaStorageError as aF, AthenaStorageErrorCode as aG, type AthenaStorageErrorDetails as aH, type AthenaStorageErrorHandler as aI, type AthenaStorageErrorInput as aJ, type AthenaStorageFileConfig as aK, type AthenaStorageFileDeleteInput as aL, type AthenaStorageFileDownloadInput as aM, type AthenaStorageFileListInput as aN, type AthenaStorageFileModule as aO, type AthenaStorageFileUploadInput as aP, type AthenaStorageFileUploadResult as aQ, type AthenaStorageModule as aR, type AthenaStoragePathContext as aS, type AthenaStoragePrefixPath as aT, type AthenaStorageTemplateValue as aU, type AthenaStorageTemplateVars as aV, type AthenaStorageUploadConstraints as aW, type AthenaStorageUploadProgress as aX, type AthenaStorageUploadProgressHandler as aY, type AthenaStorageUploadSource as aZ, type AthenaStorageUploadedFile as a_, AthenaErrorCategory as aa, AthenaErrorCode as ab, type AthenaErrorInput as ac, AthenaErrorKind as ad, type AthenaFindManyOptions as ae, type AthenaFindManyResult as af, type AthenaForgetPasswordRequest as ag, type AthenaFromOptions as ah, AthenaGatewayError as ai, type AthenaLinkSocialRequest as aj, type AthenaOAuthAccountTokenRequest as ak, type AthenaOAuthTokenBundle as al, type AthenaOperationContext as am, type AthenaOrderBy as an, type AthenaQueryTraceCallsite as ao, type AthenaQueryTraceEvent as ap, type AthenaQueryTraceOptions as aq, type AthenaRelationSelectNode as ar, type AthenaResetPasswordRequest as as, type AthenaResult as at, type AthenaResultError as au, type AthenaSdkClient as av, type AthenaSdkClientWithAuth as aw, type AthenaSdkClientWithStorage as ax, type AthenaSelectShape as ay, type AthenaSendVerificationEmailRequest as az, type AthenaAdminListUsersSearchOperator as b, type AthenaUpdateUserRequest as b0, type AthenaUsernameSignInRequest as b1, type AthenaVerifyEmailRequest as b2, type AthenaWhere as b3, type AthenaWhereBooleanOperand as b4, type AthenaWhereOperatorInput as b5, type CreateStorageCatalogRequest as b6, type CreateStorageUploadUrlRequest as b7, type CreateStorageUploadUrlsRequest as b8, type DeleteStorageFolderRequest as b9, type ToModelFormDefaultsOptions as bA, type ToModelPayloadOptions as bB, type UnwrapOneOptions as bC, type UnwrapOptions as bD, type UpdateStorageCatalogRequest as bE, type UpdateStorageFileRequest as bF, assertInt as bG, coerceInt as bH, createAthenaStorageError as bI, createClient as bJ, createModelFormAdapter as bK, isAthenaGatewayError as bL, isOk as bM, normalizeAthenaError as bN, parseBooleanFlag as bO, requireAffected as bP, requireSuccess as bQ, storageSdkManifest as bR, toModelFormDefaults as bS, toModelPayload as bT, unwrap as bU, unwrapOne as bV, unwrapRows as bW, withRetry as bX, type AthenaAuthFetchCompatibleInput as bY, type GetStorageFileUrlQuery as ba, type IntCoercionOptions as bb, type ListStorageFilesRequest as bc, type ManagedFileRecord as bd, type ModelFormAdapter as be, type ModelFormDefaults as bf, type ModelFormNullishMode as bg, type ModelFormValues as bh, type MoveStorageFolderRequest as bi, type NormalizedAthenaError as bj, type PresignedFileUrlResponse as bk, type RequireAffectedOptions as bl, type RetryBackoffStrategy as bm, type RetryConfig as bn, type RpcOrderOptions as bo, type RpcQueryBuilder as bp, type S3CatalogItem as bq, type S3CredentialListItem as br, type SetStorageFileVisibilityRequest as bs, type StorageBatchUploadUrlResponse as bt, type StorageFileAccessPurpose as bu, type StorageFileMutationResponse as bv, type StorageFolderMutationResponse as bw, type StorageListFilesResponse as bx, type StorageUploadUrlResponse as by, type TableQueryBuilder as bz, type AthenaAuthAdminUserSessionRevokeBinding as c, type AthenaAuthBindings as d, type AthenaAuthCallOptions as e, type AthenaAuthClientConfig as f, type AthenaAuthCredentials as g, type AthenaAuthEmailChangeResponse as h, type AthenaAuthEmailTemplateBuilder as i, type AthenaAuthEmailTemplateCreateFromDefinitionInput as j, type AthenaAuthEmailTemplateDefinition as k, type AthenaAuthEmailTemplateReactOverrides as l, type AthenaAuthEmailTemplateUpdateFromDefinitionInput as m, type AthenaAuthEndpointPath as n, type AthenaAuthErrorCode as o, type AthenaAuthErrorDetails as p, type AthenaAuthFilterOperator as q, type AthenaAuthGenericInput as r, type AthenaAuthGenericQueryInput as s, type AthenaAuthLinkedAccount as t, type AthenaAuthMethod as u, type AthenaAuthOrganization as v, type AthenaAuthOrganizationBindings as w, type AthenaAuthOrganizationInvitation as x, type AthenaAuthOrganizationMember as y, type AthenaAuthQueryPrimitive as z };
|