@xylex-group/athena 1.7.0 → 2.0.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 +63 -53
- package/dist/cli/index.cjs +1224 -102
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +1224 -102
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +1832 -1138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -293
- package/dist/index.d.ts +63 -293
- package/dist/index.js +1829 -1139
- package/dist/index.js.map +1 -1
- package/dist/model-form-CVOtC8jq.d.ts +1284 -0
- package/dist/model-form-hXkvHS_3.d.cts +1284 -0
- package/dist/pipeline-C-cN0ACi.d.cts +164 -0
- package/dist/pipeline-CQgV-Yfo.d.ts +164 -0
- package/dist/react.cjs +157 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +38 -4
- package/dist/react.d.ts +38 -4
- package/dist/react.js +154 -1
- package/dist/react.js.map +1 -1
- package/dist/types-BnzoaNRC.d.cts +380 -0
- package/dist/types-BnzoaNRC.d.ts +380 -0
- package/package.json +3 -3
- package/dist/errors-BJGgjHcI.d.cts +0 -31
- package/dist/errors-Bcf5Sftv.d.ts +0 -31
- package/dist/pipeline-BsKuBqmE.d.cts +0 -343
- package/dist/pipeline-xQSjGbqF.d.ts +0 -343
- package/dist/types-wPA1Z4vQ.d.cts +0 -195
- package/dist/types-wPA1Z4vQ.d.ts +0 -195
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { B as BackendConfig, a as BackendType, A as
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { B as BackendConfig, a as BackendType, A as AthenaJsonValue, b as AthenaConditionValue, c as AthenaConditionCastType, d as AthenaConditionArrayValue, e as AthenaConditionOperator, f as AthenaGatewayCallOptions, g as AthenaGatewayErrorDetails, h as AthenaJsonObject, i as AthenaRpcCallOptions, S as SchemaDef, j as AnyModelDef, D as DatabaseDef, M as ModelMetadata, k as ModelDef, R as RegistryDef, T as TenantKeyMap, l as TenantContext, m as RowOf, n as ModelAt, I as InsertOf, U as UpdateOf, o as SchemaIntrospectionProvider, p as IntrospectionSnapshot, q as IntrospectionColumn } from './types-BnzoaNRC.cjs';
|
|
2
|
+
export { r as AthenaGatewayErrorCode, s as AthenaJsonArray, t as AthenaJsonPrimitive, u as AthenaRpcFilter, v as AthenaRpcFilterOperator, w as AthenaRpcOrder, x as AthenaRpcPayload, y as Backend, z as IntrospectionInspectOptions, C as IntrospectionRelation, E as IntrospectionSchema, F as IntrospectionTable, G as IntrospectionTypeKind, H as ModelRelationKind, J as ModelRelationMetadata, K as TenantContextValue } from './types-BnzoaNRC.cjs';
|
|
3
|
+
import { A as AthenaAuthBindings, a as AthenaAuthClientConfig, b as AthenaAuthSdkClient } from './model-form-hXkvHS_3.cjs';
|
|
4
|
+
export { c as AthenaAuthAdminUserSessionRevokeBinding, d as AthenaAuthCallOptions, e as AthenaAuthCredentials, f as AthenaAuthEmailChangeResponse, g as AthenaAuthEndpointPath, h as AthenaAuthErrorCode, i as AthenaAuthErrorDetails, j as AthenaAuthGenericInput, k as AthenaAuthGenericQueryInput, l as AthenaAuthLinkedAccount, m as AthenaAuthMethod, n as AthenaAuthOrganization, o as AthenaAuthOrganizationBindings, p as AthenaAuthOrganizationInvitation, q as AthenaAuthOrganizationMember, r as AthenaAuthQueryPrimitive, s as AthenaAuthQueryValue, t as AthenaAuthRequestInput, u as AthenaAuthResetPasswordBinding, v as AthenaAuthResult, w as AthenaAuthRevokeSessionRequest, x as AthenaAuthSession, y as AthenaAuthSessionResponse, z as AthenaAuthSessionRevokeBinding, B as AthenaAuthSignInResponse, C as AthenaAuthSignOutResponse, D as AthenaAuthSocialRedirectResponse, E as AthenaAuthStatusResponse, F as AthenaAuthUser, G as AthenaChangeEmailRequest, H as AthenaChangePasswordRequest, I as AthenaDeleteUserCallbackRequest, J as AthenaDeleteUserRequest, K as AthenaDeleteUserResponse, L as AthenaEmailSignInRequest, M as AthenaEmailSignUpRequest, N as AthenaForgetPasswordRequest, O as AthenaGatewayError, P as AthenaLinkSocialRequest, Q as AthenaOAuthAccountTokenRequest, R as AthenaOAuthTokenBundle, S as AthenaResetPasswordRequest, T as AthenaSendVerificationEmailRequest, U as AthenaSocialSignInRequest, V as AthenaUnlinkAccountRequest, W as AthenaUpdateUserRequest, X as AthenaUsernameSignInRequest, Y as AthenaVerifyEmailRequest, Z as ModelFormAdapter, _ as ModelFormDefaults, $ as ModelFormNullishMode, a0 as ModelFormValues, a1 as ToModelFormDefaultsOptions, a2 as ToModelPayloadOptions, a3 as createModelFormAdapter, a4 as isAthenaGatewayError, a5 as toModelFormDefaults, a6 as toModelPayload } from './model-form-hXkvHS_3.cjs';
|
|
5
|
+
import { A as AthenaGeneratorConfig, L as LoadGeneratorConfigOptions, a as LoadedGeneratorConfig, N as NormalizedAthenaGeneratorConfig, G as GeneratedArtifacts, b as GeneratorProviderConfig, c as GeneratorExperimentalFlags, d as GeneratorSchemaSelection } from './pipeline-C-cN0ACi.cjs';
|
|
6
|
+
export { e as GeneratedArtifact, f as GeneratorArtifactKind, g as GeneratorFeatureFlags, h as GeneratorNamingConfig, i as GeneratorOutputConfig, j as GeneratorOutputTargets, k as NamingStyle, R as RunGeneratorOptions, l as RunGeneratorResult, r as runSchemaGenerator } from './pipeline-C-cN0ACi.cjs';
|
|
6
7
|
|
|
7
8
|
interface AthenaResult<T> {
|
|
8
9
|
data: T | null;
|
|
@@ -13,6 +14,9 @@ interface AthenaResult<T> {
|
|
|
13
14
|
raw: unknown;
|
|
14
15
|
}
|
|
15
16
|
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
17
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
18
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
19
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
16
20
|
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
17
21
|
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
18
22
|
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
@@ -26,39 +30,39 @@ interface OrderOptions {
|
|
|
26
30
|
ascending?: boolean;
|
|
27
31
|
}
|
|
28
32
|
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
29
|
-
interface FilterChain<Self> {
|
|
30
|
-
eq(column:
|
|
31
|
-
eqCast(column:
|
|
32
|
-
eqUuid(column:
|
|
33
|
-
match(filters: Record<
|
|
33
|
+
interface FilterChain<Self, Row> {
|
|
34
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
35
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
36
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
37
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
34
38
|
range(from: number, to: number): Self;
|
|
35
39
|
limit(count: number): Self;
|
|
36
40
|
offset(count: number): Self;
|
|
37
41
|
currentPage(value: number): Self;
|
|
38
42
|
pageSize(value: number): Self;
|
|
39
43
|
totalPages(value: number): Self;
|
|
40
|
-
order(column:
|
|
41
|
-
gt(column:
|
|
42
|
-
gte(column:
|
|
43
|
-
lt(column:
|
|
44
|
-
lte(column:
|
|
45
|
-
neq(column:
|
|
46
|
-
like(column:
|
|
47
|
-
ilike(column:
|
|
48
|
-
is(column:
|
|
49
|
-
in(column:
|
|
50
|
-
contains(column:
|
|
51
|
-
containedBy(column:
|
|
52
|
-
not(columnOrExpression: string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
44
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
45
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
46
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
47
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
48
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
49
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
50
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
51
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
52
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
53
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
54
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
55
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
56
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
53
57
|
or(expression: string): Self;
|
|
54
58
|
}
|
|
55
59
|
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
56
|
-
interface SelectChain<Row> extends FilterChain<SelectChain<Row
|
|
57
|
-
single<T =
|
|
58
|
-
maybeSingle<T =
|
|
60
|
+
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
61
|
+
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
62
|
+
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
59
63
|
}
|
|
60
64
|
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
61
|
-
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row
|
|
65
|
+
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
62
66
|
}
|
|
63
67
|
interface RpcFilterChain<Self> {
|
|
64
68
|
eq(column: string, value: AthenaConditionValue): Self;
|
|
@@ -84,31 +88,34 @@ interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, Pro
|
|
|
84
88
|
offset(count: number): RpcQueryBuilder<Row>;
|
|
85
89
|
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
86
90
|
}
|
|
87
|
-
interface TableQueryBuilder<Row
|
|
88
|
-
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<T>;
|
|
89
|
-
insert(values:
|
|
90
|
-
insert(values:
|
|
91
|
-
upsert(values:
|
|
92
|
-
updateBody?:
|
|
91
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>> extends FilterChain<TableQueryBuilder<Row, Insert, Update>, Row> {
|
|
92
|
+
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
93
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
94
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
95
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
96
|
+
updateBody?: Update;
|
|
93
97
|
onConflict?: string | string[];
|
|
94
98
|
}): MutationQuery<Row>;
|
|
95
|
-
upsert(values:
|
|
96
|
-
updateBody?:
|
|
99
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
100
|
+
updateBody?: Update;
|
|
97
101
|
onConflict?: string | string[];
|
|
98
102
|
}): MutationQuery<Row[]>;
|
|
99
|
-
update(values:
|
|
103
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
100
104
|
delete(options?: AthenaGatewayCallOptions & {
|
|
101
105
|
resourceId?: string;
|
|
102
106
|
}): MutationQuery<Row | null>;
|
|
103
107
|
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
104
108
|
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
105
|
-
reset(): TableQueryBuilder<Row>;
|
|
109
|
+
reset(): TableQueryBuilder<Row, Insert, Update>;
|
|
106
110
|
}
|
|
107
111
|
interface AthenaSdkClient {
|
|
108
|
-
from<Row =
|
|
109
|
-
rpc<Row = unknown, Args extends
|
|
112
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string): TableQueryBuilder<Row, Insert, Update>;
|
|
113
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
110
114
|
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
111
115
|
}
|
|
116
|
+
interface AthenaSdkClientWithAuth extends AthenaSdkClient {
|
|
117
|
+
auth: AthenaAuthBindings;
|
|
118
|
+
}
|
|
112
119
|
interface AthenaClientBuilder {
|
|
113
120
|
/** Set the gateway base URL. */
|
|
114
121
|
url(url: string): AthenaClientBuilder;
|
|
@@ -123,17 +130,20 @@ interface AthenaClientBuilder {
|
|
|
123
130
|
/** Enable or disable health tracking metadata. */
|
|
124
131
|
healthTracking(enabled: boolean): AthenaClientBuilder;
|
|
125
132
|
/** Build the immutable Athena SDK client. */
|
|
126
|
-
build():
|
|
133
|
+
build(): AthenaSdkClientWithAuth;
|
|
127
134
|
}
|
|
128
135
|
/** Canonical Athena client factory with builder-based configuration. */
|
|
129
136
|
declare class AthenaClient {
|
|
130
137
|
/** Create a fluent builder for a strongly-typed Athena SDK client. */
|
|
131
138
|
static builder(): AthenaClientBuilder;
|
|
132
139
|
/** Build a client from process environment variables. */
|
|
133
|
-
static fromEnvironment():
|
|
140
|
+
static fromEnvironment(): AthenaSdkClientWithAuth;
|
|
141
|
+
}
|
|
142
|
+
interface AthenaCreateClientOptions extends Pick<AthenaGatewayCallOptions, 'client' | 'headers' | 'backend'> {
|
|
143
|
+
auth?: AthenaAuthClientConfig;
|
|
134
144
|
}
|
|
135
145
|
/** Create client (convenience wrapper; use AthenaClient.builder() for full control) */
|
|
136
|
-
declare function createClient(url: string, apiKey: string, options?:
|
|
146
|
+
declare function createClient(url: string, apiKey: string, options?: AthenaCreateClientOptions): AthenaSdkClientWithAuth;
|
|
137
147
|
|
|
138
148
|
type AthenaErrorKind = 'unique_violation' | 'not_found' | 'validation' | 'auth' | 'rate_limit' | 'transient' | 'unknown';
|
|
139
149
|
declare const AthenaErrorKind: {
|
|
@@ -218,6 +228,12 @@ interface RetryConfig {
|
|
|
218
228
|
interface RequireAffectedOptions {
|
|
219
229
|
min?: number;
|
|
220
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Parses a string-based boolean flag with a deterministic fallback.
|
|
233
|
+
*
|
|
234
|
+
* Accepts common truthy/falsey token variants used by env vars and CLI flags.
|
|
235
|
+
*/
|
|
236
|
+
declare function parseBooleanFlag(rawValue: string | undefined, fallback: boolean): boolean;
|
|
221
237
|
declare class AthenaError extends Error {
|
|
222
238
|
readonly code: AthenaErrorCode;
|
|
223
239
|
readonly kind: AthenaErrorKind;
|
|
@@ -352,7 +368,7 @@ interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap ext
|
|
|
352
368
|
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
353
369
|
readonly tenantContext: TenantContext<TTenantMap>;
|
|
354
370
|
withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
355
|
-
fromModel<TDatabase extends keyof TRegistry & string, TSchema extends keyof TRegistry[TDatabase]['schemas'] & string, TModel extends keyof TRegistry[TDatabase]['schemas'][TSchema]['models'] & string>(database: TDatabase, schema: TSchema, model: TModel): TableQueryBuilder<RowOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>>;
|
|
371
|
+
fromModel<TDatabase extends keyof TRegistry & string, TSchema extends keyof TRegistry[TDatabase]['schemas'] & string, TModel extends keyof TRegistry[TDatabase]['schemas'][TSchema]['models'] & string>(database: TDatabase, schema: TSchema, model: TModel): TableQueryBuilder<RowOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, InsertOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, UpdateOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>>;
|
|
356
372
|
}
|
|
357
373
|
/**
|
|
358
374
|
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
@@ -409,255 +425,9 @@ declare function normalizeSchemaSelection(input: GeneratorSchemaSelection | unde
|
|
|
409
425
|
*/
|
|
410
426
|
declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig): string[];
|
|
411
427
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
type AthenaAuthQueryValue = AthenaAuthQueryPrimitive | AthenaAuthQueryPrimitive[] | null | undefined;
|
|
416
|
-
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-password' | '/update-user' | '/delete-user' | '/delete-user/callback' | '/list-sessions' | '/revoke-session' | '/revoke-sessions' | '/revoke-other-sessions' | '/link-social' | '/list-accounts' | '/unlink-account' | '/refresh-token' | '/get-access-token' | '/ok' | '/error' | `/reset-password/${string}`;
|
|
417
|
-
type AthenaAuthErrorCode = 'NETWORK_ERROR' | 'HTTP_ERROR' | 'INVALID_JSON' | 'UNKNOWN_ERROR';
|
|
418
|
-
interface AthenaAuthErrorDetails {
|
|
419
|
-
code: AthenaAuthErrorCode;
|
|
420
|
-
message: string;
|
|
421
|
-
status: number;
|
|
422
|
-
endpoint?: AthenaAuthEndpointPath;
|
|
423
|
-
method?: AthenaAuthMethod;
|
|
424
|
-
requestId?: string;
|
|
425
|
-
hint?: string;
|
|
426
|
-
cause?: string;
|
|
427
|
-
}
|
|
428
|
-
interface AthenaAuthResult<T = unknown> {
|
|
429
|
-
ok: boolean;
|
|
430
|
-
status: number;
|
|
431
|
-
data: T | null;
|
|
432
|
-
error: string | null;
|
|
433
|
-
errorDetails?: AthenaAuthErrorDetails | null;
|
|
434
|
-
raw: unknown;
|
|
435
|
-
}
|
|
436
|
-
interface AthenaAuthUser {
|
|
437
|
-
id: string;
|
|
438
|
-
email: string;
|
|
439
|
-
name?: string | null;
|
|
440
|
-
image?: string | null;
|
|
441
|
-
emailVerified?: boolean;
|
|
442
|
-
createdAt?: string;
|
|
443
|
-
updatedAt?: string;
|
|
444
|
-
username?: string | null;
|
|
445
|
-
displayUsername?: string | null;
|
|
446
|
-
twoFactorEnabled?: boolean;
|
|
447
|
-
role?: string | null;
|
|
448
|
-
banned?: boolean;
|
|
449
|
-
banReason?: string | null;
|
|
450
|
-
banExpires?: string | null;
|
|
451
|
-
}
|
|
452
|
-
interface AthenaAuthSession {
|
|
453
|
-
id: string;
|
|
454
|
-
expiresAt?: string;
|
|
455
|
-
token?: string;
|
|
456
|
-
createdAt?: string;
|
|
457
|
-
updatedAt?: string;
|
|
458
|
-
ipAddress?: string | null;
|
|
459
|
-
userAgent?: string | null;
|
|
460
|
-
userId?: string;
|
|
461
|
-
impersonatedBy?: string | null;
|
|
462
|
-
activeOrganizationId?: string | null;
|
|
463
|
-
}
|
|
464
|
-
interface AthenaAuthSessionResponse {
|
|
465
|
-
session: AthenaAuthSession;
|
|
466
|
-
user: AthenaAuthUser;
|
|
467
|
-
}
|
|
468
|
-
interface AthenaEmailSignInRequest {
|
|
469
|
-
email: string;
|
|
470
|
-
password: string;
|
|
471
|
-
callbackURL?: string;
|
|
472
|
-
rememberMe?: boolean;
|
|
473
|
-
}
|
|
474
|
-
interface AthenaUsernameSignInRequest {
|
|
475
|
-
username: string;
|
|
476
|
-
password: string;
|
|
477
|
-
rememberMe?: boolean;
|
|
478
|
-
}
|
|
479
|
-
interface AthenaSocialSignInRequest {
|
|
480
|
-
provider: string;
|
|
481
|
-
callbackURL?: string;
|
|
482
|
-
newUserCallbackURL?: string;
|
|
483
|
-
errorCallbackURL?: string;
|
|
484
|
-
disableRedirect?: boolean;
|
|
485
|
-
idToken?: string;
|
|
486
|
-
scopes?: string[] | string;
|
|
487
|
-
requestSignUp?: boolean;
|
|
488
|
-
loginHint?: string;
|
|
489
|
-
}
|
|
490
|
-
interface AthenaEmailSignUpRequest {
|
|
491
|
-
name: string;
|
|
492
|
-
email: string;
|
|
493
|
-
password: string;
|
|
494
|
-
callbackURL?: string;
|
|
495
|
-
}
|
|
496
|
-
interface AthenaAuthSignInResponse {
|
|
497
|
-
redirect: false;
|
|
498
|
-
token: string;
|
|
499
|
-
url?: string | null;
|
|
500
|
-
user: AthenaAuthUser;
|
|
501
|
-
}
|
|
502
|
-
interface AthenaAuthSocialRedirectResponse {
|
|
503
|
-
url: string;
|
|
504
|
-
redirect: boolean;
|
|
505
|
-
}
|
|
506
|
-
interface AthenaAuthSignOutResponse {
|
|
507
|
-
success: boolean;
|
|
508
|
-
}
|
|
509
|
-
interface AthenaAuthStatusResponse {
|
|
510
|
-
status: boolean;
|
|
511
|
-
}
|
|
512
|
-
interface AthenaAuthRevokeSessionRequest {
|
|
513
|
-
token: string;
|
|
514
|
-
}
|
|
515
|
-
interface AthenaForgetPasswordRequest {
|
|
516
|
-
email: string;
|
|
517
|
-
redirectTo?: string;
|
|
518
|
-
}
|
|
519
|
-
interface AthenaResetPasswordRequest {
|
|
520
|
-
newPassword: string;
|
|
521
|
-
token?: string;
|
|
522
|
-
}
|
|
523
|
-
interface AthenaVerifyEmailRequest {
|
|
524
|
-
token: string;
|
|
525
|
-
callbackURL?: string;
|
|
526
|
-
}
|
|
527
|
-
interface AthenaSendVerificationEmailRequest {
|
|
528
|
-
email: string;
|
|
529
|
-
callbackURL?: string;
|
|
530
|
-
}
|
|
531
|
-
interface AthenaChangeEmailRequest {
|
|
532
|
-
newEmail: string;
|
|
533
|
-
callbackURL?: string;
|
|
534
|
-
}
|
|
535
|
-
interface AthenaChangePasswordRequest {
|
|
536
|
-
newPassword: string;
|
|
537
|
-
currentPassword: string;
|
|
538
|
-
revokeOtherSessions?: boolean;
|
|
539
|
-
}
|
|
540
|
-
interface AthenaUpdateUserRequest {
|
|
541
|
-
name?: string;
|
|
542
|
-
image?: string;
|
|
543
|
-
}
|
|
544
|
-
interface AthenaDeleteUserRequest {
|
|
545
|
-
callbackURL?: string;
|
|
546
|
-
password?: string;
|
|
547
|
-
token?: string;
|
|
548
|
-
}
|
|
549
|
-
interface AthenaDeleteUserCallbackRequest {
|
|
550
|
-
token?: string;
|
|
551
|
-
callbackURL?: string;
|
|
552
|
-
}
|
|
553
|
-
interface AthenaDeleteUserResponse {
|
|
554
|
-
success: boolean;
|
|
555
|
-
message?: string;
|
|
556
|
-
}
|
|
557
|
-
interface AthenaAuthEmailChangeResponse {
|
|
558
|
-
status: boolean;
|
|
559
|
-
message?: string | null;
|
|
560
|
-
}
|
|
561
|
-
interface AthenaLinkSocialRequest {
|
|
562
|
-
provider: string;
|
|
563
|
-
callbackURL?: string;
|
|
564
|
-
scopes?: string[] | string;
|
|
565
|
-
}
|
|
566
|
-
interface AthenaUnlinkAccountRequest {
|
|
567
|
-
providerId: string;
|
|
568
|
-
accountId?: string;
|
|
569
|
-
}
|
|
570
|
-
interface AthenaOAuthAccountTokenRequest {
|
|
571
|
-
providerId: string;
|
|
572
|
-
accountId?: string;
|
|
573
|
-
userId?: string;
|
|
574
|
-
}
|
|
575
|
-
interface AthenaOAuthTokenBundle {
|
|
576
|
-
tokenType?: string;
|
|
577
|
-
idToken?: string;
|
|
578
|
-
accessToken?: string;
|
|
579
|
-
refreshToken?: string;
|
|
580
|
-
accessTokenExpiresAt?: string;
|
|
581
|
-
refreshTokenExpiresAt?: string;
|
|
582
|
-
}
|
|
583
|
-
interface AthenaAuthLinkedAccount {
|
|
584
|
-
id: string;
|
|
585
|
-
provider?: string;
|
|
586
|
-
accountId?: string;
|
|
587
|
-
scopes?: string[];
|
|
588
|
-
createdAt?: string;
|
|
589
|
-
updatedAt?: string;
|
|
590
|
-
}
|
|
591
|
-
interface AthenaAuthRequestInput {
|
|
592
|
-
endpoint: AthenaAuthEndpointPath;
|
|
593
|
-
method?: AthenaAuthMethod;
|
|
594
|
-
body?: unknown;
|
|
595
|
-
query?: Record<string, AthenaAuthQueryValue>;
|
|
596
|
-
fetchOptions?: AthenaAuthCallOptions;
|
|
597
|
-
}
|
|
598
|
-
interface AthenaAuthCallOptions {
|
|
599
|
-
baseUrl?: string;
|
|
600
|
-
apiKey?: string;
|
|
601
|
-
bearerToken?: string;
|
|
602
|
-
headers?: Record<string, string>;
|
|
603
|
-
credentials?: AthenaAuthCredentials;
|
|
604
|
-
signal?: AbortSignal;
|
|
605
|
-
}
|
|
606
|
-
interface AthenaAuthFetchCompatibleInput {
|
|
607
|
-
fetchOptions?: AthenaAuthCallOptions;
|
|
608
|
-
}
|
|
609
|
-
interface AthenaAuthClientConfig extends AthenaAuthCallOptions {
|
|
610
|
-
fetch?: typeof fetch;
|
|
611
|
-
}
|
|
612
|
-
interface AthenaAuthSdkClient {
|
|
613
|
-
baseUrl: string;
|
|
614
|
-
request: <T = unknown>(input: AthenaAuthRequestInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<T>>;
|
|
615
|
-
signIn: {
|
|
616
|
-
email: (input: AthenaEmailSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
617
|
-
username: (input: AthenaUsernameSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
618
|
-
social: (input: AthenaSocialSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse | AthenaAuthSignInResponse>>;
|
|
619
|
-
};
|
|
620
|
-
signUp: {
|
|
621
|
-
email: (input: AthenaEmailSignUpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
622
|
-
};
|
|
623
|
-
signOut: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
|
|
624
|
-
logout: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
|
|
625
|
-
getSession: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSessionResponse>>;
|
|
626
|
-
listSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSession[]>>;
|
|
627
|
-
revokeSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
628
|
-
clearSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
629
|
-
revokeSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
630
|
-
clearSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
631
|
-
revokeOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
632
|
-
clearOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
633
|
-
forgetPassword: (input: AthenaForgetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
634
|
-
resetPassword: (input: AthenaResetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
635
|
-
resolveResetPasswordToken: (input: {
|
|
636
|
-
token: string;
|
|
637
|
-
callbackURL?: string;
|
|
638
|
-
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
639
|
-
token?: string;
|
|
640
|
-
}>>;
|
|
641
|
-
verifyEmail: (input: AthenaVerifyEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
642
|
-
user: AthenaAuthUser;
|
|
643
|
-
status: boolean;
|
|
644
|
-
}>>;
|
|
645
|
-
sendVerificationEmail: (input: AthenaSendVerificationEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
646
|
-
changeEmail: (input: AthenaChangeEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailChangeResponse>>;
|
|
647
|
-
changePassword: (input: AthenaChangePasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
648
|
-
token?: string | null;
|
|
649
|
-
user: AthenaAuthUser;
|
|
650
|
-
}>>;
|
|
651
|
-
updateUser: (input: AthenaUpdateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
652
|
-
deleteUser: (input?: AthenaDeleteUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
|
|
653
|
-
deleteUserCallback: (input?: AthenaDeleteUserCallbackRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
|
|
654
|
-
linkSocial: (input: AthenaLinkSocialRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse>>;
|
|
655
|
-
listAccounts: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLinkedAccount[]>>;
|
|
656
|
-
unlinkAccount: (input: AthenaUnlinkAccountRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
657
|
-
refreshToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
|
|
658
|
-
getAccessToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
|
|
659
|
-
}
|
|
660
|
-
|
|
428
|
+
/**
|
|
429
|
+
* @deprecated Prefer `createClient(...).auth` from `@xylex-group/athena`.
|
|
430
|
+
*/
|
|
661
431
|
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
662
432
|
|
|
663
|
-
export {
|
|
433
|
+
export { AthenaAuthBindings, AthenaAuthClientConfig, AthenaAuthSdkClient, AthenaClient, AthenaConditionCastType, type AthenaCreateClientOptions, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, AthenaGeneratorConfig, AthenaJsonObject, AthenaJsonValue, type AthenaOperationContext, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, type AthenaSdkClientWithAuth, BackendConfig, BackendType, DEFAULT_POSTGRES_SCHEMAS, DatabaseDef, GeneratedArtifacts, GeneratorExperimentalFlags, GeneratorProviderConfig, GeneratorSchemaSelection, InsertOf, type IntCoercionOptions, IntrospectionColumn, IntrospectionSnapshot, LoadGeneratorConfigOptions, LoadedGeneratorConfig, ModelAt, ModelDef, ModelMetadata, type NormalizedAthenaError, NormalizedAthenaGeneratorConfig, type PostgresIntrospectionProviderOptions, RegistryDef, type RequireAffectedOptions, type RetryBackoffStrategy, type RetryConfig, RowOf, type RpcOrderOptions, type RpcQueryBuilder, SchemaDef, SchemaIntrospectionProvider, type TableQueryBuilder, TenantContext, TenantKeyMap, type TypedAthenaClient, type TypedClientOptions, type UnwrapOneOptions, type UnwrapOptions, UpdateOf, assertInt, coerceInt, createAuthClient, createClient, createPostgresIntrospectionProvider, createTypedClient, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, findGeneratorConfigPath, generateArtifactsFromSnapshot, identifier, isOk, loadGeneratorConfig, normalizeAthenaError, normalizeGeneratorConfig, normalizeSchemaSelection, parseBooleanFlag, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, unwrap, unwrapOne, unwrapRows, withRetry };
|