@teslemetry/api 0.2.0 → 0.2.2
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/index.cjs +5 -3
- package/dist/index.d.cts +152 -43
- package/dist/index.d.mts +152 -43
- package/dist/index.mjs +5 -3
- package/package.json +8 -2
package/dist/index.cjs
CHANGED
|
@@ -4984,7 +4984,7 @@ const consoleLogger = {
|
|
|
4984
4984
|
|
|
4985
4985
|
//#endregion
|
|
4986
4986
|
//#region package.json
|
|
4987
|
-
var version = "0.
|
|
4987
|
+
var version = "0.2.2";
|
|
4988
4988
|
|
|
4989
4989
|
//#endregion
|
|
4990
4990
|
//#region src/Teslemetry.ts
|
|
@@ -5055,12 +5055,14 @@ var Teslemetry = class {
|
|
|
5055
5055
|
name: product.display_name ?? useTeslaModel(product.vin),
|
|
5056
5056
|
vin: product.vin,
|
|
5057
5057
|
api: this.api.getVehicle(product.vin),
|
|
5058
|
-
sse: this.sse.getVehicle(product.vin)
|
|
5058
|
+
sse: this.sse.getVehicle(product.vin),
|
|
5059
|
+
product
|
|
5059
5060
|
};
|
|
5060
5061
|
if (product.device_type === "energy") result.energySites[product.energy_site_id] = {
|
|
5061
5062
|
name: product.site_name ?? "Unnamed",
|
|
5062
5063
|
site: product.energy_site_id,
|
|
5063
|
-
api: this.api.getEnergySite(product.energy_site_id)
|
|
5064
|
+
api: this.api.getEnergySite(product.energy_site_id),
|
|
5065
|
+
product
|
|
5064
5066
|
};
|
|
5065
5067
|
});
|
|
5066
5068
|
return result;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
//#region src/client/types.gen.d.ts
|
|
2
2
|
|
|
3
|
+
type GetApi1ProductsResponses = {
|
|
4
|
+
/**
|
|
5
|
+
* Default Response
|
|
6
|
+
*/
|
|
7
|
+
200: {
|
|
8
|
+
response: Array<{
|
|
9
|
+
id: number;
|
|
10
|
+
user_id: number;
|
|
11
|
+
vehicle_id: number;
|
|
12
|
+
vin: string;
|
|
13
|
+
color: null;
|
|
14
|
+
access_type: null | string;
|
|
15
|
+
display_name: string;
|
|
16
|
+
option_codes: null | string;
|
|
17
|
+
cached_data: null | string | {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
mobile_access_disabled: boolean;
|
|
21
|
+
granular_access: {
|
|
22
|
+
hide_private: boolean;
|
|
23
|
+
};
|
|
24
|
+
tokens: null;
|
|
25
|
+
state: string;
|
|
26
|
+
in_service: boolean;
|
|
27
|
+
id_s: string;
|
|
28
|
+
calendar_enabled: boolean;
|
|
29
|
+
api_version: number;
|
|
30
|
+
backseat_token: null;
|
|
31
|
+
backseat_token_updated_at: null;
|
|
32
|
+
ble_autopair_enrolled: boolean;
|
|
33
|
+
device_type: 'vehicle';
|
|
34
|
+
command_signing: string;
|
|
35
|
+
release_notes_supported?: boolean;
|
|
36
|
+
share_type_s?: string;
|
|
37
|
+
bnd_enrolled?: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
energy_site_id: number;
|
|
40
|
+
device_type: 'energy';
|
|
41
|
+
resource_type: string;
|
|
42
|
+
site_name?: string;
|
|
43
|
+
id: string;
|
|
44
|
+
gateway_id?: string;
|
|
45
|
+
asset_site_id: string;
|
|
46
|
+
warp_site_number: string;
|
|
47
|
+
percentage_charged?: number;
|
|
48
|
+
battery_type?: string;
|
|
49
|
+
battery_power?: number;
|
|
50
|
+
go_off_grid_test_banner_enabled: null;
|
|
51
|
+
storm_mode_enabled: boolean | null;
|
|
52
|
+
powerwall_onboarding_settings_set: boolean | null;
|
|
53
|
+
powerwall_tesla_electric_interested_in: null;
|
|
54
|
+
vpp_tour_enabled: null;
|
|
55
|
+
components: {
|
|
56
|
+
battery: boolean;
|
|
57
|
+
battery_type?: string;
|
|
58
|
+
solar: boolean;
|
|
59
|
+
solar_type?: string;
|
|
60
|
+
grid: boolean;
|
|
61
|
+
load_meter: boolean;
|
|
62
|
+
market_type: string;
|
|
63
|
+
gateways?: Array<{
|
|
64
|
+
device_id: string;
|
|
65
|
+
din: string;
|
|
66
|
+
serial_number: string;
|
|
67
|
+
part_number: string;
|
|
68
|
+
is_active: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
wall_connectors?: Array<{
|
|
71
|
+
device_id: string;
|
|
72
|
+
din: string;
|
|
73
|
+
serial_number: string;
|
|
74
|
+
part_number: string;
|
|
75
|
+
is_active: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
inverters?: Array<{
|
|
78
|
+
device_id: string;
|
|
79
|
+
din: string;
|
|
80
|
+
serial_number: string;
|
|
81
|
+
part_number: string;
|
|
82
|
+
is_active: boolean;
|
|
83
|
+
site_id: string;
|
|
84
|
+
firmware_version?: string;
|
|
85
|
+
}>;
|
|
86
|
+
generator?: boolean;
|
|
87
|
+
};
|
|
88
|
+
features: {
|
|
89
|
+
rate_plan_manager_no_pricing_constraint?: boolean;
|
|
90
|
+
};
|
|
91
|
+
solar_power?: number;
|
|
92
|
+
charge_on_solar_capable?: boolean;
|
|
93
|
+
grid_installation_id?: string;
|
|
94
|
+
solar_type?: string;
|
|
95
|
+
}>;
|
|
96
|
+
count?: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
3
99
|
type GetApiConfigByVinResponses = {
|
|
4
100
|
/**
|
|
5
101
|
* Default Response
|
|
@@ -8889,7 +8985,29 @@ declare class TeslemetryVehicleApi {
|
|
|
8889
8985
|
* Wakes the vehicle from sleep. This command costs 20 command credits
|
|
8890
8986
|
* @return Promise to an object with response containing wake up confirmation
|
|
8891
8987
|
*/
|
|
8892
|
-
wakeUp(): Promise<
|
|
8988
|
+
wakeUp(): Promise<{
|
|
8989
|
+
response?: {
|
|
8990
|
+
id?: number;
|
|
8991
|
+
vehicle_id?: number;
|
|
8992
|
+
vin?: string;
|
|
8993
|
+
color?: string | null;
|
|
8994
|
+
access_type?: string;
|
|
8995
|
+
display_name?: string | null;
|
|
8996
|
+
option_codes?: string | null;
|
|
8997
|
+
granular_access?: {
|
|
8998
|
+
hide_private?: boolean;
|
|
8999
|
+
};
|
|
9000
|
+
tokens?: null;
|
|
9001
|
+
state?: string;
|
|
9002
|
+
in_service?: boolean;
|
|
9003
|
+
id_s?: string;
|
|
9004
|
+
calendar_enabled?: boolean;
|
|
9005
|
+
api_version?: number;
|
|
9006
|
+
backseat_token?: string | null;
|
|
9007
|
+
backseat_token_updated_at?: string | null;
|
|
9008
|
+
ble_autopair_enrolled?: boolean;
|
|
9009
|
+
};
|
|
9010
|
+
}>;
|
|
8893
9011
|
/**
|
|
8894
9012
|
* Fetches a vehicle's fleet telemetry config.
|
|
8895
9013
|
* @return Promise to an object with response containing fleet telemetry configuration
|
|
@@ -10823,9 +10941,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10823
10941
|
*/
|
|
10824
10942
|
ping(): Promise<{
|
|
10825
10943
|
response: {
|
|
10826
|
-
result: boolean
|
|
10827
|
-
[key: string]: unknown;
|
|
10828
|
-
};
|
|
10944
|
+
result: boolean;
|
|
10829
10945
|
reason?: string;
|
|
10830
10946
|
};
|
|
10831
10947
|
}>;
|
|
@@ -10836,9 +10952,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10836
10952
|
*/
|
|
10837
10953
|
closure(body: PostApi1VehiclesByVinCustomCommandClosureData["body"]): Promise<{
|
|
10838
10954
|
response: {
|
|
10839
|
-
result: boolean
|
|
10840
|
-
[key: string]: unknown;
|
|
10841
|
-
};
|
|
10955
|
+
result: boolean;
|
|
10842
10956
|
reason?: string;
|
|
10843
10957
|
};
|
|
10844
10958
|
}>;
|
|
@@ -10849,9 +10963,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10849
10963
|
*/
|
|
10850
10964
|
setSeatHeaters(body: PostApi1VehiclesByVinCustomCommandSeatHeaterData["body"]): Promise<{
|
|
10851
10965
|
response: {
|
|
10852
|
-
result: boolean
|
|
10853
|
-
[key: string]: unknown;
|
|
10854
|
-
};
|
|
10966
|
+
result: boolean;
|
|
10855
10967
|
reason?: string;
|
|
10856
10968
|
};
|
|
10857
10969
|
}>;
|
|
@@ -10864,9 +10976,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10864
10976
|
*/
|
|
10865
10977
|
chargeOnSolar(enabled?: boolean, lowerChargeLimit?: number, upperChargeLimit?: number): Promise<{
|
|
10866
10978
|
response: {
|
|
10867
|
-
result: boolean
|
|
10868
|
-
[key: string]: unknown;
|
|
10869
|
-
};
|
|
10979
|
+
result: boolean;
|
|
10870
10980
|
reason?: string;
|
|
10871
10981
|
};
|
|
10872
10982
|
}>;
|
|
@@ -10876,9 +10986,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10876
10986
|
*/
|
|
10877
10987
|
dashcamSave(): Promise<{
|
|
10878
10988
|
response: {
|
|
10879
|
-
result: boolean
|
|
10880
|
-
[key: string]: unknown;
|
|
10881
|
-
};
|
|
10989
|
+
result: boolean;
|
|
10882
10990
|
reason?: string;
|
|
10883
10991
|
};
|
|
10884
10992
|
}>;
|
|
@@ -10889,9 +10997,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10889
10997
|
*/
|
|
10890
10998
|
playVideo(url: string): Promise<{
|
|
10891
10999
|
response: {
|
|
10892
|
-
result: boolean
|
|
10893
|
-
[key: string]: unknown;
|
|
10894
|
-
};
|
|
11000
|
+
result: boolean;
|
|
10895
11001
|
reason?: string;
|
|
10896
11002
|
};
|
|
10897
11003
|
}>;
|
|
@@ -10901,9 +11007,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10901
11007
|
*/
|
|
10902
11008
|
stopLightShow(): Promise<{
|
|
10903
11009
|
response: {
|
|
10904
|
-
result: boolean
|
|
10905
|
-
[key: string]: unknown;
|
|
10906
|
-
};
|
|
11010
|
+
result: boolean;
|
|
10907
11011
|
reason?: string;
|
|
10908
11012
|
};
|
|
10909
11013
|
}>;
|
|
@@ -10917,9 +11021,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10917
11021
|
*/
|
|
10918
11022
|
startLightShow(show_index: number, start_time?: number, volume?: number, dance_moves?: boolean): Promise<{
|
|
10919
11023
|
response: {
|
|
10920
|
-
result: boolean
|
|
10921
|
-
[key: string]: unknown;
|
|
10922
|
-
};
|
|
11024
|
+
result: boolean;
|
|
10923
11025
|
reason?: string;
|
|
10924
11026
|
};
|
|
10925
11027
|
}>;
|
|
@@ -10930,9 +11032,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10930
11032
|
*/
|
|
10931
11033
|
clearPinToDrive(pin: string): Promise<{
|
|
10932
11034
|
response: {
|
|
10933
|
-
result: boolean
|
|
10934
|
-
[key: string]: unknown;
|
|
10935
|
-
};
|
|
11035
|
+
result: boolean;
|
|
10936
11036
|
reason?: string;
|
|
10937
11037
|
};
|
|
10938
11038
|
}>;
|
|
@@ -10942,9 +11042,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10942
11042
|
*/
|
|
10943
11043
|
removeAllImpermanentKeys(): Promise<{
|
|
10944
11044
|
response: {
|
|
10945
|
-
result: boolean
|
|
10946
|
-
[key: string]: unknown;
|
|
10947
|
-
};
|
|
11045
|
+
result: boolean;
|
|
10948
11046
|
reason?: string;
|
|
10949
11047
|
};
|
|
10950
11048
|
}>;
|
|
@@ -11000,18 +11098,29 @@ type SseConfig = ExtractSse<{
|
|
|
11000
11098
|
type FieldsResponse = GetApiConfigByVinResponses[200]["fields"];
|
|
11001
11099
|
type FieldsRequest = NonNullable<NonNullable<PatchApiConfigByVinData["body"]>["fields"]>;
|
|
11002
11100
|
type Signals = keyof SseData["data"];
|
|
11101
|
+
type ProductsResponse = GetApi1ProductsResponses[200]["response"];
|
|
11102
|
+
type VehicleProduct = Extract<ProductsResponse[number], {
|
|
11103
|
+
device_type: "vehicle";
|
|
11104
|
+
}>;
|
|
11105
|
+
type EnergyProduct = Extract<ProductsResponse[number], {
|
|
11106
|
+
device_type: "energy";
|
|
11107
|
+
}>;
|
|
11108
|
+
interface VehicleDetails {
|
|
11109
|
+
name: string;
|
|
11110
|
+
vin: string;
|
|
11111
|
+
api: TeslemetryVehicleApi;
|
|
11112
|
+
sse: TeslemetryVehicleStream;
|
|
11113
|
+
product: VehicleProduct;
|
|
11114
|
+
}
|
|
11115
|
+
interface EnergyDetails {
|
|
11116
|
+
name: string;
|
|
11117
|
+
site: number;
|
|
11118
|
+
api: TeslemetryEnergyApi;
|
|
11119
|
+
product: EnergyProduct;
|
|
11120
|
+
}
|
|
11003
11121
|
interface Products {
|
|
11004
|
-
vehicles: Record<string,
|
|
11005
|
-
|
|
11006
|
-
vin: string;
|
|
11007
|
-
api: TeslemetryVehicleApi;
|
|
11008
|
-
sse: TeslemetryVehicleStream;
|
|
11009
|
-
}>;
|
|
11010
|
-
energySites: Record<string, {
|
|
11011
|
-
name: string;
|
|
11012
|
-
site: number;
|
|
11013
|
-
api: TeslemetryEnergyApi;
|
|
11014
|
-
}>;
|
|
11122
|
+
vehicles: Record<string, VehicleDetails>;
|
|
11123
|
+
energySites: Record<string, EnergyDetails>;
|
|
11015
11124
|
}
|
|
11016
11125
|
//#endregion
|
|
11017
11126
|
//#region src/logger.d.ts
|
|
@@ -11846,4 +11955,4 @@ declare class ValueError extends Error {
|
|
|
11846
11955
|
constructor(message: string);
|
|
11847
11956
|
}
|
|
11848
11957
|
//#endregion
|
|
11849
|
-
export { FieldsRequest, FieldsResponse, Products, Signals, SseAlerts, SseConfig, SseConnectivity, SseCredits, SseData, SseErrors, SseEvent, SseState, SseVehicleData, Teslemetry, TeslemetryApi, TeslemetryEnergyApi, TeslemetryStream, TeslemetryStreamConnectionError, TeslemetryStreamEnded, TeslemetryStreamError, TeslemetryVehicleApi, TeslemetryVehicleStream, TeslemetryVehicleStreamNotConfigured, ValueError };
|
|
11958
|
+
export { type EnergyDetails, FieldsRequest, FieldsResponse, type Products, Signals, SseAlerts, SseConfig, SseConnectivity, SseCredits, SseData, SseErrors, SseEvent, SseState, SseVehicleData, Teslemetry, TeslemetryApi, TeslemetryEnergyApi, TeslemetryStream, TeslemetryStreamConnectionError, TeslemetryStreamEnded, TeslemetryStreamError, TeslemetryVehicleApi, TeslemetryVehicleStream, TeslemetryVehicleStreamNotConfigured, ValueError, type VehicleDetails };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
//#region src/client/types.gen.d.ts
|
|
2
2
|
|
|
3
|
+
type GetApi1ProductsResponses = {
|
|
4
|
+
/**
|
|
5
|
+
* Default Response
|
|
6
|
+
*/
|
|
7
|
+
200: {
|
|
8
|
+
response: Array<{
|
|
9
|
+
id: number;
|
|
10
|
+
user_id: number;
|
|
11
|
+
vehicle_id: number;
|
|
12
|
+
vin: string;
|
|
13
|
+
color: null;
|
|
14
|
+
access_type: null | string;
|
|
15
|
+
display_name: string;
|
|
16
|
+
option_codes: null | string;
|
|
17
|
+
cached_data: null | string | {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
mobile_access_disabled: boolean;
|
|
21
|
+
granular_access: {
|
|
22
|
+
hide_private: boolean;
|
|
23
|
+
};
|
|
24
|
+
tokens: null;
|
|
25
|
+
state: string;
|
|
26
|
+
in_service: boolean;
|
|
27
|
+
id_s: string;
|
|
28
|
+
calendar_enabled: boolean;
|
|
29
|
+
api_version: number;
|
|
30
|
+
backseat_token: null;
|
|
31
|
+
backseat_token_updated_at: null;
|
|
32
|
+
ble_autopair_enrolled: boolean;
|
|
33
|
+
device_type: 'vehicle';
|
|
34
|
+
command_signing: string;
|
|
35
|
+
release_notes_supported?: boolean;
|
|
36
|
+
share_type_s?: string;
|
|
37
|
+
bnd_enrolled?: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
energy_site_id: number;
|
|
40
|
+
device_type: 'energy';
|
|
41
|
+
resource_type: string;
|
|
42
|
+
site_name?: string;
|
|
43
|
+
id: string;
|
|
44
|
+
gateway_id?: string;
|
|
45
|
+
asset_site_id: string;
|
|
46
|
+
warp_site_number: string;
|
|
47
|
+
percentage_charged?: number;
|
|
48
|
+
battery_type?: string;
|
|
49
|
+
battery_power?: number;
|
|
50
|
+
go_off_grid_test_banner_enabled: null;
|
|
51
|
+
storm_mode_enabled: boolean | null;
|
|
52
|
+
powerwall_onboarding_settings_set: boolean | null;
|
|
53
|
+
powerwall_tesla_electric_interested_in: null;
|
|
54
|
+
vpp_tour_enabled: null;
|
|
55
|
+
components: {
|
|
56
|
+
battery: boolean;
|
|
57
|
+
battery_type?: string;
|
|
58
|
+
solar: boolean;
|
|
59
|
+
solar_type?: string;
|
|
60
|
+
grid: boolean;
|
|
61
|
+
load_meter: boolean;
|
|
62
|
+
market_type: string;
|
|
63
|
+
gateways?: Array<{
|
|
64
|
+
device_id: string;
|
|
65
|
+
din: string;
|
|
66
|
+
serial_number: string;
|
|
67
|
+
part_number: string;
|
|
68
|
+
is_active: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
wall_connectors?: Array<{
|
|
71
|
+
device_id: string;
|
|
72
|
+
din: string;
|
|
73
|
+
serial_number: string;
|
|
74
|
+
part_number: string;
|
|
75
|
+
is_active: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
inverters?: Array<{
|
|
78
|
+
device_id: string;
|
|
79
|
+
din: string;
|
|
80
|
+
serial_number: string;
|
|
81
|
+
part_number: string;
|
|
82
|
+
is_active: boolean;
|
|
83
|
+
site_id: string;
|
|
84
|
+
firmware_version?: string;
|
|
85
|
+
}>;
|
|
86
|
+
generator?: boolean;
|
|
87
|
+
};
|
|
88
|
+
features: {
|
|
89
|
+
rate_plan_manager_no_pricing_constraint?: boolean;
|
|
90
|
+
};
|
|
91
|
+
solar_power?: number;
|
|
92
|
+
charge_on_solar_capable?: boolean;
|
|
93
|
+
grid_installation_id?: string;
|
|
94
|
+
solar_type?: string;
|
|
95
|
+
}>;
|
|
96
|
+
count?: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
3
99
|
type GetApiConfigByVinResponses = {
|
|
4
100
|
/**
|
|
5
101
|
* Default Response
|
|
@@ -8889,7 +8985,29 @@ declare class TeslemetryVehicleApi {
|
|
|
8889
8985
|
* Wakes the vehicle from sleep. This command costs 20 command credits
|
|
8890
8986
|
* @return Promise to an object with response containing wake up confirmation
|
|
8891
8987
|
*/
|
|
8892
|
-
wakeUp(): Promise<
|
|
8988
|
+
wakeUp(): Promise<{
|
|
8989
|
+
response?: {
|
|
8990
|
+
id?: number;
|
|
8991
|
+
vehicle_id?: number;
|
|
8992
|
+
vin?: string;
|
|
8993
|
+
color?: string | null;
|
|
8994
|
+
access_type?: string;
|
|
8995
|
+
display_name?: string | null;
|
|
8996
|
+
option_codes?: string | null;
|
|
8997
|
+
granular_access?: {
|
|
8998
|
+
hide_private?: boolean;
|
|
8999
|
+
};
|
|
9000
|
+
tokens?: null;
|
|
9001
|
+
state?: string;
|
|
9002
|
+
in_service?: boolean;
|
|
9003
|
+
id_s?: string;
|
|
9004
|
+
calendar_enabled?: boolean;
|
|
9005
|
+
api_version?: number;
|
|
9006
|
+
backseat_token?: string | null;
|
|
9007
|
+
backseat_token_updated_at?: string | null;
|
|
9008
|
+
ble_autopair_enrolled?: boolean;
|
|
9009
|
+
};
|
|
9010
|
+
}>;
|
|
8893
9011
|
/**
|
|
8894
9012
|
* Fetches a vehicle's fleet telemetry config.
|
|
8895
9013
|
* @return Promise to an object with response containing fleet telemetry configuration
|
|
@@ -10823,9 +10941,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10823
10941
|
*/
|
|
10824
10942
|
ping(): Promise<{
|
|
10825
10943
|
response: {
|
|
10826
|
-
result: boolean
|
|
10827
|
-
[key: string]: unknown;
|
|
10828
|
-
};
|
|
10944
|
+
result: boolean;
|
|
10829
10945
|
reason?: string;
|
|
10830
10946
|
};
|
|
10831
10947
|
}>;
|
|
@@ -10836,9 +10952,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10836
10952
|
*/
|
|
10837
10953
|
closure(body: PostApi1VehiclesByVinCustomCommandClosureData["body"]): Promise<{
|
|
10838
10954
|
response: {
|
|
10839
|
-
result: boolean
|
|
10840
|
-
[key: string]: unknown;
|
|
10841
|
-
};
|
|
10955
|
+
result: boolean;
|
|
10842
10956
|
reason?: string;
|
|
10843
10957
|
};
|
|
10844
10958
|
}>;
|
|
@@ -10849,9 +10963,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10849
10963
|
*/
|
|
10850
10964
|
setSeatHeaters(body: PostApi1VehiclesByVinCustomCommandSeatHeaterData["body"]): Promise<{
|
|
10851
10965
|
response: {
|
|
10852
|
-
result: boolean
|
|
10853
|
-
[key: string]: unknown;
|
|
10854
|
-
};
|
|
10966
|
+
result: boolean;
|
|
10855
10967
|
reason?: string;
|
|
10856
10968
|
};
|
|
10857
10969
|
}>;
|
|
@@ -10864,9 +10976,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10864
10976
|
*/
|
|
10865
10977
|
chargeOnSolar(enabled?: boolean, lowerChargeLimit?: number, upperChargeLimit?: number): Promise<{
|
|
10866
10978
|
response: {
|
|
10867
|
-
result: boolean
|
|
10868
|
-
[key: string]: unknown;
|
|
10869
|
-
};
|
|
10979
|
+
result: boolean;
|
|
10870
10980
|
reason?: string;
|
|
10871
10981
|
};
|
|
10872
10982
|
}>;
|
|
@@ -10876,9 +10986,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10876
10986
|
*/
|
|
10877
10987
|
dashcamSave(): Promise<{
|
|
10878
10988
|
response: {
|
|
10879
|
-
result: boolean
|
|
10880
|
-
[key: string]: unknown;
|
|
10881
|
-
};
|
|
10989
|
+
result: boolean;
|
|
10882
10990
|
reason?: string;
|
|
10883
10991
|
};
|
|
10884
10992
|
}>;
|
|
@@ -10889,9 +10997,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10889
10997
|
*/
|
|
10890
10998
|
playVideo(url: string): Promise<{
|
|
10891
10999
|
response: {
|
|
10892
|
-
result: boolean
|
|
10893
|
-
[key: string]: unknown;
|
|
10894
|
-
};
|
|
11000
|
+
result: boolean;
|
|
10895
11001
|
reason?: string;
|
|
10896
11002
|
};
|
|
10897
11003
|
}>;
|
|
@@ -10901,9 +11007,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10901
11007
|
*/
|
|
10902
11008
|
stopLightShow(): Promise<{
|
|
10903
11009
|
response: {
|
|
10904
|
-
result: boolean
|
|
10905
|
-
[key: string]: unknown;
|
|
10906
|
-
};
|
|
11010
|
+
result: boolean;
|
|
10907
11011
|
reason?: string;
|
|
10908
11012
|
};
|
|
10909
11013
|
}>;
|
|
@@ -10917,9 +11021,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10917
11021
|
*/
|
|
10918
11022
|
startLightShow(show_index: number, start_time?: number, volume?: number, dance_moves?: boolean): Promise<{
|
|
10919
11023
|
response: {
|
|
10920
|
-
result: boolean
|
|
10921
|
-
[key: string]: unknown;
|
|
10922
|
-
};
|
|
11024
|
+
result: boolean;
|
|
10923
11025
|
reason?: string;
|
|
10924
11026
|
};
|
|
10925
11027
|
}>;
|
|
@@ -10930,9 +11032,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10930
11032
|
*/
|
|
10931
11033
|
clearPinToDrive(pin: string): Promise<{
|
|
10932
11034
|
response: {
|
|
10933
|
-
result: boolean
|
|
10934
|
-
[key: string]: unknown;
|
|
10935
|
-
};
|
|
11035
|
+
result: boolean;
|
|
10936
11036
|
reason?: string;
|
|
10937
11037
|
};
|
|
10938
11038
|
}>;
|
|
@@ -10942,9 +11042,7 @@ declare class TeslemetryVehicleApi {
|
|
|
10942
11042
|
*/
|
|
10943
11043
|
removeAllImpermanentKeys(): Promise<{
|
|
10944
11044
|
response: {
|
|
10945
|
-
result: boolean
|
|
10946
|
-
[key: string]: unknown;
|
|
10947
|
-
};
|
|
11045
|
+
result: boolean;
|
|
10948
11046
|
reason?: string;
|
|
10949
11047
|
};
|
|
10950
11048
|
}>;
|
|
@@ -11000,18 +11098,29 @@ type SseConfig = ExtractSse<{
|
|
|
11000
11098
|
type FieldsResponse = GetApiConfigByVinResponses[200]["fields"];
|
|
11001
11099
|
type FieldsRequest = NonNullable<NonNullable<PatchApiConfigByVinData["body"]>["fields"]>;
|
|
11002
11100
|
type Signals = keyof SseData["data"];
|
|
11101
|
+
type ProductsResponse = GetApi1ProductsResponses[200]["response"];
|
|
11102
|
+
type VehicleProduct = Extract<ProductsResponse[number], {
|
|
11103
|
+
device_type: "vehicle";
|
|
11104
|
+
}>;
|
|
11105
|
+
type EnergyProduct = Extract<ProductsResponse[number], {
|
|
11106
|
+
device_type: "energy";
|
|
11107
|
+
}>;
|
|
11108
|
+
interface VehicleDetails {
|
|
11109
|
+
name: string;
|
|
11110
|
+
vin: string;
|
|
11111
|
+
api: TeslemetryVehicleApi;
|
|
11112
|
+
sse: TeslemetryVehicleStream;
|
|
11113
|
+
product: VehicleProduct;
|
|
11114
|
+
}
|
|
11115
|
+
interface EnergyDetails {
|
|
11116
|
+
name: string;
|
|
11117
|
+
site: number;
|
|
11118
|
+
api: TeslemetryEnergyApi;
|
|
11119
|
+
product: EnergyProduct;
|
|
11120
|
+
}
|
|
11003
11121
|
interface Products {
|
|
11004
|
-
vehicles: Record<string,
|
|
11005
|
-
|
|
11006
|
-
vin: string;
|
|
11007
|
-
api: TeslemetryVehicleApi;
|
|
11008
|
-
sse: TeslemetryVehicleStream;
|
|
11009
|
-
}>;
|
|
11010
|
-
energySites: Record<string, {
|
|
11011
|
-
name: string;
|
|
11012
|
-
site: number;
|
|
11013
|
-
api: TeslemetryEnergyApi;
|
|
11014
|
-
}>;
|
|
11122
|
+
vehicles: Record<string, VehicleDetails>;
|
|
11123
|
+
energySites: Record<string, EnergyDetails>;
|
|
11015
11124
|
}
|
|
11016
11125
|
//#endregion
|
|
11017
11126
|
//#region src/logger.d.ts
|
|
@@ -11846,4 +11955,4 @@ declare class ValueError extends Error {
|
|
|
11846
11955
|
constructor(message: string);
|
|
11847
11956
|
}
|
|
11848
11957
|
//#endregion
|
|
11849
|
-
export { FieldsRequest, FieldsResponse, Products, Signals, SseAlerts, SseConfig, SseConnectivity, SseCredits, SseData, SseErrors, SseEvent, SseState, SseVehicleData, Teslemetry, TeslemetryApi, TeslemetryEnergyApi, TeslemetryStream, TeslemetryStreamConnectionError, TeslemetryStreamEnded, TeslemetryStreamError, TeslemetryVehicleApi, TeslemetryVehicleStream, TeslemetryVehicleStreamNotConfigured, ValueError };
|
|
11958
|
+
export { type EnergyDetails, FieldsRequest, FieldsResponse, type Products, Signals, SseAlerts, SseConfig, SseConnectivity, SseCredits, SseData, SseErrors, SseEvent, SseState, SseVehicleData, Teslemetry, TeslemetryApi, TeslemetryEnergyApi, TeslemetryStream, TeslemetryStreamConnectionError, TeslemetryStreamEnded, TeslemetryStreamError, TeslemetryVehicleApi, TeslemetryVehicleStream, TeslemetryVehicleStreamNotConfigured, ValueError, type VehicleDetails };
|
package/dist/index.mjs
CHANGED
|
@@ -4983,7 +4983,7 @@ const consoleLogger = {
|
|
|
4983
4983
|
|
|
4984
4984
|
//#endregion
|
|
4985
4985
|
//#region package.json
|
|
4986
|
-
var version = "0.
|
|
4986
|
+
var version = "0.2.2";
|
|
4987
4987
|
|
|
4988
4988
|
//#endregion
|
|
4989
4989
|
//#region src/Teslemetry.ts
|
|
@@ -5054,12 +5054,14 @@ var Teslemetry = class {
|
|
|
5054
5054
|
name: product.display_name ?? useTeslaModel(product.vin),
|
|
5055
5055
|
vin: product.vin,
|
|
5056
5056
|
api: this.api.getVehicle(product.vin),
|
|
5057
|
-
sse: this.sse.getVehicle(product.vin)
|
|
5057
|
+
sse: this.sse.getVehicle(product.vin),
|
|
5058
|
+
product
|
|
5058
5059
|
};
|
|
5059
5060
|
if (product.device_type === "energy") result.energySites[product.energy_site_id] = {
|
|
5060
5061
|
name: product.site_name ?? "Unnamed",
|
|
5061
5062
|
site: product.energy_site_id,
|
|
5062
|
-
api: this.api.getEnergySite(product.energy_site_id)
|
|
5063
|
+
api: this.api.getEnergySite(product.energy_site_id),
|
|
5064
|
+
product
|
|
5063
5065
|
};
|
|
5064
5066
|
});
|
|
5065
5067
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teslemetry/api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "API client for Teslemetry",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,8 +29,14 @@
|
|
|
29
29
|
"url": "https://teslemetry.com"
|
|
30
30
|
},
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/Teslemetry/typescript-teslemetry"
|
|
35
|
+
},
|
|
36
|
+
"bugs": "https://github.com/Teslemetry/typescript-teslemetry/issues/new?template=api_bug.yml",
|
|
32
37
|
"publishConfig": {
|
|
33
|
-
"access": "public"
|
|
38
|
+
"access": "public",
|
|
39
|
+
"provenance": true
|
|
34
40
|
},
|
|
35
41
|
"devDependencies": {
|
|
36
42
|
"@hey-api/openapi-ts": "0.88.0",
|