@xylex-group/athena 1.6.2 → 1.9.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 +70 -11
- package/bin/athena-js.js +0 -0
- package/dist/cli/index.cjs +150 -53
- 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 +150 -53
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +709 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +307 -41
- package/dist/index.d.ts +307 -41
- package/dist/index.js +703 -54
- package/dist/index.js.map +1 -1
- package/dist/model-form-Bm_kqCn2.d.ts +92 -0
- package/dist/model-form-DkS48fsh.d.cts +92 -0
- package/dist/pipeline-C-cN0ACi.d.cts +164 -0
- package/dist/pipeline-CQgV-Yfo.d.ts +164 -0
- package/dist/react.cjs +64 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +62 -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 +15 -14
- package/dist/errors-1b-LSTum.d.ts +0 -31
- package/dist/errors-BYRK5phv.d.cts +0 -31
- package/dist/pipeline-BQzpSLD3.d.ts +0 -338
- package/dist/pipeline-CA2aexDl.d.cts +0 -338
- package/dist/types-v6UyGg-x.d.cts +0 -195
- package/dist/types-v6UyGg-x.d.ts +0 -195
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { A as AthenaGatewayError, i as isAthenaGatewayError } from './
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
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
|
+
export { A as AthenaGatewayError, M as ModelFormAdapter, a as ModelFormDefaults, b as ModelFormNullishMode, c as ModelFormValues, T as ToModelFormDefaultsOptions, d as ToModelPayloadOptions, e as createModelFormAdapter, i as isAthenaGatewayError, t as toModelFormDefaults, f as toModelPayload } from './model-form-DkS48fsh.cjs';
|
|
4
|
+
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';
|
|
5
|
+
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
6
|
|
|
7
7
|
interface AthenaResult<T> {
|
|
8
8
|
data: T | null;
|
|
@@ -13,6 +13,9 @@ interface AthenaResult<T> {
|
|
|
13
13
|
raw: unknown;
|
|
14
14
|
}
|
|
15
15
|
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
16
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
17
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
18
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
16
19
|
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
17
20
|
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
18
21
|
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
@@ -26,39 +29,39 @@ interface OrderOptions {
|
|
|
26
29
|
ascending?: boolean;
|
|
27
30
|
}
|
|
28
31
|
/** 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<
|
|
32
|
+
interface FilterChain<Self, Row> {
|
|
33
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
34
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
35
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
36
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
34
37
|
range(from: number, to: number): Self;
|
|
35
38
|
limit(count: number): Self;
|
|
36
39
|
offset(count: number): Self;
|
|
37
40
|
currentPage(value: number): Self;
|
|
38
41
|
pageSize(value: number): Self;
|
|
39
42
|
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;
|
|
43
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
44
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
45
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
46
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
47
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
48
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
49
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
50
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
51
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
52
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
53
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
54
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
55
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
53
56
|
or(expression: string): Self;
|
|
54
57
|
}
|
|
55
58
|
/** 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 =
|
|
59
|
+
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
60
|
+
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
61
|
+
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
59
62
|
}
|
|
60
63
|
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
61
|
-
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row
|
|
64
|
+
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
62
65
|
}
|
|
63
66
|
interface RpcFilterChain<Self> {
|
|
64
67
|
eq(column: string, value: AthenaConditionValue): Self;
|
|
@@ -84,29 +87,29 @@ interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, Pro
|
|
|
84
87
|
offset(count: number): RpcQueryBuilder<Row>;
|
|
85
88
|
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
86
89
|
}
|
|
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?:
|
|
90
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>> extends FilterChain<TableQueryBuilder<Row, Insert, Update>, Row> {
|
|
91
|
+
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
92
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
93
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
94
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
95
|
+
updateBody?: Update;
|
|
93
96
|
onConflict?: string | string[];
|
|
94
97
|
}): MutationQuery<Row>;
|
|
95
|
-
upsert(values:
|
|
96
|
-
updateBody?:
|
|
98
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
99
|
+
updateBody?: Update;
|
|
97
100
|
onConflict?: string | string[];
|
|
98
101
|
}): MutationQuery<Row[]>;
|
|
99
|
-
update(values:
|
|
102
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
100
103
|
delete(options?: AthenaGatewayCallOptions & {
|
|
101
104
|
resourceId?: string;
|
|
102
105
|
}): MutationQuery<Row | null>;
|
|
103
106
|
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
104
107
|
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
105
|
-
reset(): TableQueryBuilder<Row>;
|
|
108
|
+
reset(): TableQueryBuilder<Row, Insert, Update>;
|
|
106
109
|
}
|
|
107
110
|
interface AthenaSdkClient {
|
|
108
|
-
from<Row =
|
|
109
|
-
rpc<Row = unknown, Args extends
|
|
111
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string): TableQueryBuilder<Row, Insert, Update>;
|
|
112
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
110
113
|
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
111
114
|
}
|
|
112
115
|
interface AthenaClientBuilder {
|
|
@@ -352,7 +355,7 @@ interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap ext
|
|
|
352
355
|
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
353
356
|
readonly tenantContext: TenantContext<TTenantMap>;
|
|
354
357
|
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>>>;
|
|
358
|
+
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
359
|
}
|
|
357
360
|
/**
|
|
358
361
|
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
@@ -365,6 +368,7 @@ declare function createTypedClient<TRegistry extends RegistryConstraint, TTenant
|
|
|
365
368
|
interface PostgresIntrospectionProviderOptions {
|
|
366
369
|
connectionString: string;
|
|
367
370
|
database?: string;
|
|
371
|
+
schemas?: readonly string[];
|
|
368
372
|
}
|
|
369
373
|
/**
|
|
370
374
|
* Creates a PostgreSQL-backed schema introspection provider.
|
|
@@ -397,4 +401,266 @@ declare function resolvePostgresColumnType(column: IntrospectionColumn): string;
|
|
|
397
401
|
*/
|
|
398
402
|
declare function resolveGeneratorProvider(providerConfig: GeneratorProviderConfig, experimentalFlags: GeneratorExperimentalFlags): SchemaIntrospectionProvider;
|
|
399
403
|
|
|
400
|
-
|
|
404
|
+
declare const DEFAULT_POSTGRES_SCHEMAS: readonly ["public"];
|
|
405
|
+
/**
|
|
406
|
+
* Normalizes schema selection from config or env-backed strings into a stable,
|
|
407
|
+
* deduplicated list. Empty selections fall back to PostgreSQL's public schema.
|
|
408
|
+
*/
|
|
409
|
+
declare function normalizeSchemaSelection(input: GeneratorSchemaSelection | undefined): string[];
|
|
410
|
+
/**
|
|
411
|
+
* Resolves the effective schema list for provider-backed generator runs.
|
|
412
|
+
*/
|
|
413
|
+
declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig): string[];
|
|
414
|
+
|
|
415
|
+
type AthenaAuthMethod = 'GET' | 'POST';
|
|
416
|
+
type AthenaAuthCredentials = 'omit' | 'same-origin' | 'include';
|
|
417
|
+
type AthenaAuthQueryPrimitive = string | number | boolean;
|
|
418
|
+
type AthenaAuthQueryValue = AthenaAuthQueryPrimitive | AthenaAuthQueryPrimitive[] | null | undefined;
|
|
419
|
+
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}`;
|
|
420
|
+
type AthenaAuthErrorCode = 'NETWORK_ERROR' | 'HTTP_ERROR' | 'INVALID_JSON' | 'UNKNOWN_ERROR';
|
|
421
|
+
interface AthenaAuthErrorDetails {
|
|
422
|
+
code: AthenaAuthErrorCode;
|
|
423
|
+
message: string;
|
|
424
|
+
status: number;
|
|
425
|
+
endpoint?: AthenaAuthEndpointPath;
|
|
426
|
+
method?: AthenaAuthMethod;
|
|
427
|
+
requestId?: string;
|
|
428
|
+
hint?: string;
|
|
429
|
+
cause?: string;
|
|
430
|
+
}
|
|
431
|
+
interface AthenaAuthResult<T = unknown> {
|
|
432
|
+
ok: boolean;
|
|
433
|
+
status: number;
|
|
434
|
+
data: T | null;
|
|
435
|
+
error: string | null;
|
|
436
|
+
errorDetails?: AthenaAuthErrorDetails | null;
|
|
437
|
+
raw: unknown;
|
|
438
|
+
}
|
|
439
|
+
interface AthenaAuthUser {
|
|
440
|
+
id: string;
|
|
441
|
+
email: string;
|
|
442
|
+
name?: string | null;
|
|
443
|
+
image?: string | null;
|
|
444
|
+
emailVerified?: boolean;
|
|
445
|
+
createdAt?: string;
|
|
446
|
+
updatedAt?: string;
|
|
447
|
+
username?: string | null;
|
|
448
|
+
displayUsername?: string | null;
|
|
449
|
+
twoFactorEnabled?: boolean;
|
|
450
|
+
role?: string | null;
|
|
451
|
+
banned?: boolean;
|
|
452
|
+
banReason?: string | null;
|
|
453
|
+
banExpires?: string | null;
|
|
454
|
+
}
|
|
455
|
+
interface AthenaAuthSession {
|
|
456
|
+
id: string;
|
|
457
|
+
expiresAt?: string;
|
|
458
|
+
token?: string;
|
|
459
|
+
createdAt?: string;
|
|
460
|
+
updatedAt?: string;
|
|
461
|
+
ipAddress?: string | null;
|
|
462
|
+
userAgent?: string | null;
|
|
463
|
+
userId?: string;
|
|
464
|
+
impersonatedBy?: string | null;
|
|
465
|
+
activeOrganizationId?: string | null;
|
|
466
|
+
}
|
|
467
|
+
interface AthenaAuthSessionResponse {
|
|
468
|
+
session: AthenaAuthSession;
|
|
469
|
+
user: AthenaAuthUser;
|
|
470
|
+
}
|
|
471
|
+
interface AthenaEmailSignInRequest {
|
|
472
|
+
email: string;
|
|
473
|
+
password: string;
|
|
474
|
+
callbackURL?: string;
|
|
475
|
+
rememberMe?: boolean;
|
|
476
|
+
}
|
|
477
|
+
interface AthenaUsernameSignInRequest {
|
|
478
|
+
username: string;
|
|
479
|
+
password: string;
|
|
480
|
+
rememberMe?: boolean;
|
|
481
|
+
}
|
|
482
|
+
interface AthenaSocialSignInRequest {
|
|
483
|
+
provider: string;
|
|
484
|
+
callbackURL?: string;
|
|
485
|
+
newUserCallbackURL?: string;
|
|
486
|
+
errorCallbackURL?: string;
|
|
487
|
+
disableRedirect?: boolean;
|
|
488
|
+
idToken?: string;
|
|
489
|
+
scopes?: string[] | string;
|
|
490
|
+
requestSignUp?: boolean;
|
|
491
|
+
loginHint?: string;
|
|
492
|
+
}
|
|
493
|
+
interface AthenaEmailSignUpRequest {
|
|
494
|
+
name: string;
|
|
495
|
+
email: string;
|
|
496
|
+
password: string;
|
|
497
|
+
callbackURL?: string;
|
|
498
|
+
}
|
|
499
|
+
interface AthenaAuthSignInResponse {
|
|
500
|
+
redirect: false;
|
|
501
|
+
token: string;
|
|
502
|
+
url?: string | null;
|
|
503
|
+
user: AthenaAuthUser;
|
|
504
|
+
}
|
|
505
|
+
interface AthenaAuthSocialRedirectResponse {
|
|
506
|
+
url: string;
|
|
507
|
+
redirect: boolean;
|
|
508
|
+
}
|
|
509
|
+
interface AthenaAuthSignOutResponse {
|
|
510
|
+
success: boolean;
|
|
511
|
+
}
|
|
512
|
+
interface AthenaAuthStatusResponse {
|
|
513
|
+
status: boolean;
|
|
514
|
+
}
|
|
515
|
+
interface AthenaAuthRevokeSessionRequest {
|
|
516
|
+
token: string;
|
|
517
|
+
}
|
|
518
|
+
interface AthenaForgetPasswordRequest {
|
|
519
|
+
email: string;
|
|
520
|
+
redirectTo?: string;
|
|
521
|
+
}
|
|
522
|
+
interface AthenaResetPasswordRequest {
|
|
523
|
+
newPassword: string;
|
|
524
|
+
token?: string;
|
|
525
|
+
}
|
|
526
|
+
interface AthenaVerifyEmailRequest {
|
|
527
|
+
token: string;
|
|
528
|
+
callbackURL?: string;
|
|
529
|
+
}
|
|
530
|
+
interface AthenaSendVerificationEmailRequest {
|
|
531
|
+
email: string;
|
|
532
|
+
callbackURL?: string;
|
|
533
|
+
}
|
|
534
|
+
interface AthenaChangeEmailRequest {
|
|
535
|
+
newEmail: string;
|
|
536
|
+
callbackURL?: string;
|
|
537
|
+
}
|
|
538
|
+
interface AthenaChangePasswordRequest {
|
|
539
|
+
newPassword: string;
|
|
540
|
+
currentPassword: string;
|
|
541
|
+
revokeOtherSessions?: boolean;
|
|
542
|
+
}
|
|
543
|
+
interface AthenaUpdateUserRequest {
|
|
544
|
+
name?: string;
|
|
545
|
+
image?: string;
|
|
546
|
+
}
|
|
547
|
+
interface AthenaDeleteUserRequest {
|
|
548
|
+
callbackURL?: string;
|
|
549
|
+
password?: string;
|
|
550
|
+
token?: string;
|
|
551
|
+
}
|
|
552
|
+
interface AthenaDeleteUserCallbackRequest {
|
|
553
|
+
token?: string;
|
|
554
|
+
callbackURL?: string;
|
|
555
|
+
}
|
|
556
|
+
interface AthenaDeleteUserResponse {
|
|
557
|
+
success: boolean;
|
|
558
|
+
message?: string;
|
|
559
|
+
}
|
|
560
|
+
interface AthenaAuthEmailChangeResponse {
|
|
561
|
+
status: boolean;
|
|
562
|
+
message?: string | null;
|
|
563
|
+
}
|
|
564
|
+
interface AthenaLinkSocialRequest {
|
|
565
|
+
provider: string;
|
|
566
|
+
callbackURL?: string;
|
|
567
|
+
scopes?: string[] | string;
|
|
568
|
+
}
|
|
569
|
+
interface AthenaUnlinkAccountRequest {
|
|
570
|
+
providerId: string;
|
|
571
|
+
accountId?: string;
|
|
572
|
+
}
|
|
573
|
+
interface AthenaOAuthAccountTokenRequest {
|
|
574
|
+
providerId: string;
|
|
575
|
+
accountId?: string;
|
|
576
|
+
userId?: string;
|
|
577
|
+
}
|
|
578
|
+
interface AthenaOAuthTokenBundle {
|
|
579
|
+
tokenType?: string;
|
|
580
|
+
idToken?: string;
|
|
581
|
+
accessToken?: string;
|
|
582
|
+
refreshToken?: string;
|
|
583
|
+
accessTokenExpiresAt?: string;
|
|
584
|
+
refreshTokenExpiresAt?: string;
|
|
585
|
+
}
|
|
586
|
+
interface AthenaAuthLinkedAccount {
|
|
587
|
+
id: string;
|
|
588
|
+
provider?: string;
|
|
589
|
+
accountId?: string;
|
|
590
|
+
scopes?: string[];
|
|
591
|
+
createdAt?: string;
|
|
592
|
+
updatedAt?: string;
|
|
593
|
+
}
|
|
594
|
+
interface AthenaAuthRequestInput {
|
|
595
|
+
endpoint: AthenaAuthEndpointPath;
|
|
596
|
+
method?: AthenaAuthMethod;
|
|
597
|
+
body?: unknown;
|
|
598
|
+
query?: Record<string, AthenaAuthQueryValue>;
|
|
599
|
+
fetchOptions?: AthenaAuthCallOptions;
|
|
600
|
+
}
|
|
601
|
+
interface AthenaAuthCallOptions {
|
|
602
|
+
baseUrl?: string;
|
|
603
|
+
apiKey?: string;
|
|
604
|
+
bearerToken?: string;
|
|
605
|
+
headers?: Record<string, string>;
|
|
606
|
+
credentials?: AthenaAuthCredentials;
|
|
607
|
+
signal?: AbortSignal;
|
|
608
|
+
}
|
|
609
|
+
interface AthenaAuthFetchCompatibleInput {
|
|
610
|
+
fetchOptions?: AthenaAuthCallOptions;
|
|
611
|
+
}
|
|
612
|
+
interface AthenaAuthClientConfig extends AthenaAuthCallOptions {
|
|
613
|
+
fetch?: typeof fetch;
|
|
614
|
+
}
|
|
615
|
+
interface AthenaAuthSdkClient {
|
|
616
|
+
baseUrl: string;
|
|
617
|
+
request: <T = unknown>(input: AthenaAuthRequestInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<T>>;
|
|
618
|
+
signIn: {
|
|
619
|
+
email: (input: AthenaEmailSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
620
|
+
username: (input: AthenaUsernameSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
621
|
+
social: (input: AthenaSocialSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse | AthenaAuthSignInResponse>>;
|
|
622
|
+
};
|
|
623
|
+
signUp: {
|
|
624
|
+
email: (input: AthenaEmailSignUpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>>;
|
|
625
|
+
};
|
|
626
|
+
signOut: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
|
|
627
|
+
logout: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>>;
|
|
628
|
+
getSession: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSessionResponse>>;
|
|
629
|
+
listSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSession[]>>;
|
|
630
|
+
revokeSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
631
|
+
clearSession: (input: AthenaAuthRevokeSessionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
632
|
+
revokeSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
633
|
+
clearSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
634
|
+
revokeOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
635
|
+
clearOtherSessions: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
636
|
+
forgetPassword: (input: AthenaForgetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
637
|
+
resetPassword: (input: AthenaResetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
638
|
+
resolveResetPasswordToken: (input: {
|
|
639
|
+
token: string;
|
|
640
|
+
callbackURL?: string;
|
|
641
|
+
} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
642
|
+
token?: string;
|
|
643
|
+
}>>;
|
|
644
|
+
verifyEmail: (input: AthenaVerifyEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
645
|
+
user: AthenaAuthUser;
|
|
646
|
+
status: boolean;
|
|
647
|
+
}>>;
|
|
648
|
+
sendVerificationEmail: (input: AthenaSendVerificationEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
649
|
+
changeEmail: (input: AthenaChangeEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailChangeResponse>>;
|
|
650
|
+
changePassword: (input: AthenaChangePasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{
|
|
651
|
+
token?: string | null;
|
|
652
|
+
user: AthenaAuthUser;
|
|
653
|
+
}>>;
|
|
654
|
+
updateUser: (input: AthenaUpdateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
655
|
+
deleteUser: (input?: AthenaDeleteUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
|
|
656
|
+
deleteUserCallback: (input?: AthenaDeleteUserCallbackRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>>;
|
|
657
|
+
linkSocial: (input: AthenaLinkSocialRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse>>;
|
|
658
|
+
listAccounts: (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLinkedAccount[]>>;
|
|
659
|
+
unlinkAccount: (input: AthenaUnlinkAccountRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>>;
|
|
660
|
+
refreshToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
|
|
661
|
+
getAccessToken: (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>>;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
665
|
+
|
|
666
|
+
export { type AthenaAuthCallOptions, type AthenaAuthClientConfig, type AthenaAuthCredentials, type AthenaAuthEmailChangeResponse, type AthenaAuthEndpointPath, type AthenaAuthErrorCode, type AthenaAuthErrorDetails, type AthenaAuthLinkedAccount, type AthenaAuthMethod, type AthenaAuthQueryPrimitive, type AthenaAuthQueryValue, type AthenaAuthRequestInput, type AthenaAuthResult, type AthenaAuthRevokeSessionRequest, type AthenaAuthSdkClient, type AthenaAuthSession, type AthenaAuthSessionResponse, type AthenaAuthSignInResponse, type AthenaAuthSignOutResponse, type AthenaAuthSocialRedirectResponse, type AthenaAuthStatusResponse, type AthenaAuthUser, type AthenaChangeEmailRequest, type AthenaChangePasswordRequest, AthenaClient, AthenaConditionCastType, type AthenaDeleteUserCallbackRequest, type AthenaDeleteUserRequest, type AthenaDeleteUserResponse, type AthenaEmailSignInRequest, type AthenaEmailSignUpRequest, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, type AthenaForgetPasswordRequest, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, AthenaGeneratorConfig, AthenaJsonObject, AthenaJsonValue, type AthenaLinkSocialRequest, type AthenaOAuthAccountTokenRequest, type AthenaOAuthTokenBundle, type AthenaOperationContext, type AthenaResetPasswordRequest, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, type AthenaSendVerificationEmailRequest, type AthenaSocialSignInRequest, type AthenaUnlinkAccountRequest, type AthenaUpdateUserRequest, type AthenaUsernameSignInRequest, type AthenaVerifyEmailRequest, 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, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, unwrap, unwrapOne, unwrapRows, withRetry };
|