feat(mindspace): 公开页分享组件、workspace 路径与 Plaza 发布增强
- 新增 public share widget 与 workspace relative path 解析 - 增强 publications/chat-plaza 发布链路与缩略图 demo - 补充 schema、cover 检查脚本与回归测试 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -689,3 +689,30 @@ test('createUpload rejects another users category id', async () => {
|
||||
(error) => error.code === 'category_not_found',
|
||||
);
|
||||
});
|
||||
|
||||
test('publicUrlForAsset uses MindSpace public URL for workspace-synced images', () => {
|
||||
const url = assetInternals.publicUrlForAsset({
|
||||
id: 'asset-1',
|
||||
user_id: 'user-1',
|
||||
category_code: 'public',
|
||||
mime_type: 'image/png',
|
||||
original_filename: 'mapo-tofu-recipe.thumbnail.png',
|
||||
workspace_relative_path: 'public/mapo-tofu-recipe.thumbnail.png',
|
||||
storage_key: 'workspace://user-1/public/mapo-tofu-recipe.thumbnail.png',
|
||||
});
|
||||
assert.match(url, /\/MindSpace\/user-1\/public\/mapo-tofu-recipe\.thumbnail\.png$/);
|
||||
});
|
||||
|
||||
test('publicUrlForAsset does not route workspace image paths through imgproxy', () => {
|
||||
const url = assetInternals.publicUrlForAsset({
|
||||
id: 'asset-2',
|
||||
user_id: 'user-1',
|
||||
category_code: 'public',
|
||||
mime_type: 'image/jpeg',
|
||||
original_filename: 'images/2026-07-04/photo.jpg',
|
||||
workspace_relative_path: 'public/images/2026-07-04/photo.jpg',
|
||||
storage_key: 'workspace://user-1/public/images/2026-07-04/photo.jpg',
|
||||
});
|
||||
assert.match(url, /\/MindSpace\/user-1\/public\/images\/2026-07-04\/photo\.jpg$/);
|
||||
assert.doesNotMatch(url, /20081|workspace:\/\//);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user