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:
@@ -198,6 +198,29 @@ try {
|
||||
assert.match(stillV1.body, /V1 内容/);
|
||||
assert.doesNotMatch(stillV1.body, /V2 内容/);
|
||||
|
||||
const blockedRepublish = await request(`/api/mindspace/v1/pages/${page.id}/publish`, {
|
||||
method: 'POST',
|
||||
headers: authHeaders(owner.cookie),
|
||||
body: JSON.stringify({
|
||||
page_version_id: updated.body.data.currentVersionId,
|
||||
access_mode: 'owner_only',
|
||||
url_slug: 'immutable-page',
|
||||
acknowledged_finding_ids: [],
|
||||
}),
|
||||
});
|
||||
assert.equal(blockedRepublish.response.status, 409);
|
||||
assert.equal(blockedRepublish.body.error.code, 'page_already_online');
|
||||
|
||||
const offlineBeforeRepublish = await request(
|
||||
`/api/mindspace/v1/publications/${published.body.data.id}/offline`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: authHeaders(owner.cookie),
|
||||
body: '{}',
|
||||
},
|
||||
);
|
||||
assert.equal(offlineBeforeRepublish.response.status, 200);
|
||||
|
||||
const republished = await request(`/api/mindspace/v1/pages/${page.id}/publish`, {
|
||||
method: 'POST',
|
||||
headers: authHeaders(owner.cookie),
|
||||
@@ -218,7 +241,21 @@ try {
|
||||
assert.equal(ownerProtected.response.status, 200);
|
||||
assert.match(ownerProtected.body, /V2 内容/);
|
||||
|
||||
let currentPublicationId = republished.body.data.id;
|
||||
const offlineCurrentPublication = async () => {
|
||||
const response = await request(
|
||||
`/api/mindspace/v1/publications/${currentPublicationId}/offline`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: authHeaders(owner.cookie),
|
||||
body: '{}',
|
||||
},
|
||||
);
|
||||
assert.equal(response.response.status, 200, JSON.stringify(response.body));
|
||||
};
|
||||
|
||||
const publishMode = async (accessMode, extra = {}) => {
|
||||
await offlineCurrentPublication();
|
||||
const response = await request(`/api/mindspace/v1/pages/${page.id}/publish`, {
|
||||
method: 'POST',
|
||||
headers: authHeaders(owner.cookie),
|
||||
@@ -231,6 +268,7 @@ try {
|
||||
}),
|
||||
});
|
||||
assert.equal(response.response.status, 201, JSON.stringify(response.body));
|
||||
currentPublicationId = response.body.data.id;
|
||||
return response.body.data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user