mozhost-cli 2.1.0 → 2.1.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/utils/api.js +27 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozhost-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.3",
4
4
  "description": "Command-line interface for MozHost container platform",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/utils/api.js CHANGED
@@ -9,7 +9,7 @@ class ApiClient {
9
9
 
10
10
  const client = axios.create({
11
11
  baseURL,
12
- timeout: 30000,
12
+ timeout: 160000,
13
13
  headers: {
14
14
  'Content-Type': 'application/json'
15
15
  }
@@ -109,33 +109,32 @@ class ApiClient {
109
109
  return response.data;
110
110
  }
111
111
 
112
- async uploadFile(containerId, filePath, content) {
113
- const client = await this.getClient();
114
-
115
- // 🔍 DEBUG
116
- console.log('📤 Upload:', {
117
- endpoint: `/api/files/${containerId}/cli-upload`,
118
- filePath,
119
- contentLength: content.length
120
- });
121
-
122
- try {
123
- const response = await client.post(`/api/files/${containerId}/cli-upload`, {
124
- path: filePath,
125
- content
126
- });
127
- return response.data;
128
- } catch (error) {
129
- // 🔍 DEBUG - Mostrar erro completo
130
- console.error('❌ Upload error:', {
131
- status: error.response?.status,
132
- data: error.response?.data,
133
- message: error.message
112
+ async uploadFile(containerId, filePath, content) {
113
+ const client = await this.getClient();
114
+
115
+ // 🔍 DEBUG
116
+ console.log('📤 Upload:', {
117
+ endpoint: `/api/files/${containerId}/cli-upload`,
118
+ filePath,
119
+ contentLength: content.length
134
120
  });
135
- throw error;
136
- }
137
- }
138
121
 
122
+ try {
123
+ const response = await client.post(`/api/files/${containerId}/cli-upload`, {
124
+ path: filePath,
125
+ content
126
+ });
127
+ return response.data;
128
+ } catch (error) {
129
+ // 🔍 DEBUG - Mostrar erro completo
130
+ console.error('❌ Upload error:', {
131
+ status: error.response?.status,
132
+ data: error.response?.data,
133
+ message: error.message
134
+ });
135
+ throw error;
136
+ }
137
+ }
139
138
 
140
139
  async uploadFiles(containerId, files) {
141
140
  const client = await this.getClient();
@@ -168,7 +167,6 @@ class ApiClient {
168
167
  });
169
168
  return response.data;
170
169
  }
171
- }
172
170
 
173
171
  // Databases
174
172
  async listDatabases() {
@@ -203,4 +201,6 @@ class ApiClient {
203
201
  return response.data;
204
202
  }
205
203
 
204
+ }
205
+
206
206
  module.exports = new ApiClient();