agent-messenger 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/release.md +92 -0
- package/.claude-plugin/README.md +144 -0
- package/.claude-plugin/marketplace.json +37 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.github/workflows/ci.yml +30 -0
- package/CLAUDE.md +106 -0
- package/CONTRIBUTING.md +131 -0
- package/README.md +140 -0
- package/biome.json +34 -0
- package/bun.lock +252 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +21 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +140 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/channel.d.ts +3 -0
- package/dist/commands/channel.d.ts.map +1 -0
- package/dist/commands/channel.js +118 -0
- package/dist/commands/channel.js.map +1 -0
- package/dist/commands/file.d.ts +3 -0
- package/dist/commands/file.d.ts.map +1 -0
- package/dist/commands/file.js +113 -0
- package/dist/commands/file.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/message.d.ts +3 -0
- package/dist/commands/message.d.ts.map +1 -0
- package/dist/commands/message.js +214 -0
- package/dist/commands/message.js.map +1 -0
- package/dist/commands/reaction.d.ts +3 -0
- package/dist/commands/reaction.d.ts.map +1 -0
- package/dist/commands/reaction.js +100 -0
- package/dist/commands/reaction.js.map +1 -0
- package/dist/commands/snapshot.d.ts +3 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +88 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/user.d.ts +3 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +96 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +89 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/lib/credential-manager.d.ts +13 -0
- package/dist/lib/credential-manager.d.ts.map +1 -0
- package/dist/lib/credential-manager.js +58 -0
- package/dist/lib/credential-manager.js.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +3 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/ref-manager.d.ts +26 -0
- package/dist/lib/ref-manager.d.ts.map +1 -0
- package/dist/lib/ref-manager.js +92 -0
- package/dist/lib/ref-manager.js.map +1 -0
- package/dist/lib/slack-client.d.ts +37 -0
- package/dist/lib/slack-client.d.ts.map +1 -0
- package/dist/lib/slack-client.js +379 -0
- package/dist/lib/slack-client.js.map +1 -0
- package/dist/lib/token-extractor.d.ts +28 -0
- package/dist/lib/token-extractor.d.ts.map +1 -0
- package/dist/lib/token-extractor.js +401 -0
- package/dist/lib/token-extractor.js.map +1 -0
- package/dist/package.json +37 -0
- package/dist/src/cli.d.ts +5 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +22 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/platforms/discord/cli.d.ts +5 -0
- package/dist/src/platforms/discord/cli.d.ts.map +1 -0
- package/dist/src/platforms/discord/cli.js +22 -0
- package/dist/src/platforms/discord/cli.js.map +1 -0
- package/dist/src/platforms/discord/client.d.ts +34 -0
- package/dist/src/platforms/discord/client.d.ts.map +1 -0
- package/dist/src/platforms/discord/client.js +187 -0
- package/dist/src/platforms/discord/client.js.map +1 -0
- package/dist/src/platforms/discord/client.test.d.ts +2 -0
- package/dist/src/platforms/discord/client.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/client.test.js +367 -0
- package/dist/src/platforms/discord/client.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/auth.d.ts +13 -0
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/auth.js +155 -0
- package/dist/src/platforms/discord/commands/auth.js.map +1 -0
- package/dist/src/platforms/discord/commands/auth.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/auth.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/auth.test.js +65 -0
- package/dist/src/platforms/discord/commands/auth.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/channel.d.ts +13 -0
- package/dist/src/platforms/discord/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/channel.js +99 -0
- package/dist/src/platforms/discord/commands/channel.js.map +1 -0
- package/dist/src/platforms/discord/commands/channel.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/channel.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/channel.test.js +136 -0
- package/dist/src/platforms/discord/commands/channel.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/file.d.ts +13 -0
- package/dist/src/platforms/discord/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/file.js +99 -0
- package/dist/src/platforms/discord/commands/file.js.map +1 -0
- package/dist/src/platforms/discord/commands/file.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/file.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/file.test.js +83 -0
- package/dist/src/platforms/discord/commands/file.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/guild.d.ts +15 -0
- package/dist/src/platforms/discord/commands/guild.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/guild.js +102 -0
- package/dist/src/platforms/discord/commands/guild.js.map +1 -0
- package/dist/src/platforms/discord/commands/guild.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/guild.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/guild.test.js +100 -0
- package/dist/src/platforms/discord/commands/guild.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/index.d.ts +9 -0
- package/dist/src/platforms/discord/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/index.js +9 -0
- package/dist/src/platforms/discord/commands/index.js.map +1 -0
- package/dist/src/platforms/discord/commands/message.d.ts +17 -0
- package/dist/src/platforms/discord/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/message.js +131 -0
- package/dist/src/platforms/discord/commands/message.js.map +1 -0
- package/dist/src/platforms/discord/commands/message.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/message.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/message.test.js +91 -0
- package/dist/src/platforms/discord/commands/message.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.d.ts +12 -0
- package/dist/src/platforms/discord/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.js +99 -0
- package/dist/src/platforms/discord/commands/reaction.js.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/reaction.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.test.js +115 -0
- package/dist/src/platforms/discord/commands/reaction.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.d.ts +9 -0
- package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.js +80 -0
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.test.js +25 -0
- package/dist/src/platforms/discord/commands/snapshot.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/user.d.ts +3 -0
- package/dist/src/platforms/discord/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/user.js +94 -0
- package/dist/src/platforms/discord/commands/user.js.map +1 -0
- package/dist/src/platforms/discord/commands/user.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/user.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/user.test.js +103 -0
- package/dist/src/platforms/discord/commands/user.test.js.map +1 -0
- package/dist/src/platforms/discord/credential-manager.d.ts +33 -0
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/discord/credential-manager.js +73 -0
- package/dist/src/platforms/discord/credential-manager.js.map +1 -0
- package/dist/src/platforms/discord/credential-manager.test.d.ts +2 -0
- package/dist/src/platforms/discord/credential-manager.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/credential-manager.test.js +136 -0
- package/dist/src/platforms/discord/credential-manager.test.js.map +1 -0
- package/dist/src/platforms/discord/token-extractor.d.ts +55 -0
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/discord/token-extractor.js +462 -0
- package/dist/src/platforms/discord/token-extractor.js.map +1 -0
- package/dist/src/platforms/discord/token-extractor.test.d.ts +2 -0
- package/dist/src/platforms/discord/token-extractor.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/token-extractor.test.js +789 -0
- package/dist/src/platforms/discord/token-extractor.test.js.map +1 -0
- package/dist/src/platforms/discord/types.d.ts +251 -0
- package/dist/src/platforms/discord/types.d.ts.map +1 -0
- package/dist/src/platforms/discord/types.js +74 -0
- package/dist/src/platforms/discord/types.js.map +1 -0
- package/dist/src/platforms/discord/types.test.d.ts +2 -0
- package/dist/src/platforms/discord/types.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/types.test.js +211 -0
- package/dist/src/platforms/discord/types.test.js.map +1 -0
- package/dist/src/platforms/slack/cli.d.ts +5 -0
- package/dist/src/platforms/slack/cli.d.ts.map +1 -0
- package/dist/src/platforms/slack/cli.js +22 -0
- package/dist/src/platforms/slack/cli.js.map +1 -0
- package/dist/src/platforms/slack/client.d.ts +47 -0
- package/dist/src/platforms/slack/client.d.ts.map +1 -0
- package/dist/src/platforms/slack/client.js +412 -0
- package/dist/src/platforms/slack/client.js.map +1 -0
- package/dist/src/platforms/slack/commands/auth.d.ts +3 -0
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/auth.js +156 -0
- package/dist/src/platforms/slack/commands/auth.js.map +1 -0
- package/dist/src/platforms/slack/commands/channel.d.ts +3 -0
- package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/channel.js +118 -0
- package/dist/src/platforms/slack/commands/channel.js.map +1 -0
- package/dist/src/platforms/slack/commands/file.d.ts +3 -0
- package/dist/src/platforms/slack/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/file.js +113 -0
- package/dist/src/platforms/slack/commands/file.js.map +1 -0
- package/dist/src/platforms/slack/commands/index.d.ts +9 -0
- package/dist/src/platforms/slack/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/index.js +9 -0
- package/dist/src/platforms/slack/commands/index.js.map +1 -0
- package/dist/src/platforms/slack/commands/message.d.ts +3 -0
- package/dist/src/platforms/slack/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/message.js +263 -0
- package/dist/src/platforms/slack/commands/message.js.map +1 -0
- package/dist/src/platforms/slack/commands/reaction.d.ts +3 -0
- package/dist/src/platforms/slack/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/reaction.js +100 -0
- package/dist/src/platforms/slack/commands/reaction.js.map +1 -0
- package/dist/src/platforms/slack/commands/snapshot.d.ts +3 -0
- package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/snapshot.js +87 -0
- package/dist/src/platforms/slack/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/slack/commands/user.d.ts +3 -0
- package/dist/src/platforms/slack/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/user.js +96 -0
- package/dist/src/platforms/slack/commands/user.js.map +1 -0
- package/dist/src/platforms/slack/commands/workspace.d.ts +3 -0
- package/dist/src/platforms/slack/commands/workspace.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/workspace.js +89 -0
- package/dist/src/platforms/slack/commands/workspace.js.map +1 -0
- package/dist/src/platforms/slack/credential-manager.d.ts +13 -0
- package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/slack/credential-manager.js +58 -0
- package/dist/src/platforms/slack/credential-manager.js.map +1 -0
- package/dist/src/platforms/slack/index.d.ts +3 -0
- package/dist/src/platforms/slack/index.d.ts.map +1 -0
- package/dist/src/platforms/slack/index.js +3 -0
- package/dist/src/platforms/slack/index.js.map +1 -0
- package/dist/src/platforms/slack/token-extractor.d.ts +28 -0
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/slack/token-extractor.js +401 -0
- package/dist/src/platforms/slack/token-extractor.js.map +1 -0
- package/dist/src/platforms/slack/types.d.ts +369 -0
- package/dist/src/platforms/slack/types.d.ts.map +1 -0
- package/dist/src/platforms/slack/types.js +92 -0
- package/dist/src/platforms/slack/types.js.map +1 -0
- package/dist/src/shared/utils/concurrency.d.ts +2 -0
- package/dist/src/shared/utils/concurrency.d.ts.map +1 -0
- package/dist/src/shared/utils/concurrency.js +14 -0
- package/dist/src/shared/utils/concurrency.js.map +1 -0
- package/dist/src/shared/utils/concurrency.test.d.ts +2 -0
- package/dist/src/shared/utils/concurrency.test.d.ts.map +1 -0
- package/dist/src/shared/utils/concurrency.test.js +39 -0
- package/dist/src/shared/utils/concurrency.test.js.map +1 -0
- package/dist/src/shared/utils/error-handler.d.ts +2 -0
- package/dist/src/shared/utils/error-handler.d.ts.map +1 -0
- package/dist/src/shared/utils/error-handler.js +5 -0
- package/dist/src/shared/utils/error-handler.js.map +1 -0
- package/dist/src/shared/utils/output.d.ts +2 -0
- package/dist/src/shared/utils/output.d.ts.map +1 -0
- package/dist/src/shared/utils/output.js +4 -0
- package/dist/src/shared/utils/output.js.map +1 -0
- package/dist/tests/cli.test.d.ts +2 -0
- package/dist/tests/cli.test.d.ts.map +1 -0
- package/dist/tests/cli.test.js +83 -0
- package/dist/tests/cli.test.js.map +1 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/CURRENT +1 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOCK +0 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG +3 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG.old +1 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/MANIFEST-000004 +0 -0
- package/dist/tests/commands/auth.test.d.ts +2 -0
- package/dist/tests/commands/auth.test.d.ts.map +1 -0
- package/dist/tests/commands/auth.test.js +304 -0
- package/dist/tests/commands/auth.test.js.map +1 -0
- package/dist/tests/commands/channel.test.d.ts +2 -0
- package/dist/tests/commands/channel.test.d.ts.map +1 -0
- package/dist/tests/commands/channel.test.js +166 -0
- package/dist/tests/commands/channel.test.js.map +1 -0
- package/dist/tests/commands/file.test.d.ts +2 -0
- package/dist/tests/commands/file.test.d.ts.map +1 -0
- package/dist/tests/commands/file.test.js +175 -0
- package/dist/tests/commands/file.test.js.map +1 -0
- package/dist/tests/commands/message.test.d.ts +2 -0
- package/dist/tests/commands/message.test.d.ts.map +1 -0
- package/dist/tests/commands/message.test.js +293 -0
- package/dist/tests/commands/message.test.js.map +1 -0
- package/dist/tests/commands/reaction.test.d.ts +2 -0
- package/dist/tests/commands/reaction.test.d.ts.map +1 -0
- package/dist/tests/commands/reaction.test.js +84 -0
- package/dist/tests/commands/reaction.test.js.map +1 -0
- package/dist/tests/commands/snapshot.test.d.ts +2 -0
- package/dist/tests/commands/snapshot.test.d.ts.map +1 -0
- package/dist/tests/commands/snapshot.test.js +280 -0
- package/dist/tests/commands/snapshot.test.js.map +1 -0
- package/dist/tests/commands/user.test.d.ts +2 -0
- package/dist/tests/commands/user.test.d.ts.map +1 -0
- package/dist/tests/commands/user.test.js +117 -0
- package/dist/tests/commands/user.test.js.map +1 -0
- package/dist/tests/commands/workspace.test.d.ts +2 -0
- package/dist/tests/commands/workspace.test.d.ts.map +1 -0
- package/dist/tests/commands/workspace.test.js +453 -0
- package/dist/tests/commands/workspace.test.js.map +1 -0
- package/dist/tests/credential-manager.test.d.ts +2 -0
- package/dist/tests/credential-manager.test.d.ts.map +1 -0
- package/dist/tests/credential-manager.test.js +199 -0
- package/dist/tests/credential-manager.test.js.map +1 -0
- package/dist/tests/slack-client.test.d.ts +2 -0
- package/dist/tests/slack-client.test.d.ts.map +1 -0
- package/dist/tests/slack-client.test.js +741 -0
- package/dist/tests/slack-client.test.js.map +1 -0
- package/dist/tests/types.test.d.ts +2 -0
- package/dist/tests/types.test.d.ts.map +1 -0
- package/dist/tests/types.test.js +215 -0
- package/dist/tests/types.test.js.map +1 -0
- package/dist/types/index.d.ts +369 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +92 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/error-handler.d.ts +2 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +5 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/output.d.ts +2 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +4 -0
- package/dist/utils/output.js.map +1 -0
- package/docs/discord.md +182 -0
- package/docs/slack.md +160 -0
- package/package.json +37 -0
- package/skills/agent-discord/SKILL.md +273 -0
- package/skills/agent-discord/references/authentication.md +294 -0
- package/skills/agent-discord/references/common-patterns.md +455 -0
- package/skills/agent-discord/templates/guild-summary.sh +167 -0
- package/skills/agent-discord/templates/monitor-channel.sh +180 -0
- package/skills/agent-discord/templates/post-message.sh +173 -0
- package/skills/agent-slack/SKILL.md +268 -0
- package/skills/agent-slack/references/authentication.md +332 -0
- package/skills/agent-slack/references/common-patterns.md +527 -0
- package/skills/agent-slack/templates/monitor-channel.sh +186 -0
- package/skills/agent-slack/templates/post-message.sh +130 -0
- package/skills/agent-slack/templates/workspace-summary.sh +149 -0
- package/src/cli.ts +29 -0
- package/src/platforms/discord/cli.ts +36 -0
- package/src/platforms/discord/client.test.ts +456 -0
- package/src/platforms/discord/client.ts +281 -0
- package/src/platforms/discord/commands/auth.test.ts +72 -0
- package/src/platforms/discord/commands/auth.ts +206 -0
- package/src/platforms/discord/commands/channel.test.ts +153 -0
- package/src/platforms/discord/commands/channel.ts +127 -0
- package/src/platforms/discord/commands/file.test.ts +98 -0
- package/src/platforms/discord/commands/file.ts +134 -0
- package/src/platforms/discord/commands/guild.test.ts +117 -0
- package/src/platforms/discord/commands/guild.ts +129 -0
- package/src/platforms/discord/commands/index.ts +8 -0
- package/src/platforms/discord/commands/message.test.ts +107 -0
- package/src/platforms/discord/commands/message.ts +182 -0
- package/src/platforms/discord/commands/reaction.test.ts +123 -0
- package/src/platforms/discord/commands/reaction.ts +156 -0
- package/src/platforms/discord/commands/snapshot.test.ts +29 -0
- package/src/platforms/discord/commands/snapshot.ts +104 -0
- package/src/platforms/discord/commands/user.test.ts +115 -0
- package/src/platforms/discord/commands/user.ts +124 -0
- package/src/platforms/discord/credential-manager.test.ts +173 -0
- package/src/platforms/discord/credential-manager.ts +95 -0
- package/src/platforms/discord/token-extractor.test.ts +918 -0
- package/src/platforms/discord/token-extractor.ts +549 -0
- package/src/platforms/discord/types.test.ts +245 -0
- package/src/platforms/discord/types.ts +158 -0
- package/src/platforms/slack/cli.ts +36 -0
- package/src/platforms/slack/client.ts +466 -0
- package/src/platforms/slack/commands/auth.ts +211 -0
- package/src/platforms/slack/commands/channel.ts +158 -0
- package/src/platforms/slack/commands/file.ts +153 -0
- package/src/platforms/slack/commands/index.ts +8 -0
- package/src/platforms/slack/commands/message.ts +369 -0
- package/src/platforms/slack/commands/reaction.ts +166 -0
- package/src/platforms/slack/commands/snapshot.ts +114 -0
- package/src/platforms/slack/commands/user.ts +110 -0
- package/src/platforms/slack/commands/workspace.ts +111 -0
- package/src/platforms/slack/credential-manager.ts +74 -0
- package/src/platforms/slack/index.ts +2 -0
- package/src/platforms/slack/token-extractor.ts +496 -0
- package/src/platforms/slack/types.ts +193 -0
- package/src/shared/utils/concurrency.test.ts +53 -0
- package/src/shared/utils/concurrency.ts +20 -0
- package/src/shared/utils/error-handler.ts +4 -0
- package/src/shared/utils/output.ts +3 -0
- package/tests/cli.test.ts +94 -0
- package/tests/commands/auth.test.ts +383 -0
- package/tests/commands/channel.test.ts +185 -0
- package/tests/commands/file.test.ts +204 -0
- package/tests/commands/message.test.ts +344 -0
- package/tests/commands/reaction.test.ts +101 -0
- package/tests/commands/snapshot.test.ts +308 -0
- package/tests/commands/user.test.ts +138 -0
- package/tests/commands/workspace.test.ts +528 -0
- package/tests/credential-manager.test.ts +241 -0
- package/tests/slack-client.test.ts +916 -0
- package/tests/types.test.ts +241 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
|
|
2
|
+
import { DiscordClient, DiscordError } from './client'
|
|
3
|
+
|
|
4
|
+
describe('DiscordClient', () => {
|
|
5
|
+
const originalFetch = globalThis.fetch
|
|
6
|
+
let fetchCalls: Array<{ url: string; options?: RequestInit }> = []
|
|
7
|
+
let fetchResponses: Response[] = []
|
|
8
|
+
let fetchIndex = 0
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
fetchCalls = []
|
|
12
|
+
fetchResponses = []
|
|
13
|
+
fetchIndex = 0
|
|
14
|
+
;(globalThis as any).fetch = async (
|
|
15
|
+
url: string | URL | Request,
|
|
16
|
+
options?: RequestInit
|
|
17
|
+
): Promise<Response> => {
|
|
18
|
+
fetchCalls.push({ url: url.toString(), options })
|
|
19
|
+
const response = fetchResponses[fetchIndex]
|
|
20
|
+
fetchIndex++
|
|
21
|
+
if (!response) {
|
|
22
|
+
throw new Error('No mock response configured')
|
|
23
|
+
}
|
|
24
|
+
return response
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
globalThis.fetch = originalFetch
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
globalThis.fetch = originalFetch
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const mockResponse = (body: unknown, status = 200, headers: Record<string, string> = {}) => {
|
|
37
|
+
const defaultHeaders: Record<string, string> = {
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
'X-RateLimit-Remaining': '10',
|
|
40
|
+
'X-RateLimit-Reset': String(Date.now() / 1000 + 60),
|
|
41
|
+
'X-RateLimit-Bucket': 'test-bucket',
|
|
42
|
+
...headers,
|
|
43
|
+
}
|
|
44
|
+
fetchResponses.push(
|
|
45
|
+
new Response(body === null ? null : JSON.stringify(body), {
|
|
46
|
+
status,
|
|
47
|
+
headers: defaultHeaders,
|
|
48
|
+
})
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe('constructor', () => {
|
|
53
|
+
test('requires token', () => {
|
|
54
|
+
expect(() => new DiscordClient('')).toThrow(DiscordError)
|
|
55
|
+
expect(() => new DiscordClient('')).toThrow('Token is required')
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
test('accepts valid token', () => {
|
|
59
|
+
const client = new DiscordClient('test-token')
|
|
60
|
+
expect(client).toBeInstanceOf(DiscordClient)
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
describe('testAuth', () => {
|
|
65
|
+
test('returns current user info', async () => {
|
|
66
|
+
mockResponse({
|
|
67
|
+
id: '123456789',
|
|
68
|
+
username: 'testuser',
|
|
69
|
+
global_name: 'Test User',
|
|
70
|
+
avatar: 'abc123',
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const client = new DiscordClient('test-token')
|
|
74
|
+
const user = await client.testAuth()
|
|
75
|
+
|
|
76
|
+
expect(user.id).toBe('123456789')
|
|
77
|
+
expect(user.username).toBe('testuser')
|
|
78
|
+
expect(fetchCalls.length).toBe(1)
|
|
79
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/users/@me')
|
|
80
|
+
expect(fetchCalls[0].options?.headers).toMatchObject({
|
|
81
|
+
Authorization: 'test-token',
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
test('throws DiscordError on API error', async () => {
|
|
86
|
+
mockResponse({ message: 'Unauthorized', code: 401 }, 401)
|
|
87
|
+
|
|
88
|
+
const client = new DiscordClient('bad-token')
|
|
89
|
+
await expect(client.testAuth()).rejects.toThrow(DiscordError)
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
describe('listGuilds', () => {
|
|
94
|
+
test('returns list of guilds', async () => {
|
|
95
|
+
mockResponse([
|
|
96
|
+
{ id: '111', name: 'Guild One' },
|
|
97
|
+
{ id: '222', name: 'Guild Two' },
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
const client = new DiscordClient('test-token')
|
|
101
|
+
const guilds = await client.listGuilds()
|
|
102
|
+
|
|
103
|
+
expect(guilds).toHaveLength(2)
|
|
104
|
+
expect(guilds[0].name).toBe('Guild One')
|
|
105
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/users/@me/guilds')
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
describe('getGuild', () => {
|
|
110
|
+
test('returns guild info', async () => {
|
|
111
|
+
mockResponse({ id: '111', name: 'Test Guild' })
|
|
112
|
+
|
|
113
|
+
const client = new DiscordClient('test-token')
|
|
114
|
+
const guild = await client.getGuild('111')
|
|
115
|
+
|
|
116
|
+
expect(guild.id).toBe('111')
|
|
117
|
+
expect(guild.name).toBe('Test Guild')
|
|
118
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/guilds/111')
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
describe('listChannels', () => {
|
|
123
|
+
test('returns list of channels for guild', async () => {
|
|
124
|
+
mockResponse([
|
|
125
|
+
{ id: 'ch1', guild_id: '111', name: 'general', type: 0 },
|
|
126
|
+
{ id: 'ch2', guild_id: '111', name: 'random', type: 0 },
|
|
127
|
+
])
|
|
128
|
+
|
|
129
|
+
const client = new DiscordClient('test-token')
|
|
130
|
+
const channels = await client.listChannels('111')
|
|
131
|
+
|
|
132
|
+
expect(channels).toHaveLength(2)
|
|
133
|
+
expect(channels[0].name).toBe('general')
|
|
134
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/guilds/111/channels')
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
describe('getChannel', () => {
|
|
139
|
+
test('returns channel info', async () => {
|
|
140
|
+
mockResponse({ id: 'ch1', guild_id: '111', name: 'general', type: 0 })
|
|
141
|
+
|
|
142
|
+
const client = new DiscordClient('test-token')
|
|
143
|
+
const channel = await client.getChannel('ch1')
|
|
144
|
+
|
|
145
|
+
expect(channel.id).toBe('ch1')
|
|
146
|
+
expect(channel.name).toBe('general')
|
|
147
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1')
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
describe('sendMessage', () => {
|
|
152
|
+
test('sends message to channel', async () => {
|
|
153
|
+
mockResponse({
|
|
154
|
+
id: 'msg1',
|
|
155
|
+
channel_id: 'ch1',
|
|
156
|
+
author: { id: '123', username: 'bot' },
|
|
157
|
+
content: 'Hello world',
|
|
158
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
const client = new DiscordClient('test-token')
|
|
162
|
+
const message = await client.sendMessage('ch1', 'Hello world')
|
|
163
|
+
|
|
164
|
+
expect(message.content).toBe('Hello world')
|
|
165
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages')
|
|
166
|
+
expect(fetchCalls[0].options?.method).toBe('POST')
|
|
167
|
+
expect(fetchCalls[0].options?.body).toBe(JSON.stringify({ content: 'Hello world' }))
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
describe('getMessages', () => {
|
|
172
|
+
test('returns messages from channel', async () => {
|
|
173
|
+
mockResponse([
|
|
174
|
+
{
|
|
175
|
+
id: 'msg1',
|
|
176
|
+
channel_id: 'ch1',
|
|
177
|
+
author: { id: '123', username: 'user1' },
|
|
178
|
+
content: 'Message 1',
|
|
179
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
180
|
+
},
|
|
181
|
+
])
|
|
182
|
+
|
|
183
|
+
const client = new DiscordClient('test-token')
|
|
184
|
+
const messages = await client.getMessages('ch1', 50)
|
|
185
|
+
|
|
186
|
+
expect(messages).toHaveLength(1)
|
|
187
|
+
expect(messages[0].content).toBe('Message 1')
|
|
188
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages?limit=50')
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
test('uses default limit of 50', async () => {
|
|
192
|
+
mockResponse([])
|
|
193
|
+
|
|
194
|
+
const client = new DiscordClient('test-token')
|
|
195
|
+
await client.getMessages('ch1')
|
|
196
|
+
|
|
197
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages?limit=50')
|
|
198
|
+
})
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
describe('getMessage', () => {
|
|
202
|
+
test('returns single message', async () => {
|
|
203
|
+
mockResponse({
|
|
204
|
+
id: 'msg1',
|
|
205
|
+
channel_id: 'ch1',
|
|
206
|
+
author: { id: '123', username: 'user1' },
|
|
207
|
+
content: 'Message 1',
|
|
208
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
const client = new DiscordClient('test-token')
|
|
212
|
+
const message = await client.getMessage('ch1', 'msg1')
|
|
213
|
+
|
|
214
|
+
expect(message.id).toBe('msg1')
|
|
215
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages/msg1')
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
describe('deleteMessage', () => {
|
|
220
|
+
test('deletes message', async () => {
|
|
221
|
+
mockResponse(null, 204)
|
|
222
|
+
|
|
223
|
+
const client = new DiscordClient('test-token')
|
|
224
|
+
await client.deleteMessage('ch1', 'msg1')
|
|
225
|
+
|
|
226
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages/msg1')
|
|
227
|
+
expect(fetchCalls[0].options?.method).toBe('DELETE')
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
describe('addReaction', () => {
|
|
232
|
+
test('adds reaction to message', async () => {
|
|
233
|
+
mockResponse(null, 204)
|
|
234
|
+
|
|
235
|
+
const client = new DiscordClient('test-token')
|
|
236
|
+
await client.addReaction('ch1', 'msg1', '👍')
|
|
237
|
+
|
|
238
|
+
expect(fetchCalls[0].url).toBe(
|
|
239
|
+
'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me'
|
|
240
|
+
)
|
|
241
|
+
expect(fetchCalls[0].options?.method).toBe('PUT')
|
|
242
|
+
})
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
describe('removeReaction', () => {
|
|
246
|
+
test('removes reaction from message', async () => {
|
|
247
|
+
mockResponse(null, 204)
|
|
248
|
+
|
|
249
|
+
const client = new DiscordClient('test-token')
|
|
250
|
+
await client.removeReaction('ch1', 'msg1', '👍')
|
|
251
|
+
|
|
252
|
+
expect(fetchCalls[0].url).toBe(
|
|
253
|
+
'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me'
|
|
254
|
+
)
|
|
255
|
+
expect(fetchCalls[0].options?.method).toBe('DELETE')
|
|
256
|
+
})
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
describe('listUsers', () => {
|
|
260
|
+
test('returns list of guild members', async () => {
|
|
261
|
+
mockResponse([
|
|
262
|
+
{ user: { id: 'u1', username: 'user1' } },
|
|
263
|
+
{ user: { id: 'u2', username: 'user2' } },
|
|
264
|
+
])
|
|
265
|
+
|
|
266
|
+
const client = new DiscordClient('test-token')
|
|
267
|
+
const users = await client.listUsers('111')
|
|
268
|
+
|
|
269
|
+
expect(users).toHaveLength(2)
|
|
270
|
+
expect(users[0].username).toBe('user1')
|
|
271
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/guilds/111/members?limit=1000')
|
|
272
|
+
})
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
describe('getUser', () => {
|
|
276
|
+
test('returns user info', async () => {
|
|
277
|
+
mockResponse({ id: 'u1', username: 'testuser' })
|
|
278
|
+
|
|
279
|
+
const client = new DiscordClient('test-token')
|
|
280
|
+
const user = await client.getUser('u1')
|
|
281
|
+
|
|
282
|
+
expect(user.id).toBe('u1')
|
|
283
|
+
expect(user.username).toBe('testuser')
|
|
284
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/users/u1')
|
|
285
|
+
})
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
describe('uploadFile', () => {
|
|
289
|
+
test('uploads file to channel', async () => {
|
|
290
|
+
const tempFile = '/tmp/test-upload.txt'
|
|
291
|
+
await Bun.write(tempFile, 'test content')
|
|
292
|
+
|
|
293
|
+
mockResponse({
|
|
294
|
+
id: 'msg1',
|
|
295
|
+
channel_id: 'ch1',
|
|
296
|
+
author: { id: '123', username: 'bot' },
|
|
297
|
+
content: '',
|
|
298
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
299
|
+
attachments: [
|
|
300
|
+
{
|
|
301
|
+
id: 'att1',
|
|
302
|
+
filename: 'test-upload.txt',
|
|
303
|
+
size: 12,
|
|
304
|
+
url: 'https://cdn.discord.com/attachments/ch1/att1/test-upload.txt',
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
const client = new DiscordClient('test-token')
|
|
310
|
+
const file = await client.uploadFile('ch1', tempFile)
|
|
311
|
+
|
|
312
|
+
expect(file.filename).toBe('test-upload.txt')
|
|
313
|
+
expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages')
|
|
314
|
+
expect(fetchCalls[0].options?.method).toBe('POST')
|
|
315
|
+
})
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
describe('listFiles', () => {
|
|
319
|
+
test('returns files from recent messages', async () => {
|
|
320
|
+
mockResponse([
|
|
321
|
+
{
|
|
322
|
+
id: 'msg1',
|
|
323
|
+
channel_id: 'ch1',
|
|
324
|
+
author: { id: '123', username: 'user1' },
|
|
325
|
+
content: '',
|
|
326
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
327
|
+
attachments: [
|
|
328
|
+
{ id: 'att1', filename: 'file1.txt', size: 100, url: 'https://example.com/file1.txt' },
|
|
329
|
+
],
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 'msg2',
|
|
333
|
+
channel_id: 'ch1',
|
|
334
|
+
author: { id: '456', username: 'user2' },
|
|
335
|
+
content: 'No attachments',
|
|
336
|
+
timestamp: '2024-01-01T00:00:01.000Z',
|
|
337
|
+
attachments: [],
|
|
338
|
+
},
|
|
339
|
+
])
|
|
340
|
+
|
|
341
|
+
const client = new DiscordClient('test-token')
|
|
342
|
+
const files = await client.listFiles('ch1')
|
|
343
|
+
|
|
344
|
+
expect(files).toHaveLength(1)
|
|
345
|
+
expect(files[0].filename).toBe('file1.txt')
|
|
346
|
+
})
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
describe('rate limiting', () => {
|
|
350
|
+
test('waits when bucket is exhausted before making request', async () => {
|
|
351
|
+
mockResponse({ id: '1', username: 'user1' }, 200, {
|
|
352
|
+
'X-RateLimit-Remaining': '0',
|
|
353
|
+
'X-RateLimit-Reset': String(Date.now() / 1000 + 0.1),
|
|
354
|
+
'X-RateLimit-Bucket': 'user-bucket',
|
|
355
|
+
})
|
|
356
|
+
mockResponse({ id: '2', username: 'user2' }, 200, {
|
|
357
|
+
'X-RateLimit-Remaining': '10',
|
|
358
|
+
'X-RateLimit-Reset': String(Date.now() / 1000 + 60),
|
|
359
|
+
'X-RateLimit-Bucket': 'user-bucket',
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
const client = new DiscordClient('test-token')
|
|
363
|
+
await client.testAuth()
|
|
364
|
+
|
|
365
|
+
const startTime = Date.now()
|
|
366
|
+
await client.testAuth()
|
|
367
|
+
const elapsed = Date.now() - startTime
|
|
368
|
+
|
|
369
|
+
expect(elapsed).toBeGreaterThanOrEqual(50)
|
|
370
|
+
expect(fetchCalls.length).toBe(2)
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
test('retries on 429 with Retry-After header', async () => {
|
|
374
|
+
mockResponse({ message: 'Rate limited', retry_after: 0.1 }, 429, { 'Retry-After': '0.1' })
|
|
375
|
+
mockResponse({ id: '123', username: 'user' })
|
|
376
|
+
|
|
377
|
+
const client = new DiscordClient('test-token')
|
|
378
|
+
const user = await client.testAuth()
|
|
379
|
+
|
|
380
|
+
expect(user.id).toBe('123')
|
|
381
|
+
expect(fetchCalls.length).toBe(2)
|
|
382
|
+
})
|
|
383
|
+
|
|
384
|
+
test('handles global rate limit', async () => {
|
|
385
|
+
mockResponse({ message: 'Global rate limited', global: true }, 429, {
|
|
386
|
+
'Retry-After': '0.1',
|
|
387
|
+
'X-RateLimit-Global': 'true',
|
|
388
|
+
})
|
|
389
|
+
mockResponse({ id: '123', username: 'user' })
|
|
390
|
+
|
|
391
|
+
const client = new DiscordClient('test-token')
|
|
392
|
+
const user = await client.testAuth()
|
|
393
|
+
|
|
394
|
+
expect(user.id).toBe('123')
|
|
395
|
+
expect(fetchCalls.length).toBe(2)
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
test('throws after max retries exceeded', async () => {
|
|
399
|
+
for (let i = 0; i <= 3; i++) {
|
|
400
|
+
mockResponse({ message: 'Rate limited' }, 429, { 'Retry-After': '0.01' })
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const client = new DiscordClient('test-token')
|
|
404
|
+
await expect(client.testAuth()).rejects.toThrow(DiscordError)
|
|
405
|
+
expect(fetchCalls.length).toBeLessThanOrEqual(4)
|
|
406
|
+
})
|
|
407
|
+
})
|
|
408
|
+
|
|
409
|
+
describe('retry logic', () => {
|
|
410
|
+
test('retries on 500 server error', async () => {
|
|
411
|
+
mockResponse({ message: 'Internal Server Error' }, 500)
|
|
412
|
+
mockResponse({ id: '123', username: 'user' })
|
|
413
|
+
|
|
414
|
+
const client = new DiscordClient('test-token')
|
|
415
|
+
const user = await client.testAuth()
|
|
416
|
+
|
|
417
|
+
expect(user.id).toBe('123')
|
|
418
|
+
expect(fetchCalls.length).toBe(2)
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
test('does not retry on 4xx client errors (except 429)', async () => {
|
|
422
|
+
mockResponse({ message: 'Not Found' }, 404)
|
|
423
|
+
|
|
424
|
+
const client = new DiscordClient('test-token')
|
|
425
|
+
await expect(client.testAuth()).rejects.toThrow(DiscordError)
|
|
426
|
+
expect(fetchCalls.length).toBe(1)
|
|
427
|
+
})
|
|
428
|
+
|
|
429
|
+
test('exponential backoff increases delay', async () => {
|
|
430
|
+
mockResponse({ message: 'Error' }, 500)
|
|
431
|
+
mockResponse({ message: 'Error' }, 500)
|
|
432
|
+
mockResponse({ id: '123', username: 'user' })
|
|
433
|
+
|
|
434
|
+
const client = new DiscordClient('test-token')
|
|
435
|
+
const startTime = Date.now()
|
|
436
|
+
await client.testAuth()
|
|
437
|
+
const elapsed = Date.now() - startTime
|
|
438
|
+
|
|
439
|
+
expect(elapsed).toBeGreaterThanOrEqual(150)
|
|
440
|
+
expect(fetchCalls.length).toBe(3)
|
|
441
|
+
})
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
describe('bucket key normalization', () => {
|
|
445
|
+
test('normalizes channel IDs in routes', async () => {
|
|
446
|
+
mockResponse([])
|
|
447
|
+
mockResponse([])
|
|
448
|
+
|
|
449
|
+
const client = new DiscordClient('test-token')
|
|
450
|
+
await client.getMessages('123456789')
|
|
451
|
+
await client.getMessages('987654321')
|
|
452
|
+
|
|
453
|
+
expect(fetchCalls.length).toBe(2)
|
|
454
|
+
})
|
|
455
|
+
})
|
|
456
|
+
})
|