feat(mindspace): enforce PostgreSQL user data delivery

This commit is contained in:
john
2026-07-13 15:29:29 +08:00
parent b33c943b69
commit a6620fb719
57 changed files with 2779 additions and 164 deletions
+5 -1
View File
@@ -316,6 +316,7 @@ test('syncUserWorkspace imports nested workspace files into asset library', asyn
const workspace = resolveUserWorkspaceRoot(h5Root, { id: 'user-1', username: 'john' });
await fs.mkdir(path.join(workspace, 'oa', '暑假实习报告'), { recursive: true });
await fs.writeFile(path.join(workspace, 'oa', '暑假实习报告', 'report.csv'), 'a,b\n1,2\n');
await fs.writeFile(path.join(workspace, 'oa', 'historical.csv'), 'old,data\n3,4\n');
const state = {
categories: [
@@ -417,7 +418,10 @@ test('syncUserWorkspace imports nested workspace files into asset library', asyn
idFactory: () => `id-${++nextId}`,
});
const result = await sync.syncUserWorkspace('user-1', { categoryCode: 'oa' });
const result = await sync.syncUserWorkspace('user-1', {
categoryCode: 'oa',
onlyRelativePaths: ['oa/暑假实习报告/report.csv'],
});
assert.equal(result.imported, 1);
assert.equal(state.assets[0].original_filename, '暑假实习报告/report.csv');
});