@hooklink/cli 0.1.44 → 0.1.46
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 +6 -6
- package/dist/commands/connect.js +2 -2
- package/dist/commands/login.js +3 -3
- package/dist/commands/update.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/sentry.d.ts.map +1 -1
- package/dist/utils/sentry.js +32 -7
- package/dist/utils/sentry.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hooklink CLI
|
|
2
2
|
|
|
3
3
|
Forward webhooks to your local development machine via WebSocket tunnel.
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ npm install -g @hooklink/cli
|
|
|
29
29
|
|
|
30
30
|
### `hooklink login`
|
|
31
31
|
|
|
32
|
-
Authenticate with your
|
|
32
|
+
Authenticate with your Hooklink API key.
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
# Interactive prompt
|
|
@@ -49,7 +49,7 @@ hooklink logout
|
|
|
49
49
|
|
|
50
50
|
### `hooklink connect [endpoint]`
|
|
51
51
|
|
|
52
|
-
Connect to
|
|
52
|
+
Connect to Hooklink and forward webhooks to your local server.
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
# Connect to specific endpoint
|
|
@@ -130,7 +130,7 @@ hooklink config --reset
|
|
|
130
130
|
Configuration is stored in `~/.config/hooklink/config.json` (or OS-specific config directory).
|
|
131
131
|
|
|
132
132
|
**Available configuration keys:**
|
|
133
|
-
- `apiKey` - Your
|
|
133
|
+
- `apiKey` - Your Hooklink API key (use `hooklink login` instead)
|
|
134
134
|
- `apiUrl` - API base URL (default: https://api.hooklink.net)
|
|
135
135
|
- `wsUrl` - WebSocket server URL (default: wss://ws.hooklink.net/ws)
|
|
136
136
|
- `defaultEndpoint` - Default endpoint keyword to connect to
|
|
@@ -138,11 +138,11 @@ Configuration is stored in `~/.config/hooklink/config.json` (or OS-specific conf
|
|
|
138
138
|
|
|
139
139
|
## How It Works
|
|
140
140
|
|
|
141
|
-
1. The CLI establishes a WebSocket connection to the
|
|
141
|
+
1. The CLI establishes a WebSocket connection to the Hooklink server
|
|
142
142
|
2. When a webhook arrives at your public URL, the server forwards it through the WebSocket
|
|
143
143
|
3. The CLI receives the webhook and forwards it to your local server
|
|
144
144
|
4. The response from your local server is sent back through the WebSocket
|
|
145
|
-
5.
|
|
145
|
+
5. Hooklink returns the response to the original webhook sender
|
|
146
146
|
|
|
147
147
|
## Troubleshooting
|
|
148
148
|
|
package/dist/commands/connect.js
CHANGED
|
@@ -62,7 +62,7 @@ function detectMessageType(request) {
|
|
|
62
62
|
return 'request';
|
|
63
63
|
}
|
|
64
64
|
exports.connectCommand = new commander_1.Command('connect')
|
|
65
|
-
.description('Connect to
|
|
65
|
+
.description('Connect to Hooklink and forward webhooks to local server')
|
|
66
66
|
.argument('[endpoint]', 'Endpoint keyword to connect to')
|
|
67
67
|
.option('-t, --target <url>', 'Override local target URL (uses endpoint\'s configured URL by default)')
|
|
68
68
|
.option('-p, --port <port>', 'Override local port (alternative to --target)', parseInt)
|
|
@@ -73,7 +73,7 @@ exports.connectCommand = new commander_1.Command('connect')
|
|
|
73
73
|
if (!apiKey) {
|
|
74
74
|
// Welcome message
|
|
75
75
|
logger_1.Logger.log('');
|
|
76
|
-
logger_1.Logger.log(chalk_1.default.cyan.bold('👋 Welcome to
|
|
76
|
+
logger_1.Logger.log(chalk_1.default.cyan.bold('👋 Welcome to Hooklink!'));
|
|
77
77
|
logger_1.Logger.log('');
|
|
78
78
|
logger_1.Logger.log('To get started, you\'ll need an API key.');
|
|
79
79
|
logger_1.Logger.log(chalk_1.default.gray('You can create one at: ') + chalk_1.default.cyan('https://hooklink.net/dashboard/keys'));
|
package/dist/commands/login.js
CHANGED
|
@@ -13,7 +13,7 @@ const api_1 = require("../utils/api");
|
|
|
13
13
|
const logger_1 = require("../utils/logger");
|
|
14
14
|
const sentry_1 = require("../utils/sentry");
|
|
15
15
|
exports.loginCommand = new commander_1.Command('login')
|
|
16
|
-
.description('Authenticate with your
|
|
16
|
+
.description('Authenticate with your Hooklink API key')
|
|
17
17
|
.option('-k, --key <key>', 'API key')
|
|
18
18
|
.action(async (options) => {
|
|
19
19
|
let apiKey = options.key;
|
|
@@ -21,7 +21,7 @@ exports.loginCommand = new commander_1.Command('login')
|
|
|
21
21
|
if (!apiKey) {
|
|
22
22
|
// Welcome message
|
|
23
23
|
logger_1.Logger.log('');
|
|
24
|
-
logger_1.Logger.log(chalk_1.default.cyan.bold('👋 Welcome to
|
|
24
|
+
logger_1.Logger.log(chalk_1.default.cyan.bold('👋 Welcome to Hooklink!'));
|
|
25
25
|
logger_1.Logger.log('');
|
|
26
26
|
logger_1.Logger.log('To authenticate, you\'ll need an API key.');
|
|
27
27
|
logger_1.Logger.log(chalk_1.default.gray('Create one at: ') + chalk_1.default.cyan('https://hooklink.net/dashboard/keys'));
|
|
@@ -72,7 +72,7 @@ exports.loginCommand = new commander_1.Command('login')
|
|
|
72
72
|
logger_1.Logger.log(` ${chalk_1.default.cyan('hooklink endpoints')} ${chalk_1.default.gray('- List your endpoints')}`);
|
|
73
73
|
logger_1.Logger.log(` ${chalk_1.default.cyan('hooklink status')} ${chalk_1.default.gray('- View your account info')}`);
|
|
74
74
|
logger_1.Logger.log('');
|
|
75
|
-
logger_1.Logger.log(chalk_1.default.gray('Telemetry: Anonymous crash reports are sent to improve
|
|
75
|
+
logger_1.Logger.log(chalk_1.default.gray('Telemetry: Anonymous crash reports are sent to improve Hooklink.'));
|
|
76
76
|
logger_1.Logger.log(chalk_1.default.gray(`Opt out anytime: ${chalk_1.default.cyan('hooklink config --set telemetry=false')}`));
|
|
77
77
|
logger_1.Logger.log('');
|
|
78
78
|
}
|
package/dist/commands/update.js
CHANGED
|
@@ -34,7 +34,7 @@ function fetchLatestVersion() {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
exports.updateCommand = new commander_1.Command('update')
|
|
37
|
-
.description('Update
|
|
37
|
+
.description('Update Hooklink CLI to the latest version')
|
|
38
38
|
.action(async () => {
|
|
39
39
|
const currentVersion = package_json_1.default.version;
|
|
40
40
|
const spinner = (0, ora_1.default)('Checking for updates...').start();
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ async function main() {
|
|
|
51
51
|
const program = new commander_1.Command();
|
|
52
52
|
program
|
|
53
53
|
.name('hooklink')
|
|
54
|
-
.description('
|
|
54
|
+
.description('Hooklink CLI - Forward webhooks to your local development machine')
|
|
55
55
|
.version(package_json_1.default.version)
|
|
56
56
|
.exitOverride();
|
|
57
57
|
// ASCII art banner
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../src/utils/sentry.ts"],"names":[],"mappings":"AAeA,wBAAgB,UAAU,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../src/utils/sentry.ts"],"names":[],"mappings":"AAeA,wBAAgB,UAAU,IAAI,IAAI,CA+CjC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAIrD;AAED,wBAAsB,WAAW,CAAC,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
package/dist/utils/sentry.js
CHANGED
|
@@ -19,19 +19,44 @@ function initSentry() {
|
|
|
19
19
|
if (!isTelemetryEnabled())
|
|
20
20
|
return;
|
|
21
21
|
const dsn = process.env.SENTRY_DSN || HOOKLINK_SENTRY_DSN;
|
|
22
|
+
// Pre-check: diagnostics_channel.subscribe must exist for Sentry's Http/NodeFetch
|
|
23
|
+
// integrations. Older Node versions lack this and Sentry throws during setupOnce().
|
|
24
|
+
let hasDiagnosticsSubscribe = false;
|
|
25
|
+
try {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
27
|
+
const dc = require('diagnostics_channel');
|
|
28
|
+
const ch = dc.channel('sentry.test');
|
|
29
|
+
hasDiagnosticsSubscribe = typeof ch.subscribe === 'function';
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// diagnostics_channel not available
|
|
33
|
+
}
|
|
22
34
|
try {
|
|
23
35
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
24
36
|
Sentry = require('@sentry/node');
|
|
37
|
+
const unsafeIntegrations = ['Http', 'NodeFetch'];
|
|
38
|
+
Sentry.init({
|
|
39
|
+
dsn,
|
|
40
|
+
environment: process.env.NODE_ENV || 'production',
|
|
41
|
+
tracesSampleRate: 0.01,
|
|
42
|
+
...(hasDiagnosticsSubscribe
|
|
43
|
+
? {}
|
|
44
|
+
: {
|
|
45
|
+
integrations: (defaults) => defaults.filter((i) => !unsafeIntegrations.includes(i.name)),
|
|
46
|
+
}),
|
|
47
|
+
beforeSend(event) {
|
|
48
|
+
const msg = event.exception?.values?.[0]?.value || '';
|
|
49
|
+
if (msg.includes('diagnosticsChannel.subscribe'))
|
|
50
|
+
return null;
|
|
51
|
+
return event;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
initialized = true;
|
|
25
55
|
}
|
|
26
56
|
catch {
|
|
27
|
-
|
|
57
|
+
Sentry = null;
|
|
58
|
+
initialized = false;
|
|
28
59
|
}
|
|
29
|
-
Sentry.init({
|
|
30
|
-
dsn,
|
|
31
|
-
environment: process.env.NODE_ENV || 'production',
|
|
32
|
-
tracesSampleRate: 0.01,
|
|
33
|
-
});
|
|
34
|
-
initialized = true;
|
|
35
60
|
}
|
|
36
61
|
function captureException(error) {
|
|
37
62
|
if (initialized && Sentry) {
|
package/dist/utils/sentry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.js","sourceRoot":"","sources":["../../src/utils/sentry.ts"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"sentry.js","s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ACzB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE,YAAY,EAAE,CAAC,QAAmB,EAAE,EAAE,CACnC,QAA+B,CAAC,MAAM,CACrC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAC5C;iBACJ,CAAC;YACN,UAAU,CAAC,KAAwD;gBACjE,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;gBACtD,IAAI,GAAG,CAAC,QAAQ,CAAC,8BAA8B,CAAC;oBAAE,OAAO,IAAI,CAAC;gBAC9D,OAAO,KAAK,CAAC;YACf,CAAC;SACF,CAAC,CAAC;QAEH,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,IAAI,CAAC;QACd,WAAW,GAAG,KAAK,CAAC;IACtB,CAAC;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc;IAC7C,IAAI,WAAW,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,WAAW,CAAC,OAAO,GAAG,IAAI;IAC9C,IAAI,WAAW,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hooklink/cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.46",
|
|
4
|
+
"description": "Hooklink CLI - Forward webhooks to your local development machine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"hooklink": "dist/index.js"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"forwarding",
|
|
30
30
|
"websocket"
|
|
31
31
|
],
|
|
32
|
-
"author": "
|
|
32
|
+
"author": "Hooklink",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"homepage": "https://hooklink.net",
|
|
35
35
|
"engines": {
|