feat(page-data): complete Phase 4-5, ops UI, and publish integration

Add visitor roles, row-level scope, owner ops APIs, MySQL policy index,
Turnstile captcha, browser client SDK, publish-panel dataset binding,
acceptance tests, and usage documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-08 14:52:49 +08:00
parent 8d01553469
commit 6b0c633a75
40 changed files with 4056 additions and 60 deletions
+13
View File
@@ -834,6 +834,19 @@ export async function migrateSchema(pool) {
AND c.category_code IN ('public', 'oa')`,
);
await pool.query(`
CREATE TABLE IF NOT EXISTS h5_page_data_policy_index (
page_id CHAR(36) PRIMARY KEY,
owner_user_id CHAR(36) NOT NULL,
access_mode VARCHAR(32) NOT NULL,
dataset_count INT UNSIGNED NOT NULL DEFAULT 0,
scope_hash CHAR(16) NOT NULL,
updated_at BIGINT NOT NULL,
KEY idx_h5_page_data_policy_owner (owner_user_id, updated_at),
CONSTRAINT fk_h5_page_data_policy_owner FOREIGN KEY (owner_user_id) REFERENCES h5_users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
`);
await pool.query(`
CREATE TABLE IF NOT EXISTS h5_user_feedback (
id CHAR(36) PRIMARY KEY,