cloudron 5.14.0 → 5.14.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": "cloudron",
3
- "version": "5.14.0",
3
+ "version": "5.14.1",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
6
  "main": "main.js",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "author": "Cloudron Developers <support@cloudron.io>",
19
19
  "dependencies": {
20
- "cloudron-manifestformat": "^5.26.2",
20
+ "cloudron-manifestformat": "^5.27.0",
21
21
  "commander": "^13.1.0",
22
22
  "debug": "^4.4.0",
23
23
  "easy-table": "^1.2.0",
@@ -32,8 +32,8 @@
32
32
  "node": ">= 18.x.x"
33
33
  },
34
34
  "devDependencies": {
35
- "@eslint/js": "^9.20.0",
36
- "eslint": "^9.20.1",
35
+ "@eslint/js": "^9.22.0",
36
+ "eslint": "^9.22.0",
37
37
  "expect.js": "^0.3.1",
38
38
  "mocha": "^11.1.0"
39
39
  }
@@ -214,10 +214,9 @@ async function addVersion(manifest, baseDir, options) {
214
214
  manifest.changelog = parseChangelog(changelogPath, manifest.version);
215
215
  if (!manifest.changelog) throw new Error('Bad changelog format or missing changelog for this version');
216
216
  }
217
-
218
217
  const request = createRequest('POST', `/api/v1/developers/apps/${manifest.id}/versions`, options);
219
218
  if (iconFilePath) request.attach('icon', iconFilePath);
220
- request.attach('manifest', Buffer.from(JSON.stringify(manifest)), 'manifest');
219
+ request.attach('manifest', Buffer.from(JSON.stringify(manifest)));
221
220
  const response = await request;
222
221
  if (response.status === 409) throw new Error('This version already exists. Use --force to overwrite.');
223
222
  if (response.status !== 204) throw new Error(`Failed to publish version: ${requestError(response)}`);
@@ -260,7 +259,7 @@ async function updateVersion(manifest, baseDir, options) {
260
259
 
261
260
  const request = createRequest('PUT', `/api/v1/developers/apps/${manifest.id}/versions/${manifest.version}`, options);
262
261
  if (iconFilePath) request.attach('icon', iconFilePath);
263
- request.attach('manifest', Buffer.from(JSON.stringify(manifest)), 'manifest');
262
+ request.attach('manifest', Buffer.from(JSON.stringify(manifest)));
264
263
  const response = await request;
265
264
  if (response.status !== 204) throw new Error(`Failed to publish version: ${requestError(response)}`);
266
265
  }
package/src/superagent.js CHANGED
@@ -190,11 +190,12 @@ class Request {
190
190
  return this;
191
191
  }
192
192
 
193
- attach(name, filepath) { // this is only used in tests and thus simplistic
193
+ attach(name, filepathOrBuffer) { // this is only used in tests and thus simplistic
194
194
  if (!this.#boundary) this.#boundary = '----WebKitFormBoundary' + Math.random().toString(36).substring(2);
195
195
 
196
- const partHeader = Buffer.from(`--${this.#boundary}\r\nContent-Disposition: form-data; name="${name}" filename="${path.basename(filepath)}"\r\n\r\n`, 'utf8');
197
- const partData = fs.readFileSync(filepath);
196
+ const filename = Buffer.isBuffer(filepathOrBuffer) ? name : path.basename(filepathOrBuffer);
197
+ const partHeader = Buffer.from(`--${this.#boundary}\r\nContent-Disposition: form-data; name="${name}" filename="${filename}"\r\n\r\n`, 'utf8');
198
+ const partData = Buffer.isBuffer(filepathOrBuffer) ? filepathOrBuffer : fs.readFileSync(filepathOrBuffer);
198
199
  this.#body = Buffer.concat([this.#body, partHeader, partData, Buffer.from('\r\n', 'utf8')]);
199
200
 
200
201
  return this;