vibefast-cli 0.2.0 → 0.2.2
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 +7 -0
- package/ERROR-MESSAGE-CLEANUP.md +64 -0
- package/MONITORING-AND-ANNOUNCEMENT-GUIDE.md +669 -0
- package/PUBLISHED-SUCCESS.md +282 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +0 -2
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/devices.d.ts.map +1 -1
- package/dist/commands/devices.js +25 -1
- package/dist/commands/devices.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +36 -1
- package/dist/commands/list.js.map +1 -1
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +61 -33
- package/dist/core/http.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/add.ts +0 -2
- package/src/commands/devices.ts +26 -1
- package/src/commands/list.ts +37 -1
- package/src/core/http.ts +62 -36
package/src/commands/devices.ts
CHANGED
|
@@ -32,7 +32,32 @@ export const devicesCommand = new Command('devices')
|
|
|
32
32
|
log.plain(` • ${device.id} (${device.os}/${device.arch}) - ${device.lastSeen}`);
|
|
33
33
|
});
|
|
34
34
|
} catch (error: any) {
|
|
35
|
-
|
|
35
|
+
const errorMsg = error.message || '';
|
|
36
|
+
|
|
37
|
+
log.plain('');
|
|
38
|
+
|
|
39
|
+
// Better error messages - http.ts already provides clean messages
|
|
40
|
+
if (errorMsg.includes('license_key not found') || errorMsg.includes('Invalid') || errorMsg.includes('token')) {
|
|
41
|
+
log.plain('❌ Invalid or expired license key');
|
|
42
|
+
log.plain('');
|
|
43
|
+
log.info('To fix this:');
|
|
44
|
+
log.plain(' 1. Run: vf logout');
|
|
45
|
+
log.plain(' 2. Run: vf login --token YOUR_LICENSE_KEY');
|
|
46
|
+
log.plain('');
|
|
47
|
+
log.info('Need help? Contact support@vibefast.pro');
|
|
48
|
+
} else if (errorMsg.includes('Network') || errorMsg.includes('connect') || errorMsg.includes('fetch')) {
|
|
49
|
+
log.plain('❌ Network error');
|
|
50
|
+
log.plain('');
|
|
51
|
+
log.info('Could not connect to VibeFast servers');
|
|
52
|
+
log.plain('');
|
|
53
|
+
log.plain(`Details: ${errorMsg}`);
|
|
54
|
+
} else {
|
|
55
|
+
log.plain(`❌ ${errorMsg}`);
|
|
56
|
+
log.plain('');
|
|
57
|
+
log.info('If this problem persists, contact support@vibefast.pro');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
log.plain('');
|
|
36
61
|
process.exit(1);
|
|
37
62
|
}
|
|
38
63
|
});
|
package/src/commands/list.ts
CHANGED
|
@@ -39,7 +39,43 @@ export const listCommand = new Command('list')
|
|
|
39
39
|
|
|
40
40
|
log.plain('\nInstall with: vf add <feature-name>');
|
|
41
41
|
} catch (error: any) {
|
|
42
|
-
|
|
42
|
+
const errorMsg = error.message || '';
|
|
43
|
+
|
|
44
|
+
log.plain('');
|
|
45
|
+
|
|
46
|
+
// Better error messages - http.ts already provides clean messages
|
|
47
|
+
if (errorMsg.includes('license_key not found') || errorMsg.includes('Invalid') || errorMsg.includes('token')) {
|
|
48
|
+
log.plain('❌ Invalid or expired license key');
|
|
49
|
+
log.plain('');
|
|
50
|
+
log.info('Your license key may be:');
|
|
51
|
+
log.plain(' • Incorrect or mistyped');
|
|
52
|
+
log.plain(' • Expired');
|
|
53
|
+
log.plain(' • Not yet activated');
|
|
54
|
+
log.plain('');
|
|
55
|
+
log.info('To fix this:');
|
|
56
|
+
log.plain(' 1. Check your license key from your purchase receipt');
|
|
57
|
+
log.plain(' 2. Run: vf logout');
|
|
58
|
+
log.plain(' 3. Run: vf login --token YOUR_LICENSE_KEY');
|
|
59
|
+
log.plain('');
|
|
60
|
+
log.info('Need help? Contact support@vibefast.pro');
|
|
61
|
+
} else if (errorMsg.includes('Network') || errorMsg.includes('connect') || errorMsg.includes('fetch')) {
|
|
62
|
+
log.plain('❌ Network error');
|
|
63
|
+
log.plain('');
|
|
64
|
+
log.info('Could not connect to VibeFast servers');
|
|
65
|
+
log.plain('');
|
|
66
|
+
log.info('Please check:');
|
|
67
|
+
log.plain(' • Your internet connection');
|
|
68
|
+
log.plain(' • Firewall settings');
|
|
69
|
+
log.plain(' • VPN configuration');
|
|
70
|
+
log.plain('');
|
|
71
|
+
log.plain(`Details: ${errorMsg}`);
|
|
72
|
+
} else {
|
|
73
|
+
log.plain(`❌ ${errorMsg}`);
|
|
74
|
+
log.plain('');
|
|
75
|
+
log.info('If this problem persists, contact support@vibefast.pro');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
log.plain('');
|
|
43
79
|
process.exit(1);
|
|
44
80
|
}
|
|
45
81
|
});
|
package/src/core/http.ts
CHANGED
|
@@ -103,55 +103,81 @@ export async function listRecipes(token: string): Promise<any> {
|
|
|
103
103
|
} catch {
|
|
104
104
|
// ignore JSON parse errors
|
|
105
105
|
}
|
|
106
|
-
throw
|
|
106
|
+
// Just throw the actual error message, no wrapping
|
|
107
|
+
throw new Error(message);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
return response.json();
|
|
110
111
|
} catch (err: any) {
|
|
111
|
-
|
|
112
|
+
// If it's already our error, just rethrow
|
|
113
|
+
if (err.message && !err.message.includes('fetch')) {
|
|
114
|
+
throw err;
|
|
115
|
+
}
|
|
116
|
+
// Network error
|
|
117
|
+
throw new Error(`Network error: ${err.message}`);
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
export async function listDevices(token: string): Promise<any> {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
try {
|
|
123
|
+
const response = await fetch(`${WORKER_URL}/api/devices/list`, {
|
|
124
|
+
method: 'GET',
|
|
125
|
+
headers: {
|
|
126
|
+
'Authorization': `Bearer ${token}`,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
if (!response.ok) {
|
|
131
|
+
let message = response.statusText;
|
|
132
|
+
try {
|
|
133
|
+
const body = (await response.json()) as { error?: string; message?: string };
|
|
134
|
+
message = body?.error || body?.message || message;
|
|
135
|
+
} catch {
|
|
136
|
+
// ignore
|
|
137
|
+
}
|
|
138
|
+
// Just throw the actual error message
|
|
139
|
+
throw new Error(message);
|
|
130
140
|
}
|
|
131
|
-
throw new Error(`Failed to fetch devices: ${message}`);
|
|
132
|
-
}
|
|
133
141
|
|
|
134
|
-
|
|
142
|
+
return response.json();
|
|
143
|
+
} catch (err: any) {
|
|
144
|
+
// If it's already our error, just rethrow
|
|
145
|
+
if (err.message && !err.message.includes('fetch')) {
|
|
146
|
+
throw err;
|
|
147
|
+
}
|
|
148
|
+
// Network error
|
|
149
|
+
throw new Error(`Network error: ${err.message}`);
|
|
150
|
+
}
|
|
135
151
|
}
|
|
136
152
|
|
|
137
153
|
export async function deactivateDevice(token: string, deviceId: string): Promise<void> {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
try {
|
|
155
|
+
const response = await fetch(`${WORKER_URL}/api/devices/deactivate`, {
|
|
156
|
+
method: 'POST',
|
|
157
|
+
headers: {
|
|
158
|
+
'Authorization': `Bearer ${token}`,
|
|
159
|
+
'Content-Type': 'application/json',
|
|
160
|
+
},
|
|
161
|
+
body: JSON.stringify({ deviceId }),
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
let message = response.statusText;
|
|
166
|
+
try {
|
|
167
|
+
const body = (await response.json()) as { error?: string; message?: string };
|
|
168
|
+
message = body?.error || body?.message || message;
|
|
169
|
+
} catch {
|
|
170
|
+
// ignore
|
|
171
|
+
}
|
|
172
|
+
// Just throw the actual error message
|
|
173
|
+
throw new Error(message);
|
|
174
|
+
}
|
|
175
|
+
} catch (err: any) {
|
|
176
|
+
// If it's already our error, just rethrow
|
|
177
|
+
if (err.message && !err.message.includes('fetch')) {
|
|
178
|
+
throw err;
|
|
154
179
|
}
|
|
155
|
-
|
|
180
|
+
// Network error
|
|
181
|
+
throw new Error(`Network error: ${err.message}`);
|
|
156
182
|
}
|
|
157
183
|
}
|