bring-shopping
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -83,3 +83,3 @@ interface BringOptions { | ||
private readonly headers; | ||
private name?; | ||
name?: string; | ||
private bearerToken?; | ||
@@ -86,0 +86,0 @@ private refreshToken?; |
'use strict'; | ||
const request = require(`request-promise-native`); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
const request_promise_native_1 = __importDefault(require("request-promise-native")); | ||
class Bring { | ||
@@ -22,3 +25,3 @@ constructor(options) { | ||
try { | ||
data = await request.post(`${this.url}bringauth`, { | ||
data = await request_promise_native_1.default.post(`${this.url}bringauth`, { | ||
form: { | ||
@@ -47,3 +50,3 @@ email: this.mail, | ||
try { | ||
const data = await request(`${this.url}bringusers/${this.uuid}/lists`, { headers: this.headers }); | ||
const data = await (0, request_promise_native_1.default)(`${this.url}bringusers/${this.uuid}/lists`, { headers: this.headers }); | ||
return JSON.parse(data); | ||
@@ -60,3 +63,3 @@ } | ||
try { | ||
const data = await request(`${this.url}bringlists/${listUuid}`, { headers: this.headers }); | ||
const data = await (0, request_promise_native_1.default)(`${this.url}bringlists/${listUuid}`, { headers: this.headers }); | ||
return JSON.parse(data); | ||
@@ -73,3 +76,3 @@ } | ||
try { | ||
const data = await request(`${this.url}bringlists/${listUuid}/details`, { headers: this.headers }); | ||
const data = await (0, request_promise_native_1.default)(`${this.url}bringlists/${listUuid}/details`, { headers: this.headers }); | ||
return JSON.parse(data); | ||
@@ -91,3 +94,3 @@ } | ||
try { | ||
const data = await request.put(`${this.url}bringlists/${listUuid}`, { | ||
const data = await request_promise_native_1.default.put(`${this.url}bringlists/${listUuid}`, { | ||
headers: this.putHeaders, | ||
@@ -111,3 +114,3 @@ body: `&purchase=${itemName}&recently=&specification=${specification}&remove=&sender=null` | ||
try { | ||
const data = await request.put(`${this.url}bringlists/${listUuid}`, { | ||
const data = await request_promise_native_1.default.put(`${this.url}bringlists/${listUuid}`, { | ||
headers: this.putHeaders, | ||
@@ -131,3 +134,3 @@ body: `&purchase=&recently=&specification=&remove=${itemName}&sender=null` | ||
try { | ||
const data = await request.put(`${this.url}bringlists/${listUuid}`, { | ||
const data = await request_promise_native_1.default.put(`${this.url}bringlists/${listUuid}`, { | ||
headers: this.putHeaders, | ||
@@ -149,3 +152,3 @@ body: `&purchase=&recently=${itemName}&specification=&remove=&&sender=null` | ||
try { | ||
const data = await request(`${this.url}bringlists/${listUuid}/users`, { headers: this.headers }); | ||
const data = await (0, request_promise_native_1.default)(`${this.url}bringlists/${listUuid}/users`, { headers: this.headers }); | ||
return JSON.parse(data); | ||
@@ -162,3 +165,3 @@ } | ||
try { | ||
const data = await request(`${this.url}bringusersettings/${this.uuid}`, { headers: this.headers }); | ||
const data = await (0, request_promise_native_1.default)(`${this.url}bringusersettings/${this.uuid}`, { headers: this.headers }); | ||
return JSON.parse(data); | ||
@@ -176,3 +179,3 @@ } | ||
try { | ||
const data = await request(`https://web.getbring.com/locale/articles.${locale}.json`); | ||
const data = await (0, request_promise_native_1.default)(`https://web.getbring.com/locale/articles.${locale}.json`); | ||
return JSON.parse(data); | ||
@@ -190,3 +193,3 @@ } | ||
try { | ||
const data = await request(`https://web.getbring.com/locale/catalog.${locale}.json`); | ||
const data = await (0, request_promise_native_1.default)(`https://web.getbring.com/locale/catalog.${locale}.json`); | ||
return JSON.parse(data); | ||
@@ -203,3 +206,3 @@ } | ||
try { | ||
const data = await request(`${this.url}bringusers/${this.uuid}/invitations?status=pending`, { headers: this.headers }); | ||
const data = await (0, request_promise_native_1.default)(`${this.url}bringusers/${this.uuid}/invitations?status=pending`, { headers: this.headers }); | ||
return JSON.parse(data); | ||
@@ -206,0 +209,0 @@ } |
{ | ||
"name": "bring-shopping", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=8.0.0" |
@@ -29,2 +29,3 @@ # Node-Bring-Shopping | ||
await bring.login(); | ||
console.log(`Successfully logged in as ${bring.name}`); | ||
} catch (e) { | ||
@@ -49,3 +50,3 @@ console.error(`Error on Login: ${e.message}`); | ||
## Changelog | ||
### 1.4.1 (2021-08-12) | ||
### 1.4.2 (2021-08-12) | ||
* (foxriver76) restructure to typescript | ||
@@ -52,0 +53,0 @@ |
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
22775
357
83
0