From bb529c498a7e2d0408b7de9e1d2f78db9a8b0d0f Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 10 Dec 2024 22:27:42 +0800 Subject: [PATCH] fix: break hono types Signed-off-by: Innei --- packages/shared/src/hono.ts | 306 +++++++++++++----------------------- 1 file changed, 112 insertions(+), 194 deletions(-) diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index ffb075789..a8ef01ca3 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -24,7 +24,12 @@ declare const authPlugins: ({ method: "GET"; }> | undefined)?]>(...ctx: C): Promise; + }] ? Response : { + [k: string]: { + id: string; + name: string; + }; + }>; path: "/get-providers"; options: { method: "GET"; @@ -53,23 +58,6 @@ declare const authPlugins: ({ headers: Headers; }; }; -} | { - id: "updateUserccc"; - endpoints: { - updateUserccc: { - | undefined)?]>(...ctx: C): Promise; - path: "/update-user-ccc"; - options: { - method: "POST"; - }; - method: better_call.Method | better_call.Method[]; - headers: Headers; - }; - }; })[]; declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{ @@ -4747,10 +4735,10 @@ declare const user: drizzle_orm_pg_core.PgTableWithColumns<{ emailVerified: drizzle_orm_pg_core.PgColumn<{ name: "emailVerified"; tableName: "user"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; @@ -4890,10 +4878,10 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ emailVerified: drizzle_orm_pg_core.PgColumn<{ name: "emailVerified"; tableName: "user"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; @@ -4980,7 +4968,7 @@ declare const usersOpenApiSchema: z.ZodObject; email: z.ZodString; - emailVerified: z.ZodNullable; + emailVerified: z.ZodNullable; image: z.ZodNullable; handle: z.ZodNullable; createdAt: z.ZodDate; @@ -4988,7 +4976,7 @@ declare const usersOpenApiSchema: z.ZodObject, z.UnknownKeysParam, z.ZodTypeAny, { name: string | null; id: string; - emailVerified: boolean | null; + emailVerified: string | null; image: string | null; handle: string | null; createdAt: Date; @@ -4996,7 +4984,7 @@ declare const usersOpenApiSchema: z.ZodObject; - disableRefresh: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; }, { disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; }>>; requireHeaders: true; metadata: { @@ -6614,7 +6599,12 @@ declare const auth: { method: "GET"; }> | undefined)?]>(...ctx: C): Promise; + }] ? Response : { + [k: string]: { + id: string; + name: string; + }; + }>; path: "/get-providers"; options: { method: "GET"; @@ -6638,19 +6628,6 @@ declare const auth: { method: better_call.Method | better_call.Method[]; headers: Headers; }; - updateUserccc: { - | undefined)?]>(...ctx: C): Promise; - path: "/update-user-ccc"; - options: { - method: "POST"; - }; - method: better_call.Method | better_call.Method[]; - headers: Headers; - }; signInSocial: { ]>(...ctx: C): Promise; @@ -8034,20 +7989,20 @@ declare const auth: { ; + image: zod.ZodOptional; + }, zod.UnknownKeysParam, zod.ZodTypeAny, { + name?: string | undefined; + image?: string | undefined; + }, { + name?: string | undefined; + image?: string | undefined; + }> & zod.ZodObject<{ handle: zod.ZodString; }, zod.UnknownKeysParam, zod.ZodTypeAny, { 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; + image: zod.ZodOptional; + }, zod.UnknownKeysParam, zod.ZodTypeAny, { + name?: string | undefined; + image?: string | undefined; + }, { + name?: string | undefined; + image?: string | undefined; + }> & zod.ZodObject<{ handle: zod.ZodString; }, zod.UnknownKeysParam, zod.ZodTypeAny, { 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_call.Endpoint & { @@ -8248,15 +8210,19 @@ declare const auth: { }; }; }; - }> | undefined)?]>(...ctx: C): Promise]>(...ctx: C): Promise; + }] ? Response : null>; path: "/delete-user"; options: { method: "POST"; + body: zod.ZodObject<{ + password: zod.ZodString; + }, "strip", zod.ZodTypeAny, { + password: string; + }, { + password: string; + }>; use: better_call.Endpoint & { @@ -9105,36 +9071,6 @@ declare const auth: { method: better_call.Method | better_call.Method[]; headers: Headers; }; - deleteUserCallback: { - ; - }>]>(...ctx: C): Promise; - path: "/delete-user/callback"; - options: { - method: "GET"; - query: zod.ZodObject<{ - token: zod.ZodString; - }, "strip", zod.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - }; - method: better_call.Method | better_call.Method[]; - headers: Headers; - }; }; options: { appName: string; @@ -9180,6 +9116,7 @@ declare const auth: { }): Promise; options: better_auth_adapters_drizzle.DrizzleAdapterConfig; }; + baseUrl: string | undefined; basePath: string; trustedOrigins: string[]; user: { @@ -9189,32 +9126,25 @@ declare const auth: { }; }; }; - account: { + accounts: { accountLinking: { - enabled: true; - trustedProviders: ("github" | "apple" | "google")[]; + enabled: boolean; + trustedProviders: string[]; }; }; socialProviders: { google: { clientId: string; clientSecret: string; - redirectURI: string; }; github: { clientId: string; clientSecret: string; - redirectURI: string; }; apple: { - enabled: boolean; clientId: string; clientSecret: string; - redirectURI: string; - }; - }; - emailAndPassword: { - enabled: true; + } | undefined; }; plugins: ({ id: "custom-session"; @@ -9277,7 +9207,12 @@ declare const auth: { method: "GET"; }> | undefined)?]>(...ctx: C): Promise; + }] ? Response : { + [k: string]: { + id: string; + name: string; + }; + }>; path: "/get-providers"; options: { method: "GET"; @@ -9306,23 +9241,6 @@ declare const auth: { headers: Headers; }; }; - } | { - id: "updateUserccc"; - endpoints: { - updateUserccc: { - | undefined)?]>(...ctx: C): Promise; - path: "/update-user-ccc"; - options: { - method: "POST"; - }; - method: better_call.Method | better_call.Method[]; - headers: Headers; - }; - }; })[]; }; $context: Promise; @@ -9808,7 +9726,7 @@ declare const _routes: hono_hono_base.HonoBase