tesla-fleet-api 0.0.7 → 0.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/dist/vehicle.d.ts CHANGED
@@ -9,19 +9,19 @@ export default class Vehicle {
9
9
  * @param vin
10
10
  * @returns
11
11
  */
12
- specific(vin: String): VehicleSpecific;
12
+ specific(vin: string): VehicleSpecific;
13
13
  /**
14
14
  * Return the vehicle model name
15
15
  * @param vin
16
16
  * @returns
17
17
  */
18
- model(vin: String): String;
18
+ model(vin: string): string;
19
19
  /**
20
20
  * Return if the vehicle was build before 2021 and cannot sleep without a break
21
21
  * @param vin
22
22
  * @returns
23
23
  */
24
- pre2021(vin: String): Boolean;
24
+ pre2021(vin: string): boolean;
25
25
  /**
26
26
  * Controls the front (which_trunk: "front") or rear (which_trunk: "rear") trunk.
27
27
  * @param vehicle_tag VIN or id field of a vehicle
@@ -422,7 +422,7 @@ export default class Vehicle {
422
422
  * @param vins list of Vehicle Identification Number
423
423
  * @returns
424
424
  */
425
- fleet_status(vins: Array<String>): Promise<Record<string, any>>;
425
+ fleet_status(vins: Array<string>): Promise<Record<string, any>>;
426
426
  /**
427
427
  * Configures vehicles to connect to self-hosted fleet-telemetry server. This endpoint has concurrency 1 (status 429 will be returned if many calls are made at the same time). Multiple vehicles can be configured with a single call.
428
428
  * @param config A dictionary description the fleet telemetry configuration
@@ -14,10 +14,10 @@ interface FleetTelemetryConfig {
14
14
  }
15
15
  export default class VehicleSpecific {
16
16
  parent: Vehicle;
17
- vin: String;
18
- model: String;
19
- pre2021: Boolean;
20
- constructor(parent: Vehicle, vin: String);
17
+ vin: string;
18
+ model: string;
19
+ pre2021: boolean;
20
+ constructor(parent: Vehicle, vin: string);
21
21
  /**
22
22
  * Controls the front (which_trunk: "front") or rear (which_trunk: "rear") trunk.
23
23
  * @param which_trunk "front" or "rear"
@@ -354,7 +354,7 @@ export default class VehicleSpecific {
354
354
  * @param vins list of Vehicle Identification Number
355
355
  * @returns
356
356
  */
357
- fleet_status(vins: Array<String>): Promise<Record<string, any>>;
357
+ fleet_status(vins: Array<string>): Promise<Record<string, any>>;
358
358
  /**
359
359
  * Configures vehicles to connect to self-hosted fleet-telemetry server. This endpoint has concurrency 1 (status 429 will be returned if many calls are made at the same time). Multiple vehicles can be configured with a single call.
360
360
  * @param config A dictionary description the fleet telemetry configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tesla-fleet-api",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "author": {
5
5
  "name": "Teslemetry",
6
6
  "email": "hello@teslemetry.com",
package/src/vehicle.ts CHANGED
@@ -23,7 +23,7 @@ export default class Vehicle {
23
23
  * @param vin
24
24
  * @returns
25
25
  */
26
- specific(vin: String): VehicleSpecific {
26
+ specific(vin: string): VehicleSpecific {
27
27
  return new VehicleSpecific(this, vin);
28
28
  }
29
29
 
@@ -32,7 +32,7 @@ export default class Vehicle {
32
32
  * @param vin
33
33
  * @returns
34
34
  */
35
- model(vin: String): String {
35
+ model(vin: string): string {
36
36
  return Models?.[vin[3]] || "Unknown";
37
37
  }
38
38
 
@@ -41,7 +41,7 @@ export default class Vehicle {
41
41
  * @param vin
42
42
  * @returns
43
43
  */
44
- pre2021(vin: String): Boolean {
44
+ pre2021(vin: string): boolean {
45
45
  return (vin[3] === "S" || vin[3] === "X") && vin[9] < "L";
46
46
  }
47
47
 
@@ -705,7 +705,7 @@ export default class Vehicle {
705
705
  * @param vins list of Vehicle Identification Number
706
706
  * @returns
707
707
  */
708
- async fleet_status(vins: Array<String>): Promise<Record<string, any>> {
708
+ async fleet_status(vins: Array<string>): Promise<Record<string, any>> {
709
709
  return this.parent._request("POST", "api/1/vehicles/fleet_status", null, { vins });
710
710
  }
711
711
 
@@ -16,11 +16,11 @@ interface FleetTelemetryConfig {
16
16
 
17
17
  export default class VehicleSpecific {
18
18
  parent: Vehicle;
19
- vin: String;
20
- model: String;
21
- pre2021: Boolean;
19
+ vin: string;
20
+ model: string;
21
+ pre2021: boolean;
22
22
 
23
- constructor(parent: Vehicle, vin: String) {
23
+ constructor(parent: Vehicle, vin: string) {
24
24
  this.parent = parent;
25
25
  this.vin = vin;
26
26
  this.model = this.parent.model(this.vin);
@@ -615,7 +615,7 @@ export default class VehicleSpecific {
615
615
  * @param vins list of Vehicle Identification Number
616
616
  * @returns
617
617
  */
618
- async fleet_status(vins: Array<String>): Promise<Record<string, any>> {
618
+ async fleet_status(vins: Array<string>): Promise<Record<string, any>> {
619
619
  return this.parent.parent._request("POST", "api/1/vehicles/fleet_status", null, { vins });
620
620
  }
621
621