@xylex-group/athena 2.6.0 → 2.8.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 +210 -17
- package/dist/browser.cjs +2102 -527
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +8 -7
- package/dist/browser.d.ts +8 -7
- package/dist/browser.js +2096 -528
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +2116 -559
- 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 +2116 -559
- 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 +2694 -748
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +2688 -749
- package/dist/index.js.map +1 -1
- package/dist/model-form-DMed05gE.d.cts +3037 -0
- package/dist/model-form-DXPlOnlI.d.ts +3037 -0
- package/dist/{pipeline-Ce3pTw5h.d.ts → pipeline-CkMnhwPI.d.ts} +1 -1
- package/dist/{pipeline-D1ZYeoH7.d.cts → pipeline-D4sJRKqN.d.cts} +1 -1
- package/dist/react-email-DZhDDlEl.d.cts +417 -0
- package/dist/react-email-Lrz9A-BW.d.ts +417 -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-BzY6fETM.d.ts} +47 -5
- package/dist/{types-DapchQY5.d.ts → types-CAtTGGoz.d.cts} +47 -5
- package/dist/{types-DSX6AT5B.d.cts → types-vikz9YIO.d.cts} +23 -1
- package/dist/{types-DSX6AT5B.d.ts → types-vikz9YIO.d.ts} +23 -1
- package/package.json +194 -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,3037 @@
|
|
|
1
|
+
import { j as AthenaModelTarget, H as RowOf, r as InsertOf, U as UpdateOf, i as AthenaJsonValue, a as AthenaGatewayCallOptions, g as AthenaJsonObject, k as AthenaRpcCallOptions, Z as AthenaGatewayEndpointPath, _ as AthenaGatewayMethod, $ as AthenaConditionValue, a0 as AthenaConditionArrayValue, R as RegistryDef, D as DatabaseDef, J as SchemaDef, N as AnyModelDef, C as ModelDef, G as ModelRelationMetadata, a1 as AthenaGatewayCondition, a2 as AthenaSortBy, V as AthenaFetchPayload, X as AthenaInsertPayload, Y as AthenaUpdatePayload, Q as AthenaDeletePayload, l as AthenaRpcFilter, o as AthenaRpcPayload, p as BackendConfig, q as BackendType, e as AthenaGatewayErrorDetails, A as AthenaConditionCastType, a3 as AthenaConditionOperator, b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, d as AthenaGatewayErrorCode, W as AthenaGatewayResponse } from './types-vikz9YIO.cjs';
|
|
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
|
+
* @deprecated Prefer `result.error` on failed `AthenaResult` values and the
|
|
1400
|
+
* structured fields already attached to thrown SDK errors. This helper is
|
|
1401
|
+
* retained for compatibility with mixed unknown inputs.
|
|
1402
|
+
*
|
|
1403
|
+
* Normalizes any Athena failure shape into a stable, typed error envelope.
|
|
1404
|
+
*
|
|
1405
|
+
* Accepts `AthenaResult`, `AthenaGatewayError`, native `Error`, or unknown values.
|
|
1406
|
+
* Optional `context` can override inferred table/operation metadata for clearer diagnostics.
|
|
1407
|
+
*/
|
|
1408
|
+
declare function normalizeAthenaError(resultOrError: unknown, context?: AthenaOperationContext): NormalizedAthenaError;
|
|
1409
|
+
/**
|
|
1410
|
+
* Unwraps a successful result into a row array.
|
|
1411
|
+
*
|
|
1412
|
+
* - Throws on failed results.
|
|
1413
|
+
* - Converts `null` data to an empty array.
|
|
1414
|
+
* - Wraps scalar data in a single-element array.
|
|
1415
|
+
*/
|
|
1416
|
+
declare function unwrapRows<T>(result: AthenaResult<T[] | T | null>, options?: UnwrapOptions): T[];
|
|
1417
|
+
/**
|
|
1418
|
+
* Unwraps successful result data from `AthenaResult<T | null>`.
|
|
1419
|
+
*
|
|
1420
|
+
* By default, `null` data throws. Pass `{ allowNull: true }` to permit nullable payloads.
|
|
1421
|
+
*/
|
|
1422
|
+
declare function unwrap<T>(result: AthenaResult<T | null>, options: UnwrapOptions & {
|
|
1423
|
+
allowNull: true;
|
|
1424
|
+
}): T | null;
|
|
1425
|
+
declare function unwrap<T>(result: AthenaResult<T | null>, options?: UnwrapOptions): T;
|
|
1426
|
+
/**
|
|
1427
|
+
* Unwraps the first row from a successful result that may contain arrays/scalars/null.
|
|
1428
|
+
*
|
|
1429
|
+
* - Throws on failed results.
|
|
1430
|
+
* - Throws when no row exists unless `allowNull: true` is provided.
|
|
1431
|
+
* - Optionally enforces exact cardinality via `requireExactlyOne`.
|
|
1432
|
+
*/
|
|
1433
|
+
declare function unwrapOne<T>(result: AthenaResult<T[] | T | null>, options: UnwrapOneOptions & {
|
|
1434
|
+
allowNull: true;
|
|
1435
|
+
}): T | null;
|
|
1436
|
+
declare function unwrapOne<T>(result: AthenaResult<T[] | T | null>, options?: UnwrapOneOptions): T;
|
|
1437
|
+
/**
|
|
1438
|
+
* Asserts that an Athena result is successful.
|
|
1439
|
+
*
|
|
1440
|
+
* Returns the original result for fluent composition and throws `AthenaGatewayError` on failure.
|
|
1441
|
+
*/
|
|
1442
|
+
declare function requireSuccess<T>(result: AthenaResult<T>, context?: AthenaOperationContext): AthenaResult<T>;
|
|
1443
|
+
/**
|
|
1444
|
+
* Enforces mutation postconditions based on `result.count`.
|
|
1445
|
+
*
|
|
1446
|
+
* - Validates success first.
|
|
1447
|
+
* - Requires a non-null count in the response.
|
|
1448
|
+
* - Validates `count >= min` (default: `1`).
|
|
1449
|
+
*
|
|
1450
|
+
* Useful for guaranteeing that critical writes actually affected rows.
|
|
1451
|
+
*/
|
|
1452
|
+
declare function requireAffected<T>(result: AthenaResult<T>, options?: RequireAffectedOptions, context?: AthenaOperationContext): number;
|
|
1453
|
+
/**
|
|
1454
|
+
* Safely coerces `unknown` values into finite integers.
|
|
1455
|
+
*
|
|
1456
|
+
* Returns `null` when coercion fails or bounds/strict bigint checks are violated.
|
|
1457
|
+
*/
|
|
1458
|
+
declare function coerceInt(value: unknown, options?: IntCoercionOptions): number | null;
|
|
1459
|
+
/**
|
|
1460
|
+
* Strict integer assertion wrapper around `coerceInt`.
|
|
1461
|
+
*
|
|
1462
|
+
* Throws a `TypeError` with the provided label when coercion fails.
|
|
1463
|
+
*/
|
|
1464
|
+
declare function assertInt(value: unknown, label?: string, options?: IntCoercionOptions): number;
|
|
1465
|
+
/**
|
|
1466
|
+
* Retries an async operation with configurable backoff and retry policy.
|
|
1467
|
+
*
|
|
1468
|
+
* `retries` represents additional attempts after the first failure.
|
|
1469
|
+
* By default, transient and rate-limit errors are retried.
|
|
1470
|
+
*/
|
|
1471
|
+
declare function withRetry<T>(config: RetryConfig, fn: () => Promise<T>): Promise<T>;
|
|
1472
|
+
|
|
1473
|
+
type Whitespace = ' ' | '\n' | '\r' | '\t';
|
|
1474
|
+
type TrimLeft<TValue extends string> = TValue extends `${Whitespace}${infer TRest}` ? TrimLeft<TRest> : TValue;
|
|
1475
|
+
type TrimRight<TValue extends string> = TValue extends `${infer TRest}${Whitespace}` ? TrimRight<TRest> : TValue;
|
|
1476
|
+
type Trim<TValue extends string> = TrimLeft<TrimRight<TValue>>;
|
|
1477
|
+
type KnownSelectColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
1478
|
+
type HasKnownSelectColumns<Row> = [KnownSelectColumnKey<Row>] extends [never] ? false : string extends KnownSelectColumnKey<Row> ? false : true;
|
|
1479
|
+
type HasComplexSelectTokenSyntax<TValue extends string> = TValue extends `${string}(${string}` ? true : TValue extends `${string})${string}` ? true : TValue extends `${string}.${string}` ? true : TValue extends `${string}"${string}` ? true : TValue extends `${string}'${string}` ? true : false;
|
|
1480
|
+
type ValidateAliasedBase<Row, TOriginal extends string, TBase extends string> = HasComplexSelectTokenSyntax<Trim<TBase>> extends true ? TOriginal : Trim<TBase> extends KnownSelectColumnKey<Row> ? TOriginal : never;
|
|
1481
|
+
type ValidateSelectToken<Row, TToken extends string> = Trim<TToken> extends infer TTrimmed extends string ? TTrimmed extends '' ? never : TTrimmed extends '*' ? TTrimmed : TTrimmed extends `${string}:${infer TBase}` ? ValidateAliasedBase<Row, TTrimmed, TBase> : TTrimmed extends `${infer TBase} as ${string}` ? ValidateAliasedBase<Row, TTrimmed, TBase> : TTrimmed extends `${infer TBase} AS ${string}` ? ValidateAliasedBase<Row, TTrimmed, TBase> : HasComplexSelectTokenSyntax<TTrimmed> extends true ? TTrimmed : TTrimmed extends KnownSelectColumnKey<Row> ? TTrimmed : never : never;
|
|
1482
|
+
type ValidateSelectList<Row, TValue extends string> = string extends TValue ? TValue : HasComplexSelectTokenSyntax<TValue> extends true ? TValue : TValue extends `${infer THead},${infer TTail}` ? ValidateSelectToken<Row, THead> extends never ? never : ValidateSelectList<Row, TTail> extends never ? never : TValue : ValidateSelectToken<Row, TValue> extends never ? never : TValue;
|
|
1483
|
+
type ValidateSelectArray<Row, TValue extends readonly string[]> = string extends TValue[number] ? TValue : TValue extends readonly [
|
|
1484
|
+
infer THead extends string,
|
|
1485
|
+
...infer TTail extends readonly string[]
|
|
1486
|
+
] ? ValidateSelectToken<Row, THead> extends never ? never : ValidateSelectArray<Row, TTail> extends never ? never : TValue : TValue;
|
|
1487
|
+
type AthenaSelectInput = string | string[] | readonly string[];
|
|
1488
|
+
type AthenaValidatedSelectInput<Row, TValue extends AthenaSelectInput> = HasKnownSelectColumns<Row> extends true ? TValue extends string ? ValidateSelectList<Row, TValue> : TValue extends readonly string[] ? ValidateSelectArray<Row, TValue> : never : TValue;
|
|
1489
|
+
type AthenaTypecheckedColumnKey<Row, TEnabled extends boolean> = TEnabled extends true ? HasKnownSelectColumns<Row> extends true ? KnownSelectColumnKey<Row> : string : string;
|
|
1490
|
+
|
|
1491
|
+
type AthenaRowShape$2 = Record<string, AthenaJsonValue | undefined>;
|
|
1492
|
+
type AthenaUpsertOptions<Update> = AthenaGatewayCallOptions & {
|
|
1493
|
+
updateBody?: Update;
|
|
1494
|
+
onConflict?: string | string[];
|
|
1495
|
+
};
|
|
1496
|
+
interface AthenaDbModule<TStrict extends boolean = false> {
|
|
1497
|
+
from<TModel extends AthenaModelTarget>(model: TModel): TableQueryBuilder<RowOf<TModel>, InsertOf<TModel>, UpdateOf<TModel>, unknown, TStrict>;
|
|
1498
|
+
from<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update, unknown, TStrict>;
|
|
1499
|
+
select<Row = AthenaRowShape$2>(table: string, options?: AthenaGatewayCallOptions): SelectChain<Row, Row, TStrict>;
|
|
1500
|
+
select(table: string, columns: AthenaSelectInput, options?: AthenaGatewayCallOptions): SelectChain<AthenaRowShape$2, AthenaRowShape$2, TStrict>;
|
|
1501
|
+
insert<Row = AthenaRowShape$2, Insert = Partial<Row>>(table: string, values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row, Row, TStrict>;
|
|
1502
|
+
insert<Row = AthenaRowShape$2, Insert = Partial<Row>>(table: string, values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[], Row, TStrict>;
|
|
1503
|
+
upsert<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert, options?: AthenaUpsertOptions<Update>): MutationQuery<Row, Row, TStrict>;
|
|
1504
|
+
upsert<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert[], options?: AthenaUpsertOptions<Update>): MutationQuery<Row[], Row, TStrict>;
|
|
1505
|
+
update<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row, TStrict>;
|
|
1506
|
+
delete<Row = AthenaRowShape$2>(table: string, options?: AthenaGatewayCallOptions & {
|
|
1507
|
+
resourceId?: string;
|
|
1508
|
+
}): MutationQuery<Row | null, Row, TStrict>;
|
|
1509
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row, TStrict>;
|
|
1510
|
+
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
type AthenaStorageTemplateValue = string | number | boolean | null | undefined;
|
|
1514
|
+
type AthenaStorageTemplateVars = Record<string, AthenaStorageTemplateValue>;
|
|
1515
|
+
type AthenaStorageEnv = Record<string, string | undefined>;
|
|
1516
|
+
type AthenaStorageUploadHeaders = ConstructorParameters<typeof Headers>[0];
|
|
1517
|
+
type AthenaStoragePrefixPath = string | ((context: AthenaStoragePathContext) => string | null | undefined);
|
|
1518
|
+
interface AthenaStoragePathContext {
|
|
1519
|
+
vars: AthenaStorageTemplateVars;
|
|
1520
|
+
env: AthenaStorageEnv;
|
|
1521
|
+
organizationId?: string;
|
|
1522
|
+
organization_id?: string;
|
|
1523
|
+
userId?: string;
|
|
1524
|
+
user_id?: string;
|
|
1525
|
+
resourceId?: string;
|
|
1526
|
+
resource_id?: string;
|
|
1527
|
+
}
|
|
1528
|
+
interface AthenaStorageFileConfig {
|
|
1529
|
+
/**
|
|
1530
|
+
* Prefix applied by high-level file helpers before storage keys are sent to Athena.
|
|
1531
|
+
* Supports tokens such as `{organization_id}`, `{organizationId}`, `{env.NODE_ENV}`,
|
|
1532
|
+
* and `${ATHENA_STORAGE_PREFIX}`.
|
|
1533
|
+
*/
|
|
1534
|
+
prefixPath?: AthenaStoragePrefixPath;
|
|
1535
|
+
vars?: AthenaStorageTemplateVars;
|
|
1536
|
+
env?: AthenaStorageEnv;
|
|
1537
|
+
}
|
|
1538
|
+
type AthenaStorageUploadSource = Blob | ArrayBuffer | Uint8Array;
|
|
1539
|
+
interface AthenaStorageUploadConstraints {
|
|
1540
|
+
maxFiles?: number;
|
|
1541
|
+
allowedExtensions?: readonly string[];
|
|
1542
|
+
extensions?: readonly string[];
|
|
1543
|
+
maxFileSizeMb?: number;
|
|
1544
|
+
maxFileSizeBytes?: number;
|
|
1545
|
+
}
|
|
1546
|
+
interface AthenaStorageUploadProgress {
|
|
1547
|
+
phase: 'preparing' | 'uploading' | 'complete';
|
|
1548
|
+
fileIndex: number;
|
|
1549
|
+
fileCount: number;
|
|
1550
|
+
fileName: string;
|
|
1551
|
+
loaded: number;
|
|
1552
|
+
total: number;
|
|
1553
|
+
percent: number;
|
|
1554
|
+
aggregateLoaded: number;
|
|
1555
|
+
aggregateTotal: number;
|
|
1556
|
+
aggregatePercent: number;
|
|
1557
|
+
}
|
|
1558
|
+
type AthenaStorageUploadProgressHandler = (progress: AthenaStorageUploadProgress) => void;
|
|
1559
|
+
interface AthenaStorageFileUploadInput extends AthenaStorageUploadConstraints {
|
|
1560
|
+
s3_id: string;
|
|
1561
|
+
bucket?: string;
|
|
1562
|
+
files: AthenaStorageUploadSource | ArrayLike<AthenaStorageUploadSource> | readonly AthenaStorageUploadSource[];
|
|
1563
|
+
storage_key?: string;
|
|
1564
|
+
storageKey?: string;
|
|
1565
|
+
storageKeyTemplate?: string;
|
|
1566
|
+
prefixPath?: AthenaStoragePrefixPath;
|
|
1567
|
+
fileName?: string;
|
|
1568
|
+
name?: string;
|
|
1569
|
+
original_name?: string;
|
|
1570
|
+
resource_id?: string;
|
|
1571
|
+
resourceId?: string;
|
|
1572
|
+
organization_id?: string;
|
|
1573
|
+
organizationId?: string;
|
|
1574
|
+
user_id?: string;
|
|
1575
|
+
userId?: string;
|
|
1576
|
+
mime_type?: string;
|
|
1577
|
+
content_type?: string;
|
|
1578
|
+
public?: boolean;
|
|
1579
|
+
metadata?: Record<string, unknown>;
|
|
1580
|
+
vars?: AthenaStorageTemplateVars;
|
|
1581
|
+
env?: AthenaStorageEnv;
|
|
1582
|
+
uploadHeaders?: AthenaStorageUploadHeaders;
|
|
1583
|
+
onProgress?: AthenaStorageUploadProgressHandler;
|
|
1584
|
+
}
|
|
1585
|
+
interface AthenaStorageUploadedFile {
|
|
1586
|
+
file: ManagedFileRecord;
|
|
1587
|
+
upload: StorageUploadUrlResponse['upload'];
|
|
1588
|
+
source: AthenaStorageUploadSource;
|
|
1589
|
+
fileName: string;
|
|
1590
|
+
storage_key: string;
|
|
1591
|
+
response: Response;
|
|
1592
|
+
}
|
|
1593
|
+
interface AthenaStorageFileUploadResult {
|
|
1594
|
+
files: AthenaStorageUploadedFile[];
|
|
1595
|
+
count: number;
|
|
1596
|
+
}
|
|
1597
|
+
interface AthenaStorageFileListInput extends Omit<ListStorageFilesRequest, 'prefix'> {
|
|
1598
|
+
prefix?: string;
|
|
1599
|
+
prefixPath?: AthenaStoragePrefixPath;
|
|
1600
|
+
vars?: AthenaStorageTemplateVars;
|
|
1601
|
+
env?: AthenaStorageEnv;
|
|
1602
|
+
organization_id?: string;
|
|
1603
|
+
organizationId?: string;
|
|
1604
|
+
user_id?: string;
|
|
1605
|
+
userId?: string;
|
|
1606
|
+
resource_id?: string;
|
|
1607
|
+
resourceId?: string;
|
|
1608
|
+
}
|
|
1609
|
+
interface AthenaStorageFileDownloadInput extends GetStorageFileUrlQuery {
|
|
1610
|
+
fileId?: string;
|
|
1611
|
+
fileIds?: readonly string[];
|
|
1612
|
+
}
|
|
1613
|
+
type AthenaStorageFileDeleteInput = string | readonly string[];
|
|
1614
|
+
interface AthenaStorageFileModule {
|
|
1615
|
+
upload(input: AthenaStorageFileUploadInput, options?: AthenaStorageCallOptions): Promise<AthenaStorageFileUploadResult>;
|
|
1616
|
+
download(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response>;
|
|
1617
|
+
download(fileIds: readonly string[], query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response[]>;
|
|
1618
|
+
download(input: AthenaStorageFileDownloadInput, options?: AthenaStorageBinaryCallOptions): Promise<Response | Response[]>;
|
|
1619
|
+
list(input: AthenaStorageFileListInput, options?: AthenaStorageCallOptions): Promise<StorageListFilesResponse>;
|
|
1620
|
+
delete(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
1621
|
+
delete(fileIds: readonly string[], options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse[]>;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
declare const storageSdkManifest: {
|
|
1625
|
+
readonly namespace: "storage";
|
|
1626
|
+
readonly basePath: "/storage";
|
|
1627
|
+
readonly envelopeKinds: {
|
|
1628
|
+
readonly raw: "response body is the payload";
|
|
1629
|
+
readonly athena: "response body is { status, message, data }";
|
|
1630
|
+
};
|
|
1631
|
+
readonly methods: readonly [{
|
|
1632
|
+
readonly name: "listStorageCatalogs";
|
|
1633
|
+
readonly method: "GET";
|
|
1634
|
+
readonly path: "/storage/catalogs";
|
|
1635
|
+
readonly responseEnvelope: "raw";
|
|
1636
|
+
readonly responseType: "{ data: S3CatalogItem[] }";
|
|
1637
|
+
}, {
|
|
1638
|
+
readonly name: "createStorageCatalog";
|
|
1639
|
+
readonly method: "POST";
|
|
1640
|
+
readonly path: "/storage/catalogs";
|
|
1641
|
+
readonly requestType: "CreateStorageCatalogRequest";
|
|
1642
|
+
readonly responseEnvelope: "raw";
|
|
1643
|
+
readonly responseType: "S3CatalogItem";
|
|
1644
|
+
}, {
|
|
1645
|
+
readonly name: "updateStorageCatalog";
|
|
1646
|
+
readonly method: "PATCH";
|
|
1647
|
+
readonly path: "/storage/catalogs/{id}";
|
|
1648
|
+
readonly pathParams: readonly ["id"];
|
|
1649
|
+
readonly requestType: "UpdateStorageCatalogRequest";
|
|
1650
|
+
readonly responseEnvelope: "raw";
|
|
1651
|
+
readonly responseType: "S3CatalogItem";
|
|
1652
|
+
}, {
|
|
1653
|
+
readonly name: "deleteStorageCatalog";
|
|
1654
|
+
readonly method: "DELETE";
|
|
1655
|
+
readonly path: "/storage/catalogs/{id}";
|
|
1656
|
+
readonly pathParams: readonly ["id"];
|
|
1657
|
+
readonly responseEnvelope: "raw";
|
|
1658
|
+
readonly responseType: "{ id: string; deleted: boolean }";
|
|
1659
|
+
}, {
|
|
1660
|
+
readonly name: "listStorageCredentials";
|
|
1661
|
+
readonly method: "GET";
|
|
1662
|
+
readonly path: "/storage/credentials";
|
|
1663
|
+
readonly responseEnvelope: "raw";
|
|
1664
|
+
readonly responseType: "{ data: S3CredentialListItem[] }";
|
|
1665
|
+
}, {
|
|
1666
|
+
readonly name: "createStorageUploadUrl";
|
|
1667
|
+
readonly method: "POST";
|
|
1668
|
+
readonly path: "/storage/files/upload-url";
|
|
1669
|
+
readonly requestType: "CreateStorageUploadUrlRequest";
|
|
1670
|
+
readonly responseEnvelope: "athena";
|
|
1671
|
+
readonly responseType: "StorageUploadUrlResponse";
|
|
1672
|
+
}, {
|
|
1673
|
+
readonly name: "createStorageUploadUrls";
|
|
1674
|
+
readonly method: "POST";
|
|
1675
|
+
readonly path: "/storage/files/upload-urls";
|
|
1676
|
+
readonly requestType: "CreateStorageUploadUrlsRequest";
|
|
1677
|
+
readonly responseEnvelope: "athena";
|
|
1678
|
+
readonly responseType: "StorageBatchUploadUrlResponse";
|
|
1679
|
+
}, {
|
|
1680
|
+
readonly name: "listStorageFiles";
|
|
1681
|
+
readonly method: "POST";
|
|
1682
|
+
readonly path: "/storage/files/list";
|
|
1683
|
+
readonly requestType: "ListStorageFilesRequest";
|
|
1684
|
+
readonly responseEnvelope: "athena";
|
|
1685
|
+
readonly responseType: "StorageListFilesResponse";
|
|
1686
|
+
}, {
|
|
1687
|
+
readonly name: "getStorageFile";
|
|
1688
|
+
readonly method: "GET";
|
|
1689
|
+
readonly path: "/storage/files/{file_id}";
|
|
1690
|
+
readonly pathParams: readonly ["file_id"];
|
|
1691
|
+
readonly responseEnvelope: "athena";
|
|
1692
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1693
|
+
}, {
|
|
1694
|
+
readonly name: "getStorageFileUrl";
|
|
1695
|
+
readonly method: "GET";
|
|
1696
|
+
readonly path: "/storage/files/{file_id}/url";
|
|
1697
|
+
readonly pathParams: readonly ["file_id"];
|
|
1698
|
+
readonly queryParams: readonly ["purpose"];
|
|
1699
|
+
readonly responseEnvelope: "athena";
|
|
1700
|
+
readonly responseType: "PresignedFileUrlResponse";
|
|
1701
|
+
}, {
|
|
1702
|
+
readonly name: "getStorageFileProxy";
|
|
1703
|
+
readonly method: "GET";
|
|
1704
|
+
readonly path: "/storage/files/{file_id}/proxy";
|
|
1705
|
+
readonly pathParams: readonly ["file_id"];
|
|
1706
|
+
readonly queryParams: readonly ["purpose"];
|
|
1707
|
+
readonly responseEnvelope: "raw";
|
|
1708
|
+
readonly responseType: "Response";
|
|
1709
|
+
readonly binary: true;
|
|
1710
|
+
}, {
|
|
1711
|
+
readonly name: "updateStorageFile";
|
|
1712
|
+
readonly method: "PATCH";
|
|
1713
|
+
readonly path: "/storage/files/{file_id}";
|
|
1714
|
+
readonly pathParams: readonly ["file_id"];
|
|
1715
|
+
readonly requestType: "UpdateStorageFileRequest";
|
|
1716
|
+
readonly responseEnvelope: "athena";
|
|
1717
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1718
|
+
}, {
|
|
1719
|
+
readonly name: "deleteStorageFile";
|
|
1720
|
+
readonly method: "DELETE";
|
|
1721
|
+
readonly path: "/storage/files/{file_id}";
|
|
1722
|
+
readonly pathParams: readonly ["file_id"];
|
|
1723
|
+
readonly responseEnvelope: "athena";
|
|
1724
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1725
|
+
}, {
|
|
1726
|
+
readonly name: "setStorageFileVisibility";
|
|
1727
|
+
readonly method: "PATCH";
|
|
1728
|
+
readonly path: "/storage/files/{file_id}/visibility";
|
|
1729
|
+
readonly pathParams: readonly ["file_id"];
|
|
1730
|
+
readonly requestType: "SetStorageFileVisibilityRequest";
|
|
1731
|
+
readonly responseEnvelope: "athena";
|
|
1732
|
+
readonly responseType: "StorageFileMutationResponse";
|
|
1733
|
+
}, {
|
|
1734
|
+
readonly name: "deleteStorageFolder";
|
|
1735
|
+
readonly method: "POST";
|
|
1736
|
+
readonly path: "/storage/folders/delete";
|
|
1737
|
+
readonly requestType: "DeleteStorageFolderRequest";
|
|
1738
|
+
readonly responseEnvelope: "athena";
|
|
1739
|
+
readonly responseType: "StorageFolderMutationResponse";
|
|
1740
|
+
}, {
|
|
1741
|
+
readonly name: "moveStorageFolder";
|
|
1742
|
+
readonly method: "POST";
|
|
1743
|
+
readonly path: "/storage/folders/move";
|
|
1744
|
+
readonly requestType: "MoveStorageFolderRequest";
|
|
1745
|
+
readonly responseEnvelope: "athena";
|
|
1746
|
+
readonly responseType: "StorageFolderMutationResponse";
|
|
1747
|
+
}];
|
|
1748
|
+
};
|
|
1749
|
+
interface S3CatalogItem {
|
|
1750
|
+
id: string;
|
|
1751
|
+
name: string;
|
|
1752
|
+
endpoint?: string | null;
|
|
1753
|
+
region?: string | null;
|
|
1754
|
+
bucket: string;
|
|
1755
|
+
provider: string;
|
|
1756
|
+
force_path_style: boolean;
|
|
1757
|
+
default_prefix?: string | null;
|
|
1758
|
+
public_base_url?: string | null;
|
|
1759
|
+
is_active: boolean;
|
|
1760
|
+
metadata: Record<string, unknown>;
|
|
1761
|
+
created_at: string;
|
|
1762
|
+
updated_at: string;
|
|
1763
|
+
}
|
|
1764
|
+
interface S3CredentialListItem {
|
|
1765
|
+
id: string;
|
|
1766
|
+
s3_id: string;
|
|
1767
|
+
name: string;
|
|
1768
|
+
endpoint?: string | null;
|
|
1769
|
+
region?: string | null;
|
|
1770
|
+
bucket: string;
|
|
1771
|
+
provider: string;
|
|
1772
|
+
access_key: string;
|
|
1773
|
+
is_active: boolean;
|
|
1774
|
+
created_at: string;
|
|
1775
|
+
rotated_at?: string | null;
|
|
1776
|
+
}
|
|
1777
|
+
interface ManagedFileRecord {
|
|
1778
|
+
id: string;
|
|
1779
|
+
name: string;
|
|
1780
|
+
original_name?: string | null;
|
|
1781
|
+
file_name?: string | null;
|
|
1782
|
+
url?: string | null;
|
|
1783
|
+
bucket: string;
|
|
1784
|
+
s3_id?: string | null;
|
|
1785
|
+
prefix_path?: string | null;
|
|
1786
|
+
size_bytes?: number | null;
|
|
1787
|
+
mime_type?: string | null;
|
|
1788
|
+
content_type?: string | null;
|
|
1789
|
+
resource_id?: string | null;
|
|
1790
|
+
organization_id?: string | null;
|
|
1791
|
+
created_by_user_id?: string | null;
|
|
1792
|
+
uploaded_by_user_id?: string | null;
|
|
1793
|
+
checksum_sha256?: string | null;
|
|
1794
|
+
metadata: Record<string, unknown>;
|
|
1795
|
+
created_at: string;
|
|
1796
|
+
updated_at: string;
|
|
1797
|
+
storage_key: string;
|
|
1798
|
+
extension?: string | null;
|
|
1799
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1800
|
+
is_public: boolean;
|
|
1801
|
+
status: string;
|
|
1802
|
+
deleted_at?: string | null;
|
|
1803
|
+
}
|
|
1804
|
+
interface PresignedFileUrlResponse {
|
|
1805
|
+
file_id: string;
|
|
1806
|
+
bucket: string;
|
|
1807
|
+
storage_key: string;
|
|
1808
|
+
purpose: string;
|
|
1809
|
+
url: string;
|
|
1810
|
+
expires_at: string;
|
|
1811
|
+
expires_at_epoch_seconds: number;
|
|
1812
|
+
expires_in: number;
|
|
1813
|
+
cache_hit: boolean;
|
|
1814
|
+
cache_layer: string;
|
|
1815
|
+
}
|
|
1816
|
+
interface CreateStorageCatalogRequest {
|
|
1817
|
+
name: string;
|
|
1818
|
+
endpoint: string;
|
|
1819
|
+
region: string;
|
|
1820
|
+
bucket: string;
|
|
1821
|
+
provider?: string;
|
|
1822
|
+
force_path_style?: boolean;
|
|
1823
|
+
default_prefix?: string;
|
|
1824
|
+
public_base_url?: string;
|
|
1825
|
+
access_key_id: string;
|
|
1826
|
+
secret_key: string;
|
|
1827
|
+
session_token?: string;
|
|
1828
|
+
metadata?: Record<string, unknown>;
|
|
1829
|
+
}
|
|
1830
|
+
interface UpdateStorageCatalogRequest {
|
|
1831
|
+
name?: string;
|
|
1832
|
+
endpoint?: string;
|
|
1833
|
+
region?: string;
|
|
1834
|
+
bucket?: string;
|
|
1835
|
+
provider?: string;
|
|
1836
|
+
force_path_style?: boolean;
|
|
1837
|
+
default_prefix?: string | null;
|
|
1838
|
+
public_base_url?: string | null;
|
|
1839
|
+
access_key_id?: string;
|
|
1840
|
+
secret_key?: string;
|
|
1841
|
+
session_token?: string;
|
|
1842
|
+
is_active?: boolean;
|
|
1843
|
+
metadata?: Record<string, unknown>;
|
|
1844
|
+
}
|
|
1845
|
+
interface CreateStorageUploadUrlRequest {
|
|
1846
|
+
s3_id: string;
|
|
1847
|
+
bucket?: string;
|
|
1848
|
+
storage_key: string;
|
|
1849
|
+
name?: string;
|
|
1850
|
+
original_name?: string;
|
|
1851
|
+
resource_id?: string;
|
|
1852
|
+
mime_type?: string;
|
|
1853
|
+
content_type?: string;
|
|
1854
|
+
size_bytes?: number;
|
|
1855
|
+
file_id?: string;
|
|
1856
|
+
public?: boolean;
|
|
1857
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1858
|
+
metadata?: Record<string, unknown>;
|
|
1859
|
+
}
|
|
1860
|
+
interface CreateStorageUploadUrlsRequest {
|
|
1861
|
+
files: CreateStorageUploadUrlRequest[];
|
|
1862
|
+
}
|
|
1863
|
+
interface StorageUploadUrlResponse {
|
|
1864
|
+
file: ManagedFileRecord;
|
|
1865
|
+
upload: PresignedFileUrlResponse;
|
|
1866
|
+
}
|
|
1867
|
+
interface StorageBatchUploadUrlResponse {
|
|
1868
|
+
files: StorageUploadUrlResponse[];
|
|
1869
|
+
}
|
|
1870
|
+
interface ListStorageFilesRequest {
|
|
1871
|
+
s3_id: string;
|
|
1872
|
+
prefix: string;
|
|
1873
|
+
}
|
|
1874
|
+
interface StorageListFilesResponse {
|
|
1875
|
+
files: ManagedFileRecord[];
|
|
1876
|
+
count: number;
|
|
1877
|
+
}
|
|
1878
|
+
interface UpdateStorageFileRequest {
|
|
1879
|
+
storage_key: string;
|
|
1880
|
+
bucket?: string;
|
|
1881
|
+
}
|
|
1882
|
+
interface SetStorageFileVisibilityRequest {
|
|
1883
|
+
public?: boolean;
|
|
1884
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1885
|
+
}
|
|
1886
|
+
interface DeleteStorageFolderRequest {
|
|
1887
|
+
s3_id: string;
|
|
1888
|
+
prefix: string;
|
|
1889
|
+
}
|
|
1890
|
+
interface MoveStorageFolderRequest {
|
|
1891
|
+
s3_id: string;
|
|
1892
|
+
from_prefix: string;
|
|
1893
|
+
to_prefix: string;
|
|
1894
|
+
}
|
|
1895
|
+
interface StorageFileMutationResponse {
|
|
1896
|
+
file: ManagedFileRecord;
|
|
1897
|
+
}
|
|
1898
|
+
interface StorageFolderMutationResponse {
|
|
1899
|
+
s3_id: string;
|
|
1900
|
+
prefix: string;
|
|
1901
|
+
processed_files: number;
|
|
1902
|
+
}
|
|
1903
|
+
interface StorageFileMutationManyResponse {
|
|
1904
|
+
files: ManagedFileRecord[];
|
|
1905
|
+
count: number;
|
|
1906
|
+
}
|
|
1907
|
+
interface StorageFilePermissionRecord {
|
|
1908
|
+
id: string;
|
|
1909
|
+
file_id: string;
|
|
1910
|
+
principal_type: 'user' | 'organization' | 'team' | 'role';
|
|
1911
|
+
principal_id: string;
|
|
1912
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1913
|
+
granted_by_user_id?: string | null;
|
|
1914
|
+
created_at: string;
|
|
1915
|
+
expires_at?: string | null;
|
|
1916
|
+
revoked_at?: string | null;
|
|
1917
|
+
metadata: Record<string, unknown>;
|
|
1918
|
+
}
|
|
1919
|
+
interface StoragePermissionListResponse {
|
|
1920
|
+
permissions: StorageFilePermissionRecord[];
|
|
1921
|
+
count: number;
|
|
1922
|
+
}
|
|
1923
|
+
interface StoragePermissionCheckResponse {
|
|
1924
|
+
allowed: boolean;
|
|
1925
|
+
permission: string;
|
|
1926
|
+
}
|
|
1927
|
+
interface StorageAuditEventRecord {
|
|
1928
|
+
id: string;
|
|
1929
|
+
operation: string;
|
|
1930
|
+
file_id?: string | null;
|
|
1931
|
+
s3_id?: string | null;
|
|
1932
|
+
bucket?: string | null;
|
|
1933
|
+
storage_key?: string | null;
|
|
1934
|
+
actor_user_id?: string | null;
|
|
1935
|
+
organization_id?: string | null;
|
|
1936
|
+
status: 'success' | 'error';
|
|
1937
|
+
error?: string | null;
|
|
1938
|
+
metadata: Record<string, unknown>;
|
|
1939
|
+
created_at: string;
|
|
1940
|
+
}
|
|
1941
|
+
interface StorageAuditListResponse {
|
|
1942
|
+
events: StorageAuditEventRecord[];
|
|
1943
|
+
count: number;
|
|
1944
|
+
}
|
|
1945
|
+
interface ConfirmStorageUploadRequest {
|
|
1946
|
+
size_bytes?: number;
|
|
1947
|
+
content_type?: string;
|
|
1948
|
+
checksum_sha256?: string;
|
|
1949
|
+
metadata?: Record<string, unknown>;
|
|
1950
|
+
}
|
|
1951
|
+
interface SearchStorageFilesRequest {
|
|
1952
|
+
query?: string;
|
|
1953
|
+
limit?: number;
|
|
1954
|
+
}
|
|
1955
|
+
interface DeleteManyStorageFilesRequest {
|
|
1956
|
+
file_ids: string[];
|
|
1957
|
+
}
|
|
1958
|
+
interface UpdateManyStorageFilesRequest {
|
|
1959
|
+
file_ids: string[];
|
|
1960
|
+
storage_key: string;
|
|
1961
|
+
bucket?: string;
|
|
1962
|
+
}
|
|
1963
|
+
interface SetManyStorageFileVisibilityRequest {
|
|
1964
|
+
file_ids: string[];
|
|
1965
|
+
public?: boolean;
|
|
1966
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1967
|
+
}
|
|
1968
|
+
interface CopyStorageFileRequest {
|
|
1969
|
+
storage_key: string;
|
|
1970
|
+
bucket?: string;
|
|
1971
|
+
file_name?: string;
|
|
1972
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
1973
|
+
metadata?: Record<string, unknown>;
|
|
1974
|
+
}
|
|
1975
|
+
interface ListStorageFoldersRequest {
|
|
1976
|
+
s3_id: string;
|
|
1977
|
+
prefix: string;
|
|
1978
|
+
}
|
|
1979
|
+
interface TreeStorageFoldersRequest {
|
|
1980
|
+
s3_id: string;
|
|
1981
|
+
prefix: string;
|
|
1982
|
+
}
|
|
1983
|
+
interface StoragePermissionListRequest {
|
|
1984
|
+
file_id: string;
|
|
1985
|
+
}
|
|
1986
|
+
interface StoragePermissionGrantRequest {
|
|
1987
|
+
file_id: string;
|
|
1988
|
+
principal_type: 'user' | 'organization' | 'team' | 'role';
|
|
1989
|
+
principal_id: string;
|
|
1990
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1991
|
+
expires_at?: string;
|
|
1992
|
+
metadata?: Record<string, unknown>;
|
|
1993
|
+
}
|
|
1994
|
+
interface StoragePermissionRevokeRequest {
|
|
1995
|
+
file_id: string;
|
|
1996
|
+
principal_type: 'user' | 'organization' | 'team' | 'role';
|
|
1997
|
+
principal_id: string;
|
|
1998
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
1999
|
+
}
|
|
2000
|
+
interface StoragePermissionCheckRequest {
|
|
2001
|
+
file_id: string;
|
|
2002
|
+
permission: 'read' | 'write' | 'delete' | 'share' | 'owner';
|
|
2003
|
+
}
|
|
2004
|
+
interface StorageMultipartCreateRequest {
|
|
2005
|
+
file_id: string;
|
|
2006
|
+
content_type?: string;
|
|
2007
|
+
}
|
|
2008
|
+
interface StorageMultipartSignPartRequest {
|
|
2009
|
+
file_id: string;
|
|
2010
|
+
upload_id: string;
|
|
2011
|
+
part_number: number;
|
|
2012
|
+
}
|
|
2013
|
+
interface StorageMultipartCompletePartInput {
|
|
2014
|
+
part_number: number;
|
|
2015
|
+
etag: string;
|
|
2016
|
+
}
|
|
2017
|
+
interface StorageMultipartCompleteRequest {
|
|
2018
|
+
file_id: string;
|
|
2019
|
+
upload_id: string;
|
|
2020
|
+
parts: StorageMultipartCompletePartInput[];
|
|
2021
|
+
}
|
|
2022
|
+
interface StorageMultipartAbortRequest {
|
|
2023
|
+
file_id: string;
|
|
2024
|
+
upload_id: string;
|
|
2025
|
+
}
|
|
2026
|
+
interface StorageMultipartListPartsRequest {
|
|
2027
|
+
file_id: string;
|
|
2028
|
+
upload_id: string;
|
|
2029
|
+
}
|
|
2030
|
+
interface StorageObjectFolderCreateRequest {
|
|
2031
|
+
endpoint: string;
|
|
2032
|
+
region: string;
|
|
2033
|
+
access_key_id: string;
|
|
2034
|
+
secret_key: string;
|
|
2035
|
+
bucket: string;
|
|
2036
|
+
prefix: string;
|
|
2037
|
+
}
|
|
2038
|
+
type StorageObjectFolderDeleteRequest = StorageObjectFolderCreateRequest;
|
|
2039
|
+
interface StorageObjectFolderRenameRequest extends Omit<StorageObjectFolderCreateRequest, 'prefix'> {
|
|
2040
|
+
from_prefix: string;
|
|
2041
|
+
to_prefix: string;
|
|
2042
|
+
}
|
|
2043
|
+
interface StorageObjectBaseRequest {
|
|
2044
|
+
endpoint: string;
|
|
2045
|
+
region: string;
|
|
2046
|
+
access_key_id: string;
|
|
2047
|
+
secret_key: string;
|
|
2048
|
+
bucket: string;
|
|
2049
|
+
}
|
|
2050
|
+
interface StorageObjectRequest extends StorageObjectBaseRequest {
|
|
2051
|
+
key: string;
|
|
2052
|
+
}
|
|
2053
|
+
interface StorageObjectCopyRequest extends StorageObjectBaseRequest {
|
|
2054
|
+
source_key: string;
|
|
2055
|
+
destination_key: string;
|
|
2056
|
+
destination_bucket?: string;
|
|
2057
|
+
}
|
|
2058
|
+
interface StorageObjectPublicUrlRequest extends StorageObjectRequest {
|
|
2059
|
+
public_base_url?: string;
|
|
2060
|
+
force_path_style?: boolean;
|
|
2061
|
+
}
|
|
2062
|
+
interface StorageListObjectsRequest extends StorageObjectBaseRequest {
|
|
2063
|
+
prefix?: string;
|
|
2064
|
+
delimiter?: string;
|
|
2065
|
+
continuation_token?: string;
|
|
2066
|
+
max_keys?: number;
|
|
2067
|
+
}
|
|
2068
|
+
interface StorageUpdateObjectRequest extends StorageObjectRequest {
|
|
2069
|
+
acl?: string;
|
|
2070
|
+
content_type?: string;
|
|
2071
|
+
cache_control?: string;
|
|
2072
|
+
content_disposition?: string;
|
|
2073
|
+
content_encoding?: string;
|
|
2074
|
+
content_language?: string;
|
|
2075
|
+
metadata?: Record<string, string>;
|
|
2076
|
+
}
|
|
2077
|
+
interface StoragePresignUploadRequest extends StorageObjectRequest {
|
|
2078
|
+
content_type?: string;
|
|
2079
|
+
}
|
|
2080
|
+
type StorageBucketCorsRequest = StorageObjectBaseRequest;
|
|
2081
|
+
interface StorageBucketCorsRuleInput {
|
|
2082
|
+
allowed_origins: string[];
|
|
2083
|
+
allowed_methods: string[];
|
|
2084
|
+
allowed_headers?: string[];
|
|
2085
|
+
expose_headers?: string[];
|
|
2086
|
+
max_age_seconds?: number;
|
|
2087
|
+
}
|
|
2088
|
+
interface StorageSetBucketCorsRequest extends StorageBucketCorsRequest {
|
|
2089
|
+
rules: StorageBucketCorsRuleInput[];
|
|
2090
|
+
}
|
|
2091
|
+
interface StorageAuditQueryRequest {
|
|
2092
|
+
file_id?: string;
|
|
2093
|
+
limit?: number;
|
|
2094
|
+
offset?: number;
|
|
2095
|
+
}
|
|
2096
|
+
interface AthenaEnvelope<T> {
|
|
2097
|
+
status: string;
|
|
2098
|
+
message: string;
|
|
2099
|
+
data: T;
|
|
2100
|
+
}
|
|
2101
|
+
type StorageFileAccessPurpose = 'read' | 'download' | 'stream';
|
|
2102
|
+
interface GetStorageFileUrlQuery {
|
|
2103
|
+
purpose?: StorageFileAccessPurpose | (string & {});
|
|
2104
|
+
}
|
|
2105
|
+
type AthenaStorageErrorHandler = (error: AthenaStorageError) => void | Promise<void>;
|
|
2106
|
+
interface AthenaStorageClientConfig extends AthenaStorageFileConfig {
|
|
2107
|
+
onError?: AthenaStorageErrorHandler;
|
|
2108
|
+
}
|
|
2109
|
+
interface AthenaStorageCallOptions extends AthenaGatewayCallOptions {
|
|
2110
|
+
signal?: AbortSignal;
|
|
2111
|
+
onError?: AthenaStorageErrorHandler;
|
|
2112
|
+
}
|
|
2113
|
+
type AthenaStorageBinaryCallOptions = AthenaStorageCallOptions;
|
|
2114
|
+
type AthenaStorageErrorCode = 'INVALID_URL' | 'NETWORK_ERROR' | 'HTTP_ERROR' | 'INVALID_JSON' | 'INVALID_ATHENA_ENVELOPE' | 'UNKNOWN_ERROR';
|
|
2115
|
+
declare const AthenaStorageErrorCode: {
|
|
2116
|
+
readonly InvalidUrl: "INVALID_URL";
|
|
2117
|
+
readonly NetworkError: "NETWORK_ERROR";
|
|
2118
|
+
readonly HttpError: "HTTP_ERROR";
|
|
2119
|
+
readonly InvalidJson: "INVALID_JSON";
|
|
2120
|
+
readonly InvalidAthenaEnvelope: "INVALID_ATHENA_ENVELOPE";
|
|
2121
|
+
readonly UnknownError: "UNKNOWN_ERROR";
|
|
2122
|
+
};
|
|
2123
|
+
interface AthenaStorageErrorDetails {
|
|
2124
|
+
code: AthenaStorageErrorCode;
|
|
2125
|
+
athenaCode: AthenaErrorCode;
|
|
2126
|
+
kind: AthenaErrorKind;
|
|
2127
|
+
category: AthenaErrorCategory;
|
|
2128
|
+
retryable: boolean;
|
|
2129
|
+
message: string;
|
|
2130
|
+
status: number;
|
|
2131
|
+
endpoint: AthenaGatewayEndpointPath;
|
|
2132
|
+
method: AthenaGatewayMethod;
|
|
2133
|
+
requestId?: string;
|
|
2134
|
+
hint?: string;
|
|
2135
|
+
cause?: string;
|
|
2136
|
+
raw: unknown;
|
|
2137
|
+
}
|
|
2138
|
+
interface AthenaStorageErrorInput {
|
|
2139
|
+
code: AthenaStorageErrorCode;
|
|
2140
|
+
message: string;
|
|
2141
|
+
status: number;
|
|
2142
|
+
endpoint: AthenaGatewayEndpointPath;
|
|
2143
|
+
method: AthenaGatewayMethod;
|
|
2144
|
+
raw?: unknown;
|
|
2145
|
+
requestId?: string;
|
|
2146
|
+
hint?: string;
|
|
2147
|
+
cause?: unknown;
|
|
2148
|
+
}
|
|
2149
|
+
declare class AthenaStorageError extends Error {
|
|
2150
|
+
readonly code: AthenaStorageErrorCode;
|
|
2151
|
+
readonly athenaCode: AthenaErrorCode;
|
|
2152
|
+
readonly kind: AthenaErrorKind;
|
|
2153
|
+
readonly category: AthenaErrorCategory;
|
|
2154
|
+
readonly retryable: boolean;
|
|
2155
|
+
readonly status: number;
|
|
2156
|
+
readonly endpoint: AthenaGatewayEndpointPath;
|
|
2157
|
+
readonly method: AthenaGatewayMethod;
|
|
2158
|
+
readonly requestId?: string;
|
|
2159
|
+
readonly hint?: string;
|
|
2160
|
+
readonly causeDetail?: string;
|
|
2161
|
+
readonly raw: unknown;
|
|
2162
|
+
readonly normalized: NormalizedAthenaError;
|
|
2163
|
+
readonly __athenaNormalizedError: NormalizedAthenaError;
|
|
2164
|
+
constructor(input: AthenaStorageErrorInput);
|
|
2165
|
+
toDetails(): AthenaStorageErrorDetails;
|
|
2166
|
+
}
|
|
2167
|
+
interface AthenaStorageBaseModule {
|
|
2168
|
+
listStorageCatalogs(options?: AthenaStorageCallOptions): Promise<{
|
|
2169
|
+
data: S3CatalogItem[];
|
|
2170
|
+
}>;
|
|
2171
|
+
createStorageCatalog(input: CreateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2172
|
+
updateStorageCatalog(id: string, input: UpdateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2173
|
+
deleteStorageCatalog(id: string, options?: AthenaStorageCallOptions): Promise<{
|
|
2174
|
+
id: string;
|
|
2175
|
+
deleted: boolean;
|
|
2176
|
+
}>;
|
|
2177
|
+
listStorageCredentials(options?: AthenaStorageCallOptions): Promise<{
|
|
2178
|
+
data: S3CredentialListItem[];
|
|
2179
|
+
}>;
|
|
2180
|
+
createStorageUploadUrl(input: CreateStorageUploadUrlRequest, options?: AthenaStorageCallOptions): Promise<StorageUploadUrlResponse>;
|
|
2181
|
+
createStorageUploadUrls(input: CreateStorageUploadUrlsRequest, options?: AthenaStorageCallOptions): Promise<StorageBatchUploadUrlResponse>;
|
|
2182
|
+
listStorageFiles(input: ListStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageListFilesResponse>;
|
|
2183
|
+
getStorageFile(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2184
|
+
getStorageFileUrl(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageCallOptions): Promise<PresignedFileUrlResponse>;
|
|
2185
|
+
getStorageFileProxy(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response>;
|
|
2186
|
+
updateStorageFile(fileId: string, input: UpdateStorageFileRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2187
|
+
deleteStorageFile(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2188
|
+
setStorageFileVisibility(fileId: string, input: SetStorageFileVisibilityRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2189
|
+
deleteStorageFolder(input: DeleteStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2190
|
+
moveStorageFolder(input: MoveStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2191
|
+
}
|
|
2192
|
+
type AthenaStoragePutBody = Blob | ArrayBuffer | Uint8Array | ReadableStream<Uint8Array>;
|
|
2193
|
+
interface AthenaStoragePutOptions {
|
|
2194
|
+
headers?: Record<string, string>;
|
|
2195
|
+
signal?: AbortSignal;
|
|
2196
|
+
}
|
|
2197
|
+
interface AthenaStorageManagedUpload extends PresignedFileUrlResponse {
|
|
2198
|
+
method: 'PUT';
|
|
2199
|
+
headers: Record<string, string>;
|
|
2200
|
+
expiresAt: string;
|
|
2201
|
+
put(body: AthenaStoragePutBody, options?: AthenaStoragePutOptions): Promise<Response>;
|
|
2202
|
+
}
|
|
2203
|
+
interface StorageUploadUrlResponseWithPut extends Omit<StorageUploadUrlResponse, 'upload'> {
|
|
2204
|
+
upload: AthenaStorageManagedUpload;
|
|
2205
|
+
}
|
|
2206
|
+
interface StorageBatchUploadUrlResponseWithPut {
|
|
2207
|
+
files: StorageUploadUrlResponseWithPut[];
|
|
2208
|
+
}
|
|
2209
|
+
interface AthenaStorageFileUploadRequest {
|
|
2210
|
+
s3_id?: string;
|
|
2211
|
+
s3Id?: string;
|
|
2212
|
+
bucket?: string;
|
|
2213
|
+
storage_key?: string;
|
|
2214
|
+
storageKey?: string;
|
|
2215
|
+
name?: string;
|
|
2216
|
+
fileName?: string;
|
|
2217
|
+
original_name?: string;
|
|
2218
|
+
originalName?: string;
|
|
2219
|
+
resource_id?: string;
|
|
2220
|
+
resourceId?: string;
|
|
2221
|
+
mime_type?: string;
|
|
2222
|
+
mimeType?: string;
|
|
2223
|
+
content_type?: string;
|
|
2224
|
+
contentType?: string;
|
|
2225
|
+
size_bytes?: number;
|
|
2226
|
+
sizeBytes?: number;
|
|
2227
|
+
file_id?: string;
|
|
2228
|
+
fileId?: string;
|
|
2229
|
+
public?: boolean;
|
|
2230
|
+
visibility?: 'private' | 'organization' | 'public';
|
|
2231
|
+
metadata?: Record<string, unknown>;
|
|
2232
|
+
}
|
|
2233
|
+
interface AthenaStorageFileUploadManyRequest {
|
|
2234
|
+
files: AthenaStorageFileUploadRequest[];
|
|
2235
|
+
}
|
|
2236
|
+
interface AthenaStorageFileNamespace extends AthenaStorageFileModule {
|
|
2237
|
+
upload(input: AthenaStorageFileUploadRequest, options?: AthenaStorageCallOptions): Promise<StorageUploadUrlResponseWithPut>;
|
|
2238
|
+
upload(input: Parameters<AthenaStorageFileModule['upload']>[0], options?: AthenaStorageCallOptions): ReturnType<AthenaStorageFileModule['upload']>;
|
|
2239
|
+
uploadMany(input: AthenaStorageFileUploadManyRequest, options?: AthenaStorageCallOptions): Promise<StorageBatchUploadUrlResponseWithPut>;
|
|
2240
|
+
confirmUpload(fileId: string, input?: ConfirmStorageUploadRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2241
|
+
uploadBinary(fileId: string, body: AthenaStoragePutBody, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2242
|
+
search(input: SearchStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageListFilesResponse>;
|
|
2243
|
+
get(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2244
|
+
update(fileId: string, input: UpdateStorageFileRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2245
|
+
deleteMany(input: DeleteManyStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationManyResponse>;
|
|
2246
|
+
updateMany(input: UpdateManyStorageFilesRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationManyResponse>;
|
|
2247
|
+
restore(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2248
|
+
purge(fileId: string, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2249
|
+
copy(fileId: string, input: CopyStorageFileRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2250
|
+
url(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageCallOptions): Promise<PresignedFileUrlResponse>;
|
|
2251
|
+
publicUrl(fileId: string, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2252
|
+
proxy(fileId: string, query?: GetStorageFileUrlQuery, options?: AthenaStorageBinaryCallOptions): Promise<Response>;
|
|
2253
|
+
visibility: {
|
|
2254
|
+
set(fileId: string, input: SetStorageFileVisibilityRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2255
|
+
setMany(input: SetManyStorageFileVisibilityRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationManyResponse>;
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2258
|
+
interface AthenaStorageCredentialsNamespace {
|
|
2259
|
+
list(options?: AthenaStorageCallOptions): Promise<{
|
|
2260
|
+
data: S3CredentialListItem[];
|
|
2261
|
+
}>;
|
|
2262
|
+
}
|
|
2263
|
+
interface AthenaStorageCatalogNamespace {
|
|
2264
|
+
list(options?: AthenaStorageCallOptions): Promise<{
|
|
2265
|
+
data: S3CatalogItem[];
|
|
2266
|
+
}>;
|
|
2267
|
+
create(input: CreateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2268
|
+
update(id: string, input: UpdateStorageCatalogRequest, options?: AthenaStorageCallOptions): Promise<S3CatalogItem>;
|
|
2269
|
+
delete(id: string, options?: AthenaStorageCallOptions): Promise<{
|
|
2270
|
+
id: string;
|
|
2271
|
+
deleted: boolean;
|
|
2272
|
+
}>;
|
|
2273
|
+
}
|
|
2274
|
+
interface AthenaStorageFolderNamespace {
|
|
2275
|
+
list(input: ListStorageFoldersRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2276
|
+
tree(input: TreeStorageFoldersRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2277
|
+
delete(input: DeleteStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2278
|
+
move(input: MoveStorageFolderRequest, options?: AthenaStorageCallOptions): Promise<StorageFolderMutationResponse>;
|
|
2279
|
+
}
|
|
2280
|
+
interface AthenaStoragePermissionNamespace {
|
|
2281
|
+
list(input: StoragePermissionListRequest, options?: AthenaStorageCallOptions): Promise<StoragePermissionListResponse>;
|
|
2282
|
+
grant(input: StoragePermissionGrantRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2283
|
+
revoke(input: StoragePermissionRevokeRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2284
|
+
check(input: StoragePermissionCheckRequest, options?: AthenaStorageCallOptions): Promise<StoragePermissionCheckResponse>;
|
|
2285
|
+
}
|
|
2286
|
+
interface AthenaStorageObjectFolderNamespace {
|
|
2287
|
+
create(input: StorageObjectFolderCreateRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2288
|
+
delete(input: StorageObjectFolderDeleteRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2289
|
+
rename(input: StorageObjectFolderRenameRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2290
|
+
}
|
|
2291
|
+
interface AthenaStorageObjectNamespace {
|
|
2292
|
+
list(input: StorageListObjectsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2293
|
+
head(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2294
|
+
exists(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2295
|
+
validate(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2296
|
+
update(input: StorageUpdateObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2297
|
+
copy(input: StorageObjectCopyRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2298
|
+
url(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2299
|
+
publicUrl(input: StorageObjectPublicUrlRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2300
|
+
delete(input: StorageObjectRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2301
|
+
uploadUrl(input: StoragePresignUploadRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2302
|
+
folder: AthenaStorageObjectFolderNamespace;
|
|
2303
|
+
}
|
|
2304
|
+
interface AthenaStorageBucketCorsNamespace {
|
|
2305
|
+
get(input: StorageBucketCorsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2306
|
+
set(input: StorageSetBucketCorsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2307
|
+
delete(input: StorageBucketCorsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2308
|
+
}
|
|
2309
|
+
interface AthenaStorageBucketNamespace {
|
|
2310
|
+
list(input: Omit<StorageObjectBaseRequest, 'bucket'>, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2311
|
+
create(input: StorageObjectBaseRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2312
|
+
delete(input: StorageObjectBaseRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2313
|
+
cors: AthenaStorageBucketCorsNamespace;
|
|
2314
|
+
}
|
|
2315
|
+
interface AthenaStorageMultipartNamespace {
|
|
2316
|
+
create(input: StorageMultipartCreateRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2317
|
+
signPart(input: StorageMultipartSignPartRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2318
|
+
complete(input: StorageMultipartCompleteRequest, options?: AthenaStorageCallOptions): Promise<StorageFileMutationResponse>;
|
|
2319
|
+
abort(input: StorageMultipartAbortRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2320
|
+
listParts(input: StorageMultipartListPartsRequest, options?: AthenaStorageCallOptions): Promise<Record<string, unknown>>;
|
|
2321
|
+
}
|
|
2322
|
+
interface AthenaStorageAuditNamespace {
|
|
2323
|
+
list(input: StorageAuditQueryRequest, options?: AthenaStorageCallOptions): Promise<StorageAuditListResponse>;
|
|
2324
|
+
}
|
|
2325
|
+
interface AthenaStorageModule extends AthenaStorageBaseModule {
|
|
2326
|
+
credentials: AthenaStorageCredentialsNamespace;
|
|
2327
|
+
catalog: AthenaStorageCatalogNamespace;
|
|
2328
|
+
file: AthenaStorageFileNamespace;
|
|
2329
|
+
folder: AthenaStorageFolderNamespace;
|
|
2330
|
+
permission: AthenaStoragePermissionNamespace;
|
|
2331
|
+
object: AthenaStorageObjectNamespace;
|
|
2332
|
+
bucket: AthenaStorageBucketNamespace;
|
|
2333
|
+
multipart: AthenaStorageMultipartNamespace;
|
|
2334
|
+
audit: AthenaStorageAuditNamespace;
|
|
2335
|
+
delete: AthenaStorageFileModule['delete'];
|
|
2336
|
+
}
|
|
2337
|
+
declare function createAthenaStorageError(input: AthenaStorageErrorInput): AthenaStorageError;
|
|
2338
|
+
|
|
2339
|
+
type AthenaRowShape$1 = Record<string, AthenaJsonValue | undefined>;
|
|
2340
|
+
type FilterColumnKey$1<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
2341
|
+
type ResolvedFilterColumnKey$1<Row> = [FilterColumnKey$1<Row>] extends [never] ? string : FilterColumnKey$1<Row>;
|
|
2342
|
+
type AthenaFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'contains' | 'containedBy';
|
|
2343
|
+
type AthenaWherePrimitive = AthenaConditionValue;
|
|
2344
|
+
type AthenaWhereOperatorInput = {
|
|
2345
|
+
eq?: AthenaConditionValue;
|
|
2346
|
+
neq?: AthenaConditionValue;
|
|
2347
|
+
gt?: AthenaConditionValue;
|
|
2348
|
+
gte?: AthenaConditionValue;
|
|
2349
|
+
lt?: AthenaConditionValue;
|
|
2350
|
+
lte?: AthenaConditionValue;
|
|
2351
|
+
like?: AthenaConditionValue;
|
|
2352
|
+
ilike?: AthenaConditionValue;
|
|
2353
|
+
is?: AthenaConditionValue;
|
|
2354
|
+
in?: AthenaConditionArrayValue;
|
|
2355
|
+
contains?: AthenaConditionArrayValue;
|
|
2356
|
+
containedBy?: AthenaConditionArrayValue;
|
|
2357
|
+
};
|
|
2358
|
+
type AthenaWhereColumnInput<Row = AthenaRowShape$1> = Partial<Record<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereOperatorInput>>;
|
|
2359
|
+
type AthenaBooleanSafeOperator = Exclude<AthenaFilterOperator, 'in' | 'contains' | 'containedBy'>;
|
|
2360
|
+
type AthenaWhereBooleanSafeOperatorInput = Partial<Record<AthenaBooleanSafeOperator, AthenaConditionValue>>;
|
|
2361
|
+
type AthenaWhereBooleanNotOperatorInput = {
|
|
2362
|
+
[K in AthenaBooleanSafeOperator]: {
|
|
2363
|
+
[P in K]: AthenaConditionValue;
|
|
2364
|
+
} & Partial<Record<Exclude<AthenaBooleanSafeOperator, K>, never>>;
|
|
2365
|
+
}[AthenaBooleanSafeOperator];
|
|
2366
|
+
type AthenaStrictBooleanOperand<Keys extends string, Value> = {
|
|
2367
|
+
[K in Keys]: {
|
|
2368
|
+
[P in K]: Value;
|
|
2369
|
+
} & Partial<Record<Exclude<Keys, K>, never>>;
|
|
2370
|
+
}[Keys];
|
|
2371
|
+
type AthenaNonEmptyArray<T> = [T, ...T[]];
|
|
2372
|
+
type AthenaWhereBooleanOperand<Row = AthenaRowShape$1> = string extends ResolvedFilterColumnKey$1<Row> ? AthenaWhereColumnInput<Row> : AthenaStrictBooleanOperand<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereBooleanSafeOperatorInput>;
|
|
2373
|
+
type AthenaWhereNotOperand<Row = AthenaRowShape$1> = string extends ResolvedFilterColumnKey$1<Row> ? AthenaWhereColumnInput<Row> : AthenaStrictBooleanOperand<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereBooleanNotOperatorInput>;
|
|
2374
|
+
type AthenaWhere<Row = AthenaRowShape$1> = AthenaWhereColumnInput<Row> & {
|
|
2375
|
+
or?: string extends ResolvedFilterColumnKey$1<Row> ? Array<AthenaWhereColumnInput<Row>> : AthenaNonEmptyArray<AthenaWhereBooleanOperand<Row>>;
|
|
2376
|
+
not?: AthenaWhereNotOperand<Row>;
|
|
2377
|
+
};
|
|
2378
|
+
interface AthenaRelationSelectNode<TSelect extends AthenaSelectShape = AthenaSelectShape> {
|
|
2379
|
+
select: TSelect;
|
|
2380
|
+
as?: string;
|
|
2381
|
+
via?: string;
|
|
2382
|
+
schema?: string;
|
|
2383
|
+
}
|
|
2384
|
+
type AthenaSelectShape = Record<string, true | AthenaRelationSelectNode<AthenaSelectShape>>;
|
|
2385
|
+
type AthenaAllowedRelationSelectNodeKey = 'select' | 'as' | 'via' | 'schema';
|
|
2386
|
+
type AthenaValidatedRelationSelectNode<TNode> = TNode extends {
|
|
2387
|
+
select: infer TChild;
|
|
2388
|
+
} ? Exclude<keyof TNode, AthenaAllowedRelationSelectNodeKey> extends never ? TNode extends {
|
|
2389
|
+
schema: string;
|
|
2390
|
+
via: string;
|
|
2391
|
+
} ? never : TChild extends Record<string, unknown> ? {
|
|
2392
|
+
[K in keyof TNode]: K extends 'select' ? AthenaValidatedSelectShape<TChild> : K extends AthenaAllowedRelationSelectNodeKey ? TNode[K] : never;
|
|
2393
|
+
} : never : never : never;
|
|
2394
|
+
type AthenaValidatedSelectShape<TSelect> = {
|
|
2395
|
+
[K in keyof TSelect]: TSelect[K] extends true ? true : AthenaValidatedRelationSelectNode<TSelect[K]>;
|
|
2396
|
+
};
|
|
2397
|
+
type GenericRegistryDef = RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>;
|
|
2398
|
+
type AthenaOrderByDirectionInput = 'asc' | 'desc' | 'ascending' | 'descending' | boolean | {
|
|
2399
|
+
ascending?: boolean;
|
|
2400
|
+
};
|
|
2401
|
+
type AthenaOrderBy<Row = AthenaRowShape$1> = {
|
|
2402
|
+
column: ResolvedFilterColumnKey$1<Row>;
|
|
2403
|
+
ascending?: boolean;
|
|
2404
|
+
} | Partial<Record<ResolvedFilterColumnKey$1<Row>, AthenaOrderByDirectionInput>>;
|
|
2405
|
+
interface AthenaFindManyOptions<Row = AthenaRowShape$1, TSelect extends AthenaSelectShape = AthenaSelectShape> {
|
|
2406
|
+
select: TSelect;
|
|
2407
|
+
where?: AthenaWhere<Row>;
|
|
2408
|
+
orderBy?: AthenaOrderBy<Row>;
|
|
2409
|
+
limit?: number;
|
|
2410
|
+
}
|
|
2411
|
+
type AthenaModelContext<TRegistry extends GenericRegistryDef = GenericRegistryDef, TDatabase extends string = string, TSchema extends string = string, TModel extends AnyModelDef = AnyModelDef> = {
|
|
2412
|
+
registry: TRegistry;
|
|
2413
|
+
database: TDatabase;
|
|
2414
|
+
schema: TSchema;
|
|
2415
|
+
model: TModel;
|
|
2416
|
+
};
|
|
2417
|
+
type Simplify<T> = {
|
|
2418
|
+
[K in keyof T]: T[K];
|
|
2419
|
+
} & {};
|
|
2420
|
+
type ContextRegistry<TContext> = TContext extends AthenaModelContext<infer TRegistry, string, string, AnyModelDef> ? TRegistry : never;
|
|
2421
|
+
type ContextDatabase<TContext> = TContext extends AthenaModelContext<GenericRegistryDef, infer TDatabase, string, AnyModelDef> ? TDatabase : never;
|
|
2422
|
+
type ContextModel<TContext> = TContext extends AthenaModelContext<GenericRegistryDef, string, string, infer TModel> ? TModel : never;
|
|
2423
|
+
type ModelMetaOf<TContext> = ContextModel<TContext> extends ModelDef<unknown, unknown, unknown, infer TMeta> ? TMeta : never;
|
|
2424
|
+
type ModelRelationsOf<TContext> = NonNullable<ModelMetaOf<TContext>['relations']>;
|
|
2425
|
+
type SelectedResultKey<TKey extends string, TValue> = TValue extends {
|
|
2426
|
+
as: infer TAlias extends string;
|
|
2427
|
+
} ? TAlias : TKey;
|
|
2428
|
+
type ScalarSelectionResult<Row, TSelect extends AthenaSelectShape> = {
|
|
2429
|
+
[TKey in Extract<keyof TSelect, string> as TSelect[TKey] extends true ? TKey : never]-?: TKey extends keyof NonNullable<Row> ? NonNullable<Row>[TKey] : unknown;
|
|
2430
|
+
};
|
|
2431
|
+
type RelationByKey<TContext, TKey extends string> = TKey extends keyof ModelRelationsOf<TContext> ? ModelRelationsOf<TContext>[TKey] : never;
|
|
2432
|
+
type RelationByVia<TContext, TVia extends string> = {
|
|
2433
|
+
[TKey in keyof ModelRelationsOf<TContext>]: ModelRelationsOf<TContext>[TKey] extends infer TRelation ? TRelation extends ModelRelationMetadata ? TVia extends TRelation['sourceColumns'][number] ? TRelation : never : never : never;
|
|
2434
|
+
}[keyof ModelRelationsOf<TContext>];
|
|
2435
|
+
type ResolvedRelation<TContext, TKey extends string, TValue> = RelationByKey<TContext, TKey> extends never ? TValue extends {
|
|
2436
|
+
via: infer TVia extends string;
|
|
2437
|
+
} ? RelationByVia<TContext, TVia> : never : RelationByKey<TContext, TKey>;
|
|
2438
|
+
type TargetDatabaseName<TContext, TRelation extends ModelRelationMetadata> = TRelation['targetDatabase'] extends string ? TRelation['targetDatabase'] : ContextDatabase<TContext>;
|
|
2439
|
+
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;
|
|
2440
|
+
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;
|
|
2441
|
+
type RelationSelectionResult<TContext, TSelect extends AthenaSelectShape> = {
|
|
2442
|
+
[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;
|
|
2443
|
+
};
|
|
2444
|
+
type AthenaFindManyResult<Row, TSelect extends AthenaSelectShape, TContext = unknown> = Simplify<ScalarSelectionResult<Row, TSelect> & RelationSelectionResult<TContext, TSelect>>;
|
|
2445
|
+
|
|
2446
|
+
type AthenaFindManyAstPayload<Row, TSelect extends AthenaSelectShape> = {
|
|
2447
|
+
table_name: string;
|
|
2448
|
+
select: TSelect;
|
|
2449
|
+
where?: AthenaWhere<Row>;
|
|
2450
|
+
orderBy?: AthenaOrderBy<Row>;
|
|
2451
|
+
limit?: number;
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2454
|
+
interface AthenaTableBuilderStateAst {
|
|
2455
|
+
conditions: AthenaGatewayCondition[];
|
|
2456
|
+
limit?: number;
|
|
2457
|
+
offset?: number;
|
|
2458
|
+
order?: AthenaSortBy;
|
|
2459
|
+
currentPage?: number;
|
|
2460
|
+
pageSize?: number;
|
|
2461
|
+
totalPages?: number;
|
|
2462
|
+
}
|
|
2463
|
+
interface AthenaRpcBuilderStateAst {
|
|
2464
|
+
filters: AthenaRpcFilter[];
|
|
2465
|
+
limit?: number;
|
|
2466
|
+
offset?: number;
|
|
2467
|
+
order?: {
|
|
2468
|
+
column: string;
|
|
2469
|
+
ascending?: boolean;
|
|
2470
|
+
};
|
|
2471
|
+
}
|
|
2472
|
+
interface AthenaDebugAstBase<TKind extends string> {
|
|
2473
|
+
version: 1;
|
|
2474
|
+
kind: TKind;
|
|
2475
|
+
}
|
|
2476
|
+
type AthenaSelectDebugTransport = {
|
|
2477
|
+
mode: 'compiled-fetch' | 'structured-fetch';
|
|
2478
|
+
endpoint: '/gateway/fetch';
|
|
2479
|
+
payload: AthenaFetchPayload;
|
|
2480
|
+
} | {
|
|
2481
|
+
mode: 'typed-query';
|
|
2482
|
+
endpoint: '/gateway/query';
|
|
2483
|
+
payload: {
|
|
2484
|
+
query: string;
|
|
2485
|
+
};
|
|
2486
|
+
};
|
|
2487
|
+
interface AthenaSelectDebugAst extends AthenaDebugAstBase<'select'> {
|
|
2488
|
+
tableName: string;
|
|
2489
|
+
input: {
|
|
2490
|
+
columns: string | string[];
|
|
2491
|
+
state: AthenaTableBuilderStateAst;
|
|
2492
|
+
};
|
|
2493
|
+
transport: AthenaSelectDebugTransport;
|
|
2494
|
+
}
|
|
2495
|
+
type AthenaFindManyDebugTransport<Row = Record<string, unknown>, TSelect extends AthenaSelectShape = AthenaSelectShape> = {
|
|
2496
|
+
mode: 'direct-ast-fetch';
|
|
2497
|
+
endpoint: '/gateway/fetch';
|
|
2498
|
+
payload: AthenaFindManyAstPayload<Row, TSelect>;
|
|
2499
|
+
} | {
|
|
2500
|
+
mode: 'compiled-fetch' | 'structured-fetch';
|
|
2501
|
+
endpoint: '/gateway/fetch';
|
|
2502
|
+
payload: AthenaFetchPayload;
|
|
2503
|
+
} | {
|
|
2504
|
+
mode: 'compiled-query';
|
|
2505
|
+
endpoint: '/gateway/query';
|
|
2506
|
+
payload: {
|
|
2507
|
+
query: string;
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
interface AthenaFindManyDebugAst<Row = Record<string, unknown>, TSelect extends AthenaSelectShape = AthenaSelectShape> extends AthenaDebugAstBase<'findMany'> {
|
|
2511
|
+
tableName: string;
|
|
2512
|
+
input: {
|
|
2513
|
+
select: AthenaValidatedSelectShape<TSelect>;
|
|
2514
|
+
where?: AthenaWhere<Row>;
|
|
2515
|
+
orderBy?: AthenaOrderBy<Row>;
|
|
2516
|
+
limit?: number;
|
|
2517
|
+
};
|
|
2518
|
+
compiled: {
|
|
2519
|
+
columns: string;
|
|
2520
|
+
baseState: AthenaTableBuilderStateAst;
|
|
2521
|
+
executionState: AthenaTableBuilderStateAst;
|
|
2522
|
+
};
|
|
2523
|
+
transport: AthenaFindManyDebugTransport<Row, TSelect>;
|
|
2524
|
+
}
|
|
2525
|
+
interface AthenaInsertDebugAst extends AthenaDebugAstBase<'insert'> {
|
|
2526
|
+
tableName: string;
|
|
2527
|
+
input: {
|
|
2528
|
+
values: AthenaInsertPayload['insert_body'];
|
|
2529
|
+
returning?: AthenaInsertPayload['columns'];
|
|
2530
|
+
count?: AthenaInsertPayload['count'];
|
|
2531
|
+
head?: boolean;
|
|
2532
|
+
defaultToNull?: boolean;
|
|
2533
|
+
};
|
|
2534
|
+
transport: {
|
|
2535
|
+
mode: 'insert';
|
|
2536
|
+
endpoint: '/gateway/insert';
|
|
2537
|
+
payload: AthenaInsertPayload;
|
|
2538
|
+
};
|
|
2539
|
+
}
|
|
2540
|
+
interface AthenaUpsertDebugAst extends AthenaDebugAstBase<'upsert'> {
|
|
2541
|
+
tableName: string;
|
|
2542
|
+
input: {
|
|
2543
|
+
values: AthenaInsertPayload['insert_body'];
|
|
2544
|
+
updateBody?: AthenaInsertPayload['update_body'];
|
|
2545
|
+
onConflict?: AthenaInsertPayload['on_conflict'];
|
|
2546
|
+
returning?: AthenaInsertPayload['columns'];
|
|
2547
|
+
count?: AthenaInsertPayload['count'];
|
|
2548
|
+
head?: boolean;
|
|
2549
|
+
defaultToNull?: boolean;
|
|
2550
|
+
};
|
|
2551
|
+
transport: {
|
|
2552
|
+
mode: 'upsert';
|
|
2553
|
+
endpoint: '/gateway/insert';
|
|
2554
|
+
payload: AthenaInsertPayload;
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
interface AthenaUpdateDebugAst extends AthenaDebugAstBase<'update'> {
|
|
2558
|
+
tableName: string;
|
|
2559
|
+
input: {
|
|
2560
|
+
values: AthenaUpdatePayload['set'];
|
|
2561
|
+
state: AthenaTableBuilderStateAst;
|
|
2562
|
+
returning?: AthenaUpdatePayload['columns'];
|
|
2563
|
+
};
|
|
2564
|
+
transport: {
|
|
2565
|
+
mode: 'update';
|
|
2566
|
+
endpoint: '/gateway/update';
|
|
2567
|
+
payload: AthenaUpdatePayload;
|
|
2568
|
+
};
|
|
2569
|
+
}
|
|
2570
|
+
interface AthenaDeleteDebugAst extends AthenaDebugAstBase<'delete'> {
|
|
2571
|
+
tableName: string;
|
|
2572
|
+
input: {
|
|
2573
|
+
resourceId?: AthenaDeletePayload['resource_id'];
|
|
2574
|
+
state: AthenaTableBuilderStateAst;
|
|
2575
|
+
returning?: AthenaDeletePayload['columns'];
|
|
2576
|
+
};
|
|
2577
|
+
transport: {
|
|
2578
|
+
mode: 'delete';
|
|
2579
|
+
endpoint: '/gateway/delete';
|
|
2580
|
+
payload: AthenaDeletePayload;
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
interface AthenaRpcDebugAst extends AthenaDebugAstBase<'rpc'> {
|
|
2584
|
+
functionName: string;
|
|
2585
|
+
input: {
|
|
2586
|
+
args?: AthenaJsonObject;
|
|
2587
|
+
select?: string | string[];
|
|
2588
|
+
state: AthenaRpcBuilderStateAst;
|
|
2589
|
+
};
|
|
2590
|
+
transport: {
|
|
2591
|
+
mode: 'rpc-post' | 'rpc-get';
|
|
2592
|
+
endpoint: '/gateway/rpc' | `/rpc/${string}`;
|
|
2593
|
+
payload: AthenaRpcPayload;
|
|
2594
|
+
};
|
|
2595
|
+
}
|
|
2596
|
+
interface AthenaRawQueryDebugAst extends AthenaDebugAstBase<'query'> {
|
|
2597
|
+
input: {
|
|
2598
|
+
query: string;
|
|
2599
|
+
};
|
|
2600
|
+
transport: {
|
|
2601
|
+
mode: 'raw-query';
|
|
2602
|
+
endpoint: '/gateway/query';
|
|
2603
|
+
payload: {
|
|
2604
|
+
query: string;
|
|
2605
|
+
};
|
|
2606
|
+
};
|
|
2607
|
+
}
|
|
2608
|
+
type AthenaQueryDebugAst = AthenaSelectDebugAst | AthenaFindManyDebugAst | AthenaInsertDebugAst | AthenaUpsertDebugAst | AthenaUpdateDebugAst | AthenaDeleteDebugAst | AthenaRpcDebugAst | AthenaRawQueryDebugAst;
|
|
2609
|
+
declare function getAthenaDebugAst(value: unknown): AthenaQueryDebugAst | null;
|
|
2610
|
+
|
|
2611
|
+
interface AthenaResult<T> {
|
|
2612
|
+
data: T | null;
|
|
2613
|
+
error: AthenaResultError | null;
|
|
2614
|
+
statusText?: string | null;
|
|
2615
|
+
/**
|
|
2616
|
+
* @deprecated Prefer `error?.gatewayCode`, `error?.hint`, and related fields on `error`.
|
|
2617
|
+
*/
|
|
2618
|
+
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
2619
|
+
status: number;
|
|
2620
|
+
count?: number | null;
|
|
2621
|
+
raw: unknown;
|
|
2622
|
+
}
|
|
2623
|
+
interface AthenaResultError {
|
|
2624
|
+
message: string;
|
|
2625
|
+
code: string | null;
|
|
2626
|
+
athenaCode: NormalizedAthenaError['code'];
|
|
2627
|
+
gatewayCode?: AthenaGatewayErrorDetails['code'] | null;
|
|
2628
|
+
kind: NormalizedAthenaError['kind'];
|
|
2629
|
+
category: NormalizedAthenaError['category'];
|
|
2630
|
+
retryable: boolean;
|
|
2631
|
+
details: unknown | null;
|
|
2632
|
+
hint: string | null;
|
|
2633
|
+
status: number;
|
|
2634
|
+
statusText: string | null;
|
|
2635
|
+
constraint?: string;
|
|
2636
|
+
table?: string;
|
|
2637
|
+
operation?: string;
|
|
2638
|
+
endpoint?: AthenaGatewayErrorDetails['endpoint'];
|
|
2639
|
+
method?: AthenaGatewayErrorDetails['method'];
|
|
2640
|
+
requestId?: string;
|
|
2641
|
+
cause?: string;
|
|
2642
|
+
raw: unknown;
|
|
2643
|
+
}
|
|
2644
|
+
interface AthenaClientExperimentalOptions {
|
|
2645
|
+
/**
|
|
2646
|
+
* @deprecated Failed `AthenaResult` values now include normalized structured `error`
|
|
2647
|
+
* envelopes by default. This flag is retained as a no-op compatibility switch.
|
|
2648
|
+
*/
|
|
2649
|
+
enableErrorNormalization?: boolean;
|
|
2650
|
+
/**
|
|
2651
|
+
* Retry retryable read failures (`select`, `findMany`, `query`) with a fixed internal policy.
|
|
2652
|
+
*
|
|
2653
|
+
* Applies two additional attempts with exponential backoff and jitter.
|
|
2654
|
+
*/
|
|
2655
|
+
retryReads?: boolean;
|
|
2656
|
+
/**
|
|
2657
|
+
* Emit execution diagnostics for every query/mutation/RPC invocation.
|
|
2658
|
+
* Includes payload, synthesized SQL, full outcome, and best-effort callsite metadata.
|
|
2659
|
+
*/
|
|
2660
|
+
traceQueries?: boolean | AthenaQueryTraceOptions;
|
|
2661
|
+
/**
|
|
2662
|
+
* Build and attach a normalized operation AST for runtime debugging.
|
|
2663
|
+
*
|
|
2664
|
+
* When enabled, successful Athena results expose a non-enumerable debug AST
|
|
2665
|
+
* that can be read with `getAthenaDebugAst(...)`. If tracing is also enabled,
|
|
2666
|
+
* the same AST is included on emitted trace events.
|
|
2667
|
+
*/
|
|
2668
|
+
debugAst?: boolean;
|
|
2669
|
+
/**
|
|
2670
|
+
* Compile-time opt-in for validating simple `select(...)`, `order(...)`, and
|
|
2671
|
+
* RPC filter column names against known row keys.
|
|
2672
|
+
*
|
|
2673
|
+
* This flag is type-only. It does not change runtime request behavior.
|
|
2674
|
+
*/
|
|
2675
|
+
typecheckColumns?: boolean;
|
|
2676
|
+
/**
|
|
2677
|
+
* Send the original `findMany(...)` AST body for clean object-select reads.
|
|
2678
|
+
* This requires gateway support and falls back to legacy compiled transport
|
|
2679
|
+
* when a chain carries filter/pagination state that the AST payload cannot
|
|
2680
|
+
* represent losslessly yet.
|
|
2681
|
+
*/
|
|
2682
|
+
findManyAst?: boolean;
|
|
2683
|
+
/**
|
|
2684
|
+
* Expose the experimental `client.storage.*` bindings for Athena storage APIs.
|
|
2685
|
+
*/
|
|
2686
|
+
athenaStorageBackend?: boolean;
|
|
2687
|
+
/**
|
|
2688
|
+
* Optional storage SDK runtime hooks. Only used when `athenaStorageBackend` is enabled.
|
|
2689
|
+
*/
|
|
2690
|
+
storage?: AthenaStorageClientConfig;
|
|
2691
|
+
}
|
|
2692
|
+
interface AthenaQueryTraceOptions {
|
|
2693
|
+
/**
|
|
2694
|
+
* Custom sink for trace events. Defaults to console.info.
|
|
2695
|
+
*/
|
|
2696
|
+
logger?: (event: AthenaQueryTraceEvent) => void;
|
|
2697
|
+
}
|
|
2698
|
+
interface AthenaQueryTraceCallsite {
|
|
2699
|
+
filePath: string;
|
|
2700
|
+
fileName: string;
|
|
2701
|
+
line: number;
|
|
2702
|
+
column: number;
|
|
2703
|
+
frame?: string;
|
|
2704
|
+
functionName?: string;
|
|
2705
|
+
}
|
|
2706
|
+
interface AthenaQueryTraceEvent {
|
|
2707
|
+
timestamp: string;
|
|
2708
|
+
durationMs: number;
|
|
2709
|
+
operation: 'select' | 'insert' | 'upsert' | 'update' | 'delete' | 'rpc' | 'query';
|
|
2710
|
+
endpoint: '/gateway/fetch' | '/gateway/insert' | '/gateway/update' | '/gateway/delete' | '/gateway/rpc' | '/gateway/query' | `/rpc/${string}`;
|
|
2711
|
+
table?: string;
|
|
2712
|
+
functionName?: string;
|
|
2713
|
+
sql: string;
|
|
2714
|
+
payload: unknown;
|
|
2715
|
+
ast?: AthenaQueryDebugAst;
|
|
2716
|
+
options?: AthenaGatewayCallOptions | AthenaRpcCallOptions;
|
|
2717
|
+
callsite: AthenaQueryTraceCallsite | null;
|
|
2718
|
+
outcome?: {
|
|
2719
|
+
status: number;
|
|
2720
|
+
error: AthenaResultError | null;
|
|
2721
|
+
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
2722
|
+
count?: number | null;
|
|
2723
|
+
data: unknown;
|
|
2724
|
+
raw: unknown;
|
|
2725
|
+
};
|
|
2726
|
+
thrownError?: unknown;
|
|
2727
|
+
}
|
|
2728
|
+
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
2729
|
+
type MutationResultRow<Result> = Result extends Array<infer Item> ? Item : Result;
|
|
2730
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
2731
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
2732
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
2733
|
+
type SelectColumnsFor<Row, TStrict extends boolean, TValue extends AthenaSelectInput> = TStrict extends true ? AthenaValidatedSelectInput<Row, TValue> : TValue;
|
|
2734
|
+
interface MutationQuery<Result, Row = MutationResultRow<Result>, TStrict extends boolean = false> extends PromiseLike<AthenaResult<Result>> {
|
|
2735
|
+
select<const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
2736
|
+
returning<const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
2737
|
+
single<const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
2738
|
+
maybeSingle<const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
2739
|
+
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>;
|
|
2740
|
+
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | undefined | null): Promise<AthenaResult<Result> | TResult>;
|
|
2741
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<AthenaResult<Result>>;
|
|
2742
|
+
}
|
|
2743
|
+
interface OrderOptions {
|
|
2744
|
+
ascending?: boolean;
|
|
2745
|
+
}
|
|
2746
|
+
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
2747
|
+
interface FilterChain<Self, Row> {
|
|
2748
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2749
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
2750
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
2751
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
2752
|
+
range(from: number, to: number): Self;
|
|
2753
|
+
limit(count: number): Self;
|
|
2754
|
+
offset(count: number): Self;
|
|
2755
|
+
currentPage(value: number): Self;
|
|
2756
|
+
pageSize(value: number): Self;
|
|
2757
|
+
totalPages(value: number): Self;
|
|
2758
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
2759
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2760
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2761
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2762
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2763
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2764
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2765
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2766
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
2767
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
2768
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
2769
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
2770
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
2771
|
+
or(expression: string): Self;
|
|
2772
|
+
}
|
|
2773
|
+
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
2774
|
+
interface SelectChain<Row, SelectedRow = Row, TStrict extends boolean = false> extends FilterChain<SelectChain<Row, SelectedRow, TStrict>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
2775
|
+
single<T = SelectedRow, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2776
|
+
maybeSingle<T = SelectedRow, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2777
|
+
}
|
|
2778
|
+
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
2779
|
+
interface UpdateChain<Row, TStrict extends boolean = false> extends FilterChain<UpdateChain<Row, TStrict>, Row>, MutationQuery<Row[], Row, TStrict> {
|
|
2780
|
+
}
|
|
2781
|
+
interface RpcFilterChain<Self, Row, TStrict extends boolean = false> {
|
|
2782
|
+
eq(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2783
|
+
neq(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2784
|
+
gt(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2785
|
+
gte(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2786
|
+
lt(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2787
|
+
lte(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2788
|
+
like(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2789
|
+
ilike(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2790
|
+
is(column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue): Self;
|
|
2791
|
+
in(column: AthenaTypecheckedColumnKey<Row, TStrict>, values: AthenaConditionArrayValue): Self;
|
|
2792
|
+
}
|
|
2793
|
+
interface RpcOrderOptions {
|
|
2794
|
+
ascending?: boolean;
|
|
2795
|
+
}
|
|
2796
|
+
interface RpcQueryBuilder<Row, TStrict extends boolean = false> extends RpcFilterChain<RpcQueryBuilder<Row, TStrict>, Row, TStrict>, PromiseLike<AthenaResult<Row[]>> {
|
|
2797
|
+
select<const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaRpcCallOptions): Promise<AthenaResult<Row[]>>;
|
|
2798
|
+
single<T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
2799
|
+
maybeSingle<T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
2800
|
+
order(column: AthenaTypecheckedColumnKey<Row, TStrict>, options?: RpcOrderOptions): RpcQueryBuilder<Row, TStrict>;
|
|
2801
|
+
limit(count: number): RpcQueryBuilder<Row, TStrict>;
|
|
2802
|
+
offset(count: number): RpcQueryBuilder<Row, TStrict>;
|
|
2803
|
+
range(from: number, to: number): RpcQueryBuilder<Row, TStrict>;
|
|
2804
|
+
}
|
|
2805
|
+
interface AthenaFromOptions {
|
|
2806
|
+
schema?: string;
|
|
2807
|
+
}
|
|
2808
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>, TContext = unknown, TStrict extends boolean = false> extends FilterChain<TableQueryBuilder<Row, Insert, Update, TContext, TStrict>, Row> {
|
|
2809
|
+
select<T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): SelectChain<Row, T, TStrict>;
|
|
2810
|
+
findMany<const TSelect extends AthenaSelectShape>(options: AthenaFindManyOptions<Row, TSelect> & {
|
|
2811
|
+
select: AthenaValidatedSelectShape<TSelect>;
|
|
2812
|
+
}): Promise<AthenaResult<Array<AthenaFindManyResult<Row, TSelect, TContext>>>>;
|
|
2813
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row, Row, TStrict>;
|
|
2814
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[], Row, TStrict>;
|
|
2815
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
2816
|
+
updateBody?: Update;
|
|
2817
|
+
onConflict?: string | string[];
|
|
2818
|
+
}): MutationQuery<Row, Row, TStrict>;
|
|
2819
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
2820
|
+
updateBody?: Update;
|
|
2821
|
+
onConflict?: string | string[];
|
|
2822
|
+
}): MutationQuery<Row[], Row, TStrict>;
|
|
2823
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row, TStrict>;
|
|
2824
|
+
delete(options?: AthenaGatewayCallOptions & {
|
|
2825
|
+
resourceId?: string;
|
|
2826
|
+
}): MutationQuery<Row | null, Row, TStrict>;
|
|
2827
|
+
single<T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2828
|
+
maybeSingle<T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
2829
|
+
reset(): TableQueryBuilder<Row, Insert, Update, TContext, TStrict>;
|
|
2830
|
+
}
|
|
2831
|
+
interface AthenaSdkClient<TStrict extends boolean = false> {
|
|
2832
|
+
from<TModel extends AthenaModelTarget>(model: TModel): TableQueryBuilder<RowOf<TModel>, InsertOf<TModel>, UpdateOf<TModel>, unknown, TStrict>;
|
|
2833
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update, unknown, TStrict>;
|
|
2834
|
+
db: AthenaDbModule<TStrict>;
|
|
2835
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row, TStrict>;
|
|
2836
|
+
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
2837
|
+
verifyConnection(options?: AthenaGatewayConnectionOptions): Promise<AthenaGatewayConnectionResult>;
|
|
2838
|
+
}
|
|
2839
|
+
interface AthenaSdkClientWithAuth<TStrict extends boolean = false> extends AthenaSdkClient<TStrict> {
|
|
2840
|
+
auth: AthenaAuthBindings;
|
|
2841
|
+
}
|
|
2842
|
+
interface AthenaSdkClientWithStorage<TStrict extends boolean = false> extends AthenaSdkClientWithAuth<TStrict> {
|
|
2843
|
+
storage: AthenaStorageModule;
|
|
2844
|
+
}
|
|
2845
|
+
interface AthenaCreateClientServiceUrlConfig {
|
|
2846
|
+
url?: string | null;
|
|
2847
|
+
}
|
|
2848
|
+
interface AthenaCreateClientAuthOptions extends AthenaAuthClientConfig {
|
|
2849
|
+
url?: string | null;
|
|
2850
|
+
}
|
|
2851
|
+
interface AthenaCreateClientOptions extends Pick<AthenaGatewayCallOptions, 'client' | 'headers' | 'backend'> {
|
|
2852
|
+
db?: AthenaCreateClientServiceUrlConfig;
|
|
2853
|
+
gateway?: AthenaCreateClientServiceUrlConfig;
|
|
2854
|
+
auth?: AthenaCreateClientAuthOptions;
|
|
2855
|
+
storage?: AthenaCreateClientServiceUrlConfig;
|
|
2856
|
+
dbUrl?: string | null;
|
|
2857
|
+
gatewayUrl?: string | null;
|
|
2858
|
+
authUrl?: string | null;
|
|
2859
|
+
storageUrl?: string | null;
|
|
2860
|
+
experimental?: AthenaClientExperimentalOptions;
|
|
2861
|
+
}
|
|
2862
|
+
interface AthenaCreateClientOptionsWithStorage extends AthenaCreateClientOptions {
|
|
2863
|
+
experimental: AthenaClientExperimentalOptions & {
|
|
2864
|
+
athenaStorageBackend: true;
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
interface AthenaCreateClientOptionsWithTypecheckedColumns extends AthenaCreateClientOptions {
|
|
2868
|
+
experimental: AthenaClientExperimentalOptions & {
|
|
2869
|
+
typecheckColumns: true;
|
|
2870
|
+
};
|
|
2871
|
+
}
|
|
2872
|
+
interface AthenaCreateClientOptionsWithStorageAndTypecheckedColumns extends AthenaCreateClientOptions {
|
|
2873
|
+
experimental: AthenaClientExperimentalOptions & {
|
|
2874
|
+
athenaStorageBackend: true;
|
|
2875
|
+
typecheckColumns: true;
|
|
2876
|
+
};
|
|
2877
|
+
}
|
|
2878
|
+
interface AthenaCreateClientConfig extends AthenaCreateClientOptions {
|
|
2879
|
+
url?: string | null;
|
|
2880
|
+
key: string;
|
|
2881
|
+
}
|
|
2882
|
+
interface AthenaCreateClientConfigWithStorage extends AthenaCreateClientOptionsWithStorage {
|
|
2883
|
+
url?: string | null;
|
|
2884
|
+
key: string;
|
|
2885
|
+
}
|
|
2886
|
+
interface AthenaCreateClientConfigWithTypecheckedColumns extends AthenaCreateClientOptionsWithTypecheckedColumns {
|
|
2887
|
+
url?: string | null;
|
|
2888
|
+
key: string;
|
|
2889
|
+
}
|
|
2890
|
+
interface AthenaCreateClientConfigWithStorageAndTypecheckedColumns extends AthenaCreateClientOptionsWithStorageAndTypecheckedColumns {
|
|
2891
|
+
url?: string | null;
|
|
2892
|
+
key: string;
|
|
2893
|
+
}
|
|
2894
|
+
interface AthenaClientBuilder<StorageEnabled extends boolean = false, TStrict extends boolean = false> {
|
|
2895
|
+
/** Set the public Athena base URL. */
|
|
2896
|
+
url(url: string): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2897
|
+
/** Set the API key used for all requests. */
|
|
2898
|
+
key(apiKey: string): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2899
|
+
/** Set the default backend routing strategy. */
|
|
2900
|
+
backend(backend: BackendConfig | BackendType): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2901
|
+
/** Set the default Athena client routing key. */
|
|
2902
|
+
client(clientName: string): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2903
|
+
/** Attach static headers to every request. */
|
|
2904
|
+
headers(headers: Record<string, string>): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2905
|
+
/** Configure Athena Auth client behavior for `client.auth.*` methods. */
|
|
2906
|
+
auth(config: AthenaCreateClientAuthOptions): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2907
|
+
/** Configure experimental client options and narrow the built client when storage or strict column checks are enabled. */
|
|
2908
|
+
experimental(options: AthenaClientExperimentalOptions & {
|
|
2909
|
+
athenaStorageBackend: true;
|
|
2910
|
+
typecheckColumns: true;
|
|
2911
|
+
}): AthenaClientBuilder<true, true>;
|
|
2912
|
+
experimental(options: AthenaClientExperimentalOptions & {
|
|
2913
|
+
athenaStorageBackend: true;
|
|
2914
|
+
}): AthenaClientBuilder<true, TStrict>;
|
|
2915
|
+
experimental(options: AthenaClientExperimentalOptions & {
|
|
2916
|
+
typecheckColumns: true;
|
|
2917
|
+
}): AthenaClientBuilder<StorageEnabled, true>;
|
|
2918
|
+
experimental(options: AthenaClientExperimentalOptions): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2919
|
+
/** Apply createClient options and narrow the built client when storage is enabled. */
|
|
2920
|
+
options(options: AthenaCreateClientOptionsWithStorageAndTypecheckedColumns): AthenaClientBuilder<true, true>;
|
|
2921
|
+
options(options: AthenaCreateClientOptionsWithStorage): AthenaClientBuilder<true, TStrict>;
|
|
2922
|
+
options(options: AthenaCreateClientOptionsWithTypecheckedColumns): AthenaClientBuilder<StorageEnabled, true>;
|
|
2923
|
+
options(options: AthenaCreateClientOptions): AthenaClientBuilder<StorageEnabled, TStrict>;
|
|
2924
|
+
/** Build the immutable Athena SDK client. */
|
|
2925
|
+
build(): StorageEnabled extends true ? AthenaSdkClientWithStorage<TStrict> : AthenaSdkClientWithAuth<TStrict>;
|
|
2926
|
+
}
|
|
2927
|
+
/** Canonical Athena client factory with builder-based configuration. */
|
|
2928
|
+
declare class AthenaClient {
|
|
2929
|
+
/** Create a fluent builder for a strongly-typed Athena SDK client. */
|
|
2930
|
+
static builder(): AthenaClientBuilder<false, false>;
|
|
2931
|
+
/** Build a client from process environment variables. */
|
|
2932
|
+
static fromEnvironment(): AthenaSdkClientWithAuth<false>;
|
|
2933
|
+
}
|
|
2934
|
+
/** Create client (convenience wrapper; use AthenaClient.builder() for full control) */
|
|
2935
|
+
declare function createClient(config: AthenaCreateClientConfigWithStorageAndTypecheckedColumns): AthenaSdkClientWithStorage<true>;
|
|
2936
|
+
declare function createClient(config: AthenaCreateClientConfigWithStorage): AthenaSdkClientWithStorage<false>;
|
|
2937
|
+
declare function createClient(config: AthenaCreateClientConfigWithTypecheckedColumns): AthenaSdkClientWithAuth<true>;
|
|
2938
|
+
declare function createClient(config: AthenaCreateClientConfig): AthenaSdkClientWithAuth<false>;
|
|
2939
|
+
declare function createClient(url: string, apiKey: string, options: AthenaCreateClientOptionsWithStorageAndTypecheckedColumns): AthenaSdkClientWithStorage<true>;
|
|
2940
|
+
declare function createClient(url: string, apiKey: string, options: AthenaCreateClientOptionsWithStorage): AthenaSdkClientWithStorage<false>;
|
|
2941
|
+
declare function createClient(url: string, apiKey: string, options: AthenaCreateClientOptionsWithTypecheckedColumns): AthenaSdkClientWithAuth<true>;
|
|
2942
|
+
declare function createClient(url: string, apiKey: string, options?: AthenaCreateClientOptions): AthenaSdkClientWithAuth<false>;
|
|
2943
|
+
|
|
2944
|
+
interface AthenaGatewayErrorInput {
|
|
2945
|
+
code: AthenaGatewayErrorCode;
|
|
2946
|
+
message: string;
|
|
2947
|
+
status?: number;
|
|
2948
|
+
endpoint?: AthenaGatewayEndpointPath;
|
|
2949
|
+
method?: AthenaGatewayMethod;
|
|
2950
|
+
requestId?: string;
|
|
2951
|
+
hint?: string;
|
|
2952
|
+
cause?: string;
|
|
2953
|
+
}
|
|
2954
|
+
/**
|
|
2955
|
+
* Canonical error for gateway failures.
|
|
2956
|
+
* Holds request context and machine-readable classification.
|
|
2957
|
+
*/
|
|
2958
|
+
declare class AthenaGatewayError extends Error {
|
|
2959
|
+
readonly code: AthenaGatewayErrorCode;
|
|
2960
|
+
readonly status: number;
|
|
2961
|
+
readonly endpoint?: AthenaGatewayEndpointPath;
|
|
2962
|
+
readonly method?: AthenaGatewayMethod;
|
|
2963
|
+
readonly requestId?: string;
|
|
2964
|
+
readonly hint?: string;
|
|
2965
|
+
readonly causeDetail?: string;
|
|
2966
|
+
constructor(input: AthenaGatewayErrorInput);
|
|
2967
|
+
toDetails(): AthenaGatewayErrorDetails;
|
|
2968
|
+
static fromResponse<T>(response: AthenaGatewayResponse<T>, fallback: Omit<AthenaGatewayErrorInput, 'code' | 'message' | 'status'>): AthenaGatewayError;
|
|
2969
|
+
}
|
|
2970
|
+
declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
|
|
2971
|
+
|
|
2972
|
+
type ModelFormNullishMode = 'empty-string' | 'undefined' | 'null';
|
|
2973
|
+
type NullishValueByMode = {
|
|
2974
|
+
'empty-string': '';
|
|
2975
|
+
undefined: undefined;
|
|
2976
|
+
null: null;
|
|
2977
|
+
};
|
|
2978
|
+
type MapNullableToFormValue<TField, TMode extends ModelFormNullishMode> = null extends TField ? Exclude<TField, null> | NullishValueByMode[TMode] : TField;
|
|
2979
|
+
/**
|
|
2980
|
+
* Form value shape derived from a model insert payload.
|
|
2981
|
+
* Nullable fields are remapped to the selected nullish representation.
|
|
2982
|
+
*/
|
|
2983
|
+
type ModelFormValues<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = {
|
|
2984
|
+
[K in keyof InsertOf<TModel>]: MapNullableToFormValue<InsertOf<TModel>[K], TMode>;
|
|
2985
|
+
};
|
|
2986
|
+
/**
|
|
2987
|
+
* Alias for deriving form value types from any model contract.
|
|
2988
|
+
*/
|
|
2989
|
+
type FormValuesOf<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = ModelFormValues<TModel, TMode>;
|
|
2990
|
+
/**
|
|
2991
|
+
* Default value shape for form initialization.
|
|
2992
|
+
*/
|
|
2993
|
+
type ModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = Partial<ModelFormValues<TModel, TMode>>;
|
|
2994
|
+
interface ToModelFormDefaultsOptions<TMode extends ModelFormNullishMode = 'empty-string'> {
|
|
2995
|
+
/**
|
|
2996
|
+
* Controls how nullable model values are represented in form defaults.
|
|
2997
|
+
* - `empty-string` (default): `null -> ""`
|
|
2998
|
+
* - `undefined`: `null -> undefined`
|
|
2999
|
+
* - `null`: keeps `null`
|
|
3000
|
+
*/
|
|
3001
|
+
nullishMode?: TMode;
|
|
3002
|
+
}
|
|
3003
|
+
interface ToModelPayloadOptions {
|
|
3004
|
+
/**
|
|
3005
|
+
* Converts `""` into `null` for nullable model fields.
|
|
3006
|
+
* Defaults to `true`.
|
|
3007
|
+
*/
|
|
3008
|
+
emptyStringAsNull?: boolean;
|
|
3009
|
+
/**
|
|
3010
|
+
* Omits `undefined` keys from the outgoing payload.
|
|
3011
|
+
* Defaults to `true`.
|
|
3012
|
+
*/
|
|
3013
|
+
stripUndefined?: boolean;
|
|
3014
|
+
}
|
|
3015
|
+
/**
|
|
3016
|
+
* Normalizes model data into form-safe defaults using model nullability metadata.
|
|
3017
|
+
*/
|
|
3018
|
+
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>;
|
|
3019
|
+
/**
|
|
3020
|
+
* Normalizes form values back into model-compatible insert/update payloads.
|
|
3021
|
+
*/
|
|
3022
|
+
declare function toModelPayload<TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
3023
|
+
/**
|
|
3024
|
+
* Runtime form adapter bound to a model contract.
|
|
3025
|
+
*/
|
|
3026
|
+
interface ModelFormAdapter<TModel extends AnyModelDef> {
|
|
3027
|
+
model: TModel;
|
|
3028
|
+
toDefaults<TMode extends ModelFormNullishMode = 'empty-string'>(values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
3029
|
+
toInsert(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
3030
|
+
toUpdate(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<UpdateOf<TModel>>;
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Creates a small model-aware adapter for form defaults and payload normalization.
|
|
3034
|
+
*/
|
|
3035
|
+
declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
|
|
3036
|
+
|
|
3037
|
+
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 AthenaStorageFileConfig as a$, type AthenaCreateClientAuthOptions as a0, type AthenaCreateClientConfig as a1, type AthenaCreateClientConfigWithStorage as a2, type AthenaCreateClientConfigWithStorageAndTypecheckedColumns as a3, type AthenaCreateClientConfigWithTypecheckedColumns as a4, type AthenaCreateClientOptions as a5, type AthenaCreateClientOptionsWithStorage as a6, type AthenaCreateClientOptionsWithStorageAndTypecheckedColumns as a7, type AthenaCreateClientOptionsWithTypecheckedColumns as a8, type AthenaCreateClientServiceUrlConfig as a9, type AthenaQueryTraceCallsite as aA, type AthenaQueryTraceEvent as aB, type AthenaQueryTraceOptions as aC, type AthenaRawQueryDebugAst as aD, type AthenaRelationSelectNode as aE, type AthenaResetPasswordRequest as aF, type AthenaResult as aG, type AthenaResultError as aH, type AthenaRpcBuilderStateAst as aI, type AthenaRpcDebugAst as aJ, type AthenaSdkClient as aK, type AthenaSdkClientWithAuth as aL, type AthenaSdkClientWithStorage as aM, type AthenaSelectDebugAst as aN, type AthenaSelectDebugTransport as aO, type AthenaSelectShape as aP, type AthenaSendVerificationEmailRequest as aQ, type AthenaSocialSignInRequest as aR, type AthenaStorageBinaryCallOptions as aS, type AthenaStorageCallOptions as aT, type AthenaStorageClientConfig as aU, type AthenaStorageEnv as aV, AthenaStorageError as aW, AthenaStorageErrorCode as aX, type AthenaStorageErrorDetails as aY, type AthenaStorageErrorHandler as aZ, type AthenaStorageErrorInput as a_, type AthenaDbModule as aa, type AthenaDeleteDebugAst as ab, type AthenaDeleteUserCallbackRequest as ac, type AthenaDeleteUserRequest as ad, type AthenaDeleteUserResponse as ae, type AthenaEmailSignInRequest as af, type AthenaEmailSignUpRequest as ag, type AthenaEnvelope as ah, AthenaError as ai, AthenaErrorCategory as aj, AthenaErrorCode as ak, type AthenaErrorInput as al, AthenaErrorKind as am, type AthenaFindManyDebugAst as an, type AthenaFindManyOptions as ao, type AthenaFindManyResult as ap, type AthenaForgetPasswordRequest as aq, type AthenaFromOptions as ar, AthenaGatewayError as as, type AthenaInsertDebugAst as at, type AthenaLinkSocialRequest as au, type AthenaOAuthAccountTokenRequest as av, type AthenaOAuthTokenBundle as aw, type AthenaOperationContext as ax, type AthenaOrderBy as ay, type AthenaQueryDebugAst as az, type AthenaAdminListUsersSearchOperator as b, assertInt as b$, type AthenaStorageFileDeleteInput as b0, type AthenaStorageFileDownloadInput as b1, type AthenaStorageFileListInput as b2, type AthenaStorageFileModule as b3, type AthenaStorageFileUploadInput as b4, type AthenaStorageFileUploadResult as b5, type AthenaStorageModule as b6, type AthenaStoragePathContext as b7, type AthenaStoragePrefixPath as b8, type AthenaStorageTemplateValue as b9, type ModelFormDefaults as bA, type ModelFormNullishMode as bB, type ModelFormValues as bC, type MoveStorageFolderRequest as bD, type NormalizedAthenaError as bE, type PresignedFileUrlResponse as bF, type RequireAffectedOptions as bG, type RetryBackoffStrategy as bH, type RetryConfig as bI, type RpcOrderOptions as bJ, type RpcQueryBuilder as bK, type S3CatalogItem as bL, type S3CredentialListItem as bM, type SetStorageFileVisibilityRequest as bN, type StorageBatchUploadUrlResponse as bO, type StorageFileAccessPurpose as bP, type StorageFileMutationResponse as bQ, type StorageFolderMutationResponse as bR, type StorageListFilesResponse as bS, type StorageUploadUrlResponse as bT, type TableQueryBuilder as bU, type ToModelFormDefaultsOptions as bV, type ToModelPayloadOptions as bW, type UnwrapOneOptions as bX, type UnwrapOptions as bY, type UpdateStorageCatalogRequest as bZ, type UpdateStorageFileRequest as b_, type AthenaStorageTemplateVars as ba, type AthenaStorageUploadConstraints as bb, type AthenaStorageUploadProgress as bc, type AthenaStorageUploadProgressHandler as bd, type AthenaStorageUploadSource as be, type AthenaStorageUploadedFile as bf, type AthenaTableBuilderStateAst as bg, type AthenaUnlinkAccountRequest as bh, type AthenaUpdateDebugAst as bi, type AthenaUpdateUserRequest as bj, type AthenaUpsertDebugAst as bk, type AthenaUsernameSignInRequest as bl, type AthenaVerifyEmailRequest as bm, type AthenaWhere as bn, type AthenaWhereBooleanOperand as bo, type AthenaWhereOperatorInput as bp, type CreateStorageCatalogRequest as bq, type CreateStorageUploadUrlRequest as br, type CreateStorageUploadUrlsRequest as bs, type DeleteStorageFolderRequest as bt, type FormValuesOf as bu, type GetStorageFileUrlQuery as bv, type IntCoercionOptions as bw, type ListStorageFilesRequest as bx, type ManagedFileRecord as by, type ModelFormAdapter as bz, type AthenaAuthAdminUserSessionRevokeBinding as c, coerceInt as c0, createAthenaStorageError as c1, createClient as c2, createModelFormAdapter as c3, getAthenaDebugAst as c4, isAthenaGatewayError as c5, isOk as c6, normalizeAthenaError as c7, parseBooleanFlag as c8, requireAffected as c9, requireSuccess as ca, storageSdkManifest as cb, toModelFormDefaults as cc, toModelPayload as cd, unwrap as ce, unwrapOne as cf, unwrapRows as cg, withRetry as ch, type AthenaAuthFetchCompatibleInput as ci, 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 };
|