tesla-fleet-api 0.0.1
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 +2 -0
- package/dist/charging.js +29 -0
- package/dist/charging.js.map +1 -0
- package/dist/energy.js +45 -0
- package/dist/energy.js.map +1 -0
- package/dist/energyspecific.js +59 -0
- package/dist/energyspecific.js.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/partner.js +15 -0
- package/dist/partner.js.map +1 -0
- package/dist/teslafleetapi.js +82 -0
- package/dist/teslafleetapi.js.map +1 -0
- package/dist/teslemetry.js +18 -0
- package/dist/teslemetry.js.map +1 -0
- package/dist/tessie.js +10 -0
- package/dist/tessie.js.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/user.js +21 -0
- package/dist/user.js.map +1 -0
- package/dist/vehicle.js +316 -0
- package/dist/vehicle.js.map +1 -0
- package/dist/vehiclespecific.js +310 -0
- package/dist/vehiclespecific.js.map +1 -0
- package/package.json +23 -0
- package/src/charging.ts +66 -0
- package/src/energy.ts +153 -0
- package/src/energyspecific.ts +136 -0
- package/src/index.ts +5 -0
- package/src/partner.ts +37 -0
- package/src/teslafleetapi.ts +114 -0
- package/src/teslemetry.ts +24 -0
- package/src/tessie.ts +13 -0
- package/src/types.ts +59 -0
- package/src/user.ts +34 -0
- package/src/vehicle.ts +855 -0
- package/src/vehiclespecific.ts +769 -0
package/src/user.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import TeslaFleetApi from "./teslafleetapi.js";
|
|
2
|
+
|
|
3
|
+
export default class User {
|
|
4
|
+
parent: TeslaFleetApi;
|
|
5
|
+
|
|
6
|
+
constructor(parent: TeslaFleetApi) {
|
|
7
|
+
this.parent = parent;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Returns the public key associated with the user. */
|
|
11
|
+
async backup_key(): Promise<Record<string, any>> {
|
|
12
|
+
return this.parent._request("GET", "api/1/users/backup_key");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Returns any custom feature flag applied to a user. */
|
|
16
|
+
async feature_config(): Promise<Record<string, any>> {
|
|
17
|
+
return this.parent._request("GET", "api/1/users/feature_config");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Returns a summary of a user's account. */
|
|
21
|
+
async me(): Promise<Record<string, any>> {
|
|
22
|
+
return this.parent._request("GET", "api/1/users/me");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Returns the active orders for a user. */
|
|
26
|
+
async orders(): Promise<Record<string, any>> {
|
|
27
|
+
return this.parent._request("GET", "api/1/users/orders");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Returns a user's region and appropriate fleet-api base URL. Accepts no parameters, response is based on the authentication token subject. */
|
|
31
|
+
async region(): Promise<Record<string, any>> {
|
|
32
|
+
return this.parent._request("GET", "api/1/users/region");
|
|
33
|
+
}
|
|
34
|
+
}
|