feat(group-album): expose cover and upload metadata
Decode the verified album cover response field and expose normalized cover details and last-upload timestamps through both album list actions. Preserve the legacy numeric timestamp shape, retain string timestamps for the native response, return null when no cover exists, and avoid additional network requests. Document the new output contracts in the OneBot and MCP catalogs. Add independent wire fixtures and action-level regression tests for the protocol mapping and public response shapes. Refs #257
This commit is contained in:
9 files changed
+841
-5
No files matched your search
@@ -37,6 +37,30 @@ describe('action-docs', () => {
|
||||
},
|
||||
);
|
||||
|
||||
it.each(['get_group_album_list', 'get_qun_album_list'])(
|
||||
'documents album cover and last-upload metadata for %s',
|
||||
(name) => {
|
||||
const action = docs.find((d) => d.name === name);
|
||||
const rootProperties = action?.returnsSchema?.properties as Record<string, any> | undefined;
|
||||
const itemProperties = name === 'get_group_album_list'
|
||||
? (action?.returnsSchema?.items as any)?.properties
|
||||
: rootProperties?.album_list?.items?.properties;
|
||||
|
||||
expect(itemProperties).toEqual(expect.objectContaining({
|
||||
last_upload_time: expect.objectContaining({
|
||||
type: name === 'get_group_album_list' ? 'integer' : 'string',
|
||||
}),
|
||||
cover: expect.objectContaining({ type: ['object', 'null'] }),
|
||||
}));
|
||||
expect(itemProperties.cover.properties.image.properties).toEqual(expect.objectContaining({
|
||||
photoUrls: expect.objectContaining({ type: 'array' }),
|
||||
defaultUrl: expect.objectContaining({ type: ['object', 'null'] }),
|
||||
isGif: expect.objectContaining({ type: 'boolean' }),
|
||||
hasRaw: expect.objectContaining({ type: 'boolean' }),
|
||||
}));
|
||||
},
|
||||
);
|
||||
|
||||
it('renders markdown with header + an action section', () => {
|
||||
const md = renderActionDocsMarkdown(docs);
|
||||
expect(md).toContain('# OneBot Actions');
|
||||
|
||||
Reference in new issue
Block a user