fix(feishu): integrate slash command permissions

This commit is contained in:
xmanrui 2026-08-31 01:15:45 +08:00
parent 29aa138b3b
commit 347acceffb
20 changed files with 464 additions and 273 deletions

View file

@ -187,6 +187,8 @@ test('QR registration separates events from card callbacks', async () => {
assert.deepEqual(run.options.addons.callbacks.items, ['card.action.trigger']);
assert.ok(run.options.addons.scopes.tenant.includes('im:resource'));
assert.equal(run.options.addons.scopes.tenant.includes('im:resource:upload'), false);
assert.ok(run.options.addons.scopes.tenant.includes('application:app_slash_command:read'));
assert.ok(run.options.addons.scopes.tenant.includes('application:app_slash_command:write'));
run.options.onQRCodeReady({ url: 'https://accounts.feishu.cn/callbacks', expireIn: 60 });
run.resolve({
client_id: 'cli_callbacks', client_secret: 'callbacks-secret',
@ -346,7 +348,14 @@ test('callback repair is deduplicated per bot, updates only its secret, and prov
assert.equal(Object.hasOwn(run.options, 'appPreset'), false);
assert.deepEqual(run.options.addons, {
preset: false,
scopes: { tenant: ['im:message:readonly', 'im:resource'] },
scopes: {
tenant: [
'im:message:readonly',
'im:resource',
'application:app_slash_command:read',
'application:app_slash_command:write',
],
},
callbacks: { items: ['card.action.trigger'] },
});
run.options.onQRCodeReady({