From 4296e7f4d8de64a62dbf5e5d152b19ae25df489e Mon Sep 17 00:00:00 2001 From: adripo <26493496+adripo@users.noreply.github.com> Date: Mon, 21 Apr 2025 19:59:40 +0200 Subject: chore: rename missing files/conf from Hoarder to Karakeep (#1280) * refactor: Rename remaining project configuration from Hoarder to Karakeep * some fixes --------- Co-authored-by: Mohamed Bassem --- packages/db/index.ts | 2 +- packages/e2e_tests/docker-compose.yml | 2 +- packages/e2e_tests/setup/startContainers.ts | 8 +- packages/e2e_tests/tests/api/assets.test.ts | 8 +- packages/e2e_tests/tests/api/bookmarks.test.ts | 8 +- packages/e2e_tests/tests/api/highlights.test.ts | 8 +- packages/e2e_tests/tests/api/lists.test.ts | 8 +- packages/e2e_tests/tests/api/tags.test.ts | 8 +- packages/e2e_tests/tests/api/users.test.ts | 8 +- packages/e2e_tests/tests/workers/crawler.test.ts | 2 +- packages/e2e_tests/utils/trpc.ts | 2 +- packages/open-api/hoarder-openapi-spec.json | 2901 ---------------------- packages/open-api/index.ts | 10 +- packages/open-api/karakeep-openapi-spec.json | 2901 ++++++++++++++++++++++ packages/sdk/package.json | 3 +- packages/sdk/src/hoarder-api.d.ts | 1843 -------------- packages/sdk/src/index.ts | 2 +- packages/sdk/src/karakeep-api.d.ts | 1843 ++++++++++++++ 18 files changed, 4784 insertions(+), 4783 deletions(-) delete mode 100644 packages/open-api/hoarder-openapi-spec.json create mode 100644 packages/open-api/karakeep-openapi-spec.json delete mode 100644 packages/sdk/src/hoarder-api.d.ts create mode 100644 packages/sdk/src/karakeep-api.d.ts (limited to 'packages') diff --git a/packages/db/index.ts b/packages/db/index.ts index 8a33d488..0a72c9bb 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -10,7 +10,7 @@ export * as schema from "./schema"; export { SqliteError } from "better-sqlite3"; // This is exported here to avoid leaking better-sqlite types outside of this package. -export type HoarderDBTransaction = SQLiteTransaction< +export type KarakeepDBTransaction = SQLiteTransaction< "sync", Database.RunResult, typeof schema, diff --git a/packages/e2e_tests/docker-compose.yml b/packages/e2e_tests/docker-compose.yml index c48d4d63..201db154 100644 --- a/packages/e2e_tests/docker-compose.yml +++ b/packages/e2e_tests/docker-compose.yml @@ -6,7 +6,7 @@ services: target: aio restart: unless-stopped ports: - - "${HOARDER_PORT:-3000}:3000" + - "${KARAKEEP_PORT:-3000}:3000" environment: DATA_DIR: /tmp NEXTAUTH_SECRET: secret diff --git a/packages/e2e_tests/setup/startContainers.ts b/packages/e2e_tests/setup/startContainers.ts index df07cc58..3086d1c8 100644 --- a/packages/e2e_tests/setup/startContainers.ts +++ b/packages/e2e_tests/setup/startContainers.ts @@ -39,7 +39,7 @@ export default async function ({ provide }: GlobalSetupContext) { stdio: "inherit", env: { ...process.env, - HOARDER_PORT: port.toString(), + KARAKEEP_PORT: port.toString(), }, }); @@ -49,9 +49,9 @@ export default async function ({ provide }: GlobalSetupContext) { // Wait 5 seconds for the worker to start await new Promise((resolve) => setTimeout(resolve, 5000)); - provide("hoarderPort", port); + provide("karakeepPort", port); - process.env.HOARDER_PORT = port.toString(); + process.env.KARAKEEP_PORT = port.toString(); return async () => { console.log("Stopping docker compose..."); @@ -65,6 +65,6 @@ export default async function ({ provide }: GlobalSetupContext) { declare module "vitest" { export interface ProvidedContext { - hoarderPort: number; + karakeepPort: number; } } diff --git a/packages/e2e_tests/tests/api/assets.test.ts b/packages/e2e_tests/tests/api/assets.test.ts index 8de3c411..5c294929 100644 --- a/packages/e2e_tests/tests/api/assets.test.ts +++ b/packages/e2e_tests/tests/api/assets.test.ts @@ -1,22 +1,22 @@ import { assert, beforeEach, describe, expect, inject, it } from "vitest"; -import { createHoarderClient } from "@karakeep/sdk"; +import { createKarakeepClient } from "@karakeep/sdk"; import { createTestUser, uploadTestAsset } from "../../utils/api"; describe("Assets API", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); } - let client: ReturnType; + let client: ReturnType; let apiKey: string; beforeEach(async () => { apiKey = await createTestUser(); - client = createHoarderClient({ + client = createKarakeepClient({ baseUrl: `http://localhost:${port}/api/v1/`, headers: { "Content-Type": "application/json", diff --git a/packages/e2e_tests/tests/api/bookmarks.test.ts b/packages/e2e_tests/tests/api/bookmarks.test.ts index 91fbcc20..6c56f689 100644 --- a/packages/e2e_tests/tests/api/bookmarks.test.ts +++ b/packages/e2e_tests/tests/api/bookmarks.test.ts @@ -1,22 +1,22 @@ import { assert, beforeEach, describe, expect, inject, it } from "vitest"; -import { createHoarderClient } from "@karakeep/sdk"; +import { createKarakeepClient } from "@karakeep/sdk"; import { createTestUser } from "../../utils/api"; describe("Bookmarks API", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); } - let client: ReturnType; + let client: ReturnType; let apiKey: string; beforeEach(async () => { apiKey = await createTestUser(); - client = createHoarderClient({ + client = createKarakeepClient({ baseUrl: `http://localhost:${port}/api/v1/`, headers: { "Content-Type": "application/json", diff --git a/packages/e2e_tests/tests/api/highlights.test.ts b/packages/e2e_tests/tests/api/highlights.test.ts index 1523dc91..4776d06d 100644 --- a/packages/e2e_tests/tests/api/highlights.test.ts +++ b/packages/e2e_tests/tests/api/highlights.test.ts @@ -1,22 +1,22 @@ import { beforeEach, describe, expect, inject, it } from "vitest"; -import { createHoarderClient } from "@karakeep/sdk"; +import { createKarakeepClient } from "@karakeep/sdk"; import { createTestUser } from "../../utils/api"; describe("Highlights API", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); } - let client: ReturnType; + let client: ReturnType; let apiKey: string; beforeEach(async () => { apiKey = await createTestUser(); - client = createHoarderClient({ + client = createKarakeepClient({ baseUrl: `http://localhost:${port}/api/v1/`, headers: { "Content-Type": "application/json", diff --git a/packages/e2e_tests/tests/api/lists.test.ts b/packages/e2e_tests/tests/api/lists.test.ts index 2d6ab98c..caddfd87 100644 --- a/packages/e2e_tests/tests/api/lists.test.ts +++ b/packages/e2e_tests/tests/api/lists.test.ts @@ -1,22 +1,22 @@ import { beforeEach, describe, expect, inject, it } from "vitest"; -import { createHoarderClient } from "@karakeep/sdk"; +import { createKarakeepClient } from "@karakeep/sdk"; import { createTestUser } from "../../utils/api"; describe("Lists API", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); } - let client: ReturnType; + let client: ReturnType; let apiKey: string; beforeEach(async () => { apiKey = await createTestUser(); - client = createHoarderClient({ + client = createKarakeepClient({ baseUrl: `http://localhost:${port}/api/v1/`, headers: { "Content-Type": "application/json", diff --git a/packages/e2e_tests/tests/api/tags.test.ts b/packages/e2e_tests/tests/api/tags.test.ts index 3355bc1e..3e3cacc0 100644 --- a/packages/e2e_tests/tests/api/tags.test.ts +++ b/packages/e2e_tests/tests/api/tags.test.ts @@ -1,22 +1,22 @@ import { beforeEach, describe, expect, inject, it } from "vitest"; -import { createHoarderClient } from "@karakeep/sdk"; +import { createKarakeepClient } from "@karakeep/sdk"; import { createTestUser } from "../../utils/api"; describe("Tags API", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); } - let client: ReturnType; + let client: ReturnType; let apiKey: string; beforeEach(async () => { apiKey = await createTestUser(); - client = createHoarderClient({ + client = createKarakeepClient({ baseUrl: `http://localhost:${port}/api/v1/`, headers: { "Content-Type": "application/json", diff --git a/packages/e2e_tests/tests/api/users.test.ts b/packages/e2e_tests/tests/api/users.test.ts index fb33fdca..096e4b54 100644 --- a/packages/e2e_tests/tests/api/users.test.ts +++ b/packages/e2e_tests/tests/api/users.test.ts @@ -1,22 +1,22 @@ import { beforeEach, describe, expect, inject, it } from "vitest"; -import { createHoarderClient } from "@karakeep/sdk"; +import { createKarakeepClient } from "@karakeep/sdk"; import { createTestUser } from "../../utils/api"; describe("Users API", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); } - let client: ReturnType; + let client: ReturnType; let apiKey: string; beforeEach(async () => { apiKey = await createTestUser(); - client = createHoarderClient({ + client = createKarakeepClient({ baseUrl: `http://localhost:${port}/api/v1/`, headers: { "Content-Type": "application/json", diff --git a/packages/e2e_tests/tests/workers/crawler.test.ts b/packages/e2e_tests/tests/workers/crawler.test.ts index df276cae..cafc50cc 100644 --- a/packages/e2e_tests/tests/workers/crawler.test.ts +++ b/packages/e2e_tests/tests/workers/crawler.test.ts @@ -6,7 +6,7 @@ import { createTestUser } from "../../utils/api"; import { waitUntil } from "../../utils/general"; describe("Crawler Tests", () => { - const port = inject("hoarderPort"); + const port = inject("karakeepPort"); if (!port) { throw new Error("Missing required environment variables"); diff --git a/packages/e2e_tests/utils/trpc.ts b/packages/e2e_tests/utils/trpc.ts index a13e0a83..6b4f3979 100644 --- a/packages/e2e_tests/utils/trpc.ts +++ b/packages/e2e_tests/utils/trpc.ts @@ -8,7 +8,7 @@ export function getTrpcClient(apiKey?: string) { links: [ httpBatchLink({ transformer: superjson, - url: `http://localhost:${process.env.HOARDER_PORT}/api/trpc`, + url: `http://localhost:${process.env.KARAKEEP_PORT}/api/trpc`, headers() { return { authorization: apiKey ? `Bearer ${apiKey}` : undefined, diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json deleted file mode 100644 index 9a1d8634..00000000 --- a/packages/open-api/hoarder-openapi-spec.json +++ /dev/null @@ -1,2901 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "version": "1.0.0", - "title": "Hoarder API", - "description": "The API for the Hoarder app" - }, - "servers": [ - { - "url": "{address}/api/v1", - "variables": { - "address": { - "default": "https://try.hoarder.app", - "description": "The address of the hoarder server" - } - } - } - ], - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - } - }, - "schemas": { - "AssetId": { - "type": "string", - "example": "ieidlxygmwj87oxz5hxttoc8" - }, - "BookmarkId": { - "type": "string", - "example": "ieidlxygmwj87oxz5hxttoc8" - }, - "ListId": { - "type": "string", - "example": "ieidlxygmwj87oxz5hxttoc8" - }, - "TagId": { - "type": "string", - "example": "ieidlxygmwj87oxz5hxttoc8" - }, - "HighlightId": { - "type": "string", - "example": "ieidlxygmwj87oxz5hxttoc8" - }, - "Bookmark": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "modifiedAt": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "archived": { - "type": "boolean" - }, - "favourited": { - "type": "boolean" - }, - "taggingStatus": { - "type": "string", - "nullable": true, - "enum": [ - "success", - "failure", - "pending" - ] - }, - "note": { - "type": "string", - "nullable": true - }, - "summary": { - "type": "string", - "nullable": true - }, - "tags": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "attachedBy": { - "type": "string", - "enum": [ - "ai", - "human" - ] - } - }, - "required": [ - "id", - "name", - "attachedBy" - ] - } - }, - "content": { - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "link" - ] - }, - "url": { - "type": "string" - }, - "title": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string", - "nullable": true - }, - "imageUrl": { - "type": "string", - "nullable": true - }, - "imageAssetId": { - "type": "string", - "nullable": true - }, - "screenshotAssetId": { - "type": "string", - "nullable": true - }, - "fullPageArchiveAssetId": { - "type": "string", - "nullable": true - }, - "precrawledArchiveAssetId": { - "type": "string", - "nullable": true - }, - "videoAssetId": { - "type": "string", - "nullable": true - }, - "favicon": { - "type": "string", - "nullable": true - }, - "htmlContent": { - "type": "string", - "nullable": true - }, - "crawledAt": { - "type": "string", - "nullable": true - }, - "author": { - "type": "string", - "nullable": true - }, - "publisher": { - "type": "string", - "nullable": true - }, - "datePublished": { - "type": "string", - "nullable": true - }, - "dateModified": { - "type": "string", - "nullable": true - } - }, - "required": [ - "type", - "url" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "text": { - "type": "string" - }, - "sourceUrl": { - "type": "string", - "nullable": true - } - }, - "required": [ - "type", - "text" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "asset" - ] - }, - "assetType": { - "type": "string", - "enum": [ - "image", - "pdf" - ] - }, - "assetId": { - "type": "string" - }, - "fileName": { - "type": "string", - "nullable": true - }, - "sourceUrl": { - "type": "string", - "nullable": true - }, - "size": { - "type": "number", - "nullable": true - }, - "content": { - "type": "string", - "nullable": true - } - }, - "required": [ - "type", - "assetType", - "assetId" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "unknown" - ] - } - }, - "required": [ - "type" - ] - } - ] - }, - "assets": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "assetType": { - "type": "string", - "enum": [ - "screenshot", - "assetScreenshot", - "bannerImage", - "fullPageArchive", - "video", - "bookmarkAsset", - "precrawledArchive", - "unknown" - ] - } - }, - "required": [ - "id", - "assetType" - ] - } - } - }, - "required": [ - "id", - "createdAt", - "modifiedAt", - "archived", - "favourited", - "taggingStatus", - "tags", - "content", - "assets" - ] - }, - "PaginatedBookmarks": { - "type": "object", - "properties": { - "bookmarks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Bookmark" - } - }, - "nextCursor": { - "type": "string", - "nullable": true - } - }, - "required": [ - "bookmarks", - "nextCursor" - ] - }, - "Cursor": { - "type": "string" - }, - "Highlight": { - "type": "object", - "properties": { - "bookmarkId": { - "type": "string" - }, - "startOffset": { - "type": "number" - }, - "endOffset": { - "type": "number" - }, - "color": { - "type": "string", - "enum": [ - "yellow", - "red", - "green", - "blue" - ], - "default": "yellow" - }, - "text": { - "type": "string", - "nullable": true - }, - "note": { - "type": "string", - "nullable": true - }, - "id": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "createdAt": { - "type": "string" - } - }, - "required": [ - "bookmarkId", - "startOffset", - "endOffset", - "text", - "note", - "id", - "userId", - "createdAt" - ] - }, - "List": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string" - }, - "parentId": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "enum": [ - "manual", - "smart" - ], - "default": "manual" - }, - "query": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "name", - "icon", - "parentId" - ] - }, - "Tag": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "numBookmarks": { - "type": "number" - }, - "numBookmarksByAttachedType": { - "type": "object", - "properties": { - "ai": { - "type": "number" - }, - "human": { - "type": "number" - } - } - } - }, - "required": [ - "id", - "name", - "numBookmarks", - "numBookmarksByAttachedType" - ] - }, - "PaginatedHighlights": { - "type": "object", - "properties": { - "highlights": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Highlight" - } - }, - "nextCursor": { - "type": "string", - "nullable": true - } - }, - "required": [ - "highlights", - "nextCursor" - ] - } - }, - "parameters": { - "AssetId": { - "schema": { - "$ref": "#/components/schemas/AssetId" - }, - "required": true, - "name": "assetId", - "in": "path" - }, - "BookmarkId": { - "schema": { - "$ref": "#/components/schemas/BookmarkId" - }, - "required": true, - "name": "bookmarkId", - "in": "path" - }, - "ListId": { - "schema": { - "$ref": "#/components/schemas/ListId" - }, - "required": true, - "name": "listId", - "in": "path" - }, - "TagId": { - "schema": { - "$ref": "#/components/schemas/TagId" - }, - "required": true, - "name": "tagId", - "in": "path" - }, - "HighlightId": { - "schema": { - "$ref": "#/components/schemas/HighlightId" - }, - "required": true, - "name": "highlightId", - "in": "path" - } - } - }, - "paths": { - "/bookmarks": { - "get": { - "description": "Get all bookmarks", - "summary": "Get all bookmarks", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "required": false, - "name": "archived", - "in": "query" - }, - { - "schema": { - "type": "boolean" - }, - "required": false, - "name": "favourited", - "in": "query" - }, - { - "schema": { - "type": "number" - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "$ref": "#/components/schemas/Cursor" - }, - "required": false, - "name": "cursor", - "in": "query" - }, - { - "schema": { - "type": "boolean", - "default": true, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." - }, - "required": false, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", - "name": "includeContent", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Object with all bookmarks data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedBookmarks" - } - } - } - } - } - }, - "post": { - "description": "Create a new bookmark", - "summary": "Create a new bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "description": "The bookmark to create", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "type": "object", - "properties": { - "title": { - "type": "string", - "nullable": true, - "maxLength": 1000 - }, - "archived": { - "type": "boolean" - }, - "favourited": { - "type": "boolean" - }, - "note": { - "type": "string" - }, - "summary": { - "type": "string" - }, - "createdAt": { - "type": "string", - "nullable": true - } - } - }, - { - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "link" - ] - }, - "url": { - "type": "string", - "format": "uri" - }, - "precrawledArchiveId": { - "type": "string" - } - }, - "required": [ - "type", - "url" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "text": { - "type": "string" - }, - "sourceUrl": { - "type": "string" - } - }, - "required": [ - "type", - "text" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "asset" - ] - }, - "assetType": { - "type": "string", - "enum": [ - "image", - "pdf" - ] - }, - "assetId": { - "type": "string" - }, - "fileName": { - "type": "string" - }, - "sourceUrl": { - "type": "string" - } - }, - "required": [ - "type", - "assetType", - "assetId" - ] - } - ] - } - ] - } - } - } - }, - "responses": { - "201": { - "description": "The created bookmark", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Bookmark" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/bookmarks/search": { - "get": { - "description": "Search bookmarks", - "summary": "Search bookmarks", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "schema": { - "type": "string" - }, - "required": true, - "name": "q", - "in": "query" - }, - { - "schema": { - "type": "number" - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "$ref": "#/components/schemas/Cursor" - }, - "required": false, - "name": "cursor", - "in": "query" - }, - { - "schema": { - "type": "boolean", - "default": true, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." - }, - "required": false, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", - "name": "includeContent", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Object with the search results.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedBookmarks" - } - } - } - } - } - } - }, - "/bookmarks/{bookmarkId}": { - "get": { - "description": "Get bookmark by its id", - "summary": "Get a single bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - }, - { - "schema": { - "type": "boolean", - "default": true, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." - }, - "required": false, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", - "name": "includeContent", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Object with bookmark data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Bookmark" - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Delete bookmark by its id", - "summary": "Delete a bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "responses": { - "204": { - "description": "No content - the bookmark was deleted" - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "patch": { - "description": "Update bookmark by its id", - "summary": "Update a bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "requestBody": { - "description": "The data to update. Only the fields you want to update need to be provided.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "archived": { - "type": "boolean" - }, - "favourited": { - "type": "boolean" - }, - "summary": { - "type": "string", - "nullable": true - }, - "note": { - "type": "string" - }, - "title": { - "type": "string", - "nullable": true, - "maxLength": 1000 - }, - "createdAt": { - "type": "string", - "nullable": true - }, - "url": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string", - "nullable": true - }, - "author": { - "type": "string", - "nullable": true - }, - "publisher": { - "type": "string", - "nullable": true - }, - "datePublished": { - "type": "string", - "nullable": true - }, - "dateModified": { - "type": "string", - "nullable": true - }, - "text": { - "type": "string", - "nullable": true - }, - "assetContent": { - "type": "string", - "nullable": true - } - } - } - } - } - }, - "responses": { - "200": { - "description": "The updated bookmark", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "modifiedAt": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "archived": { - "type": "boolean" - }, - "favourited": { - "type": "boolean" - }, - "taggingStatus": { - "type": "string", - "nullable": true, - "enum": [ - "success", - "failure", - "pending" - ] - }, - "note": { - "type": "string", - "nullable": true - }, - "summary": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "createdAt", - "modifiedAt", - "archived", - "favourited", - "taggingStatus" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/bookmarks/{bookmarkId}/summarize": { - "post": { - "description": "Attaches a summary to the bookmark and returns the updated record.", - "summary": "Summarize a bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "responses": { - "200": { - "description": "The updated bookmark with summary", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "modifiedAt": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "archived": { - "type": "boolean" - }, - "favourited": { - "type": "boolean" - }, - "taggingStatus": { - "type": "string", - "nullable": true, - "enum": [ - "success", - "failure", - "pending" - ] - }, - "note": { - "type": "string", - "nullable": true - }, - "summary": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "createdAt", - "modifiedAt", - "archived", - "favourited", - "taggingStatus" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/bookmarks/{bookmarkId}/tags": { - "post": { - "description": "Attach tags to a bookmark", - "summary": "Attach tags to a bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "requestBody": { - "description": "The tags to attach.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": { - "type": "object", - "properties": { - "tagId": { - "type": "string" - }, - "tagName": { - "type": "string" - } - } - } - } - }, - "required": [ - "tags" - ] - } - } - } - }, - "responses": { - "200": { - "description": "The list of attached tag ids", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "attached": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TagId" - } - } - }, - "required": [ - "attached" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Detach tags from a bookmark", - "summary": "Detach tags from a bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "requestBody": { - "description": "The tags to detach.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": { - "type": "object", - "properties": { - "tagId": { - "type": "string" - }, - "tagName": { - "type": "string" - } - } - } - } - }, - "required": [ - "tags" - ] - } - } - } - }, - "responses": { - "200": { - "description": "The list of detached tag ids", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "detached": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TagId" - } - } - }, - "required": [ - "detached" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/bookmarks/{bookmarkId}/highlights": { - "get": { - "description": "Get highlights of a bookmark", - "summary": "Get highlights of a bookmark", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "responses": { - "200": { - "description": "The list of highlights", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "highlights": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Highlight" - } - } - }, - "required": [ - "highlights" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/bookmarks/{bookmarkId}/assets": { - "post": { - "description": "Attach a new asset to a bookmark", - "summary": "Attach asset", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "requestBody": { - "description": "The asset to attach", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "assetType": { - "type": "string", - "enum": [ - "screenshot", - "assetScreenshot", - "bannerImage", - "fullPageArchive", - "video", - "bookmarkAsset", - "precrawledArchive", - "unknown" - ] - } - }, - "required": [ - "id", - "assetType" - ] - } - } - } - }, - "responses": { - "201": { - "description": "The attached asset", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "assetType": { - "type": "string", - "enum": [ - "screenshot", - "assetScreenshot", - "bannerImage", - "fullPageArchive", - "video", - "bookmarkAsset", - "precrawledArchive", - "unknown" - ] - } - }, - "required": [ - "id", - "assetType" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/bookmarks/{bookmarkId}/assets/{assetId}": { - "put": { - "description": "Replace an existing asset with a new one", - "summary": "Replace asset", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - }, - { - "$ref": "#/components/parameters/AssetId" - } - ], - "requestBody": { - "description": "The new asset to replace with", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "assetId": { - "type": "string" - } - }, - "required": [ - "assetId" - ] - } - } - } - }, - "responses": { - "204": { - "description": "No content - asset was replaced successfully" - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Detach an asset from a bookmark", - "summary": "Detach asset", - "tags": [ - "Bookmarks" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/BookmarkId" - }, - { - "$ref": "#/components/parameters/AssetId" - } - ], - "responses": { - "204": { - "description": "No content - asset was detached successfully" - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/lists": { - "get": { - "description": "Get all lists", - "summary": "Get all lists", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "Object with all lists data.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "lists": { - "type": "array", - "items": { - "$ref": "#/components/schemas/List" - } - } - }, - "required": [ - "lists" - ] - } - } - } - } - } - }, - "post": { - "description": "Create a new list", - "summary": "Create a new list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "description": "The list to create", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40 - }, - "description": { - "type": "string", - "minLength": 0, - "maxLength": 100 - }, - "icon": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "manual", - "smart" - ], - "default": "manual" - }, - "query": { - "type": "string", - "minLength": 1 - }, - "parentId": { - "type": "string", - "nullable": true - } - }, - "required": [ - "name", - "icon" - ] - } - } - } - }, - "responses": { - "201": { - "description": "The created list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/List" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/lists/{listId}": { - "get": { - "description": "Get list by its id", - "summary": "Get a single list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/ListId" - } - ], - "responses": { - "200": { - "description": "Object with list data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/List" - } - } - } - }, - "404": { - "description": "List not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Delete list by its id", - "summary": "Delete a list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/ListId" - } - ], - "responses": { - "204": { - "description": "No content - the bookmark was deleted" - }, - "404": { - "description": "List not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "patch": { - "description": "Update list by its id", - "summary": "Update a list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/ListId" - } - ], - "requestBody": { - "description": "The data to update. Only the fields you want to update need to be provided.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40 - }, - "description": { - "type": "string", - "nullable": true, - "minLength": 0, - "maxLength": 100 - }, - "icon": { - "type": "string" - }, - "parentId": { - "type": "string", - "nullable": true - }, - "query": { - "type": "string", - "minLength": 1 - } - } - } - } - } - }, - "responses": { - "200": { - "description": "The updated list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/List" - } - } - } - }, - "404": { - "description": "List not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/lists/{listId}/bookmarks": { - "get": { - "description": "Get the bookmarks in a list", - "summary": "Get a bookmarks in a list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/ListId" - }, - { - "schema": { - "type": "number" - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "$ref": "#/components/schemas/Cursor" - }, - "required": false, - "name": "cursor", - "in": "query" - }, - { - "schema": { - "type": "boolean", - "default": true, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." - }, - "required": false, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", - "name": "includeContent", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Object with list data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedBookmarks" - } - } - } - }, - "404": { - "description": "List not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/lists/{listId}/bookmarks/{bookmarkId}": { - "put": { - "description": "Add the bookmarks to a list", - "summary": "Add a bookmark to a list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/ListId" - }, - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "responses": { - "204": { - "description": "No content - the bookmark was added" - }, - "400": { - "description": "Bookmark already in list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - }, - "404": { - "description": "List or bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Remove the bookmarks from a list", - "summary": "Remove a bookmark from a list", - "tags": [ - "Lists" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/ListId" - }, - { - "$ref": "#/components/parameters/BookmarkId" - } - ], - "responses": { - "204": { - "description": "No content - the bookmark was added" - }, - "400": { - "description": "Bookmark already not in list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - }, - "404": { - "description": "List or bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/tags": { - "get": { - "description": "Get all tags", - "summary": "Get all tags", - "tags": [ - "Tags" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "Object with all tags data.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - } - } - }, - "required": [ - "tags" - ] - } - } - } - } - } - } - }, - "/tags/{tagId}": { - "get": { - "description": "Get tag by its id", - "summary": "Get a single tag", - "tags": [ - "Tags" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/TagId" - } - ], - "responses": { - "200": { - "description": "Object with list data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Tag" - } - } - } - }, - "404": { - "description": "Tag not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Delete tag by its id", - "summary": "Delete a tag", - "tags": [ - "Tags" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/TagId" - } - ], - "responses": { - "204": { - "description": "No content - the bookmark was deleted" - }, - "404": { - "description": "Tag not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "patch": { - "description": "Update tag by its id", - "summary": "Update a tag", - "tags": [ - "Tags" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/TagId" - } - ], - "requestBody": { - "description": "The data to update. Only the fields you want to update need to be provided.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "The updated tag", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Tag" - } - } - } - }, - "404": { - "description": "Tag not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/tags/{tagId}/bookmarks": { - "get": { - "description": "Get the bookmarks with the tag", - "summary": "Get a bookmarks with the tag", - "tags": [ - "Tags" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/TagId" - }, - { - "schema": { - "type": "number" - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "$ref": "#/components/schemas/Cursor" - }, - "required": false, - "name": "cursor", - "in": "query" - }, - { - "schema": { - "type": "boolean", - "default": true, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." - }, - "required": false, - "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", - "name": "includeContent", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Object with list data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedBookmarks" - } - } - } - }, - "404": { - "description": "Tag not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/highlights": { - "get": { - "description": "Get all highlights", - "summary": "Get all highlights", - "tags": [ - "Highlights" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "schema": { - "type": "number" - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "$ref": "#/components/schemas/Cursor" - }, - "required": false, - "name": "cursor", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Object with all highlights data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedHighlights" - } - } - } - } - } - }, - "post": { - "description": "Create a new highlight", - "summary": "Create a new highlight", - "tags": [ - "Highlights" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "description": "The highlight to create", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bookmarkId": { - "type": "string" - }, - "startOffset": { - "type": "number" - }, - "endOffset": { - "type": "number" - }, - "color": { - "type": "string", - "enum": [ - "yellow", - "red", - "green", - "blue" - ], - "default": "yellow" - }, - "text": { - "type": "string", - "nullable": true - }, - "note": { - "type": "string", - "nullable": true - } - }, - "required": [ - "bookmarkId", - "startOffset", - "endOffset", - "text", - "note" - ] - } - } - } - }, - "responses": { - "201": { - "description": "The created highlight", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Highlight" - } - } - } - }, - "400": { - "description": "Bad highlight request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - }, - "404": { - "description": "Bookmark not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/highlights/{highlightId}": { - "get": { - "description": "Get highlight by its id", - "summary": "Get a single highlight", - "tags": [ - "Highlights" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/HighlightId" - } - ], - "responses": { - "200": { - "description": "Object with highlight data.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Highlight" - } - } - } - }, - "404": { - "description": "Highlight not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "delete": { - "description": "Delete highlight by its id", - "summary": "Delete a highlight", - "tags": [ - "Highlights" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/HighlightId" - } - ], - "responses": { - "200": { - "description": "The deleted highlight", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Highlight" - } - } - } - }, - "404": { - "description": "Highlight not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - }, - "patch": { - "description": "Update highlight by its id", - "summary": "Update a highlight", - "tags": [ - "Highlights" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/HighlightId" - } - ], - "requestBody": { - "description": "The data to update. Only the fields you want to update need to be provided.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "color": { - "type": "string", - "enum": [ - "yellow", - "red", - "green", - "blue" - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "The updated highlight", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Highlight" - } - } - } - }, - "404": { - "description": "Highlight not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ] - } - } - } - } - } - } - }, - "/users/me": { - "get": { - "description": "Returns info about the current user", - "summary": "Get current user info", - "tags": [ - "Users" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "Object with user data.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string", - "nullable": true - }, - "email": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id" - ] - } - } - } - } - } - } - }, - "/users/me/stats": { - "get": { - "description": "Returns stats about the current user", - "summary": "Get current user stats", - "tags": [ - "Users" - ], - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "Object with user stats.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "numBookmarks": { - "type": "number" - }, - "numFavorites": { - "type": "number" - }, - "numArchived": { - "type": "number" - }, - "numTags": { - "type": "number" - }, - "numLists": { - "type": "number" - }, - "numHighlights": { - "type": "number" - } - }, - "required": [ - "numBookmarks", - "numFavorites", - "numArchived", - "numTags", - "numLists", - "numHighlights" - ] - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/open-api/index.ts b/packages/open-api/index.ts index d96cb5ca..9186805e 100644 --- a/packages/open-api/index.ts +++ b/packages/open-api/index.ts @@ -27,16 +27,16 @@ function getOpenApiDocumentation() { openapi: "3.0.0", info: { version: "1.0.0", - title: "Hoarder API", - description: "The API for the Hoarder app", + title: "Karakeep API", + description: "The API for the Karakeep app", }, servers: [ { url: "{address}/api/v1", variables: { address: { - default: "https://try.hoarder.app", - description: "The address of the hoarder server", + default: "https://try.karakeep.app", + description: "The address of the Karakeep server", }, }, }, @@ -47,7 +47,7 @@ function getOpenApiDocumentation() { function writeDocumentation() { const docs = getOpenApiDocumentation(); const fileContent = JSON.stringify(docs, null, 2); - fs.writeFileSync(`./hoarder-openapi-spec.json`, fileContent, { + fs.writeFileSync(`./karakeep-openapi-spec.json`, fileContent, { encoding: "utf-8", }); } diff --git a/packages/open-api/karakeep-openapi-spec.json b/packages/open-api/karakeep-openapi-spec.json new file mode 100644 index 00000000..0f8074d4 --- /dev/null +++ b/packages/open-api/karakeep-openapi-spec.json @@ -0,0 +1,2901 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Karakeep API", + "description": "The API for the Karakeep app" + }, + "servers": [ + { + "url": "{address}/api/v1", + "variables": { + "address": { + "default": "https://try.karakeep.app", + "description": "The address of the Karakeep server" + } + } + } + ], + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "AssetId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, + "BookmarkId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, + "ListId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, + "TagId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, + "HighlightId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, + "Bookmark": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "modifiedAt": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "archived": { + "type": "boolean" + }, + "favourited": { + "type": "boolean" + }, + "taggingStatus": { + "type": "string", + "nullable": true, + "enum": [ + "success", + "failure", + "pending" + ] + }, + "note": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "attachedBy": { + "type": "string", + "enum": [ + "ai", + "human" + ] + } + }, + "required": [ + "id", + "name", + "attachedBy" + ] + } + }, + "content": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "link" + ] + }, + "url": { + "type": "string" + }, + "title": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "imageUrl": { + "type": "string", + "nullable": true + }, + "imageAssetId": { + "type": "string", + "nullable": true + }, + "screenshotAssetId": { + "type": "string", + "nullable": true + }, + "fullPageArchiveAssetId": { + "type": "string", + "nullable": true + }, + "precrawledArchiveAssetId": { + "type": "string", + "nullable": true + }, + "videoAssetId": { + "type": "string", + "nullable": true + }, + "favicon": { + "type": "string", + "nullable": true + }, + "htmlContent": { + "type": "string", + "nullable": true + }, + "crawledAt": { + "type": "string", + "nullable": true + }, + "author": { + "type": "string", + "nullable": true + }, + "publisher": { + "type": "string", + "nullable": true + }, + "datePublished": { + "type": "string", + "nullable": true + }, + "dateModified": { + "type": "string", + "nullable": true + } + }, + "required": [ + "type", + "url" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "text": { + "type": "string" + }, + "sourceUrl": { + "type": "string", + "nullable": true + } + }, + "required": [ + "type", + "text" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "asset" + ] + }, + "assetType": { + "type": "string", + "enum": [ + "image", + "pdf" + ] + }, + "assetId": { + "type": "string" + }, + "fileName": { + "type": "string", + "nullable": true + }, + "sourceUrl": { + "type": "string", + "nullable": true + }, + "size": { + "type": "number", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + } + }, + "required": [ + "type", + "assetType", + "assetId" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "unknown" + ] + } + }, + "required": [ + "type" + ] + } + ] + }, + "assets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "assetType": { + "type": "string", + "enum": [ + "screenshot", + "assetScreenshot", + "bannerImage", + "fullPageArchive", + "video", + "bookmarkAsset", + "precrawledArchive", + "unknown" + ] + } + }, + "required": [ + "id", + "assetType" + ] + } + } + }, + "required": [ + "id", + "createdAt", + "modifiedAt", + "archived", + "favourited", + "taggingStatus", + "tags", + "content", + "assets" + ] + }, + "PaginatedBookmarks": { + "type": "object", + "properties": { + "bookmarks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Bookmark" + } + }, + "nextCursor": { + "type": "string", + "nullable": true + } + }, + "required": [ + "bookmarks", + "nextCursor" + ] + }, + "Cursor": { + "type": "string" + }, + "Highlight": { + "type": "object", + "properties": { + "bookmarkId": { + "type": "string" + }, + "startOffset": { + "type": "number" + }, + "endOffset": { + "type": "number" + }, + "color": { + "type": "string", + "enum": [ + "yellow", + "red", + "green", + "blue" + ], + "default": "yellow" + }, + "text": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "required": [ + "bookmarkId", + "startOffset", + "endOffset", + "text", + "note", + "id", + "userId", + "createdAt" + ] + }, + "List": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string" + }, + "parentId": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "enum": [ + "manual", + "smart" + ], + "default": "manual" + }, + "query": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "icon", + "parentId" + ] + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "numBookmarks": { + "type": "number" + }, + "numBookmarksByAttachedType": { + "type": "object", + "properties": { + "ai": { + "type": "number" + }, + "human": { + "type": "number" + } + } + } + }, + "required": [ + "id", + "name", + "numBookmarks", + "numBookmarksByAttachedType" + ] + }, + "PaginatedHighlights": { + "type": "object", + "properties": { + "highlights": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Highlight" + } + }, + "nextCursor": { + "type": "string", + "nullable": true + } + }, + "required": [ + "highlights", + "nextCursor" + ] + } + }, + "parameters": { + "AssetId": { + "schema": { + "$ref": "#/components/schemas/AssetId" + }, + "required": true, + "name": "assetId", + "in": "path" + }, + "BookmarkId": { + "schema": { + "$ref": "#/components/schemas/BookmarkId" + }, + "required": true, + "name": "bookmarkId", + "in": "path" + }, + "ListId": { + "schema": { + "$ref": "#/components/schemas/ListId" + }, + "required": true, + "name": "listId", + "in": "path" + }, + "TagId": { + "schema": { + "$ref": "#/components/schemas/TagId" + }, + "required": true, + "name": "tagId", + "in": "path" + }, + "HighlightId": { + "schema": { + "$ref": "#/components/schemas/HighlightId" + }, + "required": true, + "name": "highlightId", + "in": "path" + } + } + }, + "paths": { + "/bookmarks": { + "get": { + "description": "Get all bookmarks", + "summary": "Get all bookmarks", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "required": false, + "name": "archived", + "in": "query" + }, + { + "schema": { + "type": "boolean" + }, + "required": false, + "name": "favourited", + "in": "query" + }, + { + "schema": { + "type": "number" + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/Cursor" + }, + "required": false, + "name": "cursor", + "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with all bookmarks data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedBookmarks" + } + } + } + } + } + }, + "post": { + "description": "Create a new bookmark", + "summary": "Create a new bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "description": "The bookmark to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "title": { + "type": "string", + "nullable": true, + "maxLength": 1000 + }, + "archived": { + "type": "boolean" + }, + "favourited": { + "type": "boolean" + }, + "note": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "createdAt": { + "type": "string", + "nullable": true + } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "link" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "precrawledArchiveId": { + "type": "string" + } + }, + "required": [ + "type", + "url" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "text": { + "type": "string" + }, + "sourceUrl": { + "type": "string" + } + }, + "required": [ + "type", + "text" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "asset" + ] + }, + "assetType": { + "type": "string", + "enum": [ + "image", + "pdf" + ] + }, + "assetId": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "sourceUrl": { + "type": "string" + } + }, + "required": [ + "type", + "assetType", + "assetId" + ] + } + ] + } + ] + } + } + } + }, + "responses": { + "201": { + "description": "The created bookmark", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bookmark" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/bookmarks/search": { + "get": { + "description": "Search bookmarks", + "summary": "Search bookmarks", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "q", + "in": "query" + }, + { + "schema": { + "type": "number" + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/Cursor" + }, + "required": false, + "name": "cursor", + "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with the search results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedBookmarks" + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}": { + "get": { + "description": "Get bookmark by its id", + "summary": "Get a single bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with bookmark data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bookmark" + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Delete bookmark by its id", + "summary": "Delete a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "responses": { + "204": { + "description": "No content - the bookmark was deleted" + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "patch": { + "description": "Update bookmark by its id", + "summary": "Update a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "requestBody": { + "description": "The data to update. Only the fields you want to update need to be provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "archived": { + "type": "boolean" + }, + "favourited": { + "type": "boolean" + }, + "summary": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string" + }, + "title": { + "type": "string", + "nullable": true, + "maxLength": 1000 + }, + "createdAt": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri" + }, + "description": { + "type": "string", + "nullable": true + }, + "author": { + "type": "string", + "nullable": true + }, + "publisher": { + "type": "string", + "nullable": true + }, + "datePublished": { + "type": "string", + "nullable": true + }, + "dateModified": { + "type": "string", + "nullable": true + }, + "text": { + "type": "string", + "nullable": true + }, + "assetContent": { + "type": "string", + "nullable": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The updated bookmark", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "modifiedAt": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "archived": { + "type": "boolean" + }, + "favourited": { + "type": "boolean" + }, + "taggingStatus": { + "type": "string", + "nullable": true, + "enum": [ + "success", + "failure", + "pending" + ] + }, + "note": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "createdAt", + "modifiedAt", + "archived", + "favourited", + "taggingStatus" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}/summarize": { + "post": { + "description": "Attaches a summary to the bookmark and returns the updated record.", + "summary": "Summarize a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "responses": { + "200": { + "description": "The updated bookmark with summary", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "modifiedAt": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "archived": { + "type": "boolean" + }, + "favourited": { + "type": "boolean" + }, + "taggingStatus": { + "type": "string", + "nullable": true, + "enum": [ + "success", + "failure", + "pending" + ] + }, + "note": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "createdAt", + "modifiedAt", + "archived", + "favourited", + "taggingStatus" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}/tags": { + "post": { + "description": "Attach tags to a bookmark", + "summary": "Attach tags to a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "requestBody": { + "description": "The tags to attach.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tagId": { + "type": "string" + }, + "tagName": { + "type": "string" + } + } + } + } + }, + "required": [ + "tags" + ] + } + } + } + }, + "responses": { + "200": { + "description": "The list of attached tag ids", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "attached": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TagId" + } + } + }, + "required": [ + "attached" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Detach tags from a bookmark", + "summary": "Detach tags from a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "requestBody": { + "description": "The tags to detach.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tagId": { + "type": "string" + }, + "tagName": { + "type": "string" + } + } + } + } + }, + "required": [ + "tags" + ] + } + } + } + }, + "responses": { + "200": { + "description": "The list of detached tag ids", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "detached": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TagId" + } + } + }, + "required": [ + "detached" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}/highlights": { + "get": { + "description": "Get highlights of a bookmark", + "summary": "Get highlights of a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "responses": { + "200": { + "description": "The list of highlights", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "highlights": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Highlight" + } + } + }, + "required": [ + "highlights" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}/assets": { + "post": { + "description": "Attach a new asset to a bookmark", + "summary": "Attach asset", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "requestBody": { + "description": "The asset to attach", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "assetType": { + "type": "string", + "enum": [ + "screenshot", + "assetScreenshot", + "bannerImage", + "fullPageArchive", + "video", + "bookmarkAsset", + "precrawledArchive", + "unknown" + ] + } + }, + "required": [ + "id", + "assetType" + ] + } + } + } + }, + "responses": { + "201": { + "description": "The attached asset", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "assetType": { + "type": "string", + "enum": [ + "screenshot", + "assetScreenshot", + "bannerImage", + "fullPageArchive", + "video", + "bookmarkAsset", + "precrawledArchive", + "unknown" + ] + } + }, + "required": [ + "id", + "assetType" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/bookmarks/{bookmarkId}/assets/{assetId}": { + "put": { + "description": "Replace an existing asset with a new one", + "summary": "Replace asset", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + }, + { + "$ref": "#/components/parameters/AssetId" + } + ], + "requestBody": { + "description": "The new asset to replace with", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "assetId": { + "type": "string" + } + }, + "required": [ + "assetId" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No content - asset was replaced successfully" + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Detach an asset from a bookmark", + "summary": "Detach asset", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + }, + { + "$ref": "#/components/parameters/AssetId" + } + ], + "responses": { + "204": { + "description": "No content - asset was detached successfully" + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/lists": { + "get": { + "description": "Get all lists", + "summary": "Get all lists", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Object with all lists data.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/List" + } + } + }, + "required": [ + "lists" + ] + } + } + } + } + } + }, + "post": { + "description": "Create a new list", + "summary": "Create a new list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "description": "The list to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "description": { + "type": "string", + "minLength": 0, + "maxLength": 100 + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "manual", + "smart" + ], + "default": "manual" + }, + "query": { + "type": "string", + "minLength": 1 + }, + "parentId": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "icon" + ] + } + } + } + }, + "responses": { + "201": { + "description": "The created list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/List" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/lists/{listId}": { + "get": { + "description": "Get list by its id", + "summary": "Get a single list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/ListId" + } + ], + "responses": { + "200": { + "description": "Object with list data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/List" + } + } + } + }, + "404": { + "description": "List not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Delete list by its id", + "summary": "Delete a list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/ListId" + } + ], + "responses": { + "204": { + "description": "No content - the bookmark was deleted" + }, + "404": { + "description": "List not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "patch": { + "description": "Update list by its id", + "summary": "Update a list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/ListId" + } + ], + "requestBody": { + "description": "The data to update. Only the fields you want to update need to be provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "description": { + "type": "string", + "nullable": true, + "minLength": 0, + "maxLength": 100 + }, + "icon": { + "type": "string" + }, + "parentId": { + "type": "string", + "nullable": true + }, + "query": { + "type": "string", + "minLength": 1 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The updated list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/List" + } + } + } + }, + "404": { + "description": "List not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/lists/{listId}/bookmarks": { + "get": { + "description": "Get the bookmarks in a list", + "summary": "Get a bookmarks in a list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/ListId" + }, + { + "schema": { + "type": "number" + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/Cursor" + }, + "required": false, + "name": "cursor", + "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with list data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedBookmarks" + } + } + } + }, + "404": { + "description": "List not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/lists/{listId}/bookmarks/{bookmarkId}": { + "put": { + "description": "Add the bookmarks to a list", + "summary": "Add a bookmark to a list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/ListId" + }, + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "responses": { + "204": { + "description": "No content - the bookmark was added" + }, + "400": { + "description": "Bookmark already in list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + }, + "404": { + "description": "List or bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Remove the bookmarks from a list", + "summary": "Remove a bookmark from a list", + "tags": [ + "Lists" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/ListId" + }, + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "responses": { + "204": { + "description": "No content - the bookmark was added" + }, + "400": { + "description": "Bookmark already not in list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + }, + "404": { + "description": "List or bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/tags": { + "get": { + "description": "Get all tags", + "summary": "Get all tags", + "tags": [ + "Tags" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Object with all tags data.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tag" + } + } + }, + "required": [ + "tags" + ] + } + } + } + } + } + } + }, + "/tags/{tagId}": { + "get": { + "description": "Get tag by its id", + "summary": "Get a single tag", + "tags": [ + "Tags" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/TagId" + } + ], + "responses": { + "200": { + "description": "Object with list data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "404": { + "description": "Tag not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Delete tag by its id", + "summary": "Delete a tag", + "tags": [ + "Tags" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/TagId" + } + ], + "responses": { + "204": { + "description": "No content - the bookmark was deleted" + }, + "404": { + "description": "Tag not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "patch": { + "description": "Update tag by its id", + "summary": "Update a tag", + "tags": [ + "Tags" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/TagId" + } + ], + "requestBody": { + "description": "The data to update. Only the fields you want to update need to be provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The updated tag", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "404": { + "description": "Tag not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/tags/{tagId}/bookmarks": { + "get": { + "description": "Get the bookmarks with the tag", + "summary": "Get a bookmarks with the tag", + "tags": [ + "Tags" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/TagId" + }, + { + "schema": { + "type": "number" + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/Cursor" + }, + "required": false, + "name": "cursor", + "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with list data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedBookmarks" + } + } + } + }, + "404": { + "description": "Tag not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/highlights": { + "get": { + "description": "Get all highlights", + "summary": "Get all highlights", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "schema": { + "type": "number" + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/Cursor" + }, + "required": false, + "name": "cursor", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with all highlights data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedHighlights" + } + } + } + } + } + }, + "post": { + "description": "Create a new highlight", + "summary": "Create a new highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "description": "The highlight to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bookmarkId": { + "type": "string" + }, + "startOffset": { + "type": "number" + }, + "endOffset": { + "type": "number" + }, + "color": { + "type": "string", + "enum": [ + "yellow", + "red", + "green", + "blue" + ], + "default": "yellow" + }, + "text": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + } + }, + "required": [ + "bookmarkId", + "startOffset", + "endOffset", + "text", + "note" + ] + } + } + } + }, + "responses": { + "201": { + "description": "The created highlight", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + }, + "400": { + "description": "Bad highlight request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + }, + "404": { + "description": "Bookmark not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/highlights/{highlightId}": { + "get": { + "description": "Get highlight by its id", + "summary": "Get a single highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/HighlightId" + } + ], + "responses": { + "200": { + "description": "Object with highlight data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + }, + "404": { + "description": "Highlight not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "delete": { + "description": "Delete highlight by its id", + "summary": "Delete a highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/HighlightId" + } + ], + "responses": { + "200": { + "description": "The deleted highlight", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + }, + "404": { + "description": "Highlight not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + }, + "patch": { + "description": "Update highlight by its id", + "summary": "Update a highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/HighlightId" + } + ], + "requestBody": { + "description": "The data to update. Only the fields you want to update need to be provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "color": { + "type": "string", + "enum": [ + "yellow", + "red", + "green", + "blue" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The updated highlight", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + }, + "404": { + "description": "Highlight not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ] + } + } + } + } + } + } + }, + "/users/me": { + "get": { + "description": "Returns info about the current user", + "summary": "Get current user info", + "tags": [ + "Users" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Object with user data.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + } + } + } + } + } + } + }, + "/users/me/stats": { + "get": { + "description": "Returns stats about the current user", + "summary": "Get current user stats", + "tags": [ + "Users" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Object with user stats.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "numBookmarks": { + "type": "number" + }, + "numFavorites": { + "type": "number" + }, + "numArchived": { + "type": "number" + }, + "numTags": { + "type": "number" + }, + "numLists": { + "type": "number" + }, + "numHighlights": { + "type": "number" + } + }, + "required": [ + "numBookmarks", + "numFavorites", + "numArchived", + "numTags", + "numLists", + "numHighlights" + ] + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/sdk/package.json b/packages/sdk/package.json index eada3234..ea23a8cd 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -6,6 +6,7 @@ "license": "GNU Affero General Public License version 3", "keywords": [ "hoarder", + "karakeep", "sdk" ], "main": "./src/index.ts", @@ -46,7 +47,7 @@ "@karakeep/eslint-config/base" ], "ignorePatterns": [ - "src/hoarder-api.d.ts" + "src/karakeep-api.d.ts" ] }, "prettier": "@karakeep/prettier-config", diff --git a/packages/sdk/src/hoarder-api.d.ts b/packages/sdk/src/hoarder-api.d.ts deleted file mode 100644 index 0b434b3d..00000000 --- a/packages/sdk/src/hoarder-api.d.ts +++ /dev/null @@ -1,1843 +0,0 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ - -export interface paths { - "/bookmarks": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get all bookmarks - * @description Get all bookmarks - */ - get: { - parameters: { - query?: { - archived?: boolean; - favourited?: boolean; - limit?: number; - cursor?: components["schemas"]["Cursor"]; - /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ - includeContent?: boolean; - }; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with all bookmarks data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["PaginatedBookmarks"]; - }; - }; - }; - }; - put?: never; - /** - * Create a new bookmark - * @description Create a new bookmark - */ - post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description The bookmark to create */ - requestBody?: { - content: { - "application/json": { - title?: string | null; - archived?: boolean; - favourited?: boolean; - note?: string; - summary?: string; - createdAt?: string | null; - } & ( - | { - /** @enum {string} */ - type: "link"; - /** Format: uri */ - url: string; - precrawledArchiveId?: string; - } - | { - /** @enum {string} */ - type: "text"; - text: string; - sourceUrl?: string; - } - | { - /** @enum {string} */ - type: "asset"; - /** @enum {string} */ - assetType: "image" | "pdf"; - assetId: string; - fileName?: string; - sourceUrl?: string; - } - ); - }; - }; - responses: { - /** @description The created bookmark */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Bookmark"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/bookmarks/search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Search bookmarks - * @description Search bookmarks - */ - get: { - parameters: { - query: { - q: string; - limit?: number; - cursor?: components["schemas"]["Cursor"]; - /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ - includeContent?: boolean; - }; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with the search results. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["PaginatedBookmarks"]; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/bookmarks/{bookmarkId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a single bookmark - * @description Get bookmark by its id - */ - get: { - parameters: { - query?: { - /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ - includeContent?: boolean; - }; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with bookmark data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Bookmark"]; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - /** - * Delete a bookmark - * @description Delete bookmark by its id - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No content - the bookmark was deleted */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - /** - * Update a bookmark - * @description Update bookmark by its id - */ - patch: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - /** @description The data to update. Only the fields you want to update need to be provided. */ - requestBody?: { - content: { - "application/json": { - archived?: boolean; - favourited?: boolean; - summary?: string | null; - note?: string; - title?: string | null; - createdAt?: string | null; - /** Format: uri */ - url?: string; - description?: string | null; - author?: string | null; - publisher?: string | null; - datePublished?: string | null; - dateModified?: string | null; - text?: string | null; - assetContent?: string | null; - }; - }; - }; - responses: { - /** @description The updated bookmark */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - createdAt: string; - modifiedAt: string | null; - title?: string | null; - archived: boolean; - favourited: boolean; - /** @enum {string|null} */ - taggingStatus: "success" | "failure" | "pending" | null; - note?: string | null; - summary?: string | null; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - trace?: never; - }; - "/bookmarks/{bookmarkId}/summarize": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Summarize a bookmark - * @description Attaches a summary to the bookmark and returns the updated record. - */ - post: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description The updated bookmark with summary */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - createdAt: string; - modifiedAt: string | null; - title?: string | null; - archived: boolean; - favourited: boolean; - /** @enum {string|null} */ - taggingStatus: "success" | "failure" | "pending" | null; - note?: string | null; - summary?: string | null; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/bookmarks/{bookmarkId}/tags": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Attach tags to a bookmark - * @description Attach tags to a bookmark - */ - post: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - /** @description The tags to attach. */ - requestBody?: { - content: { - "application/json": { - tags: { - tagId?: string; - tagName?: string; - }[]; - }; - }; - }; - responses: { - /** @description The list of attached tag ids */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - attached: components["schemas"]["TagId"][]; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - /** - * Detach tags from a bookmark - * @description Detach tags from a bookmark - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - /** @description The tags to detach. */ - requestBody?: { - content: { - "application/json": { - tags: { - tagId?: string; - tagName?: string; - }[]; - }; - }; - }; - responses: { - /** @description The list of detached tag ids */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - detached: components["schemas"]["TagId"][]; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/bookmarks/{bookmarkId}/highlights": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get highlights of a bookmark - * @description Get highlights of a bookmark - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description The list of highlights */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - highlights: components["schemas"]["Highlight"][]; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/bookmarks/{bookmarkId}/assets": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Attach asset - * @description Attach a new asset to a bookmark - */ - post: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - /** @description The asset to attach */ - requestBody?: { - content: { - "application/json": { - id: string; - /** @enum {string} */ - assetType: - | "screenshot" - | "assetScreenshot" - | "bannerImage" - | "fullPageArchive" - | "video" - | "bookmarkAsset" - | "precrawledArchive" - | "unknown"; - }; - }; - }; - responses: { - /** @description The attached asset */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - /** @enum {string} */ - assetType: - | "screenshot" - | "assetScreenshot" - | "bannerImage" - | "fullPageArchive" - | "video" - | "bookmarkAsset" - | "precrawledArchive" - | "unknown"; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/bookmarks/{bookmarkId}/assets/{assetId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Replace asset - * @description Replace an existing asset with a new one - */ - put: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - assetId: components["parameters"]["AssetId"]; - }; - cookie?: never; - }; - /** @description The new asset to replace with */ - requestBody?: { - content: { - "application/json": { - assetId: string; - }; - }; - }; - responses: { - /** @description No content - asset was replaced successfully */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - post?: never; - /** - * Detach asset - * @description Detach an asset from a bookmark - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - bookmarkId: components["parameters"]["BookmarkId"]; - assetId: components["parameters"]["AssetId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No content - asset was detached successfully */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/lists": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get all lists - * @description Get all lists - */ - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with all lists data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - lists: components["schemas"]["List"][]; - }; - }; - }; - }; - }; - put?: never; - /** - * Create a new list - * @description Create a new list - */ - post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description The list to create */ - requestBody?: { - content: { - "application/json": { - name: string; - description?: string; - icon: string; - /** - * @default manual - * @enum {string} - */ - type?: "manual" | "smart"; - query?: string; - parentId?: string | null; - }; - }; - }; - responses: { - /** @description The created list */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["List"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/lists/{listId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a single list - * @description Get list by its id - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - listId: components["parameters"]["ListId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with list data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["List"]; - }; - }; - /** @description List not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - /** - * Delete a list - * @description Delete list by its id - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - listId: components["parameters"]["ListId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No content - the bookmark was deleted */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description List not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - /** - * Update a list - * @description Update list by its id - */ - patch: { - parameters: { - query?: never; - header?: never; - path: { - listId: components["parameters"]["ListId"]; - }; - cookie?: never; - }; - /** @description The data to update. Only the fields you want to update need to be provided. */ - requestBody?: { - content: { - "application/json": { - name?: string; - description?: string | null; - icon?: string; - parentId?: string | null; - query?: string; - }; - }; - }; - responses: { - /** @description The updated list */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["List"]; - }; - }; - /** @description List not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - trace?: never; - }; - "/lists/{listId}/bookmarks": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a bookmarks in a list - * @description Get the bookmarks in a list - */ - get: { - parameters: { - query?: { - limit?: number; - cursor?: components["schemas"]["Cursor"]; - /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ - includeContent?: boolean; - }; - header?: never; - path: { - listId: components["parameters"]["ListId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with list data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["PaginatedBookmarks"]; - }; - }; - /** @description List not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/lists/{listId}/bookmarks/{bookmarkId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Add a bookmark to a list - * @description Add the bookmarks to a list - */ - put: { - parameters: { - query?: never; - header?: never; - path: { - listId: components["parameters"]["ListId"]; - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No content - the bookmark was added */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bookmark already in list */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - /** @description List or bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - post?: never; - /** - * Remove a bookmark from a list - * @description Remove the bookmarks from a list - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - listId: components["parameters"]["ListId"]; - bookmarkId: components["parameters"]["BookmarkId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No content - the bookmark was added */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bookmark already not in list */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - /** @description List or bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/tags": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get all tags - * @description Get all tags - */ - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with all tags data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - tags: components["schemas"]["Tag"][]; - }; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/tags/{tagId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a single tag - * @description Get tag by its id - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - tagId: components["parameters"]["TagId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with list data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Tag"]; - }; - }; - /** @description Tag not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - /** - * Delete a tag - * @description Delete tag by its id - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - tagId: components["parameters"]["TagId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No content - the bookmark was deleted */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Tag not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - /** - * Update a tag - * @description Update tag by its id - */ - patch: { - parameters: { - query?: never; - header?: never; - path: { - tagId: components["parameters"]["TagId"]; - }; - cookie?: never; - }; - /** @description The data to update. Only the fields you want to update need to be provided. */ - requestBody?: { - content: { - "application/json": { - name?: string; - }; - }; - }; - responses: { - /** @description The updated tag */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Tag"]; - }; - }; - /** @description Tag not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - trace?: never; - }; - "/tags/{tagId}/bookmarks": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a bookmarks with the tag - * @description Get the bookmarks with the tag - */ - get: { - parameters: { - query?: { - limit?: number; - cursor?: components["schemas"]["Cursor"]; - /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ - includeContent?: boolean; - }; - header?: never; - path: { - tagId: components["parameters"]["TagId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with list data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["PaginatedBookmarks"]; - }; - }; - /** @description Tag not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/highlights": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get all highlights - * @description Get all highlights - */ - get: { - parameters: { - query?: { - limit?: number; - cursor?: components["schemas"]["Cursor"]; - }; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with all highlights data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["PaginatedHighlights"]; - }; - }; - }; - }; - put?: never; - /** - * Create a new highlight - * @description Create a new highlight - */ - post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description The highlight to create */ - requestBody?: { - content: { - "application/json": { - bookmarkId: string; - startOffset: number; - endOffset: number; - /** - * @default yellow - * @enum {string} - */ - color?: "yellow" | "red" | "green" | "blue"; - text: string | null; - note: string | null; - }; - }; - }; - responses: { - /** @description The created highlight */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Highlight"]; - }; - }; - /** @description Bad highlight request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - /** @description Bookmark not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/highlights/{highlightId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a single highlight - * @description Get highlight by its id - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - highlightId: components["parameters"]["HighlightId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with highlight data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Highlight"]; - }; - }; - /** @description Highlight not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - put?: never; - post?: never; - /** - * Delete a highlight - * @description Delete highlight by its id - */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - highlightId: components["parameters"]["HighlightId"]; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description The deleted highlight */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Highlight"]; - }; - }; - /** @description Highlight not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - options?: never; - head?: never; - /** - * Update a highlight - * @description Update highlight by its id - */ - patch: { - parameters: { - query?: never; - header?: never; - path: { - highlightId: components["parameters"]["HighlightId"]; - }; - cookie?: never; - }; - /** @description The data to update. Only the fields you want to update need to be provided. */ - requestBody?: { - content: { - "application/json": { - /** @enum {string} */ - color?: "yellow" | "red" | "green" | "blue"; - }; - }; - }; - responses: { - /** @description The updated highlight */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Highlight"]; - }; - }; - /** @description Highlight not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - code: string; - message: string; - }; - }; - }; - }; - }; - trace?: never; - }; - "/users/me": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get current user info - * @description Returns info about the current user - */ - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with user data. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - name?: string | null; - email?: string | null; - }; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/users/me/stats": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get current user stats - * @description Returns stats about the current user - */ - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Object with user stats. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - numBookmarks: number; - numFavorites: number; - numArchived: number; - numTags: number; - numLists: number; - numHighlights: number; - }; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; -} -export type webhooks = Record; -export interface components { - schemas: { - /** @example ieidlxygmwj87oxz5hxttoc8 */ - AssetId: string; - /** @example ieidlxygmwj87oxz5hxttoc8 */ - BookmarkId: string; - /** @example ieidlxygmwj87oxz5hxttoc8 */ - ListId: string; - /** @example ieidlxygmwj87oxz5hxttoc8 */ - TagId: string; - /** @example ieidlxygmwj87oxz5hxttoc8 */ - HighlightId: string; - Bookmark: { - id: string; - createdAt: string; - modifiedAt: string | null; - title?: string | null; - archived: boolean; - favourited: boolean; - /** @enum {string|null} */ - taggingStatus: "success" | "failure" | "pending" | null; - note?: string | null; - summary?: string | null; - tags: { - id: string; - name: string; - /** @enum {string} */ - attachedBy: "ai" | "human"; - }[]; - content: - | { - /** @enum {string} */ - type: "link"; - url: string; - title?: string | null; - description?: string | null; - imageUrl?: string | null; - imageAssetId?: string | null; - screenshotAssetId?: string | null; - fullPageArchiveAssetId?: string | null; - precrawledArchiveAssetId?: string | null; - videoAssetId?: string | null; - favicon?: string | null; - htmlContent?: string | null; - crawledAt?: string | null; - author?: string | null; - publisher?: string | null; - datePublished?: string | null; - dateModified?: string | null; - } - | { - /** @enum {string} */ - type: "text"; - text: string; - sourceUrl?: string | null; - } - | { - /** @enum {string} */ - type: "asset"; - /** @enum {string} */ - assetType: "image" | "pdf"; - assetId: string; - fileName?: string | null; - sourceUrl?: string | null; - size?: number | null; - content?: string | null; - } - | { - /** @enum {string} */ - type: "unknown"; - }; - assets: { - id: string; - /** @enum {string} */ - assetType: - | "screenshot" - | "assetScreenshot" - | "bannerImage" - | "fullPageArchive" - | "video" - | "bookmarkAsset" - | "precrawledArchive" - | "unknown"; - }[]; - }; - PaginatedBookmarks: { - bookmarks: components["schemas"]["Bookmark"][]; - nextCursor: string | null; - }; - Cursor: string; - Highlight: { - bookmarkId: string; - startOffset: number; - endOffset: number; - /** - * @default yellow - * @enum {string} - */ - color: "yellow" | "red" | "green" | "blue"; - text: string | null; - note: string | null; - id: string; - userId: string; - createdAt: string; - }; - List: { - id: string; - name: string; - description?: string | null; - icon: string; - parentId: string | null; - /** - * @default manual - * @enum {string} - */ - type: "manual" | "smart"; - query?: string | null; - }; - Tag: { - id: string; - name: string; - numBookmarks: number; - numBookmarksByAttachedType: { - ai?: number; - human?: number; - }; - }; - PaginatedHighlights: { - highlights: components["schemas"]["Highlight"][]; - nextCursor: string | null; - }; - }; - responses: never; - parameters: { - AssetId: components["schemas"]["AssetId"]; - BookmarkId: components["schemas"]["BookmarkId"]; - ListId: components["schemas"]["ListId"]; - TagId: components["schemas"]["TagId"]; - HighlightId: components["schemas"]["HighlightId"]; - }; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export type operations = Record; diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 7ff0c0dc..e233e6c1 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,6 +1,6 @@ import createClient from "openapi-fetch"; -import type { components, paths } from "./hoarder-api.d.ts"; +import type { components, paths } from "./karakeep-api.d.ts"; /** * @deprecated Use createKarakeepClient instead. diff --git a/packages/sdk/src/karakeep-api.d.ts b/packages/sdk/src/karakeep-api.d.ts new file mode 100644 index 00000000..0b434b3d --- /dev/null +++ b/packages/sdk/src/karakeep-api.d.ts @@ -0,0 +1,1843 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/bookmarks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get all bookmarks + * @description Get all bookmarks + */ + get: { + parameters: { + query?: { + archived?: boolean; + favourited?: boolean; + limit?: number; + cursor?: components["schemas"]["Cursor"]; + /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ + includeContent?: boolean; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with all bookmarks data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PaginatedBookmarks"]; + }; + }; + }; + }; + put?: never; + /** + * Create a new bookmark + * @description Create a new bookmark + */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description The bookmark to create */ + requestBody?: { + content: { + "application/json": { + title?: string | null; + archived?: boolean; + favourited?: boolean; + note?: string; + summary?: string; + createdAt?: string | null; + } & ( + | { + /** @enum {string} */ + type: "link"; + /** Format: uri */ + url: string; + precrawledArchiveId?: string; + } + | { + /** @enum {string} */ + type: "text"; + text: string; + sourceUrl?: string; + } + | { + /** @enum {string} */ + type: "asset"; + /** @enum {string} */ + assetType: "image" | "pdf"; + assetId: string; + fileName?: string; + sourceUrl?: string; + } + ); + }; + }; + responses: { + /** @description The created bookmark */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Bookmark"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bookmarks/search": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Search bookmarks + * @description Search bookmarks + */ + get: { + parameters: { + query: { + q: string; + limit?: number; + cursor?: components["schemas"]["Cursor"]; + /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ + includeContent?: boolean; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with the search results. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PaginatedBookmarks"]; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bookmarks/{bookmarkId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a single bookmark + * @description Get bookmark by its id + */ + get: { + parameters: { + query?: { + /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ + includeContent?: boolean; + }; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with bookmark data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Bookmark"]; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + /** + * Delete a bookmark + * @description Delete bookmark by its id + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No content - the bookmark was deleted */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + /** + * Update a bookmark + * @description Update bookmark by its id + */ + patch: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + /** @description The data to update. Only the fields you want to update need to be provided. */ + requestBody?: { + content: { + "application/json": { + archived?: boolean; + favourited?: boolean; + summary?: string | null; + note?: string; + title?: string | null; + createdAt?: string | null; + /** Format: uri */ + url?: string; + description?: string | null; + author?: string | null; + publisher?: string | null; + datePublished?: string | null; + dateModified?: string | null; + text?: string | null; + assetContent?: string | null; + }; + }; + }; + responses: { + /** @description The updated bookmark */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + createdAt: string; + modifiedAt: string | null; + title?: string | null; + archived: boolean; + favourited: boolean; + /** @enum {string|null} */ + taggingStatus: "success" | "failure" | "pending" | null; + note?: string | null; + summary?: string | null; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + trace?: never; + }; + "/bookmarks/{bookmarkId}/summarize": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Summarize a bookmark + * @description Attaches a summary to the bookmark and returns the updated record. + */ + post: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The updated bookmark with summary */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + createdAt: string; + modifiedAt: string | null; + title?: string | null; + archived: boolean; + favourited: boolean; + /** @enum {string|null} */ + taggingStatus: "success" | "failure" | "pending" | null; + note?: string | null; + summary?: string | null; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bookmarks/{bookmarkId}/tags": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Attach tags to a bookmark + * @description Attach tags to a bookmark + */ + post: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + /** @description The tags to attach. */ + requestBody?: { + content: { + "application/json": { + tags: { + tagId?: string; + tagName?: string; + }[]; + }; + }; + }; + responses: { + /** @description The list of attached tag ids */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + attached: components["schemas"]["TagId"][]; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + /** + * Detach tags from a bookmark + * @description Detach tags from a bookmark + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + /** @description The tags to detach. */ + requestBody?: { + content: { + "application/json": { + tags: { + tagId?: string; + tagName?: string; + }[]; + }; + }; + }; + responses: { + /** @description The list of detached tag ids */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + detached: components["schemas"]["TagId"][]; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bookmarks/{bookmarkId}/highlights": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get highlights of a bookmark + * @description Get highlights of a bookmark + */ + get: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The list of highlights */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + highlights: components["schemas"]["Highlight"][]; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bookmarks/{bookmarkId}/assets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Attach asset + * @description Attach a new asset to a bookmark + */ + post: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + /** @description The asset to attach */ + requestBody?: { + content: { + "application/json": { + id: string; + /** @enum {string} */ + assetType: + | "screenshot" + | "assetScreenshot" + | "bannerImage" + | "fullPageArchive" + | "video" + | "bookmarkAsset" + | "precrawledArchive" + | "unknown"; + }; + }; + }; + responses: { + /** @description The attached asset */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + /** @enum {string} */ + assetType: + | "screenshot" + | "assetScreenshot" + | "bannerImage" + | "fullPageArchive" + | "video" + | "bookmarkAsset" + | "precrawledArchive" + | "unknown"; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/bookmarks/{bookmarkId}/assets/{assetId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Replace asset + * @description Replace an existing asset with a new one + */ + put: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + assetId: components["parameters"]["AssetId"]; + }; + cookie?: never; + }; + /** @description The new asset to replace with */ + requestBody?: { + content: { + "application/json": { + assetId: string; + }; + }; + }; + responses: { + /** @description No content - asset was replaced successfully */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + post?: never; + /** + * Detach asset + * @description Detach an asset from a bookmark + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + bookmarkId: components["parameters"]["BookmarkId"]; + assetId: components["parameters"]["AssetId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No content - asset was detached successfully */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/lists": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get all lists + * @description Get all lists + */ + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with all lists data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + lists: components["schemas"]["List"][]; + }; + }; + }; + }; + }; + put?: never; + /** + * Create a new list + * @description Create a new list + */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description The list to create */ + requestBody?: { + content: { + "application/json": { + name: string; + description?: string; + icon: string; + /** + * @default manual + * @enum {string} + */ + type?: "manual" | "smart"; + query?: string; + parentId?: string | null; + }; + }; + }; + responses: { + /** @description The created list */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["List"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/lists/{listId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a single list + * @description Get list by its id + */ + get: { + parameters: { + query?: never; + header?: never; + path: { + listId: components["parameters"]["ListId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with list data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["List"]; + }; + }; + /** @description List not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + /** + * Delete a list + * @description Delete list by its id + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + listId: components["parameters"]["ListId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No content - the bookmark was deleted */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description List not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + /** + * Update a list + * @description Update list by its id + */ + patch: { + parameters: { + query?: never; + header?: never; + path: { + listId: components["parameters"]["ListId"]; + }; + cookie?: never; + }; + /** @description The data to update. Only the fields you want to update need to be provided. */ + requestBody?: { + content: { + "application/json": { + name?: string; + description?: string | null; + icon?: string; + parentId?: string | null; + query?: string; + }; + }; + }; + responses: { + /** @description The updated list */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["List"]; + }; + }; + /** @description List not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + trace?: never; + }; + "/lists/{listId}/bookmarks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a bookmarks in a list + * @description Get the bookmarks in a list + */ + get: { + parameters: { + query?: { + limit?: number; + cursor?: components["schemas"]["Cursor"]; + /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ + includeContent?: boolean; + }; + header?: never; + path: { + listId: components["parameters"]["ListId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with list data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PaginatedBookmarks"]; + }; + }; + /** @description List not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/lists/{listId}/bookmarks/{bookmarkId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Add a bookmark to a list + * @description Add the bookmarks to a list + */ + put: { + parameters: { + query?: never; + header?: never; + path: { + listId: components["parameters"]["ListId"]; + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No content - the bookmark was added */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bookmark already in list */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + /** @description List or bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + post?: never; + /** + * Remove a bookmark from a list + * @description Remove the bookmarks from a list + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + listId: components["parameters"]["ListId"]; + bookmarkId: components["parameters"]["BookmarkId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No content - the bookmark was added */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bookmark already not in list */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + /** @description List or bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/tags": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get all tags + * @description Get all tags + */ + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with all tags data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + tags: components["schemas"]["Tag"][]; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/tags/{tagId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a single tag + * @description Get tag by its id + */ + get: { + parameters: { + query?: never; + header?: never; + path: { + tagId: components["parameters"]["TagId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with list data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Tag"]; + }; + }; + /** @description Tag not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + /** + * Delete a tag + * @description Delete tag by its id + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + tagId: components["parameters"]["TagId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No content - the bookmark was deleted */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Tag not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + /** + * Update a tag + * @description Update tag by its id + */ + patch: { + parameters: { + query?: never; + header?: never; + path: { + tagId: components["parameters"]["TagId"]; + }; + cookie?: never; + }; + /** @description The data to update. Only the fields you want to update need to be provided. */ + requestBody?: { + content: { + "application/json": { + name?: string; + }; + }; + }; + responses: { + /** @description The updated tag */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Tag"]; + }; + }; + /** @description Tag not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + trace?: never; + }; + "/tags/{tagId}/bookmarks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a bookmarks with the tag + * @description Get the bookmarks with the tag + */ + get: { + parameters: { + query?: { + limit?: number; + cursor?: components["schemas"]["Cursor"]; + /** @description If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks. */ + includeContent?: boolean; + }; + header?: never; + path: { + tagId: components["parameters"]["TagId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with list data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PaginatedBookmarks"]; + }; + }; + /** @description Tag not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/highlights": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get all highlights + * @description Get all highlights + */ + get: { + parameters: { + query?: { + limit?: number; + cursor?: components["schemas"]["Cursor"]; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with all highlights data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PaginatedHighlights"]; + }; + }; + }; + }; + put?: never; + /** + * Create a new highlight + * @description Create a new highlight + */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description The highlight to create */ + requestBody?: { + content: { + "application/json": { + bookmarkId: string; + startOffset: number; + endOffset: number; + /** + * @default yellow + * @enum {string} + */ + color?: "yellow" | "red" | "green" | "blue"; + text: string | null; + note: string | null; + }; + }; + }; + responses: { + /** @description The created highlight */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Highlight"]; + }; + }; + /** @description Bad highlight request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + /** @description Bookmark not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/highlights/{highlightId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a single highlight + * @description Get highlight by its id + */ + get: { + parameters: { + query?: never; + header?: never; + path: { + highlightId: components["parameters"]["HighlightId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with highlight data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Highlight"]; + }; + }; + /** @description Highlight not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + put?: never; + post?: never; + /** + * Delete a highlight + * @description Delete highlight by its id + */ + delete: { + parameters: { + query?: never; + header?: never; + path: { + highlightId: components["parameters"]["HighlightId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The deleted highlight */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Highlight"]; + }; + }; + /** @description Highlight not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + options?: never; + head?: never; + /** + * Update a highlight + * @description Update highlight by its id + */ + patch: { + parameters: { + query?: never; + header?: never; + path: { + highlightId: components["parameters"]["HighlightId"]; + }; + cookie?: never; + }; + /** @description The data to update. Only the fields you want to update need to be provided. */ + requestBody?: { + content: { + "application/json": { + /** @enum {string} */ + color?: "yellow" | "red" | "green" | "blue"; + }; + }; + }; + responses: { + /** @description The updated highlight */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Highlight"]; + }; + }; + /** @description Highlight not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + code: string; + message: string; + }; + }; + }; + }; + }; + trace?: never; + }; + "/users/me": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get current user info + * @description Returns info about the current user + */ + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with user data. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name?: string | null; + email?: string | null; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/users/me/stats": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get current user stats + * @description Returns stats about the current user + */ + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Object with user stats. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + numBookmarks: number; + numFavorites: number; + numArchived: number; + numTags: number; + numLists: number; + numHighlights: number; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + /** @example ieidlxygmwj87oxz5hxttoc8 */ + AssetId: string; + /** @example ieidlxygmwj87oxz5hxttoc8 */ + BookmarkId: string; + /** @example ieidlxygmwj87oxz5hxttoc8 */ + ListId: string; + /** @example ieidlxygmwj87oxz5hxttoc8 */ + TagId: string; + /** @example ieidlxygmwj87oxz5hxttoc8 */ + HighlightId: string; + Bookmark: { + id: string; + createdAt: string; + modifiedAt: string | null; + title?: string | null; + archived: boolean; + favourited: boolean; + /** @enum {string|null} */ + taggingStatus: "success" | "failure" | "pending" | null; + note?: string | null; + summary?: string | null; + tags: { + id: string; + name: string; + /** @enum {string} */ + attachedBy: "ai" | "human"; + }[]; + content: + | { + /** @enum {string} */ + type: "link"; + url: string; + title?: string | null; + description?: string | null; + imageUrl?: string | null; + imageAssetId?: string | null; + screenshotAssetId?: string | null; + fullPageArchiveAssetId?: string | null; + precrawledArchiveAssetId?: string | null; + videoAssetId?: string | null; + favicon?: string | null; + htmlContent?: string | null; + crawledAt?: string | null; + author?: string | null; + publisher?: string | null; + datePublished?: string | null; + dateModified?: string | null; + } + | { + /** @enum {string} */ + type: "text"; + text: string; + sourceUrl?: string | null; + } + | { + /** @enum {string} */ + type: "asset"; + /** @enum {string} */ + assetType: "image" | "pdf"; + assetId: string; + fileName?: string | null; + sourceUrl?: string | null; + size?: number | null; + content?: string | null; + } + | { + /** @enum {string} */ + type: "unknown"; + }; + assets: { + id: string; + /** @enum {string} */ + assetType: + | "screenshot" + | "assetScreenshot" + | "bannerImage" + | "fullPageArchive" + | "video" + | "bookmarkAsset" + | "precrawledArchive" + | "unknown"; + }[]; + }; + PaginatedBookmarks: { + bookmarks: components["schemas"]["Bookmark"][]; + nextCursor: string | null; + }; + Cursor: string; + Highlight: { + bookmarkId: string; + startOffset: number; + endOffset: number; + /** + * @default yellow + * @enum {string} + */ + color: "yellow" | "red" | "green" | "blue"; + text: string | null; + note: string | null; + id: string; + userId: string; + createdAt: string; + }; + List: { + id: string; + name: string; + description?: string | null; + icon: string; + parentId: string | null; + /** + * @default manual + * @enum {string} + */ + type: "manual" | "smart"; + query?: string | null; + }; + Tag: { + id: string; + name: string; + numBookmarks: number; + numBookmarksByAttachedType: { + ai?: number; + human?: number; + }; + }; + PaginatedHighlights: { + highlights: components["schemas"]["Highlight"][]; + nextCursor: string | null; + }; + }; + responses: never; + parameters: { + AssetId: components["schemas"]["AssetId"]; + BookmarkId: components["schemas"]["BookmarkId"]; + ListId: components["schemas"]["ListId"]; + TagId: components["schemas"]["TagId"]; + HighlightId: components["schemas"]["HighlightId"]; + }; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export type operations = Record; -- cgit v1.3-1-g0d28