diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 1b012501f..04675b97b 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -46,7 +46,6 @@ updates: patterns: - immer - re-resizable - - hono - electron-context-menu - "@mozilla/readability" - daisyui diff --git a/.prettierignore b/.prettierignore index 1d4f6902f..165674e58 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,3 @@ -packages/internal/shared/src/hono.ts pnpm-lock.yaml CHANGELOG.md diff --git a/apps/desktop/layer/main/package.json b/apps/desktop/layer/main/package.json index 55f4ee216..f0334b0ba 100644 --- a/apps/desktop/layer/main/package.json +++ b/apps/desktop/layer/main/package.json @@ -58,7 +58,6 @@ "@types/node": "24.5.0", "electron": "37.2.0", "electron-devtools-installer": "4.0.0", - "hono": "4.9.7", "typescript": "catalog:" } } diff --git a/apps/desktop/layer/main/src/lib/api-client.ts b/apps/desktop/layer/main/src/lib/api-client.ts index cc566ccac..bf171a91d 100644 --- a/apps/desktop/layer/main/src/lib/api-client.ts +++ b/apps/desktop/layer/main/src/lib/api-client.ts @@ -53,14 +53,14 @@ followClient.addResponseInterceptor(({ response }) => { return response }) -followClient.addErrorInterceptor(async ({ error, response }) => { +followClient.addErrorInterceptor(async ({ response, error }) => { if (!response) { logger.error("API Request failed - no response", error) return error } +}) - logger.error(`API Request failed: ${response.status} ${response.statusText}`, error) - +followClient.addResponseInterceptor(async ({ response }) => { // Handle specific error cases if needed in main process if (response.status === 401) { logger.warn("Authentication failed in main process") @@ -73,7 +73,7 @@ followClient.addErrorInterceptor(async ({ error, response }) => { // ignore JSON parsing errors } - return error + return response }) // Legacy export for compatibility diff --git a/apps/desktop/layer/main/src/manager/app.ts b/apps/desktop/layer/main/src/manager/app.ts index 5cab6fd74..1394a739c 100644 --- a/apps/desktop/layer/main/src/manager/app.ts +++ b/apps/desktop/layer/main/src/manager/app.ts @@ -2,7 +2,6 @@ import { PushReceiver } from "@eneris/push-receiver" import { callWindowExpose } from "@follow/shared/bridge" import { APP_PROTOCOL, DEV, LEGACY_APP_PROTOCOL } from "@follow/shared/constants" import { env } from "@follow/shared/env.desktop" -import type { MessagingData } from "@follow/shared/hono" import { app, nativeTheme, Notification, shell } from "electron" import contextMenu from "electron-context-menu" import path from "pathe" @@ -121,12 +120,15 @@ class AppManagerStatic { logger.info( `PushReceiver received notification: ${JSON.stringify(notification.message.data)}`, ) - const data = notification.message.data as MessagingData + const { data } = notification.message + if (!data) { + return + } switch (data.type) { case "new-entry": { const notification = new Notification({ - title: data.title, - body: data.description, + title: data.title as string, + body: data.description as string, }) notification.on("click", () => { const mainWindow = WindowManager.getMainWindowOrCreate() @@ -134,9 +136,9 @@ class AppManagerStatic { mainWindow.focus() const handlers = callWindowExpose(mainWindow) handlers.navigateEntry({ - feedId: data.feedId, - entryId: data.entryId, - view: Number.parseInt(data.view), + feedId: data.feedId as string, + entryId: data.entryId as string, + view: Number.parseInt(data.view as string), }) }) notification.show() diff --git a/apps/desktop/layer/renderer/src/atoms/settings/general.ts b/apps/desktop/layer/renderer/src/atoms/settings/general.ts index 4dec0ba1b..9da664f7b 100644 --- a/apps/desktop/layer/renderer/src/atoms/settings/general.ts +++ b/apps/desktop/layer/renderer/src/atoms/settings/general.ts @@ -1,8 +1,8 @@ import { createSettingAtom } from "@follow/atoms/helper/setting.js" -import type { SupportedLanguages } from "@follow/models" import { defaultGeneralSettings } from "@follow/shared/settings/defaults" import { hookEnhancedSettings as baseHookEnhancedSettings } from "@follow/shared/settings/hook" import type { GeneralSettings as BaseGeneralSettings } from "@follow/shared/settings/interface" +import type { SupportedLanguages } from "@follow-app/client-sdk" import { jotaiStore } from "~/lib/jotai" import { getDefaultLanguage } from "~/lib/language" diff --git a/apps/desktop/layer/renderer/src/components/ui/media/PreviewMediaContent.tsx b/apps/desktop/layer/renderer/src/components/ui/media/PreviewMediaContent.tsx index 7f40eefa4..6e5671a72 100644 --- a/apps/desktop/layer/renderer/src/components/ui/media/PreviewMediaContent.tsx +++ b/apps/desktop/layer/renderer/src/components/ui/media/PreviewMediaContent.tsx @@ -1,9 +1,9 @@ import { Spring } from "@follow/components/constants/spring.js" import { MotionButtonBase } from "@follow/components/ui/button/index.js" import { IN_ELECTRON } from "@follow/shared/constants" -import type { MediaModel } from "@follow/shared/hono" import { stopPropagation } from "@follow/utils/dom" import { cn } from "@follow/utils/utils" +import type { EntryMedia } from "@follow-app/client-sdk" import useEmblaCarousel from "embla-carousel-react" import { WheelGesturesPlugin } from "embla-carousel-wheel-gestures" import { useAnimationControls } from "motion/react" @@ -255,7 +255,7 @@ const HeaderActions: FC<{ ) } -export interface PreviewMediaProps extends MediaModel { +export interface PreviewMediaProps extends EntryMedia { fallbackUrl?: string } export const PreviewMediaContent: FC<{ @@ -299,7 +299,7 @@ export const PreviewMediaContent: FC<{ if (media.length === 0) return null if (media.length === 1) { - const src = media[0]!.url + const src = media[0]!.url! const { type } = media[0]! const isVideo = type === "video" return ( diff --git a/apps/desktop/layer/renderer/src/components/ui/media/SwipeMedia.tsx b/apps/desktop/layer/renderer/src/components/ui/media/SwipeMedia.tsx index 428fb9c62..3fe70061f 100644 --- a/apps/desktop/layer/renderer/src/components/ui/media/SwipeMedia.tsx +++ b/apps/desktop/layer/renderer/src/components/ui/media/SwipeMedia.tsx @@ -1,4 +1,4 @@ -import type { MediaModel } from "@follow/shared/hono" +import type { MediaModel } from "@follow/database/schemas/types" import { stopPropagation } from "@follow/utils/dom" import { cn } from "@follow/utils/utils" import useEmblaCarousel from "embla-carousel-react" diff --git a/apps/desktop/layer/renderer/src/components/ui/media/VideoPlayer.tsx b/apps/desktop/layer/renderer/src/components/ui/media/VideoPlayer.tsx index 15cb0ad3f..0f86f4db4 100644 --- a/apps/desktop/layer/renderer/src/components/ui/media/VideoPlayer.tsx +++ b/apps/desktop/layer/renderer/src/components/ui/media/VideoPlayer.tsx @@ -1,4 +1,3 @@ -"~/components/common/Focusable.js" import { Spring } from "@follow/components/constants/spring.js" import { ActionButton, MotionButtonBase } from "@follow/components/ui/button/index.js" import type { HTMLMediaState } from "@follow/hooks" diff --git a/apps/desktop/layer/renderer/src/components/ui/peek-modal/EntryToastPreview.tsx b/apps/desktop/layer/renderer/src/components/ui/peek-modal/EntryToastPreview.tsx index 9b2652914..ba5f420d9 100644 --- a/apps/desktop/layer/renderer/src/components/ui/peek-modal/EntryToastPreview.tsx +++ b/apps/desktop/layer/renderer/src/components/ui/peek-modal/EntryToastPreview.tsx @@ -90,7 +90,7 @@ export const EntryToastPreview = ({ entryId }: { entryId: string }) => { diff --git a/apps/desktop/layer/renderer/src/initialize/analytics.ts b/apps/desktop/layer/renderer/src/initialize/analytics.ts index 00284e14e..6275eebee 100644 --- a/apps/desktop/layer/renderer/src/initialize/analytics.ts +++ b/apps/desktop/layer/renderer/src/initialize/analytics.ts @@ -1,6 +1,6 @@ import { env } from "@follow/shared/env.desktop" -import type { AuthSession } from "@follow/shared/hono" import { setFirebaseTracker, setPostHogTracker, tracker } from "@follow/tracker" +import type { AuthSessionResponse } from "@follow-app/client-sdk" import posthog from "posthog-js" import { QUERY_PERSIST_KEY } from "~/constants/app" @@ -25,7 +25,7 @@ export const initAnalytics = async () => { }), ) - let session: AuthSession | undefined + let session: AuthSessionResponse | undefined try { const queryData = JSON.parse(window.localStorage.getItem(QUERY_PERSIST_KEY) ?? "{}") session = queryData.clientState.queries.find( diff --git a/apps/desktop/layer/renderer/src/initialize/helper.ts b/apps/desktop/layer/renderer/src/initialize/helper.ts index 44377d5a2..da5ea036f 100644 --- a/apps/desktop/layer/renderer/src/initialize/helper.ts +++ b/apps/desktop/layer/renderer/src/initialize/helper.ts @@ -1,7 +1,7 @@ -import type { UserModel } from "@follow/models" import { tracker } from "@follow/tracker" +import type { AuthUser } from "@follow-app/client-sdk" -export const setIntegrationIdentify = async (user: UserModel) => { +export const setIntegrationIdentify = async (user: AuthUser) => { tracker.identify(user) await import("@sentry/react").then(({ setTag }) => { setTag("user_id", user.id) diff --git a/apps/desktop/layer/renderer/src/lib/api-client.ts b/apps/desktop/layer/renderer/src/lib/api-client.ts index cada22f55..7f500e3bf 100644 --- a/apps/desktop/layer/renderer/src/lib/api-client.ts +++ b/apps/desktop/layer/renderer/src/lib/api-client.ts @@ -45,8 +45,6 @@ followClient.addResponseInterceptor(({ response }) => { }) followClient.addErrorInterceptor(async ({ error, response }) => { - const { router } = window - // If api is down if ((!response || response.status === 0) && navigator.onLine) { setApiStatus(NetworkStatus.OFFLINE) @@ -58,6 +56,11 @@ followClient.addErrorInterceptor(async ({ error, response }) => { return error } + return error +}) + +followClient.addResponseInterceptor(async ({ response }) => { + const { router } = window if (response.status === 401) { // Or we can present LoginModal here. // router.navigate("/login") @@ -66,8 +69,12 @@ followClient.addErrorInterceptor(async ({ error, response }) => { userActions.removeCurrentUser() } try { + const isJSON = response.headers.get("content-type")?.includes("application/json") + if (!isJSON) return response const json = await response.clone().json() + const isError = response.status >= 400 + if (!isError) return response if (response.status === 400 && json.code === 1003) { router.navigate("/invitation") } @@ -94,5 +101,5 @@ followClient.addErrorInterceptor(async ({ error, response }) => { // ignore } - return error + return response }) diff --git a/apps/desktop/layer/renderer/src/lib/api-fetch.ts b/apps/desktop/layer/renderer/src/lib/api-fetch.ts index c48ce9961..e2c8918b2 100644 --- a/apps/desktop/layer/renderer/src/lib/api-fetch.ts +++ b/apps/desktop/layer/renderer/src/lib/api-fetch.ts @@ -1,11 +1,9 @@ import { DEV } from "@follow/shared/constants" import { env } from "@follow/shared/env.desktop" -import type { AppType } from "@follow/shared/hono" import { userActions } from "@follow/store/user/store" import { createDesktopAPIHeaders } from "@follow/utils/headers" import PKG from "@pkg" -import { hc } from "hono/client" -import { FetchError, ofetch } from "ofetch" +import { ofetch } from "ofetch" import { createElement } from "react" import { toast } from "sonner" @@ -84,16 +82,6 @@ export const apiFetch = ofetch.create({ }, }) -export const apiClient = hc(env.VITE_API_URL, { - fetch: async (input, options = {}) => - apiFetch(input.toString(), options).catch((err) => { - if (err instanceof FetchError && !err.response) { - setApiStatus(NetworkStatus.OFFLINE) - } - throw err - }), -}) - if (DEV) { DebugRegistry.add("Activation Toast", () => { setTimeout(() => { diff --git a/apps/desktop/layer/renderer/src/lib/ga4.ts b/apps/desktop/layer/renderer/src/lib/ga4.ts index 943f10ed6..53c3fa0e7 100644 --- a/apps/desktop/layer/renderer/src/lib/ga4.ts +++ b/apps/desktop/layer/renderer/src/lib/ga4.ts @@ -1,6 +1,7 @@ -import { apiClient } from "~/lib/api-fetch" import { getClientId, getSessionId } from "~/lib/client-session" +import { followClient } from "./api-client" + class Analytics4 { private clientID: string private sessionID: string @@ -46,8 +47,8 @@ class Analytics4 { user_properties: this.userProperties, } - return apiClient.data.g.$post({ - json: payload, + return followClient.api.data.sendAnalytics({ + ...payload, }) } } diff --git a/apps/desktop/layer/renderer/src/lib/translate.ts b/apps/desktop/layer/renderer/src/lib/translate.ts index 7d7749f3e..c82461633 100644 --- a/apps/desktop/layer/renderer/src/lib/translate.ts +++ b/apps/desktop/layer/renderer/src/lib/translate.ts @@ -15,7 +15,7 @@ export const checkLanguage = ({ const pureContent = parseHtml(content) .toText() .replaceAll(/https?:\/\/\S+|www\.\S+/g, " ") - const { code } = ACTION_LANGUAGE_MAP[language] + const { code } = ACTION_LANGUAGE_MAP[language] ?? {} if (!code) { return false } diff --git a/apps/desktop/layer/renderer/src/lib/utils.ts b/apps/desktop/layer/renderer/src/lib/utils.ts index 4a77ee75b..e6b7603ce 100644 --- a/apps/desktop/layer/renderer/src/lib/utils.ts +++ b/apps/desktop/layer/renderer/src/lib/utils.ts @@ -1,7 +1,6 @@ import { FeedViewType } from "@follow/constants" import { getServerConfigs } from "~/atoms/server-configs" -import type { RSSHubRoute } from "~/modules/discover/types" import { FEED_COLLECTION_LIST, ROUTE_FEED_PENDING } from "../constants/app" @@ -48,27 +47,6 @@ export function getEntriesParams({ } } -const rsshubCategoryMap: Partial> = { - design: FeedViewType.Pictures, - forecast: FeedViewType.Notifications, - live: FeedViewType.Notifications, - picture: FeedViewType.Pictures, - "program-update": FeedViewType.Notifications, - "social-media": FeedViewType.SocialMedia, -} - -export const getViewFromRoute = (route: RSSHubRoute) => { - if (route.view) { - return route.view - } - for (const categories of route.categories) { - if (rsshubCategoryMap[categories]) { - return rsshubCategoryMap[categories] - } - } - return null -} - export const getLevelMultiplier = (level: number) => { if (level === 0) { return 0.1 diff --git a/apps/desktop/layer/renderer/src/main.tsx b/apps/desktop/layer/renderer/src/main.tsx index c55360f59..e09c49b0c 100644 --- a/apps/desktop/layer/renderer/src/main.tsx +++ b/apps/desktop/layer/renderer/src/main.tsx @@ -3,19 +3,13 @@ import "@follow/components/tailwind" import "./styles/main.css" import { IN_ELECTRON, WEB_BUILD } from "@follow/shared/constants" -import { - apiClientContext, - apiContext, - authClientContext, - queryClientContext, -} from "@follow/store/context" +import { apiContext, authClientContext, queryClientContext } from "@follow/store/context" import { getOS } from "@follow/utils/utils" import * as React from "react" import { flushSync } from "react-dom" import ReactDOM from "react-dom/client" import { RouterProvider } from "react-router/dom" -import { apiClient } from "~/lib/api-fetch" import { authClient } from "~/lib/auth" import { setAppIsReady } from "./atoms/app" @@ -26,7 +20,6 @@ import { followApi } from "./lib/api-client" import { queryClient } from "./lib/query-client" import { router } from "./router" -apiClientContext.provide(apiClient) authClientContext.provide(authClient) queryClientContext.provide(queryClient) apiContext.provide(followApi) diff --git a/apps/desktop/layer/renderer/src/modules/achievement/AchievementModalContent.tsx b/apps/desktop/layer/renderer/src/modules/achievement/AchievementModalContent.tsx index bdbf5124c..560bfae1e 100644 --- a/apps/desktop/layer/renderer/src/modules/achievement/AchievementModalContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/achievement/AchievementModalContent.tsx @@ -1,29 +1,26 @@ import { RiNftFill } from "@follow/components/icons/nft.jsx" import { Button, MotionButtonBase } from "@follow/components/ui/button/index.js" import { styledButtonVariant } from "@follow/components/ui/button/variants.js" -import { Input } from "@follow/components/ui/input/Input.js" import { LoadingCircle, LoadingWithIcon } from "@follow/components/ui/loading/index.jsx" import { ScrollArea } from "@follow/components/ui/scroll-area/ScrollArea.js" -import { Tooltip, TooltipContent, TooltipTrigger } from "@follow/components/ui/tooltip/index.js" import { useOnce } from "@follow/hooks" -import type { ExtractBizResponse } from "@follow/models/types" import { Chain } from "@follow/utils/chain" import { cn } from "@follow/utils/utils" +import type { AchievementWithPower } from "@follow-app/client-sdk" import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" import type { PrimitiveAtom } from "jotai" import { atom, useStore } from "jotai" import { nanoid } from "nanoid" import type { FC, ReactNode } from "react" -import { useEffect, useId, useMemo, useRef, useState } from "react" +import { useEffect, useMemo, useState } from "react" import { useTranslation } from "react-i18next" -import { useServerConfigs } from "~/atoms/server-configs" import { LazyDotLottie } from "~/components/common/LazyDotLottie" import { VideoPlayer } from "~/components/ui/media/VideoPlayer" import { ScaleModal } from "~/components/ui/modal/stacked/custom-modal" -import { useCurrentModal, useModalStack } from "~/components/ui/modal/stacked/hooks" +import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useI18n } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import achievementAnimationUri from "~/lottie/achievement.lottie?url" const absoluteachievementAnimationUri = new URL(achievementAnimationUri, import.meta.url).href @@ -100,7 +97,6 @@ const prefetchVideos = () => { }) } -type Achievement = ExtractBizResponse["data"] export const AchievementModalContent: FC = () => { const jotaiStore = useStore() @@ -120,16 +116,14 @@ export const AchievementModalContent: FC = () => { persist: true, }, queryFn: async () => { - const res = await apiClient.achievement.$get({ - query: { - type: "all", - }, + const res = await followClient.api.achievement.list({ + type: "all", }) jotaiStore.set(achievementsDataAtom, res.data) return res.data }, - initialData: defaultAchievements as Achievement, + initialData: defaultAchievements as AchievementWithPower[], }) useEffect(() => { @@ -330,16 +324,14 @@ const buildDefaultAchievements = () => { } const MintButton: FC<{ - achievementsDataAtom: PrimitiveAtom - achievement: Achievement[number] + achievementsDataAtom: PrimitiveAtom + achievement: AchievementWithPower onMinted: () => void }> = ({ achievementsDataAtom, achievement, onMinted }) => { const { mutateAsync: mintAchievement, isPending: isMinting } = useMutation({ mutationFn: async (actionId: number) => { - return apiClient.achievement.$put({ - json: { - actionId, - }, + return followClient.api.achievement.claim({ + actionId, }) }, }) @@ -383,15 +375,13 @@ const MintButton: FC<{ } const IncompleteButton: FC<{ - achievement: Achievement[number] + achievement: AchievementWithPower refetch: () => void }> = ({ achievement, refetch }) => { const { mutateAsync: checkAchievement, isPending: checkPending } = useMutation({ mutationFn: async (actionId: number) => { - return apiClient.achievement.check.$post({ - json: { - actionId, - }, + return followClient.api.achievement.check({ + actionId, }) }, onSuccess: () => { @@ -399,34 +389,31 @@ const IncompleteButton: FC<{ }, }) - const { present } = useModalStack() let Content: ReactNode - const { PRODUCT_HUNT_VOTE_URL } = useServerConfigs() || {} - switch (achievement.actionId) { - case AchievementsActionIdMap.PRODUCT_HUNT_VOTE: { - return ( - - - - - {!PRODUCT_HUNT_VOTE_URL && ( - Product Hunt Vote is not ready, We'll see. - )} - - ) - } + // case AchievementsActionIdMap.PRODUCT_HUNT_VOTE: { + // return ( + // + // + // + // + // {!PRODUCT_HUNT_VOTE_URL && ( + // Product Hunt Vote is not ready, We'll see. + // )} + // + // ) + // } default: { Content = ( <> @@ -476,74 +463,3 @@ const IncompleteButton: FC<{ ) } -const VoteValidateModalContent: FC<{ refetch: () => void }> = ({ refetch }) => { - const ref = useRef(null) - const { dismiss } = useCurrentModal() - const { present } = useModalStack() - const { mutateAsync: audit, isPending } = useMutation({ - mutationFn: (username: string) => { - return apiClient.achievement.audit.$post({ - json: { - actionId: AchievementsActionIdMap.PRODUCT_HUNT_VOTE, - payload: { - username, - }, - }, - }) - }, - onSuccess: () => { - dismiss() - - refetch() - present({ - title: "Thank you!", - content: () =>
Thank you for your vote. Please wait for our verification.
, - clickOutsideToDismiss: true, - }) - }, - }) - const { PRODUCT_HUNT_VOTE_URL } = useServerConfigs() || {} - const id = useId() - - const openOnceRef = useRef(false) - useEffect(() => { - if (openOnceRef.current) return - if (PRODUCT_HUNT_VOTE_URL) { - window.open(PRODUCT_HUNT_VOTE_URL, "_blank") - openOnceRef.current = true - } - }, [PRODUCT_HUNT_VOTE_URL]) - - return ( -
{ - e.preventDefault() - if (!ref.current?.value) return - audit(ref.current.value) - }} - > - -
- -
- -
- -
-
- ) -} diff --git a/apps/desktop/layer/renderer/src/modules/action/constants.tsx b/apps/desktop/layer/renderer/src/modules/action/constants.tsx index 9c60ebde1..adab578ae 100644 --- a/apps/desktop/layer/renderer/src/modules/action/constants.tsx +++ b/apps/desktop/layer/renderer/src/modules/action/constants.tsx @@ -1,6 +1,8 @@ import { ResponsiveSelect } from "@follow/components/ui/select/responsive.js" import { ACTION_LANGUAGE_MAP } from "@follow/shared/language" +import type { ActionAction } from "@follow/store/action/constant" import { availableActionMap as availableActionMapOriginal } from "@follow/store/action/constant" +import type { ActionId } from "@follow-app/client-sdk" import { useTranslation } from "react-i18next" import { defaultResources } from "~/@types/default-resource" @@ -22,7 +24,7 @@ export const availableActionMap: typeof availableActionMapOriginal = { ...availableActionMapOriginal.translation, prefixElement: , }, -} +} as Record function AiTargetLanguageSelector() { const { t } = useTranslation("settings") diff --git a/apps/desktop/layer/renderer/src/modules/action/then-section.tsx b/apps/desktop/layer/renderer/src/modules/action/then-section.tsx index 6a0f73d04..1cceafb9a 100644 --- a/apps/desktop/layer/renderer/src/modules/action/then-section.tsx +++ b/apps/desktop/layer/renderer/src/modules/action/then-section.tsx @@ -1,10 +1,10 @@ import { ActionButton, Button } from "@follow/components/ui/button/index.js" import { Divider } from "@follow/components/ui/divider/index.js" import { Input } from "@follow/components/ui/input/index.js" -import type { ActionId } from "@follow/models/types" import type { ActionAction } from "@follow/store/action/constant" import { useActionRule } from "@follow/store/action/hooks" import { actionActions } from "@follow/store/action/store" +import type { ActionId } from "@follow-app/client-sdk" import { merge } from "es-toolkit/compat" import { Fragment, useMemo } from "react" import { useTranslation } from "react-i18next" diff --git a/apps/desktop/layer/renderer/src/modules/action/when-section.tsx b/apps/desktop/layer/renderer/src/modules/action/when-section.tsx index f444e16e9..7ee824634 100644 --- a/apps/desktop/layer/renderer/src/modules/action/when-section.tsx +++ b/apps/desktop/layer/renderer/src/modules/action/when-section.tsx @@ -9,10 +9,10 @@ import { SelectValue, } from "@follow/components/ui/select/index.jsx" import { ResponsiveSelect } from "@follow/components/ui/select/responsive.js" -import type { ActionFeedField, ActionOperation } from "@follow/models/types" import { filterFieldOptions, filterOperatorOptions } from "@follow/store/action/constant" import { useActionRule } from "@follow/store/action/hooks" import { actionActions } from "@follow/store/action/store" +import type { ActionFeedField, ActionOperation } from "@follow-app/client-sdk" import { Fragment } from "react" import { useTranslation } from "react-i18next" diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayEntriesPart.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayEntriesPart.tsx index e24a155d2..722429bde 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayEntriesPart.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayEntriesPart.tsx @@ -33,7 +33,12 @@ const SingleEntryCard = ({ entry }: { entry: SingleEntry }) => { {/* Header */}
- +

{entry.title || "Untitled Entry"}

diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayFeedsPart.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayFeedsPart.tsx index dcefdc8f7..e6f52b2f1 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayFeedsPart.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/components/displays/AIDisplayFeedsPart.tsx @@ -31,10 +31,10 @@ const AIDisplayFeedPartBase = ({
{ if (messages.length < 2) return null @@ -23,8 +23,8 @@ export const generateChatTitle = async (messages: UIMessage[]) => { } }) - const response = await apiClient.ai["summary-title"].$post({ - json: { messages: relevantMessages }, + const response = await followClient.api.ai.summaryTitle({ + messages: relevantMessages, }) if ("title" in response) { diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/components/PodcastButton.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/components/PodcastButton.tsx index 72c418438..007b6f374 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/components/PodcastButton.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/components/PodcastButton.tsx @@ -39,7 +39,7 @@ export const PodcastButton = ({ feed }: { feed: FeedModel }) => { content={ <>
- +
{ } >
- +
) diff --git a/apps/desktop/layer/renderer/src/modules/auth/ReferralForm.tsx b/apps/desktop/layer/renderer/src/modules/auth/ReferralForm.tsx index dbea5e7d2..d3c6d8316 100644 --- a/apps/desktop/layer/renderer/src/modules/auth/ReferralForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/auth/ReferralForm.tsx @@ -18,7 +18,7 @@ import { useForm } from "react-hook-form" import { useTranslation } from "react-i18next" import { z } from "zod" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" const formSchema = z.object({ referral: z.string().optional(), @@ -37,7 +37,7 @@ function getDefaultReferralCode() { } async function getReferralCycleDays(code: string) { - return apiClient.referrals.days.$get({ query: { code } }) + return followClient.api.referrals.getDays({ code }) } export function ReferralForm({ diff --git a/apps/desktop/layer/renderer/src/modules/boost/boost-certification.tsx b/apps/desktop/layer/renderer/src/modules/boost/boost-certification.tsx index 83b899a8f..996d67920 100644 --- a/apps/desktop/layer/renderer/src/modules/boost/boost-certification.tsx +++ b/apps/desktop/layer/renderer/src/modules/boost/boost-certification.tsx @@ -4,7 +4,8 @@ import { TooltipPortal, TooltipTrigger, } from "@follow/components/ui/tooltip/index.js" -import type { FeedOrListRespModel } from "@follow/models/types" +import type { FeedModel } from "@follow/store/feed/types" +import type { ListModel } from "@follow/store/list/types" import { cn } from "@follow/utils/utils" import { useTranslation } from "react-i18next" @@ -14,7 +15,7 @@ export const BoostCertification = ({ feed, className, }: { - feed: FeedOrListRespModel + feed: FeedModel | ListModel className?: string }) => { const showBoostModal = useBoostModal() diff --git a/apps/desktop/layer/renderer/src/modules/boost/modal.tsx b/apps/desktop/layer/renderer/src/modules/boost/modal.tsx index 1eff0a8f1..c8bbe1ac7 100644 --- a/apps/desktop/layer/renderer/src/modules/boost/modal.tsx +++ b/apps/desktop/layer/renderer/src/modules/boost/modal.tsx @@ -54,7 +54,7 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => { return (
- +

diff --git a/apps/desktop/layer/renderer/src/modules/boost/query.tsx b/apps/desktop/layer/renderer/src/modules/boost/query.tsx index d7241d1f8..5b3e9a53e 100644 --- a/apps/desktop/layer/renderer/src/modules/boost/query.tsx +++ b/apps/desktop/layer/renderer/src/modules/boost/query.tsx @@ -1,9 +1,10 @@ import { tracker } from "@follow/tracker" +import type { BoostFeedRequest } from "@follow-app/client-sdk" import { useMutation } from "@tanstack/react-query" import { toast } from "sonner" import { useAuthQuery, useI18n } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { toastFetchError } from "~/lib/error-parser" @@ -12,19 +13,15 @@ import { updateFeedBoostStatus } from "./atom" const query = { getStatus: ({ feedId }: { feedId: string }) => defineQuery(["boostFeed", feedId], async () => { - const res = await apiClient.boosts.$get({ - query: { - feedId, - }, + const res = await followClient.api.boosts.getFeedBoostLevel({ + feedId, }) return res.data }), getBoosters: ({ feedId }: { feedId: string }) => defineQuery(["boosters", feedId], async () => { - const res = await apiClient.boosts.boosters.$get({ - query: { - feedId, - }, + const res = await followClient.api.boosts.getFeedBoosters({ + feedId, }) return res.data @@ -45,8 +42,12 @@ export const useFeedBoostersQuery = (feedId: string | null | undefined) => export const useBoostFeedMutation = () => { const t = useI18n() return useMutation({ - mutationFn: (data: Parameters[0]["json"]) => - apiClient.boosts.$post({ json: data }), + mutationFn: (data: BoostFeedRequest) => + followClient.api.boosts.boostFeed({ + amount: data.amount, + feedId: data.feedId, + TOTPCode: data.TOTPCode, + }), onError(err) { toastFetchError(err) }, diff --git a/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedCard.tsx b/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedCard.tsx index 8f16809c8..8b7a78f4b 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedCard.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedCard.tsx @@ -4,6 +4,7 @@ import { RelativeTime } from "@follow/components/ui/datetime/index.js" import { useIsSubscribed } from "@follow/store/subscription/hooks" import { getBackgroundGradient } from "@follow/utils/color" import { cn, formatNumber } from "@follow/utils/utils" +import type { DiscoveryItem, TrendingFeedItem } from "@follow-app/client-sdk" import type { FC } from "react" import { memo } from "react" import { useTranslation } from "react-i18next" @@ -13,82 +14,77 @@ import { Media } from "~/components/ui/media/Media" import { useFollow } from "~/hooks/biz/useFollow" import { navigateEntry } from "~/hooks/biz/useNavigateEntry" import { useFeedSafeUrl } from "~/hooks/common/useFeedSafeUrl" -import type { apiClient } from "~/lib/api-fetch" import { FollowSummary } from "../feed/feed-summary" -export type DiscoverItem = Awaited>["data"][number] - -export const FeedCardActions: FC<{ - item: DiscoverItem - onSuccess?: (item: DiscoverItem) => void +export function FeedCardActions({ + item, + onSuccess, + isSubscribed, + followButtonVariant, + followedButtonVariant = "ghost", + followButtonClassName, + followedButtonClassName, +}: { + item: T + onSuccess?: (item: T) => void isSubscribed: boolean followButtonVariant?: "ghost" | "outline" followedButtonVariant?: "ghost" | "outline" followButtonClassName?: string followedButtonClassName?: string -}> = memo( - ({ - item, - onSuccess, - isSubscribed, - followButtonVariant, - followedButtonVariant = "ghost", - followButtonClassName, - followedButtonClassName, - }) => { - const follow = useFollow() - const { t } = useTranslation() - const location = useLocation() +}) { + const follow = useFollow() + const { t } = useTranslation() + const location = useLocation() - return ( -
- {!isSubscribed && ( - - )} + return ( +
+ {!isSubscribed && ( -
- ) - }, -) + )} + +
+ ) +} interface DiscoverFeedCardProps { - item: DiscoverItem - onSuccess?: (item: DiscoverItem) => void - onUnSubscribed?: (item: DiscoverItem) => void + item: DiscoveryItem + onSuccess?: (item: DiscoveryItem) => void + onUnSubscribed?: (item: DiscoveryItem) => void className?: string } @@ -108,7 +104,7 @@ export const DiscoverFeedCard: FC = memo( )} > - + {item.docs ? ( @@ -171,7 +167,7 @@ export const DiscoverFeedCard: FC = memo( ) const SearchResultContent: FC<{ - entry: NonUndefined[number] + entry: NonUndefined[number] }> = memo(({ entry }) => { const safeUrl = useFeedSafeUrl(entry.id) return ( @@ -205,7 +201,7 @@ const SearchResultContent: FC<{ }) const FeedCardMediaThumbnail: FC<{ - entry: NonUndefined[number] + entry: NonUndefined[number] }> = ({ entry }) => { const [, , , bgAccent, bgAccentLight] = getBackgroundGradient( entry.title || entry.url || "Untitled", diff --git a/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedForm.tsx index 7b3dc39cb..2fcff9bf5 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/DiscoverFeedForm.tsx @@ -19,6 +19,7 @@ import { regexpPathToPath, } from "@follow/utils/path-parser" import { cn } from "@follow/utils/utils" +import type { RSSHubRouteMetadata } from "@follow-app/client-sdk" import { zodResolver } from "@hookform/resolvers/zod" import { m } from "motion/react" import type { FC } from "react" @@ -39,7 +40,6 @@ import { } from "~/components/ui/modal/stacked/hooks" import { FeedForm } from "./FeedForm" -import type { RSSHubRoute } from "./types" import { normalizeRSSHubParameters } from "./utils" const FeedMaintainers = ({ maintainers }: { maintainers?: string[] }) => { @@ -92,7 +92,7 @@ export const DiscoverFeedForm = ({ viewportClassName, rootClassName, }: { - route: RSSHubRoute + route: RSSHubRouteMetadata routePrefix: string noDescription?: boolean routeParams?: RouteParams diff --git a/apps/desktop/layer/renderer/src/modules/discover/DiscoverForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/DiscoverForm.tsx index 188358c85..5f52c304d 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/DiscoverForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/DiscoverForm.tsx @@ -11,6 +11,7 @@ import { import { Input } from "@follow/components/ui/input/index.js" import { SegmentGroup, SegmentItem } from "@follow/components/ui/segment/index.js" import { ResponsiveSelect } from "@follow/components/ui/select/responsive.js" +import type { DiscoveryItem } from "@follow-app/client-sdk" import { zodResolver } from "@hookform/resolvers/zod" import { repository } from "@pkg" import { useMutation } from "@tanstack/react-query" @@ -25,7 +26,7 @@ import { z } from "zod" import { useIsInMASReview } from "~/atoms/server-configs" import { useModalStack } from "~/components/ui/modal/stacked/hooks" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { DiscoverFeedCard } from "./DiscoverFeedCard" import { FeedForm } from "./FeedForm" @@ -90,9 +91,7 @@ const info = { } > -type DiscoverSearchData = Awaited>["data"] - -const discoverSearchDataAtom = atom>() +const discoverSearchDataAtom = atom>() export function DiscoverForm({ type = "search" }: { type?: string }) { const { prefix, default: defaultValue, schema: formSchema } = info[type]! @@ -125,11 +124,9 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { const jotaiStore = useStore() const mutation = useMutation({ mutationFn: async ({ keyword, target }: { keyword: string; target: "feeds" | "lists" }) => { - let { data } = await apiClient.discover.$post({ - json: { - keyword: keyword.trim(), - target, - }, + let { data } = await followClient.api.discover.discover({ + keyword: keyword.trim(), + target, }) if (isInMASReview) { data = data.filter((item) => !item.list?.fee) @@ -205,7 +202,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { ) const handleSuccess = useCallback( - (item: DiscoverSearchData[number]) => { + (item: DiscoveryItem) => { const currentData = jotaiStore.get(discoverSearchDataAtom) if (!currentData) return jotaiStore.set( @@ -229,7 +226,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { ) const handleUnSubscribed = useCallback( - (item: DiscoverSearchData[number]) => { + (item: DiscoveryItem) => { const currentData = jotaiStore.get(discoverSearchDataAtom) if (!currentData) return jotaiStore.set( diff --git a/apps/desktop/layer/renderer/src/modules/discover/DiscoverImport.tsx b/apps/desktop/layer/renderer/src/modules/discover/DiscoverImport.tsx index 5014ef2b8..917dece99 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/DiscoverImport.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/DiscoverImport.tsx @@ -2,7 +2,6 @@ import { Button } from "@follow/components/ui/button/index.js" import { CollapseCss, CollapseCssGroup } from "@follow/components/ui/collapse/index.js" import { DropZone } from "@follow/components/ui/drop-zone/index.js" import { Form, FormControl, FormField, FormItem } from "@follow/components/ui/form/index.jsx" -import type { BizRespose } from "@follow/models" import { zodResolver } from "@hookform/resolvers/zod" import { useMutation } from "@tanstack/react-query" import { Fragment } from "react" @@ -12,20 +11,13 @@ import { z } from "zod" import { Media } from "~/components/ui/media/Media" import { useModalStack } from "~/components/ui/modal/stacked/hooks" -import { apiFetch } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { toastFetchError } from "~/lib/error-parser" import { OpmlSelectionModal } from "./OpmlSelectionModal" -import type { ParsedOpmlData } from "./types" -const parseOpmlFile = async (file: File): Promise => { - const formData = new FormData() - formData.append("file", file) - - const data = await apiFetch>("/subscriptions/parse-opml", { - method: "POST", - body: formData, - }) +const parseOpmlFile = async (file: File) => { + const data = await followClient.api.subscriptions.parseOpml(await file.arrayBuffer()) return data.data } diff --git a/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx index 7804c00df..e4b39b3f5 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx @@ -14,13 +14,14 @@ import { RootPortal } from "@follow/components/ui/portal/index.js" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" import { Switch } from "@follow/components/ui/switch/index.jsx" import { FeedViewType } from "@follow/constants" -import type { EntryModelSimple, FeedAnalyticsModel, FeedModel } from "@follow/models/types" import { useFeedByIdOrUrl } from "@follow/store/feed/hooks" +import type { FeedModel } from "@follow/store/feed/types" import { useCategories, useSubscriptionByFeedId } from "@follow/store/subscription/hooks" import { subscriptionSyncService } from "@follow/store/subscription/store" import { whoami } from "@follow/store/user/getters" import { tracker } from "@follow/tracker" import { cn } from "@follow/utils/utils" +import type { FeedAnalyticsModel, ParsedEntry } from "@follow-app/client-sdk" import { zodResolver } from "@hookform/resolvers/zod" import { useMutation } from "@tanstack/react-query" import { useCallback, useEffect, useMemo, useRef } from "react" @@ -150,6 +151,7 @@ export const FeedForm: Component<{ }, [ defaultValues, feed, + feedQuery.data?.analytics, feedQuery.data?.entries, feedQuery.data?.subscription, feedQuery.error, @@ -190,7 +192,7 @@ const FeedInnerForm = ({ hideFromTimeline?: boolean | null } feed: FeedModel - entries?: EntryModelSimple[] + entries?: ParsedEntry[] analytics?: FeedAnalyticsModel placeholderRef: React.RefObject diff --git a/apps/desktop/layer/renderer/src/modules/discover/FeedSummary.tsx b/apps/desktop/layer/renderer/src/modules/discover/FeedSummary.tsx index 80647c5e9..302f3130b 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/FeedSummary.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/FeedSummary.tsx @@ -1,6 +1,8 @@ import { Skeleton } from "@follow/components/ui/skeleton/index.js" -import type { FeedAnalyticsModel, FeedOrListRespModel, ListAnalyticsModel } from "@follow/models" +import type { FeedModel } from "@follow/store/feed/types" +import type { ListModel } from "@follow/store/list/types" import { formatNumber } from "@follow/utils" +import type { FeedAnalyticsModel, ListAnalyticsSchema } from "@follow-app/client-sdk" import type { FC } from "react" import { useTranslation } from "react-i18next" @@ -9,9 +11,9 @@ import { RelativeTime } from "~/components/ui/datetime" import { FollowSummary } from "../feed/feed-summary" export interface FeedSummaryProps { - feed: FeedOrListRespModel + feed: FeedModel | ListModel - analytics?: FeedAnalyticsModel | ListAnalyticsModel + analytics?: FeedAnalyticsModel | ListAnalyticsSchema showAnalytics?: boolean isLoading?: boolean diff --git a/apps/desktop/layer/renderer/src/modules/discover/ListForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/ListForm.tsx index 0b6a8e69b..eb47e593b 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/ListForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/ListForm.tsx @@ -12,7 +12,6 @@ import { Input } from "@follow/components/ui/input/index.js" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { Switch } from "@follow/components/ui/switch/index.jsx" import { FeedViewType } from "@follow/constants" -import type { ListAnalyticsModel } from "@follow/models/types" import { useListById, usePrefetchListById } from "@follow/store/list/hooks" import type { ListModel } from "@follow/store/list/types" import { useSubscriptionByFeedId } from "@follow/store/subscription/hooks" @@ -20,6 +19,7 @@ import { subscriptionSyncService } from "@follow/store/subscription/store" import { whoami } from "@follow/store/user/getters" import { tracker } from "@follow/tracker" import { cn } from "@follow/utils/utils" +import type { ListAnalyticsSchema } from "@follow-app/client-sdk" import { zodResolver } from "@hookform/resolvers/zod" import { useMutation } from "@tanstack/react-query" import { useEffect, useRef } from "react" @@ -176,7 +176,7 @@ const ListInnerForm = ({ hideFromTimeline?: boolean | null } list: ListModel - analytics?: ListAnalyticsModel + analytics?: ListAnalyticsSchema isLoading: boolean }) => { const subscription = useSubscriptionByFeedId(id || "") || subscriptionData @@ -261,8 +261,6 @@ const ListInnerForm = ({ feed={{ ...list, fee: list.fee || 0, - createdAt: null, - updatedAt: null, }} analytics={analytics} showAnalytics diff --git a/apps/desktop/layer/renderer/src/modules/discover/OpmlSelectionModal.tsx b/apps/desktop/layer/renderer/src/modules/discover/OpmlSelectionModal.tsx index 1897416ce..44fd6fea0 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/OpmlSelectionModal.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/OpmlSelectionModal.tsx @@ -3,9 +3,9 @@ import { Checkbox } from "@follow/components/ui/checkbox/index.jsx" import { Input } from "@follow/components/ui/input/index.js" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" import { Tooltip, TooltipContent, TooltipTrigger } from "@follow/components/ui/tooltip/index.jsx" -import type { BizRespose } from "@follow/models" import { subscriptionSyncService } from "@follow/store/subscription/store" import { cn } from "@follow/utils/utils" +import type { ExtractResponseData, SubscriptionParseOpmlResponse } from "@follow-app/client-sdk" import { useMutation } from "@tanstack/react-query" import Fuse from "fuse.js" import { useCallback, useMemo, useState } from "react" @@ -13,22 +13,17 @@ import { Trans, useTranslation } from "react-i18next" import { toast } from "sonner" import { useCurrentModal } from "~/components/ui/modal/stacked/hooks" -import { apiFetch } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { toastFetchError } from "~/lib/error-parser" -import type { ParsedFeedItem, ParsedOpmlData } from "./types" +import type { ParsedFeedItem } from "./types" -type FeedResponseList = { - id: string - url: string - title: string | null -}[] export const OpmlSelectionModal = ({ parsedData, file, }: { - parsedData: ParsedOpmlData + parsedData: ExtractResponseData file: File }) => { @@ -41,16 +36,7 @@ export const OpmlSelectionModal = ({ formData.append("file", file) formData.append("items", JSON.stringify(selectedItems.map((i) => i.url))) - const { data } = await apiFetch< - BizRespose<{ - successfulItems: FeedResponseList - conflictItems: FeedResponseList - parsedErrorItems: FeedResponseList - }> - >("/subscriptions/import", { - method: "POST", - body: formData, - }) + const { data } = await followClient.api.subscriptions.import(formData) return data }, diff --git a/apps/desktop/layer/renderer/src/modules/discover/RecommendationCard.tsx b/apps/desktop/layer/renderer/src/modules/discover/RecommendationCard.tsx deleted file mode 100644 index 14c88f53a..000000000 --- a/apps/desktop/layer/renderer/src/modules/discover/RecommendationCard.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import { Card, CardContent, CardHeader, CardTitle } from "@follow/components/ui/card/index.jsx" -import { SiteIcon } from "@follow/components/ui/icon/SiteIcon.js" -import { RSSHubCategories } from "@follow/constants" -import { getHighestWeightColor } from "@follow/utils/color" -import { clsx, cn, getUrlIcon } from "@follow/utils/utils" -import { upperFirst } from "es-toolkit/compat" -import type { FC } from "react" -import { memo, useEffect, useMemo, useState } from "react" -import { useTranslation } from "react-i18next" - -import { useModalStack } from "~/components/ui/modal/stacked/hooks" -import { FeedIcon } from "~/modules/feed/feed-icon" - -import { RecommendationContent } from "./RecommendationContent" -import type { RSSHubRouteDeclaration } from "./types" - -interface RecommendationCardProps { - data: RSSHubRouteDeclaration - routePrefix: string - setCategory: (category: string) => void -} -export const RecommendationCard: FC = memo( - ({ data, routePrefix, setCategory }) => { - const { t } = useTranslation() - const { present } = useModalStack() - - const { maintainers, categories } = useMemo(() => { - const maintainers = new Set() - const categories = new Set() - for (const route in data.routes) { - const routeData = data.routes[route]! - if (routeData.maintainers) { - routeData.maintainers.forEach((m) => maintainers.add(m)) - } - if (routeData.categories) { - routeData.categories.forEach((c) => categories.add(c)) - } - } - categories.delete("popular") - return { - maintainers: Array.from(maintainers), - categories: Array.from(categories) as unknown as typeof RSSHubCategories, - } - }, [data]) - - return ( - - -
- - - -
- - - - - - - - - {data.name} - - -
- -
    - {Object.keys(data.routes).map((route) => { - const routeData = data.routes[route]! - // some routes have multiple paths, like `huxiu` - if (Array.isArray(routeData.path)) { - routeData.path = routeData.path.find((p) => p === route) ?? routeData.path[0] - } - return ( -
  • { - ;(e.target as HTMLElement).querySelector("button")?.click() - }} - tabIndex={-1} - > - -
  • - ) - })} -
- -
-
- - - - {maintainers.map((m) => ( - - @{m} - - ))} - -
-
- - - {categories.map((c) => ( - - ))} - -
-
-
-
- ) - }, -) - -const BackgroundGradient = memo(({ url, className }: { url: string; className?: string }) => { - const [color, setColor] = useState() - - useEffect(() => { - const { src } = getUrlIcon(`https://${url}`) - const image = new Image() - image.src = src - image.crossOrigin = "anonymous" - image.onload = () => { - try { - const color = getHighestWeightColor(image) - setColor(color) - } catch { - setColor("#333") - } - } - }, [url]) - return ( -
- ) -}) diff --git a/apps/desktop/layer/renderer/src/modules/discover/RecommendationContent.tsx b/apps/desktop/layer/renderer/src/modules/discover/RecommendationContent.tsx index e686f7a42..07af248cd 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/RecommendationContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/RecommendationContent.tsx @@ -1,11 +1,12 @@ +import type { RSSHubRouteMetadata } from "@follow-app/client-sdk" + import { DiscoverFeedForm } from "./DiscoverFeedForm" -import type { RSSHubRoute } from "./types" export const RecommendationContent = ({ route, routePrefix, }: { - route: RSSHubRoute + route: RSSHubRouteMetadata routePrefix: string }) => (
diff --git a/apps/desktop/layer/renderer/src/modules/discover/TrendingFeedCard.tsx b/apps/desktop/layer/renderer/src/modules/discover/TrendingFeedCard.tsx index e61e37cb7..ddeb24331 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/TrendingFeedCard.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/TrendingFeedCard.tsx @@ -1,21 +1,21 @@ import { useIsSubscribed } from "@follow/store/subscription/hooks" import { formatNumber } from "@follow/utils" +import type { TrendingFeedItem } from "@follow-app/client-sdk" import type { FC } from "react" import { useTranslation } from "react-i18next" import { FollowSummary } from "../feed/feed-summary" -import type { DiscoverItem } from "./DiscoverFeedCard" import { FeedCardActions } from "./DiscoverFeedCard" export const TrendingFeedCard: FC<{ - item: DiscoverItem + item: TrendingFeedItem }> = ({ item }) => { const { t } = useTranslation("common") const { analytics } = item - const isSubscribed = useIsSubscribed(item.feed?.id || item.list?.id || "") + const isSubscribed = useIsSubscribed(item.feed?.id || "") return (
- +
{analytics?.subscriptionCount ? ( diff --git a/apps/desktop/layer/renderer/src/modules/discover/types.ts b/apps/desktop/layer/renderer/src/modules/discover/types.ts index 43bd63659..6ab219f5d 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/types.ts +++ b/apps/desktop/layer/renderer/src/modules/discover/types.ts @@ -1,19 +1,5 @@ -import type { FeedViewType } from "@follow/constants" - -export * from "@follow/models/rsshub" - export type ParsedFeedItem = { url: string title: string | null category?: string | null } - -export type ParsedOpmlData = { - remaining: number - subscriptions: { - category: string | null - title: string - url: string - view: FeedViewType - }[] -} diff --git a/apps/desktop/layer/renderer/src/modules/discover/utils.ts b/apps/desktop/layer/renderer/src/modules/discover/utils.ts index e9c3e7bb3..50e89849e 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/utils.ts +++ b/apps/desktop/layer/renderer/src/modules/discover/utils.ts @@ -1,4 +1,4 @@ -import type { RSSHubParameter, RSSHubParameterObject } from "./types" +import type { RSSHubParameter, RSSHubParameterObject } from "@follow/models/rsshub" export const normalizeRSSHubParameters = ( parameters: RSSHubParameter, diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/EntrySubscriptionItem.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/EntrySubscriptionItem.tsx index d7ab1104d..6fbfd140d 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/EntrySubscriptionItem.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/EntrySubscriptionItem.tsx @@ -86,7 +86,7 @@ const EntrySubscriptionItemImpl = ({ entryId, view, className }: EntrySubscripti {...contextMenuProps} >
- +
{ video, } } -export function AllItem({ entryId, entryPreview, translation }: UniversalItemProps) { +export function AllItem({ entryId, translation }: UniversalItemProps) { const entry = useEntry(entryId, entrySelector) const simple = true @@ -84,18 +84,17 @@ export function AllItem({ entryId, entryPreview, translation }: UniversalItemPro const inInCollection = useRouteParamsSelector((s) => s.feedId === FEED_COLLECTION_LIST) - const feed = - useFeedById(entry?.feedId, (feed) => { - return { - type: feed.type, - ownerUserId: feed.ownerUserId, - id: feed.id, - title: feed.title, - url: (feed as any).url || "", - image: feed.image, - siteUrl: feed.siteUrl, - } - }) || entryPreview?.feeds + const feed = useFeedById(entry?.feedId, (feed) => { + return { + type: feed.type, + ownerUserId: feed.ownerUserId, + id: feed.id, + title: feed.title, + url: (feed as any).url || "", + image: feed.image, + siteUrl: feed.siteUrl, + } + }) const inbox = useInboxById(entry?.inboxId) @@ -141,7 +140,7 @@ export function AllItem({ entryId, entryPreview, translation }: UniversalItemPro "before:bg-accent before:absolute before:-left-4 before:top-[14px] before:block before:size-2 before:rounded-full", )} > - +
- +
diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/article-item.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/article-item.tsx index 591ac3c5a..4a0de68a8 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/article-item.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/article-item.tsx @@ -9,8 +9,8 @@ import { FeedTitle } from "~/modules/feed/feed-title" import { readableContentMaxWidth } from "../styles" import type { EntryItemStatelessProps, UniversalItemProps } from "../types" -export function ArticleItem({ entryId, entryPreview, translation }: UniversalItemProps) { - return +export function ArticleItem({ entryId, translation }: UniversalItemProps) { + return } ArticleItem.wrapperClassName = readableContentMaxWidth @@ -18,7 +18,7 @@ ArticleItem.wrapperClassName = readableContentMaxWidth export function ArticleItemStateLess({ entry, feed }: EntryItemStatelessProps) { return (
- +
diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/audio-item.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/audio-item.tsx index 5de7779c2..d20982f6c 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/audio-item.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/audio-item.tsx @@ -5,8 +5,8 @@ import { ListItem } from "~/modules/entry-column/templates/list-item-template" import { readableContentMaxWidth } from "../styles" import type { UniversalItemProps } from "../types" -export function AudioItem({ entryId, entryPreview, translation }: UniversalItemProps) { - return +export function AudioItem({ entryId, translation }: UniversalItemProps) { + return } AudioItem.wrapperClassName = readableContentMaxWidth diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/notification-item.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/notification-item.tsx index 0f3246d84..3853e461d 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/notification-item.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/notification-item.tsx @@ -8,8 +8,8 @@ import { FeedTitle } from "~/modules/feed/feed-title" import { readableContentMaxWidth } from "../styles" import type { EntryItemStatelessProps, UniversalItemProps } from "../types" -export function NotificationItem({ entryId, entryPreview, translation }: UniversalItemProps) { - return +export function NotificationItem({ entryId, translation }: UniversalItemProps) { + return } NotificationItem.wrapperClassName = readableContentMaxWidth @@ -17,7 +17,7 @@ NotificationItem.wrapperClassName = readableContentMaxWidth export function NotificationItemStateLess({ entry, feed }: EntryItemStatelessProps) { return (
- +
diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/picture-item.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/picture-item.tsx index a1f0e11d3..8c179c0dc 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/picture-item.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/picture-item.tsx @@ -22,9 +22,9 @@ import { EntryItemWrapper } from "../layouts/EntryItemWrapper" import { GridItem, GridItemFooter } from "../templates/grid-item-template" import type { UniversalItemProps } from "../types" -export function PictureItem({ entryId, entryPreview, translation }: UniversalItemProps) { +export function PictureItem({ entryId, translation }: UniversalItemProps) { const entry = useEntry(entryId, (state) => ({ media: state.media, id: state.id })) - const entryMedia = entry?.media || entryPreview?.entries?.media || [] + const entryMedia = entry?.media || [] const isActive = useRouteParamsSelector(({ entryId }) => entryId === entry?.id) @@ -33,7 +33,7 @@ export function PictureItem({ entryId, entryPreview, translation }: UniversalIte const previewMedia = usePreviewMedia(entryContent) if (!entry) return null return ( - +
{entryMedia ? (
- +
) : ( diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/social-media-item.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/social-media-item.tsx index 8719bb54d..8e5b4798e 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/social-media-item.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/social-media-item.tsx @@ -87,7 +87,7 @@ export const SocialMediaItem: EntryListItemFC = ({ entryId, translation }) => { "before:bg-accent before:absolute before:-left-3 before:top-8 before:block before:size-2 before:rounded-full", )} > - +
@@ -140,7 +140,7 @@ SocialMediaItem.wrapperClassName = readableContentMaxWidth export function SocialMediaItemStateLess({ entry, feed }: EntryItemStatelessProps) { return (
- +
diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.ai.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.ai.tsx index a32add28e..5ed65f2c8 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.ai.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.ai.tsx @@ -18,7 +18,7 @@ import type { EntryItemStatelessProps, UniversalItemProps } from "../types" const ViewTag = IN_ELECTRON ? "webview" : "iframe" -export function VideoItem({ entryId, entryPreview, translation }: UniversalItemProps) { +export function VideoItem({ entryId, translation }: UniversalItemProps) { const entry = useEntry(entryId, (state) => { const { id, url } = state @@ -81,7 +81,7 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP if (!entry) return null return ( - +
{miniIframeSrc && showPreview ? ( @@ -167,7 +167,7 @@ export function VideoItemStateLess({ entry, feed }: EntryItemStatelessProps) {
- + diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.legacy.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.legacy.tsx index d614829bc..4c4531345 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.legacy.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/Items/video-item.legacy.tsx @@ -33,7 +33,7 @@ import type { EntryItemStatelessProps, UniversalItemProps } from "../types" const ViewTag = IN_ELECTRON ? "webview" : "iframe" -export function VideoItem({ entryId, entryPreview, translation }: UniversalItemProps) { +export function VideoItem({ entryId, translation }: UniversalItemProps) { const entry = useEntry(entryId, (state) => { const { id, url } = state @@ -100,7 +100,7 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP if (!entry) return null return ( - +
{ @@ -273,7 +273,7 @@ export function VideoItemStateLess({ entry, feed }: EntryItemStatelessProps) {
- + diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/templates/grid-item-template.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/templates/grid-item-template.tsx index 50426dd73..c96b73e6a 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/templates/grid-item-template.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/templates/grid-item-template.tsx @@ -20,14 +20,14 @@ interface GridItemProps extends UniversalItemProps { wrapperClassName?: string } export function GridItem(props: GridItemProps) { - const { entryId, entryPreview, wrapperClassName, children, translation } = props + const { entryId, wrapperClassName, children, translation } = props const hasEntry = useHasEntry(entryId) if (!hasEntry) return null return (
{children} - +
) } @@ -38,7 +38,7 @@ export const GridItemFooter = ({ titleClassName, descriptionClassName, timeClassName, -}: Pick & { +}: Pick & { titleClassName?: string descriptionClassName?: string timeClassName?: string @@ -105,7 +105,7 @@ export const GridItemFooter = ({ fallback noMargin className="flex" - feed={feeds!} + target={feeds!} entry={entry?.iconEntry} size={18} /> diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.ai.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.ai.tsx index baec481fa..6f430ef4d 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.ai.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.ai.tsx @@ -55,7 +55,6 @@ const entrySelector = (state: EntryModel) => { } export function ListItem({ entryId, - entryPreview, translation, simple, }: UniversalItemProps & { @@ -71,18 +70,17 @@ export function ListItem({ const inInCollection = useRouteParamsSelector((s) => s.feedId === FEED_COLLECTION_LIST) - const feed = - useFeedById(entry?.feedId, (feed) => { - return { - type: feed.type, - ownerUserId: feed.ownerUserId, - id: feed.id, - title: feed.title, - url: (feed as any).url || "", - image: feed.image, - siteUrl: feed.siteUrl, - } - }) || entryPreview?.feeds + const feed = useFeedById(entry?.feedId, (feed) => { + return { + type: feed.type, + ownerUserId: feed.ownerUserId, + id: feed.id, + title: feed.title, + url: (feed as any).url || "", + image: feed.image, + siteUrl: feed.siteUrl, + } + }) const inbox = useInboxById(entry?.inboxId) @@ -149,7 +147,7 @@ export function ListItem({ "before:bg-accent before:absolute before:-left-3 before:top-6 before:block before:size-2 before:rounded-full", )} > - +
} - feed={feed || inbox} + target={feed || inbox} entry={entry?.iconEntry} size={80} className="m-0 rounded" diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx index b3daed23f..a223c4db8 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx @@ -55,7 +55,7 @@ const entrySelector = (state: EntryModel) => { } export function ListItem({ entryId, - entryPreview, + translation, simple, }: UniversalItemProps & { @@ -71,18 +71,17 @@ export function ListItem({ const inInCollection = useRouteParamsSelector((s) => s.feedId === FEED_COLLECTION_LIST) - const feed = - useFeedById(entry?.feedId, (feed) => { - return { - type: feed.type, - ownerUserId: feed.ownerUserId, - id: feed.id, - title: feed.title, - url: (feed as any).url || "", - image: feed.image, - siteUrl: feed.siteUrl, - } - }) || entryPreview?.feeds + const feed = useFeedById(entry?.feedId, (feed) => { + return { + type: feed.type, + ownerUserId: feed.ownerUserId, + id: feed.id, + title: feed.title, + url: (feed as any).url || "", + image: feed.image, + siteUrl: feed.siteUrl, + } + }) const inbox = useInboxById(entry?.inboxId) @@ -151,7 +150,7 @@ export function ListItem({ settingWideMode ? "py-3" : "py-4", )} > - +
} - feed={feed || inbox} + target={feed || inbox} entry={entry?.iconEntry} size={settingWideMode ? 65 : 80} className="m-0 rounded" diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/types.ts b/apps/desktop/layer/renderer/src/modules/entry-column/types.ts index 340328989..7a785d65c 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/types.ts +++ b/apps/desktop/layer/renderer/src/modules/entry-column/types.ts @@ -1,19 +1,10 @@ -import type { - CombinedEntryModel, - EntryModelSimple, - FeedModel, - FeedOrListRespModel, -} from "@follow/models/types" +import type { FeedModel } from "@follow/store/feed/types" import type { EntryTranslation } from "@follow/store/translation/types" +import type { ParsedEntry } from "@follow-app/client-sdk" import type { FC } from "react" export type UniversalItemProps = { entryId: string - entryPreview?: CombinedEntryModel & { - feeds: FeedOrListRespModel - feedId: string - inboxId: string - } translation?: EntryTranslation } @@ -23,6 +14,6 @@ export type EntryListItemFC

= FC

) } -export const ImageGallery = ({ images }: { images: MediaModel }) => { +export const ImageGallery = ({ images }: { images: MediaModel[] }) => { const { containerRef, currentColumn, currentItemWidth } = useMasonryColumn(gutter) const [masonryItemsRadio, setMasonryItemsRadio] = useState>({}) diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTitle.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTitle.tsx index 0e378f91b..d44249e34 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTitle.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTitle.tsx @@ -80,7 +80,7 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => { return compact ? (

- +
{entry.author || feed?.title || inbox?.title} @@ -119,7 +119,7 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => { }) } > - + {getPreferredTitle(feed || inbox, entry.titleEntry)}
diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/ImageGalleryContent.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/ImageGalleryContent.tsx index 5712842c6..93ed9d78a 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/ImageGalleryContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/ImageGalleryContent.tsx @@ -6,5 +6,5 @@ export const ImageGalleryContent = ({ entryId }: { entryId: string }) => { const images = useEntry(entryId, (entry) => entry.media) // images?.length && images.length > 5 // We don't need to check here, we already check in the action - return + return } diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/SupportCreator.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/SupportCreator.tsx index bc4251706..848a4e18e 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/SupportCreator.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/SupportCreator.tsx @@ -52,7 +52,7 @@ export const SupportCreator = ({ entryId }: { entryId: string }) => { enableModal /> ) : ( - + )} {feed.title} diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx index 3a896847b..a4974bad6 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx @@ -4,9 +4,9 @@ import { RootPortal } from "@follow/components/ui/portal/index.js" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" import { FeedViewType } from "@follow/constants" import { useTitle } from "@follow/hooks" -import type { FeedModel } from "@follow/models/types" import { useEntry } from "@follow/store/entry/hooks" import { useFeedById } from "@follow/store/feed/hooks" +import type { FeedModel } from "@follow/store/feed/types" import { useIsInbox } from "@follow/store/inbox/hooks" import { useSubscriptionByFeedId } from "@follow/store/subscription/hooks" import { thenable } from "@follow/utils" diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.legacy.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.legacy.tsx index 96cce8aaf..651e8a5fd 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.legacy.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.legacy.tsx @@ -6,9 +6,9 @@ import { RootPortal } from "@follow/components/ui/portal/index.js" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" import { FeedViewType } from "@follow/constants" import { useTitle } from "@follow/hooks" -import type { FeedModel } from "@follow/models/types" import { useEntry } from "@follow/store/entry/hooks" import { useFeedById } from "@follow/store/feed/hooks" +import type { FeedModel } from "@follow/store/feed/types" import { useIsInbox } from "@follow/store/inbox/hooks" import { thenable } from "@follow/utils" import { nextFrame, stopPropagation } from "@follow/utils/dom" diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/shared/AuthorHeader.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/shared/AuthorHeader.tsx index b2e57cb93..f7b950e78 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/shared/AuthorHeader.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/shared/AuthorHeader.tsx @@ -54,7 +54,7 @@ export const AuthorHeader: React.FC = ({ {showAvatar && ( { const me = useWhoami() - const presentUserProfile = usePresentUserProfileModal("drawer") + const { t } = useTranslation() const { type } = feed @@ -61,17 +62,8 @@ export const FeedCertification = ({
{t("feed_item.claimed_by_owner")} - {feed.owner ? ( - { - e.stopPropagation() - presentUserProfile(feed.owner!.id) - }} - > - - {feed.owner.name?.slice(0, 2)} - + {feed.ownerUserId ? ( + ) : ( {t("feed_item.claimed_by_unknown")} )} @@ -82,3 +74,21 @@ export const FeedCertification = ({ )) ) } + +const FeedCertificateAvatar = ({ userId }: { userId: string }) => { + const user = useUserById(userId) + const presentUserProfile = usePresentUserProfileModal("drawer") + if (!user) return null + return ( + { + e.stopPropagation() + presentUserProfile(userId) + }} + > + + {user.name?.slice(0, 2)} + + ) +} diff --git a/apps/desktop/layer/renderer/src/modules/feed/feed-icon.tsx b/apps/desktop/layer/renderer/src/modules/feed/feed-icon.tsx index dfebab7b6..fd62bc16b 100644 --- a/apps/desktop/layer/renderer/src/modules/feed/feed-icon.tsx +++ b/apps/desktop/layer/renderer/src/modules/feed/feed-icon.tsx @@ -1,8 +1,6 @@ // import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx" import { PlatformIcon } from "@follow/components/ui/platform-icon/index.jsx" -import type { FeedOrListRespModel } from "@follow/models/types" import type { FeedModel } from "@follow/store/feed/types" -import type { ListModel } from "@follow/store/list/types" import { getBackgroundGradient } from "@follow/utils/color" import { getImageProxyUrl } from "@follow/utils/img-proxy" import { cn, getUrlIcon } from "@follow/utils/utils" @@ -21,18 +19,22 @@ const getBorderRadius = (size: number) => { return "rounded-xl" // 12px for extra large avatars } -function getIconProps( - props: Pick< - Parameters[0], - "feed" | "entry" | "useMedia" | "siteUrl" | "fallbackUrl" | "fallback" | "size" - >, -) { - const { feed, entry, useMedia, siteUrl: propSiteUrl, fallbackUrl, fallback, size = 20 } = props +type GetIconPropsProps = { + target?: IconTarget | null + entry?: FeedIconEntry | null + useMedia?: boolean + siteUrl?: string + fallbackUrl?: string + fallback?: boolean + size?: number +} +function getIconProps(props: GetIconPropsProps) { + const { target, entry, useMedia, siteUrl: propSiteUrl, fallbackUrl, fallback, size = 20 } = props const image = - (useMedia ? entry?.firstPhotoUrl || entry?.authorAvatar : entry?.authorAvatar) || feed?.image - const siteUrl = (feed as FeedModel)?.siteUrl || fallbackUrl + (useMedia ? entry?.firstPhotoUrl || entry?.authorAvatar : entry?.authorAvatar) || target?.image + const siteUrl = (target as FeedModel)?.siteUrl || fallbackUrl - if (propSiteUrl && !feed) { + if (propSiteUrl && !target) { const [src] = getFeedIconSrc({ siteUrl: propSiteUrl, }) @@ -72,13 +74,13 @@ function getIconProps( fallbackSrc, } } - if (feed?.type === "inbox") { + if (target?.type === "inbox") { return { type: "inbox" as const, } } - if (feed?.title) { + if (target?.title) { return { type: "text" as const, } @@ -147,10 +149,19 @@ const FallbackableImage = function FallbackableImage({ ) } -type FeedIconFeed = - | Pick - | ListModel - | FeedOrListRespModel +// type FeedIconFeed = Pick | ListModel +type IconTarget = { + title?: Nullable + image?: Nullable + siteUrl?: Nullable + type: "feed" | "list" | "inbox" + entry?: FeedIconEntry | null + useMedia?: boolean + feed?: FeedModel | null + fallbackUrl?: string + fallback?: boolean + size?: number +} export type FeedIconEntry = { authorAvatar?: string | null; firstPhotoUrl?: string | null } const fadeInVariant = { @@ -160,7 +171,7 @@ const fadeInVariant = { const isIconLoadedSet = new Set() export function FeedIcon({ - feed, + target, entry, fallbackUrl, className, @@ -172,7 +183,7 @@ export function FeedIcon({ disableFadeIn, noMargin, }: { - feed?: FeedIconFeed | null + target?: IconTarget | null entry?: FeedIconEntry | null fallbackUrl?: string className?: string @@ -189,11 +200,11 @@ export function FeedIcon({ noMargin?: boolean }) { const marginClassName = cn(noMargin ? "" : "mr-2", className) - const iconProps = getIconProps({ feed, entry, useMedia, siteUrl, fallbackUrl, fallback, size }) + const iconProps = getIconProps({ target, entry, useMedia, siteUrl, fallbackUrl, fallback, size }) const colors = useMemo( - () => getBackgroundGradient(feed?.title || (feed as FeedModel)?.url || siteUrl || ""), - [feed?.title, (feed as FeedModel)?.url, siteUrl], + () => getBackgroundGradient(target?.title || (target as FeedModel)?.url || siteUrl || ""), + [target?.title, (target as FeedModel)?.url, siteUrl], ) const sizeStyle: React.CSSProperties = useMemo( @@ -226,7 +237,7 @@ export function FeedIcon({ fontSize: size / 2, }} > - {!!feed?.title && feed.title[0]} + {!!target?.title && target.title[0]} ) diff --git a/apps/desktop/layer/renderer/src/modules/feed/feed-summary.tsx b/apps/desktop/layer/renderer/src/modules/feed/feed-summary.tsx index 856f3b0c3..07f902949 100644 --- a/apps/desktop/layer/renderer/src/modules/feed/feed-summary.tsx +++ b/apps/desktop/layer/renderer/src/modules/feed/feed-summary.tsx @@ -1,6 +1,8 @@ import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/EllipsisWithTooltip.js" -import type { FeedOrListRespModel } from "@follow/models/types" import { env } from "@follow/shared/env.desktop" +import type { FeedModel } from "@follow/store/feed/types" +import type { InboxModel } from "@follow/store/inbox/types" +import type { ListModel } from "@follow/store/list/types" import { cn } from "@follow/utils/utils" import { UrlBuilder } from "~/lib/url-builder" @@ -13,7 +15,7 @@ export function FollowSummary({ className, simple, }: { - feed: FeedOrListRespModel + feed: FeedModel | ListModel | InboxModel docs?: string className?: string simple?: boolean @@ -39,7 +41,7 @@ export function FollowSummary({
{title || getPreferredTitle(feed)} - {!hideExtraBadge && ( + {!hideExtraBadge && feed.type !== "inbox" && ( <> diff --git a/apps/desktop/layer/renderer/src/modules/panel/cmdk.tsx b/apps/desktop/layer/renderer/src/modules/panel/cmdk.tsx index 3ce87ce24..b636dab12 100644 --- a/apps/desktop/layer/renderer/src/modules/panel/cmdk.tsx +++ b/apps/desktop/layer/renderer/src/modules/panel/cmdk.tsx @@ -272,7 +272,7 @@ const SearchItem = memo(function Item({ }} >
- {feed && } + {feed && } {title} {subtitle} diff --git a/apps/desktop/layer/renderer/src/modules/player/corner-player.tsx b/apps/desktop/layer/renderer/src/modules/player/corner-player.tsx index 75e9fbc61..cef9f7c3e 100644 --- a/apps/desktop/layer/renderer/src/modules/player/corner-player.tsx +++ b/apps/desktop/layer/renderer/src/modules/player/corner-player.tsx @@ -211,7 +211,7 @@ const CornerPlayerImpl = ({ hideControls, rounded }: ControlButtonProps) => { {/* play cover */}
{ const refreshMutation = useMutation({ mutationFn: async () => { - await apiClient.wallets.refresh.$post() + await followClient.api.wallets.refresh() }, onSuccess: () => { walletActions.get().invalidate() diff --git a/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx b/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx index d9a060dc1..7cde6fb2a 100644 --- a/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx +++ b/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx @@ -27,7 +27,7 @@ import { z } from "zod" import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useAuthQuery } from "~/hooks/common/useBizQuery" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { useTOTPModalWrapper } from "~/modules/profile/hooks" import { Balance } from "~/modules/wallet/balance" @@ -69,7 +69,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => { const powerPrice = useAuthQuery( defineQuery(["power-price"], async () => { - const res = await apiClient.wallets["power-price"].$get() + const res = await followClient.api.wallets.powerPrice() return res.data }), ) @@ -87,13 +87,11 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => { TOTPCode?: string }) => { const amountBigInt = from(amount, 18)[0] - await apiClient.wallets.transactions.withdraw.$post({ - json: { - address, - amount: amountBigInt.toString(), - toRss3, - TOTPCode, - }, + await followClient.api.wallets.transactions.withdraw({ + address, + amount: amountBigInt.toString(), + toRss3, + TOTPCode, }) }, }) @@ -113,7 +111,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => { if (mutation.isSuccess) { toast.success(t("wallet.withdraw.success")) walletActions.get().invalidate() - walletActions.transactions.get().invalidate() + walletActions.transactions.get({}).invalidate() dismiss() } }, [mutation.isSuccess, t, dismiss]) diff --git a/apps/desktop/layer/renderer/src/modules/power/transaction-section/TransactionsSection.tsx b/apps/desktop/layer/renderer/src/modules/power/transaction-section/TransactionsSection.tsx index 64b2915ff..a2a7226b9 100644 --- a/apps/desktop/layer/renderer/src/modules/power/transaction-section/TransactionsSection.tsx +++ b/apps/desktop/layer/renderer/src/modules/power/transaction-section/TransactionsSection.tsx @@ -1,7 +1,7 @@ import { LoadingCircle } from "@follow/components/ui/loading/index.js" import { Tabs, TabsList, TabsTrigger } from "@follow/components/ui/tabs/index.jsx" -import { TransactionTypes } from "@follow/models/types" import { useWhoami } from "@follow/store/user/hooks" +import { TransactionTypes } from "@follow-app/client-sdk" import { useState } from "react" import { useTranslation } from "react-i18next" diff --git a/apps/desktop/layer/renderer/src/modules/power/transaction-section/tx-table/TxTable.tsx b/apps/desktop/layer/renderer/src/modules/power/transaction-section/tx-table/TxTable.tsx index a142d8458..72c382c66 100644 --- a/apps/desktop/layer/renderer/src/modules/power/transaction-section/tx-table/TxTable.tsx +++ b/apps/desktop/layer/renderer/src/modules/power/transaction-section/tx-table/TxTable.tsx @@ -13,9 +13,9 @@ import { TooltipTrigger, } from "@follow/components/ui/tooltip/index.jsx" import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/index.js" -import type { TransactionTypes } from "@follow/models" import { useWhoami } from "@follow/store/user/hooks" import { cn } from "@follow/utils/utils" +import type { TransactionType } from "@follow-app/client-sdk" import { useTranslation } from "react-i18next" import { RelativeTime } from "~/components/ui/datetime" @@ -30,7 +30,7 @@ export const TxTable = ({ className, type }: ComponentType) => { const user = useWhoami() const transactions = useWalletTransactions({ fromOrToUserId: user?.id, - type: type === "all" ? undefined : (type as (typeof TransactionTypes)[number]), + type: type === "all" ? undefined : (type as TransactionType), }) return ( diff --git a/apps/desktop/layer/renderer/src/modules/profile/hooks.ts b/apps/desktop/layer/renderer/src/modules/profile/hooks.ts index 2fb8729ac..2d788a56b 100644 --- a/apps/desktop/layer/renderer/src/modules/profile/hooks.ts +++ b/apps/desktop/layer/renderer/src/modules/profile/hooks.ts @@ -10,7 +10,7 @@ import { useAsyncModal } from "~/components/ui/modal/helper/useAsyncModal" import { PlainModal } from "~/components/ui/modal/stacked/custom-modal" import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useAuthQuery } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { getFetchErrorInfo } from "~/lib/error-parser" @@ -23,9 +23,7 @@ const LazyUserProfileModalContent = lazy(() => export const useUserSubscriptionsQuery = (userId: string | undefined) => { const subscriptions = useAuthQuery( defineQuery(["subscriptions", "group", userId], async () => { - const res = await apiClient.subscriptions.$get({ - query: { userId }, - }) + const res = await followClient.api.subscriptions.get({ userId }) const groupFolder = {} as Record for (const subscription of res.data || []) { diff --git a/apps/desktop/layer/renderer/src/modules/profile/profile-setting-form.tsx b/apps/desktop/layer/renderer/src/modules/profile/profile-setting-form.tsx index 012faf3d5..84563ea28 100644 --- a/apps/desktop/layer/renderer/src/modules/profile/profile-setting-form.tsx +++ b/apps/desktop/layer/renderer/src/modules/profile/profile-setting-form.tsx @@ -106,17 +106,16 @@ export const ProfileSettingForm = ({ handle: values.handle, image: values.image, name: values.name, - // @ts-expect-error bio: values.bio, website: values.website, - socialLinks: values.socialLinks, + socialLinks: values.socialLinks as any, }), onError: (error) => { toastFetchError(error) }, onSuccess: (_, variables) => { if (user && variables) { - userActions.updateWhoami({ ...variables }) + userActions.updateWhoami({ ...variables } as any) } toast(t("profile.updateSuccess"), { duration: 3000, diff --git a/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx b/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx index 242b8bbf2..544133f6e 100644 --- a/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx @@ -4,12 +4,12 @@ import { ActionButton, Button } from "@follow/components/ui/button/index.js" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" import { Tooltip, TooltipContent, TooltipTrigger } from "@follow/components/ui/tooltip/index.js" -import type { ExtractBizResponse } from "@follow/models" import { usePrefetchUser, useUserById, useWhoami } from "@follow/store/user/hooks" import { getAvatarUrl } from "@follow/utils" import { nextFrame, stopPropagation } from "@follow/utils/dom" import { getStorageNS } from "@follow/utils/ns" import { cn } from "@follow/utils/utils" +import type { ListWithStats } from "@follow-app/client-sdk" import { useQuery } from "@tanstack/react-query" import { useAtom } from "jotai" import { atomWithStorage } from "jotai/utils" @@ -21,7 +21,7 @@ import { useTranslation } from "react-i18next" import { m } from "~/components/common/Motion" import { useCurrentModal } from "~/components/ui/modal/stacked/hooks" import { useFollow } from "~/hooks/biz/useFollow" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { UrlBuilder } from "~/lib/url-builder" import { FeedIcon } from "~/modules/feed/feed-icon" @@ -63,7 +63,7 @@ const pickUserData = < } } -const ListCard = memo(({ list }: { list: List }) => { +const ListCard = memo(({ list }: { list: ListWithStats }) => { return (
{
@@ -364,15 +364,13 @@ const useUserListsQuery = (userId: string) => { return useQuery({ queryKey: ["lists", userId], queryFn: async () => { - const res = await apiClient.lists.list.$get({ query: { userId } }) + const res = await followClient.api.lists.list({ userId }) return res.data }, }) } -type List = ExtractBizResponse["data"][number] - -const Lists = ({ lists }: { lists: List[] }) => { +const Lists = ({ lists }: { lists: ListWithStats[] }) => { const { t } = useTranslation() if (!lists || lists.length === 0) return null return ( diff --git a/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/shared.tsx b/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/shared.tsx index 26b3b241c..20897c577 100644 --- a/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/shared.tsx +++ b/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/shared.tsx @@ -5,10 +5,14 @@ import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avata import { Button } from "@follow/components/ui/button/index.js" import { LoadingWithIcon } from "@follow/components/ui/loading/index.jsx" import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/index.js" -import type { SubscriptionModel } from "@follow/models/types" import { useIsSubscribed } from "@follow/store/subscription/hooks" import { usePrefetchUser, useUserById } from "@follow/store/user/hooks" import { cn } from "@follow/utils/utils" +import type { + InboxSubscriptionResponse, + ListSubscriptionResponse, + SubscriptionWithFeed, +} from "@follow-app/client-sdk" import { AnimatePresence } from "motion/react" import type { FC } from "react" import { memo, useState } from "react" @@ -71,7 +75,7 @@ export const SubscriptionItems = ({ export const SubscriptionGroup: FC<{ category: string - subscriptions: SubscriptionModel[] + subscriptions: (SubscriptionWithFeed | ListSubscriptionResponse | InboxSubscriptionResponse)[] itemStyle: ItemVariant }> = memo(({ category, subscriptions, itemStyle }) => { const [isOpened, setIsOpened] = useState(true) @@ -114,7 +118,7 @@ export const SubscriptionGroup: FC<{ }) const SubscriptionItem: FC<{ - subscription: SubscriptionModel + subscription: SubscriptionWithFeed | ListSubscriptionResponse | InboxSubscriptionResponse variant: ItemVariant }> = ({ subscription, variant }) => { @@ -154,7 +158,7 @@ const SubscriptionItem: FC<{ target="_blank" onClick={isMobile ? handleFollow : undefined} > - +
void - instance?: RSSHubModel + instance?: RSSHubListItem }) { const { t } = useTranslation("settings") const addRSSHubMutation = useAddRSSHubMutation() diff --git a/apps/desktop/layer/renderer/src/modules/rsshub/delete-modal-content.tsx b/apps/desktop/layer/renderer/src/modules/rsshub/delete-modal-content.tsx index bfb6221f1..5a5047338 100644 --- a/apps/desktop/layer/renderer/src/modules/rsshub/delete-modal-content.tsx +++ b/apps/desktop/layer/renderer/src/modules/rsshub/delete-modal-content.tsx @@ -3,14 +3,14 @@ import { useMutation } from "@tanstack/react-query" import { useTranslation } from "react-i18next" import { toast } from "sonner" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { Queries } from "~/queries" export const ConfirmDeleteModalContent = ({ id, dismiss }: { dismiss: () => void; id: string }) => { const { t } = useTranslation("settings") const deleteMutation = useMutation({ mutationFn: () => { - return apiClient.rsshub.$delete({ json: { id } }) + return followClient.api.rsshub.delete({ id }) }, onSuccess: () => { Queries.rsshub.list().invalidate() diff --git a/apps/desktop/layer/renderer/src/modules/rsshub/set-modal-content.tsx b/apps/desktop/layer/renderer/src/modules/rsshub/set-modal-content.tsx index 94eafc510..01b285fac 100644 --- a/apps/desktop/layer/renderer/src/modules/rsshub/set-modal-content.tsx +++ b/apps/desktop/layer/renderer/src/modules/rsshub/set-modal-content.tsx @@ -9,8 +9,8 @@ import { FormMessage, } from "@follow/components/ui/form/index.jsx" import { Input } from "@follow/components/ui/input/Input.js" -import type { RSSHubModel } from "@follow/models" import { whoami } from "@follow/store/user/getters" +import type { RSSHubListItem } from "@follow-app/client-sdk" import { zodResolver } from "@hookform/resolvers/zod" import { useEffect } from "react" import { useForm } from "react-hook-form" @@ -29,7 +29,7 @@ export function SetModalContent({ instance, }: { dismiss: () => void - instance: RSSHubModel + instance: RSSHubListItem }) { const { t } = useTranslation("settings") const setRSSHubMutation = useSetRSSHubMutation() diff --git a/apps/desktop/layer/renderer/src/modules/settings/helper/sync-queue.ts b/apps/desktop/layer/renderer/src/modules/settings/helper/sync-queue.ts index 9300faceb..74f937e8d 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/helper/sync-queue.ts +++ b/apps/desktop/layer/renderer/src/modules/settings/helper/sync-queue.ts @@ -2,6 +2,7 @@ import type { AISettings, GeneralSettings, UISettings } from "@follow/shared/set import { EventBus } from "@follow/utils/event-bus" import { getStorageNS } from "@follow/utils/ns" import { isEmptyObject, sleep } from "@follow/utils/utils" +import type { SettingsTab } from "@follow-app/client-sdk" import { omit } from "es-toolkit/compat" import type { PrimitiveAtom } from "jotai" @@ -12,7 +13,7 @@ import { getGeneralSettings, } from "~/atoms/settings/general" import { __uiSettingAtom, getUISettings, uiServerSyncWhiteListKeys } from "~/atoms/settings/ui" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { jotaiStore } from "~/lib/jotai" import { settings } from "~/queries/settings" @@ -171,11 +172,10 @@ class SettingSyncQueue { if (isEmptyObject(json)) { continue } - const promise = apiClient.settings[":tab"] - .$patch({ - param: { - tab, - }, + + const promise = followClient.api.settings + .update({ + tab: tab as SettingsTab, json, }) .then(() => { @@ -199,10 +199,9 @@ class SettingSyncQueue { const promises = [] as Promise[] for (const tab in localSettingGetterMap) { const payload = localSettingGetterMap[tab]() - const promise = apiClient.settings[":tab"].$patch({ - param: { - tab, - }, + + const promise = followClient.api.settings.update({ + tab: tab as SettingsTab, json: payload, }) @@ -215,10 +214,8 @@ class SettingSyncQueue { const payload = localSettingGetterMap[tab]() this.chain = this.chain.finally(() => - apiClient.settings[":tab"].$patch({ - param: { - tab, - }, + followClient.api.settings.update({ + tab: tab as SettingsTab, json: payload, }), ) diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx index aa42ce179..731ce367f 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx @@ -451,7 +451,7 @@ const FeedListItem = memo( onSelect(id, !!checked)} />
- +
{feed?.errorAt ? ( @@ -591,7 +591,7 @@ const FeedClaimedSection = () => { href={UrlBuilder.shareFeed(row.feed.id)} className="flex items-center" > - + {row.feed.title} diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/invitations.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/invitations.tsx index 091622de2..7f3e31466 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/invitations.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/invitations.tsx @@ -16,6 +16,7 @@ import { TooltipPortal, TooltipTrigger, } from "@follow/components/ui/tooltip/index.jsx" +import type { CreateInvitationRequest } from "@follow-app/client-sdk" import { useMutation } from "@tanstack/react-query" import dayjs from "dayjs" import { Trans, useTranslation } from "react-i18next" @@ -25,7 +26,7 @@ import { useServerConfigs } from "~/atoms/server-configs" import { CopyButton } from "~/components/ui/button/CopyButton" import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useAuthQuery } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { copyToClipboard } from "~/lib/clipboard" import { toastFetchError } from "~/lib/error-parser" import { usePresentUserProfileModal, useTOTPModalWrapper } from "~/modules/profile/hooks" @@ -172,8 +173,8 @@ const ConfirmModalContent = ({ dismiss }: { dismiss: () => void }) => { const { t } = useTranslation("settings") const newInvitation = useMutation({ mutationKey: ["newInvitation"], - mutationFn: (values: Parameters[0]["json"]) => - apiClient.invitations.new.$post({ json: values }), + mutationFn: (values: CreateInvitationRequest) => + followClient.api.invitations.create({ TOTPCode: values.TOTPCode }), onError(err) { toastFetchError(err) }, diff --git a/apps/desktop/layer/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx b/apps/desktop/layer/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx index 2da369be4..2a9a4df12 100644 --- a/apps/desktop/layer/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx +++ b/apps/desktop/layer/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx @@ -1,7 +1,8 @@ import { Card, CardContent, CardHeader } from "@follow/components/ui/card/index.jsx" import { FeedViewType, views } from "@follow/constants" -import type { EntryModelSimple, FeedModel } from "@follow/models" +import type { FeedModel } from "@follow/store/feed/types" import { cn } from "@follow/utils/utils" +import type { ParsedEntry } from "@follow-app/client-sdk" import { cloneElement } from "react" import { useI18n } from "~/hooks/common" @@ -17,7 +18,7 @@ export const ViewSelectorRadioGroup = ({ className, ...rest }: { - entries?: EntryModelSimple[] + entries?: ParsedEntry[] feed?: FeedModel view?: number } & React.InputHTMLAttributes & { diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx index 10c2aa7b5..c8048a98e 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx @@ -193,7 +193,7 @@ const FeedItemImpl = ({ view, feedId, className, isPreview }: FeedItemProps) => {...contextMenuProps} >
- + {isFeed && ( @@ -319,7 +319,7 @@ const ListItemImpl: Component = ({ {...contextMenuProps} >
- + {getPreferredTitle(list)} @@ -432,7 +432,7 @@ const InboxItemImpl: Component = ({ view, inboxId, className, ic {...contextMenuProps} >
- + {getPreferredTitle(inbox)} diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/SimpleDiscoverModal.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/SimpleDiscoverModal.tsx index 337ff7714..be9c2cdbf 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/SimpleDiscoverModal.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/SimpleDiscoverModal.tsx @@ -9,6 +9,7 @@ import { } from "@follow/components/ui/form/index.jsx" import { Input } from "@follow/components/ui/input/index.js" import { SegmentGroup, SegmentItem } from "@follow/components/ui/segment/index.js" +import type { DiscoveryItem } from "@follow-app/client-sdk" import { zodResolver } from "@hookform/resolvers/zod" import { useMutation } from "@tanstack/react-query" import { atom, useAtomValue, useStore } from "jotai" @@ -20,7 +21,7 @@ import { Link } from "react-router" import { z } from "zod" import { useModalStack } from "~/components/ui/modal/stacked/hooks" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { DiscoverFeedCard } from "../discover/DiscoverFeedCard" import { FeedForm } from "../discover/FeedForm" @@ -30,8 +31,6 @@ const formSchema = z.object({ type: z.enum(["search", "rss", "rsshub"]), }) -type DiscoverSearchData = Awaited>["data"] - const typeConfig = { search: { label: "discover.any_url_or_keyword", @@ -69,7 +68,7 @@ export function SimpleDiscoverModal({ dismiss }: { dismiss: () => void }) { const watchedType = form.watch("type") const currentConfig = typeConfig[watchedType] - const discoverSearchDataAtom = useState(() => atom())[0] + const discoverSearchDataAtom = useState(() => atom())[0] const discoverSearchData = useAtomValue(discoverSearchDataAtom) const mutation = useMutation({ @@ -91,12 +90,9 @@ export function SimpleDiscoverModal({ dismiss }: { dismiss: () => void }) { return [] } - // For search, use discover API - const { data } = await apiClient.discover.$post({ - json: { - keyword: keyword.trim(), - target: "feeds", - }, + const { data } = await followClient.api.discover.discover({ + keyword: keyword.trim(), + target: "feeds", }) jotaiStore.set(discoverSearchDataAtom, data) diff --git a/apps/desktop/layer/renderer/src/modules/trending/index.tsx b/apps/desktop/layer/renderer/src/modules/trending/index.tsx index b5c561446..c66b27843 100644 --- a/apps/desktop/layer/renderer/src/modules/trending/index.tsx +++ b/apps/desktop/layer/renderer/src/modules/trending/index.tsx @@ -8,7 +8,7 @@ import { useEffect, useState } from "react" import { useTranslation } from "react-i18next" import { setUISetting, useUISettingKey } from "~/atoms/settings/ui" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { TrendingFeedCard } from "../discover/TrendingFeedCard" @@ -61,12 +61,10 @@ export function Trending({ const { data, isLoading } = useQuery({ queryKey: ["trending", lang, selectedView], queryFn: async () => { - return await apiClient.trending.feeds.$get({ - query: { - language: lang === "all" ? undefined : lang, - view: selectedView === "all" ? undefined : Number(selectedView), - limit, - }, + return await followClient.api.trending.getFeeds({ + language: lang === "all" ? undefined : lang, + view: selectedView === "all" ? undefined : Number(selectedView), + limit, }) }, meta: { diff --git a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/category/[category].tsx b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/category/[category].tsx index dd6196890..b289d205c 100644 --- a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/category/[category].tsx +++ b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/category/[category].tsx @@ -6,6 +6,7 @@ import { useScrollElementUpdate } from "@follow/components/ui/scroll-area/hooks. import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/EllipsisWithTooltip.js" import { CategoryMap, RSSHubCategories } from "@follow/constants" import { cn, formatNumber } from "@follow/utils/utils" +import type { RSSHubAnalyticsResponse, RSSHubNamespace } from "@follow-app/client-sdk" import { keepPreviousData } from "@tanstack/react-query" import { memo, useCallback, useEffect, useMemo, useState } from "react" import { useTranslation } from "react-i18next" @@ -15,7 +16,6 @@ import { useUISettingKey } from "~/atoms/settings/ui" import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useFollow } from "~/hooks/biz/useFollow" import { useAuthQuery } from "~/hooks/common" -import type { apiClient } from "~/lib/api-fetch" import { useSubViewTitle } from "~/modules/app-layout/subview/hooks" import { RecommendationContent } from "~/modules/discover/RecommendationContent" import { FeedIcon } from "~/modules/feed/feed-icon" @@ -28,8 +28,6 @@ const LanguageMap = { cmn: "zh-CN", } as const -type RouteData = Awaited>["data"] - export const Component = () => { const { t } = useTranslation() const lang = useUISettingKey("discoverLanguage") @@ -44,26 +42,23 @@ export const Component = () => { }), { staleTime: 1000 * 60 * 60 * 24, // 1 day - placeholderData: keepPreviousData, + placeholderData: keepPreviousData as any as Record, meta: { persist: true, }, }, ) - - const data: RouteData = rsshubPopular.data as any + const { data } = rsshubPopular const rsshubAnalytics = useAuthQuery(Queries.discover.rsshubAnalytics({ lang }), { staleTime: 1000 * 60 * 60 * 24, // 1 day - placeholderData: keepPreviousData, + placeholderData: keepPreviousData as any as RSSHubAnalyticsResponse, meta: { persist: true, }, }) - const rsshubAnalyticsData: Awaited< - ReturnType<(typeof apiClient)["discover"]["rsshub-analytics"]["$get"]> - >["data"] = rsshubAnalytics.data as any + const { data: rsshubAnalyticsData } = rsshubAnalytics const isLoading = rsshubPopular.isLoading || rsshubAnalytics.isLoading @@ -186,11 +181,9 @@ const RecommendationListItem = memo( routePrefix, rsshubAnalyticsData, }: { - data: RouteData[string] + data: RSSHubNamespace routePrefix: string - rsshubAnalyticsData: Awaited< - ReturnType<(typeof apiClient)["discover"]["rsshub-analytics"]["$get"]> - >["data"] + rsshubAnalyticsData: RSSHubAnalyticsResponse | undefined }) => { const { t } = useTranslation() const { present } = useModalStack() @@ -377,7 +370,7 @@ const RouteItem = memo( {analytics.topFeeds.slice(0, 2).map((feed: any) => (
diff --git a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx index c8446cb95..41f58805f 100644 --- a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx +++ b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx @@ -1,9 +1,9 @@ import { Logo } from "@follow/components/icons/logo.jsx" import { Button } from "@follow/components/ui/button/index.js" import { RSSHubLogo } from "@follow/components/ui/platform-icon/icons.js" -import type { RSSHubModel } from "@follow/models" import { whoami } from "@follow/store/user/getters" import { cn, formatNumber } from "@follow/utils/utils" +import type { RSSHubListItem } from "@follow-app/client-sdk" import { memo, useCallback, useEffect } from "react" import { useTranslation } from "react-i18next" @@ -80,7 +80,7 @@ export function Component() { ) } -type InstanceItem = RSSHubModel | { id: string; isOfficial: true } +type InstanceItem = RSSHubListItem | { id: string; isOfficial: true } const InstanceCard = memo(({ item }: { item: InstanceItem }) => { const { t } = useTranslation("settings") @@ -91,7 +91,7 @@ const InstanceCard = memo(({ item }: { item: InstanceItem }) => { const { present } = useModalStack() const isOfficial = "isOfficial" in item && item.isOfficial - const instance = isOfficial ? ({} as Partial) : (item as RSSHubModel) + const instance = isOfficial ? ({} as Partial) : (item as RSSHubListItem) const isInUse = isOfficial ? !status?.data?.usage?.rsshubId @@ -198,7 +198,7 @@ const InstanceCard = memo(({ item }: { item: InstanceItem }) => { present({ title: t("rsshub.table.edit"), content: ({ dismiss }) => ( - + ), }) } @@ -237,7 +237,7 @@ const InstanceCard = memo(({ item }: { item: InstanceItem }) => { )}
) : ( - + )}
@@ -245,7 +245,7 @@ const InstanceCard = memo(({ item }: { item: InstanceItem }) => { ) }) -function List({ data }: { data?: RSSHubModel[] }) { +function List({ data }: { data?: RSSHubListItem[] }) { const status = useAuthQuery(Queries.rsshub.status()) const sortedData: InstanceItem[] = [ @@ -298,7 +298,7 @@ function List({ data }: { data?: RSSHubModel[] }) { ) } -function SelectInstanceButton({ instance }: { instance: RSSHubModel }) { +function SelectInstanceButton({ instance }: { instance: RSSHubListItem }) { const { t } = useTranslation("settings") const { present } = useModalStack() const status = useAuthQuery(Queries.rsshub.status()) diff --git a/apps/desktop/layer/renderer/src/providers/user-provider.tsx b/apps/desktop/layer/renderer/src/providers/user-provider.tsx index 593348451..d2cba04f9 100644 --- a/apps/desktop/layer/renderer/src/providers/user-provider.tsx +++ b/apps/desktop/layer/renderer/src/providers/user-provider.tsx @@ -14,7 +14,7 @@ export const UserProvider = () => { useEffect(() => { if (!session?.user) return - // @ts-expect-error FIXME + setIntegrationIdentify(session.user) }, [session?.user]) diff --git a/apps/desktop/layer/renderer/src/push-notification.ts b/apps/desktop/layer/renderer/src/push-notification.ts index 78ad65049..03fdd52c2 100644 --- a/apps/desktop/layer/renderer/src/push-notification.ts +++ b/apps/desktop/layer/renderer/src/push-notification.ts @@ -3,7 +3,7 @@ import { initializeApp } from "firebase/app" import { getMessaging, getToken } from "firebase/messaging" import { setAppMessagingToken } from "./atoms/app" -import { apiClient } from "./lib/api-fetch" +import { followClient } from "./lib/api-client" import { router } from "./router" const firebaseConfig = env.VITE_FIREBASE_CONFIG ? JSON.parse(env.VITE_FIREBASE_CONFIG) : null @@ -13,7 +13,7 @@ export async function registerWebPushNotifications() { return } try { - const actions = await apiClient.actions.$get() + const actions = await followClient.api.actions.get() const rules = actions.data?.rules const hasPushNotificationRule = rules?.some( (rule) => rule.result.newEntryNotification && !rule.result.disabled, @@ -44,11 +44,9 @@ export async function registerWebPushNotifications() { serviceWorkerRegistration: registration, }) - await apiClient.messaging.$post({ - json: { - token, - channel: "web", - }, + await followClient.api.messaging.createToken({ + token, + channel: "web", }) registerPushNotificationPostMessage() diff --git a/apps/desktop/layer/renderer/src/queries/auth.ts b/apps/desktop/layer/renderer/src/queries/auth.ts index 5a04ac939..7b440cfc3 100644 --- a/apps/desktop/layer/renderer/src/queries/auth.ts +++ b/apps/desktop/layer/renderer/src/queries/auth.ts @@ -1,4 +1,3 @@ -import type { AuthSession } from "@follow/shared/hono" import { whoamiQueryKey } from "@follow/store/user/hooks" import { userSyncService } from "@follow/store/user/store" import { tracker } from "@follow/tracker" @@ -58,18 +57,35 @@ export const useSession = (options?: { enabled?: boolean }) => { const { error } = rest const fetchError = error as FetchError + const getAuthStatus = (): + | "loading" + | "authenticated" + | "error" + | "unauthenticated" + | "unknown" => { + if (isLoading) { + return "loading" + } + + if (fetchError) { + return "error" + } + + if (data) { + return "authenticated" + } + + if (data === null) { + return "unauthenticated" + } + + return "unknown" + } + return { - session: data as AuthSession, + session: data, ...rest, - status: isLoading - ? "loading" - : data - ? "authenticated" - : fetchError - ? "error" - : data === null - ? "unauthenticated" - : "unknown", + status: getAuthStatus(), } as const } diff --git a/apps/desktop/layer/renderer/src/queries/discover.ts b/apps/desktop/layer/renderer/src/queries/discover.ts index 13ea96c92..0687357b4 100644 --- a/apps/desktop/layer/renderer/src/queries/discover.ts +++ b/apps/desktop/layer/renderer/src/queries/discover.ts @@ -1,4 +1,4 @@ -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" export const discover = { @@ -11,40 +11,38 @@ export const discover = { categories?: string lang?: string }) => - defineQuery(["discover", "rsshub", "category", category, categories, lang], async () => { - const res = await apiClient.discover.rsshub.$get({ - query: { + defineQuery( + ["discover", "rsshub", "category", category, categories, lang], + async () => { + const res = await followClient.api.discover.rsshub({ category, categories, ...(lang !== "all" && { lang }), - }, - }) - return res.data - }), + }) + return res.data + }, + { + rootKey: ["discover", "rsshub", "category"], + }, + ), rsshubNamespace: ({ namespace }: { namespace: string }) => defineQuery(["discover", "rsshub", "namespace", namespace], async () => { - const res = await apiClient.discover.rsshub.$get({ - query: { - namespace, - }, + const res = await followClient.api.discover.rsshub({ + namespace, }) return res.data }), rsshubRoute: ({ route }: { route: string }) => defineQuery(["discover", "rsshub", "route", route], async () => { - const res = await apiClient.discover.rsshub.route.$get({ - query: { - route, - }, + const res = await followClient.api.discover.rsshubRoute({ + route, }) return res.data }), rsshubAnalytics: ({ lang }: { lang?: string }) => defineQuery(["discover", "rsshub", "analytics", lang], async () => { - const res = await apiClient.discover["rsshub-analytics"].$get({ - query: { - ...(lang !== "all" && { lang }), - }, + const res = await followClient.api.discover.rsshubAnalytics({ + ...(lang !== "all" && { lang }), }) return res.data }), diff --git a/apps/desktop/layer/renderer/src/queries/entries.ts b/apps/desktop/layer/renderer/src/queries/entries.ts index 50b17f172..3506ae6cf 100644 --- a/apps/desktop/layer/renderer/src/queries/entries.ts +++ b/apps/desktop/layer/renderer/src/queries/entries.ts @@ -1,5 +1,4 @@ -import { useAuthQuery } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { getEntriesParams } from "~/lib/utils" @@ -8,10 +7,8 @@ export const entries = { defineQuery( ["entries-preview", id], async () => { - const res = await apiClient.entries.preview.$get({ - query: { - id, - }, + const res = await followClient.api.entries.preview({ + id, }) return res.data @@ -54,15 +51,13 @@ export const entries = { query.feedId = query.feedIdList[0] delete query.feedIdList } - return apiClient.entries["check-new"].$get({ - query: { - insertedAfter: query.insertedAfter, - view: query.view, - feedId: query.feedId, - read: typeof query.read === "boolean" ? JSON.stringify(query.read) : undefined, - feedIdList: query.feedIdList, - }, - }) as Promise<{ data: { has_new: boolean; lastest_at?: string } }> + return followClient.api.entries.checkNew({ + insertedAfter: query.insertedAfter, + view: query.view, + feedId: query.feedId, + read: typeof query.read === "boolean" ? query.read : undefined, + feedIdList: query.feedIdList, + }) }, { @@ -70,8 +65,3 @@ export const entries = { }, ), } - -export const useEntriesPreview = ({ id }: { id?: string }) => - useAuthQuery(entries.preview(id!), { - enabled: !!id, - }) diff --git a/apps/desktop/layer/renderer/src/queries/feed.ts b/apps/desktop/layer/renderer/src/queries/feed.ts index f32ecbed5..522459487 100644 --- a/apps/desktop/layer/renderer/src/queries/feed.ts +++ b/apps/desktop/layer/renderer/src/queries/feed.ts @@ -8,7 +8,7 @@ import { toast } from "sonner" import { ROUTE_FEED_IN_FOLDER, ROUTE_FEED_PENDING } from "~/constants" import { useAuthQuery } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { toastFetchError } from "~/lib/error-parser" @@ -29,7 +29,7 @@ export const feed = { ), claimMessage: ({ feedId }: { feedId: string }) => defineQuery(["feed", "claimMessage", feedId], async () => - apiClient.feeds.claim.message.$get({ query: { feedId } }).then((res) => { + followClient.api.feeds.claim.message({ feedId }).then((res) => { res.data.json = JSON.stringify(JSON.parse(res.data.json), null, 2) const $document = new DOMParser().parseFromString(res.data.xml, "text/xml") res.data.xml = formatXml(new XMLSerializer().serializeToString($document)) @@ -38,7 +38,7 @@ export const feed = { ), claimedList: () => defineQuery(["feed", "claimedList"], async () => { - const res = await apiClient.feeds.claim.list.$get() + const res = await followClient.api.feeds.claim.list() return res.data }), } @@ -73,7 +73,7 @@ export const useClaimFeedMutation = (feedId: string) => export const useRefreshFeedMutation = (feedId?: string) => useMutation({ mutationKey: ["refreshFeed", feedId], - mutationFn: () => apiClient.feeds.refresh.$get({ query: { id: feedId! } }), + mutationFn: () => followClient.api.feeds.refresh({ id: feedId! }), async onError(err) { toastFetchError(err) }, @@ -86,7 +86,7 @@ export const useResetFeed = () => { return useMutation({ mutationFn: async (feedId: string) => { toastIDRef.current = toast.loading(t("sidebar.feed_actions.resetting_feed")) - await apiClient.feeds.reset.$get({ query: { id: feedId } }) + await followClient.api.feeds.reset({ id: feedId }) }, onSuccess: () => { toast.success( diff --git a/apps/desktop/layer/renderer/src/queries/invitations.ts b/apps/desktop/layer/renderer/src/queries/invitations.ts index 9fc2f6d24..ecb63490d 100644 --- a/apps/desktop/layer/renderer/src/queries/invitations.ts +++ b/apps/desktop/layer/renderer/src/queries/invitations.ts @@ -1,13 +1,13 @@ import { useMutation } from "@tanstack/react-query" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import type { MutationBaseProps } from "./types" export const useInvitationMutation = ({ onError }: MutationBaseProps = {}) => useMutation({ - mutationFn: (code: string) => apiClient.invitations.use.$post({ json: { code } }), + mutationFn: (code: string) => followClient.api.invitations.use({ code }), onError: (error) => { onError?.(error) @@ -17,13 +17,13 @@ export const useInvitationMutation = ({ onError }: MutationBaseProps = {}) => export const invitations = { list: () => defineQuery(["invitations"], async () => { - const res = await apiClient.invitations.$get() + const res = await followClient.api.invitations.list() return res.data }), limitation: () => defineQuery(["invitations", "limitation"], async () => { - const res = await apiClient.invitations.limitation.$get() + const res = await followClient.api.invitations.getLimitation() return res.data }), } diff --git a/apps/desktop/layer/renderer/src/queries/messaging.ts b/apps/desktop/layer/renderer/src/queries/messaging.ts index 33bae89e3..5207fff40 100644 --- a/apps/desktop/layer/renderer/src/queries/messaging.ts +++ b/apps/desktop/layer/renderer/src/queries/messaging.ts @@ -1,12 +1,12 @@ import { useMutation } from "@tanstack/react-query" import { useAuthQuery } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" export const messaging = { list: () => - defineQuery(["messaging"], () => apiClient.messaging.$get(), { + defineQuery(["messaging"], () => followClient.api.messaging.getTokens(), { rootKey: ["messaging"], }), } @@ -16,9 +16,5 @@ export const useMessaging = () => useAuthQuery(messaging.list()) export const useTestMessaging = () => useMutation({ mutationFn: ({ channel }: { channel: string }) => - apiClient.messaging.test.$get({ - query: { - channel, - }, - }), + followClient.api.messaging.testNotification({ channel }), }) diff --git a/apps/desktop/layer/renderer/src/queries/referral.ts b/apps/desktop/layer/renderer/src/queries/referral.ts index 43f4d0d5b..1825322e0 100644 --- a/apps/desktop/layer/renderer/src/queries/referral.ts +++ b/apps/desktop/layer/renderer/src/queries/referral.ts @@ -1,5 +1,5 @@ import { useAuthQuery } from "~/hooks/common/useBizQuery" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" export const referral = { @@ -7,7 +7,7 @@ export const referral = { defineQuery( ["referral"], async () => { - const res = await apiClient.referrals.$get() + const res = await followClient.api.referrals.getReferrals() return res.data }, { diff --git a/apps/desktop/layer/renderer/src/queries/rsshub.ts b/apps/desktop/layer/renderer/src/queries/rsshub.ts index 407f4967d..1e8d68d2f 100644 --- a/apps/desktop/layer/renderer/src/queries/rsshub.ts +++ b/apps/desktop/layer/renderer/src/queries/rsshub.ts @@ -1,7 +1,8 @@ import { userActions } from "@follow/store/user/store" +import type { RSSHubUseRequest } from "@follow-app/client-sdk" import { useMutation } from "@tanstack/react-query" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { toastFetchError } from "~/lib/error-parser" @@ -9,8 +10,7 @@ import type { MutationBaseProps } from "./types" export const useSetRSSHubMutation = ({ onError }: MutationBaseProps = {}) => useMutation({ - mutationFn: (data: { id: string | null; durationInMonths?: number; TOTPCode?: string }) => - apiClient.rsshub.use.$post({ json: data }), + mutationFn: (data: RSSHubUseRequest) => followClient.api.rsshub.use({ ...data }), onSuccess: (_, variables) => { rsshub.list().invalidate() @@ -38,12 +38,10 @@ export const useAddRSSHubMutation = ({ onError }: MutationBaseProps = {}) => accessKey?: string id?: string }) => - apiClient.rsshub.$post({ - json: { - baseUrl, - accessKey, - id, - }, + followClient.api.rsshub.create({ + baseUrl, + accessKey, + id, }), onSuccess: (_) => { @@ -59,7 +57,7 @@ export const useAddRSSHubMutation = ({ onError }: MutationBaseProps = {}) => export const useDeleteRSSHubMutation = ({ onError }: MutationBaseProps = {}) => useMutation({ - mutationFn: (id: string) => apiClient.rsshub.$delete({ json: { id } }), + mutationFn: (id: string) => followClient.api.rsshub.delete({ id }), onError: (error) => { onError?.(error) @@ -70,13 +68,13 @@ export const useDeleteRSSHubMutation = ({ onError }: MutationBaseProps = {}) => export const rsshub = { get: ({ id }: { id: string }) => defineQuery(["rsshub", "get", id], async () => { - const res = await apiClient.rsshub.$get({ query: { id } }) + const res = await followClient.api.rsshub.get({ id }) return res.data }), list: () => defineQuery(["rsshub", "list"], async () => { - const res = await apiClient.rsshub.list.$get() + const res = await followClient.api.rsshub.list() userActions.upsertMany(res.data.map((item) => item.owner).filter((item) => item !== null)) return res.data @@ -84,7 +82,7 @@ export const rsshub = { status: () => defineQuery(["rsshub", "status"], async () => { - const res = await apiClient.rsshub.status.$get() + const res = await followClient.api.rsshub.status() return res.data }), } diff --git a/apps/desktop/layer/renderer/src/queries/settings.ts b/apps/desktop/layer/renderer/src/queries/settings.ts index e6a98c679..67f93214a 100644 --- a/apps/desktop/layer/renderer/src/queries/settings.ts +++ b/apps/desktop/layer/renderer/src/queries/settings.ts @@ -1,6 +1,6 @@ -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" export const settings = { - get: () => defineQuery(["settings"], async () => await apiClient.settings.$get({ query: {} })), + get: () => defineQuery(["settings"], async () => await followClient.api.settings.get()), } diff --git a/apps/desktop/layer/renderer/src/queries/wallet.tsx b/apps/desktop/layer/renderer/src/queries/wallet.tsx index d33596f19..23f98f229 100644 --- a/apps/desktop/layer/renderer/src/queries/wallet.tsx +++ b/apps/desktop/layer/renderer/src/queries/wallet.tsx @@ -1,21 +1,20 @@ import { tracker } from "@follow/tracker" +import type { TipRequest, TransactionQuery } from "@follow-app/client-sdk" import { useMutation } from "@tanstack/react-query" import { useNavigate } from "react-router" import { toast } from "sonner" import { useAuthQuery } from "~/hooks/common" -import { apiClient } from "~/lib/api-fetch" +import { followClient } from "~/lib/api-client" import { defineQuery } from "~/lib/defineQuery" import { getFetchErrorMessage, toastFetchError } from "~/lib/error-parser" export const wallet = { - get: ({ userId }: { userId?: string } = {}) => + get: () => defineQuery( - ["wallet", userId].filter(Boolean), + ["wallet"], async () => { - const res = await apiClient.wallets.$get({ - query: { userId }, - }) + const res = await followClient.api.wallets.get() return res.data }, @@ -26,15 +25,15 @@ export const wallet = { claimCheck: () => defineQuery(["wallet", "claimCheck"], async () => - apiClient.wallets.transactions["claim-check"].$get(), + followClient.api.wallets.transactions.claimCheck(), ), transactions: { - get: (query: Parameters[0]["query"] = {}) => + get: (query: TransactionQuery) => defineQuery( - ["wallet", "transactions", query].filter(Boolean), + ["wallet", "transactions", query], async () => { - const res = await apiClient.wallets.transactions.$get({ query }) + const res = await followClient.api.wallets.transactions.get(query) return res.data }, @@ -49,7 +48,7 @@ export const wallet = { defineQuery( ["wallet", "ranking"], async () => { - const res = await apiClient.wallets.ranking.$get() + const res = await followClient.api.wallets.ranking() return res.data }, { @@ -72,7 +71,7 @@ export const useWalletRanking = () => useAuthQuery(wallet.ranking.get()) export const useCreateWalletMutation = () => useMutation({ mutationKey: ["createWallet"], - mutationFn: () => apiClient.wallets.$post(), + mutationFn: () => followClient.api.wallets.post(), async onError(err) { toast.error(await getFetchErrorMessage(err)) }, @@ -93,17 +92,14 @@ export const useClaimWalletDailyRewardMutation = () => { return useMutation({ mutationKey: ["claimWalletDailyReward"], mutationFn: ({ tokenV2, tokenV3 }: { tokenV2?: string | null; tokenV3?: string | null }) => - apiClient.wallets.transactions.claim_daily.$post( - { json: {} }, - { - headers: - tokenV2 || tokenV3 - ? { - "x-token": tokenV2 ? `r2:${tokenV2}` : `r3:${tokenV3}`, - } - : undefined, - }, - ), + followClient.api.wallets.transactions.claimDaily(undefined, { + headers: + tokenV2 || tokenV3 + ? { + "x-token": tokenV2 ? `r2:${tokenV2}` : `r3:${tokenV3}`, + } + : undefined, + }), async onError(err) { toastFetchError(err) }, @@ -131,18 +127,17 @@ export const useClaimWalletDailyRewardMutation = () => { export const useWalletTipMutation = () => useMutation({ mutationKey: ["walletTip"], - mutationFn: (data: Parameters[0]["json"]) => - apiClient.wallets.transactions.tip.$post({ json: data }), + mutationFn: (data: TipRequest) => followClient.api.wallets.transactions.tip(data), async onError(err) { toastFetchError(err) }, onSuccess(response, variables) { wallet.get().invalidate() - wallet.transactions.get().invalidate() + wallet.transactions.get({}).invalidate() tracker.tipSent({ amount: variables.amount, - entryId: variables.entryId, - transactionId: response.data.transactionHash, + entryId: variables.entryId!, + transactionId: response.data.txHash, }) toast("🎉 Tipped.") }, diff --git a/apps/desktop/layer/renderer/src/store/feed/hooks.ts b/apps/desktop/layer/renderer/src/store/feed/hooks.ts index 2c8d1ff61..045fe002f 100644 --- a/apps/desktop/layer/renderer/src/store/feed/hooks.ts +++ b/apps/desktop/layer/renderer/src/store/feed/hooks.ts @@ -1,5 +1,4 @@ import { views } from "@follow/constants" -import type { FeedOrListRespModel } from "@follow/models/types" import type { EntryModel } from "@follow/store/entry/types" import { useFeedById, usePrefetchFeed } from "@follow/store/feed/hooks" import { useListById, usePrefetchListById } from "@follow/store/list/hooks" @@ -14,21 +13,27 @@ import { } from "~/constants" import { useRouteParams } from "~/hooks/biz/useRouteParams" +export type PreferredTitleTarget = { + type: string + id: string + title?: Nullable + [key: string]: any +} export const getPreferredTitle = ( - feed?: Pick | null, + target?: PreferredTitleTarget, entry?: Pick | null, ) => { - if (!feed?.id) { - return feed?.title + if (!target?.id) { + return target?.title } - if (feed.type === "inbox") { + if (target.type === "inbox") { if (entry?.authorUrl) return entry.authorUrl.replace(/^mailto:/, "") - return feed.title || `${feed.id.slice(0, 1).toUpperCase()}${feed.id.slice(1)}'s Inbox` + return target.title || `${target.id.slice(0, 1).toUpperCase()}${target.id.slice(1)}'s Inbox` } - const subscription = getSubscriptionByFeedId(feed.id) - return subscription?.title || feed.title + const subscription = getSubscriptionByFeedId(target.id) + return subscription?.title || target.title } export const useFeedHeaderTitle = () => { diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 1ff668cc7..81c807a8f 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -70,7 +70,6 @@ "es-toolkit": "1.39.10", "fake-indexeddb": "6.2.2", "happy-dom": "18.0.1", - "hono": "4.9.7", "html-minifier-terser": "7.2.0", "js-yaml": "4.1.0", "nbump": "2.1.5", diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.ts index 0887af7ba..e85c7924e 100644 --- a/apps/desktop/vite.config.ts +++ b/apps/desktop/vite.config.ts @@ -1,4 +1,4 @@ -import { existsSync, readFileSync, writeFileSync } from "node:fs" +import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs" import { fileURLToPath } from "node:url" import type { env as EnvType } from "@follow/shared/env.desktop" @@ -6,7 +6,7 @@ import legacy from "@vitejs/plugin-legacy" import { minify as htmlMinify } from "html-minifier-terser" import { cyan, dim, green } from "kolorist" import { parseHTML } from "linkedom" -import { resolve } from "pathe" +import { join, resolve } from "pathe" import type { PluginOption, ResolvedConfig, ViteDevServer } from "vite" import { defineConfig, loadEnv } from "vite" import { analyzer } from "vite-bundle-analyzer" @@ -321,14 +321,14 @@ const htmlPlugin: (env: any) => PluginOption = (env) => { closeBundle() { const { root } = config const dist = config.build.outDir - const debugProxyHtml = resolve(root, "debug_proxy.html") + const debugProxyHtml = join(root, "debug_proxy.html") if (existsSync(debugProxyHtml)) { const content = readFileSync(debugProxyHtml, "utf-8") + mkdirSync(dist, { recursive: true }) writeFileSync( - resolve(dist, "__debug_proxy.html"), - + join(dist, "__debug_proxy.html"), content.replace("import.meta.env.VITE_API_URL", `"${env.VITE_API_URL}"`), ) } diff --git a/apps/mobile/package.json b/apps/mobile/package.json index f9f81275d..4ddd3339d 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -18,7 +18,7 @@ "web": "expo start --web" }, "dependencies": { - "@better-auth/expo": "1.2.9", + "@better-auth/expo": "1.3.11", "@expo/metro-runtime": "5.0.4", "@expo/react-native-action-sheet": "4.1.1", "@follow/components": "workspace:*", @@ -48,7 +48,7 @@ "@tanstack/react-query": "5.89.0", "@tanstack/react-query-persist-client": "5.89.0", "@types/qrcode": "1.5.5", - "better-auth": "1.2.9", + "better-auth": "1.3.11", "camelcase-keys": "10.0.0", "dayjs": "1.11.18", "dnum": "2.15.0", @@ -87,7 +87,6 @@ "expo-video": "2.2.2", "expo-web-browser": "14.2.0", "franc-min": "6.2.0", - "hono": "4.9.7", "i18next": "25.5.2", "jotai": "2.14.0", "lru-cache": "11.1.0", diff --git a/apps/mobile/src/api/trending.ts b/apps/mobile/src/api/trending.ts deleted file mode 100644 index 89f76687b..000000000 --- a/apps/mobile/src/api/trending.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Models } from "@follow/models" -import camelcaseKeys from "camelcase-keys" - -import { apiFetch } from "../lib/api-fetch" - -const v1ApiPrefix = "/v1" -export const getTrendingAggregates = async (params: { language: string }) => { - const data = await apiFetch( - `${v1ApiPrefix}/trendings?language=${params.language}`, - { - params: { - language: params.language, - }, - }, - ) - return camelcaseKeys(data as any, { deep: true }) as Models.TrendingAggregates -} diff --git a/apps/mobile/src/atoms/server-configs.ts b/apps/mobile/src/atoms/server-configs.ts index be21a1a8c..622704453 100644 --- a/apps/mobile/src/atoms/server-configs.ts +++ b/apps/mobile/src/atoms/server-configs.ts @@ -1,7 +1,7 @@ -import type { ServerConfigs } from "@follow/models/types" import { createAtomHooks } from "@follow/utils/jotai" +import type { StatusConfigs } from "@follow-app/client-sdk" import { atom } from "jotai" export const [, , useServerConfigs, , getServerConfigs, setServerConfigs] = createAtomHooks( - atom>(null), + atom>(null), ) diff --git a/apps/mobile/src/atoms/settings/general.ts b/apps/mobile/src/atoms/settings/general.ts index 521d30adb..9384467c4 100644 --- a/apps/mobile/src/atoms/settings/general.ts +++ b/apps/mobile/src/atoms/settings/general.ts @@ -1,10 +1,10 @@ import { defaultGeneralSettings } from "@follow/shared/settings/defaults" import type { GeneralSettings } from "@follow/shared/settings/interface" import type { FetchEntriesPropsSettings } from "@follow/store/entry/types" +import type { SupportedLanguages } from "@follow-app/client-sdk" import { useMemo } from "react" import { getDeviceLanguage } from "@/src/lib/i18n" -import type { SupportedLanguages } from "@/src/lib/language" import { createSettingAtom } from "./internal/helper" diff --git a/apps/mobile/src/hooks/useMessaging.ts b/apps/mobile/src/hooks/useMessaging.ts index aa71223db..3b7ca6776 100644 --- a/apps/mobile/src/hooks/useMessaging.ts +++ b/apps/mobile/src/hooks/useMessaging.ts @@ -8,7 +8,7 @@ import { useMutation } from "@tanstack/react-query" import { useEffect } from "react" import { Platform } from "react-native" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import { kv } from "@/src/lib/kv" import { useNavigation } from "@/src/lib/navigation/hooks" import { requestNotificationPermission } from "@/src/lib/permission" @@ -19,12 +19,7 @@ const FIREBASE_MESSAGING_TOKEN_STORAGE_KEY = "firebase_messaging_token" async function saveMessagingToken() { const app = getApp() const token = await getMessaging(app).getToken() - await apiClient.messaging.$post({ - json: { - token, - channel: Platform.OS, - }, - }) + await followClient.api.messaging.createToken({ token, channel: Platform.OS }) kv.set(FIREBASE_MESSAGING_TOKEN_STORAGE_KEY, token) } diff --git a/apps/mobile/src/initialize/analytics.ts b/apps/mobile/src/initialize/analytics.ts index d8f318d4b..e8d033796 100644 --- a/apps/mobile/src/initialize/analytics.ts +++ b/apps/mobile/src/initialize/analytics.ts @@ -1,5 +1,6 @@ import { whoami } from "@follow/store/user/getters" import { setFirebaseTracker, setPostHogTracker, tracker } from "@follow/tracker" +import type { AuthUser } from "@follow-app/client-sdk" import { getAnalytics } from "@react-native-firebase/analytics" import { nativeApplicationVersion, nativeBuildVersion } from "expo-application" import PostHog from "posthog-react-native" @@ -11,7 +12,7 @@ export const initAnalytics = async () => { const user = whoami() if (user) { - tracker.identify(user) + tracker.identify(user as AuthUser) } tracker.manager.appendUserProperties({ diff --git a/apps/mobile/src/lib/api-client.ts b/apps/mobile/src/lib/api-client.ts index c519d55be..5b2dfc87c 100644 --- a/apps/mobile/src/lib/api-client.ts +++ b/apps/mobile/src/lib/api-client.ts @@ -1,11 +1,13 @@ import { userActions } from "@follow/store/user/store" import { createMobileAPIHeaders } from "@follow/utils/headers" import { FollowClient } from "@follow-app/client-sdk" +import { fetch } from "expo/fetch" import { nativeApplicationVersion } from "expo-application" import { Platform } from "react-native" import DeviceInfo from "react-native-device-info" import { PlanScreen } from "../modules/settings/routes/Plan" +import { LoginScreen } from "../screens/(modal)/LoginScreen" import { getCookie } from "./auth" import { getClientId, getSessionId } from "./client-session" import { getUserAgent } from "./native/user-agent" @@ -16,14 +18,23 @@ export const followClient = new FollowClient({ credentials: "omit", timeout: 10000, baseURL: proxyEnv.API_URL, - fetch: async (input, options = {}) => - fetch(input.toString(), { - ...options, - cache: "no-store", - }), + fetch: async (input, options = {}) => fetch(input.toString(), options as any) as any, }) export const followApi = followClient.api +followClient.addRequestInterceptor(async (ctx) => { + const { url } = ctx + + try { + const urlObj = new URL(url) + urlObj.searchParams.set("t", Date.now().toString()) + ctx.url = urlObj.toString() + } catch { + /* empty */ + } + + return ctx +}) followClient.addRequestInterceptor(async (ctx) => { const { options } = ctx const header = options.headers || {} @@ -48,25 +59,23 @@ followClient.addRequestInterceptor(async (ctx) => { return ctx }) -followClient.addErrorInterceptor(async ({ error, response }) => { - if (!response) { - return error - } - +followClient.addResponseInterceptor(async (ctx) => { + const { response } = ctx if (response.status === 401) { userActions.removeCurrentUser() - } else { + Navigation.rootNavigation.presentControllerView(LoginScreen) + } else if (response.status >= 400) { try { - const json = await response.json() - console.error(`Request failed with status ${response.status}`, json) + const isJSON = response.headers.get("content-type")?.includes("application/json") + const json = isJSON ? await response.json() : null - if (json.code.toString().startsWith("11")) { + if (isJSON && json?.code?.toString().startsWith("11")) { Navigation.rootNavigation.presentControllerView(PlanScreen) } - } catch { + } catch (error) { console.error(`Request failed with status ${response.status}`, error) } } - return error + return ctx.response }) diff --git a/apps/mobile/src/lib/api-fetch.ts b/apps/mobile/src/lib/api-fetch.ts deleted file mode 100644 index 5dd8af8a8..000000000 --- a/apps/mobile/src/lib/api-fetch.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* eslint-disable no-console */ -import type { AppType } from "@follow/shared" -import { userActions } from "@follow/store/user/store" -import { createMobileAPIHeaders } from "@follow/utils/headers" -import { nativeApplicationVersion } from "expo-application" -import { hc } from "hono/client" -import { FetchError, ofetch } from "ofetch" -import { Platform } from "react-native" -import DeviceInfo from "react-native-device-info" - -import { PlanScreen } from "../modules/settings/routes/Plan" -import { getCookie } from "./auth" -import { getClientId, getSessionId } from "./client-session" -import { getUserAgent } from "./native/user-agent" -import { Navigation } from "./navigation/Navigation" -import { proxyEnv } from "./proxy-env" - -export const apiFetch = ofetch.create({ - retry: false, - credentials: "omit", - baseURL: proxyEnv.API_URL, - cache: "no-store", - onRequest: async (ctx) => { - const { options, request } = ctx - if (__DEV__) { - // Logger - console.log(`---> ${options.method} ${request as string}`) - } - - // add cookie - options.headers = options.headers || new Headers() - options.headers.set("cookie", getCookie()) - - const headers = createMobileAPIHeaders({ - version: nativeApplicationVersion || "", - rnPlatform: { - OS: Platform.OS, - isPad: Platform.OS === "ios" && Platform.isPad, - }, - installerPackageName: await DeviceInfo.getInstallerPackageName(), - }) - - Object.entries(headers).forEach(([key, value]) => { - options.headers.set(key, value) - }) - }, - onRequestError: ({ error, request, options }) => { - if (__DEV__) { - console.log(`[Error] ---> ${options.method} ${request as string}`) - } - console.error(error) - }, - - onResponse: ({ response, request, options }) => { - if (__DEV__) { - console.log(`<--- ${response.status} ${options.method} ${request as string}`) - } - }, - onResponseError: ({ error, request, options, response }) => { - if (__DEV__) { - console.log(`<--- [Error] ${response.status} ${options.method} ${request as string}`) - } - if (response.status === 401) { - userActions.removeCurrentUser() - } else { - try { - const json = JSON.parse(response._data) - console.error(`Request ${request as string} failed with status ${response.status}`, json) - - if (json.code.toString().startsWith("11")) { - Navigation.rootNavigation.presentControllerView(PlanScreen) - } - } catch { - console.error(`Request ${request as string} failed with status ${response.status}`, error) - } - } - }, -}) - -export const apiClient = hc(proxyEnv.API_URL, { - fetch: async (input: any, options = {}) => - apiFetch(input.toString(), options).catch((err) => { - throw err - }), - async headers() { - return { - cookie: getCookie(), - "User-Agent": await getUserAgent(), - "X-Client-Id": getClientId(), - "X-Session-Id": getSessionId(), - } - }, -}) - -export const getBizFetchErrorMessage = (error: Error) => { - if (error instanceof FetchError && error.response) { - try { - const data = JSON.parse(error.response._data) - - if (data.message && data.code) { - // TODO i18n handle by code - return data.message - } - } catch { - return error.message - } - } - return error.message -} diff --git a/apps/mobile/src/lib/ga4.ts b/apps/mobile/src/lib/ga4.ts index a3cacf003..cb58ea532 100644 --- a/apps/mobile/src/lib/ga4.ts +++ b/apps/mobile/src/lib/ga4.ts @@ -1,4 +1,4 @@ -import { apiClient } from "./api-fetch" +import { followClient } from "./api-client" import { getClientId, getSessionId } from "./client-session" class Analytics4 { @@ -49,9 +49,7 @@ class Analytics4 { user_properties: this.userProperties, } - return apiClient.data.g.$post({ - json: payload, - }) + return followClient.api.data.sendAnalytics(payload as any) } } diff --git a/apps/mobile/src/lib/language.ts b/apps/mobile/src/lib/language.ts deleted file mode 100644 index 48cf42f69..000000000 --- a/apps/mobile/src/lib/language.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { languageSchema } from "@follow/shared/hono" -import type { z } from "zod" - -export type SupportedLanguages = z.infer diff --git a/apps/mobile/src/lib/parse-api-error.ts b/apps/mobile/src/lib/parse-api-error.ts new file mode 100644 index 000000000..17dd52b64 --- /dev/null +++ b/apps/mobile/src/lib/parse-api-error.ts @@ -0,0 +1,18 @@ +// Deprecated: replaced by FollowClient in lib/api-client +import { FetchError } from "ofetch" + +export const getBizFetchErrorMessage = (error: Error) => { + if (error instanceof FetchError && error.response) { + try { + const data = JSON.parse(error.response._data) + + if (data.message && data.code) { + // TODO i18n handle by code + return data.message + } + } catch { + return error.message + } + } + return error.message +} diff --git a/apps/mobile/src/main.tsx b/apps/mobile/src/main.tsx index 8ef37d341..180202c72 100644 --- a/apps/mobile/src/main.tsx +++ b/apps/mobile/src/main.tsx @@ -1,12 +1,7 @@ import "./global.css" import "./polyfill" -import { - apiClientContext, - apiContext, - authClientContext, - queryClientContext, -} from "@follow/store/context" +import { apiContext, authClientContext, queryClientContext } from "@follow/store/context" import { registerRootComponent } from "expo" import { Image } from "expo-image" import { LinearGradient } from "expo-linear-gradient" @@ -20,7 +15,6 @@ import { BottomTabs } from "./components/layouts/tabbar/BottomTabs" import { Lightbox } from "./components/ui/lightbox/Lightbox" import { initializeApp } from "./initialize" import { followApi } from "./lib/api-client" -import { apiClient } from "./lib/api-fetch" import { authClient } from "./lib/auth" import { initializeI18n } from "./lib/i18n" import { TabBarPortal } from "./lib/navigation/bottom-tab/TabBarPortal" @@ -39,7 +33,7 @@ import { registerSitemap } from "./sitemap" global.APP_NAME = "Folo" // @ts-expect-error global.ELECTRON = false -apiClientContext.provide(apiClient) +// @ts-expect-error authClientContext.provide(authClient) queryClientContext.provide(queryClient) apiContext.provide(followApi) diff --git a/apps/mobile/src/modules/discover/FeedSummary.tsx b/apps/mobile/src/modules/discover/FeedSummary.tsx index 6c3aa8e98..cb5e6a0bd 100644 --- a/apps/mobile/src/modules/discover/FeedSummary.tsx +++ b/apps/mobile/src/modules/discover/FeedSummary.tsx @@ -1,25 +1,30 @@ import { FeedViewType } from "@follow/constants" -import { getBackgroundGradient } from "@follow/utils" -import { LinearGradient } from "expo-linear-gradient" import { View } from "react-native" -import { ScrollView } from "react-native-gesture-handler" -import { RelativeDateTime } from "@/src/components/ui/datetime/RelativeDateTime" import { FeedIcon } from "@/src/components/ui/icon/feed-icon" -import { Image } from "@/src/components/ui/image/Image" import { ItemPressableStyle } from "@/src/components/ui/pressable/enum" import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable" import { Text } from "@/src/components/ui/typography/Text" -import type { apiClient } from "@/src/lib/api-fetch" import { useNavigation } from "@/src/lib/navigation/hooks" import { FollowScreen } from "@/src/screens/(modal)/FollowScreen" import { FeedScreen } from "@/src/screens/(stack)/feeds/[feedId]/FeedScreen" import { selectFeed, selectTimeline } from "../screen/atoms" -type SearchResultItem = Awaited>["data"][number] +type FeedSummaryFeed = { + id: string + title?: Nullable + url?: Nullable + image?: Nullable + ownerUserId?: Nullable + siteUrl?: Nullable + description?: Nullable + + [key: string]: any +} + export const FeedSummary = ({ - item, + feed, children, preChildren, className, @@ -27,7 +32,7 @@ export const FeedSummary = ({ view, preview, }: { - item: SearchResultItem + feed: FeedSummaryFeed children?: React.ReactNode preChildren?: React.ReactNode className?: string @@ -40,7 +45,7 @@ export const FeedSummary = ({ { - if (item.feed?.id) { + if (feed?.id) { if (preview) { if (typeof view === "number") { selectTimeline({ @@ -51,20 +56,20 @@ export const FeedSummary = ({ selectFeed({ type: "feed", - feedId: item.feed.id, + feedId: feed.id, }) navigation.pushControllerView(FeedScreen, { - feedId: item.feed?.id, + feedId: feed.id, }) } else { navigation.presentControllerView(FollowScreen, { - id: item.feed.id, + id: feed.id, type: "feed", }) } - } else if (item.feed?.url) { + } else if (feed.url) { navigation.presentControllerView(FollowScreen, { - url: item.feed.url, + url: feed.url, type: "url", }) } @@ -78,14 +83,14 @@ export const FeedSummary = ({ - {item.feed?.title} + {feed.title} - {item.feed?.url} + {feed.url} - {!simple && !!item.feed?.description && ( + {!simple && !!feed.description && ( - {item.feed?.description} + {feed.description} )} - {!simple && !!item.entries && ( - - - {item.entries?.map((entry) => ( - - ))} - - - )} + {children} ) } -const PreviewItem = ({ entry }: { entry: NonNullable[number] }) => { - const firstMedia = entry.media?.[0] - const [, , , bgAccent, bgAccentLight] = getBackgroundGradient( - entry.title || entry.url || "Untitled", - ) - return ( - - {firstMedia ? ( - - ) : ( - - {entry.title?.[0]} - - )} - - - {entry.title} - - - - - ) -} diff --git a/apps/mobile/src/modules/discover/RecommendationListItem.tsx b/apps/mobile/src/modules/discover/RecommendationListItem.tsx index f43a21538..351e04fd0 100644 --- a/apps/mobile/src/modules/discover/RecommendationListItem.tsx +++ b/apps/mobile/src/modules/discover/RecommendationListItem.tsx @@ -22,7 +22,7 @@ export const RecommendationListItem: FC<{ for (const route in data.routes) { const routeData = data.routes[route]! if (routeData.categories) { - routeData.categories.forEach((c) => categories.add(c)) + routeData.categories.forEach((c: string) => categories.add(c)) } } categories.delete("popular") diff --git a/apps/mobile/src/modules/discover/Recommendations.tsx b/apps/mobile/src/modules/discover/Recommendations.tsx index cc8d76fd5..3592d1e8e 100644 --- a/apps/mobile/src/modules/discover/Recommendations.tsx +++ b/apps/mobile/src/modules/discover/Recommendations.tsx @@ -192,10 +192,7 @@ export const RecommendationTab: TabComponent<{ }) }, [data]) const alphabetGroups = useMemo(() => { - const result = [] as { - key: string - data: RSSHubRouteDeclaration - }[] + const result = [] as Array<{ key: string; data: RSSHubRouteDeclaration }> for (const item of keys) { if (!data) { continue @@ -212,18 +209,8 @@ export const RecommendationTab: TabComponent<{ }) } result.sort((a, b) => { - let aHeat = 0 - let bHeat = 0 - if (typeof a === "string") { - aHeat = 0 - } else { - aHeat = Object.values(a.data.routes).reduce((acc, route) => acc + (route.heat || 0), 0) - } - if (typeof b === "string") { - bHeat = 0 - } else { - bHeat = Object.values(b.data.routes).reduce((acc, route) => acc + (route.heat || 0), 0) - } + const aHeat = Object.values(a.data.routes).reduce((acc, route) => acc + (route.heat || 0), 0) + const bHeat = Object.values(b.data.routes).reduce((acc, route) => acc + (route.heat || 0), 0) return bHeat - aHeat }) return result diff --git a/apps/mobile/src/modules/discover/Trending.tsx b/apps/mobile/src/modules/discover/Trending.tsx index e631b0f1e..07a3b90fb 100644 --- a/apps/mobile/src/modules/discover/Trending.tsx +++ b/apps/mobile/src/modules/discover/Trending.tsx @@ -67,7 +67,7 @@ export const Trending = ({ preview view={item.view} key={item.feed?.id} - item={item} + feed={item.feed!} className={cn("flex flex-1 flex-row items-center bg-none py-3", itemClassName)} simple preChildren={ diff --git a/apps/mobile/src/modules/discover/api.ts b/apps/mobile/src/modules/discover/api.ts index b3b146979..6e6fb44bc 100644 --- a/apps/mobile/src/modules/discover/api.ts +++ b/apps/mobile/src/modules/discover/api.ts @@ -1,22 +1,18 @@ -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import type { DiscoverCategories, Language } from "./constants" export const fetchRsshubPopular = (category: DiscoverCategories, lang: Language) => { - return apiClient.discover.rsshub.$get({ - query: { - category: "popular", - categories: category === "all" ? "popular" : category, - lang: lang === "all" ? undefined : lang, - }, + return followClient.api.discover.rsshub({ + category: "popular", + categories: category === "all" ? "popular" : category, + lang: lang === "all" ? undefined : lang, }) } export const fetchRsshubAnalysis = (lang: Language) => { - return apiClient.discover["rsshub-analytics"].$get({ - query: { - ...(lang !== "all" && { lang }), - }, + return followClient.api.discover.rsshubAnalytics({ + ...(lang !== "all" && { lang }), }) } @@ -29,11 +25,9 @@ export const fetchFeedTrending = ({ view?: number limit: number }) => { - return apiClient.trending.feeds.$get({ - query: { - language: lang, - view, - limit, - }, + return followClient.api.trending.getFeeds({ + language: lang, + view, + limit, }) } diff --git a/apps/mobile/src/modules/discover/search-tabs/SearchFeed.tsx b/apps/mobile/src/modules/discover/search-tabs/SearchFeed.tsx index c0ab9cf62..1a244a5db 100644 --- a/apps/mobile/src/modules/discover/search-tabs/SearchFeed.tsx +++ b/apps/mobile/src/modules/discover/search-tabs/SearchFeed.tsx @@ -3,7 +3,7 @@ import { useAtomValue } from "jotai" import { useWindowDimensions, View } from "react-native" import { Text } from "@/src/components/ui/typography/Text" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import { useSearchPageContext } from "../ctx" import { ItemSeparator } from "./__base" @@ -17,12 +17,7 @@ export const SearchFeed = () => { const { data, isLoading } = useQuery({ queryKey: ["searchFeed", searchValue], queryFn: () => { - return apiClient.discover.$post({ - json: { - keyword: searchValue, - target: "feeds", - }, - }) + return followClient.api.discover.discover({ keyword: searchValue, target: "feeds" }) }, enabled: !!searchValue, }) diff --git a/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx b/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx index 869bece21..6f62a09a7 100644 --- a/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx +++ b/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx @@ -1,5 +1,6 @@ import { useSubscriptionByFeedId } from "@follow/store/subscription/hooks" import { formatNumber } from "@follow/utils" +import type { DiscoveryItem, TrendingFeedItem } from "@follow-app/client-sdk" import { View } from "react-native" import { RelativeDateTime } from "@/src/components/ui/datetime/RelativeDateTime" @@ -7,17 +8,15 @@ import { Text } from "@/src/components/ui/typography/Text" import { SafeAlertCuteReIcon } from "@/src/icons/safe_alert_cute_re" import { SafetyCertificateCuteReIcon } from "@/src/icons/safety_certificate_cute_re" import { User3CuteReIcon } from "@/src/icons/user_3_cute_re" -import type { apiClient } from "@/src/lib/api-fetch" import { useColor } from "@/src/theme/colors" import { FeedSummary } from "../FeedSummary" -type SearchResultItem = Awaited>["data"][number] -export const SearchFeedCard = ({ item }: { item: SearchResultItem }) => { +export const SearchFeedCard = ({ item }: { item: TrendingFeedItem | DiscoveryItem }) => { const isSubscribed = useSubscriptionByFeedId(item.feed?.id ?? "") const iconColor = useColor("secondaryLabel") return ( - + diff --git a/apps/mobile/src/modules/discover/search-tabs/SearchList.tsx b/apps/mobile/src/modules/discover/search-tabs/SearchList.tsx index cf7a5cfa9..cf9e55ea5 100644 --- a/apps/mobile/src/modules/discover/search-tabs/SearchList.tsx +++ b/apps/mobile/src/modules/discover/search-tabs/SearchList.tsx @@ -12,7 +12,7 @@ import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable" import { Text } from "@/src/components/ui/typography/Text" import { RightCuteReIcon } from "@/src/icons/right_cute_re" import { User3CuteReIcon } from "@/src/icons/user_3_cute_re" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import { useNavigation } from "@/src/lib/navigation/hooks" import { UrlBuilder } from "@/src/lib/url-builder" import { FollowScreen } from "@/src/screens/(modal)/FollowScreen" @@ -22,21 +22,16 @@ import { useSearchPageContext } from "../ctx" import { ItemSeparator } from "./__base" import { useDataSkeleton } from "./hooks" -type SearchResultItem = Awaited>["data"][number] +type SearchResultItem = Awaited< + ReturnType +>["data"][number] export const SearchList = () => { const { searchValueAtom } = useSearchPageContext() const searchValue = useAtomValue(searchValueAtom) const windowWidth = useWindowDimensions().width const { data, isLoading } = useQuery({ queryKey: ["searchList", searchValue], - queryFn: () => { - return apiClient.discover.$post({ - json: { - keyword: searchValue, - target: "lists", - }, - }) - }, + queryFn: () => followClient.api.discover.discover({ keyword: searchValue, target: "lists" }), enabled: !!searchValue, }) const skeleton = useDataSkeleton(isLoading, data) diff --git a/apps/mobile/src/modules/entry-list/hooks.ts b/apps/mobile/src/modules/entry-list/hooks.ts index 63a8d49c2..90d6369e8 100644 --- a/apps/mobile/src/modules/entry-list/hooks.ts +++ b/apps/mobile/src/modules/entry-list/hooks.ts @@ -1,12 +1,10 @@ import { debouncedFetchEntryContentByStream } from "@follow/store/entry/store" import { unreadSyncService } from "@follow/store/unread/store" import type { ViewToken } from "@shopify/flash-list" -import { fetch as expoFetch } from "expo/fetch" import { useCallback, useEffect, useInsertionEffect, useMemo, useRef, useState } from "react" import type { NativeScrollEvent, NativeSyntheticEvent } from "react-native" import { useGeneralSettingKey } from "@/src/atoms/settings/general" -import { getCookie } from "@/src/lib/auth" const defaultIdExtractor = (item: ViewToken) => item.key export function useOnViewableItemsChanged({ @@ -35,10 +33,7 @@ export function useOnViewableItemsChanged({ }) => void = useNonReactiveCallback(({ viewableItems, changed }) => { setViewableItems(viewableItems) - debouncedFetchEntryContentByStream( - viewableItems.map((item) => stableIdExtractor(item)), - { cookie: getCookie(), fetch: expoFetch as any }, - ) + debouncedFetchEntryContentByStream(viewableItems.map((item) => stableIdExtractor(item))) const removed = changed.filter((item) => !item.isViewable) // Only when the scroll direction is down and the current offset is a positive number, is it marked as read. diff --git a/apps/mobile/src/modules/feed/FollowFeed.tsx b/apps/mobile/src/modules/feed/FollowFeed.tsx index b4782c602..09c0e9eef 100644 --- a/apps/mobile/src/modules/feed/FollowFeed.tsx +++ b/apps/mobile/src/modules/feed/FollowFeed.tsx @@ -172,15 +172,7 @@ function FollowImpl(props: { feedId: string; defaultView?: FeedViewType }) { > {/* Group 1 */} - + diff --git a/apps/mobile/src/modules/settings/SettingsList.tsx b/apps/mobile/src/modules/settings/SettingsList.tsx index 517f2c6de..350c9caee 100644 --- a/apps/mobile/src/modules/settings/SettingsList.tsx +++ b/apps/mobile/src/modules/settings/SettingsList.tsx @@ -1,6 +1,6 @@ import { UserRole } from "@follow/constants" -import type { ServerConfigs } from "@follow/models/types" import { useUserRole, useWhoami } from "@follow/store/user/hooks" +import type { StatusConfigs as ServerConfigs } from "@follow-app/client-sdk" import type { ParseKeys } from "i18next" import type { FC } from "react" import { Fragment, useMemo } from "react" diff --git a/apps/mobile/src/modules/settings/hooks/useShareSubscription.tsx b/apps/mobile/src/modules/settings/hooks/useShareSubscription.tsx index acd7c69a3..6bc27fb2e 100644 --- a/apps/mobile/src/modules/settings/hooks/useShareSubscription.tsx +++ b/apps/mobile/src/modules/settings/hooks/useShareSubscription.tsx @@ -2,7 +2,7 @@ import type { UseQueryResult } from "@tanstack/react-query" import { useQuery, useQueryClient } from "@tanstack/react-query" import { useCallback, useMemo } from "react" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" // eslint-disable-next-line unused-imports/no-unused-vars type ExtractQueryData = T extends UseQueryResult ? T : never @@ -11,10 +11,8 @@ export const useShareSubscription = ({ userId }: { userId: string }) => { const query = useQuery({ queryKey, queryFn: async () => { - const subscriptions = await apiClient.subscriptions.$get({ - query: { - userId, - }, + const subscriptions = await followClient.api.subscriptions.get({ + userId, }) return subscriptions diff --git a/apps/mobile/src/modules/settings/routes/Account.tsx b/apps/mobile/src/modules/settings/routes/Account.tsx index 12bf4c819..5d70f129e 100644 --- a/apps/mobile/src/modules/settings/routes/Account.tsx +++ b/apps/mobile/src/modules/settings/routes/Account.tsx @@ -49,7 +49,7 @@ type Account = { provider: string profile: | { - id: string + id: string | number name?: string email?: string | null image?: string diff --git a/apps/mobile/src/modules/settings/routes/Actions.tsx b/apps/mobile/src/modules/settings/routes/Actions.tsx index 1dec99b36..182e527ed 100644 --- a/apps/mobile/src/modules/settings/routes/Actions.tsx +++ b/apps/mobile/src/modules/settings/routes/Actions.tsx @@ -1,10 +1,10 @@ -import type { ActionModel } from "@follow/models/types" import { useActionRules, useIsActionDataDirty, usePrefetchActions, useUpdateActionsMutation, } from "@follow/store/action/hooks" +import type { ActionModel } from "@follow/store/action/store" import { actionActions } from "@follow/store/action/store" import { useCallback } from "react" import { useTranslation } from "react-i18next" @@ -157,7 +157,7 @@ const ItemSeparatorComponent = () => { /> ) } -const keyExtractor = (item: ActionModel) => item.index.toString() +const keyExtractor = (_item: ActionModel, index: number) => index.toString() const ListItemCell: ListRenderItem = (props) => { return } diff --git a/apps/mobile/src/modules/settings/routes/EditCondition.tsx b/apps/mobile/src/modules/settings/routes/EditCondition.tsx index a90268b15..7d2d7d972 100644 --- a/apps/mobile/src/modules/settings/routes/EditCondition.tsx +++ b/apps/mobile/src/modules/settings/routes/EditCondition.tsx @@ -1,7 +1,7 @@ -import type { ActionConditionIndex } from "@follow/models/types" import { filterFieldOptions, filterOperatorOptions } from "@follow/store/action/constant" import { useActionRuleCondition } from "@follow/store/action/hooks" import { actionActions } from "@follow/store/action/store" +import type { ActionConditionIndex } from "@follow-app/client-sdk" import { useMemo } from "react" import { useTranslation } from "react-i18next" import { View } from "react-native" diff --git a/apps/mobile/src/modules/settings/routes/EditProfile.tsx b/apps/mobile/src/modules/settings/routes/EditProfile.tsx index 3fe8d87d5..24157613c 100644 --- a/apps/mobile/src/modules/settings/routes/EditProfile.tsx +++ b/apps/mobile/src/modules/settings/routes/EditProfile.tsx @@ -124,6 +124,7 @@ const ProfileForm: FC<{ "instagram", "facebook", "youtube", + // @ts-expect-error adding discord "discord", ] const socialCopyMap = { diff --git a/apps/mobile/src/modules/settings/routes/EditRule.tsx b/apps/mobile/src/modules/settings/routes/EditRule.tsx index 792adcf64..f4e27e3d7 100644 --- a/apps/mobile/src/modules/settings/routes/EditRule.tsx +++ b/apps/mobile/src/modules/settings/routes/EditRule.tsx @@ -1,4 +1,3 @@ -import type { ActionFilter, ActionModel } from "@follow/models/types" import type { ActionAction } from "@follow/store/action/constant" import { availableActionMap, @@ -6,7 +5,9 @@ import { filterOperatorOptions, } from "@follow/store/action/constant" import { useActionRule } from "@follow/store/action/hooks" +import type { ActionModel } from "@follow/store/action/store" import { actionActions } from "@follow/store/action/store" +import type { ActionFilterItem, ActionId } from "@follow-app/client-sdk" import { merge } from "es-toolkit/compat" import { useTranslation } from "react-i18next" import { View } from "react-native" @@ -66,9 +67,9 @@ const RuleImpl: React.FC<{ return ( - - - + + + {__DEV__ && ( {JSON.stringify(rule, null, 2)} @@ -95,7 +96,7 @@ const NameSection: React.FC<{ hitSlop={10} selectionColor={accentColor} onChangeText={(text) => { - actionActions.patchRule(rule.index, { + actionActions.patchRule((rule as any).index ?? 0, { name: text, }) }} @@ -107,7 +108,8 @@ const NameSection: React.FC<{ } const FilterSection: React.FC<{ rule: ActionModel -}> = ({ rule }) => { + index: number +}> = ({ rule, index }) => { const { t } = useTranslation("settings") const hasCustomFilters = rule.condition.length > 0 return ( @@ -121,14 +123,14 @@ const FilterSection: React.FC<{ label={t("actions.action_card.all")} selected={!hasCustomFilters} onPress={() => { - actionActions.toggleRuleFilter(rule.index) + actionActions.toggleRuleFilter(index) }} /> { - actionActions.toggleRuleFilter(rule.index) + actionActions.toggleRuleFilter(index) }} /> @@ -136,7 +138,7 @@ const FilterSection: React.FC<{ ) } const ConditionSection: React.FC<{ - filter: ActionFilter + filter: ActionFilterItem[] index: number }> = ({ filter, index }) => { const { t } = useTranslation("settings") @@ -148,13 +150,13 @@ const ConditionSection: React.FC<{ - {filter.map((group, groupIndex) => { + {(filter as any[]).map((group: any, groupIndex: number) => { if (!Array.isArray(group)) { group = [group] } return ( - {group.map((item, itemIndex) => { + {(group as any[]).map((item: any, itemIndex: number) => { const currentField = filterFieldOptions.find((field) => field.value === item.field) const currentOperator = filterOperatorOptions.find( (field) => field.value === item.operator, @@ -267,13 +269,16 @@ const extendedAvailableActionList = Object.values( })[] const ActionSection: React.FC<{ rule: ActionModel -}> = ({ rule }) => { + index: number +}> = ({ rule, index }) => { const { t } = useTranslation("settings") const enabledActions = extendedAvailableActionList.filter( - (action) => rule.result[action.value] !== undefined, + (action) => + (rule.result as Record)[action.value as unknown as string] !== undefined, ) const notEnabledActions = extendedAvailableActionList.filter( - (action) => rule.result[action.value] === undefined, + (action) => + (rule.result as Record)[action.value as unknown as string] === undefined, ) const navigation = useNavigation() const colors = useColors() @@ -283,14 +288,14 @@ const ActionSection: React.FC<{ {enabledActions.map((action) => ( { - actionActions.deleteRuleAction(rule.index, action.value) + actionActions.deleteRuleAction(index, action.value as ActionId) }, backgroundColor: colors.red, }, @@ -301,7 +306,7 @@ const ActionSection: React.FC<{ action.onNavigate?.(navigation, rule.index)} + onPress={() => action.onNavigate?.(navigation, index)} /> ) : ( {notEnabledActions.map((action) => ( { if (action.onEnable) { - action.onEnable(rule.index) + action.onEnable(index) } else { - actionActions.patchRule(rule.index, { + actionActions.patchRule(index, { result: { [action.value]: true, }, diff --git a/apps/mobile/src/modules/settings/routes/Invitations.tsx b/apps/mobile/src/modules/settings/routes/Invitations.tsx index ede7a8ada..1a048f9f8 100644 --- a/apps/mobile/src/modules/settings/routes/Invitations.tsx +++ b/apps/mobile/src/modules/settings/routes/Invitations.tsx @@ -1,4 +1,5 @@ import { cn } from "@follow/utils" +import type { CreateInvitationRequest } from "@follow-app/client-sdk" import { useMutation, useQuery } from "@tanstack/react-query" import dayjs from "dayjs" import { setStringAsync } from "expo-clipboard" @@ -24,7 +25,7 @@ import { MonoText } from "@/src/components/ui/typography/MonoText" import { Text } from "@/src/components/ui/typography/Text" import { LoveCuteFiIcon } from "@/src/icons/love_cute_fi" import { PowerIcon } from "@/src/icons/power" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import type { DialogComponent } from "@/src/lib/dialog" import { Dialog } from "@/src/lib/dialog" import { toastFetchError } from "@/src/lib/error-parser" @@ -39,15 +40,15 @@ const invitationQueryKey = ["invitations"] const useInvitationsQuery = () => { return useQuery({ queryKey: invitationQueryKey, - queryFn: () => apiClient.invitations.$get().then((res) => res.data), + queryFn: () => followClient.api.invitations.list().then((res) => res.data), }) } const useInvitationsLimitationQuery = () => { const { data } = useQuery({ queryKey: ["invitations", "limitation"], - queryFn: () => apiClient.invitations.limitation.$get(), + queryFn: () => followClient.api.invitations.getLimitation().then((res) => res.data), }) - return data?.data + return data } const numberFormatter = new Intl.NumberFormat("en-US") export const InvitationsScreen: NavigationControllerView = () => { @@ -209,10 +210,8 @@ const ConfirmGenerateDialog: DialogComponent = () => { const { dismiss } = Dialog.useDialogContext()! const newInvitation = useMutation({ mutationKey: ["newInvitation"], - mutationFn: (values: Parameters[0]["json"]) => - apiClient.invitations.new.$post({ - json: values, - }), + mutationFn: (values: CreateInvitationRequest) => + followClient.api.invitations.create({ TOTPCode: values.TOTPCode }), onError(err) { toastFetchError(err) console.error(err) diff --git a/apps/mobile/src/modules/settings/routes/ManageList.tsx b/apps/mobile/src/modules/settings/routes/ManageList.tsx index d4846742a..a264237db 100644 --- a/apps/mobile/src/modules/settings/routes/ManageList.tsx +++ b/apps/mobile/src/modules/settings/routes/ManageList.tsx @@ -26,9 +26,9 @@ import { FeedIcon } from "@/src/components/ui/icon/feed-icon" import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable" import { Text } from "@/src/components/ui/typography/Text" import { CheckLineIcon } from "@/src/icons/check_line" -import { getBizFetchErrorMessage } from "@/src/lib/api-fetch" import { useNavigation } from "@/src/lib/navigation/hooks" import type { NavigationControllerView } from "@/src/lib/navigation/types" +import { getBizFetchErrorMessage } from "@/src/lib/parse-api-error" import { toast } from "@/src/lib/toast" import { accentColor } from "@/src/theme/colors" diff --git a/apps/mobile/src/modules/settings/routes/Plan.tsx b/apps/mobile/src/modules/settings/routes/Plan.tsx index 74480547e..2935d0d13 100644 --- a/apps/mobile/src/modules/settings/routes/Plan.tsx +++ b/apps/mobile/src/modules/settings/routes/Plan.tsx @@ -24,7 +24,7 @@ import { Text } from "@/src/components/ui/typography/Text" import { CheckLineIcon } from "@/src/icons/check_line" import { PowerOutlineIcon } from "@/src/icons/power_outline" import { TimeCuteReIcon } from "@/src/icons/time_cute_re" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import { authClient } from "@/src/lib/auth" import { useNavigation } from "@/src/lib/navigation/hooks" import type { NavigationControllerView } from "@/src/lib/navigation/types" @@ -94,7 +94,7 @@ const PLAN_CONFIGS: Plan[] = [ const useReferralInfoQuery = () => { return useQuery({ queryKey: ["referral", "info"], - queryFn: () => apiClient.referrals.$get().then((res) => res.data), + queryFn: () => followClient.api.referrals.getReferrals().then((res) => res.data), }) } export const PlanScreen: NavigationControllerView = () => { @@ -118,10 +118,8 @@ export const PlanScreen: NavigationControllerView = () => { try { const result = await validateReceipt(purchase.transactionId) if (result.isValid) { - apiClient.referrals["verify-receipt"].$post({ - json: { - appReceipt: result.receiptData, - }, + followClient.api.referrals.verifyReceipt({ + appReceipt: result.receiptData, }) } } catch (error) { @@ -270,6 +268,8 @@ export const PlanScreen: NavigationControllerView = () => { upgradePlanMutation.mutate() }} > + {/* TODO current not return back this value */} + {/* @ts-expect-error current not return back this value */} {`Pay $${serverConfigs?.REFERRAL_PRO_PREVIEW_STRIPE_PRICE_IN_DOLLAR || 1}`} diff --git a/apps/mobile/src/modules/settings/routes/Referral.tsx b/apps/mobile/src/modules/settings/routes/Referral.tsx index 7ed2992ae..35668bd0a 100644 --- a/apps/mobile/src/modules/settings/routes/Referral.tsx +++ b/apps/mobile/src/modules/settings/routes/Referral.tsx @@ -24,7 +24,7 @@ import { import { MonoText } from "@/src/components/ui/typography/MonoText" import { Text } from "@/src/components/ui/typography/Text" import { LoveCuteFiIcon } from "@/src/icons/love_cute_fi" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import type { NavigationControllerView } from "@/src/lib/navigation/types" import { toast } from "@/src/lib/toast" import { useColor } from "@/src/theme/colors" @@ -32,7 +32,7 @@ import { useColor } from "@/src/theme/colors" const useReferralInfoQuery = () => { return useQuery({ queryKey: ["referral", "info"], - queryFn: () => apiClient.referrals.$get().then((res) => res.data), + queryFn: () => followClient.api.referrals.getReferrals().then((res) => res.data), }) } export const ReferralScreen: NavigationControllerView = () => { diff --git a/apps/mobile/src/modules/settings/sync-queue.ts b/apps/mobile/src/modules/settings/sync-queue.ts index fc8df5652..01695ce47 100644 --- a/apps/mobile/src/modules/settings/sync-queue.ts +++ b/apps/mobile/src/modules/settings/sync-queue.ts @@ -1,6 +1,7 @@ import type { GeneralSettings, UISettings } from "@follow/shared/settings/interface" import { isEmptyObject, jotaiStore, sleep } from "@follow/utils" import { EventBus } from "@follow/utils/event-bus" +import type { SettingsTab } from "@follow-app/client-sdk" import { omit } from "es-toolkit/compat" import type { PrimitiveAtom } from "jotai" @@ -10,7 +11,7 @@ import { getGeneralSettings, } from "@/src/atoms/settings/general" import { __uiSettingAtom, getUISettings, uiServerSyncWhiteListKeys } from "@/src/atoms/settings/ui" -import { apiClient } from "@/src/lib/api-fetch" +import { followClient } from "@/src/lib/api-client" import { kv } from "@/src/lib/kv" type SettingMapping = { @@ -169,11 +170,10 @@ class SettingSyncQueue { if (isEmptyObject(json)) { continue } - const promise = apiClient.settings[":tab"] - .$patch({ - param: { - tab, - }, + + const promise = followClient.api.settings + .update({ + tab: tab as SettingsTab, json, }) .then(() => { @@ -197,13 +197,11 @@ class SettingSyncQueue { const promises = [] as Promise[] for (const tab in localSettingGetterMap) { const payload = localSettingGetterMap[tab as SettingSyncTab]() - const promise = apiClient.settings[":tab"].$patch({ - param: { - tab, - }, + + const promise = followClient.api.settings.update({ + tab: tab as SettingsTab, json: payload, }) - promises.push(promise) } @@ -213,10 +211,8 @@ class SettingSyncQueue { const payload = localSettingGetterMap[tab]() this.chain = this.chain.finally(() => - apiClient.settings[":tab"].$patch({ - param: { - tab, - }, + followClient.api.settings.update({ + tab: tab as SettingsTab, json: payload, }), ) @@ -235,7 +231,7 @@ class SettingSyncQueue { if (this.pendingPromise) { return this.pendingPromise } - const promise = apiClient.settings.$get({ query: {} }) + const promise = followClient.api.settings.get() this.pendingPromise = promise.finally(() => { this.pendingPromise = null }) @@ -253,8 +249,8 @@ class SettingSyncQueue { if (isEmptyObject(remoteSettings.settings)) return for (const tab in remoteSettings.settings) { - const remoteSettingPayload = remoteSettings.settings[tab] - const updated = remoteSettings.updated[tab] + const remoteSettingPayload = remoteSettings.settings[tab as SettingsTab] + const updated = remoteSettings.updated[tab as SettingsTab] if (!updated) { continue diff --git a/apps/mobile/src/modules/settings/utils.ts b/apps/mobile/src/modules/settings/utils.ts index 4842e5567..4035710e3 100644 --- a/apps/mobile/src/modules/settings/utils.ts +++ b/apps/mobile/src/modules/settings/utils.ts @@ -4,8 +4,9 @@ import * as FileSystem from "expo-file-system" import * as Sharing from "expo-sharing" import { getDbPath } from "@/src/database" -import { apiClient, apiFetch, getBizFetchErrorMessage } from "@/src/lib/api-fetch" +import { followApi } from "@/src/lib/api-client" import { pickImage } from "@/src/lib/native/picker" +import { getBizFetchErrorMessage } from "@/src/lib/parse-api-error" import { toast } from "@/src/lib/toast" export const setAvatar = async () => { @@ -16,20 +17,14 @@ export const setAvatar = async () => { if (!result) return const { formData } = result - const res = await apiFetch<{ - url: string - }>(apiClient.upload.avatar.$url().toString(), { - method: "POST", - headers: { - "Content-Type": "multipart/form-data", - }, - body: formData, - }).catch((err) => { - toast.error(getBizFetchErrorMessage(err)) - throw err - }) - - const { url } = res + const { url } = await followApi.upload + .uploadAvatar({ + file: formData.get("file") as any, + } as any) + .catch((err) => { + toast.error(getBizFetchErrorMessage(err)) + throw err + }) userSyncService .updateProfile({ @@ -43,12 +38,6 @@ export const setAvatar = async () => { }) } -type FeedResponseList = { - id: string - url: string - title: string | null -}[] - type FileUpload = { uri: string name: string @@ -78,19 +67,7 @@ export const importOpml = async () => { name: file.name, } as FileUpload as any) - const { data } = await apiFetch<{ - data: { - successfulItems: FeedResponseList - conflictItems: FeedResponseList - parsedErrorItems: FeedResponseList - } - }>("/subscriptions/import", { - method: "POST", - body: formData, - headers: { - "Content-Type": "multipart/form-data", - }, - }) + const { data } = await followApi.subscriptions.import(formData) const { successfulItems, conflictItems, parsedErrorItems } = data toast.success( diff --git a/apps/mobile/src/providers/ServerConfigsLoader.tsx b/apps/mobile/src/providers/ServerConfigsLoader.tsx index cdfcaa222..134ea6789 100644 --- a/apps/mobile/src/providers/ServerConfigsLoader.tsx +++ b/apps/mobile/src/providers/ServerConfigsLoader.tsx @@ -2,7 +2,8 @@ import { useQuery } from "@tanstack/react-query" import { useEffect } from "react" import { setServerConfigs } from "@/src/atoms/server-configs" -import { apiClient } from "@/src/lib/api-fetch" + +import { followClient } from "../lib/api-client" export const ServerConfigsLoader = () => { const serverConfigs = useServerConfigsQuery() @@ -18,7 +19,7 @@ export const ServerConfigsLoader = () => { const useServerConfigsQuery = () => { const { data } = useQuery({ queryKey: ["server-configs"], - queryFn: () => apiClient.status.configs.$get(), + queryFn: () => followClient.api.status.getConfigs(), }) return data?.data } diff --git a/apps/mobile/src/screens/(modal)/InvitationScreen.tsx b/apps/mobile/src/screens/(modal)/InvitationScreen.tsx index 3aba4e177..b78204ebc 100644 --- a/apps/mobile/src/screens/(modal)/InvitationScreen.tsx +++ b/apps/mobile/src/screens/(modal)/InvitationScreen.tsx @@ -14,9 +14,9 @@ import { GroupedInsetListCell, GroupedOutlineDescription, } from "@/src/components/ui/grouped/GroupedList" -import { getBizFetchErrorMessage } from "@/src/lib/api-fetch" import { useNavigation } from "@/src/lib/navigation/hooks" import type { NavigationControllerView } from "@/src/lib/navigation/types" +import { getBizFetchErrorMessage } from "@/src/lib/parse-api-error" import { toast } from "@/src/lib/toast" export const InvitationScreen: NavigationControllerView = () => { diff --git a/apps/mobile/src/screens/(modal)/ListScreen.tsx b/apps/mobile/src/screens/(modal)/ListScreen.tsx index 2927b5648..1dd29e0fd 100644 --- a/apps/mobile/src/screens/(modal)/ListScreen.tsx +++ b/apps/mobile/src/screens/(modal)/ListScreen.tsx @@ -24,10 +24,10 @@ import { GroupedInsetListCard, } from "@/src/components/ui/grouped/GroupedList" import { PowerIcon } from "@/src/icons/power" -import { getBizFetchErrorMessage } from "@/src/lib/api-fetch" import { useNavigation } from "@/src/lib/navigation/hooks" import { useSetModalScreenOptions } from "@/src/lib/navigation/ScreenOptionsContext" import type { NavigationControllerView } from "@/src/lib/navigation/types" +import { getBizFetchErrorMessage } from "@/src/lib/parse-api-error" import { toast } from "@/src/lib/toast" import { FeedViewSelector } from "@/src/modules/feed/view-selector" import { accentColor } from "@/src/theme/colors" diff --git a/apps/mobile/src/screens/(modal)/ProfileScreen.tsx b/apps/mobile/src/screens/(modal)/ProfileScreen.tsx index f722f488e..c2e3ce0ed 100644 --- a/apps/mobile/src/screens/(modal)/ProfileScreen.tsx +++ b/apps/mobile/src/screens/(modal)/ProfileScreen.tsx @@ -39,7 +39,7 @@ import { PlatformActivityIndicator } from "@/src/components/ui/loading/PlatformA import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable" import { Text } from "@/src/components/ui/typography/Text" import { ShareForwardCuteReIcon } from "@/src/icons/share_forward_cute_re" -import type { apiClient } from "@/src/lib/api-fetch" +import type { followClient } from "@/src/lib/api-client" import { Navigation } from "@/src/lib/navigation/Navigation" import type { NavigationControllerView } from "@/src/lib/navigation/types" import { toast } from "@/src/lib/toast" @@ -51,7 +51,7 @@ import { useColor } from "@/src/theme/colors" import { FeedScreen } from "../(stack)/feeds/[feedId]/FeedScreen" import { FollowScreen } from "./FollowScreen" -type Subscription = Awaited>["data"][number] +type Subscription = Awaited>["data"][number] export const ProfileScreen: NavigationControllerView<{ userId: string }> = ({ userId }) => { diff --git a/apps/mobile/src/screens/(modal)/RsshubFormScreen.tsx b/apps/mobile/src/screens/(modal)/RsshubFormScreen.tsx index 4f37100c1..98665a0c4 100644 --- a/apps/mobile/src/screens/(modal)/RsshubFormScreen.tsx +++ b/apps/mobile/src/screens/(modal)/RsshubFormScreen.tsx @@ -194,14 +194,7 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) { {!!topFeeds?.length && ( {topFeeds.map((feed) => ( - + ))} )} diff --git a/apps/ssr/client/atoms/server-configs.ts b/apps/ssr/client/atoms/server-configs.ts index be21a1a8c..622704453 100644 --- a/apps/ssr/client/atoms/server-configs.ts +++ b/apps/ssr/client/atoms/server-configs.ts @@ -1,7 +1,7 @@ -import type { ServerConfigs } from "@follow/models/types" import { createAtomHooks } from "@follow/utils/jotai" +import type { StatusConfigs } from "@follow-app/client-sdk" import { atom } from "jotai" export const [, , useServerConfigs, , getServerConfigs, setServerConfigs] = createAtomHooks( - atom>(null), + atom>(null), ) diff --git a/apps/ssr/client/atoms/user.ts b/apps/ssr/client/atoms/user.ts index 66b30463e..d45e22372 100644 --- a/apps/ssr/client/atoms/user.ts +++ b/apps/ssr/client/atoms/user.ts @@ -1,8 +1,8 @@ -import type { UserModel } from "@follow/models" import { createAtomHooks } from "@follow/utils/jotai" +import type { AuthUser } from "@follow-app/client-sdk" import { atom } from "jotai" -export const [, , useWhoami, , whoami, setWhoami] = createAtomHooks(atom>(null)) +export const [, , useWhoami, , whoami, setWhoami] = createAtomHooks(atom>(null)) export const [, , useLoginModalShow, useSetLoginModalShow, getLoginModalShow, setLoginModalShow] = createAtomHooks(atom(false)) diff --git a/apps/ssr/client/components/items/grid.tsx b/apps/ssr/client/components/items/grid.tsx index 8d6c73ec6..4287fac95 100644 --- a/apps/ssr/client/components/items/grid.tsx +++ b/apps/ssr/client/components/items/grid.tsx @@ -1,6 +1,6 @@ -import type { EntriesPreview } from "@client/query/entries" import type { Feed } from "@client/query/feed" import { TitleMarquee } from "@follow/components/ui/marquee/index.jsx" +import type { ParsedEntry } from "@follow-app/client-sdk" import dayjs from "dayjs" import type { FC } from "react" @@ -8,7 +8,7 @@ import { FeedIcon } from "../ui/feed-icon" import { LazyImage } from "../ui/image" export const GridList: FC<{ - entries: EntriesPreview + entries: ParsedEntry[] feed?: Feed }> = ({ entries, feed }) => { return ( @@ -34,7 +34,7 @@ export const GridList: FC<{ const GridItemFooter: FC<{ feed?: Feed entryId: string - entryPreview: EntriesPreview[number] + entryPreview: ParsedEntry }> = ({ feed, entryPreview }) => { return (
@@ -47,11 +47,11 @@ const GridItemFooter: FC<{ - {feed?.feed.title || entryPreview.feeds?.title} + {feed?.feed.title} · {dayjs diff --git a/apps/ssr/client/components/items/index.tsx b/apps/ssr/client/components/items/index.tsx index fb7cf9d0b..c4e6affa2 100644 --- a/apps/ssr/client/components/items/index.tsx +++ b/apps/ssr/client/components/items/index.tsx @@ -1,9 +1,9 @@ import { GridList } from "@client/components/items/grid" import { NormalListItem } from "@client/components/items/normal" import { PictureList } from "@client/components/items/picture" -import type { EntriesPreview } from "@client/query/entries" import type { Feed } from "@client/query/feed" import { FeedViewType } from "@follow/constants" +import type { ParsedEntry } from "@follow-app/client-sdk" import type { FC } from "react" import { useMemo } from "react" @@ -23,7 +23,7 @@ export const Item = ({ feed, view, }: { - entries: EntriesPreview + entries: ParsedEntry[] feed?: Feed view: FeedViewType }) => { @@ -43,7 +43,7 @@ export const Item = ({ } const NormalList: FC<{ - entries: EntriesPreview + entries: ParsedEntry[] feed?: Feed }> = ({ entries, feed }) => { @@ -53,12 +53,11 @@ const NormalList: FC<{
diff --git a/apps/ssr/client/components/items/normal.tsx b/apps/ssr/client/components/items/normal.tsx index 81e2c1b10..4efcd3e1e 100644 --- a/apps/ssr/client/components/items/normal.tsx +++ b/apps/ssr/client/components/items/normal.tsx @@ -1,25 +1,30 @@ import { RelativeTime } from "@follow/components/ui/datetime/index.jsx" import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/index.js" import { cn } from "@follow/utils/utils" +import type { FeedSchema, ParsedEntry } from "@follow-app/client-sdk" import { memo } from "react" import { FeedIcon } from "../ui/feed-icon" import { LazyImage } from "../ui/image" -import type { UniversalItemProps } from "./types" function NormalListItemImpl({ entryPreview, withDetails, -}: UniversalItemProps & { +}: { + entryPreview: { + entry: ParsedEntry + feed: Nullable + feedId: Nullable + } withDetails?: boolean }) { const entry = entryPreview - const feed = entryPreview?.feeds + const feed = entryPreview?.feed if (!entry || !feed) return null - const displayTime = entry.entries.publishedAt + const displayTime = entry.entry.publishedAt return (
- +
@@ -37,17 +42,17 @@ function NormalListItemImpl({ {!!displayTime && }
- {entry.entries.title} + {entry.entry.title}
{withDetails && (
- {entry.entries.description} + {entry.entry.description}
)}
- {entry.entries.media?.[0] && ( + {entry.entry.media?.[0] && (
)} diff --git a/apps/ssr/client/components/items/picture.tsx b/apps/ssr/client/components/items/picture.tsx index 3a470ee60..e09d7bd26 100644 --- a/apps/ssr/client/components/items/picture.tsx +++ b/apps/ssr/client/components/items/picture.tsx @@ -1,6 +1,5 @@ import { LazyImage } from "@client/components/ui/image" import { getPreferredTitle } from "@client/lib/helper" -import type { EntriesPreview } from "@client/query/entries" import type { Feed } from "@client/query/feed" import { MemoedDangerousHTMLStyle } from "@follow/components/common/MemoedDangerousHTMLStyle.jsx" import { TitleMarquee } from "@follow/components/ui/marquee/index.jsx" @@ -15,6 +14,7 @@ import { import { Masonry } from "@follow/components/ui/masonry/index.jsx" import { nextFrame } from "@follow/utils/dom" import { cn } from "@follow/utils/utils" +import type { ParsedEntry } from "@follow-app/client-sdk" import dayjs from "dayjs" import { throttle } from "es-toolkit/compat" import type { RenderComponentProps } from "masonic" @@ -97,7 +97,7 @@ const getCurrentColumn = (w: number) => { return columns } export const PictureList: FC<{ - entries: EntriesPreview + entries: ParsedEntry[] feed?: Feed }> = ({ entries, feed }) => { @@ -209,7 +209,7 @@ const render: React.ComponentType< width: number | undefined blurhash: string | undefined id: string - entry: EntriesPreview[number] + entry: ParsedEntry feed?: Feed }> > = memo(({ data }) => { @@ -271,7 +271,7 @@ const GridItemFooter = ({ timeClassName, feed, }: { - entry: EntriesPreview[number] + entry: ParsedEntry feed?: Feed titleClassName?: string descriptionClassName?: string @@ -291,15 +291,9 @@ const GridItemFooter = ({
- + - {getPreferredTitle(feed?.feed || entry.feeds)} + {getPreferredTitle(feed?.feed)} · diff --git a/apps/ssr/client/components/items/types.ts b/apps/ssr/client/components/items/types.ts deleted file mode 100644 index f4f5fcaca..000000000 --- a/apps/ssr/client/components/items/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CombinedEntryModel, FeedOrListRespModel } from "@follow/models/types" - -export type UniversalItemProps = { - entryId: string - entryPreview?: CombinedEntryModel & { - feeds: FeedOrListRespModel - feedId: string - } -} diff --git a/apps/ssr/client/components/layout/header/index.tsx b/apps/ssr/client/components/layout/header/index.tsx index f7c4857bd..2db231758 100644 --- a/apps/ssr/client/components/layout/header/index.tsx +++ b/apps/ssr/client/components/layout/header/index.tsx @@ -99,7 +99,7 @@ export const Header = () => { whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} className={cn( - "inline-flex items-center gap-2 rounded-full border px-3 font-medium", + "inline-flex items-center gap-2 rounded-full border px-6 font-medium", "bg-fill/60 text-text hover:bg-fill/80 text-sm", isCompact ? "h-8" : "h-10", )} @@ -114,7 +114,7 @@ export const Header = () => { whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} className={cn( - "inline-flex items-center justify-center rounded-full px-4 font-medium", + "inline-flex items-center justify-center rounded-full px-6 font-medium", "bg-white text-sm text-black shadow-sm hover:shadow", "dark:bg-zinc-50 dark:text-zinc-900", isCompact ? "h-8" : "h-10", diff --git a/apps/ssr/client/components/ui/feed-certification.tsx b/apps/ssr/client/components/ui/feed-certification.tsx index cc975ed02..a3a7d3a28 100644 --- a/apps/ssr/client/components/ui/feed-certification.tsx +++ b/apps/ssr/client/components/ui/feed-certification.tsx @@ -6,15 +6,15 @@ import { TooltipPortal, TooltipTrigger, } from "@follow/components/ui/tooltip/index.jsx" -import type { FeedOrListRespModel } from "@follow/models/types" import { cn } from "@follow/utils/utils" +import type { FeedSchema } from "@follow-app/client-sdk" import { useTranslation } from "react-i18next" export const FeedCertification = ({ feed, className, }: { - feed: FeedOrListRespModel + feed: FeedSchema className?: string }) => { const me = useWhoami() diff --git a/apps/ssr/client/components/ui/feed-icon.tsx b/apps/ssr/client/components/ui/feed-icon.tsx index b10a372d4..745884e0a 100644 --- a/apps/ssr/client/components/ui/feed-icon.tsx +++ b/apps/ssr/client/components/ui/feed-icon.tsx @@ -1,9 +1,10 @@ import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx" import { PlatformIcon } from "@follow/components/ui/platform-icon/index.jsx" -import type { CombinedEntryModel, FeedModel, FeedOrListRespModel } from "@follow/models/types" import { getBackgroundGradient } from "@follow/utils/color" import { getImageProxyUrl, replaceImgUrlIfNeed } from "@follow/utils/img-proxy" import { cn, getUrlIcon } from "@follow/utils/utils" +import type { FeedGetResponse } from "@follow-app/client-sdk" +import type { MediaModel } from "@folo-services/drizzle" import { m } from "motion/react" import type { ReactNode } from "react" import { useMemo } from "react" @@ -66,22 +67,31 @@ const FallbackableImage = function FallbackableImage({ ) } -type FeedIconFeed = - | (Pick & { - type: FeedOrListRespModel["type"] - siteUrl?: string - }) - | FeedOrListRespModel +type FeedIconEntry = { + media?: Nullable -type FeedIconEntry = Pick + [key: string]: any +} const fadeInVariant = { initial: { opacity: 0 }, animate: { opacity: 1 }, } +type FeedIconTarget = { + title?: Nullable + image?: Nullable + siteUrl?: Nullable + type: "feed" | "list" | "inbox" + entry?: FeedIconEntry | null + useMedia?: boolean + feed?: FeedGetResponse["data"]["feed"] | null + + url?: string + [key: string]: any +} const isIconLoadedSet = new Set() export function FeedIcon({ - feed, + target, entry, fallbackUrl, className, @@ -93,7 +103,7 @@ export function FeedIcon({ disableFadeIn, noMargin, }: { - feed?: FeedIconFeed | null + target?: FeedIconTarget | null entry?: FeedIconEntry | null fallbackUrl?: string className?: string @@ -113,11 +123,11 @@ export function FeedIcon({ const image = (useMedia ? entry?.media?.find((i) => i.type === "photo")?.url || entry?.authorAvatar - : entry?.authorAvatar) || feed?.image + : entry?.authorAvatar) || target?.image const colors = useMemo( - () => getBackgroundGradient(feed?.title || (feed as FeedModel)?.url || siteUrl || ""), - [feed?.title, (feed as FeedModel)?.url, siteUrl], + () => getBackgroundGradient(target?.title || target?.url || siteUrl || ""), + [target?.title, target?.url, siteUrl], ) let ImageElement: ReactNode let finalSrc = "" @@ -153,13 +163,13 @@ export function FeedIcon({ fontSize: size / 2, }} > - {!!feed?.title && feed.title[0]} + {!!target?.title && target.title[0]} ) switch (true) { - case !feed && !!siteUrl: { + case !target && !!siteUrl: { const [src] = getFeedIconSrc({ siteUrl, }) @@ -196,9 +206,9 @@ export function FeedIcon({ break } case !!fallbackUrl: - case !!(feed as FeedModel)?.siteUrl: { + case !!target?.siteUrl: { const [src, fallbackSrc] = getFeedIconSrc({ - siteUrl: (feed as FeedModel)?.siteUrl || fallbackUrl, + siteUrl: target?.siteUrl || fallbackUrl, fallback, proxy: { width: size * 2, @@ -209,7 +219,7 @@ export function FeedIcon({ ImageElement = ( @@ -222,13 +232,13 @@ export function FeedIcon({ ) break } - case feed?.type === "inbox": { + case target?.type === "inbox": { ImageElement = ( ) break } - case !!feed?.title && !!feed.title[0]: { + case !!target?.title && !!target.title[0]: { ImageElement = fallbackIcon break } diff --git a/apps/ssr/client/components/ui/user-avatar.tsx b/apps/ssr/client/components/ui/user-avatar.tsx index f33e34dcf..57f66933d 100644 --- a/apps/ssr/client/components/ui/user-avatar.tsx +++ b/apps/ssr/client/components/ui/user-avatar.tsx @@ -28,7 +28,18 @@ export const UserAvatar = ({ className }: { className?: string }) => { image: "https://avatars-githubusercontent-webp.webp.se/u/41265413?v=4", handle: "innei", role: UserRole.Free, - roleEndAt: new Date(), + isAnonymous: false, + suspended: false, + stripeCustomerId: "", + roleEndAt: new Date().toISOString(), + bio: "", + website: "", + socialLinks: {} as any, + email: "", + emailVerified: false, + createdAt: new Date().toISOString(), + updatedAt: new Date().toISOString(), + twoFactorEnabled: false, deleted: false, } } else { diff --git a/apps/ssr/client/initialize/helper.ts b/apps/ssr/client/initialize/helper.ts index e0b9ddaa7..38b852dab 100644 --- a/apps/ssr/client/initialize/helper.ts +++ b/apps/ssr/client/initialize/helper.ts @@ -1,5 +1,5 @@ -import type { AuthUser } from "@follow/shared/hono" import { tracker } from "@follow/tracker" +import type { AuthUser } from "@follow-app/client-sdk" export const setIntegrationIdentify = async (user: AuthUser) => { tracker.identify(user) diff --git a/apps/ssr/client/lib/api-fetch.ts b/apps/ssr/client/lib/api-fetch.ts index 70e35481e..6faddac61 100644 --- a/apps/ssr/client/lib/api-fetch.ts +++ b/apps/ssr/client/lib/api-fetch.ts @@ -1,31 +1,32 @@ +import "client-only" + import { env } from "@follow/shared/env.ssr" -import type { AppType } from "@follow/shared/hono" import { createSSRAPIHeaders } from "@follow/utils/headers" -import { hc } from "hono/client" -import { ofetch } from "ofetch" +import { FollowClient } from "@follow-app/client-sdk" import PKG from "../../../desktop/package.json" -const apiFetch = ofetch.create({ +export const followClient = new FollowClient({ credentials: "include", - retry: false, - cache: "no-store", - onRequest: ({ options }) => { - const header = new Headers(options.headers) - - const headers = createSSRAPIHeaders({ version: PKG.version }) - - Object.entries(headers).forEach(([key, value]) => { - header.set(key, value) - }) - - options.headers = header - }, -}) - -export const apiClient = hc(env.VITE_EXTERNAL_API_URL || env.VITE_API_URL, { + timeout: 10000, + baseURL: env.VITE_EXTERNAL_API_URL || env.VITE_API_URL, fetch: async (input: any, options = {}) => - apiFetch(input.toString(), options).catch((err) => { - throw err + fetch(input.toString(), { + ...options, + cache: "no-store", }), }) + +followClient.addRequestInterceptor(async (ctx) => { + const { options } = ctx + const header = new Headers(options.headers) + + const headers = createSSRAPIHeaders({ version: PKG.version }) + + Object.entries(headers).forEach(([key, value]) => { + header.set(key, value) + }) + + options.headers = Object.fromEntries(header.entries()) + return ctx +}) diff --git a/apps/ssr/client/lib/helper.ts b/apps/ssr/client/lib/helper.ts index c5cde3bef..864e94f91 100644 --- a/apps/ssr/client/lib/helper.ts +++ b/apps/ssr/client/lib/helper.ts @@ -1,15 +1,19 @@ -import type { FeedOrListRespModel } from "@follow/models/types" import { DEEPLINK_SCHEME } from "@follow/shared/constants" +import type { FollowClient } from "@follow-app/client-sdk" -import type { ApiClient } from "~/lib/api-client" import type { defineMetadata } from "~/meta-handler" -export const getPreferredTitle = (feed?: FeedOrListRespModel | null) => { - if (!feed?.id) { - return feed?.title +type Target = { + id: string + title?: Nullable + [key: string]: any +} +export const getPreferredTitle = (target?: Target | null) => { + if (!target?.id) { + return target?.title } - return feed.title + return target.title } export const getHydrateData = (key: string) => { @@ -37,7 +41,7 @@ type ExtractHydrateData = T extends readonly (infer Item)[] type UnwrapMetadataFn = T extends

>(args: { params: P - apiClient: ApiClient + apiClient: FollowClient origin: string throwError: (status: number, message: any) => never }) => Promise | infer R diff --git a/apps/ssr/client/modules/referral/index.tsx b/apps/ssr/client/modules/referral/index.tsx index 40051e99b..24221344e 100644 --- a/apps/ssr/client/modules/referral/index.tsx +++ b/apps/ssr/client/modules/referral/index.tsx @@ -1,5 +1,5 @@ // sync this file with apps/desktop/layer/renderer/src/modules/auth/ReferralForm.tsx -import { apiClient } from "@client/lib/api-fetch" +import { followClient } from "@client/lib/api-fetch" import { Form, FormControl, @@ -36,7 +36,7 @@ function getDefaultReferralCode() { } async function getReferralCycleDays(code: string) { - return apiClient.referrals.days.$get({ query: { code } }) + return followClient.api.referrals.getDays({ code }) } export function ReferralForm({ diff --git a/apps/ssr/client/pages/(login)/layout.tsx b/apps/ssr/client/pages/(login)/layout.tsx index 2234e12fe..afe93c7d2 100644 --- a/apps/ssr/client/pages/(login)/layout.tsx +++ b/apps/ssr/client/pages/(login)/layout.tsx @@ -1,6 +1,7 @@ import { setWhoami } from "@client/atoms/user" import { setIntegrationIdentify } from "@client/initialize/helper" import { useSession } from "@client/query/auth" +import type { AuthUser } from "@follow-app/client-sdk" import { useEffect } from "react" import { Outlet } from "react-router" @@ -18,10 +19,10 @@ const UserProvider = () => { useEffect(() => { if (!session?.user) return - // @ts-expect-error FIXME - setWhoami(session.user) - setIntegrationIdentify(session.user) + setWhoami(session.user as unknown as AuthUser) + + setIntegrationIdentify(session.user as unknown as AuthUser) }, [session?.user]) return null diff --git a/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx b/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx index 628319d83..14d883670 100644 --- a/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx +++ b/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx @@ -9,6 +9,7 @@ import { RelativeTime } from "@follow/components/ui/datetime/index.jsx" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { useTitle } from "@follow/hooks" import { cn } from "@follow/utils/utils" +import type { FeedSchema } from "@follow-app/client-sdk" import { Fragment } from "react" import { useTranslation } from "react-i18next" import { useParams, useSearchParams } from "react-router" @@ -25,7 +26,7 @@ export function Component() { }) const view = Number.parseInt(search.get("view") || feed.data?.analytics?.view?.toString() || "0") - const feedData = feed.data?.feed + const feedData = feed.data?.feed as FeedSchema const analytics = feed.data?.analytics const isSubscribed = !!feed.data?.subscription const entries = feed.data?.entries.map((entry) => ({ @@ -52,7 +53,7 @@ export function Component() {

{ const feedId = params.id - const feed = await apiClient.feeds.$get({ query: { id: feedId } }).catch(callNotFound) + const feed = await apiClient.api.feeds.get({ id: feedId }).catch(callNotFound) const { title, description } = feed.data.feed @@ -25,7 +25,7 @@ const meta = defineMetadata(async ({ params, apiClient, origin }) => { { type: "hydrate", data: feed.data, - path: apiClient.feeds.$url({ query: { id: feedId } }).pathname, + path: `/feeds/${feedId}`, key: `feeds.$get,query:id=${feedId}`, }, { diff --git a/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx b/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx index 824d81e50..890367615 100644 --- a/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx +++ b/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx @@ -2,7 +2,6 @@ import { Item } from "@client/components/items" import { FeedCertification } from "@client/components/ui/feed-certification" import { FeedIcon } from "@client/components/ui/feed-icon" import { openInFollowApp } from "@client/lib/helper" -import type { Feed } from "@client/query/feed" import { useList } from "@client/query/list" import { FollowIcon } from "@follow/components/icons/follow.jsx" import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx" @@ -10,11 +9,12 @@ import { Button } from "@follow/components/ui/button/index.jsx" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { useTitle } from "@follow/hooks" import { cn, formatNumber } from "@follow/utils/utils" +import type { FeedSchema } from "@follow-app/client-sdk" import { Fragment, memo } from "react" import { useTranslation } from "react-i18next" import { useParams } from "react-router" -const FeedRow = memo<{ feed: Feed["feed"] }>(({ feed }) => { +const FeedRow = memo<{ feed: FeedSchema }>(({ feed }) => { return ( (({ feed }) => { >
- +
@@ -68,7 +68,7 @@ export function Component() { acc[feed.id] = feed return acc }, - {} as Record, + {} as Record, ) || {} useTitle(list.data?.list.title) @@ -98,7 +98,7 @@ export function Component() {
{ const listId = params.id! - const list = await apiClient.lists.$get({ query: { listId } }).catch(callNotFound) + const list = await apiClient.api.lists.get({ listId }).catch(callNotFound) const { title, description } = list.data.list return [ @@ -22,7 +22,7 @@ export default defineMetadata(async ({ params, apiClient, origin }) => { { type: "hydrate", data: list.data, - path: apiClient.lists.$url({ query: { listId } }).pathname, + key: `lists.$get,query:listId=${listId}`, }, { diff --git a/apps/ssr/client/pages/(main)/share/users/[id]/index.tsx b/apps/ssr/client/pages/(main)/share/users/[id]/index.tsx index e15b4d24f..bbf2b81ac 100644 --- a/apps/ssr/client/pages/(main)/share/users/[id]/index.tsx +++ b/apps/ssr/client/pages/(main)/share/users/[id]/index.tsx @@ -2,7 +2,6 @@ import { FeedIcon } from "@client/components/ui/feed-icon" import { openInFollowApp } from "@client/lib/helper" import { UrlBuilder } from "@client/lib/url-builder" import { useListsByUserId } from "@client/query/list" -import type { SubscriptionResult, User } from "@client/query/users" import { useUserQuery, useUserSubscriptionsQuery } from "@client/query/users" import { FollowIcon } from "@follow/components/icons/follow.jsx" import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx" @@ -10,11 +9,12 @@ import { Button } from "@follow/components/ui/button/index.jsx" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { useTitle } from "@follow/hooks" import { cn } from "@follow/utils/utils" +import type { SubscriptionWithFeed, UserProfile } from "@follow-app/client-sdk" import { Fragment, memo, useState } from "react" import { useParams } from "react-router" interface FeedCardProps { - subscription: SubscriptionResult[number] + subscription: SubscriptionWithFeed feedId: string view: number } @@ -34,7 +34,15 @@ const FeedCard = memo(({ subscription, feedId, view }) => { >
- +

@@ -96,7 +104,7 @@ export const Component = () => { ) } -const UserHero = ({ user }: { user: User }) => { +const UserHero = ({ user }: { user: UserProfile }) => { const subscriptions = useUserSubscriptionsQuery(user.id) const totalFeeds = Object.values(subscriptions.data || {}).reduce( @@ -179,7 +187,7 @@ const Lists = ({ userId }: { userId: string }) => { > => { - const mayBeUserId = params.id + const userIdOrHandle = params.id - const handle = isBizId(mayBeUserId || "") - ? mayBeUserId - : `${mayBeUserId}`.startsWith("@") - ? `${mayBeUserId}`.slice(1) - : mayBeUserId + let handle = undefined + let userId = undefined - const profileRes = await apiClient.profiles - .$get({ - query: { - handle, - id: isBizId(handle || "") ? handle : undefined, - }, - }) + if (!userIdOrHandle) { + throw new Error("User ID or handle is required") + } + + if (isBizId(userIdOrHandle || "")) { + userId = userIdOrHandle + } else { + handle = userIdOrHandle.startsWith("@") ? userIdOrHandle.slice(1) : userIdOrHandle + } + + const profileRes = await apiClient.api.profiles + .getProfile({ id: userId, handle }) .catch(callNotFound) const realUserId = profileRes.data.id const [subscriptionsRes, listsRes] = await Promise.allSettled([ - profileRes.data.id - ? apiClient.subscriptions.$get({ - query: { userId: realUserId }, - }) - : Promise.reject(), - profileRes.data.id - ? apiClient.lists.list.$get({ - query: { userId: realUserId }, - }) - : Promise.reject(), + profileRes.data.id ? apiClient.api.subscriptions.get({ userId: realUserId }) : Promise.reject(), + profileRes.data.id ? apiClient.api.lists.list({ userId: realUserId }) : Promise.reject(), ]) const isSubscriptionsResolved = subscriptionsRes.status === "fulfilled" @@ -58,24 +52,24 @@ export default defineMetadata(async ({ params, apiClient, origin }): Promise !!v) as MetaTag[] diff --git a/apps/ssr/client/providers/server-configs-provider.tsx b/apps/ssr/client/providers/server-configs-provider.tsx index aecb4063a..d9b55f9a8 100644 --- a/apps/ssr/client/providers/server-configs-provider.tsx +++ b/apps/ssr/client/providers/server-configs-provider.tsx @@ -1,14 +1,14 @@ import { setServerConfigs } from "@client/atoms/server-configs" -import { apiClient } from "@client/lib/api-fetch" +import { followClient } from "@client/lib/api-fetch" import { useQuery } from "@tanstack/react-query" import { useEffect } from "react" const useServerConfigsQuery = () => { const { data } = useQuery({ queryKey: ["server-configs"], - queryFn: async () => await apiClient.status.configs.$get(), + queryFn: async () => await followClient.api.status.getConfigs().then((res) => res.data), }) - return data?.data + return data } export const ServerConfigsProvider = () => { diff --git a/apps/ssr/client/providers/user-provider.tsx b/apps/ssr/client/providers/user-provider.tsx index ba055bbb0..cdfb12506 100644 --- a/apps/ssr/client/providers/user-provider.tsx +++ b/apps/ssr/client/providers/user-provider.tsx @@ -1,6 +1,7 @@ import { setWhoami } from "@client/atoms/user" import { setIntegrationIdentify } from "@client/initialize/helper" import { useSession } from "@client/query/auth" +import type { AuthUser } from "@follow-app/client-sdk" import { useEffect } from "react" export const UserProvider = () => { @@ -11,7 +12,7 @@ export const UserProvider = () => { // @ts-expect-error FIXME setWhoami(session.user) - setIntegrationIdentify(session.user) + setIntegrationIdentify(session.user as unknown as AuthUser) }, [session?.user]) return null diff --git a/apps/ssr/client/query/auth.ts b/apps/ssr/client/query/auth.ts index 2a7ec6a70..2d17ee79f 100644 --- a/apps/ssr/client/query/auth.ts +++ b/apps/ssr/client/query/auth.ts @@ -1,5 +1,4 @@ import { getSession } from "@client/lib/auth" -import type { AuthSession } from "@follow/shared/hono" import { useQuery } from "@tanstack/react-query" import type { FetchError } from "ofetch" @@ -25,7 +24,7 @@ export const useSession = (options?: { enabled?: boolean }) => { const fetchError = error as FetchError return { - session: data?.data as AuthSession, + session: data?.data, ...rest, status: isLoading ? "loading" diff --git a/apps/ssr/client/query/entries.ts b/apps/ssr/client/query/entries.ts index 4ea7c37e2..491737b6f 100644 --- a/apps/ssr/client/query/entries.ts +++ b/apps/ssr/client/query/entries.ts @@ -1,14 +1,12 @@ -import { apiClient } from "@client/lib/api-fetch" +import { followClient } from "@client/lib/api-fetch" import { getHydrateData } from "@client/lib/helper" import { useQuery } from "@tanstack/react-query" import type { Feed } from "./feed" const fetchEntriesPreview = async ({ id }: { id?: string }) => { - const res = await apiClient.entries.preview.$get({ - query: { - id: id!, - }, + const res = await followClient.api.entries.preview({ + id: id!, }) return res.data @@ -22,6 +20,6 @@ export const useEntriesPreview = ({ id }: { id?: string }) => { }) } -export type EntriesPreview = (Awaited>[number] & { +export type EntriesPreview = (Awaited> & { feeds?: Feed["feed"] })[] diff --git a/apps/ssr/client/query/feed.ts b/apps/ssr/client/query/feed.ts index f51bcaa08..748cf406f 100644 --- a/apps/ssr/client/query/feed.ts +++ b/apps/ssr/client/query/feed.ts @@ -1,14 +1,12 @@ -import { apiClient } from "@client/lib/api-fetch" +import { followClient } from "@client/lib/api-fetch" import { getHydrateData } from "@client/lib/helper" import type { FeedHydrateData } from "@client/pages/(main)/share/feeds/[id]/metadata" import { useQuery } from "@tanstack/react-query" async function fetchFeedById(id: string) { - const res = await apiClient.feeds.$get({ - query: { - id, - entriesLimit: 8, - }, + const res = await followClient.api.feeds.get({ + id, + entriesLimit: 8, }) return res.data } diff --git a/apps/ssr/client/query/list.ts b/apps/ssr/client/query/list.ts index 37d4ea627..69a3e4e9b 100644 --- a/apps/ssr/client/query/list.ts +++ b/apps/ssr/client/query/list.ts @@ -1,9 +1,9 @@ -import { apiClient } from "@client/lib/api-fetch" +import { followClient } from "@client/lib/api-fetch" import { getHydrateData } from "@client/lib/helper" import { useQuery } from "@tanstack/react-query" const fetchListById = async (id: string) => { - const res = await apiClient.lists.$get({ query: { listId: id } }) + const res = await followClient.api.lists.get({ listId: id }) return res.data } @@ -18,7 +18,7 @@ export const useList = ({ id }: { id?: string }) => }) const fetchListsByUserId = async (userId: string) => { - const res = await apiClient.lists.list.$get({ query: { userId } }) + const res = await followClient.api.lists.list({ userId }) return res.data } diff --git a/apps/ssr/client/query/users.ts b/apps/ssr/client/query/users.ts index 3820a5ecf..ae54b4071 100644 --- a/apps/ssr/client/query/users.ts +++ b/apps/ssr/client/query/users.ts @@ -1,16 +1,26 @@ -import { apiClient } from "@client/lib/api-fetch" +import { followClient } from "@client/lib/api-fetch" import { getProviders } from "@client/lib/auth" import { getHydrateData } from "@client/lib/helper" import type { LoginHydrateData } from "@client/pages/(login)/login/metadata" -import type { ExtractBizResponse } from "@follow/models" import { isBizId, sortByAlphabet } from "@follow/utils/utils" +import type { + InboxSubscriptionResponse, + ListSubscriptionResponse, + SubscriptionWithFeed, +} from "@follow-app/client-sdk" import { useQuery } from "@tanstack/react-query" +type GetUserSubscriptionsResponse = ( + | SubscriptionWithFeed + | ListSubscriptionResponse + | InboxSubscriptionResponse +)[] + const UN_CATEGORIZED = "Uncategorized" const groupSubscriptions = ( - subscriptions: SubscriptionResult, -): Record => { - const groupFolder = {} as Record + subscriptions: GetUserSubscriptionsResponse, +): Record => { + const groupFolder = {} as Record for (const subscription of subscriptions.filter((s) => !s.isPrivate) || []) { if (!subscription.category && "feeds" in subscription) { subscription.category = UN_CATEGORIZED @@ -39,10 +49,9 @@ const groupSubscriptions = ( return groupFolder } -export type SubscriptionResult = ExtractBizResponse["data"] const fetchUserSubscriptions = async (userId: string | undefined) => { - const res = await apiClient.subscriptions.$get({ - query: { userId }, + const res = await followClient.api.subscriptions.get({ + userId, }) return res.data } @@ -68,12 +77,7 @@ export const fetchUser = async (handleOrId: string | undefined) => { ? `${handleOrId}`.slice(1) : handleOrId - const res = await apiClient.profiles.$get({ - query: { - handle, - id: isBizId(handle || "") ? handle : undefined, - }, - }) + const res = await followClient.api.profiles.getProfile({ id: handleOrId, handle }) return res.data } diff --git a/apps/ssr/package.json b/apps/ssr/package.json index b704454d4..9fd9d03a4 100644 --- a/apps/ssr/package.json +++ b/apps/ssr/package.json @@ -12,6 +12,7 @@ "dependencies": { "@fastify/middie": "9.0.3", "@fastify/request-context": "6.2.0", + "@follow-app/client-sdk": "catalog:", "@follow/tracker": "workspace:*", "@fontsource/sn-pro": "5.2.5", "@hcaptcha/react-hcaptcha": "1.12.1", diff --git a/apps/ssr/src/lib/api-client.ts b/apps/ssr/src/lib/api-client.ts index 62c0205e8..f180fcc27 100644 --- a/apps/ssr/src/lib/api-client.ts +++ b/apps/ssr/src/lib/api-client.ts @@ -2,9 +2,8 @@ import "./load-env" import { requestContext } from "@fastify/request-context" import { env } from "@follow/shared/env.ssr" -import type { AppType } from "@follow/shared/hono" import { createSSRAPIHeaders } from "@follow/utils/headers" -import { hc } from "hono/client" +import { FollowClient } from "@follow-app/client-sdk" import { ofetch } from "ofetch" import PKG from "../../../desktop/package.json" @@ -55,22 +54,38 @@ export const createApiFetch = () => { baseURL, }) } -export const createApiClient = () => { + +export const createFollowClient = () => { const authSessionToken = getTokenFromCookie(requestContext.get("req")?.headers.cookie || "") const baseURL = getBaseURL() - const apiFetch = createApiFetch() - const apiClient = hc(baseURL, { - fetch: async (input: any, options = {}) => apiFetch(input.toString(), options), - headers() { - return { - "User-Agent": `Folo External Server Api Client/${PKG.version}`, - Cookie: authSessionToken ? `__Secure-better-auth.session_token=${authSessionToken}` : "", - } - }, + const client = new FollowClient({ + credentials: "include", + timeout: 10000, + baseURL, + fetch: async (input: any, options = {}) => fetch(input.toString(), options), }) - return apiClient + + client.addRequestInterceptor(async (ctx) => { + const { options } = ctx + const header = new Headers(options.headers) + + const headers = createSSRAPIHeaders({ version: PKG.version }) + + Object.entries(headers).forEach(([key, value]) => { + header.set(key, value) + }) + + if (authSessionToken) { + header.set("Cookie", `__Secure-better-auth.session_token=${authSessionToken}`) + } + + options.headers = Object.fromEntries(header.entries()) + return ctx + }) + + return client } export const getTokenFromCookie = (cookie: string) => { @@ -87,5 +102,3 @@ export const getTokenFromCookie = (cookie: string) => { ) return parsedCookieMap["__Secure-better-auth.session_token"] } - -export type ApiClient = ReturnType diff --git a/apps/ssr/src/meta-handler.ts b/apps/ssr/src/meta-handler.ts index 334aba863..668d4ec1c 100644 --- a/apps/ssr/src/meta-handler.ts +++ b/apps/ssr/src/meta-handler.ts @@ -1,8 +1,8 @@ +import type { FollowClient } from "@follow-app/client-sdk" import type { FastifyReply, FastifyRequest } from "fastify" import { match } from "path-to-regexp" -import type { ApiClient } from "./lib/api-client" -import { createApiClient } from "./lib/api-client" +import { createFollowClient } from "./lib/api-client" import importer from "./meta-handler.map" interface MetaTagdata { @@ -31,7 +31,7 @@ interface MetaDescription { interface MetaHydrateData { type: "hydrate" data: any - path: string + key: string } export type MetaTag = MetaTagdata | MetaOpenGraph | MetaTitle | MetaHydrateData | MetaDescription @@ -40,7 +40,7 @@ export async function injectMetaHandler( req: FastifyRequest, res: FastifyReply, ): Promise { - const apiClient = createApiClient() + const apiClient = createFollowClient() const upstreamOrigin = req.requestContext.get("upstreamOrigin") const url = req.originalUrl @@ -78,7 +78,7 @@ export function defineMetadata, T extends req: FastifyRequest url: URL params: Params - apiClient: ApiClient + apiClient: FollowClient searchParams: URLSearchParams origin: string setStatus: (status: number) => void diff --git a/apps/ssr/src/router/global.ts b/apps/ssr/src/router/global.ts index 7407b2d53..c457d1733 100644 --- a/apps/ssr/src/router/global.ts +++ b/apps/ssr/src/router/global.ts @@ -38,7 +38,7 @@ const devHandler = (app: FastifyInstance) => { } const prodHandler = (app: FastifyInstance) => { app.get("*", async (req, reply) => { - // @ts-expect-error + // @ts-ignore const template = await import("../../.generated/index.template").then((m) => m.default) const { document } = parseHTML(template) await safeInjectMetaToTemplate(document, req, reply) diff --git a/apps/ssr/src/router/og/feed.tsx b/apps/ssr/src/router/og/feed.tsx index b1793083b..85793245b 100644 --- a/apps/ssr/src/router/og/feed.tsx +++ b/apps/ssr/src/router/og/feed.tsx @@ -1,14 +1,14 @@ import { getFeedIconSrc } from "@follow/components/utils/icon.js" import { formatNumber } from "@follow/utils" +import type { FollowClient } from "@follow-app/client-sdk" import * as React from "react" -import type { ApiClient } from "~/lib/api-client" import { renderToImage } from "~/lib/og/render-to-image" import { getImageBase64, OGAvatar, OGCanvas } from "./__base" -export const renderFeedOG = async (apiClient: ApiClient, feedId: string) => { - const feed = await apiClient.feeds.$get({ query: { id: feedId } }).catch(() => null) +export const renderFeedOG = async (apiClient: FollowClient, feedId: string) => { + const feed = await apiClient.api.feeds.get({ id: feedId }).catch(() => null) if (!feed?.data.feed) { throw 404 diff --git a/apps/ssr/src/router/og/index.ts b/apps/ssr/src/router/og/index.ts index acfa15701..0cbcf5a31 100644 --- a/apps/ssr/src/router/og/index.ts +++ b/apps/ssr/src/router/og/index.ts @@ -2,7 +2,7 @@ import { Readable } from "node:stream" import type { FastifyInstance, FastifyReply } from "fastify" -import { createApiClient } from "~/lib/api-client" +import { createFollowClient } from "~/lib/api-client" import { renderFeedOG } from "./feed" import { renderListOG } from "./list" @@ -12,7 +12,7 @@ export const ogRoute = (app: FastifyInstance) => { app.get("/og/:type/:id", async (req, reply) => { const { type, id } = req.params as Record - const apiClient = createApiClient() + const apiClient = createFollowClient() let imageRes: { image: Buffer contentType: string diff --git a/apps/ssr/src/router/og/list.tsx b/apps/ssr/src/router/og/list.tsx index 1b9da51e0..be2ac6717 100644 --- a/apps/ssr/src/router/og/list.tsx +++ b/apps/ssr/src/router/og/list.tsx @@ -1,13 +1,13 @@ import { getFeedIconSrc } from "@follow/components/utils/icon.js" +import type { FollowClient } from "@follow-app/client-sdk" import * as React from "react" -import type { ApiClient } from "~/lib/api-client" import { renderToImage } from "~/lib/og/render-to-image" import { getImageBase64, OGAvatar, OGCanvas } from "./__base" -export const renderListOG = async (apiClient: ApiClient, listId: string) => { - const feed = await apiClient.lists.$get({ query: { listId } }).catch(() => null) +export const renderListOG = async (apiClient: FollowClient, listId: string) => { + const feed = await apiClient.api.lists.get({ listId }).catch(() => null) if (!feed?.data.list) { throw 404 diff --git a/apps/ssr/src/router/og/user.tsx b/apps/ssr/src/router/og/user.tsx index d255e0e36..3895de392 100644 --- a/apps/ssr/src/router/og/user.tsx +++ b/apps/ssr/src/router/og/user.tsx @@ -1,19 +1,17 @@ import { isBizId } from "@follow/utils/utils" +import type { FollowClient } from "@follow-app/client-sdk" import * as React from "react" -import type { ApiClient } from "~/lib/api-client" import { renderToImage } from "~/lib/og/render-to-image" import { getImageBase64, OGAvatar, OGCanvas } from "./__base" -export const renderUserOG = async (apiClient: ApiClient, id: string) => { +export const renderUserOG = async (apiClient: FollowClient, id: string) => { const handle = isBizId(id || "") ? id : `${id}`.startsWith("@") ? `${id}`.slice(1) : id - const user = await apiClient.profiles.$get({ - query: { - handle, - id: isBizId(handle || "") ? handle : undefined, - }, + const user = await apiClient.api.profiles.getProfile({ + id, + handle, }) if (!user) { diff --git a/eslint.config.mjs b/eslint.config.mjs index 47e002f14..4f69eff8a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -14,7 +14,6 @@ export default defineConfig( formatting: false, lessOpinionated: true, ignores: [ - "packages/internal/shared/src/hono.ts", "resources/**", "apps/mobile/android/**", "apps/mobile/ios/**", diff --git a/packages/internal/models/package.json b/packages/internal/models/package.json index f6814cdce..8370151c8 100644 --- a/packages/internal/models/package.json +++ b/packages/internal/models/package.json @@ -24,8 +24,7 @@ "@follow/constants": "workspace:*", "@follow/shared": "workspace:*", "@follow/types": "workspace:*", - "@follow/utils": "workspace:*", - "hono": "4.9.7" + "@follow/utils": "workspace:*" }, "devDependencies": { "@follow/configs": "workspace:*" diff --git a/packages/internal/models/src/index.ts b/packages/internal/models/src/index.ts index eb7cf211b..336ce12bb 100644 --- a/packages/internal/models/src/index.ts +++ b/packages/internal/models/src/index.ts @@ -1,39 +1 @@ -import type { FeedModel, ListModelPoplutedFeeds, UserModel } from "./types" - -export * from "./types" - -/* eslint-disable @typescript-eslint/no-namespace */ -export namespace Models { - export interface TrendingList { - id: string - title?: Nullable - description?: Nullable - image?: Nullable - view: number - fee: number - timelineUpdatedAt: string - ownerUserId?: Nullable - subscriberCount?: number - } - - export interface TrendingAggregates { - trendingFeeds: FeedModel[] - trendingLists: ListModelPoplutedFeeds[] - trendingEntries: TrendingEntry[] - trendingUsers: UserModel[] - } - - export interface TrendingEntry { - id: string - feedId: string - title: string - url: string - content: string - description: string - guid: string - author: string - insertedAt: string - publishedAt: string - readCount: number - } -} +export {} diff --git a/packages/internal/models/src/rsshub.ts b/packages/internal/models/src/rsshub.ts index ec7b85128..c2033277a 100644 --- a/packages/internal/models/src/rsshub.ts +++ b/packages/internal/models/src/rsshub.ts @@ -1,6 +1,5 @@ import type { FeedViewType } from "@follow/constants" - -import type { FeedModel } from "./types" +import type { FeedDiscoveryResult } from "@follow-app/client-sdk" export type RSSHubRouteType = Record export interface RSSHubRouteDeclaration { @@ -30,5 +29,5 @@ export type RSSHubRoute = { description: string view?: FeedViewType heat?: number - topFeeds?: FeedModel[] + topFeeds?: FeedDiscoveryResult[] } diff --git a/packages/internal/models/src/types.ts b/packages/internal/models/src/types.ts deleted file mode 100644 index e1aee62d8..000000000 --- a/packages/internal/models/src/types.ts +++ /dev/null @@ -1,173 +0,0 @@ -import type { AppType, languageSchema, users } from "@follow/shared" -import type { hc } from "hono/client" -import type { z } from "zod" - -declare const _apiClient: ReturnType> -type OptionalKey = Omit & Partial> -export type UserModel = OptionalKey< - typeof users.$inferSelect, - | "createdAt" - | "updatedAt" - | "email" - | "emailVerified" - | "twoFactorEnabled" - | "isAnonymous" - | "suspended" - | "bio" - | "website" - | "socialLinks" - | "stripeCustomerId" -> - -export type ExtractBizResponse any> = Exclude< - Awaited>, - undefined -> -export type ExtractHonoParams any> = Parameters[0]["json"] - -export type ActiveList = { - id: string | number - name: string - view: number -} - -export type TransactionModel = ExtractBizResponse< - typeof _apiClient.wallets.transactions.$get ->["data"][number] - -export type FeedModel = ExtractBizResponse["data"]["feed"] - -export type FeedAnalyticsModel = ExtractBizResponse< - typeof _apiClient.feeds.$get ->["data"]["analytics"] - -export type ListAnalyticsModel = ExtractBizResponse< - typeof _apiClient.lists.$get ->["data"]["analytics"] - -export type ListModel = Omit -export type ListModelPoplutedFeeds = ExtractBizResponse< - typeof _apiClient.lists.$get ->["data"]["list"] - -export type InboxModel = ExtractBizResponse["data"] - -export type FeedOrListRespModel = FeedModel | ListModelPoplutedFeeds | InboxModel -export type FeedOrListModel = FeedModel | ListModel | InboxModel - -export type EntryResponse = Exclude< - Extract, { code: 0 }>["data"], - undefined -> - -export type EntriesResponse = Array< - | Exclude>["data"], undefined> - | Exclude>["data"], undefined> ->[number] - -export type CombinedEntryModel = Omit & { - entries: { - content?: string | null - } - inboxes?: InboxModel - feeds?: EntriesResponse[number]["feeds"] -} -export type EntryModel = CombinedEntryModel["entries"] -export type EntryModelSimple = Exclude< - ExtractBizResponse["data"]["entries"], - undefined ->[number] -export type DiscoverResponse = Array< - Exclude["data"], undefined>[number] -> - -export type ActionsResponse = Exclude< - ExtractBizResponse["data"], - undefined ->["rules"] - -export type DataResponse = { - code: number - data?: T -} - -type Nullable = T | null | undefined -export type ActiveEntryId = Nullable - -export type SubscriptionModel = ExtractBizResponse< - typeof _apiClient.subscriptions.$get ->["data"][number] & { - unread?: number -} - -export type FeedSubscriptionModel = Extract -export type ListSubscriptionModel = Extract - -export type SupportedLanguages = z.infer - -export type RecommendationItem = ExtractBizResponse< - typeof _apiClient.discover.rsshub.$get ->["data"][string] - -export type MediaModel = Exclude< - ExtractBizResponse["data"], - undefined ->["entries"]["media"] - -type ActionRulesRes = Exclude< - Exclude["data"], undefined>["rules"], - undefined | null ->[number] - -export type ActionFilterItem = Partial< - Exclude -> -export type ActionFeedField = Exclude -export type ActionOperation = Exclude -export type ActionFilterGroup = ActionFilterItem[] -export type ActionFilter = ActionFilterGroup[] - -export type ActionModel = Omit & { - condition: ActionFilter - index: number -} -export type ActionId = Exclude -export type ActionRules = ActionModel[] - -export type ActionConditionIndex = { - ruleIndex: number - groupIndex: number - conditionIndex: number -} - -export const TransactionTypes = ["mint", "purchase", "tip", "withdraw", "airdrop"] as const - -export type WalletModel = ExtractBizResponse["data"][number] - -export type ServerConfigs = ExtractBizResponse["data"] - -export type RSSHubModel = Omit< - ExtractBizResponse["data"][number], - "userCount" -> & { - baseUrl?: string | null - accessKey?: string | null - userCount?: number -} - -type Optional = { - [K in keyof T]?: T[K] -} - -export type EntryReadHistoriesModel = Optional< - ExtractBizResponse< - (typeof _apiClient.entries)["read-histories"][":id"]["$get"] - >["data"]["entryReadHistories"] -> & { - entryId: string -} - -export type BizRespose = { - data: T - code: 0 -} diff --git a/packages/internal/shared/package.json b/packages/internal/shared/package.json index 273d78a62..da6ca554c 100644 --- a/packages/internal/shared/package.json +++ b/packages/internal/shared/package.json @@ -31,15 +31,15 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@better-auth/stripe": "1.2.9", + "@better-auth/stripe": "1.3.11", "@electron-toolkit/preload": "3.0.2", "@electron-toolkit/tsconfig": "1.0.1", - "@hono/node-server": "1.15.0", + "@follow-app/client-sdk": "catalog:", + "@folo-services/drizzle": "0.1.26", "@t3-oss/env-core": "0.13.8", "ai": "5.0.4", - "better-auth": "1.2.9", + "better-auth": "1.3.11", "drizzle-orm": "0.44.3", - "hono": "4.9.7", "sonner": "2.0.7", "stripe": "18.2.1", "zod": "3.25.75" diff --git a/packages/internal/shared/src/auth.ts b/packages/internal/shared/src/auth.ts index 49479f2ec..c03260bbb 100644 --- a/packages/internal/shared/src/auth.ts +++ b/packages/internal/shared/src/auth.ts @@ -1,11 +1,12 @@ import { stripeClient } from "@better-auth/stripe/client" import { IN_ELECTRON } from "@follow/shared" -import type { authPlugins } from "@follow/shared/hono" +import type { AuthPlugins } from "@follow-app/client-sdk/auth" import type { BetterAuthClientPlugin, BetterFetchOption } from "better-auth/client" +import { createAuthClient } from "better-auth/client" import { inferAdditionalFields, twoFactorClient } from "better-auth/client/plugins" -import { createAuthClient } from "better-auth/react" -type AuthPlugin = (typeof authPlugins)[number] +type AuthPlugin = AuthPlugins[number] + export const baseAuthPlugins = [ { id: "customGetProviders", @@ -23,12 +24,25 @@ export const baseAuthPlugins = [ id: "oneTimeToken", $InferServerPlugin: {} as Extract, }, + inferAdditionalFields({ user: { handle: { type: "string", required: false, }, + bio: { + type: "string", + required: false, + }, + website: { + type: "string", + required: false, + }, + socialLinks: { + type: "json", + required: false, + }, }, }), twoFactorClient(), @@ -40,6 +54,7 @@ export type AuthClient = Ret plugins: [...typeof baseAuthPlugins, ...ExtraPlugins] }> > + export type LoginRuntime = "browser" | "app" export class Auth { diff --git a/packages/internal/shared/src/hono.ts b/packages/internal/shared/src/hono.ts deleted file mode 100644 index 801b0049e..000000000 --- a/packages/internal/shared/src/hono.ts +++ /dev/null @@ -1,26106 +0,0 @@ -// @ts-nocheck -import { HttpBindings } from "@hono/node-server"; -import "@hono/zod-openapi"; -import * as zod110 from "zod"; -import { z as z$1 } from "zod"; -import * as better_auth771 from "better-auth"; -import { BetterAuthOptions } from "better-auth"; -import * as better_auth_plugins857 from "better-auth/plugins"; -import * as better_call87 from "better-call"; -import Stripe from "stripe"; -import * as drizzle_orm_pg_core100 from "drizzle-orm/pg-core"; -import { AnyPgColumn } from "drizzle-orm/pg-core"; -import * as drizzle_orm142 from "drizzle-orm"; -import { InferInsertModel, InferSelectModel, SQL } from "drizzle-orm"; -import * as zod_v490 from "zod/v4"; -import * as ai43 from "ai"; -import * as hono_utils_http_status0 from "hono/utils/http-status"; -import * as hono_types2 from "hono/types"; -import * as hono_hono_base42 from "hono/hono-base"; -import * as zod_v4_core91 from "zod/v4/core"; - -//#region src/types/env.d.ts -type Env = { - Bindings: HttpBindings; -}; -//#endregion -//#region src/schema/achievements.d.ts -declare const achievements: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "achievements"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "achievements"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "achievements"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: drizzle_orm_pg_core100.PgColumn<{ - name: "type"; - tableName: "achievements"; - dataType: "string"; - columnType: "PgText"; - data: "checking" | "completed" | "incomplete" | "audit" | "received"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: ["checking", "completed", "incomplete", "audit", "received"]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - actionId: drizzle_orm_pg_core100.PgColumn<{ - name: "action_id"; - tableName: "achievements"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - progress: drizzle_orm_pg_core100.PgColumn<{ - name: "progress"; - tableName: "achievements"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - progressMax: drizzle_orm_pg_core100.PgColumn<{ - name: "progress_max"; - tableName: "achievements"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - done: drizzle_orm_pg_core100.PgColumn<{ - name: "done"; - tableName: "achievements"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - doneAt: drizzle_orm_pg_core100.PgColumn<{ - name: "done_at"; - tableName: "achievements"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tx: drizzle_orm_pg_core100.PgColumn<{ - name: "tx"; - tableName: "achievements"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const achievementsOpenAPISchema: zod110.ZodObject<{ - id: zod110.ZodString; - userId: zod110.ZodString; - type: zod110.ZodEnum<["checking", "completed", "incomplete", "audit", "received"]>; - actionId: zod110.ZodNumber; - progress: zod110.ZodNumber; - progressMax: zod110.ZodNumber; - done: zod110.ZodBoolean; - doneAt: zod110.ZodNullable; - tx: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - id: string; - userId: string; - type: "checking" | "completed" | "incomplete" | "audit" | "received"; - actionId: number; - progress: number; - progressMax: number; - done: boolean; - doneAt: string | null; - tx: string | null; -}, { - id: string; - userId: string; - type: "checking" | "completed" | "incomplete" | "audit" | "received"; - actionId: number; - progress: number; - progressMax: number; - done: boolean; - doneAt: string | null; - tx: string | null; -}>; -//#endregion -//#region src/schema/actions.d.ts -declare const languageSchema: z$1.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>; -declare const conditionItemSchema: z$1.ZodObject<{ - field: z$1.ZodEnum<["view", "title", "site_url", "feed_url", "category", "entry_title", "entry_content", "entry_url", "entry_author", "entry_media_length", "entry_attachments_duration", "status"]>; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodString; -}, "strip", z$1.ZodTypeAny, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; -}, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; -}>; -type ConditionItem = z$1.infer; -declare const actions: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "actions"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "actions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "actions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updated_at"; - tableName: "actions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rules: drizzle_orm_pg_core100.PgColumn<{ - name: "rules"; - tableName: "actions"; - dataType: "json"; - columnType: "PgJsonb"; - data: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }[]; - }>; - }; - dialect: "pg"; -}>; -declare const actionsItemOpenAPISchema: z$1.ZodObject<{ - name: z$1.ZodString; - condition: z$1.ZodUnion<[z$1.ZodArray; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodString; - }, "strip", z$1.ZodTypeAny, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">, z$1.ZodArray; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodString; - }, "strip", z$1.ZodTypeAny, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">, "many">]>; - result: z$1.ZodObject<{ - disabled: z$1.ZodOptional; - translation: z$1.ZodOptional, z$1.ZodBoolean]>>; - summary: z$1.ZodOptional; - readability: z$1.ZodOptional; - sourceContent: z$1.ZodOptional; - silence: z$1.ZodOptional; - block: z$1.ZodOptional; - star: z$1.ZodOptional; - newEntryNotification: z$1.ZodOptional; - rewriteRules: z$1.ZodOptional, "many">>; - blockRules: z$1.ZodOptional; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>; - }, "strip", z$1.ZodTypeAny, { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">>; - webhooks: z$1.ZodOptional>; - }, "strip", z$1.ZodTypeAny, { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }, { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }>; -}, "strip", z$1.ZodTypeAny, { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; -}, { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; -}>; -type ActionItem = z$1.infer; -declare const actionsOpenAPISchema: z$1.ZodObject; - updatedAt: z$1.ZodNullable; - rules: z$1.ZodNullable>; -}, "rules"> & { - rules: z$1.ZodNullable; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodString; - }, "strip", z$1.ZodTypeAny, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">, z$1.ZodArray; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodString; - }, "strip", z$1.ZodTypeAny, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">, "many">]>; - result: z$1.ZodObject<{ - disabled: z$1.ZodOptional; - translation: z$1.ZodOptional, z$1.ZodBoolean]>>; - summary: z$1.ZodOptional; - readability: z$1.ZodOptional; - sourceContent: z$1.ZodOptional; - silence: z$1.ZodOptional; - block: z$1.ZodOptional; - star: z$1.ZodOptional; - newEntryNotification: z$1.ZodOptional; - rewriteRules: z$1.ZodOptional, "many">>; - blockRules: z$1.ZodOptional; - operator: z$1.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>; - }, "strip", z$1.ZodTypeAny, { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">>; - webhooks: z$1.ZodOptional>; - }, "strip", z$1.ZodTypeAny, { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }, { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }>; - }, "strip", z$1.ZodTypeAny, { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }, { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }>, "many">>>; -}, "strip", z$1.ZodTypeAny, { - createdAt: string | null; - updatedAt: string | null; - userId: string; - rules?: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }[] | null | undefined; -}, { - createdAt: string | null; - updatedAt: string | null; - userId: string; - rules?: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }[] | null | undefined; -}>; -declare const actionsRelations: drizzle_orm142.Relations<"actions", { - users: drizzle_orm142.One<"user", true>; -}>; -type ActionsModel = z$1.infer; -type SettingsModel = Exclude["result"], undefined>; -//#endregion -//#region src/schema/activities.d.ts -declare const activities: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "activities"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "activities"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - activeAt: drizzle_orm_pg_core100.PgColumn<{ - name: "active_at"; - tableName: "activities"; - dataType: "date"; - columnType: "PgDate"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - platform: drizzle_orm_pg_core100.PgColumn<{ - name: "platform"; - tableName: "activities"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - version: drizzle_orm_pg_core100.PgColumn<{ - name: "version"; - tableName: "activities"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const activitiesOpenAPISchema: zod110.ZodObject<{ - userId: zod110.ZodString; - activeAt: zod110.ZodString; - platform: zod110.ZodString; - version: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - userId: string; - activeAt: string; - platform: string; - version: string | null; -}, { - userId: string; - activeAt: string; - platform: string; - version: string | null; -}>; -//#endregion -//#region src/schema/airdrops.d.ts -declare const detailModelSchema: z$1.ZodNullable>; -type DetailModel = z$1.infer; -declare const activityEnum: readonly ["public_beta"]; -type AirdropActivity = typeof activityEnum[number]; -declare const airdrops: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "airdrops"; - schema: undefined; - columns: { - activity: drizzle_orm_pg_core100.PgColumn<{ - name: "activity"; - tableName: "airdrops"; - dataType: "string"; - columnType: "PgText"; - data: "public_beta"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: ["public_beta"]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "airdrops"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - amount: drizzle_orm_pg_core100.PgColumn<{ - name: "amount"; - tableName: "airdrops"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rank: drizzle_orm_pg_core100.PgColumn<{ - name: "rank"; - tableName: "airdrops"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - detail: drizzle_orm_pg_core100.PgColumn<{ - name: "detail"; - tableName: "airdrops"; - dataType: "json"; - columnType: "PgJsonb"; - data: { - "Invitations count": number; - "Purchase lists cost": number; - "Total tip amount": number; - "Feeds subscriptions count": number; - "Lists subscriptions count": number; - "Inbox subscriptions count": number; - "Recent read count in the last month": number; - "Mint count": number; - "Claimed feeds count": number; - "Claimed feeds subscriptions count": number; - "Lists with more than 1 feed count": number; - "Created lists subscriptions count": number; - "Created lists income amount": number; - "GitHub Community Contributions": number; - "Invitations count Rank": number; - "Purchase lists cost Rank": number; - "Total tip amount Rank": number; - "Feeds subscriptions count Rank": number; - "Lists subscriptions count Rank": number; - "Inbox subscriptions count Rank": number; - "Recent read count in the last month Rank": number; - "Mint count Rank": number; - "Claimed feeds count Rank": number; - "Claimed feeds subscriptions count Rank": number; - "Lists with more than 1 feed count Rank": number; - "Created lists subscriptions count Rank": number; - "Created lists income amount Rank": number; - "GitHub Community Contributions Rank": number; - } | null; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: { - "Invitations count": number; - "Purchase lists cost": number; - "Total tip amount": number; - "Feeds subscriptions count": number; - "Lists subscriptions count": number; - "Inbox subscriptions count": number; - "Recent read count in the last month": number; - "Mint count": number; - "Claimed feeds count": number; - "Claimed feeds subscriptions count": number; - "Lists with more than 1 feed count": number; - "Created lists subscriptions count": number; - "Created lists income amount": number; - "GitHub Community Contributions": number; - "Invitations count Rank": number; - "Purchase lists cost Rank": number; - "Total tip amount Rank": number; - "Feeds subscriptions count Rank": number; - "Lists subscriptions count Rank": number; - "Inbox subscriptions count Rank": number; - "Recent read count in the last month Rank": number; - "Mint count Rank": number; - "Claimed feeds count Rank": number; - "Claimed feeds subscriptions count Rank": number; - "Lists with more than 1 feed count Rank": number; - "Created lists subscriptions count Rank": number; - "Created lists income amount Rank": number; - "GitHub Community Contributions Rank": number; - } | null; - }>; - verify: drizzle_orm_pg_core100.PgColumn<{ - name: "verify"; - tableName: "airdrops"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tx: drizzle_orm_pg_core100.PgColumn<{ - name: "tx"; - tableName: "airdrops"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const airdropsOpenAPISchema: z$1.ZodObject; - userId: z$1.ZodString; - amount: z$1.ZodString; - rank: z$1.ZodNullable; - detail: z$1.ZodNullable>; - verify: z$1.ZodNullable; - tx: z$1.ZodNullable; -}, "detail"> & { - detail: z$1.ZodNullable>; -}, "strip", z$1.ZodTypeAny, { - userId: string; - tx: string | null; - activity: "public_beta"; - amount: string; - rank: string | null; - detail: { - "Invitations count": number; - "Purchase lists cost": number; - "Total tip amount": number; - "Feeds subscriptions count": number; - "Lists subscriptions count": number; - "Inbox subscriptions count": number; - "Recent read count in the last month": number; - "Mint count": number; - "Claimed feeds count": number; - "Claimed feeds subscriptions count": number; - "Lists with more than 1 feed count": number; - "Created lists subscriptions count": number; - "Created lists income amount": number; - "GitHub Community Contributions": number; - "Invitations count Rank": number; - "Purchase lists cost Rank": number; - "Total tip amount Rank": number; - "Feeds subscriptions count Rank": number; - "Lists subscriptions count Rank": number; - "Inbox subscriptions count Rank": number; - "Recent read count in the last month Rank": number; - "Mint count Rank": number; - "Claimed feeds count Rank": number; - "Claimed feeds subscriptions count Rank": number; - "Lists with more than 1 feed count Rank": number; - "Created lists subscriptions count Rank": number; - "Created lists income amount Rank": number; - "GitHub Community Contributions Rank": number; - } | null; - verify: string | null; -}, { - userId: string; - tx: string | null; - activity: "public_beta"; - amount: string; - rank: string | null; - detail: { - "Invitations count": number; - "Purchase lists cost": number; - "Total tip amount": number; - "Feeds subscriptions count": number; - "Lists subscriptions count": number; - "Inbox subscriptions count": number; - "Recent read count in the last month": number; - "Mint count": number; - "Claimed feeds count": number; - "Claimed feeds subscriptions count": number; - "Lists with more than 1 feed count": number; - "Created lists subscriptions count": number; - "Created lists income amount": number; - "GitHub Community Contributions": number; - "Invitations count Rank": number; - "Purchase lists cost Rank": number; - "Total tip amount Rank": number; - "Feeds subscriptions count Rank": number; - "Lists subscriptions count Rank": number; - "Inbox subscriptions count Rank": number; - "Recent read count in the last month Rank": number; - "Mint count Rank": number; - "Claimed feeds count Rank": number; - "Claimed feeds subscriptions count Rank": number; - "Lists with more than 1 feed count Rank": number; - "Created lists subscriptions count Rank": number; - "Created lists income amount Rank": number; - "GitHub Community Contributions Rank": number; - } | null; - verify: string | null; -}>; -//#endregion -//#region src/schema/captcha.d.ts -declare const captcha: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "captcha"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "captcha"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - failedCount: drizzle_orm_pg_core100.PgColumn<{ - name: "failed_count"; - tableName: "captcha"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - passedCount: drizzle_orm_pg_core100.PgColumn<{ - name: "passed_count"; - tableName: "captcha"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -//#endregion -//#region src/schema/collections.d.ts -declare const collections: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "collections"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "collections"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_id"; - tableName: "collections"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - entryId: drizzle_orm_pg_core100.PgColumn<{ - name: "entry_id"; - tableName: "collections"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "collections"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "collections"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const collectionsOpenAPISchema: zod110.ZodObject<{ - userId: zod110.ZodString; - feedId: zod110.ZodString; - entryId: zod110.ZodString; - createdAt: zod110.ZodString; - view: zod110.ZodNumber; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - createdAt: string; - userId: string; - view: number; - feedId: string; - entryId: string; -}, { - createdAt: string; - userId: string; - view: number; - feedId: string; - entryId: string; -}>; -declare const collectionsRelations: drizzle_orm142.Relations<"collections", { - users: drizzle_orm142.One<"user", true>; - entries: drizzle_orm142.One<"entries", true>; - feeds: drizzle_orm142.One<"feeds", true>; -}>; -//#endregion -//#region src/schema/entries.d.ts -type MediaModel = { - url: string; - type: "photo" | "video"; - preview_image_url?: string; - width?: number; - height?: number; - blurhash?: string; -}; -type AttachmentsModel = { - url: string; - duration_in_seconds?: number | string; - mime_type?: string; - size_in_bytes?: number; - title?: string; -}; -type ExtraModel = { - links?: { - url: string; - type: string; - content_html?: string; - }[]; - title_keyword?: string -}; -declare const CommonEntryFields: { - id: drizzle_orm142.HasRuntimeDefault>>>>; - title: drizzle_orm_pg_core100.PgTextBuilderInitial<"title", [string, ...string[]]>; - url: drizzle_orm_pg_core100.PgTextBuilderInitial<"url", [string, ...string[]]>; - content: drizzle_orm_pg_core100.PgTextBuilderInitial<"content", [string, ...string[]]>; - description: drizzle_orm_pg_core100.PgTextBuilderInitial<"description", [string, ...string[]]>; - guid: drizzle_orm142.NotNull>; - author: drizzle_orm_pg_core100.PgTextBuilderInitial<"author", [string, ...string[]]>; - authorUrl: drizzle_orm_pg_core100.PgTextBuilderInitial<"author_url", [string, ...string[]]>; - authorAvatar: drizzle_orm_pg_core100.PgTextBuilderInitial<"author_avatar", [string, ...string[]]>; - insertedAt: drizzle_orm142.NotNull>; - publishedAt: drizzle_orm142.NotNull>; - media: drizzle_orm142.$Type, MediaModel[]>; - categories: drizzle_orm_pg_core100.PgArrayBuilder<{ - name: "categories"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - enumValues: [string, ...string[]]; - size: undefined; - baseBuilder: { - name: "categories"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }; - }, { - name: "categories"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }>; - attachments: drizzle_orm142.$Type, AttachmentsModel[]>; - extra: drizzle_orm142.$Type, ExtraModel>; - language: drizzle_orm_pg_core100.PgTextBuilderInitial<"language", [string, ...string[]]>; -}; -declare const entries: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "entries"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - url: drizzle_orm_pg_core100.PgColumn<{ - name: "url"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - content: drizzle_orm_pg_core100.PgColumn<{ - name: "content"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core100.PgColumn<{ - name: "description"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - guid: drizzle_orm_pg_core100.PgColumn<{ - name: "guid"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - author: drizzle_orm_pg_core100.PgColumn<{ - name: "author"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - authorUrl: drizzle_orm_pg_core100.PgColumn<{ - name: "author_url"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - authorAvatar: drizzle_orm_pg_core100.PgColumn<{ - name: "author_avatar"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - insertedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "inserted_at"; - tableName: "entries"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "published_at"; - tableName: "entries"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - media: drizzle_orm_pg_core100.PgColumn<{ - name: "media"; - tableName: "entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: MediaModel[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: MediaModel[]; - }>; - categories: drizzle_orm_pg_core100.PgColumn<{ - name: "categories"; - tableName: "entries"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: drizzle_orm142.Column<{ - name: "categories"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - identity: undefined; - generated: undefined; - }, {}, { - baseBuilder: drizzle_orm_pg_core100.PgColumnBuilder<{ - name: "categories"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }, {}, {}, drizzle_orm142.ColumnBuilderExtraConfig>; - size: undefined; - }>; - attachments: drizzle_orm_pg_core100.PgColumn<{ - name: "attachments"; - tableName: "entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: AttachmentsModel[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: AttachmentsModel[]; - }>; - extra: drizzle_orm_pg_core100.PgColumn<{ - name: "extra"; - tableName: "entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: ExtraModel; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: ExtraModel; - }>; - language: drizzle_orm_pg_core100.PgColumn<{ - name: "language"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_id"; - tableName: "entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const attachmentsZodSchema: z$1.ZodNullable>; - mime_type: z$1.ZodOptional; - size_in_bytes: z$1.ZodOptional; - title: z$1.ZodOptional; -}, "strip", z$1.ZodTypeAny, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; -}, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; -}>, "many">>>; -declare const mediaZodSchema: z$1.ZodNullable; - width: z$1.ZodOptional; - height: z$1.ZodOptional; - preview_image_url: z$1.ZodOptional; - blurhash: z$1.ZodOptional; -}, "strip", z$1.ZodTypeAny, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; -}, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; -}>, "many">>>; -declare const extraZodSchema: z$1.ZodNullable; - }, "strip", z$1.ZodTypeAny, { - type: string; - url: string; - content_html?: string | undefined; - }, { - type: string; - url: string; - content_html?: string | undefined; - }>, "many">>>; -}, "strip", z$1.ZodTypeAny, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; -}, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; -}>>>; -declare const entriesOpenAPISchema: z$1.ZodObject; - url: z$1.ZodNullable; - content: z$1.ZodNullable; - description: z$1.ZodNullable; - guid: z$1.ZodString; - author: z$1.ZodNullable; - authorUrl: z$1.ZodNullable; - authorAvatar: z$1.ZodNullable; - insertedAt: z$1.ZodString; - publishedAt: z$1.ZodString; - media: z$1.ZodNullable>; - categories: z$1.ZodNullable>; - attachments: z$1.ZodNullable>; - extra: z$1.ZodNullable>; - language: z$1.ZodNullable; - feedId: z$1.ZodString; -}, "media" | "attachments" | "extra"> & { - attachments: z$1.ZodNullable>; - mime_type: z$1.ZodOptional; - size_in_bytes: z$1.ZodOptional; - title: z$1.ZodOptional; - }, "strip", z$1.ZodTypeAny, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }>, "many">>>; - media: z$1.ZodNullable; - width: z$1.ZodOptional; - height: z$1.ZodOptional; - preview_image_url: z$1.ZodOptional; - blurhash: z$1.ZodOptional; - }, "strip", z$1.ZodTypeAny, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }>, "many">>>; - extra: z$1.ZodNullable; - }, "strip", z$1.ZodTypeAny, { - type: string; - url: string; - content_html?: string | undefined; - }, { - type: string; - url: string; - content_html?: string | undefined; - }>, "many">>>; - }, "strip", z$1.ZodTypeAny, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - }, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - }>>>; -}, "strip", z$1.ZodTypeAny, { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - feedId: string; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; -}, { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - feedId: string; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; -}>; -declare const entriesRelations: drizzle_orm142.Relations<"entries", { - feeds: drizzle_orm142.One<"feeds", true>; - collections: drizzle_orm142.Many<"collections">; - feedPowerTokens: drizzle_orm142.One<"feedPowerTokens", true>; -}>; -type EntriesModel = InferInsertModel & { - attachments?: AttachmentsModel[] | null; - media?: MediaModel[] | null; -}; -declare const urlReads: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "urlReads"; - schema: undefined; - columns: { - url: drizzle_orm_pg_core100.PgColumn<{ - name: "url"; - tableName: "urlReads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userIds: drizzle_orm_pg_core100.PgColumn<{ - name: "user_ids"; - tableName: "urlReads"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: drizzle_orm142.Column<{ - name: "user_ids"; - tableName: "urlReads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - identity: undefined; - generated: undefined; - }, {}, { - baseBuilder: drizzle_orm_pg_core100.PgColumnBuilder<{ - name: "user_ids"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }, {}, {}, drizzle_orm142.ColumnBuilderExtraConfig>; - size: undefined; - }>; - count: drizzle_orm_pg_core100.PgColumn<{ - name: "count"; - tableName: "urlReads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -type UrlReadsModel = InferInsertModel; -declare const urlReadsOpenAPISchema: z$1.ZodObject<{ - url: z$1.ZodString; - userIds: z$1.ZodArray; - count: z$1.ZodNumber; -}, z$1.UnknownKeysParam, z$1.ZodTypeAny, { - url: string; - userIds: string[]; - count: number; -}, { - url: string; - userIds: string[]; - count: number; -}>; -//#endregion -//#region src/schema/feature-flags.d.ts -declare const FEATURE_NAMES: readonly ["ai_chat"]; -type FeatureName = typeof FEATURE_NAMES[number]; -declare const featureFlags: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "feature_flags"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "feature_flags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: drizzle_orm_pg_core100.PgColumn<{ - name: "name"; - tableName: "feature_flags"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 100; - }>; - description: drizzle_orm_pg_core100.PgColumn<{ - name: "description"; - tableName: "feature_flags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - enabled: drizzle_orm_pg_core100.PgColumn<{ - name: "enabled"; - tableName: "feature_flags"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rolloutType: drizzle_orm_pg_core100.PgColumn<{ - name: "rollout_type"; - tableName: "feature_flags"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 20; - }>; - rolloutValue: drizzle_orm_pg_core100.PgColumn<{ - name: "rollout_value"; - tableName: "feature_flags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rolloutPercentage: drizzle_orm_pg_core100.PgColumn<{ - name: "rollout_percentage"; - tableName: "feature_flags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rolloutSeed: drizzle_orm_pg_core100.PgColumn<{ - name: "rollout_seed"; - tableName: "feature_flags"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 50; - }>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "feature_flags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updated_at"; - tableName: "feature_flags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const userFeatureOverrides: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "user_feature_overrides"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "user_feature_overrides"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "user_feature_overrides"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 50; - }>; - featureName: drizzle_orm_pg_core100.PgColumn<{ - name: "feature_name"; - tableName: "user_feature_overrides"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 100; - }>; - forceEnabled: drizzle_orm_pg_core100.PgColumn<{ - name: "force_enabled"; - tableName: "user_feature_overrides"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reason: drizzle_orm_pg_core100.PgColumn<{ - name: "reason"; - tableName: "user_feature_overrides"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 50; - }>; - expiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "expires_at"; - tableName: "user_feature_overrides"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "user_feature_overrides"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdBy: drizzle_orm_pg_core100.PgColumn<{ - name: "created_by"; - tableName: "user_feature_overrides"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 50; - }>; - }; - dialect: "pg"; -}>; -type FeatureFlagModel = typeof featureFlags.$inferSelect; -type FeatureFlagInsertModel = typeof featureFlags.$inferInsert; -type UserFeatureOverrideModel = typeof userFeatureOverrides.$inferSelect; -type UserFeatureOverrideInsertModel = typeof userFeatureOverrides.$inferInsert; -declare const ROLLOUT_TYPES: readonly ["whitelist", "percentage"]; -type RolloutType = typeof ROLLOUT_TYPES[number]; -type RolloutValue = 0 | 1; -//#endregion -//#region src/schema/feeds/analytics.d.ts -declare const feedAnalytics: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "feed_analytics"; - schema: undefined; - columns: { - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_id"; - tableName: "feed_analytics"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatesPerWeek: drizzle_orm_pg_core100.PgColumn<{ - name: "updates_per_week"; - tableName: "feed_analytics"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - subscriptionCount: drizzle_orm_pg_core100.PgColumn<{ - name: "subscription_count"; - tableName: "feed_analytics"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - latestEntryPublishedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "latest_entry_published_at"; - tableName: "feed_analytics"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "feed_analytics"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const feedAnalyticsOpenAPISchema: zod110.ZodObject<{ - feedId: zod110.ZodString; - updatesPerWeek: zod110.ZodNullable; - subscriptionCount: zod110.ZodNullable; - latestEntryPublishedAt: zod110.ZodNullable; - view: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - view: number | null; - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: string | null; -}, { - view: number | null; - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: string | null; -}>; -declare const feedAnalyticsRelations: drizzle_orm142.Relations<"feed_analytics", { - feed: drizzle_orm142.One<"feeds", true>; -}>; -//#endregion -//#region src/schema/feeds/feeds.d.ts -declare const feeds: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "feeds"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - url: drizzle_orm_pg_core100.PgColumn<{ - name: "url"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core100.PgColumn<{ - name: "description"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - siteUrl: drizzle_orm_pg_core100.PgColumn<{ - name: "site_url"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - image: drizzle_orm_pg_core100.PgColumn<{ - name: "image"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - checkedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "checked_at"; - tableName: "feeds"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastModifiedHeader: drizzle_orm_pg_core100.PgColumn<{ - name: "last_modified_header"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - etagHeader: drizzle_orm_pg_core100.PgColumn<{ - name: "etag_header"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ttl: drizzle_orm_pg_core100.PgColumn<{ - name: "ttl"; - tableName: "feeds"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - errorMessage: drizzle_orm_pg_core100.PgColumn<{ - name: "error_message"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - errorAt: drizzle_orm_pg_core100.PgColumn<{ - name: "error_at"; - tableName: "feeds"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ownerUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "owner_user_id"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - language: drizzle_orm_pg_core100.PgColumn<{ - name: "language"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - migrateTo: drizzle_orm_pg_core100.PgColumn<{ - name: "migrate_to"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rsshubRoute: drizzle_orm_pg_core100.PgColumn<{ - name: "rsshub_route"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rsshubNamespace: drizzle_orm_pg_core100.PgColumn<{ - name: "rsshub_namespace"; - tableName: "feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - nsfw: drizzle_orm_pg_core100.PgColumn<{ - name: "nsfw"; - tableName: "feeds"; - 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"; -}>; -declare const feedsOpenAPISchema: zod110.ZodObject<{ - id: zod110.ZodString; - url: zod110.ZodString; - title: zod110.ZodNullable; - description: zod110.ZodNullable; - siteUrl: zod110.ZodNullable; - image: zod110.ZodNullable; - checkedAt: zod110.ZodString; - lastModifiedHeader: zod110.ZodNullable; - etagHeader: zod110.ZodNullable; - ttl: zod110.ZodNullable; - errorMessage: zod110.ZodNullable; - errorAt: zod110.ZodNullable; - ownerUserId: zod110.ZodNullable; - language: zod110.ZodNullable; - migrateTo: zod110.ZodNullable; - rsshubRoute: zod110.ZodNullable; - rsshubNamespace: zod110.ZodNullable; - nsfw: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - id: string; - image: string | null; - description: string | null; - title: string | null; - url: string; - siteUrl: string | null; - checkedAt: string; - lastModifiedHeader: string | null; - etagHeader: string | null; - ttl: number | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string | null; - language: string | null; - migrateTo: string | null; - rsshubRoute: string | null; - rsshubNamespace: string | null; - nsfw: boolean | null; -}, { - id: string; - image: string | null; - description: string | null; - title: string | null; - url: string; - siteUrl: string | null; - checkedAt: string; - lastModifiedHeader: string | null; - etagHeader: string | null; - ttl: number | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string | null; - language: string | null; - migrateTo: string | null; - rsshubRoute: string | null; - rsshubNamespace: string | null; - nsfw: boolean | null; -}>; -declare const feedsRelations: drizzle_orm142.Relations<"feeds", { - subscriptions: drizzle_orm142.Many<"subscriptions">; - entries: drizzle_orm142.Many<"entries">; - owner: drizzle_orm142.One<"user", false>; - migrateTo: drizzle_orm142.One<"feeds", false>; - trendingFeeds: drizzle_orm142.Many<"trendings_feeds">; -}>; -type FeedModel = InferInsertModel; -//#endregion -//#region src/schema/feeds/subscriptions.d.ts -declare const subscriptions: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "subscriptions"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_id"; - tableName: "subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "subscriptions"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - category: drizzle_orm_pg_core100.PgColumn<{ - name: "category"; - tableName: "subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isPrivate: drizzle_orm_pg_core100.PgColumn<{ - name: "is_private"; - tableName: "subscriptions"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const subscriptionsOpenAPISchema: zod110.ZodObject<{ - userId: zod110.ZodString; - feedId: zod110.ZodString; - view: zod110.ZodNumber; - category: zod110.ZodNullable; - title: zod110.ZodNullable; - createdAt: zod110.ZodString; - isPrivate: zod110.ZodBoolean; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - createdAt: string; - userId: string; - title: string | null; - view: number; - category: string | null; - feedId: string; - isPrivate: boolean; -}, { - createdAt: string; - userId: string; - title: string | null; - view: number; - category: string | null; - feedId: string; - isPrivate: boolean; -}>; -declare const subscriptionsRelations: drizzle_orm142.Relations<"subscriptions", { - users: drizzle_orm142.One<"user", true>; - feeds: drizzle_orm142.One<"feeds", true>; - timeline: drizzle_orm142.Many<"timeline">; - rsshubUsage: drizzle_orm142.One<"rsshub_usage", true>; -}>; -//#endregion -//#region src/schema/inboxes/entries.d.ts -declare const inboxesEntries: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "inboxes_entries"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - url: drizzle_orm_pg_core100.PgColumn<{ - name: "url"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - content: drizzle_orm_pg_core100.PgColumn<{ - name: "content"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core100.PgColumn<{ - name: "description"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - guid: drizzle_orm_pg_core100.PgColumn<{ - name: "guid"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - author: drizzle_orm_pg_core100.PgColumn<{ - name: "author"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - authorUrl: drizzle_orm_pg_core100.PgColumn<{ - name: "author_url"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - authorAvatar: drizzle_orm_pg_core100.PgColumn<{ - name: "author_avatar"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - insertedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "inserted_at"; - tableName: "inboxes_entries"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "published_at"; - tableName: "inboxes_entries"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - media: drizzle_orm_pg_core100.PgColumn<{ - name: "media"; - tableName: "inboxes_entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: MediaModel[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: MediaModel[]; - }>; - categories: drizzle_orm_pg_core100.PgColumn<{ - name: "categories"; - tableName: "inboxes_entries"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: drizzle_orm142.Column<{ - name: "categories"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - identity: undefined; - generated: undefined; - }, {}, { - baseBuilder: drizzle_orm_pg_core100.PgColumnBuilder<{ - name: "categories"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }, {}, {}, drizzle_orm142.ColumnBuilderExtraConfig>; - size: undefined; - }>; - attachments: drizzle_orm_pg_core100.PgColumn<{ - name: "attachments"; - tableName: "inboxes_entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: AttachmentsModel[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: AttachmentsModel[]; - }>; - extra: drizzle_orm_pg_core100.PgColumn<{ - name: "extra"; - tableName: "inboxes_entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: ExtraModel; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: ExtraModel; - }>; - language: drizzle_orm_pg_core100.PgColumn<{ - name: "language"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inboxHandle: drizzle_orm_pg_core100.PgColumn<{ - name: "inbox_handle"; - tableName: "inboxes_entries"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - read: drizzle_orm_pg_core100.PgColumn<{ - name: "read"; - tableName: "inboxes_entries"; - 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"; -}>; -declare const inboxesEntriesOpenAPISchema: z$1.ZodObject; - url: z$1.ZodNullable; - content: z$1.ZodNullable; - description: z$1.ZodNullable; - guid: z$1.ZodString; - author: z$1.ZodNullable; - authorUrl: z$1.ZodNullable; - authorAvatar: z$1.ZodNullable; - insertedAt: z$1.ZodString; - publishedAt: z$1.ZodString; - media: z$1.ZodNullable>; - categories: z$1.ZodNullable>; - attachments: z$1.ZodNullable>; - extra: z$1.ZodNullable>; - language: z$1.ZodNullable; - inboxHandle: z$1.ZodString; - read: z$1.ZodNullable; -}, "media" | "attachments" | "extra"> & { - attachments: z$1.ZodNullable>; - mime_type: z$1.ZodOptional; - size_in_bytes: z$1.ZodOptional; - title: z$1.ZodOptional; - }, "strip", z$1.ZodTypeAny, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }>, "many">>>; - media: z$1.ZodNullable; - width: z$1.ZodOptional; - height: z$1.ZodOptional; - preview_image_url: z$1.ZodOptional; - blurhash: z$1.ZodOptional; - }, "strip", z$1.ZodTypeAny, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }>, "many">>>; - extra: z$1.ZodNullable; - }, "strip", z$1.ZodTypeAny, { - type: string; - url: string; - content_html?: string | undefined; - }, { - type: string; - url: string; - content_html?: string | undefined; - }>, "many">>>; - }, "strip", z$1.ZodTypeAny, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - }, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - }>>>; -}, "strip", z$1.ZodTypeAny, { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - read: boolean | null; - inboxHandle: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; -}, { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - read: boolean | null; - inboxHandle: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; -}>; -declare const inboxesEntriesInsertOpenAPISchema: z$1.ZodObject; - description: z$1.ZodOptional>; - title: z$1.ZodOptional>; - content: z$1.ZodOptional>; - author: z$1.ZodOptional>; - url: z$1.ZodOptional>; - language: z$1.ZodOptional>; - guid: z$1.ZodString; - media: z$1.ZodOptional>>; - categories: z$1.ZodOptional>>; - attachments: z$1.ZodOptional>>; - extra: z$1.ZodOptional>>; - authorUrl: z$1.ZodOptional>; - authorAvatar: z$1.ZodOptional>; - insertedAt: z$1.ZodString; - publishedAt: z$1.ZodString; - read: z$1.ZodOptional>; - inboxHandle: z$1.ZodString; -}, "id" | "media" | "attachments" | "extra" | "insertedAt" | "publishedAt" | "inboxHandle"> & { - attachments: z$1.ZodNullable>; - mime_type: z$1.ZodOptional; - size_in_bytes: z$1.ZodOptional; - title: z$1.ZodOptional; - }, "strip", z$1.ZodTypeAny, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }, { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }>, "many">>>; - media: z$1.ZodNullable; - width: z$1.ZodOptional; - height: z$1.ZodOptional; - preview_image_url: z$1.ZodOptional; - blurhash: z$1.ZodOptional; - }, "strip", z$1.ZodTypeAny, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }, { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }>, "many">>>; - extra: z$1.ZodNullable; - }, "strip", z$1.ZodTypeAny, { - type: string; - url: string; - content_html?: string | undefined; - }, { - type: string; - url: string; - content_html?: string | undefined; - }>, "many">>>; - }, "strip", z$1.ZodTypeAny, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - }, { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - }>>>; - publishedAt: z$1.ZodString; -}, "strip", z$1.ZodTypeAny, { - guid: string; - publishedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - content?: string | null | undefined; - author?: string | null | undefined; - url?: string | null | undefined; - language?: string | null | undefined; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - categories?: string[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - authorUrl?: string | null | undefined; - authorAvatar?: string | null | undefined; - read?: boolean | null | undefined; -}, { - guid: string; - publishedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - content?: string | null | undefined; - author?: string | null | undefined; - url?: string | null | undefined; - language?: string | null | undefined; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - categories?: string[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - authorUrl?: string | null | undefined; - authorAvatar?: string | null | undefined; - read?: boolean | null | undefined; -}>; -declare const inboxesEntriesRelations: drizzle_orm142.Relations<"inboxes_entries", { - inboxes: drizzle_orm142.One<"inboxes", true>; -}>; -type inboxesEntriesModel = InferInsertModel & { - attachments?: AttachmentsModel[] | null; - media?: MediaModel[] | null; -}; -//#endregion -//#region src/schema/inboxes/inboxes.d.ts -declare const inboxes: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "inboxes"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "inboxes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - handle: drizzle_orm_pg_core100.PgColumn<{ - name: "handle"; - tableName: "inboxes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - secret: drizzle_orm_pg_core100.PgColumn<{ - name: "secret"; - tableName: "inboxes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "inboxes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const inboxesOpenAPISchema: z$1.ZodObject<{ - userId: z$1.ZodString; - handle: z$1.ZodString; - secret: z$1.ZodString; - title: z$1.ZodNullable; -}, z$1.UnknownKeysParam, z$1.ZodTypeAny, { - handle: string; - userId: string; - title: string | null; - secret: string; -}, { - handle: string; - userId: string; - title: string | null; - secret: string; -}>; -declare const inboxesRelations: drizzle_orm142.Relations<"inboxes", { - users: drizzle_orm142.One<"user", true>; - entries: drizzle_orm142.Many<"inboxes_entries">; -}>; -declare const inboxHandleSchema: z$1.ZodString; -//#endregion -//#region src/schema/invitations.d.ts -declare const invitations: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "invitations"; - schema: undefined; - columns: { - code: drizzle_orm_pg_core100.PgColumn<{ - name: "code"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "invitations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - usedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "used_at"; - tableName: "invitations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fromUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "from_user_id"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "to_user_id"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const invitationsOpenAPISchema: zod110.ZodObject<{ - code: zod110.ZodString; - createdAt: zod110.ZodNullable; - usedAt: zod110.ZodNullable; - fromUserId: zod110.ZodString; - toUserId: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - code: string; - createdAt: string | null; - usedAt: string | null; - fromUserId: string; - toUserId: string | null; -}, { - code: string; - createdAt: string | null; - usedAt: string | null; - fromUserId: string; - toUserId: string | null; -}>; -type InvitationDB = typeof invitations.$inferSelect; -declare const invitationsRelations: drizzle_orm142.Relations<"invitations", { - users: drizzle_orm142.One<"user", false>; -}>; -//#endregion -//#region src/schema/lists/analytics.d.ts -declare const listAnalytics: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "list_analytics"; - schema: undefined; - columns: { - listId: drizzle_orm_pg_core100.PgColumn<{ - name: "list_id"; - tableName: "list_analytics"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - subscriptionCount: drizzle_orm_pg_core100.PgColumn<{ - name: "subscription_count"; - tableName: "list_analytics"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const listAnalyticsOpenAPISchema: zod110.ZodObject<{ - listId: zod110.ZodString; - subscriptionCount: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - subscriptionCount: number | null; - listId: string; -}, { - subscriptionCount: number | null; - listId: string; -}>; -declare const listAnalyticsRelations: drizzle_orm142.Relations<"list_analytics", { - list: drizzle_orm142.One<"lists", true>; -}>; -//#endregion -//#region src/schema/lists/lists.d.ts -declare const lists: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "lists"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - feedIds: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_ids"; - tableName: "lists"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: drizzle_orm142.Column<{ - name: "feed_ids"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - identity: undefined; - generated: undefined; - }, {}, { - baseBuilder: drizzle_orm_pg_core100.PgColumnBuilder<{ - name: "feed_ids"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }, {}, {}, drizzle_orm142.ColumnBuilderExtraConfig>; - size: undefined; - }>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core100.PgColumn<{ - name: "description"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - image: drizzle_orm_pg_core100.PgColumn<{ - name: "image"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "lists"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fee: drizzle_orm_pg_core100.PgColumn<{ - name: "fee"; - tableName: "lists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - language: drizzle_orm_pg_core100.PgColumn<{ - name: "language"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ownerUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "owner_user_id"; - tableName: "lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "lists"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updated_at"; - tableName: "lists"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const listsOpenAPISchema: zod110.ZodObject<{ - id: zod110.ZodString; - feedIds: zod110.ZodArray; - title: zod110.ZodString; - description: zod110.ZodNullable; - image: zod110.ZodNullable; - view: zod110.ZodNumber; - fee: zod110.ZodNumber; - language: zod110.ZodNullable; - ownerUserId: zod110.ZodString; - createdAt: zod110.ZodNullable; - updatedAt: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - id: string; - image: string | null; - createdAt: string | null; - updatedAt: string | null; - description: string | null; - title: string; - view: number; - ownerUserId: string; - language: string | null; - feedIds: string[]; - fee: number; -}, { - id: string; - image: string | null; - createdAt: string | null; - updatedAt: string | null; - description: string | null; - title: string; - view: number; - ownerUserId: string; - language: string | null; - feedIds: string[]; - fee: number; -}>; -declare const listsRelations: drizzle_orm142.Relations<"lists", { - owner: drizzle_orm142.One<"user", true>; - listsSubscriptions: drizzle_orm142.Many<"lists_subscriptions">; -}>; -type ListModel = InferInsertModel; -//#endregion -//#region src/schema/lists/subscriptions.d.ts -declare const listsSubscriptions: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "lists_subscriptions"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "lists_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - listId: drizzle_orm_pg_core100.PgColumn<{ - name: "list_id"; - tableName: "lists_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "lists_subscriptions"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core100.PgColumn<{ - name: "title"; - tableName: "lists_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "lists_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isPrivate: drizzle_orm_pg_core100.PgColumn<{ - name: "is_private"; - tableName: "lists_subscriptions"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const listsSubscriptionsOpenAPISchema: zod110.ZodObject<{ - userId: zod110.ZodString; - listId: zod110.ZodString; - view: zod110.ZodNumber; - title: zod110.ZodNullable; - createdAt: zod110.ZodString; - isPrivate: zod110.ZodBoolean; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - createdAt: string; - userId: string; - title: string | null; - view: number; - isPrivate: boolean; - listId: string; -}, { - createdAt: string; - userId: string; - title: string | null; - view: number; - isPrivate: boolean; - listId: string; -}>; -declare const listsSubscriptionsRelations: drizzle_orm142.Relations<"lists_subscriptions", { - users: drizzle_orm142.One<"user", true>; - lists: drizzle_orm142.One<"lists", true>; -}>; -//#endregion -//#region src/schema/messaging.d.ts -declare const messaging: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "messaging"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "messaging"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - token: drizzle_orm_pg_core100.PgColumn<{ - name: "token"; - tableName: "messaging"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - channel: drizzle_orm_pg_core100.PgColumn<{ - name: "channel"; - tableName: "messaging"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const messagingOpenAPISchema: z$1.ZodObject; - token: z$1.ZodString; - channel: z$1.ZodString; -}, "channel"> & { - channel: z$1.ZodEnum<["macos", "windows", "linux", "ios", "android", "web", "desktop"]>; -}, "strip", z$1.ZodTypeAny, { - userId: string | null; - token: string; - channel: "macos" | "windows" | "linux" | "ios" | "android" | "web" | "desktop"; -}, { - userId: string | null; - token: string; - channel: "macos" | "windows" | "linux" | "ios" | "android" | "web" | "desktop"; -}>; -declare const messagingRelations: drizzle_orm142.Relations<"messaging", { - users: drizzle_orm142.One<"user", false>; -}>; -declare enum MessagingType { - NewEntry = "new-entry", -} -type MessagingData = { - type: MessagingType.NewEntry; - feedId: string; - entryId: string; - view: string; - title: string; - description: string; -}; -//#endregion -//#region src/schema/readability.d.ts -declare const readabilities: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "readabilities"; - schema: undefined; - columns: { - entryId: drizzle_orm_pg_core100.PgColumn<{ - name: "entry_id"; - tableName: "readabilities"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - content: drizzle_orm_pg_core100.PgColumn<{ - name: "content"; - tableName: "readabilities"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updated_at"; - tableName: "readabilities"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -//#endregion -//#region src/schema/rsshub.d.ts -declare const rsshub: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "rsshub"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "rsshub"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - baseUrl: drizzle_orm_pg_core100.PgColumn<{ - name: "base_url"; - tableName: "rsshub"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - accessKey: drizzle_orm_pg_core100.PgColumn<{ - name: "access_key"; - tableName: "rsshub"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ownerUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "owner_user_id"; - tableName: "rsshub"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - price: drizzle_orm_pg_core100.PgColumn<{ - name: "price"; - tableName: "rsshub"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core100.PgColumn<{ - name: "description"; - tableName: "rsshub"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userLimit: drizzle_orm_pg_core100.PgColumn<{ - name: "user_limit"; - tableName: "rsshub"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - errorMessage: drizzle_orm_pg_core100.PgColumn<{ - name: "error_message"; - tableName: "rsshub"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - errorAt: drizzle_orm_pg_core100.PgColumn<{ - name: "error_at"; - tableName: "rsshub"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const rsshubOpenAPISchema: zod110.ZodObject<{ - id: zod110.ZodString; - baseUrl: zod110.ZodString; - accessKey: zod110.ZodNullable; - ownerUserId: zod110.ZodString; - price: zod110.ZodNumber; - description: zod110.ZodNullable; - userLimit: zod110.ZodNullable; - errorMessage: zod110.ZodNullable; - errorAt: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - id: string; - description: string | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string; - baseUrl: string; - accessKey: string | null; - price: number; - userLimit: number | null; -}, { - id: string; - description: string | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string; - baseUrl: string; - accessKey: string | null; - price: number; - userLimit: number | null; -}>; -declare const rsshubUsage: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "rsshub_usage"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "rsshub_usage"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rsshubId: drizzle_orm_pg_core100.PgColumn<{ - name: "rsshub_id"; - tableName: "rsshub_usage"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "rsshub_usage"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const rsshubUsageOpenAPISchema: zod110.ZodObject<{ - id: zod110.ZodString; - rsshubId: zod110.ZodString; - userId: zod110.ZodString; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - id: string; - userId: string; - rsshubId: string; -}, { - id: string; - userId: string; - rsshubId: string; -}>; -declare const rsshubUsageRelations: drizzle_orm142.Relations<"rsshub_usage", { - rsshub: drizzle_orm142.One<"rsshub", true>; -}>; -//#endregion -//#region src/schema/rsshub-analytics.d.ts -declare const rsshubAnalytics: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "rsshub_analytics"; - schema: undefined; - columns: { - rsshubId: drizzle_orm_pg_core100.PgColumn<{ - name: "rsshub_id"; - tableName: "rsshub_analytics"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rsshubRoute: drizzle_orm_pg_core100.PgColumn<{ - name: "rsshub_route"; - tableName: "rsshub_analytics"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rsshubNamespace: drizzle_orm_pg_core100.PgColumn<{ - name: "rsshub_namespace"; - tableName: "rsshub_analytics"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - successCount: drizzle_orm_pg_core100.PgColumn<{ - name: "success_count"; - tableName: "rsshub_analytics"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - errorCount: drizzle_orm_pg_core100.PgColumn<{ - name: "error_count"; - tableName: "rsshub_analytics"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - timestamp: drizzle_orm_pg_core100.PgColumn<{ - name: "timestamp"; - tableName: "rsshub_analytics"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const rsshubAnalyticsOpenAPISchema: zod110.ZodObject<{ - rsshubId: zod110.ZodString; - rsshubRoute: zod110.ZodString; - rsshubNamespace: zod110.ZodString; - successCount: zod110.ZodNumber; - errorCount: zod110.ZodNumber; - timestamp: zod110.ZodString; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - rsshubRoute: string; - rsshubNamespace: string; - rsshubId: string; - successCount: number; - errorCount: number; - timestamp: string; -}, { - rsshubRoute: string; - rsshubNamespace: string; - rsshubId: string; - successCount: number; - errorCount: number; - timestamp: string; -}>; -//#endregion -//#region src/schema/settings.d.ts -declare const settings: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "settings"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "settings"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "settings"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tab: drizzle_orm_pg_core100.PgColumn<{ - name: "tab"; - tableName: "settings"; - dataType: "string"; - columnType: "PgText"; - data: "general" | "appearance" | "integration" | "ai"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: ["general", "appearance", "integration", "ai"]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - payload: drizzle_orm_pg_core100.PgColumn<{ - name: "payload"; - tableName: "settings"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - updateAt: drizzle_orm_pg_core100.PgColumn<{ - name: "update_at"; - tableName: "settings"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - version: drizzle_orm_pg_core100.PgColumn<{ - name: "version"; - tableName: "settings"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -//#endregion -//#region src/schema/timeline.d.ts -declare const timeline: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "timeline"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "timeline"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feedId"; - tableName: "timeline"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - entryId: drizzle_orm_pg_core100.PgColumn<{ - name: "entry_id"; - tableName: "timeline"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "published_at"; - tableName: "timeline"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - insertedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "inserted_at"; - tableName: "timeline"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "timeline"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - read: drizzle_orm_pg_core100.PgColumn<{ - name: "read"; - tableName: "timeline"; - 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; - }, {}, {}>; - from: drizzle_orm_pg_core100.PgColumn<{ - name: "from"; - tableName: "timeline"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: drizzle_orm142.Column<{ - name: "from"; - tableName: "timeline"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - identity: undefined; - generated: undefined; - }, {}, { - baseBuilder: drizzle_orm_pg_core100.PgColumnBuilder<{ - name: "from"; - dataType: "string"; - columnType: "PgText"; - data: string; - enumValues: [string, ...string[]]; - driverParam: string; - }, {}, {}, drizzle_orm142.ColumnBuilderExtraConfig>; - size: undefined; - }>; - }; - dialect: "pg"; -}>; -declare const timelineOpenAPISchema: zod110.ZodObject<{ - userId: zod110.ZodString; - feedId: zod110.ZodString; - entryId: zod110.ZodString; - publishedAt: zod110.ZodString; - insertedAt: zod110.ZodString; - view: zod110.ZodNumber; - read: zod110.ZodNullable; - from: zod110.ZodNullable>; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - userId: string; - view: number; - from: string[] | null; - feedId: string; - insertedAt: string; - publishedAt: string; - entryId: string; - read: boolean | null; -}, { - userId: string; - view: number; - from: string[] | null; - feedId: string; - insertedAt: string; - publishedAt: string; - entryId: string; - read: boolean | null; -}>; -declare const timelineRelations: drizzle_orm142.Relations<"timeline", { - entries: drizzle_orm142.One<"entries", true>; - feeds: drizzle_orm142.One<"feeds", true>; - collections: drizzle_orm142.One<"collections", true>; - subscriptions: drizzle_orm142.One<"subscriptions", true>; -}>; -//#endregion -//#region src/schema/trendings/feeds.d.ts -declare const trendingFeeds: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "trendings_feeds"; - schema: undefined; - columns: { - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_id"; - tableName: "trendings_feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rankedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "ranked_at"; - tableName: "trendings_feeds"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - score1d: drizzle_orm_pg_core100.PgColumn<{ - name: "score_1d"; - tableName: "trendings_feeds"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - score3d: drizzle_orm_pg_core100.PgColumn<{ - name: "score_3d"; - tableName: "trendings_feeds"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - score7d: drizzle_orm_pg_core100.PgColumn<{ - name: "score_7d"; - tableName: "trendings_feeds"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - score30d: drizzle_orm_pg_core100.PgColumn<{ - name: "score_30d"; - tableName: "trendings_feeds"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core100.PgColumn<{ - name: "view"; - tableName: "trendings_feeds"; - dataType: "number"; - columnType: "PgSmallInt"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - language: drizzle_orm_pg_core100.PgColumn<{ - name: "language"; - tableName: "trendings_feeds"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - nsfw: drizzle_orm_pg_core100.PgColumn<{ - name: "nsfw"; - tableName: "trendings_feeds"; - 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"; -}>; -declare const trendingFeedsRelations: drizzle_orm142.Relations<"trendings_feeds", { - feed: drizzle_orm142.One<"feeds", true>; -}>; -declare const trendingFeedsOpenAPISchema: zod110.ZodObject<{ - feedId: zod110.ZodString; - rankedAt: zod110.ZodString; - score1d: zod110.ZodString; - score3d: zod110.ZodString; - score7d: zod110.ZodString; - score30d: zod110.ZodString; - view: zod110.ZodNumber; - language: zod110.ZodString; - nsfw: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - view: number; - language: string; - nsfw: boolean | null; - feedId: string; - rankedAt: string; - score1d: string; - score3d: string; - score7d: string; - score30d: string; -}, { - view: number; - language: string; - nsfw: boolean | null; - feedId: string; - rankedAt: string; - score1d: string; - score3d: string; - score7d: string; - score30d: string; -}>; -//#endregion -//#region src/lib/constants.d.ts -declare enum UploadType { - Avatar = "avatar", -} -//#endregion -//#region src/schema/uploads.d.ts -declare const uploads: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "uploads"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - url: drizzle_orm_pg_core100.PgColumn<{ - name: "url"; - tableName: "uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - md5: drizzle_orm_pg_core100.PgColumn<{ - name: "md5"; - tableName: "uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mimeType: drizzle_orm_pg_core100.PgColumn<{ - name: "mime_type"; - tableName: "uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - size: drizzle_orm_pg_core100.PgColumn<{ - name: "size"; - tableName: "uploads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: drizzle_orm_pg_core100.PgColumn<{ - name: "type"; - tableName: "uploads"; - dataType: "string"; - columnType: "PgText"; - data: UploadType; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [UploadType]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -//#endregion -//#region src/schema/users.d.ts -declare const user$1: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "user"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: drizzle_orm_pg_core100.PgColumn<{ - name: "name"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 64; - }>; - email: drizzle_orm_pg_core100.PgColumn<{ - name: "email"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 64; - }>; - emailVerified: drizzle_orm_pg_core100.PgColumn<{ - name: "emailVerified"; - 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; - }, {}, {}>; - image: drizzle_orm_pg_core100.PgColumn<{ - name: "image"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 256; - }>; - handle: drizzle_orm_pg_core100.PgColumn<{ - name: "handle"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 36; - }>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updatedAt"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - twoFactorEnabled: drizzle_orm_pg_core100.PgColumn<{ - name: "two_factor_enabled"; - 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; - }, {}, {}>; - isAnonymous: drizzle_orm_pg_core100.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; - }, {}, {}>; - suspended: drizzle_orm_pg_core100.PgColumn<{ - name: "suspended"; - 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; - }, {}, {}>; - deleted: drizzle_orm_pg_core100.PgColumn<{ - name: "deleted"; - 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; - }, {}, {}>; - bio: drizzle_orm_pg_core100.PgColumn<{ - name: "bio"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 256; - }>; - website: drizzle_orm_pg_core100.PgColumn<{ - name: "website"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 256; - }>; - socialLinks: drizzle_orm_pg_core100.PgColumn<{ - name: "social_links"; - tableName: "user"; - dataType: "json"; - columnType: "PgJsonb"; - data: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - }; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - }; - }>; - stripeCustomerId: drizzle_orm_pg_core100.PgColumn<{ - name: "stripe_customer_id"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - role: drizzle_orm_pg_core100.PgColumn<{ - name: "role"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - roleEndAt: drizzle_orm_pg_core100.PgColumn<{ - name: "role_end_at"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const users: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "user"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: drizzle_orm_pg_core100.PgColumn<{ - name: "name"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 64; - }>; - email: drizzle_orm_pg_core100.PgColumn<{ - name: "email"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 64; - }>; - emailVerified: drizzle_orm_pg_core100.PgColumn<{ - name: "emailVerified"; - 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; - }, {}, {}>; - image: drizzle_orm_pg_core100.PgColumn<{ - name: "image"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 256; - }>; - handle: drizzle_orm_pg_core100.PgColumn<{ - name: "handle"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 36; - }>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updatedAt"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - twoFactorEnabled: drizzle_orm_pg_core100.PgColumn<{ - name: "two_factor_enabled"; - 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; - }, {}, {}>; - isAnonymous: drizzle_orm_pg_core100.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; - }, {}, {}>; - suspended: drizzle_orm_pg_core100.PgColumn<{ - name: "suspended"; - 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; - }, {}, {}>; - deleted: drizzle_orm_pg_core100.PgColumn<{ - name: "deleted"; - 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; - }, {}, {}>; - bio: drizzle_orm_pg_core100.PgColumn<{ - name: "bio"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 256; - }>; - website: drizzle_orm_pg_core100.PgColumn<{ - name: "website"; - tableName: "user"; - dataType: "string"; - columnType: "PgVarchar"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - length: 256; - }>; - socialLinks: drizzle_orm_pg_core100.PgColumn<{ - name: "social_links"; - tableName: "user"; - dataType: "json"; - columnType: "PgJsonb"; - data: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - }; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - }; - }>; - stripeCustomerId: drizzle_orm_pg_core100.PgColumn<{ - name: "stripe_customer_id"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - role: drizzle_orm_pg_core100.PgColumn<{ - name: "role"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - roleEndAt: drizzle_orm_pg_core100.PgColumn<{ - name: "role_end_at"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare function lower(handle: AnyPgColumn): SQL; -declare const usersOpenApiSchema: zod110.ZodObject; - email: zod110.ZodString; - emailVerified: zod110.ZodNullable; - image: zod110.ZodNullable; - handle: zod110.ZodNullable; - createdAt: zod110.ZodDate; - updatedAt: zod110.ZodDate; - twoFactorEnabled: zod110.ZodNullable; - isAnonymous: zod110.ZodNullable; - suspended: zod110.ZodNullable; - deleted: zod110.ZodNullable; - bio: zod110.ZodNullable; - website: zod110.ZodNullable; - socialLinks: zod110.ZodNullable>; - stripeCustomerId: zod110.ZodNullable; - role: zod110.ZodNullable; - roleEndAt: zod110.ZodNullable; -}, "email">, "strip", zod110.ZodTypeAny, { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: Date; - updatedAt: Date; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: Date | 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; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: Date | null; -}>; -declare const account: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "account"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "userId"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - providerId: drizzle_orm_pg_core100.PgColumn<{ - name: "provider"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - accountId: drizzle_orm_pg_core100.PgColumn<{ - name: "providerAccountId"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - refreshToken: drizzle_orm_pg_core100.PgColumn<{ - name: "refresh_token"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - accessToken: drizzle_orm_pg_core100.PgColumn<{ - name: "access_token"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - accessTokenExpiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "expires_at"; - tableName: "account"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - refreshTokenExpiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "refreshTokenExpiresAt"; - tableName: "account"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - scope: drizzle_orm_pg_core100.PgColumn<{ - name: "scope"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - idToken: drizzle_orm_pg_core100.PgColumn<{ - name: "id_token"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - password: drizzle_orm_pg_core100.PgColumn<{ - name: "password"; - tableName: "account"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "createdAt"; - tableName: "account"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updatedAt"; - tableName: "account"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const session: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "session"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "session"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - token: drizzle_orm_pg_core100.PgColumn<{ - name: "sessionToken"; - tableName: "session"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "userId"; - tableName: "session"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "expires"; - tableName: "session"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "createdAt"; - tableName: "session"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updatedAt"; - tableName: "session"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ipAddress: drizzle_orm_pg_core100.PgColumn<{ - name: "ipAddress"; - tableName: "session"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userAgent: drizzle_orm_pg_core100.PgColumn<{ - name: "userAgent"; - tableName: "session"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const verification: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "verificationToken"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "verificationToken"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - identifier: drizzle_orm_pg_core100.PgColumn<{ - name: "identifier"; - tableName: "verificationToken"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - value: drizzle_orm_pg_core100.PgColumn<{ - name: "token"; - tableName: "verificationToken"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "expires"; - tableName: "verificationToken"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "createdAt"; - tableName: "verificationToken"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: drizzle_orm_pg_core100.PgColumn<{ - name: "updatedAt"; - tableName: "verificationToken"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const twoFactor: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "two_factor"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "two_factor"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - secret: drizzle_orm_pg_core100.PgColumn<{ - name: "secret"; - tableName: "two_factor"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - backupCodes: drizzle_orm_pg_core100.PgColumn<{ - name: "backup_codes"; - tableName: "two_factor"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "user_id"; - tableName: "two_factor"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const stripeSubscriptions: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "stripe_subscriptions"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core100.PgColumn<{ - name: "id"; - tableName: "stripe_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - plan: drizzle_orm_pg_core100.PgColumn<{ - name: "plan"; - tableName: "stripe_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - referenceId: drizzle_orm_pg_core100.PgColumn<{ - name: "reference_id"; - tableName: "stripe_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - stripeCustomerId: drizzle_orm_pg_core100.PgColumn<{ - name: "stripe_customer_id"; - tableName: "stripe_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - stripeSubscriptionId: drizzle_orm_pg_core100.PgColumn<{ - name: "stripe_subscription_id"; - tableName: "stripe_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: drizzle_orm_pg_core100.PgColumn<{ - name: "status"; - tableName: "stripe_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - periodStart: drizzle_orm_pg_core100.PgColumn<{ - name: "period_start"; - tableName: "stripe_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - periodEnd: drizzle_orm_pg_core100.PgColumn<{ - name: "period_end"; - tableName: "stripe_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - cancelAtPeriodEnd: drizzle_orm_pg_core100.PgColumn<{ - name: "cancel_at_period_end"; - tableName: "stripe_subscriptions"; - 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; - }, {}, {}>; - seats: drizzle_orm_pg_core100.PgColumn<{ - name: "seats"; - tableName: "stripe_subscriptions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - trialStart: drizzle_orm_pg_core100.PgColumn<{ - name: "trial_start"; - tableName: "stripe_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - trialEnd: drizzle_orm_pg_core100.PgColumn<{ - name: "trial_end"; - tableName: "stripe_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const applePayTransactions: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "apple_pay_transactions"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "userId"; - tableName: "apple_pay_transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - signedTransaction: drizzle_orm_pg_core100.PgColumn<{ - name: "signed_transaction"; - tableName: "apple_pay_transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const usersRelations: drizzle_orm142.Relations<"user", { - subscriptions: drizzle_orm142.Many<"subscriptions">; - listsSubscriptions: drizzle_orm142.Many<"lists_subscriptions">; - collections: drizzle_orm142.Many<"collections">; - actions: drizzle_orm142.One<"actions", true>; - wallets: drizzle_orm142.One<"wallets", true>; - feeds: drizzle_orm142.Many<"feeds">; - inboxes: drizzle_orm142.One<"inboxes", true>; - messaging: drizzle_orm142.Many<"messaging">; -}>; -//#endregion -//#region src/schema/wallets.d.ts -declare const wallets: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "wallets"; - schema: undefined; - columns: { - addressIndex: drizzle_orm_pg_core100.PgColumn<{ - name: "address_index"; - tableName: "wallets"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: "always"; - generated: undefined; - }, {}, {}>; - address: drizzle_orm_pg_core100.PgColumn<{ - name: "address"; - tableName: "wallets"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "userId"; - tableName: "wallets"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "wallets"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - powerToken: drizzle_orm_pg_core100.PgColumn<{ - name: "power_token"; - tableName: "wallets"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - dailyPowerToken: drizzle_orm_pg_core100.PgColumn<{ - name: "daily_power_token"; - tableName: "wallets"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - cashablePowerToken: drizzle_orm_pg_core100.PgColumn<{ - name: "cashable_power_token"; - tableName: "wallets"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const walletsOpenAPISchema: zod110.ZodObject<{ - addressIndex: zod110.ZodNumber; - address: zod110.ZodNullable; - userId: zod110.ZodString; - createdAt: zod110.ZodString; - powerToken: zod110.ZodString; - dailyPowerToken: zod110.ZodString; - cashablePowerToken: zod110.ZodString; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - createdAt: string; - userId: string; - powerToken: string; - addressIndex: number; - address: string | null; - dailyPowerToken: string; - cashablePowerToken: string; -}, { - createdAt: string; - userId: string; - powerToken: string; - addressIndex: number; - address: string | null; - dailyPowerToken: string; - cashablePowerToken: string; -}>; -declare const walletsRelations: drizzle_orm142.Relations<"wallets", { - user: drizzle_orm142.One<"user", true>; - transactionsFrom: drizzle_orm142.Many<"transactions">; - transactionTo: drizzle_orm142.Many<"transactions">; - level: drizzle_orm142.One<"levels", false>; -}>; -declare const transactionType: drizzle_orm_pg_core100.PgEnum<["tip", "mint", "burn", "withdraw", "purchase", "airdrop"]>; -declare const transactions: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "transactions"; - schema: undefined; - columns: { - hash: drizzle_orm_pg_core100.PgColumn<{ - name: "hash"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: drizzle_orm_pg_core100.PgColumn<{ - name: "type"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgEnumColumn"; - data: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: ["tip", "mint", "burn", "withdraw", "purchase", "airdrop"]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fromUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "from_user_id"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toUserId: drizzle_orm_pg_core100.PgColumn<{ - name: "to_user_id"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toFeedId: drizzle_orm_pg_core100.PgColumn<{ - name: "to_feed_id"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toListId: drizzle_orm_pg_core100.PgColumn<{ - name: "to_list_id"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toEntryId: drizzle_orm_pg_core100.PgColumn<{ - name: "to_entry_id"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toRSSHubId: drizzle_orm_pg_core100.PgColumn<{ - name: "to_rsshub_id"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - powerToken: drizzle_orm_pg_core100.PgColumn<{ - name: "power_token"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tax: drizzle_orm_pg_core100.PgColumn<{ - name: "tax"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core100.PgColumn<{ - name: "created_at"; - tableName: "transactions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - comment: drizzle_orm_pg_core100.PgColumn<{ - name: "comment"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const transactionsOpenAPISchema: zod110.ZodObject<{ - hash: zod110.ZodString; - type: zod110.ZodEnum<["tip", "mint", "burn", "withdraw", "purchase", "airdrop"]>; - fromUserId: zod110.ZodNullable; - toUserId: zod110.ZodNullable; - toFeedId: zod110.ZodNullable; - toListId: zod110.ZodNullable; - toEntryId: zod110.ZodNullable; - toRSSHubId: zod110.ZodNullable; - powerToken: zod110.ZodString; - tax: zod110.ZodString; - createdAt: zod110.ZodString; - comment: zod110.ZodNullable; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - createdAt: string; - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; - hash: string; - powerToken: string; - fromUserId: string | null; - toUserId: string | null; - toFeedId: string | null; - toListId: string | null; - toEntryId: string | null; - toRSSHubId: string | null; - tax: string; - comment: string | null; -}, { - createdAt: string; - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; - hash: string; - powerToken: string; - fromUserId: string | null; - toUserId: string | null; - toFeedId: string | null; - toListId: string | null; - toEntryId: string | null; - toRSSHubId: string | null; - tax: string; - comment: string | null; -}>; -declare const transactionsRelations: drizzle_orm142.Relations<"transactions", { - fromUser: drizzle_orm142.One<"user", false>; - toUser: drizzle_orm142.One<"user", false>; - toFeed: drizzle_orm142.One<"feeds", false>; - fromWallet: drizzle_orm142.One<"wallets", false>; - toWallet: drizzle_orm142.One<"wallets", false>; -}>; -declare const feedPowerTokens: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "feedPowerTokens"; - schema: undefined; - columns: { - feedId: drizzle_orm_pg_core100.PgColumn<{ - name: "feed_id"; - tableName: "feedPowerTokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - powerToken: drizzle_orm_pg_core100.PgColumn<{ - name: "power_token"; - tableName: "feedPowerTokens"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const feedPowerTokensOpenAPISchema: zod110.ZodObject<{ - feedId: zod110.ZodString; - powerToken: zod110.ZodString; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - feedId: string; - powerToken: string; -}, { - feedId: string; - powerToken: string; -}>; -declare const feedPowerTokensRelations: drizzle_orm142.Relations<"feedPowerTokens", { - feed: drizzle_orm142.One<"feeds", true>; -}>; -declare const levels: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "levels"; - schema: undefined; - columns: { - address: drizzle_orm_pg_core100.PgColumn<{ - name: "address"; - tableName: "levels"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rank: drizzle_orm_pg_core100.PgColumn<{ - name: "rank"; - tableName: "levels"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - level: drizzle_orm_pg_core100.PgColumn<{ - name: "level"; - tableName: "levels"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - prevActivityPoints: drizzle_orm_pg_core100.PgColumn<{ - name: "prev_activity_points"; - tableName: "levels"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - activityPoints: drizzle_orm_pg_core100.PgColumn<{ - name: "activity_points"; - tableName: "levels"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - powerToken: drizzle_orm_pg_core100.PgColumn<{ - name: "power_token"; - tableName: "levels"; - dataType: "string"; - columnType: "PgNumeric"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core100.PgColumn<{ - name: "userId"; - tableName: "levels"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const levelsOpenAPISchema: zod110.ZodObject<{ - address: zod110.ZodString; - rank: zod110.ZodNullable; - level: zod110.ZodNullable; - prevActivityPoints: zod110.ZodNullable; - activityPoints: zod110.ZodNullable; - powerToken: zod110.ZodString; - userId: zod110.ZodString; -}, zod110.UnknownKeysParam, zod110.ZodTypeAny, { - userId: string; - rank: number | null; - powerToken: string; - address: string; - level: number | null; - prevActivityPoints: number | null; - activityPoints: number | null; -}, { - userId: string; - rank: number | null; - powerToken: string; - address: string; - level: number | null; - prevActivityPoints: number | null; - activityPoints: number | null; -}>; -declare const levelsRelations: drizzle_orm142.Relations<"levels", { - wallet: drizzle_orm142.One<"wallets", true>; - user: drizzle_orm142.One<"user", true>; -}>; -declare const boosts: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "boosts"; - schema: undefined; - columns: { - hash: drizzle_orm_pg_core100.PgColumn<{ - name: "hash"; - tableName: "boosts"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "expires_at"; - tableName: "boosts"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const rsshubPurchase: drizzle_orm_pg_core100.PgTableWithColumns<{ - name: "rsshub_purchase"; - schema: undefined; - columns: { - hash: drizzle_orm_pg_core100.PgColumn<{ - name: "hash"; - tableName: "rsshub_purchase"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: drizzle_orm_pg_core100.PgColumn<{ - name: "expires_at"; - tableName: "rsshub_purchase"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -//#endregion -//#region src/lib/ai/tools/display/types.d.ts -type FeedWithAnalytics = { - feed: InferSelectModel; - analytics: InferSelectModel | null; -}; -type SubscriptionWithFeedAndAnalytics = { - subscription: InferSelectModel; - feed: InferSelectModel | null; - analytics: InferSelectModel | null; -}; -type TimelineStats = { - count: number; - date: string; -}; -type TrendingFeedData = { - feed: InferSelectModel; - analytics: InferSelectModel | null; - recentSubscribers: number; - totalSubscribers: number; - growthRate: number; -}; -type TrendingTopicData = { - topic: string | null; - feedCount: number; - recentSubscribers: number; - totalSubscribers: number; -}; -type TrendingAuthorData = { - author: string | null; - feedCount: number; - recentSubscribers: number; - totalSubscribers: number; -}; -type TrendingCategoryData = { - category: string | null; - feedCount: number; - recentSubscribers: number; - totalSubscribers: number; - averageQuality: number; -}; -type OverviewStats = { - totalFeeds: number; - totalSubscriptions: number; - totalReads: number; -}; -//#endregion -//#region src/lib/ai/tools/management/types.d.ts -interface ActionSuggestion { - type: string; - name: string; - description: string; - condition: ActionItem["condition"]; - result: SettingsModel; - useCase: string; -} -interface RuleTypes { - filter: number; - translation: number; - webhook: number; - notification: number; - automation: number; -} -interface ComplexityAnalysis { - average: number; - max: number; - distribution: { - simple: number; - moderate: number; - complex: number; - }; -} -//#endregion -//#region src/lib/ai/tools/analytics/types.d.ts -interface FeedEngagement { - feedId: string; - title: string; - reads: number; - lastRead: Date; - category: string; - avgReadTime: number; -} -interface FeedPerformance { - feedId: string; - title: string; - reads: number; - totalEntries: number; - readRate: number; - avgTimeToRead: number; - quality: number; - reliability: number; -} -interface QualityMetric { - feedId: string; - title: string; - category: string | null; - qualityScore: number; - reliability: number; - avgContentLength: number; - totalReads: number; - hasErrors: boolean; - language: string | null; - nsfw: boolean | null; -} -interface CategoryDistribution { - category: string; - count: number; -} -interface LanguageDistribution { - language: string; - count: number; -} -interface ViewTypeDistribution { - view: number; - name: string; - count: number; -} -interface PerformanceAnalyticsResult { - performance: { - totalFeeds: number; - analyzedFeeds: number; - avgQuality: number; - avgReliability: number; - performanceDistribution: { - high: number; - medium: number; - low: number; - }; - }; - topPerformers: FeedPerformance[]; - needsAttention: FeedPerformance[]; - metrics: { - totalReads: number; - avgReadsPerFeed: number; - }; - detailed?: { - qualityFactors: Record; - reliabilityFactors: Record; - }; -} -//#endregion -//#region src/lib/ai/tools/data/generate-daily-report.d.ts -interface DailyReportResult { - report: string; - startDate: string; - view: string; - userId: string; - isEmpty: boolean; - error?: string; -} -//#endregion -//#region src/lib/ai/tools/index.d.ts -declare const tools: { - displayFeeds: ai43.Tool<{ - feedIds: string[]; - title?: string | undefined; - displayType?: "list" | "grid" | "card" | undefined; - showAnalytics?: boolean | undefined; - }, { - feeds: { - feed: { - id: string; - url: string; - title: string | null; - description: string | null; - siteUrl: string | null; - image: string | null; - checkedAt: Date; - lastModifiedHeader: string | null; - etagHeader: string | null; - ttl: number | null; - errorMessage: string | null; - errorAt: Date | null; - ownerUserId: string | null; - language: string | null; - migrateTo: string | null; - rsshubRoute: string | null; - rsshubNamespace: string | null; - nsfw: boolean | null; - }; - analytics: { - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: Date | null; - view: number | null; - } | null; - }[]; - displayType: "list" | "grid" | "card" | undefined; - showAnalytics: boolean | undefined; - title: string | undefined; - }>; - displayEntries: ai43.Tool<{ - entryIds: string[]; - title?: string | undefined; - displayType?: "timeline" | "list" | "grid" | "card" | "magazine" | undefined; - groupBy?: "date" | "feed" | "none" | undefined; - showSummary?: boolean | undefined; - showMetadata?: boolean | undefined; - }, { - entries: { - entry: { - id: string; - title: string | null; - url: string | null; - content: string | null; - description: string | null; - guid: string; - author: string | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: Date; - publishedAt: Date; - media: MediaModel[] | null; - categories: string[] | null; - attachments: AttachmentsModel[] | null; - extra: ExtraModel | null; - language: string | null; - feedId: string; - }; - feed: { - id: string; - url: string; - title: string | null; - description: string | null; - siteUrl: string | null; - image: string | null; - checkedAt: Date; - lastModifiedHeader: string | null; - etagHeader: string | null; - ttl: number | null; - errorMessage: string | null; - errorAt: Date | null; - ownerUserId: string | null; - language: string | null; - migrateTo: string | null; - rsshubRoute: string | null; - rsshubNamespace: string | null; - nsfw: boolean | null; - } | null; - analytics: { - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: Date | null; - view: number | null; - } | null; - }[]; - displayType: "timeline" | "list" | "grid" | "card" | "magazine" | undefined; - showSummary: boolean | undefined; - showMetadata: boolean | undefined; - title: string | undefined; - groupBy: "date" | "feed" | "none" | undefined; - }>; - displaySubscriptions: ai43.Tool<{ - userId: string; - title?: string | undefined; - displayType?: "list" | "grid" | "card" | "compact" | undefined; - showAnalytics?: boolean | undefined; - groupBy?: "status" | "category" | "none" | undefined; - showCategories?: boolean | undefined; - filterBy?: "all" | "active" | "inactive" | "recent" | undefined; - }, { - subscriptions: { - subscription: { - userId: string; - feedId: string; - view: number; - category: string | null; - title: string | null; - createdAt: Date; - isPrivate: boolean; - }; - feed: { - id: string; - url: string; - title: string | null; - description: string | null; - siteUrl: string | null; - image: string | null; - checkedAt: Date; - lastModifiedHeader: string | null; - etagHeader: string | null; - ttl: number | null; - errorMessage: string | null; - errorAt: Date | null; - ownerUserId: string | null; - language: string | null; - migrateTo: string | null; - rsshubRoute: string | null; - rsshubNamespace: string | null; - nsfw: boolean | null; - } | null; - analytics: { - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: Date | null; - view: number | null; - } | null; - }[]; - displayType: "list" | "grid" | "card" | "compact" | undefined; - showAnalytics: boolean | undefined; - showCategories: boolean | undefined; - title: string | undefined; - groupBy: "status" | "category" | "none" | undefined; - filterBy: "all" | "active" | "inactive" | "recent" | undefined; - }>; - displayAnalytics: ai43.Tool<{ - analyticsType: "feed" | "subscription" | "reading" | "trending" | "overview"; - userId?: string | undefined; - title?: string | undefined; - feedId?: string | undefined; - displayType?: "table" | "card" | "chart" | "dashboard" | undefined; - timeRange?: "all" | "7d" | "30d" | "90d" | "1y" | undefined; - showComparison?: boolean | undefined; - }, { - analyticsData: { - feedData?: FeedWithAnalytics; - subscriptionStats?: SubscriptionWithFeedAndAnalytics[]; - readingStats?: TimelineStats[]; - trendingFeeds?: FeedWithAnalytics[]; - overviewStats?: OverviewStats; - }; - analyticsType: "feed" | "subscription" | "reading" | "trending" | "overview"; - timeRange: "all" | "7d" | "30d" | "90d" | "1y"; - displayType: "table" | "card" | "chart" | "dashboard" | undefined; - showComparison: boolean | undefined; - title: string | undefined; - }>; - displayTrending: ai43.Tool<{ - trendingType: "feeds" | "categories" | "topics" | "authors"; - title?: string | undefined; - limit?: number | undefined; - displayType?: "list" | "ranking" | "grid" | "card" | undefined; - timeRange?: "1d" | "7d" | "30d" | "90d" | undefined; - showGrowth?: boolean | undefined; - showMetrics?: boolean | undefined; - }, { - trendingData: { - trendingFeeds?: TrendingFeedData[]; - trendingTopics?: TrendingTopicData[]; - trendingAuthors?: TrendingAuthorData[]; - trendingCategories?: TrendingCategoryData[]; - }; - trendingType: "feeds" | "categories" | "topics" | "authors"; - timeRange: "1d" | "7d" | "30d" | "90d"; - displayType: "list" | "ranking" | "grid" | "card" | undefined; - showGrowth: boolean | undefined; - showMetrics: boolean | undefined; - limit: number; - title: string | undefined; - }>; - getFeeds: ai43.Tool<{ - select: ("id" | "image" | "description" | "title" | "url" | "siteUrl" | "checkedAt" | "lastModifiedHeader" | "etagHeader" | "ttl" | "errorMessage" | "errorAt" | "ownerUserId" | "language" | "migrateTo" | "rsshubRoute" | "rsshubNamespace" | "nsfw")[]; - ids: string[]; - }, { - feeds: Record[]; - }>; - getFeedEntries: ai43.Tool<{ - select: ("id" | "description" | "title" | "content" | "author" | "url" | "language" | "feedId" | "guid" | "media" | "categories" | "attachments" | "extra" | "authorUrl" | "authorAvatar" | "insertedAt" | "publishedAt")[]; - feedId?: string | undefined; - feedIds?: string[] | undefined; - }, { - entries: Record[]; - }>; - getEntry: ai43.Tool<{ - id: string; - select: ("id" | "description" | "title" | "content" | "author" | "url" | "language" | "feedId" | "guid" | "media" | "categories" | "attachments" | "extra" | "authorUrl" | "authorAvatar" | "insertedAt" | "publishedAt")[]; - }, Record | null>; - getUserSubscriptions: ai43.Tool<{ - userId: string; - view?: number | undefined; - category?: string | undefined; - limit?: number | undefined; - }, { - subscriptions: { - feedId: string; - title: string | null; - description: string | null; - url: string; - siteUrl: string | null; - category: string | null; - view: number; - language: string | null; - nsfw: boolean | null; - subscribedAt: Date; - isPrivate: boolean; - }[]; - summary: { - totalSubscriptions: number; - categories: (string | null)[]; - views: number[]; - languages: (string | null)[]; - nsfwCount: number; - privateCount: number; - }; - }>; - getTrendingFeeds: ai43.Tool<{ - language?: string | undefined; - limit?: number | undefined; - timeframe?: "1d" | "3d" | "7d" | "30d" | undefined; - excludeNsfw?: boolean | undefined; - minimumScore?: number | undefined; - }, { - trending: { - feedId: string; - title: string | null; - description: string | null; - url: string; - siteUrl: string | null; - image: string | null; - language: string | null; - nsfw: boolean | null; - trendingScore: number; - scores: { - "1d": string; - "3d": string; - "7d": string; - "30d": string; - }; - isHealthy: boolean; - lastChecked: Date; - rankedAt: Date; - view: number; - }[]; - summary: { - totalFeeds: number; - timeframeUsed: "1d" | "3d" | "7d" | "30d"; - averageScore: number; - languages: (string | null)[]; - healthyFeeds: number; - }; - }>; - searchFeeds: ai43.Tool<{ - query: string; - language?: string | undefined; - limit?: number | undefined; - excludeNsfw?: boolean | undefined; - }, { - results: { - feedId: string; - title: string | null; - description: string | null; - url: string; - siteUrl: string | null; - image: string | null; - language: string | null; - nsfw: boolean | null; - relevanceScore: number; - isHealthy: boolean; - lastChecked: Date; - updateFrequency: number | null; - }[]; - summary: { - totalResults: number; - query: string; - averageRelevanceScore: number; - languages: (string | null)[]; - healthyFeeds: number; - }; - }>; - getUserReadingHistory: ai43.Tool<{ - userId: string; - limit?: number | undefined; - timeframeDays?: number | undefined; - }, { - recentReads: { - readAt: Date; - entryId: string; - feedId: string; - readCount: number; - entry: { - id: string; - title: string | null; - description: string | null; - url: string | null; - author: string | null; - publishedAt: Date; - language: string | null; - categories: string[] | null; - feedId: string; - }; - feed: { - id: string; - title: string | null; - description: string | null; - language: string | null; - nsfw: boolean | null; - } | undefined; - }[]; - statistics: { - totalReads: number; - uniqueFeeds: number; - uniqueAuthors: number; - readingVelocity: number; - timeframeDays: number; - }; - patterns: { - topFeeds: { - feedId: string; - feedTitle: string; - readCount: number; - }[]; - languagePreferences: { - language: string; - count: number; - }[]; - topCategories: { - category: string; - count: number; - }[]; - }; - insights: { - mostActiveLanguage: string; - diversityScore: number; - readingConsistency: string; - }; - }>; - getContentRecommendations: ai43.Tool<{ - userId: string; - limit?: number | undefined; - excludeNsfw?: boolean | undefined; - timeframeDays?: number | undefined; - recommendationType?: "entries" | "feeds" | "both" | undefined; - excludeRead?: boolean | undefined; - includeLanguages?: string[] | undefined; - }, { - recommendations: any; - summary: { - userPreferences: { - topLanguages: { - language: string; - readCount: number; - }[]; - topCategories: { - category: string; - readCount: number; - }[]; - favoriteAuthors: { - author: string; - readCount: number; - }[]; - }; - recommendationMetadata: { - totalSubscriptions: number; - recentReads: number; - timeframeDays: number; - recommendationType: "entries" | "feeds" | "both"; - filters: { - excludeRead: boolean; - excludeNsfw: boolean; - languages: string[]; - }; - }; - }; - }>; - manageSubscriptions: ai43.Tool<{ - userId: string; - action: "analyze" | "categorize" | "cleanup" | "optimize"; - options?: { - maxSuggestions?: number | undefined; - } | undefined; - }, { - analysis: { - totalSubscriptions: number; - categories: number; - languages: number; - uncategorized: number; - inactive: number; - nsfw: number; - private: number; - utilizationRate: number; - }; - details: { - categoriesUsed: (string | null)[]; - languagesUsed: (string | null)[]; - uncategorizedFeeds: { - feedId: string; - title: string | null; - description: string | null; - language: string | null; - }[]; - inactiveFeeds: { - feedId: string; - title: string | null; - errorMessage: string | null; - lastChecked: Date; - }[]; - }; - recommendations: (string | false)[]; - totalUncategorized?: undefined; - existingCategories?: undefined; - suggestions?: undefined; - totalCandidates?: undefined; - candidates?: undefined; - potentialSavings?: undefined; - optimization?: undefined; - error?: undefined; - } | { - totalUncategorized: number; - existingCategories: string[]; - suggestions: { - feedId: string; - title: string | null; - description: string | null; - currentCategory: string | null; - suggestedCategory: string; - confidence: number; - reasons: string[]; - }[]; - analysis?: undefined; - details?: undefined; - recommendations?: undefined; - totalCandidates?: undefined; - candidates?: undefined; - potentialSavings?: undefined; - optimization?: undefined; - error?: undefined; - } | { - totalCandidates: number; - candidates: { - feedId: string; - title: string; - category: string | null; - issues: string[]; - severity: number; - recommendation: string; - }[]; - potentialSavings: number; - recommendations: string[]; - analysis?: undefined; - details?: undefined; - totalUncategorized?: undefined; - existingCategories?: undefined; - suggestions?: undefined; - optimization?: undefined; - error?: undefined; - } | { - optimization: { - totalSubscriptions: number; - utilizationRate: number; - categorizedFeeds: number; - uncategorizedFeeds: number; - languageDiversity: number; - }; - recommendations: { - type: string; - description: string; - impact: string; - count?: number; - }[]; - analysis?: undefined; - details?: undefined; - totalUncategorized?: undefined; - existingCategories?: undefined; - suggestions?: undefined; - totalCandidates?: undefined; - candidates?: undefined; - potentialSavings?: undefined; - error?: undefined; - } | { - error: string; - details: string; - analysis?: undefined; - recommendations?: undefined; - totalUncategorized?: undefined; - existingCategories?: undefined; - suggestions?: undefined; - totalCandidates?: undefined; - candidates?: undefined; - potentialSavings?: undefined; - optimization?: undefined; - }>; - manageActions: ai43.Tool<{ - userId: string; - operation: "examples" | "analyze" | "optimize" | "suggest" | "validate"; - context?: { - pattern?: string | undefined; - ruleType?: "custom" | "filter" | "translation" | "webhook" | "notification" | undefined; - } | undefined; - }, { - analysis: { - totalActions: number; - maxActions: number; - utilizationRate: number; - ruleTypes: RuleTypes; - complexity: ComplexityAnalysis; - potentialIssues: string[]; - }; - recommendations: string[]; - actions: { - id: number; - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - complexity: number; - }[]; - suggestions?: undefined; - currentCount?: undefined; - availableSlots?: undefined; - context?: undefined; - overallValid?: undefined; - totalErrors?: undefined; - totalWarnings?: undefined; - validationResults?: undefined; - optimizations?: undefined; - summary?: undefined; - examples?: undefined; - usage?: undefined; - categories?: undefined; - error?: undefined; - details?: undefined; - } | { - suggestions: ActionSuggestion[]; - currentCount: number; - availableSlots: number; - context: { - pattern?: string | undefined; - ruleType?: "custom" | "filter" | "translation" | "webhook" | "notification" | undefined; - }; - analysis?: undefined; - recommendations?: undefined; - actions?: undefined; - overallValid?: undefined; - totalErrors?: undefined; - totalWarnings?: undefined; - validationResults?: undefined; - optimizations?: undefined; - summary?: undefined; - examples?: undefined; - usage?: undefined; - categories?: undefined; - error?: undefined; - details?: undefined; - } | { - overallValid: boolean; - totalErrors: number; - totalWarnings: number; - validationResults: { - id: number; - name: string; - isValid: boolean; - errors: string[]; - warnings: string[]; - suggestions: string[]; - }[]; - recommendations: (string | false)[]; - analysis?: undefined; - actions?: undefined; - suggestions?: undefined; - currentCount?: undefined; - availableSlots?: undefined; - context?: undefined; - optimizations?: undefined; - summary?: undefined; - examples?: undefined; - usage?: undefined; - categories?: undefined; - error?: undefined; - details?: undefined; - } | { - optimizations: { - id: number; - name: string; - currentComplexity: number; - optimizedComplexity: number; - improvements: string[]; - optimizedAction: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }; - performanceGain: number; - }[]; - summary: { - totalRules: number; - totalImprovements: number; - averagePerformanceGain: number; - recommendations: (string | false)[]; - }; - analysis?: undefined; - recommendations?: undefined; - actions?: undefined; - suggestions?: undefined; - currentCount?: undefined; - availableSlots?: undefined; - context?: undefined; - overallValid?: undefined; - totalErrors?: undefined; - totalWarnings?: undefined; - validationResults?: undefined; - examples?: undefined; - usage?: undefined; - categories?: undefined; - error?: undefined; - details?: undefined; - } | { - examples: { - contentFiltering: ({ - name: string; - condition: { - field: "entry_title"; - operator: "regex"; - value: string; - }[]; - result: { - block: boolean; - star?: undefined; - }; - description: string; - } | { - name: string; - condition: { - field: "entry_content"; - operator: "gt"; - value: string; - }[]; - result: { - star: boolean; - block?: undefined; - }; - description: string; - })[]; - automation: ({ - name: string; - condition: { - field: "entry_content"; - operator: "gt"; - value: string; - }[]; - result: { - summary: boolean; - translation?: undefined; - }; - description: string; - } | { - name: string; - condition: ({ - field: "category"; - operator: "eq"; - value: string; - } | { - field: "entry_title"; - operator: "not_eq"; - value: string; - })[]; - result: { - translation: string; - summary?: undefined; - }; - description: string; - })[]; - notifications: { - name: string; - condition: { - field: "entry_author"; - operator: "contains"; - value: string; - }[]; - result: { - newEntryNotification: boolean; - }; - description: string; - }[]; - }; - usage: { - howToUse: string; - customization: string; - testing: string; - }; - categories: string[]; - analysis?: undefined; - recommendations?: undefined; - actions?: undefined; - suggestions?: undefined; - currentCount?: undefined; - availableSlots?: undefined; - context?: undefined; - overallValid?: undefined; - totalErrors?: undefined; - totalWarnings?: undefined; - validationResults?: undefined; - optimizations?: undefined; - summary?: undefined; - error?: undefined; - details?: undefined; - } | { - error: string; - details: string; - analysis?: undefined; - recommendations?: undefined; - actions?: undefined; - suggestions?: undefined; - currentCount?: undefined; - availableSlots?: undefined; - context?: undefined; - overallValid?: undefined; - totalErrors?: undefined; - totalWarnings?: undefined; - validationResults?: undefined; - optimizations?: undefined; - summary?: undefined; - examples?: undefined; - usage?: undefined; - categories?: undefined; - }>; - subscriptionAnalytics: ai43.Tool<{ - userId: string; - analysisType: "overview" | "engagement" | "performance" | "trends" | "quality" | "recommendations" | "comparative"; - options?: { - includeInactive?: boolean | undefined; - minReadThreshold?: number | undefined; - compareWithAverage?: boolean | undefined; - detailedBreakdown?: boolean | undefined; - } | undefined; - timeRange?: "all" | "7d" | "30d" | "90d" | "1y" | undefined; - }, { - overview: { - totalSubscriptions: number; - activeFeeds: number; - inactiveFeeds: number; - totalReads: number; - uniqueActiveFeeds: number; - readingVelocity: number; - timeRange: string; - healthScore: number; - }; - distribution: { - categories: CategoryDistribution[]; - languages: LanguageDistribution[]; - viewTypes: ViewTypeDistribution[]; - }; - insights: { - mostActiveCategory: string; - primaryLanguage: string; - subscriptionUtilization: number; - engagementLevel: string; - }; - } | { - engagement: { - totalFeeds: number; - activeFeeds: number; - dormantFeeds: number; - engagementTiers: { - high: number; - medium: number; - low: number; - }; - }; - topPerformers: FeedEngagement[]; - underperformers: FeedEngagement[]; - dormantFeeds: { - feedId: string; - title: string | null; - category: string | null; - subscribedAt: Date; - lastChecked: Date; - }[]; - recommendations: (string | false)[]; - } | PerformanceAnalyticsResult | { - trends: { - timeRange: string; - totalDataPoints: number; - growthTrend: number; - seasonalPatterns: string[]; - }; - timeline: { - uniqueFeeds: number; - period: string; - reads: number; - avgEngagement: number; - }[]; - insights: { - trendDirection: string; - peakPeriod: string; - avgDailyReads: number; - }; - recommendations: (string | false)[]; - } | { - quality: { - totalFeeds: number; - avgQualityScore: number; - avgReliability: number; - qualityDistribution: { - high: number; - medium: number; - low: number; - }; - }; - highQualityFeeds: QualityMetric[]; - lowQualityFeeds: QualityMetric[]; - problemFeeds: QualityMetric[]; - recommendations: (string | false)[]; - } | { - recommendations: { - contentGaps: string[]; - languageOpportunities: string[]; - similarUserPatterns: { - similarUsers: number; - commonPatterns: never[]; - recommendations: never[]; - }; - }; - opportunities: { - newCategories: string[]; - underrepresentedLanguages: string[]; - trendingTopics: never[]; - }; - insights: { - diversityScore: number; - explorationPotential: number; - recommendationReadiness: number; - }; - } | { - comparative: { - timeRange: string; - compareWithAverage: boolean; - userMetrics: { - subscriptions: number; - dailyReads: number; - categories: number; - languages: number; - engagementRate: number; - }; - platformAverages: { - subscriptions: number; - dailyReads: number; - categories: number; - languages: number; - engagementRate: number; - } | null; - comparisons: { - metric: string; - userValue: number; - platformAverage: number; - percentile: number; - status: string; - }[]; - }; - insights: { - overallRank: string; - strengths: string[]; - improvements: string[]; - }; - } | { - error: string; - details: string; - }>; - getWhoami: ai43.Tool<{ - userId: string; - select?: ("id" | "name" | "email" | "emailVerified" | "image" | "handle" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "suspended" | "deleted" | "bio" | "website" | "socialLinks")[] | undefined; - }, { - error: string; - user: null; - selectedFields?: undefined; - metadata?: undefined; - } | { - error: null; - user: any; - selectedFields: ("id" | "name" | "email" | "emailVerified" | "image" | "handle" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "suspended" | "deleted" | "bio" | "website" | "socialLinks")[]; - metadata: { - hasProfile: boolean; - hasImage: boolean; - hasSocialLinks: boolean; - accountAge: number | null; - }; - }>; - generateDailyReport: ai43.Tool<{ - userId: string; - view: "0" | "1"; - startDate: string; - }, DailyReportResult>; - getUserTimeline: ai43.Tool<{ - userId: string; - select: ("id" | "description" | "title" | "content" | "author" | "url" | "language" | "feedId" | "guid" | "media" | "categories" | "attachments" | "extra" | "authorUrl" | "authorAvatar" | "insertedAt" | "publishedAt")[]; - view?: number | undefined; - limit?: number | undefined; - timeRange?: "last_hour" | "last_day" | "last_week" | "last_month" | undefined; - onlyUnread?: boolean | undefined; - }, { - entries: never[]; - timeRange?: undefined; - totalCount?: undefined; - } | { - entries: Record[]; - timeRange: "last_hour" | "last_day" | "last_week" | "last_month" | undefined; - totalCount: number; - }>; -}; -//#endregion -//#region src/lib/auth-plugins/index.d.ts -declare const authPlugins: ({ - id: "customGetProviders"; - endpoints: { - customGetProviders: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: any; - } : any>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-providers"; - }; - }; -} | { - id: "getAccountInfo"; - endpoints: { - getAccountInfo: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null; - } : ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-account-info"; - }; - }; -} | { - id: "deleteUserCustom"; - endpoints: { - deleteUserCustom: { - (inputCtx_0: { - body: { - TOTPCode: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: void; - } : void>; - options: { - method: "POST"; - body: zod_v490.ZodObject<{ - TOTPCode: zod_v490.ZodString; - }, zod_v4_core91.$strip>; - } & { - use: any[]; - }; - path: "/delete-user-custom"; - }; - }; -} | { - id: "oneTimeToken"; - endpoints: { - generateOneTimeToken: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - }; - } : { - token: string; - }>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - } & { - use: any[]; - }; - path: "/one-time-token/generate"; - }; - applyOneTimeToken: { - (inputCtx_0: { - body: { - token: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - token: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - } & { - use: any[]; - }; - path: "/one-time-token/apply"; - }; - }; -})[]; -//#endregion -//#region src/common/auth/get-auth-user.d.ts -declare enum UserRole { - Admin = "admin", - PreProTrial = "pre_pro_trial", - PrePro = "pre_pro", - Free = "free", - /** - * @deprecated use `UserRole.Free` instead - * - */ - Trial = "trial", -} -//#endregion -//#region src/lib/auth.d.ts -declare const auth: { - handler: (request: Request) => Promise; - api: better_auth771.InferAPI<{ - ok: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - ok: boolean; - }; - } : { - ok: boolean; - }>; - options: { - method: "GET"; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - ok: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - isAction: false; - }; - } & { - use: any[]; - }; - path: "/ok"; - }; - error: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Response; - } : Response>; - options: { - method: "GET"; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "text/html": { - schema: { - type: "string"; - description: string; - }; - }; - }; - }; - }; - }; - isAction: false; - }; - } & { - use: any[]; - }; - path: "/error"; - }; - signInSocial: { - (inputCtx_0: { - body: { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; - scopes?: string[] | undefined; - loginHint?: string | undefined; - idToken?: { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - } | undefined; - callbackURL?: string | undefined; - requestSignUp?: boolean | undefined; - errorCallbackURL?: string | undefined; - newUserCallbackURL?: string | undefined; - disableRedirect?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - redirect: boolean; - token: string; - url: undefined; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - } | { - url: string; - redirect: boolean; - }; - } : { - redirect: boolean; - token: string; - url: undefined; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - } | { - url: string; - redirect: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - callbackURL: zod110.ZodOptional; - newUserCallbackURL: zod110.ZodOptional; - errorCallbackURL: zod110.ZodOptional; - provider: zod110.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom")[]]>; - disableRedirect: zod110.ZodOptional; - idToken: zod110.ZodOptional; - accessToken: zod110.ZodOptional; - refreshToken: zod110.ZodOptional; - expiresAt: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - }, { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - }>>; - scopes: zod110.ZodOptional>; - requestSignUp: zod110.ZodOptional; - loginHint: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; - scopes?: string[] | undefined; - loginHint?: string | undefined; - idToken?: { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - } | undefined; - callbackURL?: string | undefined; - requestSignUp?: boolean | undefined; - errorCallbackURL?: string | undefined; - newUserCallbackURL?: string | undefined; - disableRedirect?: boolean | undefined; - }, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; - scopes?: string[] | undefined; - loginHint?: string | undefined; - idToken?: { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - } | undefined; - callbackURL?: string | undefined; - requestSignUp?: boolean | undefined; - errorCallbackURL?: string | undefined; - newUserCallbackURL?: string | undefined; - disableRedirect?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - operationId: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - description: string; - properties: { - redirect: { - type: string; - enum: boolean[]; - }; - token: { - type: string; - description: string; - url: { - type: string; - nullable: boolean; - }; - user: { - type: string; - properties: { - id: { - type: string; - }; - email: { - type: string; - }; - name: { - type: string; - nullable: boolean; - }; - image: { - type: string; - nullable: boolean; - }; - emailVerified: { - type: string; - }; - createdAt: { - type: string; - format: string; - }; - updatedAt: { - type: string; - format: string; - }; - }; - required: string[]; - }; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/sign-in/social"; - }; - callbackOAuth: { - (inputCtx_0: { - body?: { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - user?: string | undefined; - error_description?: string | undefined; - } | undefined; - } & { - method: "GET" | "POST"; - } & { - query?: { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - user?: string | undefined; - error_description?: string | undefined; - } | undefined; - } & { - params: { - id: string; - }; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: void; - } : void>; - options: { - method: ("GET" | "POST")[]; - body: zod110.ZodOptional; - error: zod110.ZodOptional; - device_id: zod110.ZodOptional; - error_description: zod110.ZodOptional; - state: zod110.ZodOptional; - user: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - user?: string | undefined; - error_description?: string | undefined; - }, { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - user?: string | undefined; - error_description?: string | undefined; - }>>; - query: zod110.ZodOptional; - error: zod110.ZodOptional; - device_id: zod110.ZodOptional; - error_description: zod110.ZodOptional; - state: zod110.ZodOptional; - user: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - user?: string | undefined; - error_description?: string | undefined; - }, { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - user?: string | undefined; - error_description?: string | undefined; - }>>; - metadata: { - isAction: false; - }; - } & { - use: any[]; - }; - path: "/callback/:id"; - }; - getSession: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: string | boolean | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - } & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - stripeCustomerId?: string | null | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - } & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - twoFactorEnabled: boolean | null | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - }; - } | null; - } : { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - } & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - stripeCustomerId?: string | null | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - } & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - twoFactorEnabled: boolean | null | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - }; - } | null>; - options: { - method: "GET"; - query: zod110.ZodOptional]>>>; - disableRefresh: zod110.ZodOptional]>>; - }, "strip", zod110.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: string | boolean | undefined; - }>>; - requireHeaders: true; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - session: { - $ref: string; - }; - user: { - $ref: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/get-session"; - }; - signOut: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - success: boolean; - }; - } : { - success: boolean; - }>; - options: { - method: "POST"; - requireHeaders: true; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - success: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/sign-out"; - }; - signUpEmail: { - (inputCtx_0: { - body: ({ - name: string; - email: string; - password: string; - callbackURL?: string; - } & ({} | ({} & { - stripeCustomerId?: string | null | undefined; - }) | ({} & {}))) & { - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - } & { - handle?: string | null | undefined; - deleted?: boolean | null | undefined; - bio?: string | null | undefined; - website?: string | null | undefined; - socialLinks?: string | null | undefined; - role?: string | null | undefined; - roleEndAt?: Date | null | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: null; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - } | { - token: string; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: null; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - } | { - token: string; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodRecord; - metadata: { - $Infer: { - body: ({ - name: string; - email: string; - password: string; - callbackURL?: string; - } & ({} | ({} & { - stripeCustomerId?: string | null | undefined; - }) | ({} & {}))) & { - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - } & { - handle?: string | null | undefined; - deleted?: boolean | null | undefined; - bio?: string | null | undefined; - website?: string | null | undefined; - socialLinks?: string | null | undefined; - role?: string | null | undefined; - roleEndAt?: Date | null | undefined; - }; - }; - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - name: { - type: string; - description: string; - }; - email: { - type: string; - description: string; - }; - password: { - type: string; - description: string; - }; - callbackURL: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - nullable: boolean; - description: string; - }; - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - description: string; - }; - name: { - type: string; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/sign-up/email"; - }; - signInEmail: { - (inputCtx_0: { - body: { - password: string; - email: string; - callbackURL?: string | undefined; - rememberMe?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - redirect: boolean; - token: string; - url: string | undefined; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - redirect: boolean; - token: string; - url: string | undefined; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - email: zod110.ZodString; - password: zod110.ZodString; - callbackURL: zod110.ZodOptional; - rememberMe: zod110.ZodOptional>; - }, "strip", zod110.ZodTypeAny, { - password: string; - email: string; - callbackURL?: string | undefined; - rememberMe?: boolean | undefined; - }, { - password: string; - email: string; - callbackURL?: string | undefined; - rememberMe?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - description: string; - properties: { - redirect: { - type: string; - enum: boolean[]; - }; - token: { - type: string; - description: string; - }; - url: { - type: string; - nullable: boolean; - }; - user: { - type: string; - properties: { - id: { - type: string; - }; - email: { - type: string; - }; - name: { - type: string; - nullable: boolean; - }; - image: { - type: string; - nullable: boolean; - }; - emailVerified: { - type: string; - }; - createdAt: { - type: string; - format: string; - }; - updatedAt: { - type: string; - format: string; - }; - }; - required: string[]; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/sign-in/email"; - }; - forgetPassword: { - (inputCtx_0: { - body: { - email: string; - redirectTo?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - email: zod110.ZodString; - redirectTo: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - email: string; - redirectTo?: string | undefined; - }, { - email: string; - redirectTo?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/forget-password"; - }; - resetPassword: { - (inputCtx_0: { - body: { - newPassword: string; - token?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: { - token?: string | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - query: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - token?: string | undefined; - }, { - token?: string | undefined; - }>>; - body: zod110.ZodObject<{ - newPassword: zod110.ZodString; - token: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - newPassword: string; - token?: string | undefined; - }, { - newPassword: string; - token?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/reset-password"; - }; - verifyEmail: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query: { - token: string; - callbackURL?: string | undefined; - }; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: void | { - status: boolean; - user: { - id: any; - email: any; - name: any; - image: any; - emailVerified: any; - createdAt: any; - updatedAt: any; - }; - } | { - status: boolean; - user: null; - }; - } : void | { - status: boolean; - user: { - id: any; - email: any; - name: any; - image: any; - emailVerified: any; - createdAt: any; - updatedAt: any; - }; - } | { - status: boolean; - user: null; - }>; - options: { - method: "GET"; - query: zod110.ZodObject<{ - token: zod110.ZodString; - callbackURL: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - token: string; - callbackURL?: string | undefined; - }, { - token: string; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - metadata: { - openapi: { - description: string; - parameters: ({ - name: string; - in: "query"; - description: string; - required: true; - schema: { - type: "string"; - }; - } | { - name: string; - in: "query"; - description: string; - required: false; - schema: { - type: "string"; - }; - })[]; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - description: string; - }; - name: { - type: string; - description: string; - }; - image: { - type: string; - description: string; - }; - emailVerified: { - type: string; - description: string; - }; - createdAt: { - type: string; - description: string; - }; - updatedAt: { - type: string; - description: string; - }; - }; - required: string[]; - }; - status: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/verify-email"; - }; - sendVerificationEmail: { - (inputCtx_0: { - body: { - email: string; - callbackURL?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - email: zod110.ZodString; - callbackURL: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - email: string; - callbackURL?: string | undefined; - }, { - email: string; - callbackURL?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - email: { - type: string; - description: string; - example: string; - }; - callbackURL: { - type: string; - description: string; - example: string; - nullable: boolean; - }; - }; - required: string[]; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - example: boolean; - }; - }; - }; - }; - }; - }; - "400": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - message: { - type: string; - description: string; - example: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/send-verification-email"; - }; - changeEmail: { - (inputCtx_0: { - body: { - newEmail: string; - callbackURL?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - newEmail: zod110.ZodString; - callbackURL: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - newEmail: string; - callbackURL?: string | undefined; - }, { - newEmail: string; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - }; - message: { - type: string; - enum: string[]; - description: string; - nullable: boolean; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/change-email"; - }; - changePassword: { - (inputCtx_0: { - body: { - newPassword: string; - currentPassword: string; - revokeOtherSessions?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string | null; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string | null; - user: { - id: string; - email: string; - name: string; - image: string | null | undefined; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - newPassword: zod110.ZodString; - currentPassword: zod110.ZodString; - revokeOtherSessions: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - newPassword: string; - currentPassword: string; - revokeOtherSessions?: boolean | undefined; - }, { - newPassword: string; - currentPassword: string; - revokeOtherSessions?: boolean | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - nullable: boolean; - description: string; - }; - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - description: string; - }; - name: { - type: string; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/change-password"; - }; - setPassword: { - (inputCtx_0: { - body: { - newPassword: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - newPassword: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - newPassword: string; - }, { - newPassword: string; - }>; - metadata: { - SERVER_ONLY: true; - }; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - } & { - use: any[]; - }; - path: "/set-password"; - }; - updateUser: { - (inputCtx_0: { - body: Partial better_auth771.Adapter; - databaseHooks: { - user: { - create: { - after: (newUser: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }, context: better_auth771.GenericEndpointContext | undefined) => Promise; - }; - }; - }; - advanced: { - database: { - generateId: false; - }; - defaultCookieAttributes: { - sameSite: "none"; - secure: true; - }; - }; - session: { - updateAge: number; - expiresIn: number; - }; - basePath: string; - trustedOrigins: string[]; - user: { - additionalFields: { - handle: { - type: "string"; - }; - socialLinks: { - type: "string"; - transform: { - input: (value: string | number | boolean | string[] | Date | number[] | null | undefined) => string; - output: (value: string | number | boolean | string[] | Date | number[] | null | undefined) => any; - }; - }; - bio: { - type: "string"; - }; - website: { - type: "string"; - }; - deleted: { - type: "boolean"; - }; - role: { - type: "string"; - }; - roleEndAt: { - type: "date"; - }; - }; - changeEmail: { - enabled: true; - sendChangeEmailVerification: ({ - user, - url - }: { - user: better_auth771.User; - newEmail: string; - url: string; - token: string; - }) => Promise; - }; - }; - account: { - accountLinking: { - enabled: true; - trustedProviders: ("github" | "apple" | "google")[]; - allowDifferentEmails: true; - }; - }; - socialProviders: { - google: { - clientId: string; - clientSecret: string; - }; - github: { - clientId: string; - clientSecret: string; - }; - apple: { - enabled: boolean; - clientId: string; - clientSecret: string; - appBundleIdentifier: string | undefined; - }; - }; - emailAndPassword: { - enabled: true; - sendResetPassword({ - user, - url - }: { - user: better_auth771.User; - url: string; - token: string; - }): Promise; - }; - emailVerification: { - sendOnSignUp: true; - sendVerificationEmail({ - user, - url - }: { - user: better_auth771.User; - url: string; - token: string; - }): Promise; - }; - plugins: ({ - id: "stripe"; - endpoints: { - stripeWebhook: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_1 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_1] extends [true] ? { - headers: Headers; - response: { - success: boolean; - }; - } : { - success: boolean; - }>; - options: { - method: "POST"; - metadata: { - isAction: boolean; - }; - cloneRequest: true; - } & { - use: any[]; - }; - path: "/stripe/webhook"; - }; - } & { - readonly upgradeSubscription: { - (inputCtx_0: { - body: { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_2 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_2] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }; - } : { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - plan: zod110.ZodString; - annual: zod110.ZodOptional; - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - metadata: zod110.ZodOptional>; - seats: zod110.ZodOptional; - successUrl: zod110.ZodDefault; - cancelUrl: zod110.ZodDefault; - returnUrl: zod110.ZodOptional; - disableRedirect: zod110.ZodDefault; - }, "strip", zod110.ZodTypeAny, { - plan: string; - successUrl: string; - cancelUrl: string; - disableRedirect: boolean; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - returnUrl?: string | undefined; - }, { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/upgrade"; - }; - readonly cancelSubscriptionCallback: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_3 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_3] extends [true] ? { - headers: Headers; - response: never; - } : never>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/cancel/callback"; - }; - readonly cancelSubscription: { - (inputCtx_0: { - body: { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_4 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_4] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - }; - } : { - url: string; - redirect: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - returnUrl: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/cancel"; - }; - readonly restoreSubscription: { - (inputCtx_0: { - body: { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_5 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_5] extends [true] ? { - headers: Headers; - response: Stripe.Response; - } : Stripe.Response>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/restore"; - }; - readonly listActiveSubscriptions: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - referenceId?: string | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_6 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_6] extends [true] ? { - headers: Headers; - response: { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]; - } : { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]>; - options: { - method: "GET"; - query: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - }, { - referenceId?: string | undefined; - }>>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/list"; - }; - readonly subscriptionSuccess: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_7 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_7] extends [true] ? { - headers: Headers; - response: better_call87.APIError; - } : better_call87.APIError>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/success"; - }; - }; - init(ctx: better_auth771.AuthContext): { - options: { - databaseHooks: { - user: { - create: { - after(user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }, ctx: better_auth771.GenericEndpointContext | undefined): Promise; - }; - }; - }; - }; - }; - schema: { - user: { - fields: { - stripeCustomerId: { - type: "string"; - required: false; - }; - }; - }; - subscription?: { - fields: { - plan: { - type: "string"; - required: true; - }; - referenceId: { - type: "string"; - required: true; - }; - stripeCustomerId: { - type: "string"; - required: false; - }; - stripeSubscriptionId: { - type: "string"; - required: false; - }; - status: { - type: "string"; - defaultValue: string; - }; - periodStart: { - type: "date"; - required: false; - }; - periodEnd: { - type: "date"; - required: false; - }; - cancelAtPeriodEnd: { - type: "boolean"; - required: false; - defaultValue: false; - }; - seats: { - type: "number"; - required: false; - }; - }; - } | undefined; - }; - } | { - id: "open-api"; - endpoints: { - generateOpenAPISchema: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_8 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_8] extends [true] ? { - headers: Headers; - response: { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }; - } : { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/open-api/generate-schema"; - }; - openAPIReference: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_9 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_9] extends [true] ? { - headers: Headers; - response: Response; - } : Response>; - options: { - method: "GET"; - metadata: { - isAction: boolean; - }; - } & { - use: any[]; - }; - path: "/reference"; - }; - }; - } | { - id: "two-factor"; - endpoints: { - enableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - issuer?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_10 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_10] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - backupCodes: string[]; - }; - } : { - totpURI: string; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - issuer: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - password: string; - issuer?: string | undefined; - }, { - password: string; - issuer?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - description: string; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/enable"; - }; - disableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_11 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_11] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/disable"; - }; - verifyBackupCode: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_12 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_12] extends [true] ? { - headers: Headers; - response: { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - disableSession: zod110.ZodOptional; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - twoFactorEnabled: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - session: { - type: string; - properties: { - token: { - type: string; - description: string; - }; - userId: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - expiresAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-backup-code"; - }; - generateBackupCodes: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_13 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_13] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - enum: boolean[]; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/generate-backup-codes"; - }; - viewBackupCodes: { - (inputCtx_0: { - body: { - userId: string; - }; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_14 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_14] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "GET"; - body: zod110.ZodObject<{ - userId: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - userId: string; - }, { - userId: string; - }>; - metadata: { - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/two-factor/view-backup-codes"; - }; - sendTwoFactorOTP: { - (inputCtx_0?: ({ - body?: { - trustDevice?: boolean | undefined; - } | undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_15 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_15] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/send-otp"; - }; - verifyTwoFactorOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_16 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_16] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }; - } : { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - description: string; - }; - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-otp"; - }; - generateTOTP: { - (inputCtx_0: { - body: { - secret: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_17 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_17] extends [true] ? { - headers: Headers; - response: { - code: string; - }; - } : { - code: string; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - secret: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - secret: string; - }, { - secret: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/totp/generate"; - }; - getTOTPURI: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_18 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_18] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - }; - } : { - totpURI: string; - }>; - options: { - method: "POST"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/get-totp-uri"; - }; - verifyTOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_19 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_19] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-totp"; - }; - }; - options: better_auth_plugins857.TwoFactorOptions | undefined; - hooks: { - after: { - matcher(context: better_auth771.HookEndpointContext): boolean; - handler: (inputContext: better_call87.MiddlewareInputContext) => Promise<{ - twoFactorRedirect: boolean; - } | undefined>; - }[]; - }; - schema: { - user: { - fields: { - twoFactorEnabled: { - type: "boolean"; - required: false; - defaultValue: false; - input: false; - }; - }; - }; - twoFactor: { - fields: { - secret: { - type: "string"; - required: true; - returned: false; - }; - backupCodes: { - type: "string"; - required: true; - returned: false; - }; - userId: { - type: "string"; - required: true; - returned: false; - references: { - model: string; - field: string; - }; - }; - }; - }; - }; - rateLimit: { - pathMatcher(path: string): boolean; - window: number; - max: number; - }[]; - $ERROR_CODES: { - readonly OTP_NOT_ENABLED: "OTP not enabled"; - readonly OTP_HAS_EXPIRED: "OTP has expired"; - readonly TOTP_NOT_ENABLED: "TOTP not enabled"; - readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; - readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; - readonly INVALID_BACKUP_CODE: "Invalid backup code"; - readonly INVALID_CODE: "Invalid code"; - readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code."; - readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"; - }; - } | { - id: "expo"; - init: (ctx: better_auth771.AuthContext) => { - options: { - trustedOrigins: string[]; - }; - }; - onRequest(request: Request, ctx: better_auth771.AuthContext): Promise<{ - request: Request; - } | undefined>; - hooks: { - after: { - matcher(context: better_auth771.HookEndpointContext): boolean; - handler: (inputContext: better_call87.MiddlewareInputContext) => Promise; - }[]; - }; - } | { - id: "custom-session"; - endpoints: { - getSession: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_20 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_20] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null>; - options: { - method: "GET"; - query: zod110.ZodOptional]>>; - disableRefresh: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - }>>; - metadata: { - CUSTOM_SESSION: boolean; - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - nullable: boolean; - items: { - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - requireHeaders: true; - } & { - use: any[]; - }; - path: "/get-session"; - }; - }; - } | { - id: "customGetProviders"; - endpoints: { - customGetProviders: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_21 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_21] extends [true] ? { - headers: Headers; - response: any; - } : any>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-providers"; - }; - }; - } | { - id: "getAccountInfo"; - endpoints: { - getAccountInfo: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_21 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_21] extends [true] ? { - headers: Headers; - response: ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null; - } : ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-account-info"; - }; - }; - } | { - id: "deleteUserCustom"; - endpoints: { - deleteUserCustom: { - (inputCtx_0: { - body: { - TOTPCode: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_21 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_21] extends [true] ? { - headers: Headers; - response: void; - } : void>; - options: { - method: "POST"; - body: zod_v490.ZodObject<{ - TOTPCode: zod_v490.ZodString; - }, zod_v4_core91.$strip>; - } & { - use: any[]; - }; - path: "/delete-user-custom"; - }; - }; - } | { - id: "oneTimeToken"; - endpoints: { - generateOneTimeToken: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_21 | undefined; - }) | undefined): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_21] extends [true] ? { - headers: Headers; - response: { - token: string; - }; - } : { - token: string; - }>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - } & { - use: any[]; - }; - path: "/one-time-token/generate"; - }; - applyOneTimeToken: { - (inputCtx_0: { - body: { - token: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse_1 | undefined; - returnHeaders?: ReturnHeaders_21 | undefined; - }): Promise<[AsResponse_1] extends [true] ? Response : [ReturnHeaders_21] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - token: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - } & { - use: any[]; - }; - path: "/one-time-token/apply"; - }; - }; - })[]; - }>> & { - name?: string; - image?: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodRecord; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - $Infer: { - body: Partial better_auth771.Adapter; - databaseHooks: { - user: { - create: { - after: (newUser: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }, context: better_auth771.GenericEndpointContext | undefined) => Promise; - }; - }; - }; - advanced: { - database: { - generateId: false; - }; - defaultCookieAttributes: { - sameSite: "none"; - secure: true; - }; - }; - session: { - updateAge: number; - expiresIn: number; - }; - basePath: string; - trustedOrigins: string[]; - user: { - additionalFields: { - handle: { - type: "string"; - }; - socialLinks: { - type: "string"; - transform: { - input: (value: string | number | boolean | string[] | Date | number[] | null | undefined) => string; - output: (value: string | number | boolean | string[] | Date | number[] | null | undefined) => any; - }; - }; - bio: { - type: "string"; - }; - website: { - type: "string"; - }; - deleted: { - type: "boolean"; - }; - role: { - type: "string"; - }; - roleEndAt: { - type: "date"; - }; - }; - changeEmail: { - enabled: true; - sendChangeEmailVerification: ({ - user, - url - }: { - user: better_auth771.User; - newEmail: string; - url: string; - token: string; - }) => Promise; - }; - }; - account: { - accountLinking: { - enabled: true; - trustedProviders: ("github" | "apple" | "google")[]; - allowDifferentEmails: true; - }; - }; - socialProviders: { - google: { - clientId: string; - clientSecret: string; - }; - github: { - clientId: string; - clientSecret: string; - }; - apple: { - enabled: boolean; - clientId: string; - clientSecret: string; - appBundleIdentifier: string | undefined; - }; - }; - emailAndPassword: { - enabled: true; - sendResetPassword({ - user, - url - }: { - user: better_auth771.User; - url: string; - token: string; - }): Promise; - }; - emailVerification: { - sendOnSignUp: true; - sendVerificationEmail({ - user, - url - }: { - user: better_auth771.User; - url: string; - token: string; - }): Promise; - }; - plugins: ({ - id: "stripe"; - endpoints: { - stripeWebhook: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - success: boolean; - }; - } : { - success: boolean; - }>; - options: { - method: "POST"; - metadata: { - isAction: boolean; - }; - cloneRequest: true; - } & { - use: any[]; - }; - path: "/stripe/webhook"; - }; - } & { - readonly upgradeSubscription: { - (inputCtx_0: { - body: { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }; - } : { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - plan: zod110.ZodString; - annual: zod110.ZodOptional; - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - metadata: zod110.ZodOptional>; - seats: zod110.ZodOptional; - successUrl: zod110.ZodDefault; - cancelUrl: zod110.ZodDefault; - returnUrl: zod110.ZodOptional; - disableRedirect: zod110.ZodDefault; - }, "strip", zod110.ZodTypeAny, { - plan: string; - successUrl: string; - cancelUrl: string; - disableRedirect: boolean; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - returnUrl?: string | undefined; - }, { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/upgrade"; - }; - readonly cancelSubscriptionCallback: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: never; - } : never>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/cancel/callback"; - }; - readonly cancelSubscription: { - (inputCtx_0: { - body: { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - }; - } : { - url: string; - redirect: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - returnUrl: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/cancel"; - }; - readonly restoreSubscription: { - (inputCtx_0: { - body: { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Stripe.Response; - } : Stripe.Response>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/restore"; - }; - readonly listActiveSubscriptions: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - referenceId?: string | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]; - } : { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]>; - options: { - method: "GET"; - query: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - }, { - referenceId?: string | undefined; - }>>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/list"; - }; - readonly subscriptionSuccess: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: better_call87.APIError; - } : better_call87.APIError>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/success"; - }; - }; - init(ctx: better_auth771.AuthContext): { - options: { - databaseHooks: { - user: { - create: { - after(user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }, ctx: better_auth771.GenericEndpointContext | undefined): Promise; - }; - }; - }; - }; - }; - schema: { - user: { - fields: { - stripeCustomerId: { - type: "string"; - required: false; - }; - }; - }; - subscription?: { - fields: { - plan: { - type: "string"; - required: true; - }; - referenceId: { - type: "string"; - required: true; - }; - stripeCustomerId: { - type: "string"; - required: false; - }; - stripeSubscriptionId: { - type: "string"; - required: false; - }; - status: { - type: "string"; - defaultValue: string; - }; - periodStart: { - type: "date"; - required: false; - }; - periodEnd: { - type: "date"; - required: false; - }; - cancelAtPeriodEnd: { - type: "boolean"; - required: false; - defaultValue: false; - }; - seats: { - type: "number"; - required: false; - }; - }; - } | undefined; - }; - } | { - id: "open-api"; - endpoints: { - generateOpenAPISchema: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }; - } : { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/open-api/generate-schema"; - }; - openAPIReference: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Response; - } : Response>; - options: { - method: "GET"; - metadata: { - isAction: boolean; - }; - } & { - use: any[]; - }; - path: "/reference"; - }; - }; - } | { - id: "two-factor"; - endpoints: { - enableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - issuer?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - backupCodes: string[]; - }; - } : { - totpURI: string; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - issuer: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - password: string; - issuer?: string | undefined; - }, { - password: string; - issuer?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - description: string; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/enable"; - }; - disableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/disable"; - }; - verifyBackupCode: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - disableSession: zod110.ZodOptional; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - twoFactorEnabled: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - session: { - type: string; - properties: { - token: { - type: string; - description: string; - }; - userId: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - expiresAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-backup-code"; - }; - generateBackupCodes: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - enum: boolean[]; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/generate-backup-codes"; - }; - viewBackupCodes: { - (inputCtx_0: { - body: { - userId: string; - }; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "GET"; - body: zod110.ZodObject<{ - userId: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - userId: string; - }, { - userId: string; - }>; - metadata: { - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/two-factor/view-backup-codes"; - }; - sendTwoFactorOTP: { - (inputCtx_0?: ({ - body?: { - trustDevice?: boolean | undefined; - } | undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/send-otp"; - }; - verifyTwoFactorOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }; - } : { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - description: string; - }; - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-otp"; - }; - generateTOTP: { - (inputCtx_0: { - body: { - secret: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - code: string; - }; - } : { - code: string; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - secret: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - secret: string; - }, { - secret: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/totp/generate"; - }; - getTOTPURI: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - }; - } : { - totpURI: string; - }>; - options: { - method: "POST"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/get-totp-uri"; - }; - verifyTOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-totp"; - }; - }; - options: better_auth_plugins857.TwoFactorOptions | undefined; - hooks: { - after: { - matcher(context: better_auth771.HookEndpointContext): boolean; - handler: (inputContext: better_call87.MiddlewareInputContext) => Promise<{ - twoFactorRedirect: boolean; - } | undefined>; - }[]; - }; - schema: { - user: { - fields: { - twoFactorEnabled: { - type: "boolean"; - required: false; - defaultValue: false; - input: false; - }; - }; - }; - twoFactor: { - fields: { - secret: { - type: "string"; - required: true; - returned: false; - }; - backupCodes: { - type: "string"; - required: true; - returned: false; - }; - userId: { - type: "string"; - required: true; - returned: false; - references: { - model: string; - field: string; - }; - }; - }; - }; - }; - rateLimit: { - pathMatcher(path: string): boolean; - window: number; - max: number; - }[]; - $ERROR_CODES: { - readonly OTP_NOT_ENABLED: "OTP not enabled"; - readonly OTP_HAS_EXPIRED: "OTP has expired"; - readonly TOTP_NOT_ENABLED: "TOTP not enabled"; - readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; - readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; - readonly INVALID_BACKUP_CODE: "Invalid backup code"; - readonly INVALID_CODE: "Invalid code"; - readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code."; - readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"; - }; - } | { - id: "expo"; - init: (ctx: better_auth771.AuthContext) => { - options: { - trustedOrigins: string[]; - }; - }; - onRequest(request: Request, ctx: better_auth771.AuthContext): Promise<{ - request: Request; - } | undefined>; - hooks: { - after: { - matcher(context: better_auth771.HookEndpointContext): boolean; - handler: (inputContext: better_call87.MiddlewareInputContext) => Promise; - }[]; - }; - } | { - id: "custom-session"; - endpoints: { - getSession: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null>; - options: { - method: "GET"; - query: zod110.ZodOptional]>>; - disableRefresh: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - }>>; - metadata: { - CUSTOM_SESSION: boolean; - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - nullable: boolean; - items: { - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - requireHeaders: true; - } & { - use: any[]; - }; - path: "/get-session"; - }; - }; - } | { - id: "customGetProviders"; - endpoints: { - customGetProviders: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: any; - } : any>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-providers"; - }; - }; - } | { - id: "getAccountInfo"; - endpoints: { - getAccountInfo: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null; - } : ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-account-info"; - }; - }; - } | { - id: "deleteUserCustom"; - endpoints: { - deleteUserCustom: { - (inputCtx_0: { - body: { - TOTPCode: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: void; - } : void>; - options: { - method: "POST"; - body: zod_v490.ZodObject<{ - TOTPCode: zod_v490.ZodString; - }, zod_v4_core91.$strip>; - } & { - use: any[]; - }; - path: "/delete-user-custom"; - }; - }; - } | { - id: "oneTimeToken"; - endpoints: { - generateOneTimeToken: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - }; - } : { - token: string; - }>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - } & { - use: any[]; - }; - path: "/one-time-token/generate"; - }; - applyOneTimeToken: { - (inputCtx_0: { - body: { - token: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - token: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - } & { - use: any[]; - }; - path: "/one-time-token/apply"; - }; - }; - })[]; - }>> & { - name?: string; - image?: string; - }; - }; - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - name: { - type: string; - description: string; - }; - image: { - type: string; - description: string; - }; - }; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/update-user"; - }; - deleteUser: { - (inputCtx_0: { - body: { - password?: string | undefined; - token?: string | undefined; - callbackURL?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - success: boolean; - message: string; - }; - } : { - success: boolean; - message: string; - }>; - options: { - method: "POST"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - body: zod110.ZodObject<{ - callbackURL: zod110.ZodOptional; - password: zod110.ZodOptional; - token: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - password?: string | undefined; - token?: string | undefined; - callbackURL?: string | undefined; - }, { - password?: string | undefined; - token?: string | undefined; - callbackURL?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - success: { - type: string; - description: string; - }; - message: { - type: string; - enum: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/delete-user"; - }; - forgetPasswordCallback: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query: { - callbackURL: string; - }; - } & { - params: { - token: string; - }; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: never; - } : never>; - options: { - method: "GET"; - query: zod110.ZodObject<{ - callbackURL: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - callbackURL: string; - }, { - callbackURL: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/reset-password/:token"; - }; - listSessions: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: better_auth771.Prettify<{ - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }>[]; - } : better_auth771.Prettify<{ - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }>[]>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - requireHeaders: true; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - items: { - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/list-sessions"; - }; - revokeSession: { - (inputCtx_0: { - body: { - token: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - token: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - requireHeaders: true; - metadata: { - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/revoke-session"; - }; - revokeSessions: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - requireHeaders: true; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/revoke-sessions"; - }; - revokeOtherSessions: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - requireHeaders: true; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/revoke-other-sessions"; - }; - linkSocialAccount: { - (inputCtx_0: { - body: { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; - scopes?: string[] | undefined; - callbackURL?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - }; - } : { - url: string; - redirect: boolean; - }>; - options: { - method: "POST"; - requireHeaders: true; - body: zod110.ZodObject<{ - callbackURL: zod110.ZodOptional; - provider: zod110.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom")[]]>; - scopes: zod110.ZodOptional>; - }, "strip", zod110.ZodTypeAny, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; - scopes?: string[] | undefined; - callbackURL?: string | undefined; - }, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; - scopes?: string[] | undefined; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - url: { - type: string; - description: string; - }; - redirect: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/link-social"; - }; - listUserAccounts: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - id: string; - provider: string; - createdAt: Date; - updatedAt: Date; - accountId: string; - scopes: string[]; - }[]; - } : { - id: string; - provider: string; - createdAt: Date; - updatedAt: Date; - accountId: string; - scopes: string[]; - }[]>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - items: { - type: string; - properties: { - id: { - type: string; - }; - provider: { - type: string; - }; - createdAt: { - type: string; - format: string; - }; - updatedAt: { - type: string; - format: string; - }; - }; - accountId: { - type: string; - }; - scopes: { - type: string; - items: { - type: string; - }; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/list-accounts"; - }; - deleteUserCallback: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query: { - token: string; - callbackURL?: string | undefined; - }; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - success: boolean; - message: string; - }; - } : { - success: boolean; - message: string; - }>; - options: { - method: "GET"; - query: zod110.ZodObject<{ - token: zod110.ZodString; - callbackURL: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - token: string; - callbackURL?: string | undefined; - }, { - token: string; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - success: { - type: string; - description: string; - }; - message: { - type: string; - enum: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/delete-user/callback"; - }; - unlinkAccount: { - (inputCtx_0: { - body: { - providerId: string; - accountId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - providerId: zod110.ZodString; - accountId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - providerId: string; - accountId?: string | undefined; - }, { - providerId: string; - accountId?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/unlink-account"; - }; - refreshToken: { - (inputCtx_0: { - body: { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: better_auth771.OAuth2Tokens; - } : better_auth771.OAuth2Tokens>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - providerId: zod110.ZodString; - accountId: zod110.ZodOptional; - userId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }, { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }>; - 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; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/refresh-token"; - }; - getAccessToken: { - (inputCtx_0: { - body: { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - accessToken: string | undefined; - accessTokenExpiresAt: Date | undefined; - scopes: string[]; - idToken: string | undefined; - }; - } : { - accessToken: string | undefined; - accessTokenExpiresAt: Date | undefined; - scopes: string[]; - idToken: string | undefined; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - providerId: zod110.ZodString; - accountId: zod110.ZodOptional; - userId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }, { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }>; - 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; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/get-access-token"; - }; - } & { - generateOpenAPISchema: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }; - } : { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/open-api/generate-schema"; - }; - openAPIReference: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Response; - } : Response>; - options: { - method: "GET"; - metadata: { - isAction: boolean; - }; - } & { - use: any[]; - }; - path: "/reference"; - }; - } & { - customGetProviders: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: any; - } : any>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-providers"; - }; - } & { - getAccountInfo: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null; - } : ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-account-info"; - }; - } & { - deleteUserCustom: { - (inputCtx_0: { - body: { - TOTPCode: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: void; - } : void>; - options: { - method: "POST"; - body: zod_v490.ZodObject<{ - TOTPCode: zod_v490.ZodString; - }, zod_v4_core91.$strip>; - } & { - use: any[]; - }; - path: "/delete-user-custom"; - }; - } & { - generateOneTimeToken: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - }; - } : { - token: string; - }>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - } & { - use: any[]; - }; - path: "/one-time-token/generate"; - }; - applyOneTimeToken: { - (inputCtx_0: { - body: { - token: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - token: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - } & { - use: any[]; - }; - path: "/one-time-token/apply"; - }; - } & { - stripeWebhook: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - success: boolean; - }; - } : { - success: boolean; - }>; - options: { - method: "POST"; - metadata: { - isAction: boolean; - }; - cloneRequest: true; - } & { - use: any[]; - }; - path: "/stripe/webhook"; - }; - } & { - readonly upgradeSubscription: { - (inputCtx_0: { - body: { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }; - } : { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - plan: zod110.ZodString; - annual: zod110.ZodOptional; - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - metadata: zod110.ZodOptional>; - seats: zod110.ZodOptional; - successUrl: zod110.ZodDefault; - cancelUrl: zod110.ZodDefault; - returnUrl: zod110.ZodOptional; - disableRedirect: zod110.ZodDefault; - }, "strip", zod110.ZodTypeAny, { - plan: string; - successUrl: string; - cancelUrl: string; - disableRedirect: boolean; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - returnUrl?: string | undefined; - }, { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/upgrade"; - }; - readonly cancelSubscriptionCallback: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: never; - } : never>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/cancel/callback"; - }; - readonly cancelSubscription: { - (inputCtx_0: { - body: { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - }; - } : { - url: string; - redirect: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - returnUrl: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/cancel"; - }; - readonly restoreSubscription: { - (inputCtx_0: { - body: { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Stripe.Response; - } : Stripe.Response>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/restore"; - }; - readonly listActiveSubscriptions: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - referenceId?: string | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]; - } : { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]>; - options: { - method: "GET"; - query: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - }, { - referenceId?: string | undefined; - }>>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/list"; - }; - readonly subscriptionSuccess: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: better_call87.APIError; - } : better_call87.APIError>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/success"; - }; - } & { - enableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - issuer?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - backupCodes: string[]; - }; - } : { - totpURI: string; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - issuer: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - password: string; - issuer?: string | undefined; - }, { - password: string; - issuer?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - description: string; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/enable"; - }; - disableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/disable"; - }; - verifyBackupCode: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - disableSession: zod110.ZodOptional; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - twoFactorEnabled: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - session: { - type: string; - properties: { - token: { - type: string; - description: string; - }; - userId: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - expiresAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-backup-code"; - }; - generateBackupCodes: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - enum: boolean[]; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/generate-backup-codes"; - }; - viewBackupCodes: { - (inputCtx_0: { - body: { - userId: string; - }; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "GET"; - body: zod110.ZodObject<{ - userId: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - userId: string; - }, { - userId: string; - }>; - metadata: { - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/two-factor/view-backup-codes"; - }; - sendTwoFactorOTP: { - (inputCtx_0?: ({ - body?: { - trustDevice?: boolean | undefined; - } | undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/send-otp"; - }; - verifyTwoFactorOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }; - } : { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - description: string; - }; - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-otp"; - }; - generateTOTP: { - (inputCtx_0: { - body: { - secret: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - code: string; - }; - } : { - code: string; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - secret: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - secret: string; - }, { - secret: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/totp/generate"; - }; - getTOTPURI: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - }; - } : { - totpURI: string; - }>; - options: { - method: "POST"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/get-totp-uri"; - }; - verifyTOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-totp"; - }; - } & { - getSession: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null>; - options: { - method: "GET"; - query: zod110.ZodOptional]>>; - disableRefresh: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - }>>; - metadata: { - CUSTOM_SESSION: boolean; - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - nullable: boolean; - items: { - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - requireHeaders: true; - } & { - use: any[]; - }; - path: "/get-session"; - }; - }>; - options: { - appName: string; - database: (options: BetterAuthOptions) => better_auth771.Adapter; - databaseHooks: { - user: { - create: { - after: (newUser: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }, context: better_auth771.GenericEndpointContext | undefined) => Promise; - }; - }; - }; - advanced: { - database: { - generateId: false; - }; - defaultCookieAttributes: { - sameSite: "none"; - secure: true; - }; - }; - session: { - updateAge: number; - expiresIn: number; - }; - basePath: string; - trustedOrigins: string[]; - user: { - additionalFields: { - handle: { - type: "string"; - }; - socialLinks: { - type: "string"; - transform: { - input: (value: string | number | boolean | string[] | Date | number[] | null | undefined) => string; - output: (value: string | number | boolean | string[] | Date | number[] | null | undefined) => any; - }; - }; - bio: { - type: "string"; - }; - website: { - type: "string"; - }; - deleted: { - type: "boolean"; - }; - role: { - type: "string"; - }; - roleEndAt: { - type: "date"; - }; - }; - changeEmail: { - enabled: true; - sendChangeEmailVerification: ({ - user, - url - }: { - user: better_auth771.User; - newEmail: string; - url: string; - token: string; - }) => Promise; - }; - }; - account: { - accountLinking: { - enabled: true; - trustedProviders: ("github" | "apple" | "google")[]; - allowDifferentEmails: true; - }; - }; - socialProviders: { - google: { - clientId: string; - clientSecret: string; - }; - github: { - clientId: string; - clientSecret: string; - }; - apple: { - enabled: boolean; - clientId: string; - clientSecret: string; - appBundleIdentifier: string | undefined; - }; - }; - emailAndPassword: { - enabled: true; - sendResetPassword({ - user, - url - }: { - user: better_auth771.User; - url: string; - token: string; - }): Promise; - }; - emailVerification: { - sendOnSignUp: true; - sendVerificationEmail({ - user, - url - }: { - user: better_auth771.User; - url: string; - token: string; - }): Promise; - }; - plugins: ({ - id: "stripe"; - endpoints: { - stripeWebhook: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - success: boolean; - }; - } : { - success: boolean; - }>; - options: { - method: "POST"; - metadata: { - isAction: boolean; - }; - cloneRequest: true; - } & { - use: any[]; - }; - path: "/stripe/webhook"; - }; - } & { - readonly upgradeSubscription: { - (inputCtx_0: { - body: { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }; - } : { - url: string; - redirect: boolean; - } | { - redirect: boolean; - id: string; - object: "checkout.session"; - adaptive_pricing: Stripe.Checkout.Session.AdaptivePricing | null; - after_expiration: Stripe.Checkout.Session.AfterExpiration | null; - allow_promotion_codes: boolean | null; - amount_subtotal: number | null; - amount_total: number | null; - automatic_tax: Stripe.Checkout.Session.AutomaticTax; - billing_address_collection: Stripe.Checkout.Session.BillingAddressCollection | null; - cancel_url: string | null; - client_reference_id: string | null; - client_secret: string | null; - collected_information: Stripe.Checkout.Session.CollectedInformation | null; - consent: Stripe.Checkout.Session.Consent | null; - consent_collection: Stripe.Checkout.Session.ConsentCollection | null; - created: number; - currency: string | null; - currency_conversion: Stripe.Checkout.Session.CurrencyConversion | null; - custom_fields: Array; - custom_text: Stripe.Checkout.Session.CustomText; - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - customer_creation: Stripe.Checkout.Session.CustomerCreation | null; - customer_details: Stripe.Checkout.Session.CustomerDetails | null; - customer_email: string | null; - discounts: Array | null; - expires_at: number; - invoice: string | Stripe.Invoice | null; - invoice_creation: Stripe.Checkout.Session.InvoiceCreation | null; - line_items?: Stripe.ApiList; - livemode: boolean; - locale: Stripe.Checkout.Session.Locale | null; - metadata: Stripe.Metadata | null; - mode: Stripe.Checkout.Session.Mode; - optional_items?: Array | null; - payment_intent: string | Stripe.PaymentIntent | null; - payment_link: string | Stripe.PaymentLink | null; - payment_method_collection: Stripe.Checkout.Session.PaymentMethodCollection | null; - payment_method_configuration_details: Stripe.Checkout.Session.PaymentMethodConfigurationDetails | null; - payment_method_options: Stripe.Checkout.Session.PaymentMethodOptions | null; - payment_method_types: Array; - payment_status: Stripe.Checkout.Session.PaymentStatus; - permissions: Stripe.Checkout.Session.Permissions | null; - phone_number_collection?: Stripe.Checkout.Session.PhoneNumberCollection; - presentment_details?: Stripe.Checkout.Session.PresentmentDetails; - recovered_from: string | null; - redirect_on_completion?: Stripe.Checkout.Session.RedirectOnCompletion; - return_url?: string; - saved_payment_method_options: Stripe.Checkout.Session.SavedPaymentMethodOptions | null; - setup_intent: string | Stripe.SetupIntent | null; - shipping_address_collection: Stripe.Checkout.Session.ShippingAddressCollection | null; - shipping_cost: Stripe.Checkout.Session.ShippingCost | null; - shipping_options: Array; - status: Stripe.Checkout.Session.Status | null; - submit_type: Stripe.Checkout.Session.SubmitType | null; - subscription: string | Stripe.Subscription | null; - success_url: string | null; - tax_id_collection?: Stripe.Checkout.Session.TaxIdCollection; - total_details: Stripe.Checkout.Session.TotalDetails | null; - ui_mode: Stripe.Checkout.Session.UiMode | null; - url: string | null; - lastResponse: { - headers: { - [key: string]: string; - }; - requestId: string; - statusCode: number; - apiVersion?: string; - idempotencyKey?: string; - stripeAccount?: string; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - plan: zod110.ZodString; - annual: zod110.ZodOptional; - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - metadata: zod110.ZodOptional>; - seats: zod110.ZodOptional; - successUrl: zod110.ZodDefault; - cancelUrl: zod110.ZodDefault; - returnUrl: zod110.ZodOptional; - disableRedirect: zod110.ZodDefault; - }, "strip", zod110.ZodTypeAny, { - plan: string; - successUrl: string; - cancelUrl: string; - disableRedirect: boolean; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - returnUrl?: string | undefined; - }, { - plan: string; - metadata?: Record | undefined; - annual?: boolean | undefined; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - seats?: number | undefined; - successUrl?: string | undefined; - cancelUrl?: string | undefined; - returnUrl?: string | undefined; - disableRedirect?: boolean | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/upgrade"; - }; - readonly cancelSubscriptionCallback: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: never; - } : never>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/cancel/callback"; - }; - readonly cancelSubscription: { - (inputCtx_0: { - body: { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - url: string; - redirect: boolean; - }; - } : { - url: string; - redirect: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - returnUrl: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - returnUrl: string; - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/cancel"; - }; - readonly restoreSubscription: { - (inputCtx_0: { - body: { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Stripe.Response; - } : Stripe.Response>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - referenceId: zod110.ZodOptional; - subscriptionId: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }, { - referenceId?: string | undefined; - subscriptionId?: string | undefined; - }>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/restore"; - }; - readonly listActiveSubscriptions: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - referenceId?: string | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]; - } : { - limits: Record | undefined; - priceId: string | undefined; - id: string; - plan: string; - stripeCustomerId?: string; - stripeSubscriptionId?: string; - trialStart?: Date; - trialEnd?: Date; - referenceId: string; - status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid"; - periodStart?: Date; - periodEnd?: Date; - cancelAtPeriodEnd?: boolean; - groupId?: string; - seats?: number; - }[]>; - options: { - method: "GET"; - query: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - referenceId?: string | undefined; - }, { - referenceId?: string | undefined; - }>>; - use: (((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>) | ((inputContext: better_call87.MiddlewareInputContext) => Promise))[]; - } & { - use: any[]; - }; - path: "/subscription/list"; - }; - readonly subscriptionSuccess: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: better_call87.APIError; - } : better_call87.APIError>; - options: { - method: "GET"; - query: zod110.ZodOptional>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise)[]; - } & { - use: any[]; - }; - path: "/subscription/success"; - }; - }; - init(ctx: better_auth771.AuthContext): { - options: { - databaseHooks: { - user: { - create: { - after(user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }, ctx: better_auth771.GenericEndpointContext | undefined): Promise; - }; - }; - }; - }; - }; - schema: { - user: { - fields: { - stripeCustomerId: { - type: "string"; - required: false; - }; - }; - }; - subscription?: { - fields: { - plan: { - type: "string"; - required: true; - }; - referenceId: { - type: "string"; - required: true; - }; - stripeCustomerId: { - type: "string"; - required: false; - }; - stripeSubscriptionId: { - type: "string"; - required: false; - }; - status: { - type: "string"; - defaultValue: string; - }; - periodStart: { - type: "date"; - required: false; - }; - periodEnd: { - type: "date"; - required: false; - }; - cancelAtPeriodEnd: { - type: "boolean"; - required: false; - defaultValue: false; - }; - seats: { - type: "number"; - required: false; - }; - }; - } | undefined; - }; - } | { - id: "open-api"; - endpoints: { - generateOpenAPISchema: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }; - } : { - openapi: string; - info: { - title: string; - description: string; - version: string; - }; - components: { - securitySchemes: { - apiKeyCookie: { - type: string; - in: string; - name: string; - description: string; - }; - bearerAuth: { - type: string; - scheme: string; - description: string; - }; - }; - schemas: {}; - }; - security: { - apiKeyCookie: never[]; - bearerAuth: never[]; - }[]; - servers: { - url: string; - }[]; - tags: { - name: string; - description: string; - }[]; - paths: Record; - }>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/open-api/generate-schema"; - }; - openAPIReference: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: Response; - } : Response>; - options: { - method: "GET"; - metadata: { - isAction: boolean; - }; - } & { - use: any[]; - }; - path: "/reference"; - }; - }; - } | { - id: "two-factor"; - endpoints: { - enableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - issuer?: string | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - backupCodes: string[]; - }; - } : { - totpURI: string; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - issuer: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - password: string; - issuer?: string | undefined; - }, { - password: string; - issuer?: string | undefined; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - description: string; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/enable"; - }; - disableTwoFactor: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/disable"; - }; - verifyBackupCode: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string | undefined; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - disableSession: zod110.ZodOptional; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - twoFactorEnabled: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - session: { - type: string; - properties: { - token: { - type: string; - description: string; - }; - userId: { - type: string; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - expiresAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-backup-code"; - }; - generateBackupCodes: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - description: string; - enum: boolean[]; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/generate-backup-codes"; - }; - viewBackupCodes: { - (inputCtx_0: { - body: { - userId: string; - }; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - backupCodes: string[]; - }; - } : { - status: boolean; - backupCodes: string[]; - }>; - options: { - method: "GET"; - body: zod110.ZodObject<{ - userId: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - userId: string; - }, { - userId: string; - }>; - metadata: { - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/two-factor/view-backup-codes"; - }; - sendTwoFactorOTP: { - (inputCtx_0?: ({ - body?: { - trustDevice?: boolean | undefined; - } | undefined; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - status: boolean; - }; - } : { - status: boolean; - }>; - options: { - method: "POST"; - body: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/send-otp"; - }; - verifyTwoFactorOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }; - } : { - token: string; - user: { - id: any; - email: any; - emailVerified: any; - name: any; - image: any; - createdAt: any; - updatedAt: any; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - description: string; - }; - user: { - type: string; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - emailVerified: { - type: string; - nullable: boolean; - description: string; - }; - name: { - type: string; - nullable: boolean; - description: string; - }; - image: { - type: string; - format: string; - nullable: boolean; - description: string; - }; - createdAt: { - type: string; - format: string; - description: string; - }; - updatedAt: { - type: string; - format: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-otp"; - }; - generateTOTP: { - (inputCtx_0: { - body: { - secret: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - code: string; - }; - } : { - code: string; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - secret: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - secret: string; - }, { - secret: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - SERVER_ONLY: true; - }; - } & { - use: any[]; - }; - path: "/totp/generate"; - }; - getTOTPURI: { - (inputCtx_0: { - body: { - password: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - totpURI: string; - }; - } : { - totpURI: string; - }>; - options: { - method: "POST"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - body: zod110.ZodObject<{ - password: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - password: string; - }, { - password: string; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/get-totp-uri"; - }; - verifyTOTP: { - (inputCtx_0: { - body: { - code: string; - trustDevice?: boolean | undefined; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }; - } : { - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - code: zod110.ZodString; - trustDevice: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - code: string; - trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/two-factor/verify-totp"; - }; - }; - options: better_auth_plugins857.TwoFactorOptions | undefined; - hooks: { - after: { - matcher(context: better_auth771.HookEndpointContext): boolean; - handler: (inputContext: better_call87.MiddlewareInputContext) => Promise<{ - twoFactorRedirect: boolean; - } | undefined>; - }[]; - }; - schema: { - user: { - fields: { - twoFactorEnabled: { - type: "boolean"; - required: false; - defaultValue: false; - input: false; - }; - }; - }; - twoFactor: { - fields: { - secret: { - type: "string"; - required: true; - returned: false; - }; - backupCodes: { - type: "string"; - required: true; - returned: false; - }; - userId: { - type: "string"; - required: true; - returned: false; - references: { - model: string; - field: string; - }; - }; - }; - }; - }; - rateLimit: { - pathMatcher(path: string): boolean; - window: number; - max: number; - }[]; - $ERROR_CODES: { - readonly OTP_NOT_ENABLED: "OTP not enabled"; - readonly OTP_HAS_EXPIRED: "OTP has expired"; - readonly TOTP_NOT_ENABLED: "TOTP not enabled"; - readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; - readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; - readonly INVALID_BACKUP_CODE: "Invalid backup code"; - readonly INVALID_CODE: "Invalid code"; - readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code."; - readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"; - }; - } | { - id: "expo"; - init: (ctx: better_auth771.AuthContext) => { - options: { - trustedOrigins: string[]; - }; - }; - onRequest(request: Request, ctx: better_auth771.AuthContext): Promise<{ - request: Request; - } | undefined>; - hooks: { - after: { - matcher(context: better_auth771.HookEndpointContext): boolean; - handler: (inputContext: better_call87.MiddlewareInputContext) => Promise; - }[]; - }; - } | { - id: "custom-session"; - endpoints: { - getSession: { - (inputCtx_0: { - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - } | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - } & { - image: string | null; - handle: string | null; - twoFactorEnabled: boolean | null; - socialLinks: Record | null; - bio: string | null; - website: string | null; - role: string | null; - roleEndAt: Date | null; - deleted: boolean | null; - }; - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - role: UserRole.PreProTrial | UserRole.PrePro | UserRole.Free | UserRole.Trial; - roleEndAt: Date | null | undefined; - } | null>; - options: { - method: "GET"; - query: zod110.ZodOptional]>>; - disableRefresh: zod110.ZodOptional; - }, "strip", zod110.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { - disableCookieCache?: string | boolean | undefined; - disableRefresh?: boolean | undefined; - }>>; - metadata: { - CUSTOM_SESSION: boolean; - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - nullable: boolean; - items: { - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - requireHeaders: true; - } & { - use: any[]; - }; - path: "/get-session"; - }; - }; - } | { - id: "customGetProviders"; - endpoints: { - customGetProviders: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: any; - } : any>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-providers"; - }; - }; - } | { - id: "getAccountInfo"; - endpoints: { - getAccountInfo: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null; - } : ({ - id: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - }; - accountId?: undefined; - } | { - id: string; - accountId: string; - provider: string; - profile: { - id: string; - name?: string; - email?: string | null; - image?: string; - emailVerified: boolean; - } | undefined; - })[] | null>; - options: { - method: "GET"; - } & { - use: any[]; - }; - path: "/get-account-info"; - }; - }; - } | { - id: "deleteUserCustom"; - endpoints: { - deleteUserCustom: { - (inputCtx_0: { - body: { - TOTPCode: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: void; - } : void>; - options: { - method: "POST"; - body: zod_v490.ZodObject<{ - TOTPCode: zod_v490.ZodString; - }, zod_v4_core91.$strip>; - } & { - use: any[]; - }; - path: "/delete-user-custom"; - }; - }; - } | { - id: "oneTimeToken"; - endpoints: { - generateOneTimeToken: { - (inputCtx_0?: ({ - body?: undefined; - } & { - method?: "GET" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - token: string; - }; - } : { - token: string; - }>; - options: { - method: "GET"; - use: ((inputContext: better_call87.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - } & { - use: any[]; - }; - path: "/one-time-token/generate"; - }; - applyOneTimeToken: { - (inputCtx_0: { - body: { - token: string; - }; - } & { - method?: "POST" | undefined; - } & { - query?: Record | undefined; - } & { - params?: Record; - } & { - request?: Request; - } & { - headers?: HeadersInit; - } & { - asResponse?: boolean; - returnHeaders?: boolean; - use?: better_call87.Middleware[]; - path?: string; - } & { - asResponse?: AsResponse | undefined; - returnHeaders?: ReturnHeaders | undefined; - }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { - headers: Headers; - response: { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }; - } : { - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - } & Record; - }>; - options: { - method: "POST"; - body: zod110.ZodObject<{ - token: zod110.ZodString; - }, "strip", zod110.ZodTypeAny, { - token: string; - }, { - token: string; - }>; - } & { - use: any[]; - }; - path: "/one-time-token/apply"; - }; - }; - })[]; - }; - $context: Promise; - $Infer: { - Session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined | undefined; - userAgent?: string | null | undefined | undefined; - }; - user: { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - handle: string; - deleted: boolean; - bio: string; - website: string; - socialLinks: string; - role: string; - roleEndAt: Date; - stripeCustomerId?: string | null | undefined; - twoFactorEnabled: boolean | null | undefined; - }; - }; - }; - $ERROR_CODES: { - readonly OTP_NOT_ENABLED: "OTP not enabled"; - readonly OTP_HAS_EXPIRED: "OTP has expired"; - readonly TOTP_NOT_ENABLED: "TOTP not enabled"; - readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; - readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; - readonly INVALID_BACKUP_CODE: "Invalid backup code"; - readonly INVALID_CODE: "Invalid code"; - readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code."; - readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"; - } & { - USER_NOT_FOUND: string; - FAILED_TO_CREATE_USER: string; - FAILED_TO_CREATE_SESSION: string; - FAILED_TO_UPDATE_USER: string; - FAILED_TO_GET_SESSION: string; - INVALID_PASSWORD: string; - INVALID_EMAIL: string; - INVALID_EMAIL_OR_PASSWORD: string; - SOCIAL_ACCOUNT_ALREADY_LINKED: string; - PROVIDER_NOT_FOUND: string; - INVALID_TOKEN: string; - ID_TOKEN_NOT_SUPPORTED: string; - FAILED_TO_GET_USER_INFO: string; - USER_EMAIL_NOT_FOUND: string; - EMAIL_NOT_VERIFIED: string; - PASSWORD_TOO_SHORT: string; - PASSWORD_TOO_LONG: string; - USER_ALREADY_EXISTS: string; - EMAIL_CAN_NOT_BE_UPDATED: string; - CREDENTIAL_ACCOUNT_NOT_FOUND: string; - SESSION_EXPIRED: string; - FAILED_TO_UNLINK_LAST_ACCOUNT: string; - ACCOUNT_NOT_FOUND: string; - }; -}; -//#endregion -//#region src/types/auth.d.ts -type AuthSession = Awaited>; -type AuthUser = NonNullable["user"]; -//#endregion -//#region src/bootstrap.d.ts -declare const _routes: hono_hono_base42.HonoBase | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: {}; - output: { - code: 0; - data?: { - createdAt: string | null; - updatedAt: string | null; - userId: string; - rules?: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }[] | null | undefined; - } | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $put: { - input: { - json: { - rules?: { - name: string; - condition: { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | { - value: string; - field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[][]; - result: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - webhooks?: string[] | undefined; - }; - }[] | null | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/actions"> | hono_types2.MergeSchemaPath & hono_types2.MergeSchemaPath<{ - "/": { - $post: { - input: { - json: { - messages: any[]; - context?: { - mainEntryId?: string | undefined; - referEntryIds?: string[] | undefined; - referFeedIds?: string[] | undefined; - selectedText?: string | undefined; - } | undefined; - }; - }; - output: Response; - outputFormat: "json"; - status: hono_utils_http_status0.StatusCode; - }; - }; -}, "/chat"> & hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - view: "0" | "1"; - startDate: string; - }; - }; - output: { - code: 0; - data: string; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/daily"> & hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - id: string; - language?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - target?: "content" | "readabilityContent" | undefined; - }; - }; - output: { - code: 0; - data?: string | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/summary"> & hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - id: string; - language: "en" | "ja" | "zh-CN" | "zh-TW"; - fields: string; - part?: string | undefined; - }; - }; - output: { - code: 0; - data?: { - description?: string | undefined; - title?: string | undefined; - content?: string | undefined; - readabilityContent?: string | undefined; - } | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/translation">, "/ai"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - view?: string | undefined; - }; - }; - output: { - data?: string[] | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - feedIdList: string[]; - deleteSubscriptions: boolean; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $patch: { - input: { - json: { - category: string; - feedIdList: string[]; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/categories"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - entryId: string; - }; - }; - output: { - code: 0; - data: boolean; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $post: { - input: { - json: { - entryId: string; - view?: number | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - entryId: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/collections"> | hono_types2.MergeSchemaPath<{ - "/": { - $post: { - input: { - json: { - keyword: string; - target?: "feeds" | "lists" | undefined; - }; - }; - output: { - data: { - entries?: { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - feedId: string; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - }[] | undefined; - updatesPerWeek?: number | undefined; - subscriptionCount?: number | undefined; - feed?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - } | undefined; - list?: { - id: string; - createdAt: string | null; - updatedAt: string | null; - type: "list"; - view: number; - feedIds: string[]; - fee: number; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - feeds?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[] | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - } | undefined; - docs?: string | undefined; - analytics?: { - view: number | null; - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: string | null; - } | undefined; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/rsshub": { - $get: { - input: { - query: { - category?: string | undefined; - categories?: string | undefined; - namespace?: string | undefined; - lang?: string | undefined; - }; - }; - output: { - data: { - [x: string]: { - name: string; - description: string; - url: string; - lang: string; - routes: { - [x: string]: { - path: string; - name: string; - example: string; - description: string; - categories: string[]; - parameters: { - [x: string]: string; - }; - maintainers: string[]; - location: string; - view?: number | undefined; - }; - }; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/rsshub/route": { - $get: { - input: { - query: { - route: string; - }; - }; - output: { - data: { - name: string; - description: string; - url: string; - prefix: string; - route?: any; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/rsshub-analytics": { - $get: { - input: { - query: { - lang?: string | undefined; - }; - }; - output: { - data: { - [x: string]: { - subscriptionCount: number; - topFeeds: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[]; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/discover"> | hono_types2.MergeSchemaPath & hono_types2.MergeSchemaPath<{ - "/:id": { - $get: { - input: { - param: { - id?: any; - }; - } & { - query: { - size?: number | undefined; - page?: number | undefined; - }; - }; - output: { - code: 0; - data: { - users: { - [x: string]: { - id: string; - name: string | null; - image: string | null; - handle: string | null; - }; - }; - total: number; - entryReadHistories: { - userIds: string[]; - readCount: number; - } | null; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/read-histories"> & hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - insertedAfter: number; - view?: number | undefined; - feedId?: string | undefined; - read?: string | undefined; - feedIdList?: string[] | undefined; - }; - }; - output: { - code: 0; - data: { - has_new: boolean; - entry_id?: string | undefined; - lastest_at?: string | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/check-new"> & { - "/": { - $post: { - input: { - json: { - view?: number | undefined; - feedId?: string | undefined; - read?: boolean | undefined; - listId?: string | undefined; - feedIdList?: string[] | undefined; - limit?: number | undefined; - publishedAfter?: string | undefined; - publishedBefore?: string | undefined; - collected?: boolean | undefined; - isCollection?: boolean | undefined; - isArchived?: boolean | undefined; - withContent?: boolean | undefined; - excludePrivate?: boolean | undefined; - }; - }; - output: { - code: 0; - data?: { - entries: { - id: string; - description: string | null; - title: string | null; - author: string | null; - url: string | null; - language: string | null; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - }; - feeds: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }; - read: boolean | null; - view?: number | undefined; - from?: string[] | undefined; - collections?: { - createdAt: string; - } | undefined; - settings?: { - disabled?: boolean | undefined; - translation?: boolean | "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - summary?: boolean | undefined; - readability?: boolean | undefined; - sourceContent?: boolean | undefined; - silence?: boolean | undefined; - block?: boolean | undefined; - star?: boolean | undefined; - newEntryNotification?: boolean | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - webhooks?: string[] | undefined; - } | undefined; - }[] | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - data?: { - entries: { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - title_keyword?: string | undefined; - } | null | undefined; - }; - feeds: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }; - } | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/readability": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - data: { - content?: string | null | undefined; - } | null; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/stream": { - $post: { - input: { - json: { - ids: string[]; - }; - }; - output: {}; - outputFormat: "text"; - status: 200; - }; - }; -} & { - "/preview": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - data: { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - language: string | null; - feedId: string; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/entries"> | hono_types2.MergeSchemaPath & { - "/": { - $get: { - input: { - query: { - id?: string | undefined; - url?: string | undefined; - entriesLimit?: number | undefined; - }; - }; - output: { - code: 0; - data: { - entries: { - description: string | null; - title: string | null; - author: string | null; - url: string | null; - language: string | null; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - }[]; - subscriptionCount: number; - feed: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }; - readCount: number; - subscription?: { - createdAt: string; - userId: string; - title: string | null; - view: number; - category: string | null; - feedId: string; - isPrivate: boolean; - } | undefined; - analytics?: { - view: number | null; - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: string | null; - } | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/refresh": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/reset": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/analytics": { - $post: { - input: { - json: { - id: string[]; - }; - }; - output: { - code: 0; - data: { - analytics: { - [x: string]: { - view: number | null; - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: string | null; - }; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/feeds"> | hono_types2.MergeSchemaPath<{ - "/new": { - $post: { - input: { - json: { - TOTPCode?: string | undefined; - }; - }; - output: { - code: 0; - data: string; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/use": { - $post: { - input: { - json: { - code: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: {}; - output: { - code: 0; - data: { - code: string; - createdAt: string | null; - users: { - id: string; - name: string | null; - image: string | null; - } | null; - usedAt: string | null; - toUserId: string | null; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/limitation": { - $get: { - input: {}; - output: { - code: 0; - data: number; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/invitations"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - id?: string | undefined; - handle?: string | undefined; - }; - }; - output: { - code: 0; - data: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/batch": { - $post: { - input: { - json: { - ids: string[]; - }; - }; - output: { - code: 0; - data: { - [x: string]: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/profiles"> | hono_types2.MergeSchemaPath<{ - "/": { - $post: { - input: { - json: { - entryIds: string[]; - isInbox?: boolean | undefined; - readHistories?: string[] | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - entryId: string; - isInbox?: boolean | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: { - query: { - view?: string | undefined; - }; - }; - output: { - code: 0; - data: { - [x: string]: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/all": { - $post: { - input: { - json: { - view?: number | undefined; - feedId?: string | undefined; - listId?: string | undefined; - feedIdList?: string[] | undefined; - inboxId?: string | undefined; - excludePrivate?: boolean | undefined; - startTime?: number | undefined; - endTime?: number | undefined; - insertedBefore?: number | undefined; - }; - }; - output: { - code: 0; - data: { - read: { - [x: string]: number; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/total-count": { - $get: { - input: {}; - output: { - code: 0; - data: { - count: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/reads"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - tab?: "general" | "appearance" | "integration" | "ai" | undefined; - }; - }; - output: { - code: 0; - settings: { - [x: string]: any; - }; - updated: { - [x: string]: string; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/:tab": { - $patch: { - input: { - param: { - tab: string; - }; - } & { - json: Record; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/settings"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - userId?: string | undefined; - view?: string | undefined; - }; - }; - output: { - code: 0; - data: ({ - createdAt: string; - userId: string; - title: string | null; - view: number; - category: string | null; - feeds: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }; - feedId: string; - isPrivate: boolean; - boost: { - boosters: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - }[]; - }; - } | { - createdAt: string; - userId: string; - title: string | null; - view: number; - feedId: string; - isPrivate: boolean; - lists: { - id: string; - createdAt: string | null; - updatedAt: string | null; - type: "list"; - view: number; - feedIds: string[]; - fee: number; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - feeds?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[] | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - }; - listId: string; - category?: string | undefined; - } | { - createdAt: string; - userId: string; - title: string | null; - view: number; - category: string | null; - feedId: string; - isPrivate: boolean; - inboxes: { - id: string; - type: "inbox"; - secret: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - }; - inboxId: string; - })[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $post: { - input: { - json: { - view: number; - title?: string | null | undefined; - category?: string | null | undefined; - url?: string | undefined; - isPrivate?: boolean | undefined; - listId?: string | undefined; - TOTPCode?: string | undefined; - }; - }; - output: { - code: 0; - feed: { - id: string; - image: string | null; - description: string | null; - title: string | null; - url: string; - siteUrl: string | null; - checkedAt: string; - lastModifiedHeader: string | null; - etagHeader: string | null; - ttl: number | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string | null; - language: string | null; - migrateTo: string | null; - rsshubRoute: string | null; - rsshubNamespace: string | null; - nsfw: boolean | null; - } | null; - list: { - id: string; - image: string | null; - createdAt: string | null; - updatedAt: string | null; - description: string | null; - title: string; - view: number; - ownerUserId: string; - language: string | null; - feedIds: string[]; - fee: number; - } | null; - unread: { - [x: string]: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - url?: string | undefined; - feedId?: string | undefined; - listId?: string | undefined; - feedIdList?: string[] | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $patch: { - input: { - json: { - view: number; - title?: string | null | undefined; - category?: string | null | undefined; - feedId?: string | undefined; - isPrivate?: boolean | undefined; - listId?: string | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/export": { - $get: { - input: { - query: { - RSSHubURL?: string | undefined; - folderMode?: "view" | "category" | undefined; - }; - }; - output: {}; - outputFormat: string; - status: 200; - }; - }; -} & { - "/import": { - $post: { - input: {}; - output: { - code: 0; - data: { - successfulItems: { - id?: string | undefined; - title?: string | null | undefined; - url?: string | undefined; - }[]; - conflictItems: { - id: string; - url: string; - title?: string | null | undefined; - }[]; - parsedErrorItems: { - url: string; - id?: string | undefined; - title?: string | null | undefined; - }[]; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/batch": { - $patch: { - input: { - json: { - view: number; - feedIds: string[]; - title?: string | null | undefined; - category?: string | null | undefined; - isPrivate?: boolean | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/parse-opml": { - $post: { - input: {}; - output: { - code: 0; - data: { - subscriptions: { - userId: string; - title: string | null; - view: number; - category: string | null; - url: string; - }[]; - remaining: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/subscriptions"> | hono_types2.MergeSchemaPath & hono_types2.MergeSchemaPath<{ - "/tip": { - $post: { - input: { - json: { - amount: string; - entryId: string; - TOTPCode?: string | undefined; - }; - }; - output: { - code: 0; - data: { - transactionHash: string; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: { - query: { - type?: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop" | undefined; - hash?: string | undefined; - fromUserId?: string | undefined; - toUserId?: string | undefined; - toFeedId?: string | undefined; - fromOrToUserId?: string | undefined; - createdAfter?: string | undefined; - }; - }; - output: { - code: 0; - data: { - createdAt: string; - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" | "airdrop"; - hash: string; - powerToken: string; - fromUserId: string | null; - toUserId: string | null; - toFeedId: string | null; - toListId: string | null; - toEntryId: string | null; - toRSSHubId: string | null; - tax: string; - comment: string | null; - fromUser?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - } | null | undefined; - toUser?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - } | null | undefined; - toFeed?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - } | null | undefined; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/claim_daily": { - $post: { - input: {}; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/withdraw": { - $post: { - input: { - json: { - amount: string; - address: string; - TOTPCode?: string | undefined; - toRss3?: boolean | undefined; - }; - }; - output: { - code: 0; - data: { - transactionHash: string; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/claim-check": { - $get: { - input: {}; - output: { - code: 0; - data: boolean; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/transactions"> & { - "/": { - $get: { - input: {}; - output: { - code: 0; - data: { - createdAt: string; - userId: string; - powerToken: string; - addressIndex: number; - address: string | null; - dailyPowerToken: string; - cashablePowerToken: string; - level: { - rank: number | null; - level: number | null; - prevActivityPoints: number | null; - activityPoints: number | null; - } | null; - todayDailyPower: string; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $post: { - input: {}; - output: { - code: 0; - data: string; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/refresh": { - $post: { - input: {}; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/ranking": { - $get: { - input: {}; - output: { - code: 0; - data: { - user: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - }; - userId: string; - rank: number | null; - powerToken: string; - address: string; - level: number | null; - prevActivityPoints: number | null; - activityPoints: number | null; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/power-price": { - $get: { - input: {}; - output: { - code: 0; - data: { - rss3: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/wallets"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - listId: string; - noExtras?: boolean | undefined; - }; - }; - output: { - code: 0; - data: { - entries: { - id: string; - description: string | null; - title: string | null; - content: string | null; - author: string | null; - url: string | null; - feeds: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }; - language: string | null; - feedId: string; - guid: string; - categories: string[] | null; - authorUrl: string | null; - authorAvatar: string | null; - insertedAt: string; - publishedAt: string; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - }[]; - subscriptionCount: number; - list: { - id: string; - createdAt: string | null; - updatedAt: string | null; - type: "list"; - view: number; - feedIds: string[]; - fee: number; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - feeds?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[] | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - }; - readCount: number; - feedCount: number; - subscription?: { - createdAt: string; - userId: string; - title: string | null; - view: number; - isPrivate: boolean; - listId: string; - } | undefined; - analytics?: { - subscriptionCount: number | null; - listId: string; - } | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $post: { - input: { - json: { - title: string; - view: number; - fee: number; - image?: string | null | undefined; - description?: string | null | undefined; - }; - }; - output: { - code: 0; - data: { - id: string; - createdAt: string | null; - updatedAt: string | null; - type: "list"; - view: number; - feedIds: string[]; - fee: number; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - feeds?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[] | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - listId: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $patch: { - input: { - json: { - title: string; - view: number; - fee: number; - listId: string; - image?: string | null | undefined; - description?: string | null | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/list": { - $get: { - input: { - query: { - userId?: string | undefined; - }; - }; - output: { - code: 0; - data: { - id: string; - createdAt: string | null; - updatedAt: string | null; - type: "list"; - view: number; - feedIds: string[]; - fee: number; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - feeds?: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[] | undefined; - ownerUserId?: string | null | undefined; - subscriptionCount?: number | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - purchaseAmount?: number | undefined; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/feeds": { - $post: { - input: { - json: { - feedId: string; - listId: string; - } | { - feedIds: string[]; - listId: string; - }; - }; - output: { - code: 0; - data: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/feeds": { - $delete: { - input: { - json: { - feedId: string; - listId: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/lists"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: {}; - output: {}; - outputFormat: "text"; - status: 200; - }; - }; -} & { - "/pools": { - $get: { - input: {}; - output: { - code: 0; - data: { - totalCount: number; - idleCount: number; - waitingCount: number; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/metrics"> | hono_types2.MergeSchemaPath<{}, "/admin"> | hono_types2.MergeSchemaPath<{ - "/": { - $delete: { - input: { - json: { - handle: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: { - query: { - handle: string; - }; - }; - output: { - code: 0; - data: { - id: string; - type: "inbox"; - secret: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $post: { - input: { - json: { - handle: string; - title?: string | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/webhook": { - $post: { - input: { - json: { - guid: string; - publishedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - content?: string | null | undefined; - author?: string | null | undefined; - url?: string | null | undefined; - language?: string | null | undefined; - media?: { - type: "photo" | "video"; - url: string; - width?: number | undefined; - height?: number | undefined; - preview_image_url?: string | undefined; - blurhash?: string | undefined; - }[] | null | undefined; - categories?: string[] | null | undefined; - attachments?: { - url: string; - title?: string | undefined; - duration_in_seconds?: string | number | undefined; - mime_type?: string | undefined; - size_in_bytes?: number | undefined; - }[] | null | undefined; - extra?: { - links?: { - type: string; - url: string; - content_html?: string | undefined; - }[] | null | undefined; - } | null | undefined; - authorUrl?: string | null | undefined; - authorAvatar?: string | null | undefined; - read?: boolean | null | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/email": { - $post: { - input: { - json: { - date: string; - from: { - name?: string | undefined; - address?: string | undefined; - }; - to: { - address: string; - }; - messageId: string; - subject?: string | undefined; - html?: string | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $put: { - input: { - json: { - handle: string; - title: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/list": { - $get: { - input: {}; - output: { - code: 0; - data: { - id: string; - type: "inbox"; - secret: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/inboxes"> | hono_types2.MergeSchemaPath<{ - "/": { - $post: { - input: { - json: { - token: string; - channel: "macos" | "windows" | "linux" | "ios" | "android" | "web" | "desktop"; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/test": { - $get: { - input: { - query: { - channel?: string | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - channel: "macos" | "windows" | "linux" | "ios" | "android" | "web" | "desktop"; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: {}; - output: { - code: 0; - data: { - userId: string | null; - token: string; - channel: "macos" | "windows" | "linux" | "ios" | "android" | "web" | "desktop"; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/messaging"> | hono_types2.MergeSchemaPath<{ - "/configs": { - $get: { - input: {}; - output: { - code: 0; - data: { - AI_CHAT_ENABLED: boolean; - ANNOUNCEMENT: string; - DAILY_CLAIM_AMOUNT: { - trial: number; - normal: number; - }; - DAILY_POWER_PERCENTAGES: number[]; - DAILY_POWER_SUPPLY: number; - IMPORTING_TITLE: string; - INVITATION_ENABLED: boolean; - INVITATION_INTERVAL_DAYS: number; - INVITATION_PRICE: number; - IS_RSS3_TESTNET: boolean; - LEVEL_PERCENTAGES: number[]; - MAX_ACTIONS: number; - MAX_INBOXES: number; - MAX_LISTS: number; - MAX_SUBSCRIPTIONS: number; - MAX_TRIAL_USER_FEED_SUBSCRIPTION: number; - MAX_TRIAL_USER_LIST_SUBSCRIPTION: number; - MAX_WEBHOOKS_PER_ACTION: number; - PRODUCT_HUNT_VOTE_URL: string; - REFERRAL_ENABLED: boolean; - REFERRAL_PRO_PREVIEW_STRIPE_PRICE_IN_DOLLAR: number; - REFERRAL_REQUIRED_INVITATIONS: number; - REFERRAL_RULE_LINK: string; - TAX_POINT: string; - MAS_IN_REVIEW_VERSION?: string | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/status"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: { - query: { - feedId: string; - }; - }; - output: { - code: 0; - data: { - level: number; - monthlyBoostCost: number; - boostCount: number; - remainingBoostsToLevelUp: number; - lastValidBoost: { - hash: string | null; - expiresAt: string; - } | null; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/boosters": { - $get: { - input: { - query: { - feedId: string; - }; - }; - output: { - code: 0; - data: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - twoFactorEnabled: boolean | null; - isAnonymous: boolean | null; - suspended: boolean | null; - deleted: boolean | null; - bio: string | null; - website: string | null; - socialLinks: { - twitter: string; - github: string; - instagram: string; - facebook: string; - youtube: string; - } | null; - stripeCustomerId: string | null; - role: string | null; - roleEndAt: string | null; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $post: { - input: { - json: { - amount: string; - feedId: string; - TOTPCode?: string | undefined; - }; - }; - output: { - code: 0; - data: { - expiresAt: string; - transactionHash: string; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/boosts"> | hono_types2.MergeSchemaPath<{ - "/postgresql": { - $get: { - input: {}; - output: { - code: 0; - data: number; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/redis": { - $get: { - input: {}; - output: { - code: 0; - data: number; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/bullmq": { - $get: { - input: { - query: { - name: "follow-queue" | "admin-wallet-queue"; - }; - }; - output: { - code: 0; - data: { - current: { - completed: number; - wait: number; - failed: number; - }; - metrics: { - completed: { - data: number[]; - count: number; - }; - failed: { - data: number[]; - count: number; - }; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/rsshub": { - $get: { - input: { - query: { - route?: string | undefined; - namespace?: string | undefined; - }; - }; - output: { - code: 0; - data: { - successCount: number; - errorCount: number; - timestamp: string; - successRate: number; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/probes"> | hono_types2.MergeSchemaPath<{ - "/": { - $post: { - input: { - json: { - baseUrl: string; - id?: string | undefined; - accessKey?: string | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/list": { - $get: { - input: {}; - output: { - code: 0; - data: { - id: string; - description: string | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string; - owner: { - id: string; - name: string | null; - image: string | null; - handle: string | null; - } | null; - price: number; - userLimit: number | null; - userCount: number; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $delete: { - input: { - json: { - id: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/use": { - $post: { - input: { - json: { - id: string | null; - TOTPCode?: string | undefined; - durationInMonths?: number | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - data: { - purchase: { - hash: string | null; - expiresAt: string; - } | null; - instance: { - id: string; - description: string | null; - errorMessage: string | null; - errorAt: string | null; - ownerUserId: string; - price: number; - userLimit: number | null; - baseUrl?: string | null | undefined; - accessKey?: string | null | undefined; - }; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/status": { - $get: { - input: {}; - output: { - code: 0; - data: { - purchase: { - hash: string | null; - expiresAt: string; - } | null; - usage?: { - id: string; - userId: string; - rsshubId: string; - } | undefined; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/rsshub"> | hono_types2.MergeSchemaPath<{ - "/avatar": { - $post: { - input: {}; - output: { - code: 0; - url: string; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/upload"> | hono_types2.MergeSchemaPath<{ - "/feeds": { - $get: { - input: { - query: { - view?: number | undefined; - language?: "eng" | "cmn" | undefined; - limit?: number | undefined; - range?: "1d" | "3d" | "7d" | "30d" | undefined; - }; - }; - output: { - code: 0; - data: { - view: number | null; - feedId: string; - feed: { - id: string; - type: "feed"; - url: string; - image?: string | null | undefined; - description?: string | null | undefined; - title?: string | null | undefined; - siteUrl?: string | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; - owner?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - } | null | undefined; - tipUsers?: { - id: string; - name: string | null; - emailVerified: boolean | null; - image: string | null; - handle: string | null; - createdAt: string; - updatedAt: string; - suspended: boolean | null; - deleted: boolean | null; - }[] | null | undefined; - }; - analytics: { - view: number | null; - feedId: string; - updatesPerWeek: number | null; - subscriptionCount: number | null; - latestEntryPublishedAt: string | null; - }; - }[]; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/trending"> | hono_types2.MergeSchemaPath<{ - "/g": { - $post: { - input: { - json: any; - }; - output: Response; - outputFormat: "json"; - status: hono_utils_http_status0.StatusCode; - }; - }; -}, "/data"> | hono_types2.MergeSchemaPath<{ - "/": { - $get: { - input: {}; - output: { - code: 0; - data: { - invitations: { - code: string; - user: { - id: string; - name: string | null; - image: string | null; - } | null; - createdAt: string | null; - usedAt: string | null; - toUserId: string | null; - }[]; - referralCycleDays: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/days": { - $get: { - input: { - query: { - code: string; - }; - }; - output: { - code: 0; - data: { - referralCycleDays: number; - }; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/verify-receipt": { - $post: { - input: { - json: { - appReceipt: string; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/referrals">, "/">; -type AppType = typeof _routes; -//#endregion -export { ActionItem, ActionsModel, AirdropActivity, AppType, AttachmentsModel, AuthSession, AuthUser, CommonEntryFields, ConditionItem, DetailModel, EntriesModel, ExtraModel, FEATURE_NAMES, FeatureFlagInsertModel, FeatureFlagModel, FeatureName, FeedModel, InvitationDB, ListModel, MediaModel, MessagingData, MessagingType, ROLLOUT_TYPES, RolloutType, RolloutValue, SettingsModel, UrlReadsModel, UserFeatureOverrideInsertModel, UserFeatureOverrideModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activities, activitiesOpenAPISchema, activityEnum, airdrops, airdropsOpenAPISchema, applePayTransactions, attachmentsZodSchema, authPlugins, boosts, captcha, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, extraZodSchema, featureFlags, feedAnalytics, feedAnalyticsOpenAPISchema, feedAnalyticsRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, listAnalytics, listAnalyticsOpenAPISchema, listAnalyticsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, readabilities, rsshub, rsshubAnalytics, rsshubAnalyticsOpenAPISchema, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, stripeSubscriptions, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, tools, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, trendingFeeds, trendingFeedsOpenAPISchema, trendingFeedsRelations, twoFactor, uploads, urlReads, urlReadsOpenAPISchema, user$1 as user, userFeatureOverrides, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations }; diff --git a/packages/internal/shared/src/index.ts b/packages/internal/shared/src/index.ts index ee2eae8e1..4d0041ef5 100644 --- a/packages/internal/shared/src/index.ts +++ b/packages/internal/shared/src/index.ts @@ -1,3 +1,2 @@ export * from "./constants" -export type { AppType, languageSchema, users } from "./hono" export * from "./language" diff --git a/packages/internal/shared/src/language.ts b/packages/internal/shared/src/language.ts index 3a19bd35c..f8e39d4cd 100644 --- a/packages/internal/shared/src/language.ts +++ b/packages/internal/shared/src/language.ts @@ -1,8 +1,4 @@ -import type { z } from "zod" - -import type { languageSchema } from "./hono" - -export type SupportedActionLanguage = z.infer +export type SupportedActionLanguage = "en" | "ja" | "zh-CN" | "zh-TW" export const ACTION_LANGUAGE_MAP: Record< SupportedActionLanguage, { diff --git a/packages/internal/store/src/context.ts b/packages/internal/store/src/context.ts index 908be5e2d..6e4e68211 100644 --- a/packages/internal/store/src/context.ts +++ b/packages/internal/store/src/context.ts @@ -1,7 +1,7 @@ import type { AuthClient } from "@follow/shared/auth" import type { QueryClient } from "@tanstack/react-query" -import type { APIClient, FollowAPI } from "./types" +import type { FollowAPI } from "./types" const NO_VALUE_DEFAULT = Symbol("NO_VALUE_DEFAULT") type ContextValue = T | typeof NO_VALUE_DEFAULT @@ -26,11 +26,10 @@ function createJSContext() { } } -export const apiClientContext = createJSContext() export const apiContext = createJSContext() export const authClientContext = createJSContext() export const queryClientContext = createJSContext() -export const apiClient = apiClientContext.consumer + export const api = apiContext.consumer export const authClient = authClientContext.consumer export const queryClient = queryClientContext.consumer diff --git a/packages/internal/store/src/modules/action/constant.ts b/packages/internal/store/src/modules/action/constant.ts index 7fd601b4b..f9baeabc9 100644 --- a/packages/internal/store/src/modules/action/constant.ts +++ b/packages/internal/store/src/modules/action/constant.ts @@ -3,7 +3,7 @@ import type { ActionId, ActionOperation, SupportedLanguages, -} from "@follow/models/types" +} from "@follow-app/client-sdk" import type { ParseKeys } from "i18next" import type { SFSymbol } from "sf-symbols-typescript" diff --git a/packages/internal/store/src/modules/action/hooks.ts b/packages/internal/store/src/modules/action/hooks.ts index fb74abe8b..448e7703a 100644 --- a/packages/internal/store/src/modules/action/hooks.ts +++ b/packages/internal/store/src/modules/action/hooks.ts @@ -1,9 +1,10 @@ -import type { ActionConditionIndex, ActionModel, ActionRules } from "@follow/models/types" +import type { ActionConditionIndex } from "@follow-app/client-sdk" import { useMutation, useQuery } from "@tanstack/react-query" import { FetchError } from "ofetch" import { useCallback } from "react" import type { GeneralMutationOptions } from "../../types" +import type { ActionItem } from "./store" import { actionActions, actionSyncService, useActionStore } from "./store" export const usePrefetchActions = () => { @@ -31,18 +32,18 @@ export const useUpdateActionsMutation = (options?: GeneralMutationOptions) => { }) } -export function useActionRules(): ActionRules -export function useActionRules(selector: (rules: ActionRules) => T): T -export function useActionRules(selector?: (rules: ActionRules) => T) { +export function useActionRules(): ActionItem[] +export function useActionRules(selector: (rules: ActionItem[]) => T): T +export function useActionRules(selector?: (rules: ActionItem[]) => T) { return useActionStore((state) => { const { rules } = state return selector ? selector(rules) : rules }) } -export function useActionRule(index: number): ActionModel | undefined -export function useActionRule(index: number, selector: (rule: ActionModel) => T): T -export function useActionRule(index: number, selector?: (rule: ActionModel) => T) { +export function useActionRule(index: number): ActionItem | undefined +export function useActionRule(index: number, selector: (rule: ActionItem) => T): T +export function useActionRule(index: number, selector?: (rule: ActionItem) => T) { return useActionStore((state) => { const rule = state.rules[index] if (!rule) return diff --git a/packages/internal/store/src/modules/action/store.ts b/packages/internal/store/src/modules/action/store.ts index 21b96502f..07162ff99 100644 --- a/packages/internal/store/src/modules/action/store.ts +++ b/packages/internal/store/src/modules/action/store.ts @@ -1,21 +1,27 @@ import type { ActionConditionIndex, - ActionFilter, ActionFilterItem, ActionId, - ActionModel, - ActionRules, -} from "@follow/models/types" + ActionItem as ActionItemRes, +} from "@follow-app/client-sdk" import { merge } from "es-toolkit/compat" -import { apiClient } from "../../context" +import { api } from "../../context" import { createImmerSetter, createZustandStore } from "../../lib/helper" +export type ActionItem = Omit & { + condition: ActionFilterItem[][] + index: number +} + type ActionStore = { - rules: ActionRules + rules: ActionItem[] isDirty: boolean } +type ActionRules = ActionItem[] +export type ActionModel = ActionItem + export const useActionStore = createZustandStore("action")(() => ({ rules: [], isDirty: false, @@ -25,7 +31,7 @@ const immerSet = createImmerSetter(useActionStore) class ActionSyncService { async fetchRules() { - const res = await apiClient().actions.$get() + const res = await api().actions.get() if (res.data) { actionActions.updateRules( (res.data.rules ?? []).map((rule, index) => { @@ -36,7 +42,7 @@ class ActionSyncService { return { ...rule, - condition: finalCondition as ActionFilter, + condition: finalCondition as ActionFilterItem[][], index, } }), @@ -53,7 +59,7 @@ class ActionSyncService { return null } - const res = await apiClient().actions.$put({ json: { rules: rules as any } }) + const res = await api().actions.put({ rules: rules as any }) actionActions.setDirty(false) return res } diff --git a/packages/internal/store/src/modules/collection/store.ts b/packages/internal/store/src/modules/collection/store.ts index 8b77baa97..6711d28ae 100644 --- a/packages/internal/store/src/modules/collection/store.ts +++ b/packages/internal/store/src/modules/collection/store.ts @@ -2,7 +2,7 @@ import type { FeedViewType } from "@follow/constants" import type { CollectionSchema } from "@follow/database/schemas/types" import { CollectionService } from "@follow/database/services/collection" -import { apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createTransaction, createZustandStore } from "../../lib/helper" import { getEntry } from "../entry/getter" @@ -49,11 +49,9 @@ class CollectionSyncService { ]) }) tx.request(async () => { - await apiClient().collections.$post({ - json: { - entryId, - view, - }, + await api().collections.post({ + entryId, + view, }) }) tx.rollback(() => { @@ -75,10 +73,8 @@ class CollectionSyncService { collectionActions.delete(entryId) }) tx.request(async () => { - await apiClient().collections.$delete({ - json: { - entryId, - }, + await api().collections.delete({ + entryId, }) }) diff --git a/packages/internal/store/src/modules/entry/store.ts b/packages/internal/store/src/modules/entry/store.ts index c1e3636c3..48e84a2b9 100644 --- a/packages/internal/store/src/modules/entry/store.ts +++ b/packages/internal/store/src/modules/entry/store.ts @@ -4,12 +4,11 @@ import { isBizId } from "@follow/utils" import { cloneDeep } from "es-toolkit" import { debounce } from "es-toolkit/compat" -import { api, apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" import { apiMorph } from "../../morph/api" import { dbStoreMorph } from "../../morph/db-store" -import { honoMorph } from "../../morph/hono" import { storeDbMorph } from "../../morph/store-db" import { collectionActions } from "../collection/store" import { clearAllFeedUnreadDirty, clearFeedUnreadDirty } from "../feed/hooks" @@ -558,9 +557,9 @@ class EntrySyncServices { const currentEntry = getEntry(entryId) const res = currentEntry?.inboxHandle || isInbox - ? await apiClient().entries.inbox.$get({ query: { id: entryId } }) - : await apiClient().entries.$get({ query: { id: entryId } }) - const entry = honoMorph.toEntry(res.data) + ? await api().entries.inbox.get({ id: entryId }) + : await api().entries.get({ id: entryId }) + const entry = apiMorph.toEntry(res.data) if (!currentEntry && entry) { await entryActions.upsertMany([entry]) } else { @@ -597,10 +596,8 @@ class EntrySyncServices { let readabilityContent: string | null | undefined try { - const { data: contentByFetch } = await apiClient().entries.readability.$get({ - query: { - id: entryId, - }, + const { data: contentByFetch } = await api().entries.readability({ + id: entryId, }) readabilityContent = contentByFetch?.content || null } catch (error) { @@ -619,13 +616,7 @@ class EntrySyncServices { return entry } - async fetchEntryContentByStream( - remoteEntryIds?: string[], - options?: { - fetch?: typeof fetch - cookie?: string - }, - ) { + async fetchEntryContentByStream(remoteEntryIds?: string[]) { if (!remoteEntryIds || remoteEntryIds.length === 0) return const onlyNoStored = true @@ -645,29 +636,17 @@ class EntrySyncServices { if (nextIds.length === 0) return const readStream = async () => { - // https://github.com/facebook/react-native/issues/37505 - // TODO: And it seems we can not just use fetch from expo for ofetch, need further investigation - const response = await (options?.fetch || fetch)( - apiClient().entries.stream.$url().toString(), - { - method: "POST", - headers: options?.cookie - ? { - cookie: options.cookie, - } - : undefined, - credentials: options?.cookie ? "omit" : "include", - body: JSON.stringify({ - ids: nextIds, - }), - }, - ) + const response = await api().entries.stream({ + ids: nextIds, + }) + if (!response.ok) { console.error("Failed to fetch stream:", response.statusText, await response.text()) return } const reader = response.body?.getReader() + if (!reader) return const decoder = new TextDecoder() @@ -686,6 +665,7 @@ class EntrySyncServices { if (lines[i]!.trim()) { const json = JSON.parse(lines[i]!) // Handle each JSON line here + entryActions.updateEntryContent({ entryId: json.id, content: json.content }) } } @@ -711,13 +691,9 @@ class EntrySyncServices { } async fetchEntryReadHistory(entryId: EntryId, size: number) { - const res = await apiClient().entries["read-histories"][":id"].$get({ - param: { - id: entryId, - }, - query: { - size, - }, + const res = await api().entries.readHistories({ + id: entryId, + size, }) await userActions.upsertMany(Object.values(res.data.users)) @@ -735,7 +711,7 @@ class EntrySyncServices { entryActions.deleteInboxEntryById(entryId) }) tx.request(async () => { - await apiClient().entries.inbox.$delete({ json: { entryId } }) + await api().entries.inbox.delete({ entryId }) }) tx.rollback(() => { entryActions.upsertManyInSession([currentEntry]) diff --git a/packages/internal/store/src/modules/feed/store.ts b/packages/internal/store/src/modules/feed/store.ts index efb684259..09a74b557 100644 --- a/packages/internal/store/src/modules/feed/store.ts +++ b/packages/internal/store/src/modules/feed/store.ts @@ -2,7 +2,7 @@ import type { FeedSchema } from "@follow/database/schemas/types" import { FEED_EXTRA_DATA_KEYS, FeedService } from "@follow/database/services/feed" import { isBizId } from "@follow/utils" -import { apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" import { whoami } from "../user/getters" @@ -108,11 +108,9 @@ class FeedSyncServices { return null } - const res = await apiClient().feeds.$get({ - query: { - id, - url, - }, + const res = await api().feeds.get({ + id, + url, }) const nonce = Math.random().toString(36).slice(2, 15) @@ -136,10 +134,8 @@ class FeedSyncServices { } async fetchFeedByUrl({ url }: FeedQueryParams) { - const res = await apiClient().feeds.$get({ - query: { - url, - }, + const res = await api().feeds.get({ + url, }) const nonce = Math.random().toString(36).slice(2, 15) @@ -174,10 +170,8 @@ class FeedSyncServices { }) tx.request(async () => { - await apiClient().feeds.claim.challenge.$post({ - json: { - feedId, - }, + await api().feeds.claim.challenge({ + feedId, }) }) @@ -198,10 +192,8 @@ class FeedSyncServices { async fetchAnalytics(feedId: string | string[]) { const feedIds = Array.isArray(feedId) ? feedId : [feedId] - const res = await apiClient().feeds.analytics.$post({ - json: { - id: feedIds, - }, + const res = await api().feeds.analytics({ + id: feedIds, }) const { analytics } = res.data diff --git a/packages/internal/store/src/modules/inbox/store.ts b/packages/internal/store/src/modules/inbox/store.ts index 68ba7e98e..e9f0cec80 100644 --- a/packages/internal/store/src/modules/inbox/store.ts +++ b/packages/internal/store/src/modules/inbox/store.ts @@ -1,7 +1,7 @@ import type { InboxSchema } from "@follow/database/schemas/types" import { InboxService } from "@follow/database/services/inbox" -import { apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" import type { InboxModel } from "./types" @@ -84,11 +84,9 @@ class InboxSyncService { await inboxActions.upsertManyInSession([newInbox]) }) tx.request(async () => { - await apiClient().inboxes.$post({ - json: { - handle, - title, - }, + await api().inboxes.post({ + handle, + title, }) }) @@ -110,11 +108,9 @@ class InboxSyncService { await inboxActions.upsertManyInSession([newInbox]) }) tx.request(async () => { - await apiClient().inboxes.$put({ - json: { - handle, - title, - }, + await api().inboxes.put({ + handle, + title, }) }) @@ -130,10 +126,8 @@ class InboxSyncService { const tx = createTransaction(inbox) tx.store(async () => inboxActions.deleteById(inboxId)) tx.request(async () => { - await apiClient().inboxes.$delete({ - json: { - handle: inboxId, - }, + await api().inboxes.delete({ + handle: inboxId, }) }) diff --git a/packages/internal/store/src/modules/list/store.ts b/packages/internal/store/src/modules/list/store.ts index 32fa53906..d25b867f7 100644 --- a/packages/internal/store/src/modules/list/store.ts +++ b/packages/internal/store/src/modules/list/store.ts @@ -1,10 +1,10 @@ import { ListService } from "@follow/database/services/list" import { clone } from "es-toolkit" -import { apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" -import { honoMorph } from "../../morph/hono" +import { apiMorph } from "../../morph/api" import { storeDbMorph } from "../../morph/store-db" import { feedActions } from "../feed/store" import { subscriptionActions, subscriptionSyncService } from "../subscription/store" @@ -79,31 +79,29 @@ export const listActions = new ListActions() class ListSyncServices { async fetchListById(params: { id: string | undefined }) { if (!params.id) return null - const list = await apiClient().lists.$get({ query: { listId: params.id } }) + const list = await api().lists.get({ listId: params.id }) - await listActions.upsertMany([honoMorph.toList(list.data.list)]) + await listActions.upsertMany([apiMorph.toList(list.data.list)]) return list.data } async fetchOwnedLists() { - const res = await apiClient().lists.list.$get({ query: {} }) - await listActions.upsertMany(res.data.map((list) => honoMorph.toList(list))) + const res = await api().lists.list({}) + await listActions.upsertMany(res.data.map((list) => apiMorph.toList(list))) - return res.data.map((list) => honoMorph.toList(list)) + return res.data.map((list) => apiMorph.toList(list)) } async createList(params: { list: CreateListModel }) { - const res = await apiClient().lists.$post({ - json: { - title: params.list.title, - description: params.list.description, - image: params.list.image, - view: params.list.view, - fee: params.list.fee || 0, - }, + const res = await api().lists.create({ + title: params.list.title, + description: params.list.description, + image: params.list.image, + view: params.list.view, + fee: params.list.fee || 0, }) - await listActions.upsertMany([honoMorph.toList(res.data)]) + await listActions.upsertMany([apiMorph.toList(res.data)]) await subscriptionActions.upsertMany([ { isPrivate: false, @@ -142,9 +140,7 @@ class ListSyncServices { }) tx.request(async () => { - await apiClient().lists.$patch({ - json: nextModel, - }) + await api().lists.update(nextModel) }) tx.persist(async () => { @@ -177,7 +173,7 @@ class ListSyncServices { tx.request(async () => { await subscriptionSyncService.unsubscribe([listId]) - await apiClient().lists.$delete({ json: { listId } }) + await api().lists.delete({ listId }) }) tx.rollback(() => { @@ -197,14 +193,12 @@ class ListSyncServices { async addFeedsToFeedList( params: { listId: string; feedIds: string[] } | { listId: string; feedId: string }, ) { - const feeds = await apiClient().lists.feeds.$post({ - json: params, - }) + const feeds = await api().lists.addFeeds(params) const list = get().lists[params.listId] if (!list) return feeds.data.forEach((feed) => { - feedActions.upsertMany([honoMorph.toFeed(feed)]) + feedActions.upsertMany([apiMorph.toFeedFromAddFeeds(feed)]) }) await listActions.upsertMany([ { ...list, feedIds: [...list.feedIds, ...feeds.data.map((feed) => feed.id)] }, @@ -212,9 +206,7 @@ class ListSyncServices { } async removeFeedFromFeedList(params: { listId: string; feedId: string }) { - await apiClient().lists.feeds.$delete({ - json: params, - }) + await api().lists.removeFeed(params) const list = get().lists[params.listId] if (!list) return diff --git a/packages/internal/store/src/modules/summary/store.ts b/packages/internal/store/src/modules/summary/store.ts index 84b49ada9..7e2aede71 100644 --- a/packages/internal/store/src/modules/summary/store.ts +++ b/packages/internal/store/src/modules/summary/store.ts @@ -3,7 +3,7 @@ import { summaryService } from "@follow/database/services/summary" import type { SupportedActionLanguage } from "@follow/shared" import { parseHtml } from "@follow/utils/html" -import { apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" import { getEntry } from "../entry/getter" @@ -106,7 +106,9 @@ class SummaryActions implements Resetable, Hydratable { if (entries.length <= 10) return - const sortedEntries = entries.sort(([, a], [, b]) => a.lastAccessed - b.lastAccessed) + const sortedEntries = entries.sort( + ([, a], [, b]) => (a?.lastAccessed || 0) - (b?.lastAccessed || 0), + ) const entriesToRemove = sortedEntries.slice(0, entries.length - 10) @@ -174,13 +176,11 @@ class SummarySyncService { }) // Use Our AI to generate summary - const pendingPromise = apiClient() - .ai.summary.$get({ - query: { - id: entryId, - language: actionLanguage, - target, - }, + const pendingPromise = api() + .ai.summary({ + id: entryId, + language: actionLanguage, + target, }) .then((summary) => { immerSet((state) => { diff --git a/packages/internal/store/src/modules/translation/hooks.ts b/packages/internal/store/src/modules/translation/hooks.ts index 3bd955787..2abea05ee 100644 --- a/packages/internal/store/src/modules/translation/hooks.ts +++ b/packages/internal/store/src/modules/translation/hooks.ts @@ -1,5 +1,5 @@ -import type { SupportedLanguages } from "@follow/models/types" import type { SupportedActionLanguage } from "@follow/shared" +import type { SupportedLanguages } from "@follow-app/client-sdk" import { useQueries } from "@tanstack/react-query" import { useCallback } from "react" diff --git a/packages/internal/store/src/modules/translation/store.ts b/packages/internal/store/src/modules/translation/store.ts index 3f61e7fb9..d100f018d 100644 --- a/packages/internal/store/src/modules/translation/store.ts +++ b/packages/internal/store/src/modules/translation/store.ts @@ -2,7 +2,7 @@ import type { TranslationSchema } from "@follow/database/schemas/types" import { TranslationService } from "@follow/database/services/translation" import type { SupportedActionLanguage } from "@follow/shared" -import { apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" import { getEntry } from "../entry/getter" @@ -116,9 +116,7 @@ class TranslationSyncService { if (fields.length === 0) return null - const res = await apiClient().ai.translation.$get({ - query: { id: entryId, language, fields: fields.join(",") }, - }) + const res = await api().ai.translation({ id: entryId, language, fields: fields.join(",") }) if (!res.data) return null diff --git a/packages/internal/store/src/modules/unread/store.ts b/packages/internal/store/src/modules/unread/store.ts index d0274afd7..e7e7bcbd3 100644 --- a/packages/internal/store/src/modules/unread/store.ts +++ b/packages/internal/store/src/modules/unread/store.ts @@ -5,7 +5,7 @@ import { UnreadService } from "@follow/database/services/unread" import type { MarkAllAsReadRequest } from "@follow-app/client-sdk" import { isEqual } from "es-toolkit" -import { api, apiClient } from "../../context" +import { api } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createTransaction, createZustandStore } from "../../lib/helper" import { getEntry } from "../entry/getter" @@ -32,9 +32,7 @@ const set = useUnreadStore.setState class UnreadSyncService { async resetFromRemote() { - const res = await apiClient().reads.$get({ - query: {}, - }) + const res = await api().reads.get({}) if (isEqual(res.data, get().data)) { return res.data @@ -213,13 +211,9 @@ class UnreadSyncService { tx.request(async () => { if (read) { - await apiClient().reads.$post({ - json: { entryIds: [entryId], isInbox }, - }) + await api().reads.markAsRead({ entryIds: [entryId], isInbox }) } else { - await apiClient().reads.$delete({ - json: { entryId, isInbox }, - }) + await api().reads.markAsUnread({ entryId, isInbox }) } }) diff --git a/packages/internal/store/src/modules/user/hooks.ts b/packages/internal/store/src/modules/user/hooks.ts index 57d5de607..f798d7152 100644 --- a/packages/internal/store/src/modules/user/hooks.ts +++ b/packages/internal/store/src/modules/user/hooks.ts @@ -2,7 +2,7 @@ import { tracker } from "@follow/tracker" import { useQuery } from "@tanstack/react-query" import { useEffect } from "react" -import { apiClient, queryClient } from "../../context" +import { api, queryClient } from "../../context" import type { GeneralQueryOptions } from "../../types" import { isNewUserQueryKey } from "./constants" import { userSyncService, useUserStore } from "./store" @@ -24,7 +24,7 @@ export const usePrefetchSessionUser = () => { useEffect(() => { if (query.data) { const { user } = query.data - tracker.identify(user) + user && tracker.identify(user) } }, [query.data]) return query @@ -67,7 +67,7 @@ export function useIsNewUser(options?: GeneralQueryOptions) { enabled: options?.enabled, queryKey: isNewUserQueryKey, queryFn: async () => { - const subscriptions = await apiClient().subscriptions.$get({ query: {} }) + const subscriptions = await api().subscriptions.get({}) return subscriptions.data.length < 5 }, }) diff --git a/packages/internal/store/src/modules/user/store.ts b/packages/internal/store/src/modules/user/store.ts index 4450fc011..ee12bc175 100644 --- a/packages/internal/store/src/modules/user/store.ts +++ b/packages/internal/store/src/modules/user/store.ts @@ -1,18 +1,18 @@ import { UserRole } from "@follow/constants" import type { UserSchema } from "@follow/database/schemas/types" import { UserService } from "@follow/database/services/user" -import type { AuthSession } from "@follow/shared/hono" +import type { AuthUser } from "@follow-app/client-sdk" import { create, indexedResolver, windowScheduler } from "@yornaath/batshit" -import { apiClient, authClient } from "../../context" +import { api, authClient } from "../../context" import type { Hydratable, Resetable } from "../../lib/base" import { createImmerSetter, createTransaction, createZustandStore } from "../../lib/helper" -import { honoMorph } from "../../morph/hono" +import { apiMorph } from "../../morph/api" import type { UserProfileEditable } from "./types" export type UserModel = UserSchema -export type MeModel = UserModel & { +export type MeModel = AuthUser & { emailVerified?: boolean twoFactorEnabled?: boolean | null } @@ -39,9 +39,7 @@ const immerSet = createImmerSetter(useUserStore) class UserSyncService { private userBatcher = create({ fetcher: async (userIds: string[]) => { - const res = await apiClient().profiles.batch.$post({ - json: { ids: userIds }, - }) + const res = await api().profiles.getBatch({ ids: userIds }) if (res.code === 0) { const { whoami } = get() @@ -66,17 +64,16 @@ class UserSyncService { }) async whoami() { - const res = (await (apiClient()["better-auth"] as any)[ - "get-session" - ].$get()) as AuthSession | null + const res = await api().auth.getSession() + if (res) { - const user = honoMorph.toUser(res.user, true) + if (!res.user) return res + const user = apiMorph.toWhoami(res.user) immerSet((state) => { - state.whoami = { ...user, emailVerified: res.user.emailVerified } - // @ts-expect-error - state.role = res.role - if (res.roleEndAt) { - state.roleEndAt = new Date(res.roleEndAt) + state.whoami = { ...user, emailVerified: res.user?.emailVerified ?? false } + state.role = res.user?.role as UserRole | null + if (res.user?.roleEndAt) { + state.roleEndAt = new Date(res.user?.roleEndAt) } }) userActions.upsertMany([user]) @@ -95,13 +92,14 @@ class UserSyncService { tx.store(() => { immerSet((state) => { if (!state.whoami) return - state.whoami = { ...state.whoami, ...data } + state.whoami = { ...state.whoami, ...data } as MeModel }) }) tx.request(async () => { await authClient().updateUser({ ...data, + socialLinks: (data.socialLinks || null) as any, }) }) tx.persist(async () => { @@ -179,7 +177,7 @@ class UserSyncService { } async applyInvitationCode(code: string) { - const res = await apiClient().invitations.use.$post({ json: { code } }) + const res = await api().invitations.use({ code }) if (res.code === 0) { immerSet((state) => { state.role = UserRole.Pro @@ -192,8 +190,8 @@ class UserSyncService { async fetchUser(userId: string | undefined) { if (!userId) return null - // 使用批处理器获取用户 const user = await this.userBatcher.fetch(userId) + return user || null } @@ -226,7 +224,7 @@ class UserActions implements Hydratable, Resetable { for (const user of users) { state.users[user.id] = user if (user.isMe) { - state.whoami = { ...user, emailVerified: user.emailVerified ?? false } + state.whoami = { ...user, emailVerified: user.emailVerified ?? false } as MeModel } } }) diff --git a/packages/internal/store/src/morph/api.ts b/packages/internal/store/src/morph/api.ts index 9fdf7bfb8..9a073a4ed 100644 --- a/packages/internal/store/src/morph/api.ts +++ b/packages/internal/store/src/morph/api.ts @@ -1,12 +1,17 @@ import type { FeedSchema, InboxSchema } from "@follow/database/schemas/types" import type { + AddFeedsResponse, + AuthUser, + EntryGetByIdResponse, EntryListResponse, EntryWithFeed, ExtractResponseData, FeedViewType, + InboxEntryGetResponse, InboxListEntry, InboxListEntryResponse, InboxSubscriptionResponse, + ListSchema, ListSubscriptionResponse, SubscriptionWithFeed, } from "@follow-app/client-sdk" @@ -16,8 +21,63 @@ import type { EntryModel } from "../modules/entry/types" import type { FeedModel } from "../modules/feed/types" import type { ListModel } from "../modules/list/types" import type { SubscriptionModel } from "../modules/subscription/types" +import type { MeModel } from "../modules/user/store" class APIMorph { + toList(data: ListSchema): ListModel { + return { + id: data.id, + title: data.title!, + userId: ("ownerUserId" in data && data.ownerUserId ? data.ownerUserId : data.owner?.id)!, + description: data.description!, + view: data.view, + image: data.image!, + ownerUserId: ("ownerUserId" in data && data.ownerUserId ? data.ownerUserId : data.owner?.id)!, + feedIds: (data.feedIds ?? []) as string[], + fee: (data.fee ?? 0) as number, + subscriptionCount: + "subscriptionCount" in data ? (data.subscriptionCount as number | null) : null, + purchaseAmount: + "purchaseAmount" in data && data.purchaseAmount != null + ? String(data.purchaseAmount) + : null, + type: "list", + } + } + + toEntry(data?: InboxEntryGetResponse["data"] | EntryGetByIdResponse["data"]): EntryModel | null { + if (!data) return null + + return { + id: data.entries.id, + title: data.entries.title, + url: data.entries.url, + content: data.entries.content, + readabilityContent: null, + description: data.entries.description, + guid: data.entries.guid, + author: data.entries.author, + authorUrl: data.entries.authorUrl, + authorAvatar: data.entries.authorAvatar, + insertedAt: new Date(data.entries.insertedAt), + publishedAt: new Date(data.entries.publishedAt), + media: data.entries.media ?? null, + categories: data.entries.categories ?? null, + attachments: data.entries.attachments ?? null, + extra: data.entries.extra + ? { + links: data.entries.extra.links ?? undefined, + title_keyword: data.entries.extra.title_keyword ?? undefined, + } + : null, + language: data.entries.language, + feedId: data.feeds.id, + inboxHandle: "feeds" in data ? (data.feeds.type === "inbox" ? data.feeds.id : null) : null, + read: false, + sources: null, + settings: null, + } + } toSubscription( data: (SubscriptionWithFeed | ListSubscriptionResponse | InboxSubscriptionResponse)[], ) { @@ -182,5 +242,44 @@ class APIMorph { tipUserIds: data.tipUsers ? data.tipUsers.map((user) => user.id) : [], } } + + toFeedFromAddFeeds(data: AddFeedsResponse["data"][number]): FeedModel { + return { + type: "feed", + id: data.id, + title: data.title, + url: data.url, + image: data.image, + description: data.description, + ownerUserId: data.ownerUserId, + errorAt: data.errorAt, + errorMessage: data.errorMessage, + siteUrl: data.siteUrl, + tipUserIds: data.tipUsers ? data.tipUsers.map((user) => user.id) : [], + } + } + + toWhoami(data: AuthUser): MeModel { + return { + id: data.id, + name: data.name, + email: data.email, + handle: data.handle, + image: data.image, + emailVerified: data.emailVerified ?? false, + twoFactorEnabled: (data.twoFactorEnabled ?? null) as boolean | null, + bio: data.bio, + website: data.website, + socialLinks: data.socialLinks, + createdAt: data.createdAt, + updatedAt: data.updatedAt, + isAnonymous: data.isAnonymous, + suspended: data.suspended, + role: data.role, + roleEndAt: data.roleEndAt, + deleted: data.deleted, + stripeCustomerId: data.stripeCustomerId, + } + } } export const apiMorph = new APIMorph() diff --git a/packages/internal/store/src/morph/hono.ts b/packages/internal/store/src/morph/hono.ts deleted file mode 100644 index da3c5869c..000000000 --- a/packages/internal/store/src/morph/hono.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { EntryModel } from "../modules/entry/types" -import type { FeedModel } from "../modules/feed/types" -import type { ListModel } from "../modules/list/types" -import type { MeModel } from "../modules/user/store" -import type { HonoApiClient } from "./types" - -/** - * @deprecated - */ -class LegacyHonoMorph { - toList(data: HonoApiClient.List_Get["list"] | HonoApiClient.List_List_Get): ListModel { - return { - id: data.id, - title: data.title!, - userId: data.ownerUserId!, - description: data.description!, - view: data.view, - image: data.image!, - ownerUserId: data.ownerUserId!, - feedIds: data.feedIds!, - fee: data.fee!, - subscriptionCount: "subscriptionCount" in data ? data.subscriptionCount : null, - purchaseAmount: - "purchaseAmount" in data && data.purchaseAmount !== null - ? String(data.purchaseAmount) - : null, - type: "list", - } - } - - toEntry(data?: HonoApiClient.Entry_Get | HonoApiClient.Entry_Inbox_Get): EntryModel | null { - if (!data) return null - - return { - id: data.entries.id, - title: data.entries.title, - url: data.entries.url, - content: data.entries.content, - readabilityContent: null, - description: data.entries.description, - guid: data.entries.guid, - author: data.entries.author, - authorUrl: data.entries.authorUrl, - authorAvatar: data.entries.authorAvatar, - insertedAt: new Date(data.entries.insertedAt), - publishedAt: new Date(data.entries.publishedAt), - media: data.entries.media ?? null, - categories: data.entries.categories ?? null, - attachments: data.entries.attachments ?? null, - extra: data.entries.extra - ? { - links: data.entries.extra.links ?? undefined, - title_keyword: data.entries.extra.title_keyword ?? undefined, - } - : null, - language: data.entries.language, - feedId: data.feeds.id, - inboxHandle: data.feeds.type === "inbox" ? data.feeds.id : null, - read: false, - sources: null, - settings: null, - } - } - - toFeed(data: HonoApiClient.Feed_Get["feed"]): FeedModel { - return { - type: "feed", - id: data.id, - title: data.title, - url: data.url, - image: data.image, - description: data.description, - ownerUserId: data.ownerUserId, - errorAt: data.errorAt, - errorMessage: data.errorMessage, - siteUrl: data.siteUrl, - tipUserIds: data.tipUsers ? data.tipUsers.map((user) => user.id) : [], - } - } - - toUser(data: HonoApiClient.User_Get, isMe?: boolean): MeModel { - return { - id: data.id, - name: data.name, - email: data.email, - handle: data.handle, - image: data.image, - isMe: isMe ?? false, - emailVerified: data.emailVerified, - twoFactorEnabled: data.twoFactorEnabled, - bio: data.bio, - website: data.website, - socialLinks: data.socialLinks, - } - } -} -/** - * @deprecated - */ -export const honoMorph = new LegacyHonoMorph() diff --git a/packages/internal/store/src/morph/types.ts b/packages/internal/store/src/morph/types.ts deleted file mode 100644 index 33f7af432..000000000 --- a/packages/internal/store/src/morph/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable @typescript-eslint/no-namespace */ -import type { AuthSession } from "@follow/shared/hono" - -import type { APIClient } from "../types" - -// Add ExtractData type utility -type ExtractData any> = - Awaited> extends { data?: infer D } ? D : never - -export namespace HonoApiClient { - export type Subscription_Get = ExtractData - export type List_Get = ExtractData - export type Entry_Post = ExtractData - export type Entry_Inbox_Post = ExtractData - export type Entry_Get = ExtractData - export type Entry_Inbox_Get = ExtractData - export type List_List_Get = ExtractData[number] - export type Feed_Get = ExtractData - export type User_Get = Exclude["user"] - - export type ActionRule = Exclude< - ExtractData["rules"], - undefined | null - >[number] - export type ActionSettings = Exclude -} diff --git a/packages/internal/store/src/types.ts b/packages/internal/store/src/types.ts index 62b901031..6c8c36fff 100644 --- a/packages/internal/store/src/types.ts +++ b/packages/internal/store/src/types.ts @@ -1,8 +1,4 @@ -import type { AppType } from "@follow/shared/hono" import type { ModuleAPIs } from "@follow-app/client-sdk" -import type { hc } from "hono/client" - -export type APIClient = ReturnType> export type GeneralMutationOptions = { onSuccess?: () => void diff --git a/packages/internal/tracker/package.json b/packages/internal/tracker/package.json index a0738e584..40973ca9a 100644 --- a/packages/internal/tracker/package.json +++ b/packages/internal/tracker/package.json @@ -8,6 +8,7 @@ "posthog-react-native": "^4.1.3" }, "devDependencies": { + "@follow-app/client-sdk": "catalog:", "@follow/configs": "workspace:*", "@react-native-firebase/analytics": "22.2.1" } diff --git a/packages/internal/tracker/src/tracker-points.ts b/packages/internal/tracker/src/tracker-points.ts index fa95e3f9f..536f6fe77 100644 --- a/packages/internal/tracker/src/tracker-points.ts +++ b/packages/internal/tracker/src/tracker-points.ts @@ -1,12 +1,19 @@ +import type { AuthUser } from "@follow-app/client-sdk" + import { TrackerMapper } from "./enums" import { trackManager } from "./track-manager" -import type { IdentifyPayload } from "./types" export class TrackerPoints { // App - identify(props: IdentifyPayload) { + identify(props: AuthUser) { this.manager.identify(props) - this.track(TrackerMapper.Identify, props) + this.track(TrackerMapper.Identify, { + id: props.id, + name: props.name, + email: props.email, + image: props.image, + handle: props.handle, + }) } appInit(props: { diff --git a/packages/internal/utils/src/headers.ts b/packages/internal/utils/src/headers.ts index e786fc650..76bd55c97 100644 --- a/packages/internal/utils/src/headers.ts +++ b/packages/internal/utils/src/headers.ts @@ -114,6 +114,8 @@ export const createSSRAPIHeaders = ({ version }: { version: string }) => { "X-App-Platform": SSRPlatform.SSR, "X-App-Name": "Folo SSR", "X-App-Version": version, + "User-Agent": + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Folo", ...(DEV ? { "X-App-Dev": "1" } : {}), } } diff --git a/patches/hono.patch b/patches/hono.patch deleted file mode 100644 index 23e38360d..000000000 --- a/patches/hono.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/dist/types/client/types.d.ts b/dist/types/client/types.d.ts -index fb6f879fd1975b72b6c392e540dc3e2a1110e589..827da42e242012a69ad554f866fcfb7fd58692ff 100644 ---- a/dist/types/client/types.d.ts -+++ b/dist/types/client/types.d.ts -@@ -51,7 +51,7 @@ type ClientResponseOfEndpoint = T extends { - output: infer O; - outputFormat: infer F; - status: infer S; --} ? ClientResponse : never; -+} ? O : never; - export interface ClientResponse extends globalThis.Response { - readonly body: ReadableStream | null; - readonly bodyUsed: boolean; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9cd6eb19e..e4003c6e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,9 +46,6 @@ patchedDependencies: daisyui@4.12.24: hash: d393ab1cbfbfcff21dce0796a59c2d8a37e2c6dd634a8ab476cbc67e47b93d9c path: patches/daisyui@4.12.24.patch - hono: - hash: 5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05 - path: patches/hono.patch jsonpointer: hash: ad796d54956ca5a7e9e5232503e5f22d4ffa732fc4552a7e53121ea5fa81d6c1 path: patches/jsonpointer.patch @@ -282,9 +279,6 @@ importers: happy-dom: specifier: 18.0.1 version: 18.0.1 - hono: - specifier: 4.9.7 - version: 4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05) html-minifier-terser: specifier: 7.2.0 version: 7.2.0 @@ -442,9 +436,6 @@ importers: electron-devtools-installer: specifier: 4.0.0 version: 4.0.0 - hono: - specifier: 4.9.7 - version: 4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05) typescript: specifier: 'catalog:' version: 5.9.2 @@ -795,8 +786,8 @@ importers: apps/mobile: dependencies: '@better-auth/expo': - specifier: 1.2.9 - version: 1.2.9(better-auth@1.2.9) + specifier: 1.3.11 + version: 1.3.11(ebc32617e797ca73cc9305706c0ef001) '@expo/metro-runtime': specifier: 5.0.4 version: 5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)) @@ -885,8 +876,8 @@ importers: specifier: 1.5.5 version: 1.5.5 better-auth: - specifier: 1.2.9 - version: 1.2.9 + specifier: 1.3.11 + version: 1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0) camelcase-keys: specifier: 10.0.0 version: 10.0.0 @@ -1001,9 +992,6 @@ importers: franc-min: specifier: 6.2.0 version: 6.2.0 - hono: - specifier: 4.9.7 - version: 4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05) i18next: specifier: 25.5.2 version: 25.5.2(typescript@5.9.2) @@ -1178,6 +1166,9 @@ importers: '@fastify/request-context': specifier: 6.2.0 version: 6.2.0 + '@follow-app/client-sdk': + specifier: 'catalog:' + version: 0.3.65(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)(pg@8.16.3)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@follow/tracker': specifier: workspace:* version: link:../../packages/internal/tracker @@ -1243,7 +1234,7 @@ importers: version: 5.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react-i18next: specifier: 15.7.3 - version: 15.7.3(i18next@25.5.2(typescript@5.9.2))(react-dom@19.0.0(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0)(typescript@5.9.2) + version: 15.7.3(i18next@25.5.2(typescript@5.9.2))(react-dom@19.0.0(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0)(typescript@5.9.2) react-photo-view: specifier: 1.2.7 version: 1.2.7(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -1754,9 +1745,6 @@ importers: '@follow/utils': specifier: workspace:* version: link:../utils - hono: - specifier: 4.9.7 - version: 4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05) devDependencies: '@follow/configs': specifier: workspace:* @@ -1765,17 +1753,20 @@ importers: packages/internal/shared: dependencies: '@better-auth/stripe': - specifier: 1.2.9 - version: 1.2.9 + specifier: 1.3.11 + version: 1.3.11(better-auth@1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(stripe@18.2.1(@types/node@24.5.0)) '@electron-toolkit/preload': specifier: 3.0.2 version: 3.0.2(electron@38.1.0) '@electron-toolkit/tsconfig': specifier: 1.0.1 version: 1.0.1(@types/node@24.5.0) - '@hono/node-server': - specifier: 1.15.0 - version: 1.15.0(hono@4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05)) + '@follow-app/client-sdk': + specifier: 'catalog:' + version: 0.3.65(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)(pg@8.16.3)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@folo-services/drizzle': + specifier: 0.1.26 + version: 0.1.26(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7) '@t3-oss/env-core': specifier: 0.13.8 version: 0.13.8(arktype@2.1.20)(typescript@5.9.2)(zod@3.25.75) @@ -1783,14 +1774,11 @@ importers: specifier: 5.0.4 version: 5.0.4(zod@3.25.75) better-auth: - specifier: 1.2.9 - version: 1.2.9 + specifier: 1.3.11 + version: 1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0) drizzle-orm: specifier: 0.44.3 version: 0.44.3(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)(pg@8.16.3) - hono: - specifier: 4.9.7 - version: 4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05) sonner: specifier: 2.0.7 version: 2.0.7(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -1852,6 +1840,9 @@ importers: specifier: ^4.1.3 version: 4.1.3(d93d72250b78f49b80511c6d88cfb0ac) devDependencies: + '@follow-app/client-sdk': + specifier: 'catalog:' + version: 0.3.65(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)(pg@8.16.3)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@follow/configs': specifier: workspace:* version: link:../../configs @@ -2727,16 +2718,21 @@ packages: resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} engines: {node: '>=6.9.0'} - '@better-auth/expo@1.2.9': - resolution: {integrity: sha512-o2X310PJaWC131zVwpflH9bHgO2fZbbEs4t6sBxazWMVimX4olEd0v8h9M7orhsc+FkUeFhngIOyc6vD1TOUXQ==} + '@better-auth/expo@1.3.11': + resolution: {integrity: sha512-k57iGvtV3GK01Q0YyZItAOYbuHxLxGTsdw4/kcl7ZA5VFmXlhT2UkrtRUCEmc+HO1JDSVbnMoju2rNTO8cf3SA==} peerDependencies: - better-auth: 1.2.9 + better-auth: 1.3.11 + expo-constants: '>=17.0.0' + expo-crypto: '>=13.0.0' + expo-linking: '>=7.0.0' + expo-secure-store: '>=14.0.0' + expo-web-browser: '>=14.0.0' - '@better-auth/stripe@1.2.9': - resolution: {integrity: sha512-p7Q3rX63UBE+KMlRTGHeytp13/g8fQU5w8wcY6FPubsGEAPoZl7ymcqKu3AAxpFTaWOGHPVov+4no7uNGl6Qug==} - - '@better-auth/utils@0.2.5': - resolution: {integrity: sha512-uI2+/8h/zVsH8RrYdG8eUErbuGBk16rZKQfz8CjxQOyCE6v7BqFYEbFwvOkvl1KbUdxhqOnXp78+uE5h8qVEgQ==} + '@better-auth/stripe@1.3.11': + resolution: {integrity: sha512-qyU+VgVCvNWp3wBGwuEvB/pyCZrBfTf5pAfk9+QA25M59iEanLDoHiy3ntiuur8Dgb+jI2cRYY8wLJgNcbga4Q==} + peerDependencies: + better-auth: 1.3.11 + stripe: ^18 '@better-auth/utils@0.3.0': resolution: {integrity: sha512-W+Adw6ZA6mgvnSnhOki270rwJ42t4XzSK6YWGF//BbVXL6SwCLWfyzBc1lN2m/4RM28KubdBKQ4X5VMoLRNPQw==} @@ -4029,6 +4025,9 @@ packages: '@folo-services/constants@0.1.33': resolution: {integrity: sha512-RF6hE4K5tKUUge+uEhM/6A276tuSeqq1oaQjou5/A+JEUa+VDYRIVfeEXoJhxSfdb+fs4oeMlWm0TS4GOa2SMA==} + '@folo-services/drizzle@0.1.26': + resolution: {integrity: sha512-Fy2toVTcmujtOB5IWwcmA/C6J9xjF+ydPwrIk3GUNiNzEBdBPx7rO2EUb8xGisbSAWgWljo0Hq+v4UOOWvtj9w==} + '@folo-services/drizzle@0.1.27': resolution: {integrity: sha512-7bo9ZkBwGaYmDJqo+PX1eLYO0oJQMZqOkUEEchD78GldfnkaR2AQ5SK7BYrb57Qi6MQJ+A1AuFd3DV41o0cJfw==} @@ -4094,12 +4093,6 @@ packages: '@hexagon/base64@1.1.28': resolution: {integrity: sha512-lhqDEAvWixy3bZ+UOYbPwUbBkwBq5C1LAJ/xPC8Oi+lL54oyakv/npbA0aU2hgCsx/1NUd4IBvV03+aUBWxerw==} - '@hono/node-server@1.15.0': - resolution: {integrity: sha512-MjmK4l5N4dQpZ9OSWN0tCj7ejuc7WvuWMzSKtc89bnknJykAeHxzRigXBTYZk85H6Awrii6RM59iUiUluApu2A==} - engines: {node: '>=18.14.1'} - peerDependencies: - hono: ^4 - '@hookform/resolvers@5.2.2': resolution: {integrity: sha512-A/IxlMLShx3KjV/HeTcTfaMxdwy690+L/ZADoeaTltLx+CVuzkeVIPuybK3jrRfw7YZnmdKsVVHAlEPIAEUNlA==} peerDependencies: @@ -4505,17 +4498,10 @@ packages: '@napi-rs/wasm-runtime@0.2.11': resolution: {integrity: sha512-9DPkXtvHydrcOsopiYpUgPHpmj0HWZKMUnL2dZqpvC42lsratuBG06V5ipyno0fUek5VlFsNQ+AcFATSrJXgMA==} - '@noble/ciphers@0.6.0': - resolution: {integrity: sha512-mIbq/R9QXk5/cTfESb1OKtyFnk7oc1Om/8onA1158K9/OZUQFDEVy55jVTato+xmp3XX6F6Qh0zz0Nc1AxAlRQ==} - '@noble/ciphers@2.0.0': resolution: {integrity: sha512-j/l6jpnpaIBM87cAYPJzi/6TgqmBv9spkqPyCXvRYsu5uxqh6tPJZDnD85yo8VWqzTuTQPgfv7NgT63u7kbwAQ==} engines: {node: '>= 20.19.0'} - '@noble/hashes@1.8.0': - resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} - engines: {node: ^14.21.3 || >=16} - '@noble/hashes@2.0.0': resolution: {integrity: sha512-h8VUBlE8R42+XIDO229cgisD287im3kdY6nbNZJFjc6ZvKIXPYXe6Vc/t+kyjFdMFyt5JpapzTsEg8n63w5/lw==} engines: {node: '>= 20.19.0'} @@ -7541,9 +7527,6 @@ packages: before-after-hook@2.2.3: resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - better-auth@1.2.9: - resolution: {integrity: sha512-WLqBXDzuaCQetQctLGC5oTfGmL32zUvxnM4Y+LZkhwseMaZWq5EKI+c/ZATgz2YkFt7726q659PF8CfB9P1VuA==} - better-auth@1.3.10: resolution: {integrity: sha512-cEdvbqJ2TlTXUSktHKs8V3rHdFYkEG7QmQZpLXGjXZX6F0nYbTk2QPsWXNhxbinFAlE2ca4virzuDsmsQlLIVw==} peerDependencies: @@ -7573,6 +7556,35 @@ packages: vue: optional: true + better-auth@1.3.11: + resolution: {integrity: sha512-7l8bHX5rnON4vsVmWB7g2UucNpRlXnDUX/n65mHeR3Zn2/lcpQvfBvGbTaHYU8UGCQadtJ7DLHW/zA3ZR7IfdA==} + peerDependencies: + '@lynx-js/react': '*' + '@sveltejs/kit': ^2.0.0 + next: ^14.0.0 || ^15.0.0 + react: 19.0.0 + react-dom: 19.0.0 + solid-js: ^1.0.0 + svelte: ^4.0.0 || ^5.0.0 + vue: ^3.0.0 + peerDependenciesMeta: + '@lynx-js/react': + optional: true + '@sveltejs/kit': + optional: true + next: + optional: true + react: + optional: true + react-dom: + optional: true + solid-js: + optional: true + svelte: + optional: true + vue: + optional: true + better-call@1.0.19: resolution: {integrity: sha512-sI3GcA1SCVa3H+CDHl8W8qzhlrckwXOTKhqq3OOPXjgn5aTOMIqGY34zLY/pHA6tRRMjTUC3lz5Mi7EbDA24Kw==} @@ -9612,6 +9624,11 @@ packages: expo: '*' react-native: '*' + expo-crypto@15.0.7: + resolution: {integrity: sha512-FUo41TwwGT2e5rA45PsjezI868Ch3M6wbCZsmqTWdF/hr+HyPcrp1L//dsh/hsrsyrQdpY/U96Lu71/wXePJeg==} + peerDependencies: + expo: '*' + expo-dev-client@5.2.1: resolution: {integrity: sha512-SzrHvXeyTGawzc/7ZIHFmaUYiCeRJagL9bJo/yTPmxdycFFOOdLs1FNMFXyYhB6YY4u5EKTCO6g1fug+0GV9sQ==} peerDependencies: @@ -10512,10 +10529,6 @@ packages: hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} - hono@4.9.7: - resolution: {integrity: sha512-t4Te6ERzIaC48W3x4hJmBwgNlLhmiEdEE5ViYb02ffw4ignHNHa5IBtPjmbKstmtKa8X6C35iWwK4HaqvrzG9w==} - engines: {node: '>=16.9.0'} - hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -11086,9 +11099,6 @@ packages: join-component@1.1.0: resolution: {integrity: sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ==} - jose@5.10.0: - resolution: {integrity: sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==} - jose@6.1.0: resolution: {integrity: sha512-TTQJyoEoKcC1lscpVDCSsVgYzUDg/0Bt3WE//WiTPK6uOCQC2KZS4MpugbMWt/zyjkopgZoXhZuCi00gLudfUA==} @@ -12133,10 +12143,6 @@ packages: engines: {node: ^18 || >=20} hasBin: true - nanostores@0.11.4: - resolution: {integrity: sha512-k1oiVNN4hDK8NcNERSZLQiMfRzEGtfnvZvdBvey3SQbgn8Dcrk0h1I6vpxApjb10PFUflZrgJ2WEZyJQ+5v7YQ==} - engines: {node: ^18.0.0 || >=20.0.0} - nanostores@1.0.1: resolution: {integrity: sha512-kNZ9xnoJYKg/AfxjrVL4SS0fKX++4awQReGqWnwTRHxeHGZ1FJFVgTqr/eMrNQdp0Tz7M7tG/TDaX8QfHDwVCw==} engines: {node: ^20.0.0 || >=22.0.0} @@ -17438,22 +17444,21 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 - '@better-auth/expo@1.2.9(better-auth@1.2.9)': + '@better-auth/expo@1.3.11(ebc32617e797ca73cc9305706c0ef001)': dependencies: '@better-fetch/fetch': 1.1.18 - better-auth: 1.2.9 - better-call: 1.0.19 - zod: 3.25.75 + better-auth: 1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + expo-constants: 17.1.6(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)) + expo-crypto: 15.0.7(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0)) + expo-linking: 7.1.5(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0) + expo-secure-store: 14.2.3(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0)) + expo-web-browser: 14.2.0(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)) - '@better-auth/stripe@1.2.9': + '@better-auth/stripe@1.3.11(better-auth@1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(stripe@18.2.1(@types/node@24.5.0))': dependencies: - better-auth: 1.2.9 - zod: 3.25.75 - - '@better-auth/utils@0.2.5': - dependencies: - typescript: 5.9.2 - uncrypto: 0.1.3 + better-auth: 1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + stripe: 18.2.1(@types/node@24.5.0) + zod: 4.1.8 '@better-auth/utils@0.3.0': {} @@ -19668,6 +19673,45 @@ snapshots: dependencies: zod: 3.25.76 + '@folo-services/drizzle@0.1.26(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)': + dependencies: + '@folo-services/exceptions': 0.1.16 + drizzle-orm: 0.44.3(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)(pg@8.16.3) + drizzle-zod: 0.7.1(drizzle-orm@0.44.3(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(kysely@0.28.7)(pg@8.16.3))(zod@3.25.76) + nanoid: 5.1.5 + pg: 8.16.3 + zod: 3.25.76 + transitivePeerDependencies: + - '@aws-sdk/client-rds-data' + - '@cloudflare/workers-types' + - '@electric-sql/pglite' + - '@libsql/client' + - '@libsql/client-wasm' + - '@neondatabase/serverless' + - '@op-engineering/op-sqlite' + - '@opentelemetry/api' + - '@planetscale/database' + - '@prisma/client' + - '@tidbcloud/serverless' + - '@types/better-sqlite3' + - '@types/pg' + - '@types/sql.js' + - '@upstash/redis' + - '@vercel/postgres' + - '@xata.io/client' + - better-sqlite3 + - bun-types + - expo-sqlite + - gel + - knex + - kysely + - mysql2 + - pg-native + - postgres + - prisma + - sql.js + - sqlite3 + '@folo-services/drizzle@0.1.27(@opentelemetry/api@1.9.0)(@types/pg@8.15.4)(expo-sqlite@15.2.12(expo@53.0.12(@babel/core@7.28.4)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)(utf-8-validate@6.0.5)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)(utf-8-validate@6.0.5))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)(utf-8-validate@6.0.5))(react@19.0.0)(utf-8-validate@6.0.5))(react-native@0.79.1(@babel/core@7.28.4)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)(utf-8-validate@6.0.5))(react@19.0.0))(kysely@0.28.7)': dependencies: '@folo-services/exceptions': 0.1.16 @@ -19885,10 +19929,6 @@ snapshots: '@hexagon/base64@1.1.28': {} - '@hono/node-server@1.15.0(hono@4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05))': - dependencies: - hono: 4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05) - '@hookform/resolvers@5.2.2(react-hook-form@7.62.0(react@19.0.0))': dependencies: '@standard-schema/utils': 0.3.0 @@ -20450,12 +20490,8 @@ snapshots: '@tybys/wasm-util': 0.9.0 optional: true - '@noble/ciphers@0.6.0': {} - '@noble/ciphers@2.0.0': {} - '@noble/hashes@1.8.0': {} - '@noble/hashes@2.0.0': {} '@node-kit/extra.fs@3.3.1': {} @@ -24353,22 +24389,25 @@ snapshots: before-after-hook@2.2.3: {} - better-auth@1.2.9: + better-auth@1.3.10(react-dom@19.0.0(react@19.0.0))(react@19.0.0): dependencies: - '@better-auth/utils': 0.2.5 + '@better-auth/utils': 0.3.0 '@better-fetch/fetch': 1.1.18 - '@noble/ciphers': 0.6.0 - '@noble/hashes': 1.8.0 + '@noble/ciphers': 2.0.0 + '@noble/hashes': 2.0.0 '@simplewebauthn/browser': 13.2.0 '@simplewebauthn/server': 13.2.0 better-call: 1.0.19 defu: 6.1.4 - jose: 5.10.0 + jose: 6.1.0 kysely: 0.28.7 - nanostores: 0.11.4 - zod: 3.25.75 + nanostores: 1.0.1 + zod: 4.1.8 + optionalDependencies: + react: 19.0.0 + react-dom: 19.0.0(react@19.0.0) - better-auth@1.3.10(react-dom@19.0.0(react@19.0.0))(react@19.0.0): + better-auth@1.3.11(react-dom@19.0.0(react@19.0.0))(react@19.0.0): dependencies: '@better-auth/utils': 0.3.0 '@better-fetch/fetch': 1.1.18 @@ -26874,6 +26913,11 @@ snapshots: transitivePeerDependencies: - supports-color + expo-crypto@15.0.7(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0)): + dependencies: + base64-js: 1.5.1 + expo: 53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0) + expo-dev-client@5.2.1(expo@53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0)): dependencies: expo: 53.0.12(@babel/core@7.28.0)(@expo/metro-runtime@5.0.4(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0)))(bufferutil@4.0.9)(graphql@16.8.1)(react-native-webview@13.15.0(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0))(react-native@0.79.1(@babel/core@7.28.0)(@types/react@19.1.8)(bufferutil@4.0.9)(react@19.0.0))(react@19.0.0) @@ -28234,8 +28278,6 @@ snapshots: dependencies: react-is: 16.13.1 - hono@4.9.7(patch_hash=5c74c2d2afaa5880c13d75458dd26c84da568851691b1fb6de6d877c29936d05): {} - hookable@5.5.3: {} hosted-git-info@2.8.9: {} @@ -28845,8 +28887,6 @@ snapshots: join-component@1.1.0: {} - jose@5.10.0: {} - jose@6.1.0: {} jotai@2.14.0(@babel/core@7.28.0)(@babel/template@7.27.2)(@types/react@19.1.8)(react@19.0.0): @@ -30288,8 +30328,6 @@ snapshots: nanoid@5.1.5: {} - nanostores@0.11.4: {} - nanostores@1.0.1: {} napi-postinstall@0.2.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b49701346..96ecfc066 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,8 +8,8 @@ packages: - "!**/example/**" catalog: - typescript: 5.9.2 "@follow-app/client-sdk": 0.3.65 + typescript: 5.9.2 tailwindcss-uikit-colors: 1.0.0 ignorePatchFailures: false @@ -50,7 +50,6 @@ overrides: patchedDependencies: re-resizable@6.11.2: patches/re-resizable@6.11.2.patch - hono: patches/hono.patch "@mozilla/readability@0.6.0": patches/@mozilla__readability@0.6.0.patch daisyui@4.12.24: patches/daisyui@4.12.24.patch jsonpointer: patches/jsonpointer.patch diff --git a/scripts/increment-build-id.sh b/scripts/increment-build-id.sh index 38264d8f5..a426475ac 100755 --- a/scripts/increment-build-id.sh +++ b/scripts/increment-build-id.sh @@ -15,9 +15,7 @@ while [[ $# -gt 0 ]]; do shift ;; *) - echo "Unknown option $1" - echo "Usage: $0 [-f|--force]" - exit 1 + shift ;; esac done