lightspeed-retail-sdk 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -105,7 +105,7 @@ class LightspeedRetailSDK {
|
|
|
105
105
|
if (retries < this.maxRetries) {
|
|
106
106
|
console.log(`Error: ${err}, retrying in 2 seconds...`);
|
|
107
107
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
108
|
-
return await this.getResource(url, retries + 1);
|
|
108
|
+
return await this.getResource(options.url, retries + 1);
|
|
109
109
|
} else {
|
|
110
110
|
console.error(`Failed Request statusText: `, res.statusText);
|
|
111
111
|
console.log(`Failed data: `, response.data);
|
|
@@ -420,13 +420,15 @@ class LightspeedRetailSDK {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
async getSaleLinesByItems(itemIDs,
|
|
423
|
+
async getSaleLinesByItems(itemIDs, startDate = undefined, endDate = undefined) {
|
|
424
424
|
const options = {
|
|
425
|
-
url: `${this.baseUrl}/${this.accountID}/SaleLine.json?itemID=IN
|
|
425
|
+
url: `${this.baseUrl}/${this.accountID}/SaleLine.json?itemID=IN,[${itemIDs}]`,
|
|
426
426
|
method: "GET",
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
-
if (
|
|
429
|
+
if (startDate && endDate)
|
|
430
|
+
options.url =
|
|
431
|
+
options.url + `&timeStamp=%3E%3C%2C${startDate}%2C${endDate}&sort=timeStamp`;
|
|
430
432
|
|
|
431
433
|
try {
|
|
432
434
|
const response = await this.getAllData(options);
|