Add initial API documentation for Linsa API endpoints to docs/api.md

This commit is contained in:
Nikita
2025-12-28 11:45:07 -08:00
parent 3a2c78198a
commit c073fe6ee0
32 changed files with 4291 additions and 57 deletions

View File

@@ -299,6 +299,31 @@ async function seed() {
ADD COLUMN IF NOT EXISTS "cloudflare_customer_code" text
`)
// Create API keys table
await appDb.execute(sql`
CREATE TABLE IF NOT EXISTS "api_keys" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"user_id" text NOT NULL REFERENCES "users"("id") ON DELETE cascade,
"key_hash" text NOT NULL UNIQUE,
"name" text NOT NULL DEFAULT 'Default',
"last_used_at" timestamptz,
"created_at" timestamptz NOT NULL DEFAULT now()
);
`)
// Create bookmarks table
await appDb.execute(sql`
CREATE TABLE IF NOT EXISTS "bookmarks" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"user_id" text NOT NULL REFERENCES "users"("id") ON DELETE cascade,
"url" text NOT NULL,
"title" text,
"description" text,
"tags" text,
"created_at" timestamptz NOT NULL DEFAULT now()
);
`)
// ========== Seed nikiv user ==========
const nikivUserId = "nikiv"
const nikivEmail = "nikita.voloboev@gmail.com"