tesla-inventory 3.5.0 → 3.5.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tesla-inventory",
3
3
  "description": "Retrieve real-time data from Tesla Inventory.",
4
4
  "homepage": "https://github.com/Kikobeats/tesla-inventory",
5
- "version": "3.5.0",
5
+ "version": "3.5.2",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
package/src/index.js CHANGED
@@ -49,9 +49,14 @@ module.exports =
49
49
 
50
50
  const result = await pRetry(
51
51
  () =>
52
- fetcher(url, fetcherOpts).then(async text => {
53
- const body = JSON.parse(text)
54
- return { items: body.results ?? [] }
52
+ fetcher(url, fetcherOpts).then(async body => {
53
+ try {
54
+ const data = JSON.parse(body)
55
+ return { items: data.results ?? [] }
56
+ } catch (error) {
57
+ error.body = body
58
+ throw error
59
+ }
55
60
  }),
56
61
  {
57
62
  onFailedAttempt: error => onFailedAttempt(error, debug),
@@ -35,7 +35,7 @@
35
35
  "MT304": 164000,
36
36
  "MT308": 70000,
37
37
  "MT310": 160000,
38
- "MT311": 185000,
38
+ "MT311": 164000,
39
39
  "MT315": 160000,
40
40
  "MT316": 160000,
41
41
  "MT317": 164000,