@restroom-mw/files
Advanced tools
Comparing version 0.12.3-f67e107.4 to 0.13.0
export declare const DOWNLOAD = "download the {} and extract it into {}"; | ||
export declare const STORE_RESULT = "store {} in the file {}"; | ||
//# sourceMappingURL=actions.d.ts.map |
import { NextFunction, Request, Response } from "express"; | ||
declare const _default: (req: Request, res: Response, next: NextFunction) => void; | ||
export default _default; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@restroom-mw/files", | ||
"version": "0.12.3-f67e107.4+f67e107", | ||
"version": "0.13.0", | ||
"description": "Utilities middleware to work with files for Restroom", | ||
@@ -35,3 +35,3 @@ "author": "Alberto Lerda <alberto@dyne.org>", | ||
}, | ||
"gitHead": "f67e107cdadae53b954f9d15011ed2d639acf854" | ||
"gitHead": "e401976d13ad938f41b01d49cfa0613e3b77ffc7" | ||
} |
import { Restroom } from "@restroom-mw/core"; | ||
import { ObjectLiteral } from "@restroom-mw/core/src/types"; | ||
import { Zencode } from "@restroom-mw/zencode"; | ||
import axios from "axios"; | ||
@@ -13,3 +11,3 @@ import { NextFunction, Request, Response } from "express"; | ||
* | ||
* Download a zip file located at the url `myUrl` and extract it at the path | ||
* Download a zip file located at the url `myUrl` and extract it at the path | ||
* `myFolder` on the server. | ||
@@ -36,3 +34,3 @@ */ | ||
const file = result[allPassOutputs[i]] | ||
const folder = result[allPassOutputs[i+1]] | ||
const folder = result[allPassOutputs[i + 1]] | ||
@@ -44,3 +42,3 @@ if (file && folder) { | ||
responseType: 'arraybuffer' | ||
}); | ||
}); | ||
const tempdir = fs.mkdtempSync("/tmp/restroom"); | ||
@@ -57,3 +55,3 @@ const tempfile = tempdir + "/downloaded"; | ||
} | ||
else { | ||
else { | ||
throw new Error(`[FILES] url or destination folder not defined`); | ||
@@ -67,3 +65,3 @@ } | ||
const variable = result[allPassOutputs[i]] | ||
const file = result[allPassOutputs[i+1]] | ||
const file = result[allPassOutputs[i + 1]] | ||
@@ -70,0 +68,0 @@ if (variable && file) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
43780
10
0
179