tesla-inventory 3.0.9 → 3.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/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://nicedoc.io/Kikobeats/tesla-inventory",
5
- "version": "3.0.9",
5
+ "version": "3.0.12",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "josefrancisco.verdu@gmail.com",
package/src/index.js CHANGED
@@ -48,5 +48,12 @@ module.exports = async (inventory, opts, { headers, ...gotOpts } = {}) => {
48
48
  const nRequests = Math.ceil(page.total / ITEMS_PER_PAGE) - 1
49
49
  const offsets = [...Array(nRequests).keys()].map(n => (n + 1) * page.items.length)
50
50
  const pages = await Promise.all(offsets.map(paginate))
51
- return pages.reduce((acc, { items }) => acc.concat(items), page.items)
51
+
52
+ return [page, ...pages].reduce((acc, page) => {
53
+ page.items.forEach(item => {
54
+ const isAlready = acc.some(({ VIN }) => VIN === item.VIN)
55
+ if (!isAlready) acc.push(item)
56
+ })
57
+ return acc
58
+ }, [])
52
59
  }
@@ -17,6 +17,7 @@
17
17
  "PPSB": 1600,
18
18
  "RFP2": 2000,
19
19
  "SPT31": 5000,
20
+ "WTDS": 1600,
20
21
  "WTSC": 2100,
21
22
  "WTUT": 5800
22
23
  }
@@ -4,7 +4,9 @@
4
4
  "INPW0": 9500,
5
5
  "MT303": 136600,
6
6
  "MTY07": 79980,
7
+ "MTY09": 79980,
7
8
  "PBSB": 9500,
8
9
  "PPMR": 17500,
10
+ "W39B": 13500,
9
11
  "WY20P": 17500
10
12
  }
@@ -53,7 +53,7 @@
53
53
  "MTX06": 16000,
54
54
  "MTX07": 13000,
55
55
  "MTX08": 21000,
56
- "MTY07": 13290,
56
+ "MTY07": 9990,
57
57
  "MTY09": 9000,
58
58
  "PBSB": 1050,
59
59
  "PMBL": 2100,
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "APF2": 177200,
3
+ "IBW1": 21600,
3
4
  "INPW1": 21600,
4
5
  "IPW1": 21600,
5
6
  "IWC00": 43200,
7
+ "MT322": 324900,
6
8
  "MT324": 544900,
7
9
  "MTS14": 1665000,
8
10
  "MTY11": 590600,
9
11
  "PBSB": 32400,
10
12
  "PPMR": 43200,
11
13
  "STY7S": 65000,
14
+ "W41B": 32400,
12
15
  "WS10": 97000,
13
16
  "WY20P": 43200
14
17
  }
@@ -4,8 +4,10 @@
4
4
  "CC02": 54000,
5
5
  "CC04": 29300,
6
6
  "INLFC": 12500,
7
+ "INPW0": 10000,
7
8
  "MT303": 189590,
8
9
  "MTX03": 101000,
10
+ "MTY09": 192190,
9
11
  "PBSB": 10000,
10
12
  "PMBL": 16700,
11
13
  "PMNG": 12500,
@@ -1 +1,4 @@
1
- {}
1
+ {
2
+ "APF2": 10000,
3
+ "MT317": 27990
4
+ }
@@ -6,7 +6,8 @@
6
6
  "MT303": 201990,
7
7
  "MT304": 203990,
8
8
  "MT310": 201990,
9
- "PBSB": 16600,
9
+ "MT340": 203990,
10
+ "PBSB": 13000,
10
11
  "PMNG": 13000,
11
12
  "PMSS": 22100,
12
13
  "PPSB": 13000,
@@ -11,6 +11,7 @@
11
11
  "IN3PW": 1000,
12
12
  "INB3C": 1500,
13
13
  "INB3W": 1500,
14
+ "INBC3W": 1500,
14
15
  "INBCW": 1500,
15
16
  "INBDW": 1500,
16
17
  "INBFW": 1500,
@@ -18,6 +19,7 @@
18
19
  "INBTW": 1500,
19
20
  "INLFC": 1500,
20
21
  "INLFP": 1500,
22
+ "INPW1": 1000,
21
23
  "INYPW": 1000,
22
24
  "IWC00": 2000,
23
25
  "MT301": 11990,
@@ -28,7 +30,9 @@
28
30
  "MT308": 11990,
29
31
  "MT310": 20990,
30
32
  "MT311": 27990,
33
+ "MT314": 11990,
31
34
  "MT317": 27990,
35
+ "MT321": 20990,
32
36
  "MT322": 11990,
33
37
  "MTS01": 18090,
34
38
  "MTS03": 18090,
@@ -45,8 +49,11 @@
45
49
  "MTX04": 41500,
46
50
  "MTX05": 20000,
47
51
  "MTX06": 41500,
52
+ "MTX08": 41500,
48
53
  "MTY03": 23000,
49
54
  "MTY04": 28000,
55
+ "MTY05": 28000,
56
+ "MTY06": 23000,
50
57
  "PBSB": 1500,
51
58
  "PMBL": 2000,
52
59
  "PMNG": 1500,
@@ -56,6 +63,7 @@
56
63
  "RFP2": 2000,
57
64
  "TW01": 1000,
58
65
  "W39B": 1500,
66
+ "W41B": 1500,
59
67
  "WS10": 4500,
60
68
  "WTAB": 4500,
61
69
  "WTD2": 1500,