better-auth
Version:
The most comprehensive authentication framework for TypeScript.
385 lines • 11.3 kB
text/typescript
import * as z from "zod";
//#region src/api/routes/account.d.ts
declare const listUserAccounts: import("better-call").StrictEndpoint<"/list-accounts", {
method: "GET";
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
session: {
session: Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
user: Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
};
}>)[];
metadata: {
openapi: {
operationId: string;
description: string;
responses: {
"200": {
description: string;
content: {
"application/json": {
schema: {
type: "array";
items: {
type: string;
properties: {
id: {
type: string;
};
providerId: {
type: string;
};
createdAt: {
type: string;
format: string;
};
updatedAt: {
type: string;
format: string;
};
accountId: {
type: string;
};
userId: {
type: string;
};
scopes: {
type: string;
items: {
type: string;
};
};
};
required: string[];
};
};
};
};
};
};
};
};
}, {
scopes: string[];
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
providerId: string;
accountId: string;
}[]>;
declare const linkSocialAccount: import("better-call").StrictEndpoint<"/link-social", {
method: "POST";
requireHeaders: true;
body: z.ZodObject<{
callbackURL: z.ZodOptional<z.ZodString>;
provider: z.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
idToken: z.ZodOptional<z.ZodObject<{
token: z.ZodString;
nonce: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
refreshToken: z.ZodOptional<z.ZodString>;
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>;
requestSignUp: z.ZodOptional<z.ZodBoolean>;
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
errorCallbackURL: z.ZodOptional<z.ZodString>;
disableRedirect: z.ZodOptional<z.ZodBoolean>;
additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strip>;
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
session: {
session: Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
user: Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
};
}>)[];
metadata: {
openapi: {
description: string;
operationId: string;
responses: {
"200": {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
url: {
type: string;
description: string;
};
redirect: {
type: string;
description: string;
};
status: {
type: string;
};
};
required: string[];
};
};
};
};
};
};
};
}, {
url: string;
redirect: boolean;
}>;
declare const unlinkAccount: import("better-call").StrictEndpoint<"/unlink-account", {
method: "POST";
body: z.ZodObject<{
providerId: z.ZodString;
accountId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
session: {
session: Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
user: Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
};
}>)[];
metadata: {
openapi: {
description: string;
responses: {
"200": {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
status: {
type: string;
};
};
};
};
};
};
};
};
};
}, {
status: boolean;
}>;
declare const getAccessToken: import("better-call").StrictEndpoint<"/get-access-token", {
method: "POST";
body: z.ZodObject<{
providerId: z.ZodString;
accountId: z.ZodOptional<z.ZodString>;
userId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
metadata: {
openapi: {
description: string;
responses: {
200: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
tokenType: {
type: string;
};
idToken: {
type: string;
};
accessToken: {
type: string;
};
accessTokenExpiresAt: {
type: string;
format: string;
};
};
};
};
};
};
400: {
description: string;
};
};
};
};
}, {
accessToken: string;
accessTokenExpiresAt: Date | undefined;
scopes: string[];
idToken: string | undefined;
}>;
declare const refreshToken: import("better-call").StrictEndpoint<"/refresh-token", {
method: "POST";
body: z.ZodObject<{
providerId: z.ZodString;
accountId: z.ZodOptional<z.ZodString>;
userId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
metadata: {
openapi: {
description: string;
responses: {
200: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
tokenType: {
type: string;
};
idToken: {
type: string;
};
accessToken: {
type: string;
};
refreshToken: {
type: string;
};
accessTokenExpiresAt: {
type: string;
format: string;
};
refreshTokenExpiresAt: {
type: string;
format: string;
};
};
};
};
};
};
400: {
description: string;
};
};
};
};
}, {
accessToken: string | undefined;
refreshToken: string;
accessTokenExpiresAt: Date | undefined;
refreshTokenExpiresAt: Date | null | undefined;
scope: string | null | undefined;
idToken: string | null | undefined;
providerId: string;
accountId: string;
}>;
declare const accountInfo: import("better-call").StrictEndpoint<"/account-info", {
method: "GET";
metadata: {
openapi: {
description: string;
responses: {
"200": {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
user: {
type: string;
properties: {
id: {
type: string;
};
name: {
type: string;
};
email: {
type: string;
};
image: {
type: string;
};
emailVerified: {
type: string;
};
};
required: string[];
};
data: {
type: string;
properties: {};
additionalProperties: boolean;
};
};
required: string[];
additionalProperties: boolean;
};
};
};
};
};
};
};
query: z.ZodOptional<z.ZodObject<{
accountId: z.ZodOptional<z.ZodString>;
providerId: z.ZodOptional<z.ZodString>;
userId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, {
user: import("@better-auth/core/oauth2").OAuth2UserInfo;
data: Record<string, any>;
} | null>;
//#endregion
export { accountInfo, getAccessToken, linkSocialAccount, listUserAccounts, refreshToken, unlinkAccount };