@deploya-app/cli 0.1.0 → 0.1.1

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": "@deploya-app/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Deploy static sites to Deploya from a terminal or AI agent",
5
5
  "license": "MIT",
6
6
  "bin": {
package/src/api.js CHANGED
@@ -16,7 +16,11 @@ async function parseResponse(response) {
16
16
  if (!response.ok) {
17
17
  const apiError = body?.error;
18
18
  const message = typeof apiError === 'object' ? apiError.message : apiError || body.message || `HTTP ${response.status}`;
19
- throw new ApiError(message, response.status, typeof apiError === 'object' ? apiError.code : 'HTTP_ERROR', apiError?.details);
19
+ const error = new ApiError(message, response.status, typeof apiError === 'object' ? apiError.code : 'HTTP_ERROR', apiError?.details);
20
+ if (error.code === 'PROJECT_LIMIT_REACHED') {
21
+ error.hint = `Повысить тариф: ${error.details?.upgradeUrl || 'https://app.deploya.ru/billing'}`;
22
+ }
23
+ throw error;
20
24
  }
21
25
  return body;
22
26
  }
package/src/cli.js CHANGED
@@ -6,7 +6,7 @@ const { loginWithBrowser } = require('./auth');
6
6
  const { clearSession, loadProject, resolveCredentials, saveProject, saveSession } = require('./config');
7
7
  const { deployDirectory } = require('./deploy');
8
8
 
9
- const VERSION = '0.1.0';
9
+ const VERSION = '0.1.1';
10
10
 
11
11
  function parseArguments(argv) {
12
12
  const positionals = [];
package/src/deploy.js CHANGED
@@ -29,7 +29,7 @@ async function deployDirectory({ apiBase, token, directory, projectId, name, sub
29
29
  token,
30
30
  body: form,
31
31
  timeout: 10 * 60 * 1000,
32
- headers: { 'Idempotency-Key': crypto.randomUUID(), 'User-Agent': 'deploya-cli/0.1.0' },
32
+ headers: { 'Idempotency-Key': crypto.randomUUID(), 'User-Agent': 'deploya-cli/0.1.1' },
33
33
  });
34
34
  } finally {
35
35
  archive.cleanup();