lightspeed-retail-sdk 3.4.2 → 3.4.3

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A modern JavaScript SDK for interacting with the Lightspeed Retail API. This SDK provides a convenient, secure, and flexible way to access Lightspeed Retail's features—including customer, item, and order management.
4
4
 
5
- **Current Version: 3.4.2** — Auto-discovery system for seamless cron job and production deployment.
5
+ **Current Version: 3.4.1** — Auto-discovery system for seamless cron job and production deployment.
6
6
 
7
7
  ## **🆕 Recent Updates (v3.4.0)**
8
8
 
@@ -291,7 +291,15 @@ class LightspeedSDKCore {
291
291
  console.log("✅ Token refresh successful");
292
292
  return this.token;
293
293
  } catch (error) {
294
+ var _error_response, _error_response1;
294
295
  console.error("❌ Token refresh failed:", error.message);
296
+ // Log detailed error response from Lightspeed for debugging
297
+ if ((_error_response = error.response) === null || _error_response === void 0 ? void 0 : _error_response.data) {
298
+ console.error("📋 Error details from Lightspeed:", JSON.stringify(error.response.data, null, 2));
299
+ }
300
+ if ((_error_response1 = error.response) === null || _error_response1 === void 0 ? void 0 : _error_response1.status) {
301
+ console.error("📋 HTTP Status:", error.response.status);
302
+ }
295
303
  // Check if the token was refreshed by another process
296
304
  const updatedTokens = await this.tokenStorage.getTokens();
297
305
  if (updatedTokens.access_token && updatedTokens.expires_at) {
@@ -336,6 +336,17 @@ export class LightspeedSDKCore {
336
336
  } catch (error) {
337
337
  console.error("❌ Token refresh failed:", error.message);
338
338
 
339
+ // Log detailed error response from Lightspeed for debugging
340
+ if (error.response?.data) {
341
+ console.error(
342
+ "📋 Error details from Lightspeed:",
343
+ JSON.stringify(error.response.data, null, 2)
344
+ );
345
+ }
346
+ if (error.response?.status) {
347
+ console.error("📋 HTTP Status:", error.response.status);
348
+ }
349
+
339
350
  // Check if the token was refreshed by another process
340
351
  const updatedTokens = await this.tokenStorage.getTokens();
341
352
  if (updatedTokens.access_token && updatedTokens.expires_at) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightspeed-retail-sdk",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "description": "Another unofficial Lightspeed Retail API SDK for Node.js",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",