lightspeed-retail-sdk 1.0.7 → 1.0.8

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/index.js +16 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,6 +8,7 @@ We currently have the following methods available:
8
8
  getCustomers()
9
9
  getItem()
10
10
  getAllItems()
11
+ getVendorItems()
11
12
  getMultipleItems() // await api.getMultipleItems("[7957, 7944]");
12
13
  getCategories()
13
14
  getCategory()
package/index.js CHANGED
@@ -180,6 +180,22 @@ class LightspeedRetailSDK {
180
180
  }
181
181
  }
182
182
 
183
+ async getvendorItems(vendorID, relations) {
184
+ const options = {
185
+ url: `${this.baseUrl}/${this.accountID}/Item.json?defaultVendorID=${vendorID}`,
186
+ method: "GET",
187
+ };
188
+
189
+ if (relations) options.url = options.url + `?load_relations=${relations}`;
190
+
191
+ try {
192
+ const response = await this.getAllData(options);
193
+ return response;
194
+ } catch (error) {
195
+ return this.handleError("GET ITEMS ERROR", error.response);
196
+ }
197
+ }
198
+
183
199
  async getItem(itemID, relations) {
184
200
  const options = {
185
201
  url: `${this.baseUrl}/${this.accountID}/Item/${itemID}.json`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightspeed-retail-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Another unofficial Lightspeed Retail API SDK for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {