From d18f67cedf94f848b4c9c5755e90d8b2e71761da Mon Sep 17 00:00:00 2001 From: Trezy Date: Wed, 1 Jul 2026 09:12:30 -0500 Subject: [PATCH] docs: fix missing table prefixes Signed-off-by: Trezy --- .../docs/content/docs/api-reference/admin/admin-api.md | 6 +++--- .../docs/content/docs/api-reference/admin/lexicons.md | 2 +- .../docs/content/docs/api-reference/admin/plugins.md | 6 +++--- .../docs/content/docs/api-reference/admin/settings.md | 2 +- .../content/docs/api-reference/lua/database-api.md | 6 +++--- .../content/docs/getting-started/authentication.md | 4 ++-- .../docs/content/docs/guides/attestation-signing.md | 4 ++-- packages/docs/content/docs/guides/labelers.md | 2 +- packages/docs/content/docs/guides/lexicons.md | 4 ++-- packages/docs/content/docs/guides/record-scripts.md | 10 +++++----- .../docs/reference/script-examples/meilisearch-sync.md | 2 +- packages/docs/next.config.mts | 6 +++--- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/docs/content/docs/api-reference/admin/admin-api.md b/packages/docs/content/docs/api-reference/admin/admin-api.md index 85c5aa0..5370d89 100644 --- a/packages/docs/content/docs/api-reference/admin/admin-api.md +++ b/packages/docs/content/docs/api-reference/admin/admin-api.md @@ -2,7 +2,7 @@ title: "Overview" --- -The admin API lets you manage lexicons, monitor records, run backfill jobs, and control user access. All endpoints live under `/admin` and require authentication from a DID that exists in the `users` table, with the appropriate [permissions](../../guides/permissions.md) for the endpoint being called. You can also manage all of this through the [web dashboard](../../getting-started/dashboard.md). +The admin API lets you manage lexicons, monitor records, run backfill jobs, and control user access. All endpoints live under `/admin` and require authentication from a DID that exists in the `happyview_users` table, with the appropriate [permissions](../../guides/permissions.md) for the endpoint being called. You can also manage all of this through the [web dashboard](../../getting-started/dashboard.md). ## Auth @@ -12,9 +12,9 @@ The admin API supports three authentication methods: 2. **Service auth JWT** — atproto inter-service authentication via signed JWTs. 3. **Cookie-based session auth** — signed session cookies set during the dashboard OAuth login flow. The [web dashboard](../../getting-started/dashboard.md) uses this method. -In all cases the resolved DID is checked against the `users` table, and the user's permissions are loaded to authorize the request. +In all cases the resolved DID is checked against the `happyview_users` table, and the user's permissions are loaded to authorize the request. -**Auto-bootstrap**: If the `users` table is empty, the first authenticated request automatically creates the caller as the **super user** with all permissions granted. +**Auto-bootstrap**: If the `happyview_users` table is empty, the first authenticated request automatically creates the caller as the **super user** with all permissions granted. Non-user DIDs receive a `403 Forbidden` response. Users without the required permission for a specific endpoint also receive `403 Forbidden`. diff --git a/packages/docs/content/docs/api-reference/admin/lexicons.md b/packages/docs/content/docs/api-reference/admin/lexicons.md index fddad4d..a3b162a 100644 --- a/packages/docs/content/docs/api-reference/admin/lexicons.md +++ b/packages/docs/content/docs/api-reference/admin/lexicons.md @@ -514,6 +514,6 @@ curl -X DELETE http://127.0.0.1:3000/admin/network-lexicons/xyz.statusphere.stat -H "$AUTH" ``` -Removes the network lexicon tracking and also deletes the lexicon from the `lexicons` table and in-memory registry. +Removes the network lexicon tracking and also deletes the lexicon from the `happyview_lexicons` table and in-memory registry. **Response**: `204 No Content` diff --git a/packages/docs/content/docs/api-reference/admin/plugins.md b/packages/docs/content/docs/api-reference/admin/plugins.md index 2bf0907..76eb8d3 100644 --- a/packages/docs/content/docs/api-reference/admin/plugins.md +++ b/packages/docs/content/docs/api-reference/admin/plugins.md @@ -120,7 +120,7 @@ curl http://127.0.0.1:3000/admin/plugins -H "$AUTH" } ``` -`secrets_configured` is `true` if the plugin has no required secrets, or if a row exists for it in `plugin_configs`. `update_available` and `pending_releases` are populated from the cached official registry — call `POST /admin/plugins/{id}/check-update` to refresh them. +`secrets_configured` is `true` if the plugin has no required secrets, or if a row exists for it in `happyview_plugin_configs`. `update_available` and `pending_releases` are populated from the cached official registry — call `POST /admin/plugins/{id}/check-update` to refresh them. ## Preview a plugin before installing @@ -320,7 +320,7 @@ Requires `plugins:read`. Returns the cached catalog of plugins from the official DELETE /admin/plugins/{id} ``` -Requires `plugins:delete`. Unregisters the plugin from the runtime and deletes its row from the `plugins` table. Secrets stay in `plugin_configs`, so they're reused if you reinstall. +Requires `plugins:delete`. Unregisters the plugin from the runtime and deletes its row from the `happyview_plugins` table. Secrets stay in `happyview_plugin_configs`, so they're reused if you reinstall. **Response**: `204 No Content`. Returns `404 Not Found` if no plugin with that id is loaded. @@ -377,7 +377,7 @@ Requires `plugins:read`. Returns the plugin's configured secrets with values mas PUT /admin/plugins/{id}/secrets ``` -Requires `plugins:create`. Encrypts the provided secret values with `TOKEN_ENCRYPTION_KEY` (AES-256-GCM) and upserts them into `plugin_configs`. +Requires `plugins:create`. Encrypts the provided secret values with `TOKEN_ENCRYPTION_KEY` (AES-256-GCM) and upserts them into `happyview_plugin_configs`. ```ts tab="TypeScript" tab-group="language" const response = await fetch("http://127.0.0.1:3000/admin/plugins/steam/secrets", { diff --git a/packages/docs/content/docs/api-reference/admin/settings.md b/packages/docs/content/docs/api-reference/admin/settings.md index 791ddfe..5dea443 100644 --- a/packages/docs/content/docs/api-reference/admin/settings.md +++ b/packages/docs/content/docs/api-reference/admin/settings.md @@ -58,7 +58,7 @@ resp, err := http.DefaultClient.Do(req) curl http://127.0.0.1:3000/admin/settings -H "$AUTH" ``` -Returns all key/value pairs stored in the `instance_settings` table, plus any env-var fallback values for keys not stored in the database. Each entry includes a `source` field: `"database"` for stored values, `"env"` for env-var fallbacks. +Returns all key/value pairs stored in the `happyview_instance_settings` table, plus any env-var fallback values for keys not stored in the database. Each entry includes a `source` field: `"database"` for stored values, `"env"` for env-var fallbacks. ### Known settings diff --git a/packages/docs/content/docs/api-reference/lua/database-api.md b/packages/docs/content/docs/api-reference/lua/database-api.md index baf1b77..83ec672 100644 --- a/packages/docs/content/docs/api-reference/lua/database-api.md +++ b/packages/docs/content/docs/api-reference/lua/database-api.md @@ -153,7 +153,7 @@ Run a raw SQL query against the database. Supports `SELECT`, `INSERT`, `UPDATE`, ```lua -- Read query local rows = db.raw( - "SELECT uri, did, record FROM records WHERE collection = $1 AND did = $2 LIMIT $3", + "SELECT uri, did, record FROM happyview_records WHERE collection = $1 AND did = $2 LIMIT $3", { "xyz.statusphere.status", "did:plc:abc", 10 } ) @@ -196,9 +196,9 @@ Returns `"sqlite"` or `"postgres"`. Useful when you need database-specific SQL t ```lua if db.backend() == "postgres" then - db.raw("SELECT * FROM records WHERE record @> $1::jsonb", { json.encode({ status = "active" }) }) + db.raw("SELECT * FROM happyview_records WHERE record @> $1::jsonb", { json.encode({ status = "active" }) }) else -- SQLite fallback - db.raw("SELECT * FROM records WHERE json_extract(record, '$.status') = $1", { "active" }) + db.raw("SELECT * FROM happyview_records WHERE json_extract(record, '$.status') = $1", { "active" }) end ``` diff --git a/packages/docs/content/docs/getting-started/authentication.md b/packages/docs/content/docs/getting-started/authentication.md index b26f8d7..7af9627 100644 --- a/packages/docs/content/docs/getting-started/authentication.md +++ b/packages/docs/content/docs/getting-started/authentication.md @@ -231,11 +231,11 @@ For a service auth JWT to validate: - `exp` must be in the future. - The signature must verify against the issuer DID's atproto signing key. -As with the other methods, the resolved DID still has to exist in the HappyView `users` table with the right permissions to hit admin endpoints — service auth gets you identified, not privileged. +As with the other methods, the resolved DID still has to exist in the HappyView `happyview_users` table with the right permissions to hit admin endpoints — service auth gets you identified, not privileged. ### Admin access and the first user -On a fresh deployment, the `users` table is empty. The first authenticated request to any admin endpoint auto-bootstraps that user as the **super user** with all permissions granted. This includes logging in to the dashboard — the dashboard makes admin API calls on your behalf, so the first person to log in becomes the super user. +On a fresh deployment, the `happyview_users` table is empty. The first authenticated request to any admin endpoint auto-bootstraps that user as the **super user** with all permissions granted. This includes logging in to the dashboard — the dashboard makes admin API calls on your behalf, so the first person to log in becomes the super user. To add more users after that, use `POST /admin/users` or the [dashboard](dashboard.md). You can assign permissions individually or use a template (`viewer`, `operator`, `manager`, `full_access`). See [Admin API — Users](../api-reference/admin/users.md) for details. diff --git a/packages/docs/content/docs/guides/attestation-signing.md b/packages/docs/content/docs/guides/attestation-signing.md index 957ec54..d8c7f98 100644 --- a/packages/docs/content/docs/guides/attestation-signing.md +++ b/packages/docs/content/docs/guides/attestation-signing.md @@ -15,7 +15,7 @@ The repo DID is included in the signed data — a signature for one user's recor ## Setup -Attestation signing is enabled by default — HappyView generates a keypair on first startup and persists it to the `instance_settings` database table. No configuration is required. +Attestation signing is enabled by default — HappyView generates a keypair on first startup and persists it to the `happyview_instance_settings` database table. No configuration is required. To use an explicit key instead, set the `ATTESTATION_PRIVATE_KEY` environment variable: @@ -32,7 +32,7 @@ The key ID defaults to a `did:web` derived from your `PUBLIC_URL`. For example, HappyView checks for signing configuration in this order: 1. **Environment variables** — if `ATTESTATION_PRIVATE_KEY` is set, it's used -2. **Database** — if previously generated keys exist in `instance_settings`, they're loaded +2. **Database** — if previously generated keys exist in `happyview_instance_settings`, they're loaded 3. **Auto-generation** — a new key is generated and persisted to the database If key loading fails for any reason, signing is disabled and `atproto.sign` / `atproto.verify_signature` will be `nil` in Lua scripts. diff --git a/packages/docs/content/docs/guides/labelers.md b/packages/docs/content/docs/guides/labelers.md index 7610d15..faceace 100644 --- a/packages/docs/content/docs/guides/labelers.md +++ b/packages/docs/content/docs/guides/labelers.md @@ -8,7 +8,7 @@ Labelers are external services that apply content labels to records. They operat A labeler is identified by its DID. When you subscribe to a labeler, HappyView connects directly to the labeler's WebSocket and streams label events in real time. Each label targets a specific record URI and carries a value like `nudity`, `spam`, or any custom string the labeler defines. -Labels are stored in a `labels` table in the database. HappyView tracks a cursor per labeler subscription so it can resume from where it left off after a restart. +Labels are stored in a `happyview_labels` table in the database. HappyView tracks a cursor per labeler subscription so it can resume from where it left off after a restart. Records can also have **self-labels** — labels applied by the record's author and embedded directly in the record's `labels.values` array. These are not managed by external labelers but are displayed alongside external labels in the dashboard. diff --git a/packages/docs/content/docs/guides/lexicons.md b/packages/docs/content/docs/guides/lexicons.md index 81d3e9a..da0b46a 100644 --- a/packages/docs/content/docs/guides/lexicons.md +++ b/packages/docs/content/docs/guides/lexicons.md @@ -71,8 +71,8 @@ The `value` field of the response is the raw lexicon JSON. HappyView's Jetstream subscription always includes the `com.atproto.lexicon.schema` collection, so it receives real-time events whenever a lexicon schema record is created, updated, or deleted on the network. When an event arrives, HappyView checks whether the record's DID and rkey (the NSID) match any tracked network lexicon: -- **create/update**: The new schema is parsed and upserted into the `lexicons` table and the in-memory registry. If it's a record-type lexicon, Jetstream collection filters are updated to include the new collection. -- **delete**: The lexicon is removed from the `lexicons` table and registry, and collection filters are updated accordingly. +- **create/update**: The new schema is parsed and upserted into the `happyview_lexicons` table and the in-memory registry. If it's a record-type lexicon, Jetstream collection filters are updated to include the new collection. +- **delete**: The lexicon is removed from the `happyview_lexicons` table and registry, and collection filters are updated accordingly. ### Startup re-fetch diff --git a/packages/docs/content/docs/guides/record-scripts.md b/packages/docs/content/docs/guides/record-scripts.md index 20cb256..f1ac958 100644 --- a/packages/docs/content/docs/guides/record-scripts.md +++ b/packages/docs/content/docs/guides/record-scripts.md @@ -6,11 +6,11 @@ Record and label scripts are Lua scripts that run in response to events on the A These scripts are event-driven -- they react to incoming Jetstream events (which include events caused by HappyView's own PDS writes), not to XRPC requests. For scripts that run in response to XRPC queries and procedures, see [Lua Scripting](./lua-scripting.md). -> **Migration note:** Prior to v2.9, record scripts were called "index hooks" and were attached directly to lexicons. They now live in their own `scripts` table and are managed separately. Existing index hooks were automatically migrated. +> **Migration note:** Prior to v2.9, record scripts were called "index hooks" and were attached directly to lexicons. They now live in their own `happyview_scripts` table and are managed separately. Existing index hooks were automatically migrated. ## Trigger grammar -Every script is identified by a **trigger string** -- the script's `id` in the `scripts` table IS its trigger binding. There is no separate name or host column; the trigger string determines which events the script receives. +Every script is identified by a **trigger string** -- the script's `id` in the `happyview_scripts` table IS its trigger binding. There is no separate name or host column; the trigger string determines which events the script receives. ### Record event triggers @@ -140,10 +140,10 @@ Record and label scripts have access to: Record and label scripts are designed to be resilient: 1. If a script fails, it retries up to **4 attempts total** (1 initial + 3 retries) with exponential backoff (1s, 2s, 4s delays). -2. If all attempts are exhausted, the failed event is inserted into the `dead_letter_scripts` table for later inspection. +2. If all attempts are exhausted, the failed event is inserted into the `happyview_dead_letter_scripts` table for later inspection. 3. On failure the system **fails open** -- the original record or label is stored as-is so indexing is not permanently blocked. The firehose has no caller to surface errors to. -Failed scripts are logged as errors. Check the [event logs](./event-logs.md) or query the `dead_letter_scripts` table directly to find and replay failures. +Failed scripts are logged as errors. Check the [event logs](./event-logs.md) or query the `happyview_dead_letter_scripts` table directly to find and replay failures. ### Performance considerations @@ -151,7 +151,7 @@ Because scripts run synchronously before indexing, they block the Jetstream cons ### Dead letter table -The `dead_letter_scripts` table stores events that failed all retry attempts: +The `happyview_dead_letter_scripts` table stores events that failed all retry attempts: | Column | Type | Description | | ------------ | --------- | ----------------------------------------------------- | diff --git a/packages/docs/content/docs/reference/script-examples/meilisearch-sync.md b/packages/docs/content/docs/reference/script-examples/meilisearch-sync.md index a8f4f26..2eb34a9 100644 --- a/packages/docs/content/docs/reference/script-examples/meilisearch-sync.md +++ b/packages/docs/content/docs/reference/script-examples/meilisearch-sync.md @@ -51,7 +51,7 @@ This script uses [script variables](../../guides/lua-scripting.md) instead of ha | `MEILISEARCH_URL` | Your Meilisearch instance URL (e.g. `http://meilisearch.railway.internal:7700`) | | `MEILISEARCH_API_KEY` | A Meilisearch API key with write permissions | -Script variables are stored in the `script_variables` table and accessible as `env.*` in Lua. +Script variables are stored in the `happyview_script_variables` table and accessible as `env.*` in Lua. ## Use case diff --git a/packages/docs/next.config.mts b/packages/docs/next.config.mts index 40f832f..e333034 100644 --- a/packages/docs/next.config.mts +++ b/packages/docs/next.config.mts @@ -1,8 +1,8 @@ -import { createMDX } from 'fumadocs-mdx/next'; -import type { NextConfig } from 'next'; +import { createMDX } from "fumadocs-mdx/next"; +import type { NextConfig } from "next"; const config: NextConfig = { - transpilePackages: ['@happyview/design-system'], + transpilePackages: ["@happyview/design-system"], }; const withMDX = createMDX(); -- 2.51.2