amazon-sp-api
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -9,3 +9,3 @@ const CustomError = require('./CustomError'); | ||
const csv = require('csvtojson'); | ||
const fs = require('fs/promises'); | ||
const fs = require('fs'); | ||
const zlib = require('zlib'); | ||
@@ -84,2 +84,13 @@ | ||
async _saveFile(content, options){ | ||
return new Promise((resolve, reject) => { | ||
if (options.json){ | ||
content = JSON.stringify(content); | ||
} | ||
fs.writeFile(options.file, content, (err) => { | ||
err ? reject(err) : resolve(); | ||
}) | ||
}); | ||
} | ||
async refreshAccessToken(){ | ||
@@ -315,3 +326,3 @@ let res = await request({ | ||
if (options.file){ | ||
options.json ? await fs.writeFile(options.file, JSON.stringify(decrypted)) : await fs.writeFile(options.file, decrypted); | ||
await this._saveFile(decrypted, options); | ||
} | ||
@@ -318,0 +329,0 @@ return decrypted; |
{ | ||
"name": "amazon-sp-api", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Amazon Selling Partner API client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
91049
3100