@xylex-group/athena 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,8 @@
1
- import { A as AthenaGatewayCallOptions, a as AthenaConditionValue, b as AthenaConditionCastType, c as AthenaConditionArrayValue, d as AthenaConditionOperator, e as AthenaGatewayErrorDetails, f as AthenaRpcCallOptions, B as BackendConfig, g as BackendType } from './errors-C4GJaFI_.cjs';
2
- export { i as AthenaGatewayError, o as AthenaGatewayErrorCode, k as AthenaRpcFilter, l as AthenaRpcFilterOperator, m as AthenaRpcOrder, n as AthenaRpcPayload, h as Backend, j as isAthenaGatewayError } from './errors-C4GJaFI_.cjs';
1
+ import { B as BackendConfig, a as BackendType, A as AthenaConditionValue, b as AthenaConditionCastType, c as AthenaConditionArrayValue, d as AthenaConditionOperator, e as AthenaGatewayCallOptions, f as AthenaGatewayErrorDetails, g as AthenaRpcCallOptions } from './types-wPA1Z4vQ.cjs';
2
+ export { h as AthenaGatewayErrorCode, i as AthenaRpcFilter, j as AthenaRpcFilterOperator, k as AthenaRpcOrder, l as AthenaRpcPayload, m as Backend } from './types-wPA1Z4vQ.cjs';
3
+ export { A as AthenaGatewayError, i as isAthenaGatewayError } from './errors-BJGgjHcI.cjs';
4
+ import { S as SchemaDef, A as AnyModelDef, D as DatabaseDef, M as ModelMetadata, a as ModelDef, R as RegistryDef, T as TenantKeyMap, b as TenantContext, c as RowOf, d as ModelAt, e as SchemaIntrospectionProvider, f as AthenaGeneratorConfig, L as LoadGeneratorConfigOptions, g as LoadedGeneratorConfig, N as NormalizedAthenaGeneratorConfig, I as IntrospectionSnapshot, G as GeneratedArtifacts, h as IntrospectionColumn, i as GeneratorProviderConfig, j as GeneratorExperimentalFlags, k as GeneratorSchemaSelection } from './pipeline-BsKuBqmE.cjs';
5
+ export { l as GeneratedArtifact, m as GeneratorArtifactKind, n as GeneratorFeatureFlags, o as GeneratorNamingConfig, p as GeneratorOutputConfig, q as GeneratorOutputTargets, r as InsertOf, s as IntrospectionInspectOptions, t as IntrospectionRelation, u as IntrospectionSchema, v as IntrospectionTable, w as IntrospectionTypeKind, x as ModelRelationKind, y as ModelRelationMetadata, z as NamingStyle, B as RunGeneratorOptions, C as RunGeneratorResult, E as TenantContextValue, U as UpdateOf, F as runSchemaGenerator } from './pipeline-BsKuBqmE.cjs';
3
6
 
