feat(mindspace): add SEO/GEO delivery, page template catalog, and admin hooks
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
Enable optional SEO/GEO injection and discovery routes for confirmed public pages while keeping private pages noindex. Add premium page template skills, portal catalog API, template shop UI, and Baidu push gated by memind_adm config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -868,3 +868,51 @@ test('publish rejects republish while page is still online', async () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test('updatePublicationAccess notifies search engines when public access is confirmed', async () => {
|
||||
const notifyCalls = [];
|
||||
const publication = {
|
||||
id: 'pub-1',
|
||||
user_id: 'user-1',
|
||||
page_id: 'page-1',
|
||||
page_version_id: 'version-1',
|
||||
status: 'online',
|
||||
access_mode: 'private',
|
||||
url_slug: 'landing',
|
||||
expires_at: null,
|
||||
password_hash: null,
|
||||
user_confirmed_at: null,
|
||||
published_at: 1000,
|
||||
offline_at: null,
|
||||
view_count: 0,
|
||||
};
|
||||
const pool = {
|
||||
async getConnection() {
|
||||
return {
|
||||
async beginTransaction() {},
|
||||
async commit() {},
|
||||
async rollback() {},
|
||||
async query(sql) {
|
||||
if (sql.includes('FOR UPDATE')) {
|
||||
return [[publication]];
|
||||
}
|
||||
return [{ affectedRows: 1 }];
|
||||
},
|
||||
release() {},
|
||||
};
|
||||
},
|
||||
};
|
||||
const service = createPublicationService(pool, {
|
||||
notifyPublicationSearchEnginesFn: async (_pool, response) => {
|
||||
notifyCalls.push(response);
|
||||
},
|
||||
});
|
||||
|
||||
await service.updatePublicationAccess('user-1', 'pub-1', {
|
||||
accessMode: 'public',
|
||||
});
|
||||
|
||||
assert.equal(notifyCalls.length, 1);
|
||||
assert.equal(notifyCalls[0].accessMode, 'public');
|
||||
assert.equal(notifyCalls[0].urlSlug, 'landing');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user