mozhost-cli 2.1.0 β 2.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 +1 -1
- package/src/utils/api.js +26 -26
package/package.json
CHANGED
package/src/utils/api.js
CHANGED
|
@@ -109,33 +109,32 @@ class ApiClient {
|
|
|
109
109
|
return response.data;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
+
} // π FECHA A CLASSE AQUI (depois de TODOS os mΓ©todos)
|
|
205
|
+
|
|
206
206
|
module.exports = new ApiClient();
|