mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
* Add Xata adapter * Adjust slogan * Namespace tables for better DX * Fix types * Adjust docs * Import type only * Add scripts * Fix types * Update packages/adapter-xata/package.json Co-authored-by: Balázs Orbán <info@balazsorban.com> * Update packages/adapter-xata/package.json Co-authored-by: Balázs Orbán <info@balazsorban.com> * Update packages/adapter-xata/src/index.ts Co-authored-by: Balázs Orbán <info@balazsorban.com> * Update packages/adapter-xata/src/index.ts Co-authored-by: Balázs Orbán <info@balazsorban.com> * Update packages/adapter-xata/src/index.ts Co-authored-by: Balázs Orbán <info@balazsorban.com> * Update docs/docs/adapters/xata.md Co-authored-by: Balázs Orbán <info@balazsorban.com> * Update docs/docs/adapters/xata.md Co-authored-by: Balázs Orbán <info@balazsorban.com> * Address more comments * Clarify codegen * Fix by adding src * Fix types * More cleanup * Fix import * Clean up model * Adjust docs * Update docs * Housekeeping * Add tests * Update lockfile * Update packages/adapter-xata/tsconfig.json Co-authored-by: Thang Vu <hi@thvu.dev> * Update packages/adapter-xata/src/index.ts Co-authored-by: Balázs Orbán <info@balazsorban.com> Co-authored-by: Thang Vu <hi@thvu.dev>
94 lines
2.3 KiB
TypeScript
94 lines
2.3 KiB
TypeScript
/**
|
|
* This file is auto-generated from Xata and corresponds
|
|
* to the database types in the Xata database. Please do not
|
|
* augment by hand.
|
|
*/
|
|
import {
|
|
buildClient,
|
|
BaseClientOptions,
|
|
XataRecord,
|
|
ClientConstructor,
|
|
} from "@xata.io/client"
|
|
|
|
export interface NextauthUser {
|
|
email?: string | null
|
|
emailVerified?: Date | null
|
|
name?: string | null
|
|
image?: string | null
|
|
}
|
|
|
|
export type NextauthUserRecord = NextauthUser & XataRecord
|
|
|
|
export interface NextauthAccount {
|
|
user?: NextauthUserRecord | null
|
|
type?: string | null
|
|
provider?: string | null
|
|
providerAccountId?: string | null
|
|
refresh_token?: string | null
|
|
access_token?: string | null
|
|
expires_at?: number | null
|
|
token_type?: string | null
|
|
scope?: string | null
|
|
id_token?: string | null
|
|
session_state?: string | null
|
|
}
|
|
|
|
export type NextauthAccountRecord = NextauthAccount & XataRecord
|
|
|
|
export interface NextauthVerificationToken {
|
|
identifier?: string | null
|
|
token?: string | null
|
|
expires?: Date | null
|
|
}
|
|
|
|
export type NextauthVerificationTokenRecord = NextauthVerificationToken &
|
|
XataRecord
|
|
|
|
export interface NextauthUsersAccount {
|
|
user?: NextauthUserRecord | null
|
|
account?: NextauthAccountRecord | null
|
|
}
|
|
|
|
export type NextauthUsersAccountRecord = NextauthUsersAccount & XataRecord
|
|
|
|
export interface NextauthUsersSession {
|
|
user?: NextauthUserRecord | null
|
|
session?: NextauthSessionRecord | null
|
|
}
|
|
|
|
export type NextauthUsersSessionRecord = NextauthUsersSession & XataRecord
|
|
|
|
export interface NextauthSession {
|
|
sessionToken?: string | null
|
|
expires?: Date | null
|
|
user?: NextauthUserRecord | null
|
|
}
|
|
|
|
export type NextauthSessionRecord = NextauthSession & XataRecord
|
|
|
|
export type DatabaseSchema = {
|
|
nextauth_users: NextauthUser
|
|
nextauth_accounts: NextauthAccount
|
|
nextauth_verificationTokens: NextauthVerificationToken
|
|
nextauth_users_accounts: NextauthUsersAccount
|
|
nextauth_users_sessions: NextauthUsersSession
|
|
nextauth_sessions: NextauthSession
|
|
}
|
|
|
|
const tables = [
|
|
"nextauth_users",
|
|
"nextauth_accounts",
|
|
"nextauth_verificationTokens",
|
|
"nextauth_users_accounts",
|
|
"nextauth_users_sessions",
|
|
"nextauth_sessions",
|
|
]
|
|
|
|
const DatabaseClient = buildClient() as ClientConstructor<any>
|
|
|
|
export class XataClient extends DatabaseClient<DatabaseSchema> {
|
|
constructor(options?: BaseClientOptions) {
|
|
super({ databaseURL: "", ...options }, tables)
|
|
}
|
|
}
|