tesla-inventory 3.4.34 → 3.4.35

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.4.34",
5
+ "version": "3.4.35",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
package/src/index.js CHANGED
@@ -23,12 +23,13 @@ module.exports =
23
23
  }
24
24
 
25
25
  const { country, ...query } = { ...inventories[inventory], ...opts }
26
+ const domain = inventory === 'cn' ? 'cn' : 'com'
26
27
 
27
28
  const duration = timeSpan()
28
29
 
29
30
  const paginate = async (offset = 0) => {
30
31
  const url = new URL(
31
- `https://www.tesla.com/inventory/api/v1/inventory-results?${new URLSearchParams({
32
+ `https://www.tesla.${domain}/inventory/api/v1/inventory-results?${new URLSearchParams({
32
33
  query: JSON.stringify({
33
34
  query,
34
35
  count: ITEMS_PER_PAGE,
@@ -1 +1,29 @@
1
- {}
1
+ {
2
+ "APPB": 32000,
3
+ "CC02": 53000,
4
+ "CC04": 29000,
5
+ "ICC00": 17000,
6
+ "ICW00": 17000,
7
+ "INB3C": 13900,
8
+ "INLPC": 14200,
9
+ "IWC00": 17000,
10
+ "IWW00": 17000,
11
+ "MTS05": 57000,
12
+ "MTS13": 22000,
13
+ "MTS14": 152000,
14
+ "MTX03": 80000,
15
+ "MTX05": 80000,
16
+ "MTX13": 46000,
17
+ "MTX15": 46000,
18
+ "MTY07": 299900,
19
+ "MTY09": 299900,
20
+ "MTY13": 263900,
21
+ "PMSS": 18500,
22
+ "PPMR": 25000,
23
+ "PPSB": 8000,
24
+ "ST0Y": 8000,
25
+ "WS10": 37000,
26
+ "WS12": 37000,
27
+ "WX20": 45000,
28
+ "WY20P": 8000
29
+ }