lightspeed-retail-sdk 1.0.6 → 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.
- package/README.md +1 -0
- package/index.js +19 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -144,7 +144,7 @@ class LightspeedRetailSDK {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
async getMultipleItems(items) {
|
|
147
|
+
async getMultipleItems(items, relations) {
|
|
148
148
|
const options = {
|
|
149
149
|
url: `${this.baseUrl}/${this.accountID}/Item.json`,
|
|
150
150
|
method: "GET",
|
|
@@ -154,6 +154,8 @@ class LightspeedRetailSDK {
|
|
|
154
154
|
|
|
155
155
|
if (items) options.url = options.url + `?itemID=IN,${items}`;
|
|
156
156
|
|
|
157
|
+
if (relations) options.url = options.url + `&load_relations=${relations}`;
|
|
158
|
+
|
|
157
159
|
try {
|
|
158
160
|
const response = await this.getAllData(options);
|
|
159
161
|
return response;
|
|
@@ -178,6 +180,22 @@ class LightspeedRetailSDK {
|
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
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
|
+
|
|
181
199
|
async getItem(itemID, relations) {
|
|
182
200
|
const options = {
|
|
183
201
|
url: `${this.baseUrl}/${this.accountID}/Item/${itemID}.json`,
|