agent-messenger 1.0.0 → 1.1.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 +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/e2e.yml.disabled +69 -0
- package/README.md +16 -14
- package/biome.json +33 -1
- package/bun.lock +63 -0
- package/dist/package.json +8 -4
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +4 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/discord/cli.js +1 -1
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js +3 -3
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discord/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/user.js +10 -1
- package/dist/src/platforms/discord/commands/user.js.map +1 -1
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/discord/credential-manager.js +18 -12
- package/dist/src/platforms/discord/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/cli.js +1 -1
- package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/slack/credential-manager.js +20 -6
- package/dist/src/platforms/slack/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +34 -9
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/teams/cli.d.ts.map +1 -0
- package/dist/{cli.js → src/platforms/teams/cli.js} +11 -10
- package/dist/src/platforms/teams/cli.js.map +1 -0
- package/dist/src/platforms/teams/client.d.ts +32 -0
- package/dist/src/platforms/teams/client.d.ts.map +1 -0
- package/dist/src/platforms/teams/client.js +202 -0
- package/dist/src/platforms/teams/client.js.map +1 -0
- package/dist/src/platforms/teams/commands/auth.d.ts +14 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/auth.js +176 -0
- package/dist/src/platforms/teams/commands/auth.js.map +1 -0
- package/dist/src/platforms/teams/commands/channel.d.ts +13 -0
- package/dist/src/platforms/teams/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/channel.js +97 -0
- package/dist/src/platforms/teams/commands/channel.js.map +1 -0
- package/dist/src/platforms/teams/commands/file.d.ts +12 -0
- package/dist/src/platforms/teams/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/file.js +104 -0
- package/dist/src/platforms/teams/commands/file.js.map +1 -0
- package/dist/{commands → src/platforms/teams/commands}/index.d.ts +5 -2
- package/dist/src/platforms/teams/commands/index.d.ts.map +1 -0
- package/dist/{commands → src/platforms/teams/commands}/index.js +5 -2
- package/dist/src/platforms/teams/commands/index.js.map +1 -0
- package/dist/src/platforms/teams/commands/message.d.ts +17 -0
- package/dist/src/platforms/teams/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/message.js +133 -0
- package/dist/src/platforms/teams/commands/message.js.map +1 -0
- package/dist/src/platforms/teams/commands/reaction.d.ts +9 -0
- package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/reaction.js +68 -0
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts +10 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/snapshot.js +85 -0
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/teams/commands/team.d.ts +18 -0
- package/dist/src/platforms/teams/commands/team.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/team.js +130 -0
- package/dist/src/platforms/teams/commands/team.js.map +1 -0
- package/dist/src/platforms/teams/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/user.js +88 -0
- package/dist/src/platforms/teams/commands/user.js.map +1 -0
- package/dist/src/platforms/teams/credential-manager.d.ts +18 -0
- package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/teams/credential-manager.js +81 -0
- package/dist/src/platforms/teams/credential-manager.js.map +1 -0
- package/dist/src/platforms/teams/index.d.ts +4 -0
- package/dist/src/platforms/teams/index.d.ts.map +1 -0
- package/dist/src/platforms/teams/index.js +6 -0
- package/dist/src/platforms/teams/index.js.map +1 -0
- package/dist/src/platforms/teams/token-extractor.d.ts +36 -0
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/teams/token-extractor.js +335 -0
- package/dist/src/platforms/teams/token-extractor.js.map +1 -0
- package/dist/src/platforms/teams/types.d.ts +209 -0
- package/dist/src/platforms/teams/types.d.ts.map +1 -0
- package/dist/src/platforms/teams/types.js +65 -0
- package/dist/src/platforms/teams/types.js.map +1 -0
- package/docs/teams.md +321 -0
- package/e2e/README.md +256 -0
- package/e2e/config.ts +45 -0
- package/e2e/discord.e2e.test.ts +252 -0
- package/e2e/helpers.ts +107 -0
- package/e2e/slack.e2e.test.ts +309 -0
- package/package.json +8 -4
- package/scripts/postbuild.ts +15 -0
- package/skills/agent-teams/SKILL.md +292 -0
- package/skills/agent-teams/references/authentication.md +375 -0
- package/skills/agent-teams/references/common-patterns.md +596 -0
- package/skills/agent-teams/templates/monitor-channel.sh +239 -0
- package/skills/agent-teams/templates/post-message.sh +224 -0
- package/skills/agent-teams/templates/team-summary.sh +210 -0
- package/src/cli.ts +4 -0
- package/src/platforms/discord/client.ts +3 -3
- package/src/platforms/discord/commands/auth.test.ts +48 -32
- package/src/platforms/discord/commands/channel.test.ts +54 -42
- package/src/platforms/discord/commands/file.test.ts +40 -53
- package/src/platforms/discord/commands/guild.test.ts +47 -27
- package/src/platforms/discord/commands/message.test.ts +54 -51
- package/src/platforms/discord/commands/reaction.test.ts +54 -42
- package/src/platforms/discord/commands/user.ts +12 -1
- package/src/platforms/discord/credential-manager.test.ts +137 -136
- package/src/platforms/discord/credential-manager.ts +20 -13
- package/src/platforms/discord/token-extractor.test.ts +133 -383
- package/{tests → src/platforms/slack}/cli.test.ts +3 -3
- package/{tests/slack-client.test.ts → src/platforms/slack/client.test.ts} +1 -1
- package/{tests → src/platforms/slack}/commands/auth.test.ts +25 -13
- package/{tests → src/platforms/slack}/commands/channel.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/file.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/message.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/reaction.test.ts +1 -1
- package/{tests → src/platforms/slack}/commands/snapshot.test.ts +117 -105
- package/{tests → src/platforms/slack}/commands/user.test.ts +3 -3
- package/{tests → src/platforms/slack}/commands/workspace.test.ts +44 -95
- package/{tests → src/platforms/slack}/credential-manager.test.ts +2 -2
- package/src/platforms/slack/credential-manager.ts +22 -7
- package/src/platforms/slack/token-extractor-node-test.ts +40 -0
- package/src/platforms/slack/token-extractor-node.test.ts +10 -0
- package/src/platforms/slack/token-extractor.ts +36 -10
- package/{tests → src/platforms/slack}/types.test.ts +1 -1
- package/src/platforms/teams/cli.ts +36 -0
- package/src/platforms/teams/client.test.ts +500 -0
- package/src/platforms/teams/client.ts +365 -0
- package/src/platforms/teams/commands/auth.test.ts +99 -0
- package/src/platforms/teams/commands/auth.ts +232 -0
- package/src/platforms/teams/commands/channel.test.ts +147 -0
- package/src/platforms/teams/commands/channel.ts +129 -0
- package/src/platforms/teams/commands/file.test.ts +88 -0
- package/src/platforms/teams/commands/file.ts +144 -0
- package/src/platforms/teams/commands/index.ts +12 -0
- package/src/platforms/teams/commands/message.test.ts +110 -0
- package/src/platforms/teams/commands/message.ts +188 -0
- package/src/platforms/teams/commands/reaction.test.ts +87 -0
- package/src/platforms/teams/commands/reaction.ts +104 -0
- package/src/platforms/teams/commands/snapshot.test.ts +35 -0
- package/src/platforms/teams/commands/snapshot.ts +115 -0
- package/src/platforms/teams/commands/team.test.ts +157 -0
- package/src/platforms/teams/commands/team.ts +164 -0
- package/src/platforms/teams/commands/user.test.ts +83 -0
- package/src/platforms/teams/commands/user.ts +112 -0
- package/src/platforms/teams/credential-manager.test.ts +178 -0
- package/src/platforms/teams/credential-manager.ts +92 -0
- package/src/platforms/teams/index.ts +5 -0
- package/src/platforms/teams/token-extractor.test.ts +429 -0
- package/src/platforms/teams/token-extractor.ts +462 -0
- package/src/platforms/teams/types.test.ts +226 -0
- package/src/platforms/teams/types.ts +140 -0
- package/tsconfig.json +1 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -3
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js +0 -140
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/channel.d.ts +0 -3
- package/dist/commands/channel.d.ts.map +0 -1
- package/dist/commands/channel.js +0 -118
- package/dist/commands/channel.js.map +0 -1
- package/dist/commands/file.d.ts +0 -3
- package/dist/commands/file.d.ts.map +0 -1
- package/dist/commands/file.js +0 -113
- package/dist/commands/file.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/message.d.ts +0 -3
- package/dist/commands/message.d.ts.map +0 -1
- package/dist/commands/message.js +0 -214
- package/dist/commands/message.js.map +0 -1
- package/dist/commands/reaction.d.ts +0 -3
- package/dist/commands/reaction.d.ts.map +0 -1
- package/dist/commands/reaction.js +0 -100
- package/dist/commands/reaction.js.map +0 -1
- package/dist/commands/snapshot.d.ts +0 -3
- package/dist/commands/snapshot.d.ts.map +0 -1
- package/dist/commands/snapshot.js +0 -88
- package/dist/commands/snapshot.js.map +0 -1
- package/dist/commands/user.d.ts.map +0 -1
- package/dist/commands/user.js +0 -96
- package/dist/commands/user.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -3
- package/dist/commands/workspace.d.ts.map +0 -1
- package/dist/commands/workspace.js +0 -89
- package/dist/commands/workspace.js.map +0 -1
- package/dist/lib/credential-manager.d.ts +0 -13
- package/dist/lib/credential-manager.d.ts.map +0 -1
- package/dist/lib/credential-manager.js +0 -58
- package/dist/lib/credential-manager.js.map +0 -1
- package/dist/lib/index.d.ts +0 -3
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -3
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/ref-manager.d.ts +0 -26
- package/dist/lib/ref-manager.d.ts.map +0 -1
- package/dist/lib/ref-manager.js +0 -92
- package/dist/lib/ref-manager.js.map +0 -1
- package/dist/lib/slack-client.d.ts +0 -37
- package/dist/lib/slack-client.d.ts.map +0 -1
- package/dist/lib/slack-client.js +0 -379
- package/dist/lib/slack-client.js.map +0 -1
- package/dist/lib/token-extractor.d.ts +0 -28
- package/dist/lib/token-extractor.d.ts.map +0 -1
- package/dist/lib/token-extractor.js +0 -401
- package/dist/lib/token-extractor.js.map +0 -1
- package/dist/src/platforms/discord/client.test.d.ts +0 -2
- package/dist/src/platforms/discord/client.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/client.test.js +0 -367
- package/dist/src/platforms/discord/client.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/auth.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/auth.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/auth.test.js +0 -65
- package/dist/src/platforms/discord/commands/auth.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/channel.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/channel.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/channel.test.js +0 -136
- package/dist/src/platforms/discord/commands/channel.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/file.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/file.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/file.test.js +0 -83
- package/dist/src/platforms/discord/commands/file.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/guild.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/guild.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/guild.test.js +0 -100
- package/dist/src/platforms/discord/commands/guild.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/message.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/message.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/message.test.js +0 -91
- package/dist/src/platforms/discord/commands/message.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/reaction.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/reaction.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/reaction.test.js +0 -115
- package/dist/src/platforms/discord/commands/reaction.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/snapshot.test.js +0 -25
- package/dist/src/platforms/discord/commands/snapshot.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/user.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/user.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/user.test.js +0 -103
- package/dist/src/platforms/discord/commands/user.test.js.map +0 -1
- package/dist/src/platforms/discord/credential-manager.test.d.ts +0 -2
- package/dist/src/platforms/discord/credential-manager.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/credential-manager.test.js +0 -136
- package/dist/src/platforms/discord/credential-manager.test.js.map +0 -1
- package/dist/src/platforms/discord/token-extractor.test.d.ts +0 -2
- package/dist/src/platforms/discord/token-extractor.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/token-extractor.test.js +0 -789
- package/dist/src/platforms/discord/token-extractor.test.js.map +0 -1
- package/dist/src/platforms/discord/types.test.d.ts +0 -2
- package/dist/src/platforms/discord/types.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/types.test.js +0 -211
- package/dist/src/platforms/discord/types.test.js.map +0 -1
- package/dist/src/shared/utils/concurrency.test.d.ts +0 -2
- package/dist/src/shared/utils/concurrency.test.d.ts.map +0 -1
- package/dist/src/shared/utils/concurrency.test.js +0 -39
- package/dist/src/shared/utils/concurrency.test.js.map +0 -1
- package/dist/tests/cli.test.d.ts +0 -2
- package/dist/tests/cli.test.d.ts.map +0 -1
- package/dist/tests/cli.test.js +0 -83
- package/dist/tests/cli.test.js.map +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/CURRENT +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOCK +0 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG +0 -3
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG.old +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/MANIFEST-000004 +0 -0
- package/dist/tests/commands/auth.test.d.ts +0 -2
- package/dist/tests/commands/auth.test.d.ts.map +0 -1
- package/dist/tests/commands/auth.test.js +0 -304
- package/dist/tests/commands/auth.test.js.map +0 -1
- package/dist/tests/commands/channel.test.d.ts +0 -2
- package/dist/tests/commands/channel.test.d.ts.map +0 -1
- package/dist/tests/commands/channel.test.js +0 -166
- package/dist/tests/commands/channel.test.js.map +0 -1
- package/dist/tests/commands/file.test.d.ts +0 -2
- package/dist/tests/commands/file.test.d.ts.map +0 -1
- package/dist/tests/commands/file.test.js +0 -175
- package/dist/tests/commands/file.test.js.map +0 -1
- package/dist/tests/commands/message.test.d.ts +0 -2
- package/dist/tests/commands/message.test.d.ts.map +0 -1
- package/dist/tests/commands/message.test.js +0 -293
- package/dist/tests/commands/message.test.js.map +0 -1
- package/dist/tests/commands/reaction.test.d.ts +0 -2
- package/dist/tests/commands/reaction.test.d.ts.map +0 -1
- package/dist/tests/commands/reaction.test.js +0 -84
- package/dist/tests/commands/reaction.test.js.map +0 -1
- package/dist/tests/commands/snapshot.test.d.ts +0 -2
- package/dist/tests/commands/snapshot.test.d.ts.map +0 -1
- package/dist/tests/commands/snapshot.test.js +0 -280
- package/dist/tests/commands/snapshot.test.js.map +0 -1
- package/dist/tests/commands/user.test.d.ts +0 -2
- package/dist/tests/commands/user.test.d.ts.map +0 -1
- package/dist/tests/commands/user.test.js +0 -117
- package/dist/tests/commands/user.test.js.map +0 -1
- package/dist/tests/commands/workspace.test.d.ts +0 -2
- package/dist/tests/commands/workspace.test.d.ts.map +0 -1
- package/dist/tests/commands/workspace.test.js +0 -453
- package/dist/tests/commands/workspace.test.js.map +0 -1
- package/dist/tests/credential-manager.test.d.ts +0 -2
- package/dist/tests/credential-manager.test.d.ts.map +0 -1
- package/dist/tests/credential-manager.test.js +0 -199
- package/dist/tests/credential-manager.test.js.map +0 -1
- package/dist/tests/slack-client.test.d.ts +0 -2
- package/dist/tests/slack-client.test.d.ts.map +0 -1
- package/dist/tests/slack-client.test.js +0 -741
- package/dist/tests/slack-client.test.js.map +0 -1
- package/dist/tests/types.test.d.ts +0 -2
- package/dist/tests/types.test.d.ts.map +0 -1
- package/dist/tests/types.test.js +0 -215
- package/dist/tests/types.test.js.map +0 -1
- package/dist/types/index.d.ts +0 -369
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -92
- package/dist/types/index.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -2
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -5
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/output.d.ts +0 -2
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -4
- package/dist/utils/output.js.map +0 -1
- /package/dist/{cli.d.ts → src/platforms/teams/cli.d.ts} +0 -0
- /package/dist/{commands → src/platforms/teams/commands}/user.d.ts +0 -0
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import { afterAll, beforeEach, describe, expect, mock, test } from 'bun:test';
|
|
2
|
-
import { mkdirSync, rmSync } from 'node:fs';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import { CredentialManager } from '../../src/platforms/slack/credential-manager';
|
|
6
|
-
import { TokenExtractor } from '../../src/platforms/slack/token-extractor';
|
|
7
|
-
const testConfigDir = join(import.meta.dir, '.test-auth-config');
|
|
8
|
-
const testSlackDir = join(import.meta.dir, '.test-slack-data');
|
|
9
|
-
describe('TokenExtractor', () => {
|
|
10
|
-
let extractor;
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
rmSync(testSlackDir, { recursive: true, force: true });
|
|
13
|
-
mkdirSync(testSlackDir, { recursive: true });
|
|
14
|
-
});
|
|
15
|
-
afterAll(() => {
|
|
16
|
-
rmSync(testSlackDir, { recursive: true, force: true });
|
|
17
|
-
});
|
|
18
|
-
describe('getSlackDir', () => {
|
|
19
|
-
test('returns correct path for darwin', () => {
|
|
20
|
-
// Given: Platform is darwin
|
|
21
|
-
extractor = new TokenExtractor('darwin');
|
|
22
|
-
// When: getSlackDir is called
|
|
23
|
-
const dir = extractor.getSlackDir();
|
|
24
|
-
// Then: Should return macOS path (direct or sandboxed depending on what exists)
|
|
25
|
-
const directPath = join(homedir(), 'Library', 'Application Support', 'Slack');
|
|
26
|
-
const sandboxedPath = join(homedir(), 'Library', 'Containers', 'com.tinyspeck.slackmacgap', 'Data', 'Library', 'Application Support', 'Slack');
|
|
27
|
-
expect([directPath, sandboxedPath]).toContain(dir);
|
|
28
|
-
});
|
|
29
|
-
test('returns correct path for linux', () => {
|
|
30
|
-
// Given: Platform is linux
|
|
31
|
-
extractor = new TokenExtractor('linux');
|
|
32
|
-
// When: getSlackDir is called
|
|
33
|
-
const dir = extractor.getSlackDir();
|
|
34
|
-
// Then: Should return Linux path
|
|
35
|
-
expect(dir).toBe(join(homedir(), '.config', 'Slack'));
|
|
36
|
-
});
|
|
37
|
-
test('returns correct path for win32', () => {
|
|
38
|
-
// Given: Platform is win32
|
|
39
|
-
extractor = new TokenExtractor('win32');
|
|
40
|
-
// When: getSlackDir is called
|
|
41
|
-
const dir = extractor.getSlackDir();
|
|
42
|
-
// Then: Should return Windows path
|
|
43
|
-
expect(dir).toContain('Slack');
|
|
44
|
-
});
|
|
45
|
-
test('throws error for unsupported platform', () => {
|
|
46
|
-
// Given: Platform is unsupported
|
|
47
|
-
// When/Then: Constructor should throw
|
|
48
|
-
expect(() => new TokenExtractor('freebsd')).toThrow('Unsupported platform');
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('extract', () => {
|
|
52
|
-
test('throws error when Slack directory does not exist', async () => {
|
|
53
|
-
// Given: Slack directory does not exist
|
|
54
|
-
extractor = new TokenExtractor('darwin', '/nonexistent/path');
|
|
55
|
-
// When/Then: extract should throw
|
|
56
|
-
await expect(extractor.extract()).rejects.toThrow('Slack directory not found');
|
|
57
|
-
});
|
|
58
|
-
test('returns empty array when no tokens found', async () => {
|
|
59
|
-
// Given: Slack directory exists but has no tokens
|
|
60
|
-
mkdirSync(join(testSlackDir, 'storage'), { recursive: true });
|
|
61
|
-
extractor = new TokenExtractor('darwin', testSlackDir);
|
|
62
|
-
// When: extract is called
|
|
63
|
-
const result = await extractor.extract();
|
|
64
|
-
// Then: Should return empty array
|
|
65
|
-
expect(result).toEqual([]);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
describe('extractTokensFromLevelDB', () => {
|
|
69
|
-
test('extracts xoxc tokens from LevelDB', async () => {
|
|
70
|
-
// Given: LevelDB with xoxc token data
|
|
71
|
-
// This test requires mocking LevelDB - we'll test the integration
|
|
72
|
-
extractor = new TokenExtractor('darwin', testSlackDir);
|
|
73
|
-
// When: extractTokensFromLevelDB is called
|
|
74
|
-
// Then: Should extract tokens (mocked in integration test)
|
|
75
|
-
expect(extractor).toBeDefined();
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
describe('extractCookieFromSQLite', () => {
|
|
79
|
-
test('extracts xoxd cookie from SQLite', async () => {
|
|
80
|
-
// Given: SQLite Cookies database with d cookie
|
|
81
|
-
// This test requires mocking SQLite - we'll test the integration
|
|
82
|
-
extractor = new TokenExtractor('darwin', testSlackDir);
|
|
83
|
-
// When: extractCookieFromSQLite is called
|
|
84
|
-
// Then: Should extract cookie (mocked in integration test)
|
|
85
|
-
expect(extractor).toBeDefined();
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
describe('Auth Commands Integration', () => {
|
|
90
|
-
let credManager;
|
|
91
|
-
beforeEach(() => {
|
|
92
|
-
rmSync(testConfigDir, { recursive: true, force: true });
|
|
93
|
-
credManager = new CredentialManager(testConfigDir);
|
|
94
|
-
});
|
|
95
|
-
afterAll(() => {
|
|
96
|
-
rmSync(testConfigDir, { recursive: true, force: true });
|
|
97
|
-
});
|
|
98
|
-
describe('auth extract', () => {
|
|
99
|
-
test('stores extracted workspaces in credential manager', async () => {
|
|
100
|
-
// Given: Extracted workspaces
|
|
101
|
-
const workspaces = [
|
|
102
|
-
{
|
|
103
|
-
workspace_id: 'T123',
|
|
104
|
-
workspace_name: 'acme-corp',
|
|
105
|
-
token: 'xoxc-123-456',
|
|
106
|
-
cookie: 'xoxd-abc',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
workspace_id: 'T456',
|
|
110
|
-
workspace_name: 'side-project',
|
|
111
|
-
token: 'xoxc-789-012',
|
|
112
|
-
cookie: 'xoxd-def',
|
|
113
|
-
},
|
|
114
|
-
];
|
|
115
|
-
// When: Workspaces are stored
|
|
116
|
-
for (const ws of workspaces) {
|
|
117
|
-
await credManager.setWorkspace(ws);
|
|
118
|
-
}
|
|
119
|
-
await credManager.setCurrentWorkspace('T123');
|
|
120
|
-
// Then: All workspaces should be retrievable
|
|
121
|
-
const config = await credManager.load();
|
|
122
|
-
expect(Object.keys(config.workspaces)).toHaveLength(2);
|
|
123
|
-
expect(config.current_workspace).toBe('T123');
|
|
124
|
-
expect(config.workspaces.T123.token).toBe('xoxc-123-456');
|
|
125
|
-
expect(config.workspaces.T456.token).toBe('xoxc-789-012');
|
|
126
|
-
});
|
|
127
|
-
test('sets first workspace as current if none exists', async () => {
|
|
128
|
-
// Given: No current workspace
|
|
129
|
-
const workspace = {
|
|
130
|
-
workspace_id: 'T789',
|
|
131
|
-
workspace_name: 'new-workspace',
|
|
132
|
-
token: 'xoxc-new',
|
|
133
|
-
cookie: 'xoxd-new',
|
|
134
|
-
};
|
|
135
|
-
// When: First workspace is stored
|
|
136
|
-
await credManager.setWorkspace(workspace);
|
|
137
|
-
const config = await credManager.load();
|
|
138
|
-
// Then: If no current, should set first as current
|
|
139
|
-
if (!config.current_workspace) {
|
|
140
|
-
await credManager.setCurrentWorkspace('T789');
|
|
141
|
-
}
|
|
142
|
-
const updated = await credManager.load();
|
|
143
|
-
expect(updated.current_workspace).toBe('T789');
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
describe('auth logout', () => {
|
|
147
|
-
test('removes workspace by id', async () => {
|
|
148
|
-
// Given: A workspace exists
|
|
149
|
-
await credManager.setWorkspace({
|
|
150
|
-
workspace_id: 'T-logout',
|
|
151
|
-
workspace_name: 'to-logout',
|
|
152
|
-
token: 'xoxc-logout',
|
|
153
|
-
cookie: 'xoxd-logout',
|
|
154
|
-
});
|
|
155
|
-
// When: Workspace is removed
|
|
156
|
-
await credManager.removeWorkspace('T-logout');
|
|
157
|
-
// Then: Workspace should not exist
|
|
158
|
-
const ws = await credManager.getWorkspace('T-logout');
|
|
159
|
-
expect(ws).toBeNull();
|
|
160
|
-
});
|
|
161
|
-
test('removes current workspace and clears current', async () => {
|
|
162
|
-
// Given: Current workspace is set
|
|
163
|
-
await credManager.setWorkspace({
|
|
164
|
-
workspace_id: 'T-current',
|
|
165
|
-
workspace_name: 'current',
|
|
166
|
-
token: 'xoxc-current',
|
|
167
|
-
cookie: 'xoxd-current',
|
|
168
|
-
});
|
|
169
|
-
await credManager.setCurrentWorkspace('T-current');
|
|
170
|
-
// When: Current workspace is removed
|
|
171
|
-
await credManager.removeWorkspace('T-current');
|
|
172
|
-
// Then: Current should be null
|
|
173
|
-
const config = await credManager.load();
|
|
174
|
-
expect(config.current_workspace).toBeNull();
|
|
175
|
-
});
|
|
176
|
-
test('throws error when workspace not found', async () => {
|
|
177
|
-
// Given: Workspace does not exist
|
|
178
|
-
// When: Trying to get non-existent workspace
|
|
179
|
-
const ws = await credManager.getWorkspace('nonexistent');
|
|
180
|
-
// Then: Should return null (command should handle this)
|
|
181
|
-
expect(ws).toBeNull();
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
describe('auth status', () => {
|
|
185
|
-
test('returns current workspace info', async () => {
|
|
186
|
-
// Given: A current workspace is set
|
|
187
|
-
await credManager.setWorkspace({
|
|
188
|
-
workspace_id: 'T-status',
|
|
189
|
-
workspace_name: 'status-test',
|
|
190
|
-
token: 'xoxc-status',
|
|
191
|
-
cookie: 'xoxd-status',
|
|
192
|
-
});
|
|
193
|
-
await credManager.setCurrentWorkspace('T-status');
|
|
194
|
-
// When: Getting current workspace
|
|
195
|
-
const ws = await credManager.getWorkspace();
|
|
196
|
-
// Then: Should return workspace info
|
|
197
|
-
expect(ws).not.toBeNull();
|
|
198
|
-
expect(ws?.workspace_id).toBe('T-status');
|
|
199
|
-
expect(ws?.workspace_name).toBe('status-test');
|
|
200
|
-
});
|
|
201
|
-
test('returns null when no workspace configured', async () => {
|
|
202
|
-
// Given: No workspace configured
|
|
203
|
-
// When: Getting current workspace
|
|
204
|
-
const ws = await credManager.getWorkspace();
|
|
205
|
-
// Then: Should return null
|
|
206
|
-
expect(ws).toBeNull();
|
|
207
|
-
});
|
|
208
|
-
test('validates token with Slack API', async () => {
|
|
209
|
-
// Given: A workspace with valid credentials
|
|
210
|
-
// This would require mocking SlackClient.testAuth()
|
|
211
|
-
// We test the integration pattern here
|
|
212
|
-
const mockTestAuth = mock(() => Promise.resolve({
|
|
213
|
-
user_id: 'U123',
|
|
214
|
-
team_id: 'T123',
|
|
215
|
-
user: 'testuser',
|
|
216
|
-
team: 'Test Team',
|
|
217
|
-
}));
|
|
218
|
-
// When: testAuth is called
|
|
219
|
-
const result = await mockTestAuth();
|
|
220
|
-
// Then: Should return auth info
|
|
221
|
-
expect(result.user_id).toBe('U123');
|
|
222
|
-
expect(result.team_id).toBe('T123');
|
|
223
|
-
expect(result.user).toBe('testuser');
|
|
224
|
-
expect(result.team).toBe('Test Team');
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
describe('Platform Detection', () => {
|
|
229
|
-
test('auto-detects current platform', () => {
|
|
230
|
-
// Given: Running on current platform
|
|
231
|
-
const platform = process.platform;
|
|
232
|
-
// When: TokenExtractor is created without explicit platform
|
|
233
|
-
const _extractor = new TokenExtractor();
|
|
234
|
-
// Then: Should use current platform
|
|
235
|
-
expect(['darwin', 'linux', 'win32']).toContain(platform);
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
describe('Output Formatting', () => {
|
|
239
|
-
test('formats extract output correctly', () => {
|
|
240
|
-
// Given: Extracted workspaces
|
|
241
|
-
const output = {
|
|
242
|
-
workspaces: ['T123/acme-corp', 'T456/side-project'],
|
|
243
|
-
current: 'T123',
|
|
244
|
-
};
|
|
245
|
-
// When: Formatted as JSON
|
|
246
|
-
const json = JSON.stringify(output);
|
|
247
|
-
const pretty = JSON.stringify(output, null, 2);
|
|
248
|
-
// Then: Should be valid JSON
|
|
249
|
-
expect(JSON.parse(json)).toEqual(output);
|
|
250
|
-
expect(pretty).toContain('\n');
|
|
251
|
-
});
|
|
252
|
-
test('formats status output correctly', () => {
|
|
253
|
-
// Given: Status info
|
|
254
|
-
const output = {
|
|
255
|
-
workspace_id: 'T123',
|
|
256
|
-
workspace_name: 'acme-corp',
|
|
257
|
-
user: 'testuser',
|
|
258
|
-
team: 'Acme Corp',
|
|
259
|
-
valid: true,
|
|
260
|
-
};
|
|
261
|
-
// When: Formatted as JSON
|
|
262
|
-
const json = JSON.stringify(output);
|
|
263
|
-
// Then: Should be valid JSON
|
|
264
|
-
expect(JSON.parse(json)).toEqual(output);
|
|
265
|
-
});
|
|
266
|
-
test('formats logout output correctly', () => {
|
|
267
|
-
// Given: Logout result
|
|
268
|
-
const output = {
|
|
269
|
-
removed: 'T123',
|
|
270
|
-
success: true,
|
|
271
|
-
};
|
|
272
|
-
// When: Formatted as JSON
|
|
273
|
-
const json = JSON.stringify(output);
|
|
274
|
-
// Then: Should be valid JSON
|
|
275
|
-
expect(JSON.parse(json)).toEqual(output);
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
describe('Error Handling', () => {
|
|
279
|
-
test('handles missing Slack installation gracefully', async () => {
|
|
280
|
-
// Given: Slack is not installed
|
|
281
|
-
const extractor = new TokenExtractor('darwin', '/nonexistent/slack');
|
|
282
|
-
// When/Then: Should throw descriptive error
|
|
283
|
-
await expect(extractor.extract()).rejects.toThrow('Slack directory not found');
|
|
284
|
-
});
|
|
285
|
-
test('handles corrupted LevelDB gracefully', async () => {
|
|
286
|
-
// Given: Corrupted LevelDB
|
|
287
|
-
// This would require creating a corrupted LevelDB file
|
|
288
|
-
// We test that the extractor handles errors gracefully
|
|
289
|
-
const extractor = new TokenExtractor('darwin', testSlackDir);
|
|
290
|
-
// When: Trying to extract from non-existent storage
|
|
291
|
-
// Then: Should handle gracefully (return empty or throw)
|
|
292
|
-
await expect(extractor.extract()).rejects.toThrow();
|
|
293
|
-
});
|
|
294
|
-
test('handles missing Cookies database gracefully', async () => {
|
|
295
|
-
// Given: No Cookies database
|
|
296
|
-
mkdirSync(join(testSlackDir, 'storage'), { recursive: true });
|
|
297
|
-
const extractor = new TokenExtractor('darwin', testSlackDir);
|
|
298
|
-
// When: Trying to extract
|
|
299
|
-
const result = await extractor.extract();
|
|
300
|
-
// Then: Should return empty array (no tokens found)
|
|
301
|
-
expect(result).toEqual([]);
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
//# sourceMappingURL=auth.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.test.js","sourceRoot":"","sources":["../../../tests/commands/auth.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,I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AAA;IAEF,IAAI,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACtD,2BAA2B;QAC3B,uDAAuD;QACvD,uDAAuD;QACvD,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAE5D,oDAAoD;QACpD,yDAAyD;QACzD,MAAM,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC7D,6BAA6B;QAC7B,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC7D,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAE5D,0BAA0B;QAC1B,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE,CAAA;QAExC,oDAAoD;QACpD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channel.test.d.ts","sourceRoot":"","sources":["../../../tests/commands/channel.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, mock, test } from 'bun:test';
|
|
2
|
-
describe('Channel Commands', () => {
|
|
3
|
-
let mockClient;
|
|
4
|
-
beforeEach(() => {
|
|
5
|
-
// Mock SlackClient
|
|
6
|
-
mockClient = {
|
|
7
|
-
listChannels: mock(async () => [
|
|
8
|
-
{
|
|
9
|
-
id: 'C001',
|
|
10
|
-
name: 'general',
|
|
11
|
-
is_private: false,
|
|
12
|
-
is_archived: false,
|
|
13
|
-
created: 1234567890,
|
|
14
|
-
creator: 'U001',
|
|
15
|
-
topic: {
|
|
16
|
-
value: 'General discussion',
|
|
17
|
-
creator: 'U001',
|
|
18
|
-
last_set: 1234567890,
|
|
19
|
-
},
|
|
20
|
-
purpose: {
|
|
21
|
-
value: 'General channel',
|
|
22
|
-
creator: 'U001',
|
|
23
|
-
last_set: 1234567890,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
id: 'C002',
|
|
28
|
-
name: 'private-team',
|
|
29
|
-
is_private: true,
|
|
30
|
-
is_archived: false,
|
|
31
|
-
created: 1234567891,
|
|
32
|
-
creator: 'U002',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: 'C003',
|
|
36
|
-
name: 'archived-channel',
|
|
37
|
-
is_private: false,
|
|
38
|
-
is_archived: true,
|
|
39
|
-
created: 1234567892,
|
|
40
|
-
creator: 'U003',
|
|
41
|
-
},
|
|
42
|
-
]),
|
|
43
|
-
getChannel: mock(async (id) => {
|
|
44
|
-
const channels = {
|
|
45
|
-
C001: {
|
|
46
|
-
id: 'C001',
|
|
47
|
-
name: 'general',
|
|
48
|
-
is_private: false,
|
|
49
|
-
is_archived: false,
|
|
50
|
-
created: 1234567890,
|
|
51
|
-
creator: 'U001',
|
|
52
|
-
topic: {
|
|
53
|
-
value: 'General discussion',
|
|
54
|
-
creator: 'U001',
|
|
55
|
-
last_set: 1234567890,
|
|
56
|
-
},
|
|
57
|
-
purpose: {
|
|
58
|
-
value: 'General channel',
|
|
59
|
-
creator: 'U001',
|
|
60
|
-
last_set: 1234567890,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
C002: {
|
|
64
|
-
id: 'C002',
|
|
65
|
-
name: 'private-team',
|
|
66
|
-
is_private: true,
|
|
67
|
-
is_archived: false,
|
|
68
|
-
created: 1234567891,
|
|
69
|
-
creator: 'U002',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
if (!channels[id]) {
|
|
73
|
-
throw new Error(`Channel not found: ${id}`);
|
|
74
|
-
}
|
|
75
|
-
return channels[id];
|
|
76
|
-
}),
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
describe('channel list', () => {
|
|
80
|
-
test('lists all channels', async () => {
|
|
81
|
-
// Given: SlackClient returns channels
|
|
82
|
-
// When: Listing channels
|
|
83
|
-
const channels = await mockClient.listChannels();
|
|
84
|
-
// Then: Should return channels
|
|
85
|
-
expect(channels).toHaveLength(3);
|
|
86
|
-
expect(channels[0].name).toBe('general');
|
|
87
|
-
expect(channels[1].name).toBe('private-team');
|
|
88
|
-
expect(channels[2].name).toBe('archived-channel');
|
|
89
|
-
});
|
|
90
|
-
test('excludes archived channels by default', async () => {
|
|
91
|
-
// Given: SlackClient returns channels including archived
|
|
92
|
-
const channels = await mockClient.listChannels();
|
|
93
|
-
// When: Filtering out archived (default behavior)
|
|
94
|
-
const activeChannels = channels.filter((c) => !c.is_archived);
|
|
95
|
-
// Then: Should exclude archived channels
|
|
96
|
-
expect(activeChannels).toHaveLength(2);
|
|
97
|
-
expect(activeChannels.every((c) => !c.is_archived)).toBe(true);
|
|
98
|
-
});
|
|
99
|
-
test('includes archived channels when requested', async () => {
|
|
100
|
-
// Given: SlackClient returns channels including archived
|
|
101
|
-
const channels = await mockClient.listChannels();
|
|
102
|
-
// When: Including archived (--include-archived)
|
|
103
|
-
// Then: Should include all channels
|
|
104
|
-
expect(channels).toHaveLength(3);
|
|
105
|
-
expect(channels.some((c) => c.is_archived)).toBe(true);
|
|
106
|
-
});
|
|
107
|
-
test('filters channels by type=public', async () => {
|
|
108
|
-
// Given: SlackClient returns mixed channels
|
|
109
|
-
// When: Filtering by public type
|
|
110
|
-
const channels = await mockClient.listChannels();
|
|
111
|
-
const publicChannels = channels.filter((c) => !c.is_private);
|
|
112
|
-
// Then: Should return only public channels
|
|
113
|
-
expect(publicChannels).toHaveLength(2);
|
|
114
|
-
expect(publicChannels.every((c) => !c.is_private)).toBe(true);
|
|
115
|
-
});
|
|
116
|
-
test('filters channels by type=private', async () => {
|
|
117
|
-
// Given: SlackClient returns mixed channels
|
|
118
|
-
// When: Filtering by private type
|
|
119
|
-
const channels = await mockClient.listChannels();
|
|
120
|
-
const privateChannels = channels.filter((c) => c.is_private);
|
|
121
|
-
// Then: Should return only private channels
|
|
122
|
-
expect(privateChannels).toHaveLength(1);
|
|
123
|
-
expect(privateChannels[0].name).toBe('private-team');
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
describe('channel info', () => {
|
|
127
|
-
test('gets channel by ID', async () => {
|
|
128
|
-
// Given: Channel ID C001
|
|
129
|
-
// When: Getting channel info
|
|
130
|
-
const channel = await mockClient.getChannel('C001');
|
|
131
|
-
// Then: Should return channel details
|
|
132
|
-
expect(channel.id).toBe('C001');
|
|
133
|
-
expect(channel.name).toBe('general');
|
|
134
|
-
expect(channel.is_private).toBe(false);
|
|
135
|
-
});
|
|
136
|
-
test('throws error for non-existent channel', async () => {
|
|
137
|
-
// Given: Non-existent channel ID
|
|
138
|
-
// When: Getting channel info
|
|
139
|
-
// Then: Should throw error
|
|
140
|
-
try {
|
|
141
|
-
await mockClient.getChannel('C999');
|
|
142
|
-
expect.unreachable();
|
|
143
|
-
}
|
|
144
|
-
catch (error) {
|
|
145
|
-
expect(error.message).toContain('Channel not found');
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
test('returns channel with topic and purpose', async () => {
|
|
149
|
-
// Given: Channel with topic and purpose
|
|
150
|
-
// When: Getting channel info
|
|
151
|
-
const channel = await mockClient.getChannel('C001');
|
|
152
|
-
// Then: Should include topic and purpose
|
|
153
|
-
expect(channel.topic?.value).toBe('General discussion');
|
|
154
|
-
expect(channel.purpose?.value).toBe('General channel');
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
describe('channel history (alias for message list)', () => {
|
|
158
|
-
test('history command should be alias for message list', () => {
|
|
159
|
-
// Given: channel history command
|
|
160
|
-
// When: Checking command structure
|
|
161
|
-
// Then: Should be alias for message list
|
|
162
|
-
expect(true).toBe(true);
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
//# sourceMappingURL=channel.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channel.test.js","sourceRoot":"","sources":["../../../tests/commands/channel.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAInE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,UAAuB,CAAA;IAE3B,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB;QACnB,UAAU,GAAG;YACX,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC7B;oBACE,EAAE,EAAE,MAAM;oBACV,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,KAAK;oBACjB,WAAW,EAAE,KAAK;oBAClB,OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE,MAAM;oBACf,KAAK,EAAE;wBACL,KAAK,EAAE,oBAAoB;wBAC3B,OAAO,EAAE,MAAM;wBACf,QAAQ,EAAE,UAAU;qBACrB;oBACD,OAAO,EAAE;wBACP,KAAK,EAAE,iBAAiB;wBACxB,OAAO,EAAE,MAAM;wBACf,QAAQ,EAAE,UAAU;qBACrB;iBACF;gBACD;oBACE,EAAE,EAAE,MAAM;oBACV,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE,IAAI;oBAChB,WAAW,EAAE,KAAK;oBAClB,OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE,MAAM;iBAChB;gBACD;oBACE,EAAE,EAAE,MAAM;oBACV,IAAI,EAAE,kBAAkB;oBACxB,UAAU,EAAE,KAAK;oBACjB,WAAW,EAAE,IAAI;oBACjB,OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE,MAAM;iBAChB;aACF,CAAC;YACF,UAAU,EAAE,IAAI,CAAC,KAAK,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