fix(subscribe): provide toC allow_type

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2023-02-13 23:20:26 +08:00
parent c9293d1377
commit 35e18646e5
4 changed files with 19 additions and 9 deletions

View File

@@ -18,4 +18,15 @@ describe('test topic client', () => {
const data = await client.subscribe.unsubscribe('foo@example.com', 'token')
expect(data).toEqual(mocked)
})
test('GET /subscribe/status', async () => {
const mocked = mockResponse('/subscribe/status', {
enable: true,
bit_map: { post_c: 1, note_c: 2, say_c: 4, recently_c: 8, all: 15 },
allow_bits: [2, 1],
allow_types: ['note_c', 'post_c'],
})
const data = await client.subscribe.check()
expect(data).toEqual(camelcaseKeys(mocked, { deep: true }))
})
})

View File

@@ -34,7 +34,8 @@ export class SubscribeController<ResponseWrapper> implements IController {
return this.proxy.status.get<{
enable: boolean
bitMap: Record<SubscribeType, number>
allowTypes: number[]
allowBits: number[]
allowTypes: SubscribeType[]
}>()
}