@promte/app-upload 0.1.5 → 0.1.6

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.
@@ -6,7 +6,8 @@ import AdmZip from "adm-zip";
6
6
  import undici from "undici";
7
7
  import readline from "node:readline/promises";
8
8
 
9
- const { FormData, File } = undici;
9
+ const { FormData, Blob } = undici;
10
+ const BlobCtor = globalThis.Blob || Blob;
10
11
 
11
12
  const DEFAULT_HOST = "https://app.promte.dk";
12
13
  const DEFAULT_DIST = "./dist";
@@ -199,11 +200,10 @@ async function runPush(args) {
199
200
  zipBuffer = zip.toBuffer();
200
201
  }
201
202
 
203
+ assert(BlobCtor, "Blob is not available in this Node runtime.");
202
204
  const form = new FormData();
203
- const file = new File([zipBuffer], zipName, {
204
- type: "application/zip",
205
- });
206
- form.append("app", file);
205
+ const blob = new BlobCtor([zipBuffer], { type: "application/zip" });
206
+ form.append("app", blob, zipName);
207
207
 
208
208
  const url = new URL("/api/upload-app-version", host);
209
209
  url.searchParams.set("workspaceId", workspaceId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promte/app-upload",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "CLI to upload Promte app bundles",
5
5
  "type": "module",
6
6
  "bin": {