checkpoint-cli 0.5.1 → 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/dist/index.js +24 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -372,6 +372,12 @@ async function registerTunnel(sb, opts) {
|
|
|
372
372
|
console.log(chalk_1.default.yellow(` ⚠ Could not register: ${error?.message ?? 'unknown'}`));
|
|
373
373
|
return null;
|
|
374
374
|
}
|
|
375
|
+
await sb.from('tunnel_members').insert({
|
|
376
|
+
tunnel_id: data.id,
|
|
377
|
+
user_id: userId,
|
|
378
|
+
role: 'owner',
|
|
379
|
+
status: 'active',
|
|
380
|
+
});
|
|
375
381
|
return { shareUrl: `${APP_URL}/share/${shareId}`, tunnelId: data.id };
|
|
376
382
|
}
|
|
377
383
|
async function deactivateTunnel(sb, tunnelId) {
|
|
@@ -501,14 +507,18 @@ function loginWithBrowser() {
|
|
|
501
507
|
const loginUrl = `${APP_URL}/cli/auth?callback=${encodeURIComponent(callbackUrl)}`;
|
|
502
508
|
console.log(` ${chalk_1.default.cyan(loginUrl)}`);
|
|
503
509
|
console.log('');
|
|
504
|
-
|
|
505
|
-
|
|
510
|
+
process.stdout.write(chalk_1.default.gray(' Press ENTER to open the browser...'));
|
|
511
|
+
process.stdin.setRawMode?.(false);
|
|
512
|
+
process.stdin.resume();
|
|
513
|
+
process.stdin.setEncoding('utf8');
|
|
514
|
+
const onKey = () => {
|
|
515
|
+
process.stdin.removeListener('data', onKey);
|
|
516
|
+
process.stdout.write('\n');
|
|
506
517
|
openBrowser(loginUrl);
|
|
507
|
-
// Keep stdin
|
|
508
|
-
//
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
});
|
|
518
|
+
// Keep stdin resumed so the HTTP server's event loop stays alive
|
|
519
|
+
// until the browser callback arrives.
|
|
520
|
+
};
|
|
521
|
+
process.stdin.on('data', onKey);
|
|
512
522
|
});
|
|
513
523
|
// Timeout after 10 minutes
|
|
514
524
|
setTimeout(() => {
|
|
@@ -522,7 +532,7 @@ const program = new commander_1.Command();
|
|
|
522
532
|
program
|
|
523
533
|
.name('checkpoint')
|
|
524
534
|
.description('Share your localhost with reviewers — get visual feedback directly on the page.\n\nQuick start:\n 1. checkpoint login Sign in to your Checkpoint account\n 2. checkpoint start -p 3000 Start tunneling and get a share link\n\nReuse a tunnel name to keep the same share URL and preserve all comments.')
|
|
525
|
-
.version('0.5.
|
|
535
|
+
.version('0.5.2');
|
|
526
536
|
// ── checkpoint login ──
|
|
527
537
|
program
|
|
528
538
|
.command('login')
|
|
@@ -756,6 +766,12 @@ program
|
|
|
756
766
|
console.log(chalk_1.default.red(` Failed: ${error?.message ?? 'unknown error'}`));
|
|
757
767
|
process.exit(1);
|
|
758
768
|
}
|
|
769
|
+
await sb.from('tunnel_members').insert({
|
|
770
|
+
tunnel_id: data.id,
|
|
771
|
+
user_id: userData.user.id,
|
|
772
|
+
role: 'owner',
|
|
773
|
+
status: 'active',
|
|
774
|
+
});
|
|
759
775
|
const shareUrl = `${APP_URL}/share/${shareId}`;
|
|
760
776
|
console.log(chalk_1.default.green(' ✓ Registered'));
|
|
761
777
|
console.log(` ${chalk_1.default.gray('Tunnel URL:')} ${chalk_1.default.cyan(opts.url)}`);
|