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:
@@ -0,0 +1,30 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
appendPageDataLog,
|
||||
listPageDataLogs,
|
||||
resolvePageDataLogPath,
|
||||
} from './page-data-log-store.mjs';
|
||||
|
||||
test('appendPageDataLog writes jsonl entries and listPageDataLogs reads them back', () => {
|
||||
const workspaceRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'page-data-log-'));
|
||||
appendPageDataLog(workspaceRoot, 'page-1', {
|
||||
action: 'insert',
|
||||
dataset: 'entries',
|
||||
rowId: 1,
|
||||
});
|
||||
appendPageDataLog(workspaceRoot, 'page-1', {
|
||||
action: 'update',
|
||||
dataset: 'entries',
|
||||
rowId: 1,
|
||||
});
|
||||
assert.equal(fs.existsSync(resolvePageDataLogPath(workspaceRoot, 'page-1')), true);
|
||||
const logs = listPageDataLogs(workspaceRoot, 'page-1');
|
||||
assert.equal(logs.length, 2);
|
||||
assert.equal(logs[0].action, 'insert');
|
||||
assert.equal(logs[1].action, 'update');
|
||||
assert.ok(logs[0].at);
|
||||
});
|
||||
Reference in New Issue
Block a user