feat(member): improve assistant roster awareness

This commit is contained in:
2026-03-11 15:10:20 +04:00
parent 79f96ba45b
commit 0787847c19
27 changed files with 1429 additions and 3 deletions

View File

@@ -73,6 +73,24 @@ describe('createBotWebhookServer', () => {
}
})
},
miniAppUpdateOwnDisplayName: {
handler: async () =>
new Response(JSON.stringify({ ok: true, authorized: true, member: {} }), {
status: 200,
headers: {
'content-type': 'application/json; charset=utf-8'
}
})
},
miniAppUpdateMemberDisplayName: {
handler: async () =>
new Response(JSON.stringify({ ok: true, authorized: true, member: {} }), {
status: 200,
headers: {
'content-type': 'application/json; charset=utf-8'
}
})
},
miniAppUpdateMemberRentWeight: {
handler: async () =>
new Response(JSON.stringify({ ok: true, authorized: true, member: {} }), {
@@ -340,6 +358,38 @@ describe('createBotWebhookServer', () => {
})
})
test('accepts mini app own display name update request', async () => {
const response = await server.fetch(
new Request('http://localhost/api/miniapp/member/display-name', {
method: 'POST',
body: JSON.stringify({ initData: 'payload' })
})
)
expect(response.status).toBe(200)
expect(await response.json()).toEqual({
ok: true,
authorized: true,
member: {}
})
})
test('accepts mini app member display name update request', async () => {
const response = await server.fetch(
new Request('http://localhost/api/miniapp/admin/members/display-name', {
method: 'POST',
body: JSON.stringify({ initData: 'payload' })
})
)
expect(response.status).toBe(200)
expect(await response.json()).toEqual({
ok: true,
authorized: true,
member: {}
})
})
test('accepts mini app rent weight update request', async () => {
const response = await server.fetch(
new Request('http://localhost/api/miniapp/admin/members/rent-weight', {