diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 975b42df89..b0d9f8b8d9 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -53,8 +53,7 @@ "sanitize-s3-objectkey": "0.0.1", "semver": "7.3.7", "tar-fs": "2.1.1", - "uuid": "8.3.2", - "zlib": "1.0.5" + "uuid": "8.3.2" }, "devDependencies": { "@swc/core": "^1.3.25", diff --git a/packages/backend-core/src/objectStore/objectStore.ts b/packages/backend-core/src/objectStore/objectStore.ts index 059e1b228d..4ac3641de1 100644 --- a/packages/backend-core/src/objectStore/objectStore.ts +++ b/packages/backend-core/src/objectStore/objectStore.ts @@ -3,7 +3,7 @@ import AWS from "aws-sdk" import stream from "stream" import fetch from "node-fetch" import tar from "tar-fs" -const zlib = require("zlib") +import zlib from "zlib" import { promisify } from "util" import { join } from "path" import fs from "fs" @@ -415,7 +415,7 @@ export const downloadTarballDirect = async ( throw new Error(`unexpected response ${response.statusText}`) } - await streamPipeline(response.body, zlib.Unzip(), tar.extract(path)) + await streamPipeline(response.body, zlib.createUnzip(), tar.extract(path)) } export const downloadTarball = async ( @@ -431,7 +431,7 @@ export const downloadTarball = async ( } const tmpPath = join(budibaseTempDir(), path) - await streamPipeline(response.body, zlib.Unzip(), tar.extract(tmpPath)) + await streamPipeline(response.body, zlib.createUnzip(), tar.extract(tmpPath)) if (!env.isTest() && env.SELF_HOSTED) { await uploadDirectory(bucketName, tmpPath, path) } diff --git a/packages/server/package.json b/packages/server/package.json index 7a32c2312d..8da9522142 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -119,8 +119,7 @@ "vm2": "3.9.11", "worker-farm": "1.7.0", "xml2js": "0.4.23", - "yargs": "13.2.4", - "zlib": "1.0.5" + "yargs": "13.2.4" }, "devDependencies": { "@babel/core": "7.17.4", diff --git a/packages/worker/src/api/index.ts b/packages/worker/src/api/index.ts index b390d36bb8..2a3133af3f 100644 --- a/packages/worker/src/api/index.ts +++ b/packages/worker/src/api/index.ts @@ -1,6 +1,6 @@ import Router from "@koa/router" const compress = require("koa-compress") -const zlib = require("zlib") +import zlib from "zlib" import { routes } from "./routes" import { middleware as pro } from "@budibase/pro" import { auth, middleware } from "@budibase/backend-core" diff --git a/yarn.lock b/yarn.lock index 9d50b0a8c8..56fd87d2e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25463,8 +25463,3 @@ z-schema@^5.0.1: validator "^13.7.0" optionalDependencies: commander "^9.4.1" - -zlib@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zlib/-/zlib-1.0.5.tgz#6e7c972fc371c645a6afb03ab14769def114fcc0" - integrity sha512-40fpE2II+Cd3k8HWTWONfeKE2jL+P42iWJ1zzps5W51qcTsOUKM5Q5m2PFb0CLxlmFAaUuUdJGc3OfZy947v0w==