servyx-cli 0.1.10 → 0.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "servyx-cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Servyx CLI — Upload local projects and deploy via the Servyx platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -150,7 +150,7 @@ export async function runDeploy(options = {}) {
150
150
  console.log(pc.dim(`Deployment ID: ${deploymentId}`));
151
151
 
152
152
  while (true) {
153
- const statusResult = await getDeployment(deploymentId);
153
+ const statusResult = await getDeployment(appId, deploymentId);
154
154
  const current = statusResult?.data?.deployment;
155
155
  if (!current) {
156
156
  console.error(pc.red('Deployment not found while polling.'));
package/src/lib/api.js CHANGED
@@ -30,7 +30,13 @@ function unwrap(response) {
30
30
  if (response.status >= 200 && response.status < 300) {
31
31
  return response.data;
32
32
  }
33
- const err = new Error(response.data?.error || response.statusText || 'Request failed');
33
+
34
+ const isHtml = typeof response.data === 'string' && response.data.includes('<html');
35
+ const message = isHtml
36
+ ? `API returned ${response.status} (expected JSON). Check SERVYX_API_URL / cli-service routing.`
37
+ : (response.data?.error || response.data?.message || response.statusText || 'Request failed');
38
+
39
+ const err = new Error(message);
34
40
  err.status = response.status;
35
41
  err.code = response.data?.code;
36
42
  err.data = response.data;
@@ -66,9 +72,9 @@ export async function startDeployment(appId, message, { withEnv = false } = {})
66
72
  }
67
73
  }
68
74
 
69
- export async function getDeployment(deploymentId) {
75
+ export async function getDeployment(appId, deploymentId) {
70
76
  const client = createClient();
71
- return unwrap(await client.get(`/deployments/${deploymentId}`));
77
+ return unwrap(await client.get(`/apps/${appId}/deployments/${deploymentId}`));
72
78
  }
73
79
 
74
80
  export async function listAppDeployments(appId, limit = 10) {