diff --git a/electron.vite.config.ts b/electron.vite.config.ts index db36705c67..e3663b8ee9 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -15,6 +15,7 @@ export default defineConfig({ alias: { "@shared": resolve("src/shared/src"), "@env": resolve("./src/env.ts"), + "@pkg": resolve("./package.json"), }, }, }, @@ -22,6 +23,7 @@ export default defineConfig({ resolve: { alias: { "@env": resolve("./src/env.ts"), + "@pkg": resolve("./package.json"), }, }, }, diff --git a/eslint.config.mjs b/eslint.config.mjs index fd92b720f0..0bb6d8f798 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,7 +10,7 @@ export default defineConfig( lineBreak: "after", }, lessOpinionated: true, - ignores: ["src/renderer/src/hono.ts"], + ignores: ["src/renderer/src/hono.ts", "src/hono.ts"], preferESM: false, }, { diff --git a/package.json b/package.json index 7026df7c55..6b39786a8d 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "ofetch": "1.3.4", "path-to-regexp": "7.0.0", "posthog-js": "1.148.0", + "posthog-node": "4.0.1", "react-error-boundary": "4.0.13", "react-fast-marquee": "1.6.5", "react-hook-form": "7.52.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a8cf80675..cfee12b48e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -211,6 +211,9 @@ importers: posthog-js: specifier: 1.148.0 version: 1.148.0 + posthog-node: + specifier: 4.0.1 + version: 4.0.1 react-error-boundary: specifier: 4.0.13 version: 4.0.13(react@18.3.1) @@ -5643,6 +5646,10 @@ packages: posthog-js@1.148.0: resolution: {integrity: sha512-nydf+aret26YViDBwH7DdN/c8dmCzQGNQ1yredeE47UlbpJ3J/iTgskNdmGJIofFcdSagcwAE/FF7s++YfTtvg==} + posthog-node@4.0.1: + resolution: {integrity: sha512-rtqm2h22QxLGBrW2bLYzbRhliIrqgZ0k+gF0LkQ1SNdeD06YE5eilV0MxZppFSxC8TfH0+B0cWCuebEnreIDgQ==} + engines: {node: '>=15.0.0'} + postject@1.0.0-alpha.6: resolution: {integrity: sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==} engines: {node: '>=14.0.0'} @@ -6004,6 +6011,9 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + rusha@0.8.14: + resolution: {integrity: sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA==} + safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -13135,6 +13145,13 @@ snapshots: preact: 10.22.1 web-vitals: 4.2.1 + posthog-node@4.0.1: + dependencies: + axios: 1.7.2 + rusha: 0.8.14 + transitivePeerDependencies: + - debug + postject@1.0.0-alpha.6: dependencies: commander: 9.5.0 @@ -13527,6 +13544,8 @@ snapshots: dependencies: queue-microtask: 1.2.3 + rusha@0.8.14: {} + safe-buffer@5.1.2: {} safer-buffer@2.1.2: {} diff --git a/src/hono.ts b/src/hono.ts new file mode 100644 index 0000000000..7e7337badd --- /dev/null +++ b/src/hono.ts @@ -0,0 +1,3409 @@ +import type * as drizzle_orm from "drizzle-orm" +import type { InferInsertModel } from "drizzle-orm" +import type * as drizzle_orm_pg_core from "drizzle-orm/pg-core" +import type * as hono from "hono" +import type * as hono_hono_base from "hono/hono-base" +import type * as hono_types from "hono/types" +import type * as hono_utils_http_status from "hono/utils/http-status" +import type * as zod from "zod" +import type { z } from "zod" + +declare const actions: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "actions" + schema: undefined + columns: { + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + rules: drizzle_orm_pg_core.PgColumn<{ + name: "rules" + tableName: "actions" + dataType: "array" + columnType: "PgArray" + data: unknown[] + driverParam: string | unknown[] + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: drizzle_orm.Column<{ + name: "rules" + tableName: "actions" + dataType: "json" + columnType: "PgJsonb" + data: unknown + driverParam: unknown + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: never + generated: undefined + }, object, object> + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const languageSchema: z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]> +declare const actionsItemOpenAPISchema: z.ZodObject<{ + name: z.ZodString + condition: z.ZodArray + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]> + value: z.ZodString + }, "strip", z.ZodTypeAny, { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }, { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }>, "many"> + result: z.ZodObject<{ + translation: z.ZodOptional> + summary: z.ZodOptional + rewriteRules: z.ZodOptional, "many">> + blockRules: z.ZodOptional + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]> + value: z.ZodUnion<[z.ZodString, z.ZodNumber]> + }, "strip", z.ZodTypeAny, { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }, { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }>, "many">> + }, "strip", z.ZodTypeAny, { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + }, { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + }> +}, "strip", z.ZodTypeAny, { + name: string + condition: { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] + result: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + } +}, { + name: string + condition: { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] + result: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + } +}> +declare const actionsOpenAPISchema: z.ZodObject | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null, z.ZodTypeDef, string | number | boolean | Record | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null>, "many">> +}, "rules">, { + rules: z.ZodNullable + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]> + value: z.ZodString + }, "strip", z.ZodTypeAny, { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }, { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }>, "many"> + result: z.ZodObject<{ + translation: z.ZodOptional> + summary: z.ZodOptional + rewriteRules: z.ZodOptional, "many">> + blockRules: z.ZodOptional + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]> + value: z.ZodUnion<[z.ZodString, z.ZodNumber]> + }, "strip", z.ZodTypeAny, { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }, { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }>, "many">> + }, "strip", z.ZodTypeAny, { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + }, { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + }> + }, "strip", z.ZodTypeAny, { + name: string + condition: { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] + result: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + } + }, { + name: string + condition: { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] + result: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + } + }>, "many">>> +}>, "strip", z.ZodTypeAny, { + userId: string + rules?: { + name: string + condition: { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] + result: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + } + }[] | null | undefined +}, { + userId: string + rules?: { + name: string + condition: { + value: string + field: "title" | "view" | "site_url" | "feed_url" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] + result: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + blockRules?: { + value: string | number + field: "title" | "content" | "url" | "all" | "author" | "order" + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" + }[] | undefined + } + }[] | null | undefined +}> +declare const actionsRelations: drizzle_orm.Relations<"actions", { + users: drizzle_orm.One<"user", true> +}> +type ActionsModel = z.infer +type SettingsModel = Exclude["result"], undefined> + +declare const collections: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "collections" + schema: undefined + columns: { + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feedId" + 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 + generated: undefined + }, {}, {}> + entryId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + createdAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + view: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const collectionsOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString + feedId: zod.ZodString + entryId: zod.ZodString + createdAt: zod.ZodString + view: zod.ZodNumber +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + view: number + userId: string + createdAt: string + feedId: string + entryId: string +}, { + view: number + userId: string + createdAt: string + feedId: string + entryId: string +}> +declare const collectionsRelations: drizzle_orm.Relations<"collections", { + users: drizzle_orm.One<"user", true> + entries: drizzle_orm.One<"entries", true> + feeds: drizzle_orm.One<"feeds", true> +}> + +type MediaModel = { + url: string + type: "photo" | "video" + preview_image_url?: string +} +type AttachmentsModel = { + url: string + duration_in_seconds?: number + mime_type?: string + size_in_bytes?: number + title?: string +} +declare const entries: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "entries" + schema: undefined + columns: { + id: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + feedId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + title: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + url: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + content: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + description: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + guid: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + author: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + authorUrl: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + authorAvatar: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + changedAt: drizzle_orm_pg_core.PgColumn<{ + name: "changed_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 + generated: undefined + }, {}, {}> + publishedAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + media: drizzle_orm_pg_core.PgColumn<{ + name: "media" + tableName: "entries" + dataType: "array" + columnType: "PgArray" + data: unknown[] + driverParam: string | unknown[] + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: drizzle_orm.Column<{ + name: "media" + tableName: "entries" + dataType: "json" + columnType: "PgJsonb" + data: unknown + driverParam: unknown + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: never + generated: undefined + }, object, object> + generated: undefined + }, {}, {}> + categories: drizzle_orm_pg_core.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_orm.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 + generated: undefined + }, object, object> + generated: undefined + }, {}, {}> + attachments: drizzle_orm_pg_core.PgColumn<{ + name: "attachments" + tableName: "entries" + dataType: "array" + columnType: "PgArray" + data: unknown[] + driverParam: string | unknown[] + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: drizzle_orm.Column<{ + name: "attachments" + tableName: "entries" + dataType: "json" + columnType: "PgJsonb" + data: unknown + driverParam: unknown + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: never + generated: undefined + }, object, object> + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const entriesOpenAPISchema: z.ZodObject + url: z.ZodNullable + content: z.ZodNullable + description: z.ZodNullable + guid: z.ZodString + author: z.ZodNullable + authorUrl: z.ZodNullable + authorAvatar: z.ZodNullable + changedAt: z.ZodString + publishedAt: z.ZodString + media: z.ZodNullable | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null, z.ZodTypeDef, string | number | boolean | Record | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null>, "many">> + categories: z.ZodNullable> + attachments: z.ZodNullable | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null, z.ZodTypeDef, string | number | boolean | Record | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null>, "many">> +}, "media" | "attachments">, { + attachments: z.ZodNullable + type: z.ZodOptional + title: z.ZodOptional + }, "strip", z.ZodTypeAny, { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }, { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }>, "many">>> + media: z.ZodNullable + preview_image_url: z.ZodOptional + }, "strip", z.ZodTypeAny, { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }, { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }>, "many">>> +}>, "strip", z.ZodTypeAny, { + description: string | null + title: string | null + content: string | null + id: string + url: string | null + feedId: string + guid: string + author: string | null + authorUrl: string | null + authorAvatar: string | null + changedAt: string + publishedAt: string + categories: string[] | null + media?: { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }[] | null | undefined + attachments?: { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }[] | null | undefined +}, { + description: string | null + title: string | null + content: string | null + id: string + url: string | null + feedId: string + guid: string + author: string | null + authorUrl: string | null + authorAvatar: string | null + changedAt: string + publishedAt: string + categories: string[] | null + media?: { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }[] | null | undefined + attachments?: { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }[] | null | undefined +}> +declare const entriesRelations: drizzle_orm.Relations<"entries", { + feeds: drizzle_orm.One<"feeds", true> + collections: drizzle_orm.Many<"collections"> + feedPowerTokens: drizzle_orm.One<"feedPowerTokens", true> + entryReadHistories: drizzle_orm.One<"entryReadHistories", true> +}> +type EntriesModel = InferInsertModel & { + attachments?: AttachmentsModel[] | null + media?: MediaModel[] | null +} +declare const entryReadHistories: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "entryReadHistories" + schema: undefined + columns: { + entryId: drizzle_orm_pg_core.PgColumn<{ + name: "entry_id" + tableName: "entryReadHistories" + dataType: "string" + columnType: "PgText" + data: string + driverParam: string + notNull: true + hasDefault: false + isPrimaryKey: true + isAutoincrement: false + hasRuntimeDefault: false + enumValues: [string, ...string[]] + baseColumn: never + generated: undefined + }, {}, {}> + userIds: drizzle_orm_pg_core.PgColumn<{ + name: "user_ids" + tableName: "entryReadHistories" + dataType: "array" + columnType: "PgArray" + data: string[] + driverParam: string | string[] + notNull: true + hasDefault: true + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: [string, ...string[]] + baseColumn: drizzle_orm.Column<{ + name: "user_ids" + tableName: "entryReadHistories" + dataType: "string" + columnType: "PgText" + data: string + driverParam: string + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: [string, ...string[]] + baseColumn: never + generated: undefined + }, object, object> + generated: undefined + }, {}, {}> + readCount: drizzle_orm_pg_core.PgColumn<{ + name: "read_count" + tableName: "entryReadHistories" + dataType: "number" + columnType: "PgInteger" + data: number + driverParam: string | number + notNull: true + hasDefault: true + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: never + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const entryReadHistoriesRelations: drizzle_orm.Relations<"entryReadHistories", { + entry: drizzle_orm.One<"entries", true> +}> +type EntryReadHistoriesModel = InferInsertModel +declare const entryReadHistoriesOpenAPISchema: z.ZodObject<{ + entryId: z.ZodString + userIds: z.ZodArray + readCount: z.ZodNumber +}, z.UnknownKeysParam, z.ZodTypeAny, { + entryId: string + userIds: string[] + readCount: number +}, { + entryId: string + userIds: string[] + readCount: number +}> + +declare const feeds: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "feeds" + schema: undefined + columns: { + id: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + url: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + title: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + description: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + siteUrl: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + image: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + checkedAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + lastModifiedHeader: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + etagHeader: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + ttl: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + errorMessage: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + errorAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + ownerUserId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const feedsOpenAPISchema: zod.ZodObject<{ + id: zod.ZodString + url: zod.ZodString + title: zod.ZodNullable + description: zod.ZodNullable + siteUrl: zod.ZodNullable + image: zod.ZodNullable + checkedAt: zod.ZodString + lastModifiedHeader: zod.ZodNullable + etagHeader: zod.ZodNullable + ttl: zod.ZodNullable + errorMessage: zod.ZodNullable + errorAt: zod.ZodNullable + ownerUserId: zod.ZodNullable +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + description: string | null + title: string | null + id: string + image: 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 +}, { + description: string | null + title: string | null + id: string + image: 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 +}> +declare const feedsInputSchema: zod.ZodObject<{ + description: zod.ZodOptional> + title: zod.ZodOptional> + id: zod.ZodOptional + image: zod.ZodOptional> + url: zod.ZodString + siteUrl: zod.ZodOptional> + checkedAt: zod.ZodString + lastModifiedHeader: zod.ZodOptional> + etagHeader: zod.ZodOptional> + ttl: zod.ZodOptional> + errorMessage: zod.ZodOptional> + errorAt: zod.ZodOptional> + ownerUserId: zod.ZodOptional> +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + url: string + checkedAt: string + description?: string | null | undefined + title?: string | null | undefined + id?: string | undefined + image?: string | null | undefined + siteUrl?: string | null | undefined + lastModifiedHeader?: string | null | undefined + etagHeader?: string | null | undefined + ttl?: number | null | undefined + errorMessage?: string | null | undefined + errorAt?: string | null | undefined + ownerUserId?: string | null | undefined +}, { + url: string + checkedAt: string + description?: string | null | undefined + title?: string | null | undefined + id?: string | undefined + image?: string | null | undefined + siteUrl?: string | null | undefined + lastModifiedHeader?: string | null | undefined + etagHeader?: string | null | undefined + ttl?: number | null | undefined + errorMessage?: string | null | undefined + errorAt?: string | null | undefined + ownerUserId?: string | null | undefined +}> +declare const feedsRelations: drizzle_orm.Relations<"feeds", { + subscriptions: drizzle_orm.Many<"subscriptions"> + entries: drizzle_orm.Many<"entries"> + owner: drizzle_orm.One<"user", false> +}> +type FeedModel = InferInsertModel + +declare const invitations: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "invitations" + schema: undefined + columns: { + code: drizzle_orm_pg_core.PgColumn<{ + name: "code" + tableName: "invitations" + dataType: "string" + columnType: "PgText" + data: string + driverParam: string + notNull: true + hasDefault: false + isPrimaryKey: true + isAutoincrement: false + hasRuntimeDefault: false + enumValues: [string, ...string[]] + baseColumn: never + generated: undefined + }, {}, {}> + createdAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + fromUserId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + toUserId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> + +declare const subscriptions: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "subscriptions" + schema: undefined + columns: { + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + feedId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + view: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + category: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + title: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + isPrivate: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const subscriptionsOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString + feedId: zod.ZodString + view: zod.ZodNumber + category: zod.ZodNullable + title: zod.ZodNullable + isPrivate: zod.ZodBoolean +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + title: string | null + view: number + userId: string + feedId: string + category: string | null + isPrivate: boolean +}, { + title: string | null + view: number + userId: string + feedId: string + category: string | null + isPrivate: boolean +}> +declare const subscriptionsRelations: drizzle_orm.Relations<"subscriptions", { + users: drizzle_orm.One<"user", true> + feeds: drizzle_orm.One<"feeds", true> +}> + +declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "timeline" + schema: undefined + columns: { + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + feedId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + entryId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + publishedAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + view: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + read: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const timelineOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString + feedId: zod.ZodString + entryId: zod.ZodString + publishedAt: zod.ZodString + view: zod.ZodNumber + read: zod.ZodNullable +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + view: number + userId: string + feedId: string + read: boolean | null + publishedAt: string + entryId: string +}, { + view: number + userId: string + feedId: string + read: boolean | null + publishedAt: string + entryId: string +}> +declare const timelineRelations: drizzle_orm.Relations<"timeline", { + entries: drizzle_orm.One<"entries", true> + feeds: drizzle_orm.One<"feeds", true> + collections: drizzle_orm.One<"collections", true> +}> + +declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "user" + schema: undefined + columns: { + id: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + name: drizzle_orm_pg_core.PgColumn<{ + name: "name" + 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 + generated: undefined + }, {}, {}> + email: drizzle_orm_pg_core.PgColumn<{ + name: "email" + tableName: "user" + dataType: "string" + columnType: "PgText" + data: string + driverParam: string + notNull: true + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: [string, ...string[]] + baseColumn: never + generated: undefined + }, {}, {}> + emailVerified: drizzle_orm_pg_core.PgColumn<{ + name: "emailVerified" + tableName: "user" + dataType: "date" + columnType: "PgTimestamp" + data: Date + driverParam: string + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: never + generated: undefined + }, {}, {}> + image: drizzle_orm_pg_core.PgColumn<{ + name: "image" + 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 + generated: undefined + }, {}, {}> + handle: drizzle_orm_pg_core.PgColumn<{ + name: "handle" + 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 + generated: undefined + }, {}, {}> + createdAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const usersOpenApiSchema: z.ZodObject<{ + id: z.ZodString + name: z.ZodNullable + email: z.ZodString + emailVerified: z.ZodNullable + image: z.ZodNullable + handle: z.ZodNullable + createdAt: z.ZodDate +}, z.UnknownKeysParam, z.ZodTypeAny, { + name: string | null + id: string + email: string + emailVerified: string | null + image: string | null + handle: string | null + createdAt: Date +}, { + name: string | null + id: string + email: string + emailVerified: string | null + image: string | null + handle: string | null + createdAt: Date +}> +declare const accounts: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "account" + schema: undefined + columns: { + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + type: drizzle_orm_pg_core.PgColumn<{ + name: "type" + 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 + generated: undefined + }, {}, {}> + provider: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + providerAccountId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + refresh_token: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + access_token: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + expires_at: drizzle_orm_pg_core.PgColumn<{ + name: "expires_at" + tableName: "account" + dataType: "number" + columnType: "PgInteger" + data: number + driverParam: string | number + notNull: false + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: undefined + baseColumn: never + generated: undefined + }, {}, {}> + token_type: drizzle_orm_pg_core.PgColumn<{ + name: "token_type" + 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 + generated: undefined + }, {}, {}> + scope: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + id_token: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + session_state: drizzle_orm_pg_core.PgColumn<{ + name: "session_state" + 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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "session" + schema: undefined + columns: { + sessionToken: drizzle_orm_pg_core.PgColumn<{ + name: "sessionToken" + tableName: "session" + dataType: "string" + columnType: "PgText" + data: string + driverParam: string + notNull: true + hasDefault: false + isPrimaryKey: true + isAutoincrement: false + hasRuntimeDefault: false + enumValues: [string, ...string[]] + baseColumn: never + generated: undefined + }, {}, {}> + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + expires: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const verificationTokens: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "verificationToken" + schema: undefined + columns: { + identifier: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + token: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + expires: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const usersRelations: drizzle_orm.Relations<"user", { + subscriptions: drizzle_orm.Many<"subscriptions"> + collections: drizzle_orm.Many<"collections"> + actions: drizzle_orm.One<"actions", true> + wallets: drizzle_orm.One<"wallets", true> + feeds: drizzle_orm.Many<"feeds"> +}> + +declare const wallets: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "wallets" + schema: undefined + columns: { + addressIndex: drizzle_orm_pg_core.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 + generated: drizzle_orm.GeneratedColumnConfig & { + as: any + type: "always" + } + }, {}, {}> + address: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + userId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + createdAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + dailyPowerToken: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + cashablePowerToken: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const walletsOpenAPISchema: zod.ZodObject<{ + addressIndex: zod.ZodNumber + address: zod.ZodNullable + userId: zod.ZodString + createdAt: zod.ZodString + dailyPowerToken: zod.ZodString + cashablePowerToken: zod.ZodString +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + userId: string + createdAt: string + address: string | null + addressIndex: number + dailyPowerToken: string + cashablePowerToken: string +}, { + userId: string + createdAt: string + address: string | null + addressIndex: number + dailyPowerToken: string + cashablePowerToken: string +}> +declare const walletsRelations: drizzle_orm.Relations<"wallets", { + user: drizzle_orm.One<"user", true> + transactionsFrom: drizzle_orm.Many<"transactions"> + transactionTo: drizzle_orm.Many<"transactions"> +}> +declare const transactionType: drizzle_orm_pg_core.PgEnum<["tip", "mint", "burn", "withdraw"]> +declare const transactions: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "transactions" + schema: undefined + columns: { + hash: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + type: drizzle_orm_pg_core.PgColumn<{ + name: "type" + tableName: "transactions" + dataType: "string" + columnType: "PgEnumColumn" + data: "tip" | "mint" | "burn" | "withdraw" + driverParam: string + notNull: true + hasDefault: false + isPrimaryKey: false + isAutoincrement: false + hasRuntimeDefault: false + enumValues: ["tip", "mint", "burn", "withdraw"] + baseColumn: never + generated: undefined + }, {}, {}> + fromUserId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + toUserId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + toFeedId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + powerToken: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + createdAt: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + comment: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const transactionsOpenAPISchema: zod.ZodObject<{ + hash: zod.ZodString + type: zod.ZodEnum<["tip", "mint", "burn", "withdraw"]> + fromUserId: zod.ZodNullable + toUserId: zod.ZodNullable + toFeedId: zod.ZodNullable + powerToken: zod.ZodString + createdAt: zod.ZodString + comment: zod.ZodNullable +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + type: "tip" | "mint" | "burn" | "withdraw" + createdAt: string + hash: string + fromUserId: string | null + toUserId: string | null + toFeedId: string | null + powerToken: string + comment: string | null +}, { + type: "tip" | "mint" | "burn" | "withdraw" + createdAt: string + hash: string + fromUserId: string | null + toUserId: string | null + toFeedId: string | null + powerToken: string + comment: string | null +}> +declare const transactionsRelations: drizzle_orm.Relations<"transactions", { + fromUser: drizzle_orm.One<"user", false> + toUser: drizzle_orm.One<"user", false> + toFeed: drizzle_orm.One<"feeds", false> + fromWallet: drizzle_orm.One<"wallets", false> + toWallet: drizzle_orm.One<"wallets", false> +}> +declare const feedPowerTokens: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "feedPowerTokens" + schema: undefined + columns: { + feedId: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + powerToken: drizzle_orm_pg_core.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 + generated: undefined + }, {}, {}> + } + dialect: "pg" +}> +declare const feedPowerTokensOpenAPISchema: zod.ZodObject<{ + feedId: zod.ZodString + powerToken: zod.ZodString +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + feedId: string + powerToken: string +}, { + feedId: string + powerToken: string +}> +declare const feedPowerTokensRelations: drizzle_orm.Relations<"feedPowerTokens", { + feed: drizzle_orm.One<"feeds", true> +}> + +declare const _routes: hono_hono_base.HonoBase + code: 0 + } + outputFormat: "json" + status: 200 + } + } + "/reads/all": { + $post: { + input: { + json: { + view?: number | undefined + feedId?: string | undefined + feedIdList?: string[] | undefined + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + } + "/reads/total-count": { + $get: { + input: {} + output: { + data: { + count: number + } + code: 0 + } + outputFormat: "json" + status: 200 + } + } +} & { + "/collections": { + $get: { + input: { + query: { + entryId: string + } + } + output: { + data: boolean + code: 0 + } + outputFormat: "json" + status: 200 + } + $post: { + input: { + json: { + entryId: string + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + $delete: { + input: { + json: { + entryId: string + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + } +} & { + "/categories": { + $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 + } + } +} & { + "/feeds/claim/message": { + $get: { + input: { + query: { + feedId: string + } + } + output: { + data: { + json: string + description: string + xml: string + content: string + } + code: 0 + } + outputFormat: "json" + status: 200 + } + } + "/feeds/claim/challenge": { + $post: { + input: { + json: { + feedId: string + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + } + "/feeds": { + $get: { + input: { + query: { + id?: string | undefined + url?: string | undefined + } + } + output: { + data: { + readCount: number + feed: { + url: string + checkedAt: string + description?: string | null | undefined + title?: string | null | undefined + id?: string | undefined + image?: string | null | undefined + siteUrl?: string | null | undefined + lastModifiedHeader?: string | null | undefined + etagHeader?: string | null | undefined + ttl?: number | null | undefined + errorMessage?: string | null | undefined + errorAt?: string | null | undefined + ownerUserId?: string | null | undefined + } + subscriptionCount: number + subscription?: { + title: string | null + view: number + userId: string + feedId: string + category: string | null + isPrivate: boolean + } | undefined + } + code: 0 + } + outputFormat: "json" + status: 200 + } + } + "/feeds/refresh": { + $get: { + input: { + query: { + id: string + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + } +} & { + "/discover": { + $post: { + input: { + json: { + keyword: string + } + } + output: { + data: { + feed: { + description: string | null + title: string | null + id: string + image: 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 + } + entries?: { + description: string | null + title: string | null + content: string | null + id: string + url: string | null + feedId: string + guid: string + author: string | null + authorUrl: string | null + authorAvatar: string | null + changedAt: string + publishedAt: string + categories: string[] | null + media?: { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }[] | null | undefined + attachments?: { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }[] | null | undefined + }[] | undefined + docs?: string | undefined + isSubscribed?: boolean | undefined + subscriptionCount?: number | undefined + }[] + } + outputFormat: "json" + status: 200 + } + } + "/discover/rsshub": { + $get: { + input: { + query: { + category?: string | undefined + namespace?: string | undefined + } + } + output: { + data: Record + name: string + categories: string[] + maintainers: string[] + location: string + view?: number | undefined + }> + }> + } + outputFormat: "json" + status: 200 + } + } +} & { + "/auth-app/new-session": { + $post: { + input: {} + output: { + data: { + userId: string + sessionToken: string + expires: string + } + code: 0 + } + outputFormat: "json" + status: 200 + } + } + "/auth-app/update-account": { + $patch: { + input: { + json: { + name?: string | null | undefined + image?: string | null | undefined + handle?: string | null | undefined + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + } +} & Record<`/import/${string}`, Record<`$${Lowercase}`, { + input: Partial + output: any + outputFormat: string + status: hono_utils_http_status.StatusCode +}>> & { + [x: `/entries/read-histories/${string}`]: Record<`$${Lowercase}`, { + input: Partial + output: any + outputFormat: string + status: hono_utils_http_status.StatusCode + }> + [x: `/entries/check-new/${string}`]: Record<`$${Lowercase}`, { + input: Partial + output: any + outputFormat: string + status: hono_utils_http_status.StatusCode + }> + "/entries": { + $post: { + input: { + json: { + view?: number | undefined + feedId?: string | undefined + feedIdList?: string[] | undefined + read?: boolean | undefined + publishedAfter?: string | undefined + limit?: number | undefined + collected?: boolean | undefined + } + } + output: { + code: 0 + total: number + data?: { + entries: { + description: string | null + title: string | null + id: string + url: string | null + guid: string + author: string | null + authorUrl: string | null + authorAvatar: string | null + changedAt: string + publishedAt: string + categories: string[] | null + media?: { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }[] | null | undefined + attachments?: { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }[] | null | undefined + } + feeds: { + description: string | null + title: string | null + id: string + image: 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 + } + read: boolean | null + collections?: { + createdAt: string + } | undefined + settings?: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + } | undefined + }[] | undefined + } + outputFormat: "json" + status: 200 + } + $get: { + input: { + query: { + id: string + } + } + output: { + code: 0 + data?: { + entries: { + description: string | null + title: string | null + content: string | null + id: string + url: string | null + guid: string + author: string | null + authorUrl: string | null + authorAvatar: string | null + changedAt: string + publishedAt: string + categories: string[] | null + media?: { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }[] | null | undefined + attachments?: { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }[] | null | undefined + } + feeds: { + description: string | null + title: string | null + id: string + image: 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 + } + read: boolean | null + users: Record + entryReadHistories: { + userIds: string[] + readCount: number + } | null + collections: { + createdAt: string + } + settings?: { + summary?: boolean | undefined + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + rewriteRules?: { + from: string + to: string + }[] | undefined + } | undefined + } | undefined + } + outputFormat: "json" + status: 200 + } + } + "/entries/preview": { + $get: { + input: { + query: { + id: string + } + } + output: { + data: { + description: string | null + title: string | null + content: string | null + id: string + url: string | null + feedId: string + guid: string + author: string | null + authorUrl: string | null + authorAvatar: string | null + changedAt: string + publishedAt: string + categories: string[] | null + media?: { + type: "photo" | "video" + url: string + preview_image_url?: string | undefined + }[] | null | undefined + attachments?: { + url: string + length?: number | undefined + type?: string | undefined + title?: string | undefined + }[] | null | undefined + }[] + code: 0 + } + outputFormat: "json" + status: 200 + } + } +} & { + "/subscriptions": { + $get: { + input: { + query: { + view?: string | undefined + userId?: string | undefined + } + } + output: { + data: { + title: string | null + view: number + userId: string + feeds: { + description: string | null + title: string | null + id: string + image: 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 + } + feedId: string + category: string | null + isPrivate: boolean + }[] + code: 0 + } + outputFormat: "json" + status: 200 + } + $post: { + input: { + json: { + view: number + url: string + category?: string | null | undefined + isPrivate?: boolean | undefined + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + $delete: { + input: { + json: { + url?: string | undefined + feedId?: string | undefined + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + $patch: { + input: { + json: { + view: number + feedId: string + category?: string | null | undefined + isPrivate?: boolean | undefined + } + } + output: { + code: 0 + } + outputFormat: "json" + status: 200 + } + } +}, "/"> +type AppType = typeof _routes + +export { accounts, actions, actionsItemOpenAPISchema, type ActionsModel, actionsOpenAPISchema, actionsRelations, type AppType, type AttachmentsModel, collections, collectionsOpenAPISchema, collectionsRelations, entries, type EntriesModel, entriesOpenAPISchema, entriesRelations, entryReadHistories, type EntryReadHistoriesModel, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, type FeedModel, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsInputSchema, feedsOpenAPISchema, feedsRelations, invitations, languageSchema, type MediaModel, sessions, type SettingsModel, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactions, transactionsOpenAPISchema, transactionsRelations, transactionType, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations } diff --git a/src/main/constants/app.ts b/src/main/constants/app.ts new file mode 100644 index 0000000000..1391eb05cb --- /dev/null +++ b/src/main/constants/app.ts @@ -0,0 +1,2 @@ +// 5min +export const UNREAD_BACKGROUND_POLLING_INTERVAL = 1000 * 60 * 5 diff --git a/src/main/index.ts b/src/main/index.ts index 1925df8e45..92387f390e 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -8,6 +8,7 @@ import { app, BrowserWindow, session } from "electron" import { env } from "../env" import { isDev } from "./env" import { initializationApp } from "./init" +import { setAuthSessionToken } from "./lib/user" import { registerUpdater } from "./updater" import { createMainWindow, createWindow } from "./window" @@ -110,6 +111,7 @@ function bootsharp() { const apiURL = process.env["VITE_API_URL"] || import.meta.env.VITE_API_URL if (token && apiURL) { + setAuthSessionToken(token) mainWindow.webContents.session.cookies.set({ url: apiURL, name: "authjs.session-token", diff --git a/src/main/lib/api-client.ts b/src/main/lib/api-client.ts new file mode 100644 index 0000000000..0e0875b972 --- /dev/null +++ b/src/main/lib/api-client.ts @@ -0,0 +1,45 @@ +import { env } from "@env" +import PKG from "@pkg" +import { hc } from "hono/client" +import { ofetch } from "ofetch" + +import type { AppType } from "../../hono" +import { logger } from "../logger" +import { getAuthSessionToken } from "./user" + +const abortController = new AbortController() +export const apiFetch = ofetch.create({ + baseURL: env.VITE_API_URL, + credentials: "include", + signal: abortController.signal, + retry: false, + onRequest({ request }) { + const authSessionToken = getAuthSessionToken() + if (!authSessionToken) { + abortController.abort() + return + } + + logger.info(`API Request: ${request.toString()}`) + }, + onRequestError(context) { + if (context.error.name === "AbortError") { + return + } + }, +}) + +export const apiClient = hc("", { + + fetch: async (input, options = {}) => apiFetch(input.toString(), options), + headers() { + const authSessionToken = getAuthSessionToken() + return { + "X-App-Version": PKG.version, + "X-App-Dev": process.env.NODE_ENV === "development" ? "1" : "0", + "Cookie": authSessionToken ? + `authjs.session-token=${authSessionToken}` : + "", + } + }, +}) diff --git a/src/main/lib/dock.ts b/src/main/lib/dock.ts new file mode 100644 index 0000000000..509fbb0187 --- /dev/null +++ b/src/main/lib/dock.ts @@ -0,0 +1,15 @@ +import { app } from "electron" + +export const setDockCount = ( + input: number, +) => { + if (app.dock) { + if (input === 0) { + app.dock.setBadge("") + } else { + app.dock.setBadge(input.toString()) + } + } else { + app.setBadgeCount(input) + } +} diff --git a/src/main/lib/posthog.ts b/src/main/lib/posthog.ts new file mode 100644 index 0000000000..11d0f47350 --- /dev/null +++ b/src/main/lib/posthog.ts @@ -0,0 +1,19 @@ +import { env } from "@env" +import { PostHog } from "posthog-node" + +import { getUser } from "./user" + +export const initPosthog = () => { + if (env.VITE_POSTHOG_KEY === undefined) return + + return new PostHog(env.VITE_POSTHOG_KEY, {}) +} +export const posthog = initPosthog() + +// posthog?.debug(true) + +export const trackEvent = (event: string, properties?: Record) => { + const userId = getUser()?.id + if (!userId) return + posthog?.capture({ event, properties, distinctId: userId }) +} diff --git a/src/main/store.ts b/src/main/lib/store.ts similarity index 100% rename from src/main/store.ts rename to src/main/lib/store.ts diff --git a/src/main/lib/until.ts b/src/main/lib/until.ts new file mode 100644 index 0000000000..ae79457346 --- /dev/null +++ b/src/main/lib/until.ts @@ -0,0 +1 @@ +export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)) diff --git a/src/main/lib/user.ts b/src/main/lib/user.ts new file mode 100644 index 0000000000..cb90140056 --- /dev/null +++ b/src/main/lib/user.ts @@ -0,0 +1,17 @@ +import type { User } from "@auth/core/types" + +import { store } from "./store" + +const AuthKey = "authSessionToken" +export const setAuthSessionToken = (token: string) => store.set(AuthKey, token) +export const getAuthSessionToken = (): string | null => store.get(AuthKey) +export const cleanAuthSessionToken = () => store.set(AuthKey, null) + +const UserKey = "user" +export const setUser = (user: User) => store.set(UserKey, JSON.stringify(user)) +export const getUser = (): User | null => { + const user = store.get(UserKey) + return user ? JSON.parse(user) : null +} + +export const cleanUser = () => store.set(UserKey, null) diff --git a/src/main/posthog.ts b/src/main/posthog.ts deleted file mode 100644 index ac36710e54..0000000000 --- a/src/main/posthog.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { env } from "@env" -import Posthog from "posthog-js" - -export const initPosthog = () => { - if (env.VITE_POSTHOG_KEY === undefined) return - Posthog.init(env.VITE_POSTHOG_KEY, { - person_profiles: "identified_only", - debug: true, - }) - return Posthog -} -export const posthog = initPosthog() - -export const trackEvent = (event: string, properties?: Record) => { - posthog?.capture(event, properties) -} diff --git a/src/main/tipc/app.ts b/src/main/tipc/app.ts index a6d292d1b7..1d93dfc950 100644 --- a/src/main/tipc/app.ts +++ b/src/main/tipc/app.ts @@ -1,13 +1,13 @@ import { getRendererHandlers } from "@egoist/tipc/main" import type { BrowserWindow } from "electron" +import { cleanAuthSessionToken, cleanUser } from "../lib/user" import type { RendererHandlers } from "../renderer-handlers" import { quitAndInstall } from "../updater" import { getMainWindow } from "../window" import { t } from "./_instance" export const appRoute = { - saveToEagle: t.procedure .input<{ url: string, mediaUrls: string[] }>() .action(async ({ input }) => { @@ -76,6 +76,11 @@ export const appRoute = { quitAndInstall: t.procedure.action(async () => { quitAndInstall() }), + + cleanAuthSessionToken: t.procedure.action(async () => { + cleanAuthSessionToken() + cleanUser() + }), } interface Sender extends Electron.WebContents { getOwnerBrowserWindow: () => Electron.BrowserWindow | null diff --git a/src/main/tipc/dock.ts b/src/main/tipc/dock.ts new file mode 100644 index 0000000000..4767059f38 --- /dev/null +++ b/src/main/tipc/dock.ts @@ -0,0 +1,46 @@ +import { UNREAD_BACKGROUND_POLLING_INTERVAL } from "../constants/app" +import { apiClient } from "../lib/api-client" +import { setDockCount } from "../lib/dock" +import { sleep } from "../lib/until" +import { t } from "./_instance" + +const timerMap = { + unread: undefined as any, +} + +const pollingMap = { + unread: false, +} +export const dockRoute = { + pollingUpdateUnreadCount: t.procedure.action(pollingUpdateUnreadCount), + + cancelPollingUpdateUnreadCount: t.procedure.action( + cancelPollingUpdateUnreadCount, + ), + + updateUnreadCount: t.procedure.action(async () => { + await updateUnreadCount() + }), +} + +async function updateUnreadCount() { + const res = await apiClient.reads["total-count"].$get() + setDockCount(res.data.count) +} + +export async function pollingUpdateUnreadCount() { + if (timerMap.unread) { + timerMap.unread = clearTimeout(timerMap.unread) + } + + pollingMap.unread = true + while (pollingMap.unread) { + await sleep(UNREAD_BACKGROUND_POLLING_INTERVAL) + if (pollingMap.unread) { await updateUnreadCount() } + } +} + +export async function cancelPollingUpdateUnreadCount() { + pollingMap.unread = false + timerMap.unread = clearTimeout(timerMap.unread) +} diff --git a/src/main/tipc/index.ts b/src/main/tipc/index.ts index 5ff7a870c8..f6180a1120 100644 --- a/src/main/tipc/index.ts +++ b/src/main/tipc/index.ts @@ -1,5 +1,6 @@ import { appRoute } from "./app" import { debugRoute } from "./debug" +import { dockRoute } from "./dock" import { menuRoute } from "./menu" import { settingRoute } from "./setting" import { trackerRoute } from "./tracker" @@ -10,6 +11,7 @@ export const router = { ...settingRoute, ...appRoute, ...trackerRoute, + ...dockRoute, } export type Router = typeof router diff --git a/src/main/tipc/setting.ts b/src/main/tipc/setting.ts index d4fedb870b..4fb082dd65 100644 --- a/src/main/tipc/setting.ts +++ b/src/main/tipc/setting.ts @@ -1,46 +1,46 @@ import { app, nativeTheme } from "electron" +import { setDockCount } from "../lib/dock" import { createSettingWindow } from "../window" import { t } from "./_instance" -export const settingRoute = { getLoginItemSettings: t.procedure - .input() - .action(async () => await app.getLoginItemSettings()), setLoginItemSettings: t.procedure - .input() - .action(async ({ input }) => { - app.setLoginItemSettings({ - openAtLogin: input, - }) - }), openSettingWindow: t.procedure.action(async () => createSettingWindow()), getSystemFonts: t.procedure.action( - async (): Promise => - new Promise((resolve) => { - // NOTE: should external font-list deps - // use `require` to avoid bundling, vite behavior - require("font-list") - .getFonts() - .then((fonts) => { - resolve(fonts.map((font) => font.replaceAll("\"", ""))) - }) +export const settingRoute = { + getLoginItemSettings: t.procedure + .input() + .action(async () => await app.getLoginItemSettings()), + setLoginItemSettings: t.procedure + .input() + .action(async ({ input }) => { + app.setLoginItemSettings({ + openAtLogin: input, + }) }), -), setAppearance: t.procedure - .input<"light" | "dark" | "system">() - .action(async ({ input }) => { - // NOTE: Temporarily changing to system to get the color mode that system is in at the moment may cause a bit of a problem. - // On macos, there is a bug, traffic lights flicker - nativeTheme.themeSource = "system" - const systemColorMode = nativeTheme.shouldUseDarkColors ? - "dark" : - "light" + openSettingWindow: t.procedure.action(async () => createSettingWindow()), + getSystemFonts: t.procedure.action( + async (): Promise => + new Promise((resolve) => { + // NOTE: should external font-list deps + // use `require` to avoid bundling, vite behavior + require("font-list") + .getFonts() + .then((fonts) => { + resolve(fonts.map((font) => font.replaceAll("\"", ""))) + }) + }), + ), + setAppearance: t.procedure + .input<"light" | "dark" | "system">() + .action(async ({ input }) => { + // NOTE: Temporarily changing to system to get the color mode that system is in at the moment may cause a bit of a problem. + // On macos, there is a bug, traffic lights flicker + nativeTheme.themeSource = "system" + const systemColorMode = nativeTheme.shouldUseDarkColors ? + "dark" : + "light" - nativeTheme.themeSource = systemColorMode === input ? "system" : input - }), setDockBadge: t.procedure.input().action(async ({ input }) => { - if (app.dock) { - if (input === 0) { - app.dock.setBadge("") - } else { - app.dock.setBadge(input.toString()) - } - } else { - app.setBadgeCount(input) - } -}) } + nativeTheme.themeSource = systemColorMode === input ? "system" : input + }), + setDockBadge: t.procedure.input().action(async ({ input }) => { + setDockCount(input) + }), +} diff --git a/src/main/tipc/tracker.ts b/src/main/tipc/tracker.ts index 1fd1f1e174..7150b519d8 100644 --- a/src/main/tipc/tracker.ts +++ b/src/main/tipc/tracker.ts @@ -1,6 +1,7 @@ import type { User } from "@auth/core/types" -import { posthog } from "../posthog" +import { posthog } from "../lib/posthog" +import { setUser } from "../lib/user" import { t } from "./_instance" export const trackerRoute = { @@ -11,9 +12,14 @@ export const trackerRoute = { .action(async ({ input }) => { const { user } = input - posthog?.identify(user.id, { - name: user.name, - handle: user.handle, + setUser(user) + posthog?.capture({ + event: "login", + distinctId: user.id, + properties: { + name: user.name, + handle: user.handle, + }, }) }), } diff --git a/src/main/updater/index.ts b/src/main/updater/index.ts index 7b6898f04c..fbc02db8d6 100644 --- a/src/main/updater/index.ts +++ b/src/main/updater/index.ts @@ -2,8 +2,8 @@ import { getRendererHandlers } from "@egoist/tipc/main" import { autoUpdater } from "electron-updater" import { channel, isDev } from "../env" +import { trackEvent } from "../lib/posthog" import { logger } from "../logger" -import { trackEvent } from "../posthog" import type { RendererHandlers } from "../renderer-handlers" import { getMainWindow } from "../window" import { CustomGitHubProvider } from "./custom-github-provider" diff --git a/src/main/window.ts b/src/main/window.ts index 695bfc6a93..fe2ded7b5c 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -7,7 +7,11 @@ import type { BrowserWindowConstructorOptions } from "electron" import { BrowserWindow, shell } from "electron" import { getIconPath } from "./helper" -import { store } from "./store" +import { store } from "./lib/store" +import { + cancelPollingUpdateUnreadCount, + pollingUpdateUnreadCount, +} from "./tipc/dock" const windows = { settingWindow: null as BrowserWindow | null, @@ -144,6 +148,18 @@ export const createMainWindow = () => { } }) + window.on("show", () => { + cancelPollingUpdateUnreadCount() + }) + + window.on("hide", async () => { + const settings = await callGlobalContextMethod(window, "getUISettings") + + if (settings.showDockBadge) { + pollingUpdateUnreadCount() + } + }) + return window } diff --git a/src/renderer/src/atoms/settings/general.ts b/src/renderer/src/atoms/settings/general.ts index 37a6a76b1b..10edc93465 100644 --- a/src/renderer/src/atoms/settings/general.ts +++ b/src/renderer/src/atoms/settings/general.ts @@ -1,8 +1,9 @@ import { jotaiStore } from "@renderer/lib/jotai" +import type { GeneralSettings } from "@shared/interface/settings" import { createSettingAtom } from "./helper" -const createDefaultSettings = () => ({ +const createDefaultSettings = (): GeneralSettings => ({ // App appLaunchOnStartup: false, // Data control @@ -18,6 +19,7 @@ const createDefaultSettings = () => ({ // UX // autoHideFeedColumn: true, }) + export const { useSettingKey: useGeneralSettingKey, useSettingSelector: useGeneralSettingSelector, diff --git a/src/renderer/src/atoms/settings/helper.ts b/src/renderer/src/atoms/settings/helper.ts index 2a56293621..392dd735cf 100644 --- a/src/renderer/src/atoms/settings/helper.ts +++ b/src/renderer/src/atoms/settings/helper.ts @@ -5,7 +5,7 @@ import { useAtomValue } from "jotai" import { atomWithStorage, selectAtom } from "jotai/utils" import { useMemo } from "react" -export const createSettingAtom = >( +export const createSettingAtom = ( settingKey: string, createDefaultSettings: () => T, ) => { diff --git a/src/renderer/src/atoms/settings/ui.ts b/src/renderer/src/atoms/settings/ui.ts index b0ff282b07..0765ee99a2 100644 --- a/src/renderer/src/atoms/settings/ui.ts +++ b/src/renderer/src/atoms/settings/ui.ts @@ -1,6 +1,8 @@ +import type { UISettings } from "@shared/interface/settings" + import { createSettingAtom } from "./helper" -const createDefaultSettings = () => ({ +const createDefaultSettings = (): UISettings => ({ // Sidebar entryColWidth: 340, feedColWidth: 256, @@ -23,6 +25,7 @@ const createDefaultSettings = () => ({ readerRenderInlineStyle: false, codeHighlightTheme: "github-dark", }) + export const { useSettingKey: useUISettingKey, useSettingSelector: useUISettingSelector, diff --git a/src/renderer/src/components/ui/media/hooks.tsx b/src/renderer/src/components/ui/media/hooks.tsx index f5c10ca43b..075b2194a9 100644 --- a/src/renderer/src/components/ui/media/hooks.tsx +++ b/src/renderer/src/components/ui/media/hooks.tsx @@ -1,5 +1,5 @@ -import type { MediaModel } from "@renderer/hono" import { useCallback } from "react" +import type { MediaModel } from "src/hono" import { useModalStack } from "../modal/stacked/hooks" import { NoopChildren } from "../modal/stacked/utils" diff --git a/src/renderer/src/components/ui/media/preview-media.tsx b/src/renderer/src/components/ui/media/preview-media.tsx index 7f86d867e6..5a36dfe52a 100644 --- a/src/renderer/src/components/ui/media/preview-media.tsx +++ b/src/renderer/src/components/ui/media/preview-media.tsx @@ -1,11 +1,11 @@ import { m } from "@renderer/components/common/Motion" import { COPY_MAP } from "@renderer/constants" -import type { MediaModel } from "@renderer/hono" import { tipcClient } from "@renderer/lib/client" import { stopPropagation } from "@renderer/lib/dom" import { showNativeMenu } from "@renderer/lib/native-menu" import type { FC } from "react" import { useCallback, useState } from "react" +import type { MediaModel } from "src/hono" import { Keyboard, Mousewheel, Scrollbar } from "swiper/modules" import { Swiper, SwiperSlide } from "swiper/react" diff --git a/src/renderer/src/components/ui/media/swipe-media.tsx b/src/renderer/src/components/ui/media/swipe-media.tsx index 5cb4dd0c79..f7915a1a30 100644 --- a/src/renderer/src/components/ui/media/swipe-media.tsx +++ b/src/renderer/src/components/ui/media/swipe-media.tsx @@ -3,11 +3,11 @@ import "swiper/css/navigation" import "swiper/css/scrollbar" import { Media } from "@renderer/components/ui/media" -import type { MediaModel } from "@renderer/hono" import { cn } from "@renderer/lib/utils" import { useHover } from "@use-gesture/react" import { uniqBy } from "lodash-es" import { useRef, useState } from "react" +import type { MediaModel } from "src/hono" import { Mousewheel, Navigation, Scrollbar } from "swiper/modules" import { Swiper, SwiperSlide } from "swiper/react" diff --git a/src/renderer/src/hono.ts b/src/renderer/src/hono.ts deleted file mode 100644 index a04899b4c0..0000000000 --- a/src/renderer/src/hono.ts +++ /dev/null @@ -1,3426 +0,0 @@ -import * as hono_hono_base from 'hono/hono-base'; -import * as hono_utils_http_status from 'hono/utils/http-status'; -import * as hono from 'hono'; -import * as hono_types from 'hono/types'; -import * as drizzle_orm from 'drizzle-orm'; -import { InferInsertModel } from 'drizzle-orm'; -import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core'; -import * as zod from 'zod'; -import { z } from 'zod'; - -declare const actions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "actions"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - rules: drizzle_orm_pg_core.PgColumn<{ - name: "rules"; - tableName: "actions"; - dataType: "array"; - columnType: "PgArray"; - data: unknown[]; - driverParam: string | unknown[]; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: drizzle_orm.Column<{ - name: "rules"; - tableName: "actions"; - dataType: "json"; - columnType: "PgJsonb"; - data: unknown; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, object, object>; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const languageSchema: z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>; -declare const actionsItemOpenAPISchema: z.ZodObject<{ - name: z.ZodString; - condition: z.ZodArray; - operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z.ZodString; - }, "strip", z.ZodTypeAny, { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">; - result: z.ZodObject<{ - translation: z.ZodOptional>; - summary: z.ZodOptional; - rewriteRules: z.ZodOptional, "many">>; - blockRules: z.ZodOptional; - operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z.ZodUnion<[z.ZodString, z.ZodNumber]>; - }, "strip", z.ZodTypeAny, { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">>; - }, "strip", z.ZodTypeAny, { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }, { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }>; -}, "strip", z.ZodTypeAny, { - name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; - result: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }; -}, { - name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; - result: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }; -}>; -declare const actionsOpenAPISchema: z.ZodObject, "many">>; -}, "rules">, { - rules: z.ZodNullable; - operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z.ZodString; - }, "strip", z.ZodTypeAny, { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">; - result: z.ZodObject<{ - translation: z.ZodOptional>; - summary: z.ZodOptional; - rewriteRules: z.ZodOptional, "many">>; - blockRules: z.ZodOptional; - operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; - value: z.ZodUnion<[z.ZodString, z.ZodNumber]>; - }, "strip", z.ZodTypeAny, { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }, { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }>, "many">>; - }, "strip", z.ZodTypeAny, { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }, { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }>; - }, "strip", z.ZodTypeAny, { - name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; - result: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }; - }, { - name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; - result: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }; - }>, "many">>>; -}>, "strip", z.ZodTypeAny, { - userId: string; - rules?: { - name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; - result: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }; - }[] | null | undefined; -}, { - userId: string; - rules?: { - name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; - result: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - blockRules?: { - value: string | number; - field: "title" | "content" | "url" | "all" | "author" | "order"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[] | undefined; - }; - }[] | null | undefined; -}>; -declare const actionsRelations: drizzle_orm.Relations<"actions", { - users: drizzle_orm.One<"user", true>; -}>; -type ActionsModel = z.infer; -type SettingsModel = Exclude["result"], undefined>; - -declare const collections: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "collections"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core.PgColumn<{ - name: "feedId"; - 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; - generated: undefined; - }, {}, {}>; - entryId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const collectionsOpenAPISchema: zod.ZodObject<{ - userId: zod.ZodString; - feedId: zod.ZodString; - entryId: zod.ZodString; - createdAt: zod.ZodString; - view: zod.ZodNumber; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - view: number; - userId: string; - createdAt: string; - feedId: string; - entryId: string; -}, { - view: number; - userId: string; - createdAt: string; - feedId: string; - entryId: string; -}>; -declare const collectionsRelations: drizzle_orm.Relations<"collections", { - users: drizzle_orm.One<"user", true>; - entries: drizzle_orm.One<"entries", true>; - feeds: drizzle_orm.One<"feeds", true>; -}>; - -type MediaModel = { - url: string; - type: "photo" | "video"; - preview_image_url?: string; -}; -type AttachmentsModel = { - url: string; - duration_in_seconds?: number; - mime_type?: string; - size_in_bytes?: number; - title?: string; -}; -declare const entries: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "entries"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - url: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - content: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - guid: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - author: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - authorUrl: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - authorAvatar: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - changedAt: drizzle_orm_pg_core.PgColumn<{ - name: "changed_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; - generated: undefined; - }, {}, {}>; - publishedAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - media: drizzle_orm_pg_core.PgColumn<{ - name: "media"; - tableName: "entries"; - dataType: "array"; - columnType: "PgArray"; - data: unknown[]; - driverParam: string | unknown[]; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: drizzle_orm.Column<{ - name: "media"; - tableName: "entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: unknown; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, object, object>; - generated: undefined; - }, {}, {}>; - categories: drizzle_orm_pg_core.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_orm.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; - generated: undefined; - }, object, object>; - generated: undefined; - }, {}, {}>; - attachments: drizzle_orm_pg_core.PgColumn<{ - name: "attachments"; - tableName: "entries"; - dataType: "array"; - columnType: "PgArray"; - data: unknown[]; - driverParam: string | unknown[]; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: drizzle_orm.Column<{ - name: "attachments"; - tableName: "entries"; - dataType: "json"; - columnType: "PgJsonb"; - data: unknown; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, object, object>; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const entriesOpenAPISchema: z.ZodObject; - url: z.ZodNullable; - content: z.ZodNullable; - description: z.ZodNullable; - guid: z.ZodString; - author: z.ZodNullable; - authorUrl: z.ZodNullable; - authorAvatar: z.ZodNullable; - changedAt: z.ZodString; - publishedAt: z.ZodString; - media: z.ZodNullable, "many">>; - categories: z.ZodNullable>; - attachments: z.ZodNullable, "many">>; -}, "media" | "attachments">, { - attachments: z.ZodNullable; - type: z.ZodOptional; - title: z.ZodOptional; - }, "strip", z.ZodTypeAny, { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }, { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }>, "many">>>; - media: z.ZodNullable; - preview_image_url: z.ZodOptional; - }, "strip", z.ZodTypeAny, { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }, { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }>, "many">>>; -}>, "strip", z.ZodTypeAny, { - description: string | null; - title: string | null; - content: string | null; - id: string; - url: string | null; - feedId: string; - guid: string; - author: string | null; - authorUrl: string | null; - authorAvatar: string | null; - changedAt: string; - publishedAt: string; - categories: string[] | null; - media?: { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }[] | null | undefined; -}, { - description: string | null; - title: string | null; - content: string | null; - id: string; - url: string | null; - feedId: string; - guid: string; - author: string | null; - authorUrl: string | null; - authorAvatar: string | null; - changedAt: string; - publishedAt: string; - categories: string[] | null; - media?: { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }[] | null | undefined; -}>; -declare const entriesRelations: drizzle_orm.Relations<"entries", { - feeds: drizzle_orm.One<"feeds", true>; - collections: drizzle_orm.Many<"collections">; - feedPowerTokens: drizzle_orm.One<"feedPowerTokens", true>; - entryReadHistories: drizzle_orm.One<"entryReadHistories", true>; -}>; -type EntriesModel = InferInsertModel & { - attachments?: AttachmentsModel[] | null; - media?: MediaModel[] | null; -}; -declare const entryReadHistories: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "entryReadHistories"; - schema: undefined; - columns: { - entryId: drizzle_orm_pg_core.PgColumn<{ - name: "entry_id"; - tableName: "entryReadHistories"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - userIds: drizzle_orm_pg_core.PgColumn<{ - name: "user_ids"; - tableName: "entryReadHistories"; - dataType: "array"; - columnType: "PgArray"; - data: string[]; - driverParam: string | string[]; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: drizzle_orm.Column<{ - name: "user_ids"; - tableName: "entryReadHistories"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, object, object>; - generated: undefined; - }, {}, {}>; - readCount: drizzle_orm_pg_core.PgColumn<{ - name: "read_count"; - tableName: "entryReadHistories"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const entryReadHistoriesRelations: drizzle_orm.Relations<"entryReadHistories", { - entry: drizzle_orm.One<"entries", true>; -}>; -type EntryReadHistoriesModel = InferInsertModel; -declare const entryReadHistoriesOpenAPISchema: z.ZodObject<{ - entryId: z.ZodString; - userIds: z.ZodArray; - readCount: z.ZodNumber; -}, z.UnknownKeysParam, z.ZodTypeAny, { - entryId: string; - userIds: string[]; - readCount: number; -}, { - entryId: string; - userIds: string[]; - readCount: number; -}>; - -declare const feeds: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "feeds"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - url: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - description: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - siteUrl: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - image: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - checkedAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - lastModifiedHeader: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - etagHeader: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - ttl: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - errorMessage: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - errorAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - ownerUserId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const feedsOpenAPISchema: zod.ZodObject<{ - id: zod.ZodString; - url: zod.ZodString; - title: zod.ZodNullable; - description: zod.ZodNullable; - siteUrl: zod.ZodNullable; - image: zod.ZodNullable; - checkedAt: zod.ZodString; - lastModifiedHeader: zod.ZodNullable; - etagHeader: zod.ZodNullable; - ttl: zod.ZodNullable; - errorMessage: zod.ZodNullable; - errorAt: zod.ZodNullable; - ownerUserId: zod.ZodNullable; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - description: string | null; - title: string | null; - id: string; - image: 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; -}, { - description: string | null; - title: string | null; - id: string; - image: 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; -}>; -declare const feedsInputSchema: zod.ZodObject<{ - description: zod.ZodOptional>; - title: zod.ZodOptional>; - id: zod.ZodOptional; - image: zod.ZodOptional>; - url: zod.ZodString; - siteUrl: zod.ZodOptional>; - checkedAt: zod.ZodString; - lastModifiedHeader: zod.ZodOptional>; - etagHeader: zod.ZodOptional>; - ttl: zod.ZodOptional>; - errorMessage: zod.ZodOptional>; - errorAt: zod.ZodOptional>; - ownerUserId: zod.ZodOptional>; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - url: string; - checkedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - id?: string | undefined; - image?: string | null | undefined; - siteUrl?: string | null | undefined; - lastModifiedHeader?: string | null | undefined; - etagHeader?: string | null | undefined; - ttl?: number | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; -}, { - url: string; - checkedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - id?: string | undefined; - image?: string | null | undefined; - siteUrl?: string | null | undefined; - lastModifiedHeader?: string | null | undefined; - etagHeader?: string | null | undefined; - ttl?: number | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; -}>; -declare const feedsRelations: drizzle_orm.Relations<"feeds", { - subscriptions: drizzle_orm.Many<"subscriptions">; - entries: drizzle_orm.Many<"entries">; - owner: drizzle_orm.One<"user", false>; -}>; -type FeedModel = InferInsertModel; - -declare const invitations: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "invitations"; - schema: undefined; - columns: { - code: drizzle_orm_pg_core.PgColumn<{ - name: "code"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - fromUserId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - toUserId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; - -declare const subscriptions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "subscriptions"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - category: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - title: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - isPrivate: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const subscriptionsOpenAPISchema: zod.ZodObject<{ - userId: zod.ZodString; - feedId: zod.ZodString; - view: zod.ZodNumber; - category: zod.ZodNullable; - title: zod.ZodNullable; - isPrivate: zod.ZodBoolean; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - title: string | null; - view: number; - userId: string; - feedId: string; - category: string | null; - isPrivate: boolean; -}, { - title: string | null; - view: number; - userId: string; - feedId: string; - category: string | null; - isPrivate: boolean; -}>; -declare const subscriptionsRelations: drizzle_orm.Relations<"subscriptions", { - users: drizzle_orm.One<"user", true>; - feeds: drizzle_orm.One<"feeds", true>; -}>; - -declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "timeline"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - feedId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - entryId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - publishedAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - view: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - read: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const timelineOpenAPISchema: zod.ZodObject<{ - userId: zod.ZodString; - feedId: zod.ZodString; - entryId: zod.ZodString; - publishedAt: zod.ZodString; - view: zod.ZodNumber; - read: zod.ZodNullable; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - view: number; - userId: string; - feedId: string; - read: boolean | null; - publishedAt: string; - entryId: string; -}, { - view: number; - userId: string; - feedId: string; - read: boolean | null; - publishedAt: string; - entryId: string; -}>; -declare const timelineRelations: drizzle_orm.Relations<"timeline", { - entries: drizzle_orm.One<"entries", true>; - feeds: drizzle_orm.One<"feeds", true>; - collections: drizzle_orm.One<"collections", true>; -}>; - -declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "user"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - name: drizzle_orm_pg_core.PgColumn<{ - name: "name"; - 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; - generated: undefined; - }, {}, {}>; - email: drizzle_orm_pg_core.PgColumn<{ - name: "email"; - tableName: "user"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - emailVerified: drizzle_orm_pg_core.PgColumn<{ - name: "emailVerified"; - tableName: "user"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - image: drizzle_orm_pg_core.PgColumn<{ - name: "image"; - 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; - generated: undefined; - }, {}, {}>; - handle: drizzle_orm_pg_core.PgColumn<{ - name: "handle"; - 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; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const usersOpenApiSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodNullable; - email: z.ZodString; - emailVerified: z.ZodNullable; - image: z.ZodNullable; - handle: z.ZodNullable; - createdAt: z.ZodDate; -}, z.UnknownKeysParam, z.ZodTypeAny, { - name: string | null; - id: string; - email: string; - emailVerified: string | null; - image: string | null; - handle: string | null; - createdAt: Date; -}, { - name: string | null; - id: string; - email: string; - emailVerified: string | null; - image: string | null; - handle: string | null; - createdAt: Date; -}>; -declare const accounts: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "account"; - schema: undefined; - columns: { - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - type: drizzle_orm_pg_core.PgColumn<{ - name: "type"; - 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; - generated: undefined; - }, {}, {}>; - provider: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - providerAccountId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - refresh_token: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - access_token: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - expires_at: drizzle_orm_pg_core.PgColumn<{ - name: "expires_at"; - tableName: "account"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - token_type: drizzle_orm_pg_core.PgColumn<{ - name: "token_type"; - 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; - generated: undefined; - }, {}, {}>; - scope: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - id_token: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - session_state: drizzle_orm_pg_core.PgColumn<{ - name: "session_state"; - 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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "session"; - schema: undefined; - columns: { - sessionToken: drizzle_orm_pg_core.PgColumn<{ - name: "sessionToken"; - tableName: "session"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - expires: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const verificationTokens: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "verificationToken"; - schema: undefined; - columns: { - identifier: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - token: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - expires: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const usersRelations: drizzle_orm.Relations<"user", { - subscriptions: drizzle_orm.Many<"subscriptions">; - collections: drizzle_orm.Many<"collections">; - actions: drizzle_orm.One<"actions", true>; - wallets: drizzle_orm.One<"wallets", true>; - feeds: drizzle_orm.Many<"feeds">; -}>; - -declare const wallets: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "wallets"; - schema: undefined; - columns: { - addressIndex: drizzle_orm_pg_core.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; - generated: drizzle_orm.GeneratedColumnConfig & { - as: any; - type: "always"; - }; - }, {}, {}>; - address: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - dailyPowerToken: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - cashablePowerToken: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const walletsOpenAPISchema: zod.ZodObject<{ - addressIndex: zod.ZodNumber; - address: zod.ZodNullable; - userId: zod.ZodString; - createdAt: zod.ZodString; - dailyPowerToken: zod.ZodString; - cashablePowerToken: zod.ZodString; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - userId: string; - createdAt: string; - address: string | null; - addressIndex: number; - dailyPowerToken: string; - cashablePowerToken: string; -}, { - userId: string; - createdAt: string; - address: string | null; - addressIndex: number; - dailyPowerToken: string; - cashablePowerToken: string; -}>; -declare const walletsRelations: drizzle_orm.Relations<"wallets", { - user: drizzle_orm.One<"user", true>; - transactionsFrom: drizzle_orm.Many<"transactions">; - transactionTo: drizzle_orm.Many<"transactions">; -}>; -declare const transactionType: drizzle_orm_pg_core.PgEnum<["tip", "mint", "burn", "withdraw"]>; -declare const transactions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "transactions"; - schema: undefined; - columns: { - hash: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - type: drizzle_orm_pg_core.PgColumn<{ - name: "type"; - tableName: "transactions"; - dataType: "string"; - columnType: "PgEnumColumn"; - data: "tip" | "mint" | "burn" | "withdraw"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: ["tip", "mint", "burn", "withdraw"]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - fromUserId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - toUserId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - toFeedId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - powerToken: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - comment: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const transactionsOpenAPISchema: zod.ZodObject<{ - hash: zod.ZodString; - type: zod.ZodEnum<["tip", "mint", "burn", "withdraw"]>; - fromUserId: zod.ZodNullable; - toUserId: zod.ZodNullable; - toFeedId: zod.ZodNullable; - powerToken: zod.ZodString; - createdAt: zod.ZodString; - comment: zod.ZodNullable; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - type: "tip" | "mint" | "burn" | "withdraw"; - createdAt: string; - hash: string; - fromUserId: string | null; - toUserId: string | null; - toFeedId: string | null; - powerToken: string; - comment: string | null; -}, { - type: "tip" | "mint" | "burn" | "withdraw"; - createdAt: string; - hash: string; - fromUserId: string | null; - toUserId: string | null; - toFeedId: string | null; - powerToken: string; - comment: string | null; -}>; -declare const transactionsRelations: drizzle_orm.Relations<"transactions", { - fromUser: drizzle_orm.One<"user", false>; - toUser: drizzle_orm.One<"user", false>; - toFeed: drizzle_orm.One<"feeds", false>; - fromWallet: drizzle_orm.One<"wallets", false>; - toWallet: drizzle_orm.One<"wallets", false>; -}>; -declare const feedPowerTokens: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "feedPowerTokens"; - schema: undefined; - columns: { - feedId: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - powerToken: drizzle_orm_pg_core.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; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const feedPowerTokensOpenAPISchema: zod.ZodObject<{ - feedId: zod.ZodString; - powerToken: zod.ZodString; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - feedId: string; - powerToken: string; -}, { - feedId: string; - powerToken: string; -}>; -declare const feedPowerTokensRelations: drizzle_orm.Relations<"feedPowerTokens", { - feed: drizzle_orm.One<"feeds", true>; -}>; - -declare const _routes: hono_hono_base.HonoBase}`]: { - input: Partial; - output: any; - outputFormat: string; - status: hono_utils_http_status.StatusCode; - }; - }; -} & { - [x: `/entries/read-histories/${string}`]: { - [x: `$${Lowercase}`]: { - input: Partial; - output: any; - outputFormat: string; - status: hono_utils_http_status.StatusCode; - }; - }; - [x: `/entries/check-new/${string}`]: { - [x: `$${Lowercase}`]: { - input: Partial; - output: any; - outputFormat: string; - status: hono_utils_http_status.StatusCode; - }; - }; - "/entries": { - $post: { - input: { - json: { - view?: number | undefined; - feedId?: string | undefined; - feedIdList?: string[] | undefined; - read?: boolean | undefined; - publishedAfter?: string | undefined; - limit?: number | undefined; - collected?: boolean | undefined; - }; - }; - output: { - code: 0; - total: number; - data?: { - entries: { - description: string | null; - title: string | null; - id: string; - url: string | null; - guid: string; - author: string | null; - authorUrl: string | null; - authorAvatar: string | null; - changedAt: string; - publishedAt: string; - categories: string[] | null; - media?: { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }[] | null | undefined; - }; - feeds: { - description: string | null; - title: string | null; - id: string; - image: 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; - }; - read: boolean | null; - collections?: { - createdAt: string; - } | undefined; - settings?: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - } | undefined; - }[] | undefined; - }; - outputFormat: "json"; - status: 200; - }; - $get: { - input: { - query: { - id: string; - }; - }; - output: { - code: 0; - data?: { - entries: { - description: string | null; - title: string | null; - content: string | null; - id: string; - url: string | null; - guid: string; - author: string | null; - authorUrl: string | null; - authorAvatar: string | null; - changedAt: string; - publishedAt: string; - categories: string[] | null; - media?: { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }[] | null | undefined; - }; - feeds: { - description: string | null; - title: string | null; - id: string; - image: 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; - }; - read: boolean | null; - users: { - [x: string]: { - name: string | null; - id: string; - image: string | null; - handle: string | null; - }; - }; - entryReadHistories: { - userIds: string[]; - readCount: number; - } | null; - collections: { - createdAt: string; - }; - settings?: { - summary?: boolean | undefined; - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; - rewriteRules?: { - from: string; - to: string; - }[] | undefined; - } | undefined; - } | undefined; - }; - outputFormat: "json"; - status: 200; - }; - }; - "/entries/preview": { - $get: { - input: { - query: { - id: string; - }; - }; - output: { - data: { - description: string | null; - title: string | null; - content: string | null; - id: string; - url: string | null; - feedId: string; - guid: string; - author: string | null; - authorUrl: string | null; - authorAvatar: string | null; - changedAt: string; - publishedAt: string; - categories: string[] | null; - media?: { - type: "photo" | "video"; - url: string; - preview_image_url?: string | undefined; - }[] | null | undefined; - attachments?: { - url: string; - length?: number | undefined; - type?: string | undefined; - title?: string | undefined; - }[] | null | undefined; - }[]; - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -} & { - "/subscriptions": { - $get: { - input: { - query: { - view?: string | undefined; - userId?: string | undefined; - }; - }; - output: { - data: { - title: string | null; - view: number; - userId: string; - feeds: { - description: string | null; - title: string | null; - id: string; - image: 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; - }; - feedId: string; - category: string | null; - isPrivate: boolean; - }[]; - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - $post: { - input: { - json: { - view: number; - url: string; - category?: string | null | undefined; - isPrivate?: boolean | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - $delete: { - input: { - json: { - url?: string | undefined; - feedId?: string | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - $patch: { - input: { - json: { - view: number; - feedId: string; - category?: string | null | undefined; - isPrivate?: boolean | undefined; - }; - }; - output: { - code: 0; - }; - outputFormat: "json"; - status: 200; - }; - }; -}, "/">; -type AppType = typeof _routes; - -export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsInputSchema, feedsOpenAPISchema, feedsRelations, invitations, languageSchema, sessions, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; diff --git a/src/renderer/src/hono.ts b/src/renderer/src/hono.ts new file mode 120000 index 0000000000..bf1d03e73f --- /dev/null +++ b/src/renderer/src/hono.ts @@ -0,0 +1 @@ +../../hono.ts \ No newline at end of file diff --git a/src/renderer/src/hooks/biz/useSignOut.ts b/src/renderer/src/hooks/biz/useSignOut.ts index 02e5968768..26ed69fdc7 100644 --- a/src/renderer/src/hooks/biz/useSignOut.ts +++ b/src/renderer/src/hooks/biz/useSignOut.ts @@ -1,6 +1,7 @@ import { signOut } from "@hono/auth-js/react" import { setMe } from "@renderer/atoms/user" import { QUERY_PERSIST_KEY } from "@renderer/constants" +import { tipcClient } from "@renderer/lib/client" import { clearStorage } from "@renderer/lib/ns" import { clearLocalPersistStoreData } from "@renderer/store/utils/clear" import { useCallback } from "react" @@ -19,7 +20,7 @@ export const useSignOut = () => // Clear local storage clearStorage() window.posthog?.reset() - + tipcClient?.cleanAuthSessionToken() // Sign out await signOut() }, []) diff --git a/src/renderer/src/hooks/common/index.ts b/src/renderer/src/hooks/common/index.ts index 5183cc5631..5fb676c267 100644 --- a/src/renderer/src/hooks/common/index.ts +++ b/src/renderer/src/hooks/common/index.ts @@ -1,5 +1,8 @@ export * from "./useBizQuery" export * from "./useDark" +export * from "./useInputComposition" +export * from "./useIsOnline" +export * from "./usePageVisibility" export * from "./usePrevious" export * from "./useRefValue" export * from "./useTitle" diff --git a/src/renderer/src/hooks/common/useInterval.ts b/src/renderer/src/hooks/common/useInterval.ts new file mode 100644 index 0000000000..96a252fa72 --- /dev/null +++ b/src/renderer/src/hooks/common/useInterval.ts @@ -0,0 +1,56 @@ +import { useEffect, useRef } from "react" +import { useIsomorphicLayoutEffect } from "usehooks-ts" + +export function useAccurateInterval( + callback: () => void, + options: { + delay: number + enable?: boolean + immediately?: boolean + }, +) { + const { delay, enable = true, immediately = true } = options + const savedCallback = useRef(callback) + const nextTick = useRef(Date.now() + (delay || 0)) + + const triggerCountRef = useRef(0) + + const timerRef = useRef(null) + + // Remember the latest callback if it changes. + useIsomorphicLayoutEffect(() => { + savedCallback.current = callback + }, [callback]) + + // Set up the interval. + useEffect(() => { + if (!enable) return + // Don't schedule if no delay is specified. + // Note: 0 is a valid value for delay. + if (!delay && delay !== 0) { + return + } + + function tick() { + if (immediately || triggerCountRef.current > 0) { + savedCallback.current() + } + triggerCountRef.current++ + + const now = Date.now() + const expectedNextTick = nextTick.current + const actualDelay = Math.max(0, expectedNextTick - now) + + // Compensate for the time taken by the task + nextTick.current = now + delay + actualDelay + timerRef.current = setTimeout(tick, nextTick.current - now) + } + + tick() + + return () => { + nextTick.current = Date.now() // Reset for the next run + timerRef.current = clearTimeout(timerRef.current) + } + }, [delay, enable, immediately]) +} diff --git a/src/renderer/src/hooks/common/usePageVisibility.ts b/src/renderer/src/hooks/common/usePageVisibility.ts new file mode 100644 index 0000000000..b1bf0b29be --- /dev/null +++ b/src/renderer/src/hooks/common/usePageVisibility.ts @@ -0,0 +1,17 @@ +import { useLayoutEffect, useState } from "react" + +export function usePageVisibility() { + const [isPageVisible, setIsPageVisible] = useState(!document.hidden) + + useLayoutEffect(() => { + const handleVisibility = () => { + setIsPageVisible(!document.hidden) + } + document.addEventListener("visibilitychange", handleVisibility) + return () => { + document.removeEventListener("visibilitychange", handleVisibility) + } + }, []) + + return isPageVisible +} diff --git a/src/renderer/src/initialize/index.ts b/src/renderer/src/initialize/index.ts index a3a6b33eac..b697aa163e 100644 --- a/src/renderer/src/initialize/index.ts +++ b/src/renderer/src/initialize/index.ts @@ -1,6 +1,7 @@ import { env } from "@env" import { authConfigManager } from "@hono/auth-js/react" import { repository } from "@pkg" +import { getUISettings } from "@renderer/atoms/settings/ui" import { browserDB } from "@renderer/database" import { CleanerService } from "@renderer/services/cleaner" import { registerGlobalContext } from "@shared/bridge" @@ -58,6 +59,8 @@ export const initializeApp = async () => { registerGlobalContext({ showSetting: () => window.router.showSettings(), + getGeneralSettings, + getUISettings, toast, }) diff --git a/src/renderer/src/lib/api-fetch.ts b/src/renderer/src/lib/api-fetch.ts index eed2eca077..fbc633768b 100644 --- a/src/renderer/src/lib/api-fetch.ts +++ b/src/renderer/src/lib/api-fetch.ts @@ -2,9 +2,9 @@ import { getCsrfToken } from "@hono/auth-js/react" import PKG from "@pkg" import { NetworkStatus, setApiStatus } from "@renderer/atoms/network" import { setLoginModalShow } from "@renderer/atoms/user" -import type { AppType } from "@renderer/hono" import { hc } from "hono/client" import { FetchError, ofetch } from "ofetch" +import type { AppType } from "src/hono" let csrfTokenPromise: Promise | null = null export const apiFetch = ofetch.create({ diff --git a/src/renderer/src/lib/query-client.ts b/src/renderer/src/lib/query-client.ts index 5924ffe6e9..fed5dc1877 100644 --- a/src/renderer/src/lib/query-client.ts +++ b/src/renderer/src/lib/query-client.ts @@ -9,7 +9,7 @@ import { QUERY_PERSIST_KEY } from "../constants/app" const queryClient = new QueryClient({ defaultOptions: { queries: { - gcTime: Infinity, + refetchOnWindowFocus: false, retryDelay: 1000, retry(failureCount, error) { console.error(error) diff --git a/src/renderer/src/models/types.ts b/src/renderer/src/models/types.ts index 58a2025b50..c6f59a59e0 100644 --- a/src/renderer/src/models/types.ts +++ b/src/renderer/src/models/types.ts @@ -1,5 +1,5 @@ -import type { users } from "@renderer/hono" import type { apiClient } from "@renderer/lib/api-fetch" +import type { users } from "src/hono" export type UserModel = Omit diff --git a/src/renderer/src/modules/app/EnvironmentIndicator.tsx b/src/renderer/src/modules/app/EnvironmentIndicator.tsx index 76321dce32..361b6704d0 100644 --- a/src/renderer/src/modules/app/EnvironmentIndicator.tsx +++ b/src/renderer/src/modules/app/EnvironmentIndicator.tsx @@ -1,16 +1,22 @@ +import { env } from "@env" import { Tooltip, TooltipContent, + TooltipPortal, TooltipTrigger, } from "@renderer/components/ui/tooltip" export const EnvironmentIndicator = () => ( - +
{import.meta.env.MODE}
- {import.meta.env.BASE_URL} + + +
{JSON.stringify({ ...env }, null, 2)}
+
+
) diff --git a/src/renderer/src/modules/feed-column/index.tsx b/src/renderer/src/modules/feed-column/index.tsx index bc9f9c669f..3472fcd817 100644 --- a/src/renderer/src/modules/feed-column/index.tsx +++ b/src/renderer/src/modules/feed-column/index.tsx @@ -50,10 +50,7 @@ const useBackHome = (active: number) => { } const useUnreadByView = () => { - useAuthQuery(Queries.subscription.byView(), { - refetchOnWindowFocus: false, - refetchInterval: false, - }) + useAuthQuery(Queries.subscription.byView()) const idByView = useSubscriptionStore((state) => state.feedIdByView) const totalUnread = useFeedUnreadStore((state) => { const unread = {} as Record diff --git a/src/renderer/src/modules/feed-column/list.tsx b/src/renderer/src/modules/feed-column/list.tsx index c189f10bbe..5459b8c21d 100644 --- a/src/renderer/src/modules/feed-column/list.tsx +++ b/src/renderer/src/modules/feed-column/list.tsx @@ -38,6 +38,28 @@ const useGroupedData = (view: FeedViewType) => { return groupFolder }, [data]) } + +const useUpdateUnreadCount = () => { + useAuthQuery(Queries.subscription.unreadAll(), { + refetchInterval: false, + }) + // const isPageVisible = usePageVisibility() + + // useAccurateInterval( + // () => { + // if (!isPageVisible) { + // refetch() + // } + // }, + // { + // enable: !isPageVisible, + // delay: + // // 10s + // 10_000, + // }, + // ) +} + export function FeedList({ className, view, @@ -48,7 +70,7 @@ export function FeedList({ const [expansion, setExpansion] = useState(false) const data = useGroupedData(view) - useAuthQuery(Queries.subscription.unreadAll()) + useUpdateUnreadCount() const totalUnread = useFeedUnreadStore((state) => { let unread = 0 diff --git a/src/renderer/src/providers/invalidate-query-provider.tsx b/src/renderer/src/providers/invalidate-query-provider.tsx new file mode 100644 index 0000000000..37467b52da --- /dev/null +++ b/src/renderer/src/providers/invalidate-query-provider.tsx @@ -0,0 +1,27 @@ +import { usePageVisibility } from "@renderer/hooks/common" +import { appLog } from "@renderer/lib/log" +import { useQueryClient } from "@tanstack/react-query" +import { useEffect, useRef } from "react" + +/** + * InvalidateQuery when electron app window switch to visible, macOS dock icon click + */ +export const InvalidateQueryProvider = () => { + const queryClient = useQueryClient() + + const currentVisibilityRef = useRef(!document.hidden) + + const pageVisibility = usePageVisibility() + + useEffect(() => { + if (currentVisibilityRef.current === pageVisibility) { + return + } + currentVisibilityRef.current = pageVisibility + if (pageVisibility) { + appLog("Window switch to visible, invalidate all queries") + queryClient.invalidateQueries() + } + }, [pageVisibility, queryClient]) + return null +} diff --git a/src/renderer/src/providers/root-providers.tsx b/src/renderer/src/providers/root-providers.tsx index 6a1c27b9b9..bdcf090dfe 100644 --- a/src/renderer/src/providers/root-providers.tsx +++ b/src/renderer/src/providers/root-providers.tsx @@ -12,6 +12,7 @@ import { HotkeysProvider } from "react-hotkeys-hook" import { ContextMenuProvider } from "./context-menu-provider" import { EventProvider } from "./event-provider" +import { InvalidateQueryProvider } from "./invalidate-query-provider" import { StableRouterProvider } from "./stable-router-provider" import { SettingSync } from "./ui-setting-sync" import { UserProvider } from "./user-provider" @@ -31,6 +32,7 @@ export const RootProviders: FC = ({ children }) => ( persistOptions={persistConfig} client={queryClient} > + @@ -45,6 +47,7 @@ export const RootProviders: FC = ({ children }) => ( + diff --git a/src/renderer/src/services/cleaner.spec.ts b/src/renderer/src/services/cleaner.spec.ts index 2a307b4fc0..44c622e0a0 100644 --- a/src/renderer/src/services/cleaner.spec.ts +++ b/src/renderer/src/services/cleaner.spec.ts @@ -1,8 +1,8 @@ // @ts-nocheck import { browserDB } from "@renderer/database" -import type { FeedModel } from "@renderer/hono" import type { EntryModel } from "@renderer/models" import type { SubscriptionFlatModel } from "@renderer/store/subscription" +import type { FeedModel } from "src/hono" import { beforeAll, describe, expect, test } from "vitest" import { CleanerService } from "./cleaner" diff --git a/src/renderer/src/store/entry/hooks.ts b/src/renderer/src/store/entry/hooks.ts index cd26b17b63..9373cedd27 100644 --- a/src/renderer/src/store/entry/hooks.ts +++ b/src/renderer/src/store/entry/hooks.ts @@ -2,8 +2,8 @@ import { FEED_COLLECTION_LIST, ROUTE_FEED_IN_FOLDER, } from "@renderer/constants" -import type { EntryReadHistoriesModel } from "@renderer/hono" import type { FeedViewType } from "@renderer/lib/enum" +import type { EntryReadHistoriesModel } from "src/hono" import { useShallow } from "zustand/react/shallow" import { useFeedIdByView, useFolderFeedsByFeedId } from "../subscription" diff --git a/src/renderer/src/store/entry/store.ts b/src/renderer/src/store/entry/store.ts index a1498bb505..cdb4abc219 100644 --- a/src/renderer/src/store/entry/store.ts +++ b/src/renderer/src/store/entry/store.ts @@ -1,5 +1,4 @@ import { runTransactionInScope } from "@renderer/database" -import type { EntryReadHistoriesModel } from "@renderer/hono" import { apiClient } from "@renderer/lib/api-fetch" import { getEntriesParams, @@ -10,6 +9,7 @@ import type { CombinedEntryModel, EntryModel, FeedModel, UserModel, import { EntryService } from "@renderer/services" import { produce } from "immer" import { merge, omit } from "lodash-es" +import type { EntryReadHistoriesModel } from "src/hono" import { feedActions } from "../feed" import { feedUnreadActions } from "../unread" diff --git a/src/renderer/src/store/entry/types.ts b/src/renderer/src/store/entry/types.ts index 4302d53cbb..55021161c0 100644 --- a/src/renderer/src/store/entry/types.ts +++ b/src/renderer/src/store/entry/types.ts @@ -1,6 +1,6 @@ -import type { EntryReadHistoriesModel } from "@renderer/hono" import type { FeedViewType } from "@renderer/lib/enum" import type { CombinedEntryModel } from "@renderer/models" +import type { EntryReadHistoriesModel } from "src/hono" type FeedId = string type EntryId = string diff --git a/src/shared/src/bridge.ts b/src/shared/src/bridge.ts index 1441839bba..1325807b40 100644 --- a/src/shared/src/bridge.ts +++ b/src/shared/src/bridge.ts @@ -1,10 +1,13 @@ import type { BrowserWindow } from "electron" import type { toast } from "sonner" +import type { GeneralSettings, UISettings } from "./interface/settings" + const PREFIX = "__follow" interface RenderGlobalContext { showSetting: () => void - + getGeneralSettings: () => GeneralSettings + getUISettings: () => UISettings toast: typeof toast } @@ -12,19 +15,19 @@ export const registerGlobalContext = (context: RenderGlobalContext) => { globalThis[PREFIX] = context } -export function callGlobalContextMethod( - window: BrowserWindow, - method: string, - args?: any[] -): void - export function callGlobalContextMethod( window: BrowserWindow, method: T, // @ts-expect-error args: Parameters = [] as any +): Promise> +export function callGlobalContextMethod( + window: BrowserWindow, + method: string, + args?: any[] ): void + export function callGlobalContextMethod( window: BrowserWindow, method: T, diff --git a/src/shared/src/interface/settings.ts b/src/shared/src/interface/settings.ts new file mode 100644 index 0000000000..0f48f4ed54 --- /dev/null +++ b/src/shared/src/interface/settings.ts @@ -0,0 +1,25 @@ +export interface GeneralSettings { + appLaunchOnStartup: boolean + dataPersist: boolean + sendAnonymousData: boolean + unreadOnly: boolean + scrollMarkUnread: boolean + hoverMarkUnread: boolean + renderMarkUnread: boolean +} + +export interface UISettings { + entryColWidth: number + feedColWidth: number + opaqueSidebar: boolean + sidebarShowUnreadCount: boolean + uiTextSize: number + showDockBadge: boolean + modalOverlay: boolean + modalDraggable: boolean + modalOpaque: boolean + reduceMotion: boolean + readerFontFamily: string + readerRenderInlineStyle: boolean + codeHighlightTheme: string +} diff --git a/tsconfig.node.json b/tsconfig.node.json index 59ee8d6c22..5e817a36d5 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -6,7 +6,8 @@ "src/preload/**/*", "types/**/*.d.ts", "src/shared/src/**/*", - "src/env.ts" + "src/env.ts", + "./src/hono.ts" ], "compilerOptions": { "composite": true, @@ -21,6 +22,9 @@ ], "@env": [ "./src/env.ts" + ], + "@pkg": [ + "./package.json" ] } } diff --git a/tsconfig.web.json b/tsconfig.web.json index a16d2e4a28..9958159a35 100644 --- a/tsconfig.web.json +++ b/tsconfig.web.json @@ -7,7 +7,8 @@ "src/preload/*.d.ts", "src/shared/src/**/*", "types/**/*.d.ts", - "src/env.ts" + "src/env.ts", + "src/hono.ts" ], "compilerOptions": { "composite": true, @@ -27,8 +28,12 @@ "@shared/*": [ "src/shared/src/*" ], - "@pkg": ["./package.json"], - "@env": ["./src/env.ts"] + "@pkg": [ + "./package.json" + ], + "@env": [ + "./src/env.ts" + ] } } }