tesla-fleet-api 0.2.2 → 0.4.0
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/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/_virtual/_rolldown/runtime.mjs +12 -0
- package/dist/charging.cjs +53 -0
- package/dist/charging.d.cts +31 -0
- package/dist/charging.d.mts +30 -0
- package/dist/charging.mjs +53 -0
- package/dist/commands.cjs +802 -0
- package/dist/commands.d.cts +350 -0
- package/dist/commands.d.mts +349 -0
- package/dist/commands.mjs +800 -0
- package/dist/const.cjs +300 -0
- package/dist/const.d.cts +287 -0
- package/dist/const.d.mts +287 -0
- package/dist/const.mjs +263 -0
- package/dist/energy.cjs +137 -0
- package/dist/energy.d.cts +95 -0
- package/{src/energy.ts → dist/energy.d.mts} +17 -140
- package/dist/energy.mjs +137 -0
- package/dist/energyspecific.cjs +99 -0
- package/dist/energyspecific.d.cts +78 -0
- package/dist/energyspecific.d.mts +77 -0
- package/dist/energyspecific.mjs +99 -0
- package/dist/exceptions.cjs +1487 -0
- package/dist/exceptions.d.cts +1142 -0
- package/dist/exceptions.d.mts +1142 -0
- package/dist/exceptions.mjs +1324 -0
- package/dist/index.cjs +226 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.mjs +14 -0
- package/dist/partner.cjs +32 -0
- package/dist/partner.d.cts +24 -0
- package/dist/partner.d.mts +23 -0
- package/dist/partner.mjs +32 -0
- package/dist/router.cjs +0 -0
- package/dist/router.d.cts +1 -0
- package/dist/router.d.mts +1 -0
- package/dist/router.mjs +1 -0
- package/dist/signing/crypto.cjs +31 -0
- package/dist/signing/crypto.mjs +27 -0
- package/dist/signing/session.cjs +112 -0
- package/dist/signing/session.d.cts +69 -0
- package/dist/signing/session.d.mts +69 -0
- package/dist/signing/session.mjs +110 -0
- package/dist/tariff.cjs +292 -0
- package/dist/{tariff.d.ts → tariff.d.cts} +17 -17
- package/dist/tariff.d.mts +29 -0
- package/dist/tariff.mjs +291 -0
- package/dist/teslafleetapi.cjs +125 -0
- package/dist/teslafleetapi.d.cts +64 -0
- package/dist/teslafleetapi.d.mts +64 -0
- package/dist/teslafleetapi.mjs +125 -0
- package/dist/teslemetry.cjs +36 -0
- package/dist/teslemetry.d.cts +23 -0
- package/dist/teslemetry.d.mts +23 -0
- package/dist/teslemetry.mjs +36 -0
- package/dist/tessie.cjs +34 -0
- package/dist/tessie.d.cts +23 -0
- package/dist/tessie.d.mts +23 -0
- package/dist/tessie.mjs +34 -0
- package/dist/types/commands.d.cts +28 -0
- package/dist/types/commands.d.mts +28 -0
- package/dist/types/live_status.d.cts +30 -0
- package/dist/types/live_status.d.mts +30 -0
- package/dist/types/products.d.cts +58 -0
- package/dist/types/products.d.mts +58 -0
- package/dist/types/responses.d.cts +9 -0
- package/dist/types/responses.d.mts +9 -0
- package/dist/types/site_info.d.cts +154 -0
- package/dist/types/site_info.d.mts +154 -0
- package/dist/types/vehicle.d.cts +27 -0
- package/dist/types/vehicle.d.mts +27 -0
- package/dist/types/vehicle_data.d.cts +278 -0
- package/dist/types/vehicle_data.d.mts +278 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +9 -0
- package/dist/types.d.mts +9 -0
- package/dist/types.mjs +1 -0
- package/dist/user.cjs +28 -0
- package/dist/user.d.cts +17 -0
- package/dist/user.d.mts +16 -0
- package/dist/user.mjs +28 -0
- package/dist/vehicle.cjs +804 -0
- package/dist/vehicle.d.cts +550 -0
- package/dist/vehicle.d.mts +549 -0
- package/dist/vehicle.mjs +804 -0
- package/dist/vehiclesigned.cjs +20 -0
- package/dist/vehiclesigned.d.cts +14 -0
- package/dist/{vehiclesigned.d.ts → vehiclesigned.d.mts} +3 -3
- package/dist/vehiclesigned.mjs +20 -0
- package/dist/vehiclespecific.cjs +604 -0
- package/dist/vehiclespecific.d.cts +433 -0
- package/dist/vehiclespecific.d.mts +432 -0
- package/dist/vehiclespecific.mjs +604 -0
- package/package.json +108 -35
- package/dist/charging.d.ts +0 -30
- package/dist/charging.js +0 -51
- package/dist/charging.js.map +0 -1
- package/dist/commands.d.ts +0 -352
- package/dist/commands.js +0 -875
- package/dist/commands.js.map +0 -1
- package/dist/energy.d.ts +0 -94
- package/dist/energy.js +0 -125
- package/dist/energy.js.map +0 -1
- package/dist/energyspecific.d.ts +0 -77
- package/dist/energyspecific.js +0 -97
- package/dist/energyspecific.js.map +0 -1
- package/dist/helpers.d.ts +0 -2
- package/dist/helpers.js +0 -10
- package/dist/helpers.js.map +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -14
- package/dist/index.js.map +0 -1
- package/dist/partner.d.ts +0 -23
- package/dist/partner.js +0 -31
- package/dist/partner.js.map +0 -1
- package/dist/signing/crypto.d.ts +0 -10
- package/dist/signing/crypto.js +0 -26
- package/dist/signing/crypto.js.map +0 -1
- package/dist/signing/errors.d.ts +0 -29
- package/dist/signing/errors.js +0 -40
- package/dist/signing/errors.js.map +0 -1
- package/dist/signing/session.d.ts +0 -69
- package/dist/signing/session.js +0 -102
- package/dist/signing/session.js.map +0 -1
- package/dist/tariff.js +0 -302
- package/dist/tariff.js.map +0 -1
- package/dist/teslafleetapi.d.ts +0 -58
- package/dist/teslafleetapi.js +0 -120
- package/dist/teslafleetapi.js.map +0 -1
- package/dist/teslemetry.d.ts +0 -29
- package/dist/teslemetry.js +0 -39
- package/dist/teslemetry.js.map +0 -1
- package/dist/tessie.d.ts +0 -23
- package/dist/tessie.js +0 -28
- package/dist/tessie.js.map +0 -1
- package/dist/types/commands.d.ts +0 -44
- package/dist/types/commands.js +0 -11
- package/dist/types/commands.js.map +0 -1
- package/dist/types/live_status.d.ts +0 -26
- package/dist/types/live_status.js +0 -2
- package/dist/types/live_status.js.map +0 -1
- package/dist/types/products.d.ts +0 -54
- package/dist/types/products.js +0 -2
- package/dist/types/products.js.map +0 -1
- package/dist/types/responses.d.ts +0 -5
- package/dist/types/responses.js +0 -2
- package/dist/types/responses.js.map +0 -1
- package/dist/types/site_info.d.ts +0 -150
- package/dist/types/site_info.js +0 -2
- package/dist/types/site_info.js.map +0 -1
- package/dist/types/vehicle.d.ts +0 -22
- package/dist/types/vehicle.js +0 -2
- package/dist/types/vehicle.js.map +0 -1
- package/dist/types/vehicle_data.d.ts +0 -274
- package/dist/types/vehicle_data.js +0 -2
- package/dist/types/vehicle_data.js.map +0 -1
- package/dist/user.d.ts +0 -16
- package/dist/user.js +0 -26
- package/dist/user.js.map +0 -1
- package/dist/vehicle.d.ts +0 -548
- package/dist/vehicle.js +0 -781
- package/dist/vehicle.js.map +0 -1
- package/dist/vehiclesigned.js +0 -19
- package/dist/vehiclesigned.js.map +0 -1
- package/dist/vehiclespecific.d.ts +0 -432
- package/dist/vehiclespecific.js +0 -601
- package/dist/vehiclespecific.js.map +0 -1
- package/src/charging.ts +0 -66
- package/src/commands.ts +0 -1134
- package/src/energyspecific.ts +0 -116
- package/src/helpers.ts +0 -11
- package/src/index.ts +0 -20
- package/src/partner.ts +0 -37
- package/src/signing/crypto.ts +0 -29
- package/src/signing/errors.ts +0 -50
- package/src/signing/session.ts +0 -132
- package/src/tariff.ts +0 -375
- package/src/teslafleetapi.ts +0 -182
- package/src/teslemetry.ts +0 -54
- package/src/tessie.ts +0 -42
- package/src/types/commands.ts +0 -62
- package/src/types/live_status.ts +0 -27
- package/src/types/products.ts +0 -61
- package/src/types/responses.ts +0 -1
- package/src/types/site_info.ts +0 -159
- package/src/types/vehicle.ts +0 -23
- package/src/types/vehicle_data.ts +0 -286
- package/src/user.ts +0 -35
- package/src/vehicle.ts +0 -895
- package/src/vehiclesigned.ts +0 -20
- package/src/vehiclespecific.ts +0 -818
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import Energy from "./energy.mjs";
|
|
2
|
+
import { LiveStatusResponse } from "./types/live_status.mjs";
|
|
3
|
+
import { SiteInfoResponse } from "./types/site_info.mjs";
|
|
4
|
+
export default class EnergySpecific {
|
|
5
|
+
parent: Energy;
|
|
6
|
+
energy_site_id: number;
|
|
7
|
+
constructor(parent: Energy, energy_site_id: number);
|
|
8
|
+
/**
|
|
9
|
+
* Adjust the site's backup reserve.
|
|
10
|
+
* @param backup_reserve_percent The desired backup reserve percent.
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
backup(backup_reserve_percent: number): Promise<Record<string, any>>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the backup (off-grid) event history of the site in duration of seconds.
|
|
16
|
+
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
|
|
17
|
+
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
18
|
+
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
19
|
+
* @param period Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
|
|
20
|
+
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
backup_history(kind: string, start_date: string, end_date: string, period: string, time_zone: string): Promise<Record<string, any>>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the charging history of a wall connector.
|
|
26
|
+
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
|
|
27
|
+
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
28
|
+
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
29
|
+
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
charge_history(kind: string, start_date: string, end_date: string, time_zone: string): Promise<Record<string, any>>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the energy history of the site in duration of seconds.
|
|
35
|
+
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
|
|
36
|
+
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
37
|
+
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
38
|
+
* @param period Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
|
|
39
|
+
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
energy_history(kind: string, start_date: string, end_date: string, period: string, time_zone: string): Promise<Record<string, any>>;
|
|
43
|
+
/**
|
|
44
|
+
* Allow/disallow charging from the grid and exporting energy to the grid.
|
|
45
|
+
* @param disallow_charge_from_grid_with_solar_installed The desired behavior towards importing from the grid. Charging from the grid is disabled when set to true and enabled when set to false.
|
|
46
|
+
* @param customer_preferred_export_rule The desired behavior for grid exporting. The available options are battery_ok, pv_only, and never.
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
grid_import_export(disallow_charge_from_grid_with_solar_installed?: boolean | null, customer_preferred_export_rule?: string | null): Promise<Record<string, any>>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the live status of the site.
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
live_status(): Promise<LiveStatusResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Adjust the site's off-grid vehicle charging backup reserve.
|
|
57
|
+
* @param off_grid_vehicle_charging_reserve_percent The desired off grid vehicle charging reserve percent.
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
off_grid_vehicle_charging_reserve(off_grid_vehicle_charging_reserve_percent: number): Promise<Record<string, any>>;
|
|
61
|
+
/**
|
|
62
|
+
* Set the site's mode.
|
|
63
|
+
* @param default_real_mode
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
operation(default_real_mode: string): Promise<Record<string, any>>;
|
|
67
|
+
/**
|
|
68
|
+
* Returns information about the site. Things like assets (has solar, etc), settings (backup reserve, etc), and features (storm_mode_capable, etc).
|
|
69
|
+
*/
|
|
70
|
+
site_info(): Promise<SiteInfoResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Update storm watch participation.
|
|
73
|
+
* @param enabled The storm mode participation value to set.
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
storm_mode(enabled: boolean): Promise<Record<string, any>>;
|
|
77
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/energyspecific.ts
|
|
2
|
+
var EnergySpecific = class {
|
|
3
|
+
parent;
|
|
4
|
+
energy_site_id;
|
|
5
|
+
constructor(parent, energy_site_id) {
|
|
6
|
+
this.parent = parent;
|
|
7
|
+
this.energy_site_id = energy_site_id;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Adjust the site's backup reserve.
|
|
11
|
+
* @param backup_reserve_percent The desired backup reserve percent.
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
async backup(backup_reserve_percent) {
|
|
15
|
+
return this.parent.backup(this.energy_site_id, backup_reserve_percent);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the backup (off-grid) event history of the site in duration of seconds.
|
|
19
|
+
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
|
|
20
|
+
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
21
|
+
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
22
|
+
* @param period Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
|
|
23
|
+
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
async backup_history(kind, start_date, end_date, period, time_zone) {
|
|
27
|
+
return this.parent.backup_history(this.energy_site_id, kind, start_date, end_date, period, time_zone);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the charging history of a wall connector.
|
|
31
|
+
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
|
|
32
|
+
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
33
|
+
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
34
|
+
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
async charge_history(kind, start_date, end_date, time_zone) {
|
|
38
|
+
return this.parent.charge_history(this.energy_site_id, kind, start_date, end_date, time_zone);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns the energy history of the site in duration of seconds.
|
|
42
|
+
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
|
|
43
|
+
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
44
|
+
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
|
|
45
|
+
* @param period Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
|
|
46
|
+
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
async energy_history(kind, start_date, end_date, period, time_zone) {
|
|
50
|
+
return this.parent.energy_history(this.energy_site_id, kind, start_date, end_date, period, time_zone);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Allow/disallow charging from the grid and exporting energy to the grid.
|
|
54
|
+
* @param disallow_charge_from_grid_with_solar_installed The desired behavior towards importing from the grid. Charging from the grid is disabled when set to true and enabled when set to false.
|
|
55
|
+
* @param customer_preferred_export_rule The desired behavior for grid exporting. The available options are battery_ok, pv_only, and never.
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
async grid_import_export(disallow_charge_from_grid_with_solar_installed = null, customer_preferred_export_rule = null) {
|
|
59
|
+
return this.parent.grid_import_export(this.energy_site_id, disallow_charge_from_grid_with_solar_installed, customer_preferred_export_rule);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns the live status of the site.
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
async live_status() {
|
|
66
|
+
return this.parent.live_status(this.energy_site_id);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Adjust the site's off-grid vehicle charging backup reserve.
|
|
70
|
+
* @param off_grid_vehicle_charging_reserve_percent The desired off grid vehicle charging reserve percent.
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
async off_grid_vehicle_charging_reserve(off_grid_vehicle_charging_reserve_percent) {
|
|
74
|
+
return this.parent.off_grid_vehicle_charging_reserve(this.energy_site_id, off_grid_vehicle_charging_reserve_percent);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Set the site's mode.
|
|
78
|
+
* @param default_real_mode
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
async operation(default_real_mode) {
|
|
82
|
+
return this.parent.operation(this.energy_site_id, default_real_mode);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns information about the site. Things like assets (has solar, etc), settings (backup reserve, etc), and features (storm_mode_capable, etc).
|
|
86
|
+
*/
|
|
87
|
+
async site_info() {
|
|
88
|
+
return this.parent.site_info(this.energy_site_id);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Update storm watch participation.
|
|
92
|
+
* @param enabled The storm mode participation value to set.
|
|
93
|
+
* @returns
|
|
94
|
+
*/
|
|
95
|
+
async storm_mode(enabled) {
|
|
96
|
+
return this.parent.storm_mode(this.energy_site_id, enabled);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export { EnergySpecific as default };
|