diff --git a/.prettierrc.mjs b/.prettierrc.mjs index 6eba02736..6a48a4e79 100644 --- a/.prettierrc.mjs +++ b/.prettierrc.mjs @@ -4,5 +4,6 @@ export default { printWidth: 100, tabWidth: 2, trailingComma: "all", + objectWrap: "preserve", plugins: ["prettier-plugin-tailwindcss"], } diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index 57a2b2fa2..9dfdb0c09 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -2,7 +2,7 @@ import * as hono_hono_base from 'hono/hono-base'; import * as hono_types from 'hono/types'; import * as hono_utils_http_status from 'hono/utils/http-status'; import { HttpBindings } from '@hono/node-server'; -import * as better_call from 'better-call'; +import * as better_auth from 'better-auth'; import * as zod from 'zod'; import { z } from 'zod'; import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core'; @@ -11,7 +11,6 @@ import * as drizzle_orm from 'drizzle-orm'; import { InferInsertModel, SQL } from 'drizzle-orm'; import * as better_auth_adapters_drizzle from 'better-auth/adapters/drizzle'; import * as better_auth_plugins from 'better-auth/plugins'; -import * as better_auth from 'better-auth'; type Env = { Bindings: HttpBindings; @@ -21,7 +20,7 @@ declare const authPlugins: ({ id: "customGetProviders"; endpoints: { customGetProviders: { - | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise; tx: zod.ZodNullable; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - type: "received" | "checking" | "completed" | "incomplete" | "audit"; id: string; userId: string; + type: "checking" | "completed" | "incomplete" | "audit" | "received"; actionId: number; progress: number; progressMax: number; @@ -280,9 +279,9 @@ declare const achievementsOpenAPISchema: zod.ZodObject<{ doneAt: string | null; tx: string | null; }, { - type: "received" | "checking" | "completed" | "incomplete" | "audit"; id: string; userId: string; + type: "checking" | "completed" | "incomplete" | "audit" | "received"; actionId: number; progress: number; progressMax: number; @@ -449,11 +448,11 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>; }, "strip", z.ZodTypeAny, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }>, "many">>; webhooks: z.ZodOptional>; @@ -472,7 +471,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; webhooks?: string[] | undefined; @@ -491,7 +490,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; webhooks?: string[] | undefined; @@ -522,7 +521,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; webhooks?: string[] | undefined; @@ -553,7 +552,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; webhooks?: string[] | undefined; @@ -663,11 +662,11 @@ declare const actionsOpenAPISchema: z.ZodObject; }, "strip", z.ZodTypeAny, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }>, "many">>; webhooks: z.ZodOptional>; @@ -686,7 +685,7 @@ declare const actionsOpenAPISchema: z.ZodObject>>; }>, "strip", z.ZodTypeAny, { + id: string; description: string | null; title: string | null; content: string | null; - id: string; author: string | null; url: string | null; language: string | null; @@ -2261,10 +2260,10 @@ declare const entriesOpenAPISchema: z.ZodObject; migrateTo: zod.ZodNullable; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - description: string | null; - title: string | null; id: string; image: string | null; + description: string | null; + title: string | null; url: string; siteUrl: string | null; checkedAt: string; @@ -2803,10 +2802,10 @@ declare const feedsOpenAPISchema: zod.ZodObject<{ language: string | null; migrateTo: string | null; }, { - description: string | null; - title: string | null; id: string; image: string | null; + description: string | null; + title: string | null; url: string; siteUrl: string | null; checkedAt: string; @@ -2962,17 +2961,17 @@ declare const subscriptionsOpenAPISchema: zod.ZodObject<{ createdAt: zod.ZodString; isPrivate: zod.ZodBoolean; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - title: string | null; createdAt: string; userId: string; + title: string | null; view: number; category: string | null; feedId: string; isPrivate: boolean; }, { - title: string | null; createdAt: string; userId: string; + title: string | null; view: number; category: string | null; feedId: string; @@ -3721,10 +3720,10 @@ declare const inboxesEntriesOpenAPISchema: z.ZodObject>>; }>, "strip", z.ZodTypeAny, { + id: string; description: string | null; title: string | null; content: string | null; - id: string; author: string | null; url: string | null; language: string | null; @@ -3759,10 +3758,10 @@ declare const inboxesEntriesOpenAPISchema: z.ZodObject; declare const inboxesEntriesInsertOpenAPISchema: z.ZodObject; description: z.ZodOptional>; title: z.ZodOptional>; content: z.ZodOptional>; - id: z.ZodOptional; author: z.ZodOptional>; url: z.ZodOptional>; language: z.ZodOptional>; @@ -4190,14 +4189,14 @@ declare const inboxesOpenAPISchema: z.ZodObject<{ secret: z.ZodString; title: z.ZodNullable; }, z.UnknownKeysParam, z.ZodTypeAny, { - title: string | null; handle: string; userId: string; + title: string | null; secret: string; }, { - title: string | null; handle: string; userId: string; + title: string | null; secret: string; }>; declare const inboxesRelations: drizzle_orm.Relations<"inboxes", { @@ -4536,10 +4535,10 @@ declare const listsOpenAPISchema: zod.ZodObject<{ language: zod.ZodNullable; ownerUserId: zod.ZodString; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - description: string | null; - title: string; id: string; image: string | null; + description: string | null; + title: string; view: number; ownerUserId: string; language: string | null; @@ -4547,10 +4546,10 @@ declare const listsOpenAPISchema: zod.ZodObject<{ fee: number; timelineUpdatedAt: string; }, { - description: string | null; - title: string; id: string; image: string | null; + description: string | null; + title: string; view: number; ownerUserId: string; language: string | null; @@ -4698,17 +4697,17 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{ createdAt: zod.ZodString; isPrivate: zod.ZodBoolean; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - title: string | null; createdAt: string; userId: string; + title: string | null; view: number; isPrivate: boolean; listId: string; lastViewedAt: string | null; }, { - title: string | null; createdAt: string; userId: string; + title: string | null; view: number; isPrivate: boolean; listId: string; @@ -5038,16 +5037,16 @@ declare const rsshubOpenAPISchema: zod.ZodObject<{ description: zod.ZodNullable; userLimit: zod.ZodNullable; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - description: string | null; id: string; + description: string | null; ownerUserId: string; baseUrl: string; accessKey: string | null; price: number; userLimit: number | null; }, { - description: string | null; id: string; + description: string | null; ownerUserId: string; baseUrl: string; accessKey: string | null; @@ -5398,6 +5397,23 @@ declare const user: drizzle_orm_pg_core.PgTableWithColumns<{ identity: undefined; generated: undefined; }, {}, {}>; + isAnonymous: drizzle_orm_pg_core.PgColumn<{ + name: "is_anonymous"; + tableName: "user"; + dataType: "boolean"; + columnType: "PgBoolean"; + data: boolean; + driverParam: boolean; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; }; dialect: "pg"; }>; @@ -5558,6 +5574,23 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ identity: undefined; generated: undefined; }, {}, {}>; + isAnonymous: drizzle_orm_pg_core.PgColumn<{ + name: "is_anonymous"; + tableName: "user"; + dataType: "boolean"; + columnType: "PgBoolean"; + data: boolean; + driverParam: boolean; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; }; dialect: "pg"; }>; @@ -5572,24 +5605,27 @@ declare const usersOpenApiSchema: zod.ZodObject; + isAnonymous: zod.ZodNullable; }, "email">, "strip", zod.ZodTypeAny, { - name: string | null; id: string; + name: string | null; emailVerified: boolean | null; image: string | null; handle: string | null; createdAt: Date; updatedAt: Date; twoFactorEnabled: boolean | null; + isAnonymous: boolean | null; }, { - name: string | null; id: string; + name: string | null; emailVerified: boolean | null; image: string | null; handle: string | null; createdAt: Date; updatedAt: Date; twoFactorEnabled: boolean | null; + isAnonymous: boolean | null; }>; declare const account: drizzle_orm_pg_core.PgTableWithColumns<{ name: "account"; @@ -6540,8 +6576,8 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{ createdAt: zod.ZodString; comment: zod.ZodNullable; }, zod.UnknownKeysParam, zod.ZodTypeAny, { - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; createdAt: string; + type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; hash: string; powerToken: string; fromUserId: string | null; @@ -6553,8 +6589,8 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{ tax: string; comment: string | null; }, { - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; createdAt: string; + type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; hash: string; powerToken: string; fromUserId: string | null; @@ -6869,7 +6905,7 @@ declare const auth: { handler: (request: Request) => Promise; api: better_auth.InferAPI<{ ok: { - ; @@ -7172,11 +7208,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; callbackOAuth: { - ; @@ -7255,11 +7291,11 @@ declare const auth: { isAction: false; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; getSession: { - ]>>; @@ -7341,6 +7377,16 @@ declare const auth: { image?: string | null | undefined | undefined; twoFactorEnabled: boolean | null | undefined; handle: string; + } & { + id: string; + email: string; + emailVerified: boolean; + name: string; + createdAt: Date; + updatedAt: Date; + image?: string | null | undefined | undefined; + isAnonymous?: boolean | null | undefined; + handle: string; }; } | null>; path: "/get-session"; @@ -7395,11 +7441,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; signOut: { - & zod.ZodObject<{ - handle: zod.ZodString; - } | { - handle: zod.ZodString; - }, zod.UnknownKeysParam, zod.ZodTypeAny, { - handle: string; - } | { - handle: string; - }, { - handle: string; - } | { - handle: string; - }>; + body: zod.ZodRecord; metadata: { + $Infer: { + body: ({ + name: string; + email: string; + password: string; + } & ({} | ({} & {}) | ({} & { + isAnonymous?: boolean | null | undefined; + }))) & { + handle: string; + } & { + handle?: string | null | undefined; + }; + }; openapi: { description: string; requestBody: { @@ -7582,32 +7617,21 @@ declare const auth: { path: "/sign-up/email"; options: { method: "POST"; - body: zod.ZodObject<{ - name: zod.ZodString; - email: zod.ZodString; - password: zod.ZodString; - }, zod.UnknownKeysParam, zod.ZodTypeAny, { - password: string; - email: string; - name: string; - }, { - password: string; - email: string; - name: string; - }> & zod.ZodObject<{ - handle: zod.ZodString; - } | { - handle: zod.ZodString; - }, zod.UnknownKeysParam, zod.ZodTypeAny, { - handle: string; - } | { - handle: string; - }, { - handle: string; - } | { - handle: string; - }>; + body: zod.ZodRecord; metadata: { + $Infer: { + body: ({ + name: string; + email: string; + password: string; + } & ({} | ({} & {}) | ({} & { + isAnonymous?: boolean | null | undefined; + }))) & { + handle: string; + } & { + handle?: string | null | undefined; + }; + }; openapi: { description: string; requestBody: { @@ -7675,11 +7699,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; signInEmail: { - ; @@ -7963,11 +7987,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyEmail: { - ; - use: better_call.Endpoint, better_call.EndpointOptions>[]; + use: better_auth.Endpoint, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -8036,7 +8060,7 @@ declare const auth: { token: string; callbackURL?: string | undefined; }>; - use: better_call.Endpoint, better_call.EndpointOptions>[]; + use: better_auth.Endpoint, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -8064,11 +8088,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; sendVerificationEmail: { - ; - use: better_call.Endpoint & { id: string; @@ -8221,7 +8245,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { responses: { @@ -8264,7 +8288,7 @@ declare const auth: { newEmail: string; callbackURL?: string | undefined; }>; - use: better_call.Endpoint & { id: string; @@ -8286,7 +8310,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { responses: { @@ -8312,11 +8336,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; changePassword: { - ; - use: better_call.Endpoint & { id: string; @@ -8353,7 +8377,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -8407,7 +8431,7 @@ declare const auth: { currentPassword: string; revokeOtherSessions?: boolean | undefined; }>; - use: better_call.Endpoint & { id: string; @@ -8429,7 +8453,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -8454,11 +8478,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; setPassword: { - & { id: string; @@ -8492,7 +8516,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }>]>(...ctx: C): Promise & { id: string; @@ -8533,37 +8557,16 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; updateUser: { - & zod.ZodObject<{ - name: zod.ZodOptional; - image: zod.ZodOptional; - }, zod.UnknownKeysParam, zod.ZodTypeAny, { - name?: string | undefined; - image?: string | null | undefined; - }, { - name?: string | undefined; - image?: string | null | undefined; - }>; - use: better_call.Endpoint; + use: better_auth.Endpoint & { id: string; @@ -8585,8 +8588,20 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { + $Infer: { + body: (({} | ({} & {}) | ({} & { + isAnonymous?: boolean | null | undefined; + })) & { + handle: string; + }) & { + handle?: string | null | undefined; + } & { + name?: string; + image?: string | null; + }; + }; openapi: { description: string; requestBody: { @@ -8635,29 +8650,8 @@ declare const auth: { path: "/update-user"; options: { method: "POST"; - body: zod.ZodObject<{ - handle: zod.ZodString; - } | { - handle: zod.ZodString; - }, zod.UnknownKeysParam, zod.ZodTypeAny, { - handle: string; - } | { - handle: string; - }, { - handle: string; - } | { - handle: string; - }> & zod.ZodObject<{ - name: zod.ZodOptional; - image: zod.ZodOptional; - }, zod.UnknownKeysParam, zod.ZodTypeAny, { - name?: string | undefined; - image?: string | null | undefined; - }, { - name?: string | undefined; - image?: string | null | undefined; - }>; - use: better_call.Endpoint; + use: better_auth.Endpoint & { id: string; @@ -8679,8 +8673,20 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { + $Infer: { + body: (({} | ({} & {}) | ({} & { + isAnonymous?: boolean | null | undefined; + })) & { + handle: string; + }) & { + handle?: string | null | undefined; + } & { + name?: string; + image?: string | null; + }; + }; openapi: { description: string; requestBody: { @@ -8722,13 +8728,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; deleteUser: { - & { id: string; @@ -8750,7 +8756,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; body: zod.ZodObject<{ callbackURL: zod.ZodOptional; password: zod.ZodOptional; @@ -8790,7 +8796,7 @@ declare const auth: { path: "/delete-user"; options: { method: "POST"; - use: better_call.Endpoint & { id: string; @@ -8812,7 +8818,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; body: zod.ZodObject<{ callbackURL: zod.ZodOptional; password: zod.ZodOptional; @@ -8844,11 +8850,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; forgetPasswordCallback: { - ; - use: better_call.Endpoint, better_call.EndpointOptions>[]; + use: better_auth.Endpoint, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -8893,7 +8899,7 @@ declare const auth: { }, { callbackURL: string; }>; - use: better_call.Endpoint, better_call.EndpointOptions>[]; + use: better_auth.Endpoint, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -8917,13 +8923,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; listSessions: { - & { id: string; @@ -8945,7 +8951,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; requireHeaders: true; metadata: { openapi: { @@ -8993,7 +8999,7 @@ declare const auth: { path: "/list-sessions"; options: { method: "GET"; - use: better_call.Endpoint & { id: string; @@ -9015,7 +9021,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; requireHeaders: true; metadata: { openapi: { @@ -9049,11 +9055,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; revokeSession: { - ; - use: better_call.Endpoint & { id: string; @@ -9084,7 +9090,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; requireHeaders: true; metadata: { openapi: { @@ -9121,7 +9127,7 @@ declare const auth: { }, { token: string; }>; - use: better_call.Endpoint & { id: string; @@ -9143,7 +9149,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; requireHeaders: true; metadata: { openapi: { @@ -9166,13 +9172,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; revokeSessions: { - & { id: string; @@ -9194,7 +9200,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; requireHeaders: true; metadata: { openapi: { @@ -9227,7 +9233,7 @@ declare const auth: { path: "/revoke-sessions"; options: { method: "POST"; - use: better_call.Endpoint & { id: string; @@ -9249,7 +9255,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; requireHeaders: true; metadata: { openapi: { @@ -9275,14 +9281,14 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; revokeOtherSessions: { - & { id: string; @@ -9304,7 +9310,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -9336,7 +9342,7 @@ declare const auth: { options: { method: "POST"; requireHeaders: true; - use: better_call.Endpoint & { id: string; @@ -9358,7 +9364,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -9382,11 +9388,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; linkSocialAccount: { - ; - use: better_call.Endpoint & { id: string; @@ -9421,7 +9427,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -9468,7 +9474,7 @@ declare const auth: { provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "reddit"; callbackURL?: string | undefined; }>; - use: better_call.Endpoint & { id: string; @@ -9490,7 +9496,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -9518,13 +9524,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; listUserAccounts: { - & { id: string; @@ -9546,7 +9552,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -9588,7 +9594,7 @@ declare const auth: { path: "/list-accounts"; options: { method: "GET"; - use: better_call.Endpoint & { id: string; @@ -9610,7 +9616,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { description: string; @@ -9640,11 +9646,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; deleteUserCallback: { - ; - use: better_call.Endpoint, better_call.EndpointOptions>[]; + use: better_auth.Endpoint, better_auth.EndpointOptions>[]; }>]>(...ctx: C): Promise; - use: better_call.Endpoint, better_call.EndpointOptions>[]; + use: better_auth.Endpoint, better_auth.EndpointOptions>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; unlinkAccount: { - ; - use: better_call.Endpoint & { id: string; @@ -9713,7 +9719,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }>]>(...ctx: C): Promise; - use: better_call.Endpoint & { id: string; @@ -9751,14 +9757,14 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; } & { customGetProviders: { - | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise; - use: better_call.Endpoint & { id: string; @@ -9857,7 +9863,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -9905,7 +9911,7 @@ declare const auth: { }, { password: string; }>; - use: better_call.Endpoint & { id: string; @@ -9927,7 +9933,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -9960,11 +9966,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; disableTwoFactor: { - ; - use: better_call.Endpoint & { id: string; @@ -9995,7 +10001,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -10034,7 +10040,7 @@ declare const auth: { }, { password: string; }>; - use: better_call.Endpoint & { id: string; @@ -10056,7 +10062,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -10081,11 +10087,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyBackupCode: { - ; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -10252,7 +10258,7 @@ declare const auth: { code: string; disableSession?: boolean | undefined; }>; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -10354,11 +10360,11 @@ declare const auth: { method: "*"; }>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; generateBackupCodes: { - ; - use: better_call.Endpoint & { id: string; @@ -10389,7 +10395,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }>]>(...ctx: C): Promise; - use: better_call.Endpoint & { id: string; @@ -10428,13 +10434,13 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; viewBackupCodes: { - ; }, "strip", zod.ZodTypeAny, { @@ -10604,7 +10610,7 @@ declare const auth: { path: "/two-factor/send-otp"; options: { method: "POST"; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -10729,11 +10735,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyTwoFactorOTP: { - ; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -10890,7 +10896,7 @@ declare const auth: { }, { code: string; }>; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -11015,13 +11021,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; generateTOTP: { - & { id: string; @@ -11043,7 +11049,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -11075,7 +11081,7 @@ declare const auth: { path: "/totp/generate"; options: { method: "POST"; - use: better_call.Endpoint & { id: string; @@ -11097,7 +11103,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -11122,13 +11128,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; getTOTPURI: { - & { id: string; @@ -11150,7 +11156,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; body: zod.ZodObject<{ password: zod.ZodString; }, "strip", zod.ZodTypeAny, { @@ -11189,7 +11195,7 @@ declare const auth: { path: "/two-factor/get-totp-uri"; options: { method: "POST"; - use: better_call.Endpoint & { id: string; @@ -11211,7 +11217,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; body: zod.ZodObject<{ password: zod.ZodString; }, "strip", zod.ZodTypeAny, { @@ -11243,11 +11249,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyTOTP: { - ; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -11404,7 +11410,7 @@ declare const auth: { }, { code: string; }>; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -11529,12 +11535,86 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; + headers: Headers; + }; + } & { + signInAnonymous: { + | undefined)?]>(...ctx: C): Promise; + path: "/sign-in/anonymous"; + options: { + method: "POST"; + metadata: { + openapi: { + description: string; + responses: { + 200: { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + user: { + $ref: string; + }; + session: { + $ref: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; } & { getSession: { - >; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; }>; @@ -11711,11 +11791,11 @@ declare const auth: { token: string; }): Promise; }; - plugins: (better_auth.BetterAuthPlugin | { + plugins: ({ id: "two-factor"; endpoints: { enableTwoFactor: { - ; - use: better_call.Endpoint & { id: string; @@ -11746,7 +11826,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -11794,7 +11874,7 @@ declare const auth: { }, { password: string; }>; - use: better_call.Endpoint & { id: string; @@ -11816,7 +11896,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -11849,11 +11929,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; disableTwoFactor: { - ; - use: better_call.Endpoint & { id: string; @@ -11884,7 +11964,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -11923,7 +12003,7 @@ declare const auth: { }, { password: string; }>; - use: better_call.Endpoint & { id: string; @@ -11945,7 +12025,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -11970,11 +12050,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyBackupCode: { - ; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -12141,7 +12221,7 @@ declare const auth: { code: string; disableSession?: boolean | undefined; }>; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -12243,11 +12323,11 @@ declare const auth: { method: "*"; }>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; generateBackupCodes: { - ; - use: better_call.Endpoint & { id: string; @@ -12278,7 +12358,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }>]>(...ctx: C): Promise; - use: better_call.Endpoint & { id: string; @@ -12317,13 +12397,13 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; viewBackupCodes: { - ; }, "strip", zod.ZodTypeAny, { @@ -12493,7 +12573,7 @@ declare const auth: { path: "/two-factor/send-otp"; options: { method: "POST"; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -12618,11 +12698,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyTwoFactorOTP: { - ; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -12779,7 +12859,7 @@ declare const auth: { }, { code: string; }>; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -12904,13 +12984,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; generateTOTP: { - & { id: string; @@ -12932,7 +13012,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -12964,7 +13044,7 @@ declare const auth: { path: "/totp/generate"; options: { method: "POST"; - use: better_call.Endpoint & { id: string; @@ -12986,7 +13066,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; metadata: { openapi: { summary: string; @@ -13011,13 +13091,13 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; getTOTPURI: { - & { id: string; @@ -13039,7 +13119,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; body: zod.ZodObject<{ password: zod.ZodString; }, "strip", zod.ZodTypeAny, { @@ -13078,7 +13158,7 @@ declare const auth: { path: "/two-factor/get-totp-uri"; options: { method: "POST"; - use: better_call.Endpoint & { id: string; @@ -13100,7 +13180,7 @@ declare const auth: { image?: string | null | undefined; }; }; - }>, better_call.EndpointOptions>[]; + }>, better_auth.EndpointOptions>[]; body: zod.ZodObject<{ password: zod.ZodString; }, "strip", zod.ZodTypeAny, { @@ -13132,11 +13212,11 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; verifyTOTP: { - ; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -13293,7 +13373,7 @@ declare const auth: { }, { code: string; }>; - use: better_call.Endpoint; }, "strip", zod.ZodTypeAny, { @@ -13418,7 +13498,7 @@ declare const auth: { }; }; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; }; @@ -13426,10 +13506,10 @@ declare const auth: { hooks: { after: { matcher(context: better_auth.HookEndpointContext<{ - returned: better_call.APIError | Response | Record; - endpoint: better_call.Endpoint; + returned: better_auth.APIError | Response | Record; + endpoint: better_auth.Endpoint; }>): boolean; - handler: better_call.Endpoint, better_call.EndpointOptions>; + } | undefined>, better_auth.EndpointOptions>; }[]; }; schema: { @@ -13483,11 +13563,131 @@ declare const auth: { window: number; max: number; }[]; + } | { + id: "expo"; + init: (ctx: better_auth.AuthContext) => { + options: { + trustedOrigins: string[]; + }; + }; + onRequest(request: Request, ctx: better_auth.AuthContext): Promise<{ + request: Request; + } | undefined>; + hooks: { + after: { + matcher(context: better_auth.HookEndpointContext<{ + returned: better_auth.APIError | Response | Record; + endpoint: better_auth.Endpoint; + }>): boolean; + handler: (ctx: better_auth.HookEndpointContext<{}>) => Promise; + }[]; + }; + } | { + id: "anonymous"; + endpoints: { + signInAnonymous: { + | undefined)?]>(...ctx: C): Promise; + path: "/sign-in/anonymous"; + options: { + method: "POST"; + metadata: { + openapi: { + description: string; + responses: { + 200: { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + user: { + $ref: string; + }; + session: { + $ref: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; + method: better_auth.Method | better_auth.Method[]; + headers: Headers; + }; + }; + hooks: { + after: { + matcher(context: better_auth.HookEndpointContext<{ + returned: better_auth.APIError | Response | Record; + endpoint: better_auth.Endpoint; + }>): boolean; + handler: better_auth.Endpoint, better_auth.EndpointOptions>; + }[]; + }; + schema: { + user: { + fields: { + isAnonymous: { + type: "boolean"; + required: false; + }; + }; + }; + }; + $ERROR_CODES: { + readonly FAILED_TO_CREATE_USER: "Failed to create user"; + readonly COULD_NOT_CREATE_SESSION: "Could not create session"; + readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously"; + }; } | { id: "custom-session"; endpoints: { getSession: { - >; }; - method: better_call.Method | better_call.Method[]; + method: better_auth.Method | better_auth.Method[]; headers: Headers; }; }; @@ -13562,7 +13762,7 @@ declare const auth: { id: "customGetProviders"; endpoints: { customGetProviders: { - | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise | undefined)?]>(...ctx: C): Promise