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.
- package/package.json +1 -1
- package/src/utils/api.js +23 -5
package/package.json
CHANGED
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
|
|
115
|
+
// 🔍 DEBUG
|
|
116
|
+
console.log('📤 Upload:', {
|
|
117
|
+
endpoint: `/api/files/${containerId}/cli-upload`,
|
|
118
|
+
filePath,
|
|
119
|
+
contentLength: content.length
|
|
117
120
|
});
|
|
118
|
-
|
|
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) {
|