mozhost-cli 1.2.0 → 1.3.0

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 +23 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozhost-cli",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Command-line interface for MozHost container platform",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/utils/api.js CHANGED
@@ -111,12 +111,30 @@ class ApiClient {
111
111
 
112
112
  async uploadFile(containerId, filePath, content) {
113
113
  const client = await this.getClient();
114
- const response = await client.post(`/api/files/${containerId}/cli-upload`, { // ← Mudar!
115
- path: filePath,
116
- content
114
+
115
+ // 🔍 DEBUG
116
+ console.log('📤 Upload:', {
117
+ endpoint: `/api/files/${containerId}/cli-upload`,
118
+ filePath,
119
+ contentLength: content.length
117
120
  });
118
- return response.data;
119
- }
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
+ }
120
138
 
121
139
 
122
140
  async uploadFiles(containerId, files) {