@restroom-mw/files
Advanced tools
Comparing version 0.12.3-78d63fb.1 to 0.12.3-9bc85cc.9
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-78d63fb.1+78d63fb", | ||
"version": "0.12.3-9bc85cc.9+9bc85cc", | ||
"description": "Utilities middleware to work with files for Restroom", | ||
@@ -35,3 +35,3 @@ "author": "Alberto Lerda <alberto@dyne.org>", | ||
}, | ||
"gitHead": "78d63fb2f435a50d0ccd8f2555e7d84b01ed724e" | ||
"gitHead": "9bc85cce0f4a0ba57a5923f51fa773b820b2c1e7" | ||
} |
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
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
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
43798
10
179