Complete SDK Method Reference
Generated Athena.js method inventory across root exports, query builders, auth, React, cookies, and utils.
This page mirrors the generated Athena.js method inventory from the SDK repo.
Use API reference for shared contracts and signatures. Use Athena Auth client for task-oriented auth flows.
This file is generated from the TypeScript source and is intended to document every public SDK method surface with a usage example.
Total documented method paths: 356
Regenerate with: node scripts/generate-sdk-method-reference.mjs
Root Exported Functions and Classes (@xylex-group/athena)
| Method | Signature | Example | Notes |
|---|---|---|---|
root.assertInt | (value: unknown, label?: string, options?: IntCoercionOptions) => number | assertInt(/* ... */) | Strict integer assertion wrapper around coerceInt. Throws a TypeError with the provided label when coercion fails. |
root.athenaAuth | <TConfig extends AthenaAuthServerConfig>(config: TConfig) => AthenaAuthServer<TConfig> | athenaAuth(/* ... */) | — |
root.AthenaClient.builder | () => AthenaClientBuilder<false, false> | const athena = AthenaClient.builder().url("https://...").key("api_key").build() | Create a fluent builder for a strongly-typed Athena SDK client. |
root.AthenaClient.fromEnvironment | () => AthenaSdkClientWithAuth<false> | const athena = AthenaClient.fromEnvironment() | Build a client from process environment variables. |
root.boolean | () => AthenaColumnBuilder<boolean, false, false, false, undefined, "boolean"> | boolean() | — |
root.coerceInt | (value: unknown, options?: IntCoercionOptions) => number | null | coerceInt(/* ... */) | Safely coerces unknown values into finite integers. Returns null when coercion fails or bounds/strict bigint checks are violated. |
root.createAthenaStorageError | (input: AthenaStorageErrorInput) => AthenaStorageError | createAthenaStorageError(/* ... */) | — |
root.createAuthClient | (config?: AthenaAuthClientConfig) => AthenaAuthSdkClient | createAuthClient() | Deprecated: Prefer createClient(...).auth from @xylex-group/athena. |
root.createAuthReactEmailInput | <TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(component: AthenaAuthReactEmailComponent<TProps>, props: TProps, overrides?: Omit<AthenaAuthReactEmailRenderInput, "component" | "props" | "element">) => AthenaAuthReactEmailRenderInput | createAuthReactEmailInput(/* ... */) | — |
root.createClient | { (url: string, apiKey: string, options: AthenaCreateClientOptionsWithStorageAndTypecheckedColumns): AthenaSdkClientWithStorage<true>; (url: string, apiKey: string, options: AthenaCreateClientOptionsWithStorage): AthenaSdkClientWithStorage<false>; (url: string, apiKey: string, options: AthenaCreateClientOptionsWithTypecheckedColumns): AthenaSdkClientWithAuth<true>; (url: string, apiKey: string, options?: AthenaCreateClientOptions): AthenaSdkClientWithAuth<false>;} | const athena = createClient("https://...", "api_key") | Create client (convenience wrapper; use AthenaClient.builder() for full control) |
root.createModelFormAdapter | <TModel extends AnyModelDef>(model: TModel) => ModelFormAdapter<TModel> | const adapter = createModelFormAdapter(model) | Creates a small model-aware adapter for form defaults and payload normalization. |
root.createPostgresIntrospectionProvider | (options: PostgresIntrospectionProviderOptions) => SchemaIntrospectionProvider | createPostgresIntrospectionProvider(/* ... */) | Creates a PostgreSQL-backed schema introspection provider. |
root.createTypedClient | { <TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>>(registry: TRegistry, url: string, apiKey: string, options: TypedClientOptionsWithTypecheckedColumns<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap, true>; <TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>>(registry: TRegistry, url: string, apiKey: string, options?: TypedClientOptions<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap, false>;} | const typed = createTypedClient(registry, "https://...", "api_key") | Creates a typed client bound to a registry contract and optional tenant header mapping. |
root.defineAthenaAuthConfig | <TConfig extends AthenaAuthServerConfig>(config: TConfig) => TConfig | defineAthenaAuthConfig(/* ... */) | — |
root.defineAuthEmailTemplate | <TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(definition: AthenaAuthEmailTemplateDefinition<TProps>) => AthenaAuthEmailTemplateBuilder<TProps> | defineAuthEmailTemplate(/* ... */) | — |
root.defineDatabase | <Schemas extends Record<string, SchemaDef<Record<string, AnyModelDef>>>>(schemas: Schemas) => DatabaseDef<Schemas> | const db = defineDatabase({ public: defineSchema({}) }) | Declares a database-level schema map. |
root.defineGeneratorConfig | <TConfig extends AthenaGeneratorConfig>(config: TConfig) => TConfig | defineGeneratorConfig(/* ... */) | Typed identity helper for authoring generator configs. |
root.defineModel | <Row, Insert = Partial<Row>, Update = Partial<Insert>, Meta extends ModelMetadata<Row> = ModelMetadata<Row>>(input: { meta: Meta;}) => ModelDef<Row, Insert, Update, Meta> | const model = defineModel<{ id: string }>({ meta: { primaryKey: ["id"], nullable: { id: false } } }) | Declares a model contract with explicit metadata and typed row/insert/update shapes. |
root.defineRegistry | <Databases extends Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>(databases: Databases) => RegistryDef<Databases> | const registry = defineRegistry({ primary: defineDatabase({ public: defineSchema({}) }) }) | Declares a top-level multi-database registry. |
root.defineSchema | <Models extends Record<string, AnyModelDef>>(models: Models) => SchemaDef<Models> | const schema = defineSchema({ users: defineModel<{ id: string }>({ meta: { primaryKey: ["id"], nullable: { id: false } } }) }) | Declares a schema-level model map. |
root.enumeration | <const TValues extends readonly [string, ...string[]]>(values: TValues) => AthenaColumnBuilder<TValues[number], false, false, false, undefined, "enumeration"> | enumeration(/* ... */) | — |
root.findGeneratorConfigPath | (cwd?: string) => string | undefined | findGeneratorConfigPath() | Finds a supported generator config filename in the provided directory. |
root.generateArtifactsFromSnapshot | (snapshot: IntrospectionSnapshot, config: AthenaGeneratorConfig | NormalizedAthenaGeneratorConfig) => GeneratedArtifacts | generateArtifactsFromSnapshot(/* ... */) | Generates model/schema/database/registry source artifacts from an introspection snapshot. |
root.generatorEnv | GeneratorEnvHelper | generatorEnv(/* ... */) | Typed env reader for generator configs. This keeps athena.config.* files declarative while preserving exact field types for booleans, lists, unions, and JSON-backed objects. |
root.getAthenaDebugAst | (value: unknown) => AthenaQueryDebugAst | null | getAthenaDebugAst(/* ... */) | — |
root.identifier | (...segments: string[]) => SqlIdentifier | identifier() | Creates a quoted identifier object from segment or dotted inputs. |
root.isAthenaGatewayError | (error: unknown) => error is AthenaGatewayError | isAthenaGatewayError(/* ... */) | — |
root.isOk | <T>(result: AthenaResult<T>) => boolean | isOk(/* ... */) | Returns true when a result is successful (2xx status and no error). |
root.json | <TValue = unknown>(schema?: ZodType<TValue>) => AthenaColumnBuilder<TValue, false, false, false, undefined, "json"> | json() | — |
root.loadGeneratorConfig | (options?: LoadGeneratorConfigOptions) => Promise<LoadedGeneratorConfig> | loadGeneratorConfig() | Loads and normalizes athena.config.* from disk. |
root.normalizeAthenaError | (resultOrError: unknown, context?: AthenaOperationContext) => NormalizedAthenaError | normalizeAthenaError(/* ... */) | Deprecated: Prefer result.error on failed AthenaResult values and the structured fields already attached to thrown SDK errors. This helper is retained for compatibility with mixed unknown inputs. Normalizes any Athena failure shape into a stable, typed error envelope. Accepts AthenaResult, AthenaGatewayError, native Error, or unknown values. Optional context can override inferred table/operation metadata for clearer diagnostics. |
root.normalizeAthenaGatewayBaseUrl | (input: string | null | undefined, options?: NormalizeAthenaGatewayBaseUrlOptions) => string | normalizeAthenaGatewayBaseUrl(/* ... */) | — |
root.normalizeGeneratorConfig | (input: AthenaGeneratorConfig) => NormalizedAthenaGeneratorConfig | normalizeGeneratorConfig(/* ... */) | — |
root.normalizeSchemaSelection | (input: GeneratorSchemaSelection | undefined) => string[] | normalizeSchemaSelection(/* ... */) | Normalizes schema selection from config or env-backed strings into a stable, deduplicated list. Empty selections fall back to PostgreSQL's public schema. |
root.number | () => AthenaColumnBuilder<number, false, false, false, undefined, "number"> | number() | — |
root.parseBooleanFlag | (rawValue: string | undefined, fallback: boolean) => boolean | parseBooleanFlag(/* ... */) | Parses a string-based boolean flag with a deterministic fallback. Accepts common truthy/falsey token variants used by env vars and CLI flags. |
root.renderAthenaReactEmail | (input: AthenaAuthReactEmailRenderInput, options?: AthenaAuthReactEmailRuntimeOptions | AthenaAuthReactEmailConfig) => Promise<AthenaAuthRenderedReactEmail> | renderAthenaReactEmail(/* ... */) | — |
root.requireAffected | <T>(result: AthenaResult<T>, options?: RequireAffectedOptions, context?: AthenaOperationContext) => number | requireAffected(/* ... */) | Enforces mutation postconditions based on result.count. - Validates success first. - Requires a non-null count in the response. - Validates count >= min (default: 1). Useful for guaranteeing that critical writes actually affected rows. |
root.requireSuccess | <T>(result: AthenaResult<T>, context?: AthenaOperationContext) => AthenaResult<T> | requireSuccess(/* ... */) | Asserts that an Athena result is successful. Returns the original result for fluent composition and throws AthenaGatewayError on failure. |
root.resolveGeneratorProvider | (providerConfig: GeneratorProviderConfig, experimentalFlags: GeneratorExperimentalFlags) => SchemaIntrospectionProvider | resolveGeneratorProvider(/* ... */) | Resolves a runtime introspection provider from generator config. |
root.resolvePostgresColumnType | (column: IntrospectionColumn) => string | resolvePostgresColumnType(/* ... */) | — |
root.resolveProviderSchemas | (providerConfig: GeneratorProviderConfig) => string[] | resolveProviderSchemas(/* ... */) | Resolves the effective schema list for provider-backed generator runs. |
root.runSchemaGenerator | (options?: RunGeneratorOptions) => Promise<RunGeneratorResult> | await runSchemaGenerator({ configPath: "./athena.config.ts" }) | End-to-end generator execution: load config, introspect, render, and optionally write files. |
root.string | () => AthenaColumnBuilder<string, false, false, false, undefined, "string"> | string() | — |
root.table | <TName extends string>(name: TName) => AthenaTableBuilder<TName, undefined> | table(/* ... */) | — |
root.toModelFormDefaults | <TModel extends AnyModelDef, TMode extends ModelFormNullishMode = "empty-string">(model: TModel, values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>) => ModelFormDefaults<TModel, TMode> | const defaults = toModelFormDefaults(model, row) | Normalizes model data into form-safe defaults using model nullability metadata. |
root.toModelPayload | <TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, "empty-string" | "undefined" | "null">>, options?: ToModelPayloadOptions) => Partial<InsertOf<TModel>> | const payload = toModelPayload(model, values) | Normalizes form values back into model-compatible insert/update payloads. |
root.unwrap | { <T>(result: AthenaResult<T | null>, options: UnwrapOptions & { allowNull: true; }): T | null; <T>(result: AthenaResult<T | null>, options?: UnwrapOptions): T;} | unwrap(/* ... */) | Unwraps successful result data from AthenaResult<T | null>. By default, null data throws. Pass { allowNull: true } to permit nullable payloads. |
root.unwrapOne | { <T>(result: AthenaResult<T[] | T | null>, options: UnwrapOneOptions & { allowNull: true; }): T | null; <T>(result: AthenaResult<T[] | T | null>, options?: UnwrapOneOptions): T;} | unwrapOne(/* ... */) | Unwraps the first row from a successful result that may contain arrays/scalars/null. - Throws on failed results. - Throws when no row exists unless allowNull: true is provided. - Optionally enforces exact cardinality via requireExactlyOne. |
root.unwrapRows | <T>(result: AthenaResult<T[] | T | null>, options?: UnwrapOptions) => T[] | unwrapRows(/* ... */) | Unwraps a successful result into a row array. - Throws on failed results. - Converts null data to an empty array. - Wraps scalar data in a single-element array. |
root.verifyAthenaGatewayUrl | (baseUrl: string, options?: AthenaGatewayConnectionOptions) => Promise<AthenaGatewayConnectionResult> | verifyAthenaGatewayUrl(/* ... */) | — |
root.withRetry | <T>(config: RetryConfig, fn: () => Promise<T>) => Promise<T> | withRetry(/* ... */) | Retries an async operation with configurable backoff and retry policy. retries represents additional attempts after the first failure. By default, transient and rate-limit errors are retried. |
Runtime Client Fluent Builder and Query Methods
| Method | Signature | Example | Notes |
|---|---|---|---|
athena.db.delete | <Row = AthenaRowShape>(table: string, options?: AthenaGatewayCallOptions & { resourceId?: string;}) => MutationQuery<Row | null, Row, TStrict> | await athena.db.delete("users", { resourceId: "u_1" }).select() | — |
athena.db.from | { <TModel extends AthenaModelTarget>(model: TModel): TableQueryBuilder<RowOf<TModel>, InsertOf<TModel>, UpdateOf<TModel>, unknown, TStrict>; <Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update, unknown, TStrict>;} | athena.db.from("users").select() | — |
athena.db.insert | { <Row = AthenaRowShape, Insert = Partial<Row>>(table: string, values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row, Row, TStrict>; <Row = AthenaRowShape, Insert = Partial<Row>>(table: string, values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[], Row, TStrict>;} | await athena.db.insert("users", { name: "Ada" }).select() | — |
athena.db.query | <Row = unknown>(query: string, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<Row[]>> | await athena.db.query("select * from users") | — |
athena.db.rpc | <Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions) => RpcQueryBuilder<Row, TStrict> | await athena.db.rpc("list_users").select() | — |
athena.db.select | { <Row = AthenaRowShape>(table: string, options?: AthenaGatewayCallOptions): SelectChain<Row, Row, TStrict>; (table: string, columns: AthenaSelectInput, options?: AthenaGatewayCallOptions): SelectChain<AthenaRowShape, AthenaRowShape, TStrict>;} | await athena.db.select("users", "id,name") | — |
athena.db.update | <Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Update, options?: AthenaGatewayCallOptions) => UpdateChain<Row, TStrict> | await athena.db.update("users", { name: "Ada" }).eq("id", "u_1").select() | — |
athena.db.upsert | { <Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert, options?: AthenaUpsertOptions<Update>): MutationQuery<Row, Row, TStrict>; <Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert[], options?: AthenaUpsertOptions<Update>): MutationQuery<Row[], Row, TStrict>;} | await athena.db.upsert("users", { id: "u_1", name: "Ada" }).select() | — |
athena.from | { <TModel extends AthenaModelTarget>(model: TModel): TableQueryBuilder<RowOf<TModel>, InsertOf<TModel>, UpdateOf<TModel>, unknown, TStrict>; <Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update, unknown, TStrict>;} | athena.from(/* ... */) | — |
athena.from.containedBy | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").containedBy(/* ... */) | — |
athena.from.contains | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").contains(/* ... */) | — |
athena.from.currentPage | (value: number) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").currentPage(/* ... */) | — |
athena.from.delete | (options?: AthenaGatewayCallOptions & { resourceId?: string;}) => MutationQuery<Row | null, Row, TStrict> | await athena.from("users").eq("id", "u_1").delete() | — |
athena.from.eq | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").eq(/* ... */) | — |
athena.from.eqCast | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").eqCast(/* ... */) | — |
athena.from.eqUuid | (column: ResolvedFilterColumnKey<Row>, value: string) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").eqUuid(/* ... */) | — |
athena.from.findMany | <const TSelect extends AthenaSelectShape>(options: AthenaFindManyOptions<Row, TSelect> & { select: AthenaValidatedSelectShape<TSelect>;}) => Promise<AthenaResult<Array<AthenaFindManyResult<Row, TSelect, TContext>>>> | await athena.from("orchestral_sections").findMany({ select: { name: true, instruments: { select: { name: true } } } }) | — |
athena.from.gt | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").gt(/* ... */) | — |
athena.from.gte | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").gte(/* ... */) | — |
athena.from.ilike | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").ilike(/* ... */) | — |
athena.from.in | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").in(/* ... */) | — |
athena.from.insert | { (values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row, Row, TStrict>; (values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[], Row, TStrict>;} | await athena.from("users").insert({ name: "Ada" }).select() | — |
athena.from.is | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").is(/* ... */) | — |
athena.from.like | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").like(/* ... */) | — |
athena.from.limit | (count: number) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").limit(/* ... */) | — |
athena.from.lt | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").lt(/* ... */) | — |
athena.from.lte | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").lte(/* ... */) | — |
athena.from.match | (filters: Partial<Record<ResolvedFilterColumnKey<Row>, import("C:/Users/floris/Documents/GitHub/athena-js/src/index").AthenaJsonPrimitive>>) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").match(/* ... */) | — |
athena.from.maybeSingle | <T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<T | null>> | await athena.from("users").eq("id", "u_1").maybeSingle() | — |
athena.from.neq | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").neq(/* ... */) | — |
athena.from.not | (columnOrExpression: string | ResolvedFilterColumnKey<Row>, operator?: AthenaConditionOperator, value?: AthenaConditionValue) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").not(/* ... */) | — |
athena.from.offset | (count: number) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").offset(/* ... */) | — |
athena.from.or | (expression: string) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").or(/* ... */) | — |
athena.from.order | (column: ResolvedFilterColumnKey<Row>, options?: OrderOptions) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").order(/* ... */) | — |
athena.from.pageSize | (value: number) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").pageSize(/* ... */) | — |
athena.from.range | (from: number, to: number) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").range(/* ... */) | — |
athena.from.reset | () => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").eq("id", "u_1").reset() | — |
athena.from.select | <T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => SelectChain<Row, T, TStrict> | await athena.from("users").select("id,name") | — |
athena.from.select.containedBy | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").containedBy(/* ... */) | — |
athena.from.select.contains | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").contains(/* ... */) | — |
athena.from.select.currentPage | (value: number) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").currentPage(/* ... */) | — |
athena.from.select.eq | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").eq(/* ... */) | — |
athena.from.select.eqCast | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").eqCast(/* ... */) | — |
athena.from.select.eqUuid | (column: ResolvedFilterColumnKey<Row>, value: string) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").eqUuid(/* ... */) | — |
athena.from.select.gt | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").gt(/* ... */) | — |
athena.from.select.gte | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").gte(/* ... */) | — |
athena.from.select.ilike | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").ilike(/* ... */) | — |
athena.from.select.in | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").in(/* ... */) | — |
athena.from.select.is | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").is(/* ... */) | — |
athena.from.select.like | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").like(/* ... */) | — |
athena.from.select.limit | (count: number) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").limit(/* ... */) | — |
athena.from.select.lt | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").lt(/* ... */) | — |
athena.from.select.lte | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").lte(/* ... */) | — |
athena.from.select.match | (filters: Partial<Record<ResolvedFilterColumnKey<Row>, import("C:/Users/floris/Documents/GitHub/athena-js/src/index").AthenaJsonPrimitive>>) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").match(/* ... */) | — |
athena.from.select.maybeSingle | <T = SelectedRow, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<T | null>> | await athena.from("users").eq("id", "u_1").maybeSingle() | — |
athena.from.select.neq | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").neq(/* ... */) | — |
athena.from.select.not | (columnOrExpression: string | ResolvedFilterColumnKey<Row>, operator?: AthenaConditionOperator, value?: AthenaConditionValue) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").not(/* ... */) | — |
athena.from.select.offset | (count: number) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").offset(/* ... */) | — |
athena.from.select.or | (expression: string) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").or(/* ... */) | — |
athena.from.select.order | (column: ResolvedFilterColumnKey<Row>, options?: OrderOptions) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").order(/* ... */) | — |
athena.from.select.pageSize | (value: number) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").pageSize(/* ... */) | — |
athena.from.select.range | (from: number, to: number) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").range(/* ... */) | — |
athena.from.select.single | <T = SelectedRow, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<T | null>> | await athena.from("users").eq("id", "u_1").single() | — |
athena.from.select.totalPages | (value: number) => SelectChain<Row, SelectedRow, TStrict> | athena.from("users").select("id").totalPages(/* ... */) | — |
athena.from.single | <T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<T | null>> | await athena.from("users").eq("id", "u_1").single() | — |
athena.from.totalPages | (value: number) => TableQueryBuilder<Row, Insert, Update, TContext, TStrict> | athena.from("users").select("id").totalPages(/* ... */) | — |
athena.from.update | (values: Update, options?: AthenaGatewayCallOptions) => UpdateChain<Row, TStrict> | await athena.from("users").eq("id", "u_1").update({ name: "Ada" }).select() | — |
athena.from.update.catch | <TResult = never>(onrejected?: (reason: unknown) => TResult | PromiseLike<TResult>) => Promise<AthenaResult<Row[]> | TResult> | athena.from("users").catch(/* ... */) | — |
athena.from.update.containedBy | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => UpdateChain<Row, TStrict> | athena.from("users").containedBy(/* ... */) | — |
athena.from.update.contains | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => UpdateChain<Row, TStrict> | athena.from("users").contains(/* ... */) | — |
athena.from.update.currentPage | (value: number) => UpdateChain<Row, TStrict> | athena.from("users").select("id").currentPage(/* ... */) | — |
athena.from.update.eq | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").eq(/* ... */) | — |
athena.from.update.eqCast | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType) => UpdateChain<Row, TStrict> | athena.from("users").eqCast(/* ... */) | — |
athena.from.update.eqUuid | (column: ResolvedFilterColumnKey<Row>, value: string) => UpdateChain<Row, TStrict> | athena.from("users").eqUuid(/* ... */) | — |
athena.from.update.finally | (onfinally?: (() => void) | undefined | null) => Promise<AthenaResult<Row[]>> | athena.from("users").finally(/* ... */) | — |
athena.from.update.gt | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").gt(/* ... */) | — |
athena.from.update.gte | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").gte(/* ... */) | — |
athena.from.update.ilike | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").ilike(/* ... */) | — |
athena.from.update.in | (column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue) => UpdateChain<Row, TStrict> | athena.from("users").in(/* ... */) | — |
athena.from.update.is | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").is(/* ... */) | — |
athena.from.update.like | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").like(/* ... */) | — |
athena.from.update.limit | (count: number) => UpdateChain<Row, TStrict> | athena.from("users").select("id").limit(/* ... */) | — |
athena.from.update.lt | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").lt(/* ... */) | — |
athena.from.update.lte | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").lte(/* ... */) | — |
athena.from.update.match | (filters: Partial<Record<ResolvedFilterColumnKey<Row>, import("C:/Users/floris/Documents/GitHub/athena-js/src/index").AthenaJsonPrimitive>>) => UpdateChain<Row, TStrict> | athena.from("users").match(/* ... */) | — |
athena.from.update.maybeSingle | <const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<Row>> | await athena.from("users").eq("id", "u_1").maybeSingle() | — |
athena.from.update.neq | (column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").neq(/* ... */) | — |
athena.from.update.not | (columnOrExpression: string | ResolvedFilterColumnKey<Row>, operator?: AthenaConditionOperator, value?: AthenaConditionValue) => UpdateChain<Row, TStrict> | athena.from("users").not(/* ... */) | — |
athena.from.update.offset | (count: number) => UpdateChain<Row, TStrict> | athena.from("users").select("id").offset(/* ... */) | — |
athena.from.update.or | (expression: string) => UpdateChain<Row, TStrict> | athena.from("users").or(/* ... */) | — |
athena.from.update.order | (column: ResolvedFilterColumnKey<Row>, options?: OrderOptions) => UpdateChain<Row, TStrict> | athena.from("users").select("id").order(/* ... */) | — |
athena.from.update.pageSize | (value: number) => UpdateChain<Row, TStrict> | athena.from("users").select("id").pageSize(/* ... */) | — |
athena.from.update.range | (from: number, to: number) => UpdateChain<Row, TStrict> | athena.from("users").select("id").range(/* ... */) | — |
athena.from.update.returning | <const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<Row[]>> | athena.from("users").returning(/* ... */) | — |
athena.from.update.select | <const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<Row[]>> | await athena.from("users").select("id,name") | — |
athena.from.update.single | <const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<Row>> | await athena.from("users").eq("id", "u_1").single() | — |
athena.from.update.then | <TResult1 = AthenaResult<Row[]>, TResult2 = never>(onfulfilled?: (value: AthenaResult<Row[]>) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: unknown) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2> | athena.from("users").then(/* ... */) | Attaches callbacks for the resolution and/or rejection of the Promise. |
athena.from.update.totalPages | (value: number) => UpdateChain<Row, TStrict> | athena.from("users").select("id").totalPages(/* ... */) | — |
athena.from.upsert | { (values: Insert, options?: AthenaGatewayCallOptions & { updateBody?: Update; onConflict?: string | string[]; }): MutationQuery<Row, Row, TStrict>; (values: Insert[], options?: AthenaGatewayCallOptions & { updateBody?: Update; onConflict?: string | string[]; }): MutationQuery<Row[], Row, TStrict>;} | await athena.from("users").upsert({ id: "u_1", name: "Ada" }).select() | — |
athena.query | <Row = unknown>(query: string, options?: AthenaGatewayCallOptions) => Promise<AthenaResult<Row[]>> | athena.query(/* ... */) | — |
athena.rpc | <Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions) => RpcQueryBuilder<Row, TStrict> | athena.rpc(/* ... */) | — |
athena.rpc.eq | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").eq(/* ... */) | — |
athena.rpc.gt | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").gt(/* ... */) | — |
athena.rpc.gte | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").gte(/* ... */) | — |
athena.rpc.ilike | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").ilike(/* ... */) | — |
athena.rpc.in | (column: AthenaTypecheckedColumnKey<Row, TStrict>, values: AthenaConditionArrayValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").in(/* ... */) | — |
athena.rpc.is | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").is(/* ... */) | — |
athena.rpc.like | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").like(/* ... */) | — |
athena.rpc.limit | (count: number) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").limit(/* ... */) | — |
athena.rpc.lt | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").lt(/* ... */) | — |
athena.rpc.lte | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").lte(/* ... */) | — |
athena.rpc.maybeSingle | <T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaRpcCallOptions) => Promise<AthenaResult<T | null>> | await athena.rpc("list_users").maybeSingle() | — |
athena.rpc.neq | (column: AthenaTypecheckedColumnKey<Row, TStrict>, value: AthenaConditionValue) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").neq(/* ... */) | — |
athena.rpc.offset | (count: number) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").offset(/* ... */) | — |
athena.rpc.order | (column: AthenaTypecheckedColumnKey<Row, TStrict>, options?: RpcOrderOptions) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").order(/* ... */) | — |
athena.rpc.range | (from: number, to: number) => RpcQueryBuilder<Row, TStrict> | athena.rpc("list_users").range(/* ... */) | — |
athena.rpc.select | <const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaRpcCallOptions) => Promise<AthenaResult<Row[]>> | await athena.rpc("list_users").select() | — |
athena.rpc.single | <T = Row, const TColumns extends AthenaSelectInput = string>(columns?: SelectColumnsFor<Row, TStrict, TColumns>, options?: AthenaRpcCallOptions) => Promise<AthenaResult<T | null>> | await athena.rpc("list_users").single() | — |
athena.verifyConnection | (options?: AthenaGatewayConnectionOptions) => Promise<AthenaGatewayConnectionResult> | athena.verifyConnection() | — |
AthenaClient.builder.auth | (config: AthenaAuthClientConfig) => AthenaClientBuilder<StorageEnabled, TStrict> | AthenaClient.builder().auth(/* ... */) | Configure Athena Auth client behavior for client.auth.* methods. |
AthenaClient.builder.backend | (backend: BackendConfig | BackendType) => AthenaClientBuilder<StorageEnabled, TStrict> | AthenaClient.builder().backend(/* ... */) | Set the default backend routing strategy. |
AthenaClient.builder.build | () => StorageEnabled extends true ? AthenaSdkClientWithStorage<TStrict> : AthenaSdkClientWithAuth<TStrict> | const client = AthenaClient.builder().url("https://...").key("...").build() | Build the immutable Athena SDK client. |
AthenaClient.builder.client | (clientName: string) => AthenaClientBuilder<StorageEnabled, TStrict> | AthenaClient.builder().client(/* ... */) | Set the default Athena client routing key. |
AthenaClient.builder.experimental | { (options: AthenaClientExperimentalOptions & { athenaStorageBackend: true; typecheckColumns: true; }): AthenaClientBuilder<true, true>; (options: AthenaClientExperimentalOptions & { athenaStorageBackend: true; }): AthenaClientBuilder<true, TStrict>; (options: AthenaClientExperimentalOptions & { typecheckColumns: true; }): AthenaClientBuilder<StorageEnabled, true>; (options: AthenaClientExperimentalOptions): AthenaClientBuilder<StorageEnabled, TStrict>;} | AthenaClient.builder().experimental(/* ... */) | Configure experimental client options and narrow the built client when storage or strict column checks are enabled. |
AthenaClient.builder.headers | (headers: Record<string, string>) => AthenaClientBuilder<StorageEnabled, TStrict> | AthenaClient.builder().headers(/* ... */) | Attach static headers to every request. |
AthenaClient.builder.key | (apiKey: string) => AthenaClientBuilder<StorageEnabled, TStrict> | AthenaClient.builder().key(/* ... */) | Set the API key used for all requests. |
AthenaClient.builder.options | { (options: AthenaCreateClientOptionsWithStorageAndTypecheckedColumns): AthenaClientBuilder<true, true>; (options: AthenaCreateClientOptionsWithStorage): AthenaClientBuilder<true, TStrict>; (options: AthenaCreateClientOptionsWithTypecheckedColumns): AthenaClientBuilder<StorageEnabled, true>; (options: AthenaCreateClientOptions): AthenaClientBuilder<StorageEnabled, TStrict>;} | AthenaClient.builder().options(/* ... */) | Apply createClient options and narrow the built client when storage is enabled. |
AthenaClient.builder.url | (url: string) => AthenaClientBuilder<StorageEnabled, TStrict> | AthenaClient.builder().url(/* ... */) | Set the gateway base URL. |
Auth Bindings (createClient(...).auth) - Exhaustive
| Method | Signature | Example | Notes |
|---|---|---|---|
athena.auth.account.list | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLinkedAccount[]>> | await athena.auth.account.list() | List linked provider accounts. Route: GET /list-accounts. |
athena.auth.account.unlink | (input: AthenaUnlinkAccountRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.account.unlink({ /* input */ }) | Unlink a provider account. Route: POST /unlink-account. |
athena.auth.admin.apiKey.create | (input?: AthenaAdminApiKeyCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminApiKeyCreateResponse>> | await athena.auth.admin.apiKey.create() | Create admin-scoped API key. Route: POST /admin/api-key/create. |
athena.auth.admin.athenaClient.create | (input: AthenaAdminAthenaClientCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>> | await athena.auth.admin.athenaClient.create({ /* input */ }) | Create Athena client credentials. Route: POST /admin/athena-client/create. |
athena.auth.admin.athenaClient.list | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminAthenaClientListResponse>> | await athena.auth.admin.athenaClient.list() | List Athena client credentials. Route: GET /admin/athena-client/list. |
athena.auth.admin.auditLog.list | (input?: { query?: AthenaAdminAuditLogListQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminAuditLogListResponse>> | await athena.auth.admin.auditLog.list() | List auth audit events. Route: GET /admin/audit-log/list. |
athena.auth.admin.email.create | (input: AthenaAdminEmailCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.email.create({ /* input */ }) | Create an email record. Route: POST /admin/email/create. |
athena.auth.admin.email.delete | (input: AthenaAdminEmailDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.email.delete({ /* input */ }) | Delete an email record. Route: POST /admin/email/delete. |
athena.auth.admin.email.failure.create | (input: AthenaAdminEmailFailureCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.email.failure.create({ /* input */ }) | Create an email failure record. Route: POST /admin/email-failure/create. |
athena.auth.admin.email.failure.delete | (input: AthenaAdminEmailFailureDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.email.failure.delete({ /* input */ }) | Delete an email failure record. Route: POST /admin/email-failure/delete. |
athena.auth.admin.email.failure.get | (input: { query: AthenaAdminEmailFailureGetQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureGetResponse>> | await athena.auth.admin.email.failure.get({ /* input */ }) | Get an email failure record. Route: GET /admin/email-failure/get. |
athena.auth.admin.email.failure.list | (input?: { query?: AthenaAdminEmailFailureListQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureListResponse>> | await athena.auth.admin.email.failure.list() | List email failure records. Route: GET /admin/email-failure/list. |
athena.auth.admin.email.failure.update | (input: AthenaAdminEmailFailureUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailFailureUpdateResponse>> | await athena.auth.admin.email.failure.update({ /* input */ }) | Update an email failure record. Route: POST /admin/email-failure/update. |
athena.auth.admin.email.get | (input: { query: AthenaAdminEmailGetQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailGetResponse>> | await athena.auth.admin.email.get({ /* input */ }) | Get a specific email record. Route: GET /admin/email/get. |
athena.auth.admin.email.list | (input?: { query?: AthenaAdminEmailListQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailListResponse>> | await athena.auth.admin.email.list() | List emails. Route: GET /admin/email/list. |
athena.auth.admin.email.template.create | (input: AthenaAdminEmailTemplateCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>> | await athena.auth.admin.email.template.create({ /* input */ }) | Create email template. Route: POST /admin/email-template/create. |
athena.auth.admin.email.template.delete | (input: AthenaAdminEmailTemplateDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.email.template.delete({ /* input */ }) | Delete email template. Route: POST /admin/email-template/delete. |
athena.auth.admin.email.template.get | (input: { query: AthenaAdminEmailTemplateGetQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateGetResponse>> | await athena.auth.admin.email.template.get({ /* input */ }) | Get email template by ID. Route: GET /admin/email-template/get. |
athena.auth.admin.email.template.list | (input?: { query?: AthenaAdminEmailTemplateListQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateListResponse>> | await athena.auth.admin.email.template.list() | List email templates. Route: GET /admin/email-template/list. |
athena.auth.admin.email.template.update | (input: AthenaAdminEmailTemplateUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>> | await athena.auth.admin.email.template.update({ /* input */ }) | Update email template. Route: POST /admin/email-template/update. |
athena.auth.admin.email.update | (input: AthenaAdminEmailUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailUpdateResponse>> | await athena.auth.admin.email.update({ /* input */ }) | Update an email record. Route: POST /admin/email/update. |
athena.auth.admin.emailTemplate.create | (input: AthenaAdminEmailTemplateCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>> | await athena.auth.admin.emailTemplate.create({ /* input */ }) | Create email template. Route: POST /admin/email-template/create. |
athena.auth.admin.emailTemplate.delete | (input: AthenaAdminEmailTemplateDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.emailTemplate.delete({ /* input */ }) | Delete email template. Route: POST /admin/email-template/delete. |
athena.auth.admin.emailTemplate.get | (input: { query: AthenaAdminEmailTemplateGetQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateGetResponse>> | await athena.auth.admin.emailTemplate.get({ /* input */ }) | Get email template by ID. Route: GET /admin/email-template/get. |
athena.auth.admin.emailTemplate.list | (input?: { query?: AthenaAdminEmailTemplateListQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminEmailTemplateListResponse>> | await athena.auth.admin.emailTemplate.list() | List email templates. Route: GET /admin/email-template/list. |
athena.auth.admin.emailTemplate.update | (input: AthenaAdminEmailTemplateUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>> | await athena.auth.admin.emailTemplate.update({ /* input */ }) | Update email template. Route: POST /admin/email-template/update. |
athena.auth.admin.hasPermission | (input: AthenaAdminHasPermissionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminHasPermissionResponse>> | await athena.auth.admin.hasPermission({ /* input */ }) | Check permission under admin policy. Route: POST /admin/has-permission. |
athena.auth.admin.role.set | (input: AthenaAdminSetRoleRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>> | await athena.auth.admin.role.set({ /* input */ }) | Set a user role. Route: POST /admin/set-role. |
athena.auth.admin.user.ban | (input: AthenaAdminBanUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>> | await athena.auth.admin.user.ban({ /* input */ }) | Ban user. Route: POST /admin/ban-user. |
athena.auth.admin.user.create | (input: AthenaAdminCreateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>> | await athena.auth.admin.user.create({ /* input */ }) | Create user. Route: POST /admin/create-user. |
athena.auth.admin.user.impersonate | (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminImpersonateResponse>> | await athena.auth.admin.user.impersonate({ /* input */ }) | Start impersonation. Route: POST /admin/impersonate-user. |
athena.auth.admin.user.list | (input?: { query?: AthenaAdminListUsersQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminListUsersResponse>> | await athena.auth.admin.user.list() | List users. Route: GET /admin/list-users. |
athena.auth.admin.user.remove | (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.admin.user.remove({ /* input */ }) | Remove user. Route: POST /admin/remove-user. |
athena.auth.admin.user.session.list | (input: AthenaAdminListUserSessionsRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminListUserSessionsResponse>> | await athena.auth.admin.user.session.list() | List sessions for a target user. Route: POST /admin/list-user-sessions. |
athena.auth.admin.user.session.revoke | AthenaAuthAdminUserSessionRevokeBinding | await athena.auth.admin.user.session.revoke({ /* input */ }) | Revoke one or multiple sessions; collapses to /admin/revoke-user-session or /admin/revoke-user-sessions. userId is required and plural payloads must share one userId. |
athena.auth.admin.user.setPassword | (input: AthenaAdminSetUserPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.admin.user.setPassword({ /* input */ }) | Set user password. Route: POST /admin/set-user-password. |
athena.auth.admin.user.stopImpersonating | (input?: AthenaAdminStopImpersonatingRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthLooseRecord>> | await athena.auth.admin.user.stopImpersonating() | Stop impersonation. Route: POST /admin/stop-impersonating. |
athena.auth.admin.user.unban | (input: AthenaAdminTargetUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminUserResponse>> | await athena.auth.admin.user.unban({ /* input */ }) | Unban user. Route: POST /admin/unban-user. |
athena.auth.apiKey.create | (input: AthenaApiKeyCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>> | await athena.auth.apiKey.create({ /* input */ }) | Create API key. Route: POST /api-key/create. |
athena.auth.apiKey.delete | (input: AthenaApiKeyDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminSuccessResponse>> | await athena.auth.apiKey.delete({ /* input */ }) | Delete API key. Route: POST /api-key/delete. |
athena.auth.apiKey.deleteAllExpired | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyDeleteAllExpiredResponse>> | await athena.auth.apiKey.deleteAllExpired() | Delete all expired API keys. Route: POST /api-key/delete-all-expired-api-keys. |
athena.auth.apiKey.get | (input?: { query?: AthenaApiKeyGetQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>> | await athena.auth.apiKey.get() | Get API key metadata. Route: GET /api-key/get. |
athena.auth.apiKey.list | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord[]>> | await athena.auth.apiKey.list() | List API keys. Route: GET /api-key/list. |
athena.auth.apiKey.update | (input: AthenaApiKeyUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyRecord>> | await athena.auth.apiKey.update({ /* input */ }) | Update API key metadata. Route: POST /api-key/update. |
athena.auth.apiKey.verify | (input: AthenaApiKeyVerifyRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaApiKeyVerifyResponse>> | await athena.auth.apiKey.verify({ /* input */ }) | Verify an API key. Route: POST /api-key/verify. |
athena.auth.callback.provider | (input: AthenaAuthCallbackProviderRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthCallbackProviderResponse>> | await athena.auth.callback.provider({ /* input */ }) | OAuth provider callback passthrough. Route: GET /callback/{provider}. |
athena.auth.changeEmail | (input: AthenaChangeEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailChangeResponse>> | await athena.auth.changeEmail({ /* input */ }) | Start change-email flow. Route: POST /change-email. |
athena.auth.changeEmailVerify | (input: { query: AthenaAuthTokenQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthTokenVerificationResponse>> | await athena.auth.changeEmailVerify({ /* input */ }) | Verify pending email change. Route: GET /change-email/verify. |
athena.auth.changePassword | (input: AthenaChangePasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{ token?: string | null; user: AthenaAuthUser;}>> | await athena.auth.changePassword({ /* input */ }) | Change current user password. Route: POST /change-password. |
athena.auth.deleteUser.callback | (input?: AthenaDeleteUserCallbackRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>> | await athena.auth.deleteUser.callback() | Callback endpoint for delete-user verification flows. Route: GET /delete-user/callback. |
athena.auth.deleteUserVerify | (input: { query: AthenaAuthTokenQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthTokenVerificationResponse>> | await athena.auth.deleteUserVerify({ /* input */ }) | Verify pending delete-user flow. Route: GET /delete-user/verify. |
athena.auth.error | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthErrorResponse | string>> | await athena.auth.error() | Error route passthrough. Route: GET /error. |
athena.auth.forgetPassword | (input: AthenaForgetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.forgetPassword({ /* input */ }) | Trigger password reset email flow. Route: POST /forget-password. |
athena.auth.getAccessToken | (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>> | await athena.auth.getAccessToken({ /* input */ }) | Get provider access token. Route: POST /get-access-token. |
athena.auth.getSession | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSessionResponse>> | await athena.auth.getSession() | Get current session. Route: GET /get-session. |
athena.auth.health | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthHealthResponse>> | await athena.auth.health() | Auth health route. Primary GET /health; falls back to GET /ok on 404. |
athena.auth.ok | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOkResponse>> | await athena.auth.ok() | Health route passthrough. Route: GET /ok. |
athena.auth.organization.checkSlug | (input: AthenaAuthOrganizationCheckSlugRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{ available: boolean;}>> | await athena.auth.organization.checkSlug({ /* input */ }) | Check if an organization slug is available. Route: POST /organization/check-slug. |
athena.auth.organization.create | (input: AthenaAuthOrganizationCreateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization>> | await athena.auth.organization.create({ /* input */ }) | Create an organization. Route: POST /organization/create. |
athena.auth.organization.delete | (input: AthenaAuthOrganizationDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.delete({ /* input */ }) | Delete an organization. Route: POST /organization/delete. |
athena.auth.organization.getFull | (input?: { query?: AthenaAuthOrganizationGetFullQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{ organization: AthenaAuthOrganization; members?: AthenaAuthOrganizationMember[]; invitations?: AthenaAuthOrganizationInvitation[];}>> | await athena.auth.organization.getFull() | Get organization details including related members/invitations. Route: GET /organization/get-full-organization. |
athena.auth.organization.hasPermission | (input: AthenaAdminHasPermissionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAdminHasPermissionResponse>> | await athena.auth.organization.hasPermission({ /* input */ }) | Check organization-level permissions for the current principal. Route: POST /organization/has-permission. |
athena.auth.organization.invitation.accept | (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.invitation.accept({ /* input */ }) | Accept an organization invitation. Route: POST /organization/accept-invitation. |
athena.auth.organization.invitation.cancel | (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.invitation.cancel({ /* input */ }) | Cancel an organization invitation. Route: POST /organization/cancel-invitation. |
athena.auth.organization.invitation.get | (input: { query: AthenaAuthOrganizationGetInvitationQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation>> | await athena.auth.organization.invitation.get({ /* input */ }) | Get an invitation by id. Route: GET /organization/get-invitation. |
athena.auth.organization.invitation.list | (input?: { query?: AthenaAuthOrganizationListInvitationsQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation[]>> | await athena.auth.organization.invitation.list() | List invitations for an organization. Route: GET /organization/list-invitations. |
athena.auth.organization.invitation.reject | (input: AthenaAuthOrganizationInvitationActionRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.invitation.reject({ /* input */ }) | Reject an organization invitation. Route: POST /organization/reject-invitation. |
athena.auth.organization.leave | (input: AthenaAuthOrganizationLeaveRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.leave({ /* input */ }) | Leave an organization. Route: POST /organization/leave. |
athena.auth.organization.list | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization[]>> | await athena.auth.organization.list() | List organizations visible to the current user. Route: GET /organization/list. |
athena.auth.organization.listUserInvitations | (input?: { query?: AthenaAuthOrganizationListUserInvitationsQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation[]>> | await athena.auth.organization.listUserInvitations() | List invitations for the current user. Route: GET /organization/list-user-invitations. |
athena.auth.organization.member.getActive | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationMember>> | await athena.auth.organization.member.getActive() | Get the active organization member context for the current session. Route: GET /organization/get-active-member. |
athena.auth.organization.member.invite | (input: AthenaAuthOrganizationInviteMemberRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationInvitation>> | await athena.auth.organization.member.invite({ /* input */ }) | Invite a member to an organization. Route: POST /organization/invite-member. |
athena.auth.organization.member.list | (input?: { query?: AthenaAuthOrganizationListMembersQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganizationMember[]>> | await athena.auth.organization.member.list() | List organization members. Route: GET /organization/list-members. |
athena.auth.organization.member.remove | (input: AthenaAuthOrganizationRemoveMemberRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.member.remove({ /* input */ }) | Remove an organization member. Route: POST /organization/remove-member. |
athena.auth.organization.member.updateRole | (input: AthenaAuthOrganizationUpdateMemberRoleRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.member.updateRole({ /* input */ }) | Update a member role. Route: POST /organization/update-member-role. |
athena.auth.organization.setActive | (input: AthenaAuthOrganizationSetActiveRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.organization.setActive({ /* input */ }) | Set active organization for current session. Route: POST /organization/set-active. |
athena.auth.organization.update | (input: AthenaAuthOrganizationUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthOrganization>> | await athena.auth.organization.update({ /* input */ }) | Update an organization. Route: POST /organization/update. |
athena.auth.passkey.deletePasskey | (input: AthenaPasskeyDeleteRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyDeleteResponse>> | await athena.auth.passkey.deletePasskey({ /* input */ }) | Delete a passkey. Route: POST /passkey/delete-passkey. |
athena.auth.passkey.generateAuthenticateOptions | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyOptionsResponse>> | await athena.auth.passkey.generateAuthenticateOptions() | Generate WebAuthn authentication options. Route: POST /passkey/generate-authenticate-options. |
athena.auth.passkey.generateRegisterOptions | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyOptionsResponse>> | await athena.auth.passkey.generateRegisterOptions() | Generate WebAuthn registration options. Route: GET /passkey/generate-register-options. |
athena.auth.passkey.getRelatedOrigins | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{ origins?: string[];}>> | await athena.auth.passkey.getRelatedOrigins() | Return related origins for WebAuthn. Route: GET /.well-known/webauthn. |
athena.auth.passkey.listUserPasskeys | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyRecord[]>> | await athena.auth.passkey.listUserPasskeys() | List current user's passkeys. Route: GET /passkey/list-user-passkeys. |
athena.auth.passkey.updatePasskey | (input: AthenaPasskeyUpdateRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyUpdateResponse>> | await athena.auth.passkey.updatePasskey({ /* input */ }) | Update a passkey metadata record. Route: POST /passkey/update-passkey. |
athena.auth.passkey.verifyAuthentication | (input: AthenaPasskeyVerifyAuthenticationRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyVerifyAuthenticationResponse>> | await athena.auth.passkey.verifyAuthentication({ /* input */ }) | Verify passkey authentication response. Route: POST /passkey/verify-authentication. |
athena.auth.passkey.verifyRegistration | (input: AthenaPasskeyVerifyRegistrationRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaPasskeyRecord>> | await athena.auth.passkey.verifyRegistration({ /* input */ }) | Verify passkey registration response. Route: POST /passkey/verify-registration. |
athena.auth.refreshToken | (input: AthenaOAuthAccountTokenRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaOAuthTokenBundle>> | await athena.auth.refreshToken({ /* input */ }) | Refresh provider token. Route: POST /refresh-token. |
athena.auth.resetPassword | AthenaAuthResetPasswordBinding | await athena.auth.resetPassword({ /* input */ }) | Reset password (POST /reset-password) and token resolver (GET /reset-password/{token}). |
athena.auth.resetPassword.token | (input: { token: string; callbackURL?: string;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{ token?: string;}>> | await athena.auth.resetPassword.token({ token: "token" }) | — |
athena.auth.sendVerificationEmail | (input: AthenaSendVerificationEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.sendVerificationEmail({ /* input */ }) | Send verification email. Route: POST /send-verification-email. |
athena.auth.session.list | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSession[]>> | await athena.auth.session.list() | List user sessions. Route: GET /list-sessions. |
athena.auth.session.revoke | AthenaAuthSessionRevokeBinding | await athena.auth.session.revoke({ /* input */ }) | Revoke one or multiple sessions; collapses to /revoke-session or /revoke-sessions by payload shape. |
athena.auth.session.revokeOther | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.session.revokeOther() | Revoke all other sessions for current user. Route: POST /revoke-other-sessions. |
athena.auth.setPassword | (input: AthenaSetPasswordRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.setPassword({ /* input */ }) | Set password for the current authenticated user. Route: POST /set-password. |
athena.auth.signIn.email | (input: AthenaEmailSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>> | await athena.auth.signIn.email({ /* input */ }) | Sign in with email and password. Route: POST /sign-in/email. |
athena.auth.signIn.social | (input: AthenaSocialSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse | AthenaAuthSignInResponse>> | await athena.auth.signIn.social({ /* input */ }) | Sign in with social provider. Route: POST /sign-in/social. |
athena.auth.signIn.username | (input: AthenaUsernameSignInRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>> | await athena.auth.signIn.username({ /* input */ }) | Sign in with username and password. Route: POST /sign-in/username. |
athena.auth.signOut | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignOutResponse>> | await athena.auth.signOut() | Sign out current session. Route: POST /sign-out. |
athena.auth.signUp.email | (input: AthenaEmailSignUpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSignInResponse>> | await athena.auth.signUp.email({ /* input */ }) | Sign up with email/password identity. Route: POST /sign-up/email. |
athena.auth.social.link | (input: AthenaLinkSocialRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthSocialRedirectResponse>> | await athena.auth.social.link({ /* input */ }) | Link a social provider to current user. Route: POST /link-social. |
athena.auth.twoFactor.disable | (input: AthenaTwoFactorDisableRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorDisableResponse>> | await athena.auth.twoFactor.disable({ /* input */ }) | Disable two-factor auth. Route: POST /two-factor/disable. |
athena.auth.twoFactor.enable | (input: AthenaTwoFactorEnableRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorEnableResponse>> | await athena.auth.twoFactor.enable({ /* input */ }) | Enable two-factor auth. Route: POST /two-factor/enable. |
athena.auth.twoFactor.generateBackupCodes | (input: AthenaTwoFactorGenerateBackupCodesRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorGenerateBackupCodesResponse>> | await athena.auth.twoFactor.generateBackupCodes({ /* input */ }) | Generate backup codes. Route: POST /two-factor/generate-backup-codes. |
athena.auth.twoFactor.getTotpUri | (input: AthenaTwoFactorGetTotpUriRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorGetTotpUriResponse>> | await athena.auth.twoFactor.getTotpUri({ /* input */ }) | Get TOTP URI for setup. Route: POST /two-factor/get-totp-uri. |
athena.auth.twoFactor.sendOtp | (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.twoFactor.sendOtp() | Send one-time passcode (OTP). Route: POST /two-factor/send-otp. |
athena.auth.twoFactor.verifyBackupCode | (input: AthenaTwoFactorVerifyBackupCodeRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyBackupCodeResponse>> | await athena.auth.twoFactor.verifyBackupCode({ /* input */ }) | Verify backup code. Route: POST /two-factor/verify-backup-code. |
athena.auth.twoFactor.verifyOtp | (input: AthenaTwoFactorVerifyOtpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyOtpResponse>> | await athena.auth.twoFactor.verifyOtp({ /* input */ }) | Verify OTP code. Route: POST /two-factor/verify-otp. |
athena.auth.twoFactor.verifyTotp | (input: AthenaTwoFactorVerifyTotpRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaTwoFactorVerifyTotpResponse>> | await athena.auth.twoFactor.verifyTotp({ /* input */ }) | Verify TOTP code. Route: POST /two-factor/verify-totp. |
athena.auth.user.delete | (input?: AthenaDeleteUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaDeleteUserResponse>> | await athena.auth.user.delete() | Delete current user. Route: POST /delete-user. |
athena.auth.user.email.list | (input?: { query?: AthenaAuthEmailListQuery;} & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthEmailListResponse>> | await athena.auth.user.email.list() | List email identities for current user. Routes: primary GET /email/list; falls back to GET /email-list on 404. |
athena.auth.user.update | (input: AthenaUpdateUserRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<AthenaAuthStatusResponse>> | await athena.auth.user.update({ /* input */ }) | Update current user profile fields. Route: POST /update-user. |
athena.auth.verifyEmail | (input: AthenaVerifyEmailRequest & AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<{ user: AthenaAuthUser; status: boolean;}>> | await athena.auth.verifyEmail({ /* input */ }) | Verify email token. Route: GET /verify-email. |
React Runtime Methods (@xylex-group/athena/react)
| Method | Signature | Example | Notes |
|---|---|---|---|
AthenaQueryClient.attachAdapter | (adapter: AthenaStateAdapter) => AthenaUnsubscribe | queryClient.attachAdapter(/* ... */) | — |
AthenaQueryClient.constructor | (config?: AthenaQueryClientConfig): AthenaQueryClient | const queryClient = new AthenaQueryClient({ cache: { mode: "memory" } }) | — |
AthenaQueryClient.executeMutation | <TVariables, TMutationFnData, TData = TMutationFnData>(input: ExecuteMutationInput<TVariables, TMutationFnData, TData>) => Promise<AthenaMutationResultData<TData>> | queryClient.executeMutation(/* ... */) | — |
AthenaQueryClient.executeQuery | <TQueryFnData, TData = TQueryFnData>(input: ExecuteQueryInput<TQueryFnData, TData>) => Promise<AthenaQueryResult<TData>> | queryClient.executeQuery(/* ... */) | — |
AthenaQueryClient.getMutationKeyToken | (mutationKey?: QueryKey) => string | queryClient.getMutationKeyToken(/* ... */) | — |
AthenaQueryClient.getMutationState | <TVariables = unknown, TData = unknown>(key: string) => AthenaMutationState<TVariables, TData> | queryClient.getMutationState(/* ... */) | — |
AthenaQueryClient.getQueryKeyToken | (queryKey: QueryKey) => string | queryClient.getQueryKeyToken(/* ... */) | — |
AthenaQueryClient.getQueryState | <TData = unknown>(key: string) => AthenaQueryState<TData> | queryClient.getQueryState(/* ... */) | — |
AthenaQueryClient.resetMutation | (mutationKey?: QueryKey) => void | queryClient.resetMutation(/* ... */) | — |
AthenaQueryClient.resetQuery | (queryKey: QueryKey) => void | queryClient.resetQuery(/* ... */) | — |
AthenaQueryClient.subscribeEvents | (listener: (event: AthenaRuntimeEvent) => void) => AthenaUnsubscribe | queryClient.subscribeEvents(/* ... */) | — |
AthenaQueryClient.subscribeMutation | (key: string, listener: () => void) => AthenaUnsubscribe | queryClient.subscribeMutation(/* ... */) | — |
AthenaQueryClient.subscribeQuery | (key: string, listener: () => void) => AthenaUnsubscribe | queryClient.subscribeQuery(/* ... */) | — |
react.AthenaQueryClientProvider | (props: AthenaQueryClientProviderProps) => import("C:/Users/floris/Documents/GitHub/athena-js/node_modules/.pnpm/@types+react@18.3.28/node_modules/@types/react/index").FunctionComponentElement<import("C:/Users/floris/Documents/GitHub/athena-js/node_modules/.pnpm/@types+react@18.3.28/node_modules/@types/react/index").ProviderProps<AthenaQueryClient>> | react.AthenaQueryClientProvider(/* ... */) | — |
react.attachStateAdapter | (client: AthenaQueryClient, adapter: AthenaStateAdapter) => AthenaUnsubscribe | react.attachStateAdapter(/* ... */) | — |
react.createAthenaQueryClient | (config?: AthenaQueryClientConfig) => AthenaQueryClient | react.createAthenaQueryClient(/* ... */) | — |
react.createModelFormAdapter | <TModel extends AnyModelDef>(model: TModel) => ModelFormAdapter<TModel> | react.createModelFormAdapter(/* ... */) | Creates a small model-aware adapter for form defaults and payload normalization. |
react.isAthenaGatewayError | (error: unknown) => error is AthenaGatewayError | react.isAthenaGatewayError(/* ... */) | — |
react.toModelFormDefaults | <TModel extends AnyModelDef, TMode extends ModelFormNullishMode = "empty-string">(model: TModel, values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>) => ModelFormDefaults<TModel, TMode> | react.toModelFormDefaults(/* ... */) | Normalizes model data into form-safe defaults using model nullability metadata. |
react.toModelPayload | <TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, "empty-string" | "undefined" | "null">>, options?: ToModelPayloadOptions) => Partial<InsertOf<TModel>> | react.toModelPayload(/* ... */) | Normalizes form values back into model-compatible insert/update payloads. |
react.useAthenaGateway | (config?: AthenaGatewayHookConfig) => AthenaGatewayHookResult | react.useAthenaGateway(/* ... */) | — |
react.useAthenaQueryClient | () => AthenaQueryClient | react.useAthenaQueryClient(/* ... */) | — |
react.useMutation | <TVariables, TMutationFnData, TData = TMutationFnData>(options: UseMutationOptions<TVariables, TMutationFnData, TData>) => UseMutationResult<TVariables, TData> | const mutation = useMutation({ mutationFn: (v) => athena.from("users").insert(v).select() }) | — |
react.useQuery | <TQueryFnData, TData = TQueryFnData>(options: UseQueryOptions<TQueryFnData, TData>) => UseQueryResult<TData> | const query = useQuery({ queryKey: ["users"], queryFn: () => athena.from("users").select() }) | — |
react.useSession | <TClient extends UseSessionAuthClient>(authClient: TClient, options?: UseSessionOptions) => UseSessionResult<InferSessionData<TClient>> | const session = useSession(athena) | Better Auth style session hook parity for Athena auth clients. |
react.useStorageUpload | (options: UseStorageUploadOptions) => UseStorageUploadResult | react.useStorageUpload(/* ... */) | — |
Cookie Methods (@xylex-group/athena/cookies)
| Method | Signature | Example | Notes |
|---|---|---|---|
cookies.createCookieGetter | (options: AthenaCookiesOptions) => (cookieName: string, overrideAttributes?: Partial<AthenaCookieOptions>) => AthenaAuthCookie | cookies.createCookieGetter(/* cookie inputs */) | — |
cookies.createSessionStore | (cookieName: string, cookieOptions: AthenaCookieOptions, ctx: AthenaCookieContextRuntime) => { getValue(): string; hasChunks(): boolean; chunk(value: string, options?: Partial<AthenaCookieOptions>): StoreCookie[]; clean(): StoreCookie[]; setCookies(cookies: StoreCookie[]): void;} | cookies.createSessionStore(/* ... */) | — |
cookies.deleteSessionCookie | (ctx: AthenaCookieContextRuntime, skipDontRememberMe?: boolean) => void | cookies.deleteSessionCookie(/* cookie inputs */) | — |
cookies.expireCookie | (ctx: AthenaCookieContextRuntime, cookie: AthenaAuthCookie) => void | cookies.expireCookie(/* cookie inputs */) | Expires a cookie by setting maxAge: 0 while preserving attributes. |
cookies.getAccountCookie | (ctx: AthenaCookieContextRuntime, cookieName?: string) => Promise<unknown | null> | cookies.getAccountCookie(/* cookie inputs */) | SDK helper to read an account cookie value. - If plain JSON: returns parsed value. - If base64url-encoded JSON: returns parsed value. - Otherwise: returns the raw cookie string. |
cookies.getChunkedCookie | (ctx: AthenaCookieContextRuntime, cookieName: string) => string | null | cookies.getChunkedCookie(/* cookie inputs */) | — |
cookies.getCookieCache | <SessionShape extends Record<string, unknown> = Record<string, unknown>, UserShape extends Record<string, unknown> = Record<string, unknown>>(request: Request | Headers, config?: AthenaGetCookieCacheConfig<SessionShape, UserShape>) => Promise<{ session: SessionShape; user: UserShape; updatedAt: number; version?: string;} | null> | cookies.getCookieCache(/* cookie inputs */) | — |
cookies.getCookies | (options: AthenaCookiesOptions) => AthenaAuthCookies | cookies.getCookies(/* cookie inputs */) | — |
cookies.getSessionCookie | (request: Request | Headers, config?: { cookiePrefix?: string; cookieName?: string; path?: string;} | undefined) => string | null | cookies.getSessionCookie(/* cookie inputs */) | — |
cookies.parseCookies | (cookieHeader: string) => Map<string, string> | cookies.parseCookies(/* cookie inputs */) | Parse a Cookie header into a key/value map. |
cookies.parseSetCookieHeader | (setCookie: string) => Map<string, CookieAttributes> | cookies.parseSetCookieHeader(/* cookie inputs */) | — |
cookies.setCookieCache | (ctx: AthenaCookieContextRuntime, session: AthenaSessionPair, dontRememberMe: boolean) => Promise<void> | cookies.setCookieCache(/* cookie inputs */) | — |
cookies.setCookieToHeader | (headers: Headers) => (context: { response: Response;}) => void | cookies.setCookieToHeader(/* cookie inputs */) | — |
cookies.setRequestCookie | (headers: Headers, name: string, value: string) => void | cookies.setRequestCookie(/* cookie inputs */) | Add or replace a cookie in the request Cookie header. |
cookies.setSessionCookie | (ctx: AthenaCookieContextRuntime, session: AthenaSessionPair, dontRememberMe?: boolean, overrides?: Partial<AthenaCookieOptions>) => Promise<void> | cookies.setSessionCookie(/* cookie inputs */) | — |
cookies.splitSetCookieHeader | (setCookie: string) => string[] | cookies.splitSetCookieHeader(/* cookie inputs */) | Split a comma-joined Set-Cookie header string into individual cookies. |
cookies.stripSecureCookiePrefix | (cookieName: string) => string | cookies.stripSecureCookiePrefix(/* cookie inputs */) | Remove __Secure- or __Host- prefix from cookie name. |
cookies.toCookieOptions | (attributes: CookieAttributes) => AthenaCookieOptions | cookies.toCookieOptions(/* cookie inputs */) | — |
Utilities (@xylex-group/athena/utils)
| Method | Signature | Example | Notes |
|---|---|---|---|
utils.asBoolean | (value: unknown) => boolean | utils.asBoolean(/* ... */) | — |
utils.asBooleanOrNull | (value: unknown) => boolean | null | utils.asBooleanOrNull(/* ... */) | — |
utils.asIdentifier | (value: unknown) => string | null | utils.asIdentifier(/* ... */) | — |
utils.asNumber | (value: unknown) => number | null | utils.asNumber(/* ... */) | — |
utils.asRecord | (value: unknown) => Record<string, unknown> | null | utils.asRecord(/* ... */) | — |
utils.asString | (value: unknown) => string | null | utils.asString(/* ... */) | — |
utils.asStringArray | (value: unknown) => string[] | utils.asStringArray(/* ... */) | — |
utils.clearAuthCookies | (options?: ClearAuthCookiesOptions) => string[] | utils.clearAuthCookies() | Clears Athena/Better Auth browser cookies by prefix. Returns the cookie names that matched and were targeted for deletion. |
utils.escapeLikePatternValue | (value: string) => string | utils.escapeLikePatternValue(/* ... */) | Escapes %, _, and \ for SQL LIKE / ILIKE patterns. |
utils.firstString | (record: Record<string, unknown> | null | undefined, keys: readonly string[]) => string | null | utils.firstString(/* ... */) | — |
utils.isLocalHostname | (hostname: string) => boolean | utils.isLocalHostname(/* ... */) | — |
utils.parseBooleanFlag | (rawValue: string | undefined, fallback: boolean) => boolean | utils.parseBooleanFlag(/* ... */) | — |
utils.proxyRequestHeaders | (request: Request) => Headers | utils.proxyRequestHeaders(/* ... */) | — |
utils.quoteSqlStringLiteral | (value: string) => string | utils.quoteSqlStringLiteral(/* ... */) | Wraps a string in a single-quoted SQL string literal. Prefer sqlText(...) for arbitrary raw SQL values when possible. |
utils.readTrimmedString | (value: unknown) => string | null | utils.readTrimmedString(/* ... */) | — |
utils.slugify | (input: string) => string | utils.slugify(/* ... */) | — |
utils.sqlBigInt | (value: bigint | number) => string | utils.sqlBigInt(/* ... */) | Renders an explicit bigint SQL literal. |
utils.sqlJsonbLiteral | (value: unknown) => string | utils.sqlJsonbLiteral(/* ... */) | Serializes a value and casts the result to jsonb. |
utils.sqlNullableText | (value: string | null | undefined) => string | utils.sqlNullableText(/* ... */) | Returns a dollar-quoted literal for strings, or the SQL keyword NULL for nullish values. |
utils.sqlText | (value: string) => string | utils.sqlText(/* ... */) | Wraps a string in a PostgreSQL dollar-quoted literal. Use this for SQL values, not identifiers. Pair with identifier(...) for table/column names. |
utils.trimTrailingSlashes | (value: string) => string | utils.trimTrailingSlashes(/* ... */) | — |