@niradler55/earshot 0.0.2 → 0.0.3
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/README.md +2 -1
- package/dist/cli.js +11 -0
- package/dist/extract.d.ts +1 -0
- package/dist/extract.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,7 +46,8 @@ On **macOS**, if `SLACK_XOXC` / `SLACK_XOXD` aren't set, earshot pulls them auto
|
|
|
46
46
|
Print the session for your shell or another tool:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
bun run token # -> export SLACK_XOXC='…' export SLACK_XOXD='…'
|
|
49
|
+
bun run token # from source -> export SLACK_XOXC='…' export SLACK_XOXD='…'
|
|
50
|
+
bunx @niradler55/earshot token # from the published package (macOS)
|
|
50
51
|
eval "$(bun run token)"
|
|
51
52
|
```
|
|
52
53
|
|
package/dist/cli.js
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
import { resolveSession } from "./extract.js";
|
|
3
3
|
import { listen } from "./gateway.js";
|
|
4
4
|
import { deliver, parseHeaders } from "./webhook.js";
|
|
5
|
+
if (process.argv[2] === "token") {
|
|
6
|
+
const { printSession } = await import("./extract.js");
|
|
7
|
+
try {
|
|
8
|
+
printSession();
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
console.error(`[earshot] ${error instanceof Error ? error.message : error}`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
5
16
|
let token;
|
|
6
17
|
let cookie;
|
|
7
18
|
try {
|
package/dist/extract.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export declare function pickXoxc(blobs: string[]): string | undefined;
|
|
|
6
6
|
export declare function cleanCookie(decrypted: Uint8Array): string;
|
|
7
7
|
export declare function extractFromDesktop(): Session;
|
|
8
8
|
export declare function resolveSession(): Session;
|
|
9
|
+
export declare function printSession(): void;
|
package/dist/extract.js
CHANGED
|
@@ -92,7 +92,9 @@ export function resolveSession() {
|
|
|
92
92
|
const fromApp = extractFromDesktop();
|
|
93
93
|
return { token: token || fromApp.token, cookie: cookie || fromApp.cookie };
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
export function printSession() {
|
|
96
96
|
const { token, cookie } = extractFromDesktop();
|
|
97
97
|
process.stdout.write(`export SLACK_XOXC='${token}'\nexport SLACK_XOXD='${cookie}'\n`);
|
|
98
98
|
}
|
|
99
|
+
if (import.meta.main)
|
|
100
|
+
printSession();
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niradler55/earshot",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Real-time Slack message events over your own session — no app, no polling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"earshot": "
|
|
7
|
+
"earshot": "dist/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|