4
7
  interface AthenaResult<T> {
5
8
  data: T | null;
@@ -314,185 +317,6 @@ interface SqlIdentifier {
314
317
  */
315
318
  declare function identifier(...segments: string[]): SqlIdentifier;
316
319
 
317
- type ModelKey = string;
318
- type ColumnKey = string;
319
- /**
320
- * Runtime values that can safely be serialized into tenant-scoped headers.
321
- */
322
- type TenantContextValue = string | number | boolean | null | undefined;
323
- /**
324
- * Compile-time map of tenant context keys to outbound header names.
325
- */
326
- type TenantKeyMap = Record<string, string>;
327
- /**
328
- * Partial tenant context keyed by `TenantKeyMap`.
329
- */
330
- type TenantContext<TMap extends TenantKeyMap> = Partial<Record<keyof TMap, TenantContextValue>>;
331
- /**
332
- * Supported relationship cardinalities for model metadata and introspection snapshots.
333
- */
334
- type ModelRelationKind = 'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many';
335
- /**
336
- * Base metadata shape shared by typed model definitions and introspection snapshots.
337
- * This type is intentionally row-agnostic so it can be used for generic registries.
338
- */
339
- interface ModelMetadataBase {
340
- database?: string;
341
- schema?: string;
342
- model?: string;
343
- tableName?: string;
344
- primaryKey: string[];
345
- nullable?: Partial<Record<string, boolean>>;
346
- relations?: Record<string, ModelRelationMetadata>;
347
- }
348
- /**
349
- * Strongly-typed model metadata linked to a row shape.
350
- */
351
- type ModelMetadata<Row> = Omit<ModelMetadataBase, 'primaryKey' | 'nullable'> & {
352
- primaryKey: Array<Extract<keyof Row, string>>;
353
- nullable?: Partial<Record<Extract<keyof Row, string>, boolean>>;
354
- };
355
- /**
356
- * Relation metadata for model contracts and introspection snapshots.
357
- */
358
- interface ModelRelationMetadata {
359
- kind: ModelRelationKind;
360
- sourceColumns: ColumnKey[];
361
- targetSchema: string;
362
- targetModel: ModelKey;
363
- targetColumns: ColumnKey[];
364
- targetDatabase?: string;
365
- through?: {
366
- schema: string;
367
- model: string;
368
- sourceColumns: ColumnKey[];
369
- targetColumns: ColumnKey[];
370
- };
371
- }
372
- /**
373
- * Core model definition contract used by typed registries.
374
- */
375
- interface ModelDef<Row, Insert = Partial<Row>, Update = Partial<Insert>, Meta extends ModelMetadataBase = ModelMetadata<Row>> {
376
- readonly meta: Meta;
377
- readonly __types?: {
378
- row: Row;
379
- insert: Insert;
380
- update: Update;
381
- };
382
- }
383
- /**
384
- * Row-agnostic model definition used as a generic constraint.
385
- */
386
- type AnyModelDef = ModelDef<unknown, unknown, unknown, ModelMetadataBase>;
387
- /**
388
- * Schema-level model registry.
389
- */
390
- interface SchemaDef<Models extends Record<ModelKey, AnyModelDef>> {
391
- readonly models: Models;
392
- }
393
- /**
394
- * Database-level schema registry.
395
- */
396
- interface DatabaseDef<Schemas extends Record<string, SchemaDef<Record<ModelKey, AnyModelDef>>>> {
397
- readonly schemas: Schemas;
398
- }
399
- /**
400
- * Top-level registry keyed by logical database names.
401
- */
402
- type RegistryDef<Databases extends Record<string, DatabaseDef<Record<string, SchemaDef<Record<ModelKey, AnyModelDef>>>>>> = Databases;
403
- /**
404
- * Extracts row type from a model definition.
405
- */
406
- type RowOf<TModel extends AnyModelDef> = TModel extends ModelDef<infer TRow, unknown, unknown, ModelMetadataBase> ? TRow : never;
407
- /**
408
- * Extracts insert type from a model definition.
409
- */
410
- type InsertOf<TModel extends AnyModelDef> = TModel extends ModelDef<unknown, infer TInsert, unknown, ModelMetadataBase> ? TInsert : never;
411
- /**
412
- * Extracts update type from a model definition.
413
- */
414
- type UpdateOf<TModel extends AnyModelDef> = TModel extends ModelDef<unknown, unknown, infer TUpdate, ModelMetadataBase> ? TUpdate : never;
415
- /**
416
- * Resolves a model definition from a registry path.
417
- */
418
- type ModelAt<TRegistry extends RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<ModelKey, AnyModelDef>>>>>>, TDatabase extends keyof TRegistry & string, TSchema extends keyof TRegistry[TDatabase]['schemas'] & string, TModel extends keyof TRegistry[TDatabase]['schemas'][TSchema]['models'] & string> = TRegistry[TDatabase]['schemas'][TSchema]['models'][TModel];
419
- /**
420
- * Introspection-level column type families.
421
- */
422
- type IntrospectionTypeKind = 'scalar' | 'enum' | 'domain' | 'range' | 'multirange' | 'composite';
423
- /**
424
- * Introspected column metadata.
425
- */
426
- interface IntrospectionColumn {
427
- name: string;
428
- dataType: string;
429
- udtName: string;
430
- typeKind: IntrospectionTypeKind;
431
- isNullable: boolean;
432
- isPrimaryKey: boolean;
433
- hasDefault: boolean;
434
- isGenerated: boolean;
435
- arrayDimensions: number;
436
- enumValues?: string[];
437
- }
438
- /**
439
- * Introspected relationship metadata.
440
- */
441
- interface IntrospectionRelation {
442
- name: string;
443
- kind: ModelRelationKind;
444
- sourceColumns: string[];
445
- targetSchema: string;
446
- targetModel: string;
447
- targetColumns: string[];
448
- targetDatabase?: string;
449
- through?: {
450
- schema: string;
451
- model: string;
452
- sourceColumns: string[];
453
- targetColumns: string[];
454
- };
455
- }
456
- /**
457
- * Introspected table metadata.
458
- */
459
- interface IntrospectionTable {
460
- schema: string;
461
- name: string;
462
- columns: Record<string, IntrospectionColumn>;
463
- primaryKey: string[];
464
- relations: Record<string, IntrospectionRelation>;
465
- }
466
- /**
467
- * Introspected schema metadata.
468
- */
469
- interface IntrospectionSchema {
470
- name: string;
471
- tables: Record<string, IntrospectionTable>;
472
- }
473
- /**
474
- * Normalized output of a schema introspection pass.
475
- */
476
- interface IntrospectionSnapshot {
477
- backend: BackendType;
478
- database: string;
479
- generatedAt: string;
480
- schemas: Record<string, IntrospectionSchema>;
481
- }
482
- /**
483
- * Options accepted by introspection providers.
484
- */
485
- interface IntrospectionInspectOptions {
486
- schemas?: string[];
487
- }
488
- /**
489
- * Provider contract implemented by backend-specific introspection adapters.
490
- */
491
- interface SchemaIntrospectionProvider {
492
- readonly backend: BackendType;
493
- inspect(options?: IntrospectionInspectOptions): Promise<IntrospectionSnapshot>;
494
- }
495
-
496
320
  /**
497
321
  * Declares a model contract with explicit metadata and typed row/insert/update shapes.
498
322
  */
@@ -541,163 +365,13 @@ declare function createTypedClient<TRegistry extends RegistryConstraint, TTenant
541
365
  interface PostgresIntrospectionProviderOptions {
542
366
  connectionString: string;
543
367
  database?: string;
368
+ schemas?: readonly string[];
544
369
  }
545
370
  /**
546
371
  * Creates a PostgreSQL-backed schema introspection provider.
547
372
  */
548
373
  declare function createPostgresIntrospectionProvider(options: PostgresIntrospectionProviderOptions): SchemaIntrospectionProvider;
549
374
 
550
- /**
551
- * Supported case transformations for generated symbols and path token variants.
552
- */
553
- type NamingStyle = 'preserve' | 'camel' | 'pascal' | 'snake' | 'kebab';
554
- /**
555
- * Naming configuration for generated TypeScript identifiers.
556
- */
557
- interface GeneratorNamingConfig {
558
- modelType: NamingStyle;
559
- modelConst: NamingStyle;
560
- schemaConst: NamingStyle;
561
- databaseConst: NamingStyle;
562
- registryConst: NamingStyle;
563
- }
564
- /**
565
- * Stable feature flags for generator output behavior.
566
- */
567
- interface GeneratorFeatureFlags {
568
- emitRelations: boolean;
569
- emitRegistry: boolean;
570
- }
571
- /**
572
- * Experimental toggles for optional/forward-compatible generator behavior.
573
- */
574
- interface GeneratorExperimentalFlags {
575
- /**
576
- * Legacy compatibility toggle from the initial scaffold.
577
- * Gateway introspection is now implemented; this flag is retained for additive config compatibility.
578
- */
579
- postgresGatewayIntrospection: boolean;
580
- /**
581
- * Enables contract placeholders for future Scylla provider work.
582
- */
583
- scyllaProviderContracts: boolean;
584
- }
585
- /**
586
- * Path templates for each generated artifact category.
587
- */
588
- interface GeneratorOutputTargets {
589
- model: string;
590
- schema: string;
591
- database: string;
592
- registry: string;
593
- }
594
- /**
595
- * Output configuration including dynamic placeholder aliases.
596
- */
597
- interface GeneratorOutputConfig {
598
- targets: GeneratorOutputTargets;
599
- placeholderMap: Record<string, string>;
600
- }
601
- /**
602
- * Direct PostgreSQL introspection mode (implemented).
603
- */
604
- interface PostgresDirectProviderConfig {
605
- kind: 'postgres';
606
- mode: 'direct';
607
- connectionString: string;
608
- database?: string;
609
- schemas?: string[];
610
- }
611
- /**
612
- * Athena gateway-backed PostgreSQL introspection mode using `/gateway/query`.
613
- */
614
- interface PostgresGatewayProviderConfig {
615
- kind: 'postgres';
616
- mode: 'gateway';
617
- gatewayUrl: string;
618
- apiKey: string;
619
- database: string;
620
- schemas?: string[];
621
- backend?: BackendType;
622
- }
623
- /**
624
- * Scylla introspection provider contract placeholder (phase-two scaffold).
625
- */
626
- interface ScyllaDirectProviderConfig {
627
- kind: 'scylla';
628
- mode: 'direct';
629
- contactPoints: string[];
630
- keyspace: string;
631
- datacenter?: string;
632
- }
633
- type GeneratorProviderConfig = PostgresDirectProviderConfig | PostgresGatewayProviderConfig | ScyllaDirectProviderConfig;
634
- /**
635
- * Root config contract loaded from `athena.config.ts`.
636
- */
637
- interface AthenaGeneratorConfig {
638
- provider: GeneratorProviderConfig;
639
- output: GeneratorOutputConfig;
640
- naming?: Partial<GeneratorNamingConfig>;
641
- features?: Partial<GeneratorFeatureFlags>;
642
- experimental?: Partial<GeneratorExperimentalFlags>;
643
- }
644
- /**
645
- * Normalized generator config with defaults applied.
646
- */
647
- interface NormalizedAthenaGeneratorConfig {
648
- provider: GeneratorProviderConfig;
649
- output: GeneratorOutputConfig;
650
- naming: GeneratorNamingConfig;
651
- features: GeneratorFeatureFlags;
652
- experimental: GeneratorExperimentalFlags;
653
- }
654
- /**
655
- * Config loader options for CLI/programmatic usage.
656
- */
657
- interface LoadGeneratorConfigOptions {
658
- cwd?: string;
659
- configPath?: string;
660
- }
661
- /**
662
- * Fully loaded config result including resolved file path.
663
- */
664
- interface LoadedGeneratorConfig {
665
- configPath: string;
666
- config: NormalizedAthenaGeneratorConfig;
667
- }
668
- type GeneratorArtifactKind = 'model' | 'schema' | 'database' | 'registry';
669
- /**
670
- * One generated output file.
671
- */
672
- interface GeneratedArtifact {
673
- kind: GeneratorArtifactKind;
674
- path: string;
675
- content: string;
676
- }
677
- /**
678
- * In-memory generator output payload.
679
- */
680
- interface GeneratedArtifacts {
681
- snapshot: IntrospectionSnapshot;
682
- files: GeneratedArtifact[];
683
- }
684
- /**
685
- * Runtime options for executing the generator pipeline.
686
- */
687
- interface RunGeneratorOptions {
688
- cwd?: string;
689
- configPath?: string;
690
- dryRun?: boolean;
691
- provider?: SchemaIntrospectionProvider;
692
- }
693
- /**
694
- * Generator execution result including files written to disk.
695
- */
696
- interface RunGeneratorResult extends GeneratedArtifacts {
697
- configPath: string;
698
- writtenFiles: string[];
699
- }
700
-
701
375
  declare function normalizeGeneratorConfig(input: AthenaGeneratorConfig): NormalizedAthenaGeneratorConfig;
702
376
  /**
703
377
  * Typed identity helper for authoring generator configs.
@@ -724,9 +398,266 @@ declare function resolvePostgresColumnType(column: IntrospectionColumn): string;
724
398
  */
725
399
  declare function resolveGeneratorProvider(providerConfig: GeneratorProviderConfig, experimentalFlags: GeneratorExperimentalFlags): SchemaIntrospectionProvider;
726
400
 
401
+ declare const DEFAULT_POSTGRES_SCHEMAS: readonly ["public"];
727
402
  /**
728
- * End-to-end generator execution: load config, introspect, render, and optionally write files.
403
+ * Normalizes schema selection from config or env-backed strings into a stable,
404
+ * deduplicated list. Empty selections fall back to PostgreSQL's public schema.
729
405
  */
730
- declare function runSchemaGenerator(options?: RunGeneratorOptions): Promise<RunGeneratorResult>;
406
+ declare function normalizeSchemaSelection(input: GeneratorSchemaSelection | undefined): string[];
407
+ /**
408
+ * Resolves the effective schema list for provider-backed generator runs.
409
+ */
410
+ declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig): string[];
411
+
412
+ type AthenaAuthMethod = 'GET' | 'POST';
413
+ type AthenaAuthCredentials = 'omit' | 'same-origin' | 'include';
414
+ type AthenaAuthQueryPrimitive = string | number | boolean;
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
+
661
+ declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
731
662
 
732
- export { AthenaClient, AthenaConditionCastType, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, type AthenaGeneratorConfig, type AthenaOperationContext, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, BackendConfig, BackendType, type DatabaseDef, type GeneratedArtifact, type GeneratedArtifacts, type GeneratorArtifactKind, type GeneratorExperimentalFlags, type GeneratorFeatureFlags, type GeneratorNamingConfig, type GeneratorOutputConfig, type GeneratorOutputTargets, type GeneratorProviderConfig, type InsertOf, type IntCoercionOptions, type IntrospectionColumn, type IntrospectionInspectOptions, type IntrospectionRelation, type IntrospectionSchema, type IntrospectionSnapshot, type IntrospectionTable, type IntrospectionTypeKind, type LoadGeneratorConfigOptions, type LoadedGeneratorConfig, type ModelAt, type ModelDef, type ModelMetadata, type ModelRelationKind, type ModelRelationMetadata, type NamingStyle, type NormalizedAthenaError, type NormalizedAthenaGeneratorConfig, type PostgresIntrospectionProviderOptions, type RegistryDef, type RequireAffectedOptions, type RetryBackoffStrategy, type RetryConfig, type RowOf, type RpcOrderOptions, type RpcQueryBuilder, type RunGeneratorOptions, type RunGeneratorResult, type SchemaDef, type SchemaIntrospectionProvider, type TableQueryBuilder, type TenantContext, type TenantContextValue, type TenantKeyMap, type TypedAthenaClient, type TypedClientOptions, type UnwrapOneOptions, type UnwrapOptions, type UpdateOf, assertInt, coerceInt, createClient, createPostgresIntrospectionProvider, createTypedClient, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, findGeneratorConfigPath, generateArtifactsFromSnapshot, identifier, isOk, loadGeneratorConfig, normalizeAthenaError, normalizeGeneratorConfig, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, runSchemaGenerator, unwrap, unwrapOne, unwrapRows, withRetry };
663
+ 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, 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, 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, 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 };