@hienlh/ppm 0.9.64 → 0.9.65
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/cli/commands/cloud.ts +1 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.65] - 2026-04-08
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- **Removed `ppm cloud link`/`unlink` CLI commands**: Login auto-links, logout auto-unlinks — separate commands no longer needed. API routes remain for web UI.
|
|
7
|
+
|
|
3
8
|
## [0.9.63] - 2026-04-08
|
|
4
9
|
|
|
5
10
|
### Fixed
|
package/package.json
CHANGED
|
@@ -75,7 +75,6 @@ export function registerCloudCommands(program: Command): void {
|
|
|
75
75
|
} catch (linkErr: unknown) {
|
|
76
76
|
const linkMsg = linkErr instanceof Error ? linkErr.message : String(linkErr);
|
|
77
77
|
console.warn(` ⚠ Auto-link failed: ${linkMsg}`);
|
|
78
|
-
console.log(` Run 'ppm cloud link' manually to register this machine.`);
|
|
79
78
|
}
|
|
80
79
|
console.log();
|
|
81
80
|
} catch (err: unknown) {
|
|
@@ -113,69 +112,6 @@ export function registerCloudCommands(program: Command): void {
|
|
|
113
112
|
console.log(` ✓ Logged out (was: ${auth.email})\n`);
|
|
114
113
|
});
|
|
115
114
|
|
|
116
|
-
cmd
|
|
117
|
-
.command("link")
|
|
118
|
-
.description("Register this machine with PPM Cloud")
|
|
119
|
-
.option("-n, --name <name>", "Machine display name")
|
|
120
|
-
.action(async (options) => {
|
|
121
|
-
const { linkDevice } = await import("../../services/cloud.service.ts");
|
|
122
|
-
|
|
123
|
-
try {
|
|
124
|
-
const device = await linkDevice(options.name);
|
|
125
|
-
console.log(` ✓ Machine linked`);
|
|
126
|
-
console.log(` Name: ${device.name}`);
|
|
127
|
-
console.log(` ID: ${device.device_id}`);
|
|
128
|
-
|
|
129
|
-
// Auto-detect running tunnel and start heartbeat immediately
|
|
130
|
-
try {
|
|
131
|
-
const { resolve } = await import("node:path");
|
|
132
|
-
const { homedir } = await import("node:os");
|
|
133
|
-
const { existsSync, readFileSync } = await import("node:fs");
|
|
134
|
-
const statusFile = resolve(homedir(), ".ppm", "status.json");
|
|
135
|
-
if (existsSync(statusFile)) {
|
|
136
|
-
const status = JSON.parse(readFileSync(statusFile, "utf-8"));
|
|
137
|
-
if (status.shareUrl) {
|
|
138
|
-
const { sendHeartbeat } = await import("../../services/cloud.service.ts");
|
|
139
|
-
const ok = await sendHeartbeat(status.shareUrl);
|
|
140
|
-
if (ok) {
|
|
141
|
-
console.log(`\n ➜ Cloud: synced tunnel URL (${status.shareUrl})`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
} catch { /* non-blocking */ }
|
|
146
|
-
|
|
147
|
-
console.log();
|
|
148
|
-
} catch (err: unknown) {
|
|
149
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
150
|
-
console.error(` ✗ Link failed: ${msg}\n`);
|
|
151
|
-
process.exit(1);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
cmd
|
|
156
|
-
.command("unlink")
|
|
157
|
-
.description("Remove this machine from PPM Cloud")
|
|
158
|
-
.action(async () => {
|
|
159
|
-
const { unlinkDevice, getCloudDevice } = await import(
|
|
160
|
-
"../../services/cloud.service.ts"
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
const device = getCloudDevice();
|
|
164
|
-
if (!device) {
|
|
165
|
-
console.log(` Not linked to cloud.\n`);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
await unlinkDevice();
|
|
171
|
-
console.log(` ✓ Machine unlinked (was: ${device.name})\n`);
|
|
172
|
-
} catch (err: unknown) {
|
|
173
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
174
|
-
console.error(` ✗ Unlink failed: ${msg}\n`);
|
|
175
|
-
process.exit(1);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
|
|
179
115
|
cmd
|
|
180
116
|
.command("status")
|
|
181
117
|
.description("Show PPM Cloud connection status")
|
|
@@ -217,7 +153,7 @@ export function registerCloudCommands(program: Command): void {
|
|
|
217
153
|
console.log(` Linked at: ${device.linked_at}`);
|
|
218
154
|
} else {
|
|
219
155
|
console.log(` Machine: not linked`);
|
|
220
|
-
if (auth) console.log(` Run 'ppm cloud
|
|
156
|
+
if (auth) console.log(` Run 'ppm cloud login' to re-link this machine.`);
|
|
221
157
|
}
|
|
222
158
|
|
|
223
159
|
console.log();
|