tesla-fleet-api 0.3.0 → 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 -15
- package/dist/index.js +0 -15
- 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 -23
- package/dist/types/vehicle.js +0 -10
- 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 -774
- 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 -21
- 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 -33
- package/src/types/vehicle_data.ts +0 -286
- package/src/user.ts +0 -35
- package/src/vehicle.ts +0 -886
- package/src/vehiclesigned.ts +0 -20
- package/src/vehiclespecific.ts +0 -818
|
@@ -0,0 +1,1142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every error this library raises, ported class-for-class from
|
|
3
|
+
* `python-tesla-fleet-api`'s `exceptions.py` so a Python caller's
|
|
4
|
+
* `except X` maps one-to-one onto a JavaScript `instanceof X`.
|
|
5
|
+
*
|
|
6
|
+
* Each class carries its Python class attributes (`message`, `status`,
|
|
7
|
+
* `key`, `code`) as static fields, and every instance copies them, so both
|
|
8
|
+
* `err.status` and `InvalidCommand.key` work.
|
|
9
|
+
*/
|
|
10
|
+
/** The body or detail attached to an error: decoded JSON, raw text, or nothing. */
|
|
11
|
+
export type TeslaFleetErrorData = Record<string, unknown> | string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Base class for all Tesla exceptions.
|
|
14
|
+
*/
|
|
15
|
+
export declare class TeslaFleetError extends Error {
|
|
16
|
+
static readonly message: string;
|
|
17
|
+
static readonly status: number | null;
|
|
18
|
+
static readonly key: string | null;
|
|
19
|
+
static readonly code: number | null;
|
|
20
|
+
readonly data: TeslaFleetErrorData;
|
|
21
|
+
readonly status: number | null;
|
|
22
|
+
readonly key: string | null;
|
|
23
|
+
readonly code: number | null;
|
|
24
|
+
constructor(data?: TeslaFleetErrorData, status?: number | null, options?: ErrorOptions);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A request to the API could not be completed: `fetch` rejected (DNS,
|
|
28
|
+
* refused connection, TLS, reset) or the request timed out. The underlying
|
|
29
|
+
* error is kept as `cause`.
|
|
30
|
+
*/
|
|
31
|
+
export declare class TeslaFleetConnectionError extends TeslaFleetError {
|
|
32
|
+
static readonly message: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A cloud REST call was made on a vehicle that is only reachable over Bluetooth.
|
|
36
|
+
*/
|
|
37
|
+
export declare class BluetoothCloudUnavailableError extends TeslaFleetError {
|
|
38
|
+
static readonly message: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Bluetooth command timed out waiting for vehicle response.
|
|
42
|
+
*/
|
|
43
|
+
export declare class BluetoothTimeout extends TeslaFleetError {
|
|
44
|
+
static readonly message: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A mutating Bluetooth command has an unresolved outcome.
|
|
48
|
+
*
|
|
49
|
+
* The write either completed and its ack was lost, or it entered backend I/O
|
|
50
|
+
* and then failed/timed out in a way that cannot prove whether the vehicle
|
|
51
|
+
* received it. It can also have acknowledged the request without a required
|
|
52
|
+
* physical state check confirming completion. The vehicle may have executed
|
|
53
|
+
* the command - lock/unlock have both been observed to execute despite this
|
|
54
|
+
* error. Treat the outcome as unknown, not failed: verify by reading state
|
|
55
|
+
* back when possible, and never blind-retry or re-issue the same command on
|
|
56
|
+
* another transport, since it may already have run.
|
|
57
|
+
*
|
|
58
|
+
* Extends `BluetoothTimeout` so existing `instanceof BluetoothTimeout`
|
|
59
|
+
* handling still catches it, while remaining distinguishable from it (and
|
|
60
|
+
* from `BluetoothTransportError`, the provable pre-submission transport
|
|
61
|
+
* failure) via `unconfirmed` - e.g. a BLE-primary/cloud-fallback router should
|
|
62
|
+
* not fail over on this error, since failing over risks double-executing the
|
|
63
|
+
* command.
|
|
64
|
+
*/
|
|
65
|
+
export declare class BluetoothUnconfirmedCommand extends BluetoothTimeout {
|
|
66
|
+
static readonly message: string;
|
|
67
|
+
readonly unconfirmed = true;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A mutating Bluetooth command was proven NOT to have taken effect.
|
|
71
|
+
*
|
|
72
|
+
* Unlike `BluetoothUnconfirmedCommand` (ack lost, outcome unknown), this
|
|
73
|
+
* means a state check - a `confirmation="verify"` post-timeout read, or
|
|
74
|
+
* the vehicle's own status broadcast still showing a different value once
|
|
75
|
+
* the whole confirmation window elapsed - actively contradicted the
|
|
76
|
+
* requested end state. That makes it safe to fail over: a router replaying the
|
|
77
|
+
* command on a fallback transport is not at risk of double-executing an
|
|
78
|
+
* already-applied command, because this one demonstrably did not apply.
|
|
79
|
+
* Deliberately does NOT subclass `BluetoothTimeout`/
|
|
80
|
+
* `BluetoothUnconfirmedCommand` so a fallback router's per-command
|
|
81
|
+
* failover (which only special-cases the ambiguous case) treats it like any
|
|
82
|
+
* other ordinary failure and tries the next backend.
|
|
83
|
+
*/
|
|
84
|
+
export declare class BluetoothCommandFailed extends TeslaFleetError {
|
|
85
|
+
static readonly message: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The Bluetooth transport failed provably before the write reached the vehicle.
|
|
89
|
+
*
|
|
90
|
+
* Covers connect, notify-subscribe, and GATT characteristic-resolution
|
|
91
|
+
* failures - all raised by the local BLE stack before any bytes go out over
|
|
92
|
+
* the air, so a fallback router can safely retry the same command
|
|
93
|
+
* elsewhere. A GATT write that entered backend I/O and then failed or timed
|
|
94
|
+
* out is delivery-ambiguous instead (the write may have reached the
|
|
95
|
+
* vehicle) and raises `BluetoothTimeout`/`BluetoothUnconfirmedCommand`,
|
|
96
|
+
* not this class - see those exceptions.
|
|
97
|
+
*/
|
|
98
|
+
export declare class BluetoothTransportError extends TeslaFleetError {
|
|
99
|
+
static readonly message: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The response from the server was not JSON.
|
|
103
|
+
*/
|
|
104
|
+
export declare class ResponseError extends TeslaFleetError {
|
|
105
|
+
static readonly message: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The data request or command is unknown.
|
|
109
|
+
*/
|
|
110
|
+
export declare class InvalidCommand extends TeslaFleetError {
|
|
111
|
+
static readonly message: string;
|
|
112
|
+
static readonly status: number;
|
|
113
|
+
static readonly key: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A field in the input is not valid.
|
|
117
|
+
*/
|
|
118
|
+
export declare class InvalidField extends TeslaFleetError {
|
|
119
|
+
static readonly message: string;
|
|
120
|
+
static readonly status: number;
|
|
121
|
+
static readonly key: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The request body is not valid, a description giving a more specific error message may be returned.
|
|
125
|
+
*/
|
|
126
|
+
export declare class InvalidRequest extends TeslaFleetError {
|
|
127
|
+
static readonly message: string;
|
|
128
|
+
static readonly status: number;
|
|
129
|
+
static readonly key: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The "code" in request body is invalid, generate a new one and try again.
|
|
133
|
+
*/
|
|
134
|
+
export declare class InvalidAuthCode extends TeslaFleetError {
|
|
135
|
+
static readonly message: string;
|
|
136
|
+
static readonly status: number;
|
|
137
|
+
static readonly key: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Invalid redirect URI/URL. The authorize redirect URI and token redirect URI must match.
|
|
141
|
+
*/
|
|
142
|
+
export declare class InvalidRedirectUrl extends TeslaFleetError {
|
|
143
|
+
static readonly message: string;
|
|
144
|
+
static readonly status: number;
|
|
145
|
+
static readonly key: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* We don't recognize this client_id and client_secret combination. Use the client_id and client_secret that has been granted for the application.
|
|
149
|
+
*/
|
|
150
|
+
export declare class UnauthorizedClient extends TeslaFleetError {
|
|
151
|
+
static readonly message: string;
|
|
152
|
+
static readonly status: number;
|
|
153
|
+
static readonly key: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The vehicle has turned off remote access.
|
|
157
|
+
*/
|
|
158
|
+
export declare class MobileAccessDisabled extends TeslaFleetError {
|
|
159
|
+
static readonly message: string;
|
|
160
|
+
static readonly status: number;
|
|
161
|
+
static readonly key: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Third party specific error when no access token is provided.
|
|
165
|
+
*/
|
|
166
|
+
export declare class MissingToken extends TeslaFleetError {
|
|
167
|
+
static readonly message: string;
|
|
168
|
+
static readonly status: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Teslemetry specific error when no access token is provided.
|
|
172
|
+
*/
|
|
173
|
+
export declare class MissingTeslemetryToken extends MissingToken {
|
|
174
|
+
static readonly key: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Tessie specific error when no access token is provided.
|
|
178
|
+
*/
|
|
179
|
+
export declare class MissingTessieToken extends MissingToken {
|
|
180
|
+
static readonly key: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Third party specific error for invalid access token.
|
|
184
|
+
*/
|
|
185
|
+
export declare class InvalidToken extends TeslaFleetError {
|
|
186
|
+
static readonly message: string;
|
|
187
|
+
static readonly status: number;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Teslemetry specific error for invalid access token.
|
|
191
|
+
*/
|
|
192
|
+
export declare class InvalidTeslemetryToken extends InvalidToken {
|
|
193
|
+
static readonly key: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Tessie specific error for invalid access token.
|
|
197
|
+
*/
|
|
198
|
+
export declare class InvalidTessieToken extends InvalidToken {
|
|
199
|
+
static readonly key: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* The OAuth token is invalid.
|
|
203
|
+
*/
|
|
204
|
+
export declare class OAuthInvalid extends TeslaFleetError {
|
|
205
|
+
static readonly message: string;
|
|
206
|
+
static readonly status: number;
|
|
207
|
+
static readonly key: string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The OAuth token has expired.
|
|
211
|
+
*/
|
|
212
|
+
export declare class OAuthExpired extends TeslaFleetError {
|
|
213
|
+
static readonly message: string;
|
|
214
|
+
static readonly status: number;
|
|
215
|
+
static readonly key: string;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Teslemetry OAuth dynamic client registration (RFC 7591) failed.
|
|
219
|
+
*
|
|
220
|
+
* Covers a transport/timeout failure reaching the registration endpoint, a
|
|
221
|
+
* non-2xx response, a response body that isn't valid JSON, and a
|
|
222
|
+
* well-formed response missing a usable `client_id`. The specific reason
|
|
223
|
+
* is carried in `data`.
|
|
224
|
+
*/
|
|
225
|
+
export declare class TeslemetryRegistrationError extends TeslaFleetError {
|
|
226
|
+
static readonly message: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The user has reset their password and a new auth code is required, or the refresh_token has already been used.
|
|
230
|
+
*/
|
|
231
|
+
export declare class LoginRequired extends TeslaFleetError {
|
|
232
|
+
static readonly message: string;
|
|
233
|
+
static readonly status: number;
|
|
234
|
+
static readonly key: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Payment is required in order to use the API (non-free account only).
|
|
238
|
+
*/
|
|
239
|
+
export declare class PaymentRequired extends TeslaFleetError {
|
|
240
|
+
static readonly message: string;
|
|
241
|
+
static readonly status: number;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Subscription is required in order to use Teslemetry.
|
|
245
|
+
*/
|
|
246
|
+
export declare class SubscriptionRequired extends TeslaFleetError {
|
|
247
|
+
static readonly message: string;
|
|
248
|
+
static readonly status: number;
|
|
249
|
+
static readonly key: string;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Subscription is required in order to use Teslemetry.
|
|
253
|
+
*/
|
|
254
|
+
export declare class VehicleSubscriptionRequired extends TeslaFleetError {
|
|
255
|
+
static readonly message: string;
|
|
256
|
+
static readonly status: number;
|
|
257
|
+
static readonly key: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Account has insufficient credits to make this request.
|
|
261
|
+
*/
|
|
262
|
+
export declare class InsufficientCredits extends TeslaFleetError {
|
|
263
|
+
static readonly message: string;
|
|
264
|
+
static readonly status: number;
|
|
265
|
+
static readonly key: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Access to this resource is not authorized, developers should check required Scope.
|
|
269
|
+
*/
|
|
270
|
+
export declare class Forbidden extends TeslaFleetError {
|
|
271
|
+
static readonly message: string;
|
|
272
|
+
static readonly status: number;
|
|
273
|
+
static readonly key: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* The requested scopes are not granted.
|
|
277
|
+
*/
|
|
278
|
+
export declare class InvalidScope extends TeslaFleetError {
|
|
279
|
+
static readonly message: string;
|
|
280
|
+
static readonly status: number;
|
|
281
|
+
static readonly key: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* The vehicle is unsupported.
|
|
285
|
+
*/
|
|
286
|
+
export declare class UnsupportedVehicle extends TeslaFleetError {
|
|
287
|
+
static readonly message: string;
|
|
288
|
+
static readonly status: number;
|
|
289
|
+
static readonly key: string;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The requested resource does not exist.
|
|
293
|
+
*/
|
|
294
|
+
export declare class NotFound extends TeslaFleetError {
|
|
295
|
+
static readonly message: string;
|
|
296
|
+
static readonly status: number;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* The HTTP method is not allowed.
|
|
300
|
+
*/
|
|
301
|
+
export declare class InvalidMethod extends TeslaFleetError {
|
|
302
|
+
static readonly message: string;
|
|
303
|
+
static readonly status: number;
|
|
304
|
+
static readonly key: string;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* The operation is not allowed.
|
|
308
|
+
*/
|
|
309
|
+
export declare class NotAllowed extends TeslaFleetError {
|
|
310
|
+
static readonly message: string;
|
|
311
|
+
static readonly status: number;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* The HTTP request does not have a Content-Type header set to application/json.
|
|
315
|
+
*/
|
|
316
|
+
export declare class NotAcceptable extends TeslaFleetError {
|
|
317
|
+
static readonly message: string;
|
|
318
|
+
static readonly status: number;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* The vehicle is not "online.
|
|
322
|
+
*/
|
|
323
|
+
export declare class VehicleOffline extends TeslaFleetError {
|
|
324
|
+
static readonly message: string;
|
|
325
|
+
static readonly status: number;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* A condition has not been met to process the request.
|
|
329
|
+
*/
|
|
330
|
+
export declare class PreconditionFailed extends TeslaFleetError {
|
|
331
|
+
static readonly message: string;
|
|
332
|
+
static readonly status: number;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* This user is not present in the current region.
|
|
336
|
+
*/
|
|
337
|
+
export declare class InvalidRegion extends TeslaFleetError {
|
|
338
|
+
static readonly message: string;
|
|
339
|
+
static readonly status: number;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* There is a semantic problem with the data, e.g. missing or invalid data.
|
|
343
|
+
*/
|
|
344
|
+
export declare class InvalidResource extends TeslaFleetError {
|
|
345
|
+
static readonly message: string;
|
|
346
|
+
static readonly status: number;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Account is locked, and must be unlocked by Tesla.
|
|
350
|
+
*/
|
|
351
|
+
export declare class Locked extends TeslaFleetError {
|
|
352
|
+
static readonly message: string;
|
|
353
|
+
static readonly status: number;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* The response from Tesla was invalid.
|
|
357
|
+
*/
|
|
358
|
+
export declare class InvalidResponse extends TeslaFleetError {
|
|
359
|
+
static readonly message: string;
|
|
360
|
+
static readonly status: number;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Account or server is rate limited.
|
|
364
|
+
*/
|
|
365
|
+
export declare class RateLimited extends TeslaFleetError {
|
|
366
|
+
static readonly message: string;
|
|
367
|
+
static readonly status: number;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Querying for a user/vehicle without proper privacy settings.
|
|
371
|
+
*/
|
|
372
|
+
export declare class ResourceUnavailableForLegalReasons extends TeslaFleetError {
|
|
373
|
+
static readonly message: string;
|
|
374
|
+
static readonly status: number;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Client has closed the request before the server could send a response.
|
|
378
|
+
*/
|
|
379
|
+
export declare class ClientClosedRequest extends TeslaFleetError {
|
|
380
|
+
static readonly message: string;
|
|
381
|
+
static readonly status: number;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* An error occurred while processing the request.
|
|
385
|
+
*/
|
|
386
|
+
export declare class InternalServerError extends TeslaFleetError {
|
|
387
|
+
static readonly message: string;
|
|
388
|
+
static readonly status: number;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* The server, acting as a gateway, received an invalid response from an upstream server.
|
|
392
|
+
*/
|
|
393
|
+
export declare class BadGateway extends TeslaFleetError {
|
|
394
|
+
static readonly message: string;
|
|
395
|
+
static readonly status: number;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* The energy gateway is unreachable.
|
|
399
|
+
*/
|
|
400
|
+
export declare class EnergyGatewayUnreachable extends BadGateway {
|
|
401
|
+
static readonly message: string;
|
|
402
|
+
static readonly key: string;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Either an internal service or a vehicle did not respond (timeout).
|
|
406
|
+
*/
|
|
407
|
+
export declare class ServiceUnavailable extends TeslaFleetError {
|
|
408
|
+
static readonly message: string;
|
|
409
|
+
static readonly status: number;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Server did not receive a response.
|
|
413
|
+
*/
|
|
414
|
+
export declare class GatewayTimeout extends TeslaFleetError {
|
|
415
|
+
static readonly message: string;
|
|
416
|
+
static readonly status: number;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Vehicle responded with an error - might need a reboot, OTA update, or service.
|
|
420
|
+
*/
|
|
421
|
+
export declare class DeviceUnexpectedResponse extends TeslaFleetError {
|
|
422
|
+
static readonly message: string;
|
|
423
|
+
static readonly status: number;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Errors related to this library.
|
|
427
|
+
*/
|
|
428
|
+
export declare class LibraryError extends Error {
|
|
429
|
+
constructor(message?: string, options?: ErrorOptions);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* A signed operation was attempted on a vehicle constructed with signing
|
|
433
|
+
* explicitly disabled.
|
|
434
|
+
*/
|
|
435
|
+
export declare class SigningDisabled extends LibraryError {
|
|
436
|
+
constructor();
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* An existing private key file could not be loaded as a usable key.
|
|
440
|
+
*
|
|
441
|
+
* `reason` is one of `"unreadable"` (I/O failure), `"malformed"` (not valid
|
|
442
|
+
* PEM), `"encrypted"` (PEM requires a passphrase), or `"wrong_type"` (loaded
|
|
443
|
+
* key is not the expected type). A local key-file failure, not an upstream
|
|
444
|
+
* Fleet API error, so this extends `LibraryError` rather than
|
|
445
|
+
* `TeslaFleetError`.
|
|
446
|
+
*/
|
|
447
|
+
export declare class PrivateKeyError extends LibraryError {
|
|
448
|
+
readonly reason: string;
|
|
449
|
+
constructor(reason: string, message: string, options?: ErrorOptions);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* The requested action requires a signed command; the unsigned cloud API cannot actuate it.
|
|
453
|
+
*
|
|
454
|
+
* Energy gateways have been observed acknowledging this class of unsigned
|
|
455
|
+
* `grpc_command` without physically operating the grid contactor - see
|
|
456
|
+
* `EnergySite.set_island_mode`. Pair an RSA key with
|
|
457
|
+
* `EnergySite.add_authorized_client`, then either build the energy site
|
|
458
|
+
* with that `private_key` and its `din` to sign it through the cloud, or
|
|
459
|
+
* issue it through a signed local LAN backend (composed via
|
|
460
|
+
* `EnergySiteRouter`).
|
|
461
|
+
*/
|
|
462
|
+
export declare class SignedCommandRequired extends TeslaFleetError {
|
|
463
|
+
static readonly message: string;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* An energy gateway's presence-proof window expired before verification.
|
|
467
|
+
*
|
|
468
|
+
* The gateway itself reported the terminal `PENDING_VERIFICATION_TIMEOUT`
|
|
469
|
+
* state (`AuthorizedClientState`) - the ~9-minute window to confirm the
|
|
470
|
+
* key (typically via a physical breaker/switch toggle) closed with no
|
|
471
|
+
* confirmation. The registration is dead; re-register the *same* public
|
|
472
|
+
* key with `add_authorized_client` to reset the window and retry, rather
|
|
473
|
+
* than generating a new key.
|
|
474
|
+
*/
|
|
475
|
+
export declare class AuthorizedClientPairingTimedOut extends TeslaFleetError {
|
|
476
|
+
static readonly message: string;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* `wait_until_paired()`'s own bounded overall wait elapsed.
|
|
480
|
+
*
|
|
481
|
+
* Distinct from `AuthorizedClientPairingTimedOut`: the gateway had not
|
|
482
|
+
* reported a terminal state (the registration may still be alive, e.g.
|
|
483
|
+
* still `PENDING_VERIFICATION`, or the local `verify_by_use` check
|
|
484
|
+
* kept failing) when the caller's `timeout` ran out. Retry by calling
|
|
485
|
+
* `wait_until_paired()` again.
|
|
486
|
+
*/
|
|
487
|
+
export declare class AuthorizedClientWaitExpired extends TeslaFleetError {
|
|
488
|
+
static readonly message: string;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* A `session_info` reply failed local authentication and was discarded.
|
|
492
|
+
*
|
|
493
|
+
* Raised when the reply's `session_info_tag` HMAC does not verify, is
|
|
494
|
+
* absent, the echoed `request_uuid` does not match the outstanding
|
|
495
|
+
* request it claims to answer, or its clock time regresses within the same
|
|
496
|
+
* epoch. Also raised when the reply carries an empty `publicKey` (so no
|
|
497
|
+
* shared key can be derived to verify a tag) with a status other than
|
|
498
|
+
* `SESSION_INFO_STATUS_KEY_NOT_ON_WHITELIST`, which raises
|
|
499
|
+
* `NotOnWhitelistFault` instead. The session's prior state is left
|
|
500
|
+
* unmodified.
|
|
501
|
+
*/
|
|
502
|
+
export declare class SessionInfoAuthenticationFault extends TeslaFleetError {
|
|
503
|
+
static readonly message: string;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* A signed command response reused a counter value already seen on this session.
|
|
507
|
+
*
|
|
508
|
+
* protocol.md requires rejecting a response whose counter has previously
|
|
509
|
+
* been used, to prevent an attacker from replaying a captured encrypted
|
|
510
|
+
* response back at the client.
|
|
511
|
+
*/
|
|
512
|
+
export declare class SignedCommandResponseReplayed extends TeslaFleetError {
|
|
513
|
+
static readonly message: string;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Vehicle has responded with an error when sending a signed command
|
|
517
|
+
*/
|
|
518
|
+
export declare class TeslaFleetInformationFault extends TeslaFleetError {
|
|
519
|
+
static readonly message: string;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Unknown fault on signed command.
|
|
523
|
+
*/
|
|
524
|
+
export declare class UnknownFault extends TeslaFleetInformationFault {
|
|
525
|
+
static readonly message: string;
|
|
526
|
+
static readonly code: number;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Not on whitelist fault on signed command.
|
|
530
|
+
*/
|
|
531
|
+
export declare class NotOnWhitelistFault extends TeslaFleetInformationFault {
|
|
532
|
+
static readonly message: string;
|
|
533
|
+
static readonly code: number;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* IV smaller than expected fault on signed command.
|
|
537
|
+
*/
|
|
538
|
+
export declare class IVSmallerThanExpectedFault extends TeslaFleetInformationFault {
|
|
539
|
+
static readonly message: string;
|
|
540
|
+
static readonly code: number;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Invalid token fault on signed command.
|
|
544
|
+
*/
|
|
545
|
+
export declare class InvalidTokenFault extends TeslaFleetInformationFault {
|
|
546
|
+
static readonly message: string;
|
|
547
|
+
static readonly code: number;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Token and counter invalid fault on signed command.
|
|
551
|
+
*/
|
|
552
|
+
export declare class TokenAndCounterInvalidFault extends TeslaFleetInformationFault {
|
|
553
|
+
static readonly message: string;
|
|
554
|
+
static readonly code: number;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* AES decrypt auth fault on signed command.
|
|
558
|
+
*/
|
|
559
|
+
export declare class AESDecryptAuthFault extends TeslaFleetInformationFault {
|
|
560
|
+
static readonly message: string;
|
|
561
|
+
static readonly code: number;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* ECDSA input fault on signed command.
|
|
565
|
+
*/
|
|
566
|
+
export declare class ECDSAInputFault extends TeslaFleetInformationFault {
|
|
567
|
+
static readonly message: string;
|
|
568
|
+
static readonly code: number;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* ECDSA signature fault on signed command.
|
|
572
|
+
*/
|
|
573
|
+
export declare class ECDSASignatureFault extends TeslaFleetInformationFault {
|
|
574
|
+
static readonly message: string;
|
|
575
|
+
static readonly code: number;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Local entity start fault on signed command.
|
|
579
|
+
*/
|
|
580
|
+
export declare class LocalEntityStartFault extends TeslaFleetInformationFault {
|
|
581
|
+
static readonly message: string;
|
|
582
|
+
static readonly code: number;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Local entity result fault on signed command.
|
|
586
|
+
*/
|
|
587
|
+
export declare class LocalEntityResultFault extends TeslaFleetInformationFault {
|
|
588
|
+
static readonly message: string;
|
|
589
|
+
static readonly code: number;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Could not retrieve key fault on signed command.
|
|
593
|
+
*/
|
|
594
|
+
export declare class CouldNotRetrieveKeyFault extends TeslaFleetInformationFault {
|
|
595
|
+
static readonly message: string;
|
|
596
|
+
static readonly code: number;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Could not retrieve token fault on signed command.
|
|
600
|
+
*/
|
|
601
|
+
export declare class CouldNotRetrieveTokenFault extends TeslaFleetInformationFault {
|
|
602
|
+
static readonly message: string;
|
|
603
|
+
static readonly code: number;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Signature too short fault on signed command.
|
|
607
|
+
*/
|
|
608
|
+
export declare class SignatureTooShortFault extends TeslaFleetInformationFault {
|
|
609
|
+
static readonly message: string;
|
|
610
|
+
static readonly code: number;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Token is incorrect length fault on signed command.
|
|
614
|
+
*/
|
|
615
|
+
export declare class TokenIsIncorrectLengthFault extends TeslaFleetInformationFault {
|
|
616
|
+
static readonly message: string;
|
|
617
|
+
static readonly code: number;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Incorrect epoch fault on signed command.
|
|
621
|
+
*/
|
|
622
|
+
export declare class IncorrectEpochFault extends TeslaFleetInformationFault {
|
|
623
|
+
static readonly message: string;
|
|
624
|
+
static readonly code: number;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* IV incorrect length fault on signed command.
|
|
628
|
+
*/
|
|
629
|
+
export declare class IVIncorrectLengthFault extends TeslaFleetInformationFault {
|
|
630
|
+
static readonly message: string;
|
|
631
|
+
static readonly code: number;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Time expired fault on signed command.
|
|
635
|
+
*/
|
|
636
|
+
export declare class TimeExpiredFault extends TeslaFleetInformationFault {
|
|
637
|
+
static readonly message: string;
|
|
638
|
+
static readonly code: number;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Not provisioned with identity fault on signed command.
|
|
642
|
+
*/
|
|
643
|
+
export declare class NotProvisionedWithIdentityFault extends TeslaFleetInformationFault {
|
|
644
|
+
static readonly message: string;
|
|
645
|
+
static readonly code: number;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Could not hash metadata fault on signed command.
|
|
649
|
+
*/
|
|
650
|
+
export declare class CouldNotHashMetadataFault extends TeslaFleetInformationFault {
|
|
651
|
+
static readonly message: string;
|
|
652
|
+
static readonly code: number;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Vehicle has responded with an error when sending a signed command
|
|
656
|
+
*/
|
|
657
|
+
export declare class TeslaFleetMessageFault extends TeslaFleetError {
|
|
658
|
+
static readonly message: string;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Required vehicle subsystem is busy. Try again
|
|
662
|
+
*/
|
|
663
|
+
export declare class TeslaFleetMessageFaultBusy extends TeslaFleetMessageFault {
|
|
664
|
+
static readonly message: string;
|
|
665
|
+
static readonly code: number;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Vehicle subsystem did not respond. Try again
|
|
669
|
+
*/
|
|
670
|
+
export declare class TeslaFleetMessageFaultTimeout extends TeslaFleetMessageFault {
|
|
671
|
+
static readonly message: string;
|
|
672
|
+
static readonly code: number;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Vehicle did not recognize the key used to authorize command. Make sure your key is paired with the vehicle
|
|
676
|
+
*/
|
|
677
|
+
export declare class TeslaFleetMessageFaultUnknownKeyId extends TeslaFleetMessageFault {
|
|
678
|
+
static readonly message: string;
|
|
679
|
+
static readonly code: number;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Key used to authorize command has been disabled
|
|
683
|
+
*/
|
|
684
|
+
export declare class TeslaFleetMessageFaultInactiveKey extends TeslaFleetMessageFault {
|
|
685
|
+
static readonly message: string;
|
|
686
|
+
static readonly code: number;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Command signature/MAC is incorrect. Use included session info to update session and try again
|
|
690
|
+
*/
|
|
691
|
+
export declare class TeslaFleetMessageFaultInvalidSignature extends TeslaFleetMessageFault {
|
|
692
|
+
static readonly message: string;
|
|
693
|
+
static readonly code: number;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Command anti-replay counter has been used before. Use included session info to update session and try again
|
|
697
|
+
*/
|
|
698
|
+
export declare class TeslaFleetMessageFaultInvalidTokenOrCounter extends TeslaFleetMessageFault {
|
|
699
|
+
static readonly message: string;
|
|
700
|
+
static readonly code: number;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* User is not authorized to execute command. This can be because of the role or because of vehicle state
|
|
704
|
+
*/
|
|
705
|
+
export declare class TeslaFleetMessageFaultInsufficientPrivileges extends TeslaFleetMessageFault {
|
|
706
|
+
static readonly message: string;
|
|
707
|
+
static readonly code: number;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Command was malformed or addressed to an unrecognized vehicle system. May indicate client error or older vehicle firmware
|
|
711
|
+
*/
|
|
712
|
+
export declare class TeslaFleetMessageFaultInvalidDomains extends TeslaFleetMessageFault {
|
|
713
|
+
static readonly message: string;
|
|
714
|
+
static readonly code: number;
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Unrecognized command. May indicate client error or unsupported vehicle firmware
|
|
718
|
+
*/
|
|
719
|
+
export declare class TeslaFleetMessageFaultInvalidCommand extends TeslaFleetMessageFault {
|
|
720
|
+
static readonly message: string;
|
|
721
|
+
static readonly code: number;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Could not parse command. Indicates client error
|
|
725
|
+
*/
|
|
726
|
+
export declare class TeslaFleetMessageFaultDecoding extends TeslaFleetMessageFault {
|
|
727
|
+
static readonly message: string;
|
|
728
|
+
static readonly code: number;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Internal vehicle error. Try again. Most commonly encountered when the vehicle has not finished booting
|
|
732
|
+
*/
|
|
733
|
+
export declare class TeslaFleetMessageFaultInternal extends TeslaFleetMessageFault {
|
|
734
|
+
static readonly message: string;
|
|
735
|
+
static readonly code: number;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Command sent to wrong VIN
|
|
739
|
+
*/
|
|
740
|
+
export declare class TeslaFleetMessageFaultWrongPersonalization extends TeslaFleetMessageFault {
|
|
741
|
+
static readonly message: string;
|
|
742
|
+
static readonly code: number;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Command was malformed or used a deprecated parameter
|
|
746
|
+
*/
|
|
747
|
+
export declare class TeslaFleetMessageFaultBadParameter extends TeslaFleetMessageFault {
|
|
748
|
+
static readonly message: string;
|
|
749
|
+
static readonly code: number;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Vehicle's keychain is full. You must delete a key before you can add another
|
|
753
|
+
*/
|
|
754
|
+
export declare class TeslaFleetMessageFaultKeychainIsFull extends TeslaFleetMessageFault {
|
|
755
|
+
static readonly message: string;
|
|
756
|
+
static readonly code: number;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Session ID mismatch. Use included session info to update session and try again
|
|
760
|
+
*/
|
|
761
|
+
export declare class TeslaFleetMessageFaultIncorrectEpoch extends TeslaFleetMessageFault {
|
|
762
|
+
static readonly message: string;
|
|
763
|
+
static readonly code: number;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Initialization Value length is incorrect (AES-GCM must use 12-byte IVs). Indicates a client programming error
|
|
767
|
+
*/
|
|
768
|
+
export declare class TeslaFleetMessageFaultIVIncorrectLength extends TeslaFleetMessageFault {
|
|
769
|
+
static readonly message: string;
|
|
770
|
+
static readonly code: number;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Command expired. Use included session info to determine if clocks have desynchronized and try again
|
|
774
|
+
*/
|
|
775
|
+
export declare class TeslaFleetMessageFaultTimeExpired extends TeslaFleetMessageFault {
|
|
776
|
+
static readonly message: string;
|
|
777
|
+
static readonly code: number;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Vehicle has not been provisioned with a VIN and may require service
|
|
781
|
+
*/
|
|
782
|
+
export declare class TeslaFleetMessageFaultNotProvisionedWithIdentity extends TeslaFleetMessageFault {
|
|
783
|
+
static readonly message: string;
|
|
784
|
+
static readonly code: number;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Internal vehicle error
|
|
788
|
+
*/
|
|
789
|
+
export declare class TeslaFleetMessageFaultCouldNotHashMetadata extends TeslaFleetMessageFault {
|
|
790
|
+
static readonly message: string;
|
|
791
|
+
static readonly code: number;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* Vehicle rejected command because its expiration time was too far in the future. This is a security precaution
|
|
795
|
+
*/
|
|
796
|
+
export declare class TeslaFleetMessageFaultTimeToLiveTooLong extends TeslaFleetMessageFault {
|
|
797
|
+
static readonly message: string;
|
|
798
|
+
static readonly code: number;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* The vehicle owner has disabled Mobile access
|
|
802
|
+
*/
|
|
803
|
+
export declare class TeslaFleetMessageFaultRemoteAccessDisabled extends TeslaFleetMessageFault {
|
|
804
|
+
static readonly message: string;
|
|
805
|
+
static readonly code: number;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* The command was authorized with a Service key, but the vehicle has not been configured to permit remote service commands
|
|
809
|
+
*/
|
|
810
|
+
export declare class TeslaFleetMessageFaultRemoteServiceAccessDisabled extends TeslaFleetMessageFault {
|
|
811
|
+
static readonly message: string;
|
|
812
|
+
static readonly code: number;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* The command requires proof of Tesla account credentials but was not sent over a channel that provides this proof. Resend the command using Fleet API
|
|
816
|
+
*/
|
|
817
|
+
export declare class TeslaFleetMessageFaultCommandRequiresAccountCredentials extends TeslaFleetMessageFault {
|
|
818
|
+
static readonly message: string;
|
|
819
|
+
static readonly code: number;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Client sent a request with a field that exceeds MTU
|
|
823
|
+
*/
|
|
824
|
+
export declare class TeslaFleetMessageFaultFieldExceedsMTU extends TeslaFleetMessageFault {
|
|
825
|
+
static readonly message: string;
|
|
826
|
+
static readonly code: number;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Client's request was received, but response size exceeded MTU
|
|
830
|
+
*/
|
|
831
|
+
export declare class TeslaFleetMessageFaultResponseSizeExceedsMTU extends TeslaFleetMessageFault {
|
|
832
|
+
static readonly message: string;
|
|
833
|
+
static readonly code: number;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* The vehicle has seen this counter value before. Reset the counter and try again
|
|
837
|
+
*/
|
|
838
|
+
export declare class TeslaFleetMessageFaultRepeatedCounter extends TeslaFleetMessageFault {
|
|
839
|
+
static readonly message: string;
|
|
840
|
+
static readonly code: number;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* The key handle is not valid. The key may have been revoked or expired
|
|
844
|
+
*/
|
|
845
|
+
export declare class TeslaFleetMessageFaultInvalidKeyHandle extends TeslaFleetMessageFault {
|
|
846
|
+
static readonly message: string;
|
|
847
|
+
static readonly code: number;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* The response requires encryption but encryption was not requested
|
|
851
|
+
*/
|
|
852
|
+
export declare class TeslaFleetMessageFaultRequiresResponseEncryption extends TeslaFleetMessageFault {
|
|
853
|
+
static readonly message: string;
|
|
854
|
+
static readonly code: number;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Vehicle has responded with an error when sending a signed command
|
|
858
|
+
*/
|
|
859
|
+
export declare class SignedMessageInformationFault extends TeslaFleetError {
|
|
860
|
+
static readonly message: string;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Unknown fault on signed command.
|
|
864
|
+
*/
|
|
865
|
+
export declare class SignedMessageInformationFaultUnknown extends SignedMessageInformationFault {
|
|
866
|
+
static readonly message: string;
|
|
867
|
+
static readonly code: number;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Not on whitelist fault on signed command.
|
|
871
|
+
*/
|
|
872
|
+
export declare class SignedMessageInformationFaultNotOnWhitelist extends SignedMessageInformationFault {
|
|
873
|
+
static readonly message: string;
|
|
874
|
+
static readonly code: number;
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* IV smaller than expected fault on signed command.
|
|
878
|
+
*/
|
|
879
|
+
export declare class SignedMessageInformationFaultIVSmallerThanExpected extends SignedMessageInformationFault {
|
|
880
|
+
static readonly message: string;
|
|
881
|
+
static readonly code: number;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Invalid token fault on signed command.
|
|
885
|
+
*/
|
|
886
|
+
export declare class SignedMessageInformationFaultInvalidToken extends SignedMessageInformationFault {
|
|
887
|
+
static readonly message: string;
|
|
888
|
+
static readonly code: number;
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Token and counter invalid fault on signed command.
|
|
892
|
+
*/
|
|
893
|
+
export declare class SignedMessageInformationFaultTokenAndCounterInvalid extends SignedMessageInformationFault {
|
|
894
|
+
static readonly message: string;
|
|
895
|
+
static readonly code: number;
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* AES decrypt auth fault on signed command.
|
|
899
|
+
*/
|
|
900
|
+
export declare class SignedMessageInformationFaultAESDecryptAuth extends SignedMessageInformationFault {
|
|
901
|
+
static readonly message: string;
|
|
902
|
+
static readonly code: number;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* ECDSA input fault on signed command.
|
|
906
|
+
*/
|
|
907
|
+
export declare class SignedMessageInformationFaultECDSAInput extends SignedMessageInformationFault {
|
|
908
|
+
static readonly message: string;
|
|
909
|
+
static readonly code: number;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* ECDSA signature fault on signed command.
|
|
913
|
+
*/
|
|
914
|
+
export declare class SignedMessageInformationFaultECDSASignature extends SignedMessageInformationFault {
|
|
915
|
+
static readonly message: string;
|
|
916
|
+
static readonly code: number;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Local entity start fault on signed command.
|
|
920
|
+
*/
|
|
921
|
+
export declare class SignedMessageInformationFaultLocalEntityStart extends SignedMessageInformationFault {
|
|
922
|
+
static readonly message: string;
|
|
923
|
+
static readonly code: number;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Local entity result fault on signed command.
|
|
927
|
+
*/
|
|
928
|
+
export declare class SignedMessageInformationFaultLocalEntityResult extends SignedMessageInformationFault {
|
|
929
|
+
static readonly message: string;
|
|
930
|
+
static readonly code: number;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Could not retrieve key fault on signed command.
|
|
934
|
+
*/
|
|
935
|
+
export declare class SignedMessageInformationFaultCouldNotRetrieveKey extends SignedMessageInformationFault {
|
|
936
|
+
static readonly message: string;
|
|
937
|
+
static readonly code: number;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Could not retrieve token fault on signed command.
|
|
941
|
+
*/
|
|
942
|
+
export declare class SignedMessageInformationFaultCouldNotRetrieveToken extends SignedMessageInformationFault {
|
|
943
|
+
static readonly message: string;
|
|
944
|
+
static readonly code: number;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Signature too short fault on signed command.
|
|
948
|
+
*/
|
|
949
|
+
export declare class SignedMessageInformationFaultSignatureTooShort extends SignedMessageInformationFault {
|
|
950
|
+
static readonly message: string;
|
|
951
|
+
static readonly code: number;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Token is incorrect length fault on signed command.
|
|
955
|
+
*/
|
|
956
|
+
export declare class SignedMessageInformationFaultTokenIsIncorrectLength extends SignedMessageInformationFault {
|
|
957
|
+
static readonly message: string;
|
|
958
|
+
static readonly code: number;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Incorrect epoch fault on signed command.
|
|
962
|
+
*/
|
|
963
|
+
export declare class SignedMessageInformationFaultIncorrectEpoch extends SignedMessageInformationFault {
|
|
964
|
+
static readonly message: string;
|
|
965
|
+
static readonly code: number;
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* IV incorrect length fault on signed command.
|
|
969
|
+
*/
|
|
970
|
+
export declare class SignedMessageInformationFaultIVIncorrectLength extends SignedMessageInformationFault {
|
|
971
|
+
static readonly message: string;
|
|
972
|
+
static readonly code: number;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Time expired fault on signed command.
|
|
976
|
+
*/
|
|
977
|
+
export declare class SignedMessageInformationFaultTimeExpired extends SignedMessageInformationFault {
|
|
978
|
+
static readonly message: string;
|
|
979
|
+
static readonly code: number;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Not provisioned with identity fault on signed command.
|
|
983
|
+
*/
|
|
984
|
+
export declare class SignedMessageInformationFaultNotProvisionedWithIdentity extends SignedMessageInformationFault {
|
|
985
|
+
static readonly message: string;
|
|
986
|
+
static readonly code: number;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Could not hash metadata fault on signed command.
|
|
990
|
+
*/
|
|
991
|
+
export declare class SignedMessageInformationFaultCouldNotHashMetadata extends SignedMessageInformationFault {
|
|
992
|
+
static readonly message: string;
|
|
993
|
+
static readonly code: number;
|
|
994
|
+
}
|
|
995
|
+
export declare class WhitelistOperationStatus extends TeslaFleetError {
|
|
996
|
+
static readonly message: string;
|
|
997
|
+
}
|
|
998
|
+
export declare class WhitelistOperationUndocumentedError extends WhitelistOperationStatus {
|
|
999
|
+
static readonly message: string;
|
|
1000
|
+
static readonly code: number;
|
|
1001
|
+
}
|
|
1002
|
+
export declare class WhitelistOperationNoPermissionToRemoveOneself extends WhitelistOperationStatus {
|
|
1003
|
+
static readonly message: string;
|
|
1004
|
+
static readonly code: number;
|
|
1005
|
+
}
|
|
1006
|
+
export declare class WhitelistOperationKeyfobSlotsFull extends WhitelistOperationStatus {
|
|
1007
|
+
static readonly message: string;
|
|
1008
|
+
static readonly code: number;
|
|
1009
|
+
}
|
|
1010
|
+
export declare class WhitelistOperationWhitelistFull extends WhitelistOperationStatus {
|
|
1011
|
+
static readonly message: string;
|
|
1012
|
+
static readonly code: number;
|
|
1013
|
+
}
|
|
1014
|
+
export declare class WhitelistOperationNoPermissionToAdd extends WhitelistOperationStatus {
|
|
1015
|
+
static readonly message: string;
|
|
1016
|
+
static readonly code: number;
|
|
1017
|
+
}
|
|
1018
|
+
export declare class WhitelistOperationInvalidPublicKey extends WhitelistOperationStatus {
|
|
1019
|
+
static readonly message: string;
|
|
1020
|
+
static readonly code: number;
|
|
1021
|
+
}
|
|
1022
|
+
export declare class WhitelistOperationNoPermissionToRemove extends WhitelistOperationStatus {
|
|
1023
|
+
static readonly message: string;
|
|
1024
|
+
static readonly code: number;
|
|
1025
|
+
}
|
|
1026
|
+
export declare class WhitelistOperationNoPermissionToChangePermissions extends WhitelistOperationStatus {
|
|
1027
|
+
static readonly message: string;
|
|
1028
|
+
static readonly code: number;
|
|
1029
|
+
}
|
|
1030
|
+
export declare class WhitelistOperationAttemptingToElevateOthersAboveOneself extends WhitelistOperationStatus {
|
|
1031
|
+
static readonly message: string;
|
|
1032
|
+
static readonly code: number;
|
|
1033
|
+
}
|
|
1034
|
+
export declare class WhitelistOperationAttemptingToDemoteSuperiorToOneself extends WhitelistOperationStatus {
|
|
1035
|
+
static readonly message: string;
|
|
1036
|
+
static readonly code: number;
|
|
1037
|
+
}
|
|
1038
|
+
export declare class WhitelistOperationAttemptingToRemoveOwnPermissions extends WhitelistOperationStatus {
|
|
1039
|
+
static readonly message: string;
|
|
1040
|
+
static readonly code: number;
|
|
1041
|
+
}
|
|
1042
|
+
export declare class WhitelistOperationPublicKeyNotOnWhitelist extends WhitelistOperationStatus {
|
|
1043
|
+
static readonly message: string;
|
|
1044
|
+
static readonly code: number;
|
|
1045
|
+
}
|
|
1046
|
+
export declare class WhitelistOperationAttemptingToAddExistingKey extends WhitelistOperationStatus {
|
|
1047
|
+
static readonly message: string;
|
|
1048
|
+
static readonly code: number;
|
|
1049
|
+
}
|
|
1050
|
+
export declare class WhitelistOperationNotAllowedToAddUnlessOnReader extends WhitelistOperationStatus {
|
|
1051
|
+
static readonly message: string;
|
|
1052
|
+
static readonly code: number;
|
|
1053
|
+
}
|
|
1054
|
+
export declare class WhitelistOperationFMModifyingOutsideOfFMode extends WhitelistOperationStatus {
|
|
1055
|
+
static readonly message: string;
|
|
1056
|
+
static readonly code: number;
|
|
1057
|
+
}
|
|
1058
|
+
export declare class WhitelistOperationFMAttemptingToAddPermanentKey extends WhitelistOperationStatus {
|
|
1059
|
+
static readonly message: string;
|
|
1060
|
+
static readonly code: number;
|
|
1061
|
+
}
|
|
1062
|
+
export declare class WhitelistOperationFMAttemptingToRemovePermanentKey extends WhitelistOperationStatus {
|
|
1063
|
+
static readonly message: string;
|
|
1064
|
+
static readonly code: number;
|
|
1065
|
+
}
|
|
1066
|
+
export declare class WhitelistOperationKeychainWhileFSFull extends WhitelistOperationStatus {
|
|
1067
|
+
static readonly message: string;
|
|
1068
|
+
static readonly code: number;
|
|
1069
|
+
}
|
|
1070
|
+
export declare class WhitelistOperationAttemptingToAddKeyWithoutRole extends WhitelistOperationStatus {
|
|
1071
|
+
static readonly message: string;
|
|
1072
|
+
static readonly code: number;
|
|
1073
|
+
}
|
|
1074
|
+
export declare class WhitelistOperationAttemptingToAddKeyWithServiceRole extends WhitelistOperationStatus {
|
|
1075
|
+
static readonly message: string;
|
|
1076
|
+
static readonly code: number;
|
|
1077
|
+
}
|
|
1078
|
+
export declare class WhitelistOperationNonServiceKeyAttemptingToAddServiceTech extends WhitelistOperationStatus {
|
|
1079
|
+
static readonly message: string;
|
|
1080
|
+
static readonly code: number;
|
|
1081
|
+
}
|
|
1082
|
+
export declare class WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode extends WhitelistOperationStatus {
|
|
1083
|
+
static readonly message: string;
|
|
1084
|
+
static readonly code: number;
|
|
1085
|
+
}
|
|
1086
|
+
export declare class WhitelistOperationCouldNotStartLocalEntityAuth extends WhitelistOperationStatus {
|
|
1087
|
+
static readonly message: string;
|
|
1088
|
+
static readonly code: number;
|
|
1089
|
+
}
|
|
1090
|
+
export declare class WhitelistOperationLocalEntityAuthFailedUIDenied extends WhitelistOperationStatus {
|
|
1091
|
+
static readonly message: string;
|
|
1092
|
+
static readonly code: number;
|
|
1093
|
+
}
|
|
1094
|
+
export declare class WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap extends WhitelistOperationStatus {
|
|
1095
|
+
static readonly message: string;
|
|
1096
|
+
static readonly code: number;
|
|
1097
|
+
}
|
|
1098
|
+
export declare class WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck extends WhitelistOperationStatus {
|
|
1099
|
+
static readonly message: string;
|
|
1100
|
+
static readonly code: number;
|
|
1101
|
+
}
|
|
1102
|
+
export declare class WhitelistOperationLocalEntityAuthFailedValetMode extends WhitelistOperationStatus {
|
|
1103
|
+
static readonly message: string;
|
|
1104
|
+
static readonly code: number;
|
|
1105
|
+
}
|
|
1106
|
+
export declare class WhitelistOperationLocalEntityAuthFailedCancelled extends WhitelistOperationStatus {
|
|
1107
|
+
static readonly message: string;
|
|
1108
|
+
static readonly code: number;
|
|
1109
|
+
}
|
|
1110
|
+
/** `TeslaFleetInformationFault` subclasses indexed by their protobuf enum value; index 0 (no fault) is `null`. */
|
|
1111
|
+
export declare const INFORMATION_FAULTS: readonly (typeof TeslaFleetInformationFault | null)[];
|
|
1112
|
+
/** `TeslaFleetMessageFault` subclasses indexed by their protobuf enum value; index 0 (no fault) is `null`. */
|
|
1113
|
+
export declare const MESSAGE_FAULTS: readonly (typeof TeslaFleetMessageFault | null)[];
|
|
1114
|
+
/** `SignedMessageInformationFault` subclasses indexed by their protobuf enum value; index 0 (no fault) is `null`. */
|
|
1115
|
+
export declare const SIGNED_MESSAGE_INFORMATION_FAULTS: readonly (typeof SignedMessageInformationFault | null)[];
|
|
1116
|
+
/** `WhitelistOperationStatus` subclasses indexed by their protobuf enum value; index 0 (no fault) is `null`. */
|
|
1117
|
+
export declare const WHITELIST_OPERATION_STATUS: readonly (typeof WhitelistOperationStatus | null)[];
|
|
1118
|
+
/**
|
|
1119
|
+
* Every fault a vehicle can return that means it did not recognize/accept our
|
|
1120
|
+
* signing key as authorized to issue commands, verified against each fault's
|
|
1121
|
+
* proto enum meaning rather than its name alone.
|
|
1122
|
+
* `TeslaFleetMessageFaultKeychainIsFull` is deliberately excluded: its proto
|
|
1123
|
+
* meaning is "no room to add another key", not "this key was rejected".
|
|
1124
|
+
*/
|
|
1125
|
+
export declare const KEY_REJECTED_FAULTS: readonly (typeof TeslaFleetError)[];
|
|
1126
|
+
/**
|
|
1127
|
+
* Whether `error` means the vehicle rejected our signing key.
|
|
1128
|
+
*
|
|
1129
|
+
* True for a fault meaning the vehicle does not recognize our key as
|
|
1130
|
+
* whitelisted/paired (or could not retrieve/validate it), false for every
|
|
1131
|
+
* other fault, including transport errors and faults about an unrelated
|
|
1132
|
+
* signed-command condition (e.g. a full keychain).
|
|
1133
|
+
*/
|
|
1134
|
+
export declare function is_key_rejected(error: unknown): boolean;
|
|
1135
|
+
/**
|
|
1136
|
+
* Throw the `TeslaFleetError` subclass matching `resp` if its status is >= 400.
|
|
1137
|
+
* https://developer.tesla.com/docs/fleet-api#response-codes
|
|
1138
|
+
*
|
|
1139
|
+
* Consumes the response body when it throws; resolves without touching the
|
|
1140
|
+
* body otherwise.
|
|
1141
|
+
*/
|
|
1142
|
+
export declare function raise_for_status(resp: Response): Promise<void>;
|