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.
Files changed (192) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +22 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +12 -0
  3. package/dist/charging.cjs +53 -0
  4. package/dist/charging.d.cts +31 -0
  5. package/dist/charging.d.mts +30 -0
  6. package/dist/charging.mjs +53 -0
  7. package/dist/commands.cjs +802 -0
  8. package/dist/commands.d.cts +350 -0
  9. package/dist/commands.d.mts +349 -0
  10. package/dist/commands.mjs +800 -0
  11. package/dist/const.cjs +300 -0
  12. package/dist/const.d.cts +287 -0
  13. package/dist/const.d.mts +287 -0
  14. package/dist/const.mjs +263 -0
  15. package/dist/energy.cjs +137 -0
  16. package/dist/energy.d.cts +95 -0
  17. package/{src/energy.ts → dist/energy.d.mts} +17 -140
  18. package/dist/energy.mjs +137 -0
  19. package/dist/energyspecific.cjs +99 -0
  20. package/dist/energyspecific.d.cts +78 -0
  21. package/dist/energyspecific.d.mts +77 -0
  22. package/dist/energyspecific.mjs +99 -0
  23. package/dist/exceptions.cjs +1487 -0
  24. package/dist/exceptions.d.cts +1142 -0
  25. package/dist/exceptions.d.mts +1142 -0
  26. package/dist/exceptions.mjs +1324 -0
  27. package/dist/index.cjs +226 -0
  28. package/dist/index.d.cts +14 -0
  29. package/dist/index.d.mts +14 -0
  30. package/dist/index.mjs +14 -0
  31. package/dist/partner.cjs +32 -0
  32. package/dist/partner.d.cts +24 -0
  33. package/dist/partner.d.mts +23 -0
  34. package/dist/partner.mjs +32 -0
  35. package/dist/router.cjs +0 -0
  36. package/dist/router.d.cts +1 -0
  37. package/dist/router.d.mts +1 -0
  38. package/dist/router.mjs +1 -0
  39. package/dist/signing/crypto.cjs +31 -0
  40. package/dist/signing/crypto.mjs +27 -0
  41. package/dist/signing/session.cjs +112 -0
  42. package/dist/signing/session.d.cts +69 -0
  43. package/dist/signing/session.d.mts +69 -0
  44. package/dist/signing/session.mjs +110 -0
  45. package/dist/tariff.cjs +292 -0
  46. package/dist/{tariff.d.ts → tariff.d.cts} +17 -17
  47. package/dist/tariff.d.mts +29 -0
  48. package/dist/tariff.mjs +291 -0
  49. package/dist/teslafleetapi.cjs +125 -0
  50. package/dist/teslafleetapi.d.cts +64 -0
  51. package/dist/teslafleetapi.d.mts +64 -0
  52. package/dist/teslafleetapi.mjs +125 -0
  53. package/dist/teslemetry.cjs +36 -0
  54. package/dist/teslemetry.d.cts +23 -0
  55. package/dist/teslemetry.d.mts +23 -0
  56. package/dist/teslemetry.mjs +36 -0
  57. package/dist/tessie.cjs +34 -0
  58. package/dist/tessie.d.cts +23 -0
  59. package/dist/tessie.d.mts +23 -0
  60. package/dist/tessie.mjs +34 -0
  61. package/dist/types/commands.d.cts +28 -0
  62. package/dist/types/commands.d.mts +28 -0
  63. package/dist/types/live_status.d.cts +30 -0
  64. package/dist/types/live_status.d.mts +30 -0
  65. package/dist/types/products.d.cts +58 -0
  66. package/dist/types/products.d.mts +58 -0
  67. package/dist/types/responses.d.cts +9 -0
  68. package/dist/types/responses.d.mts +9 -0
  69. package/dist/types/site_info.d.cts +154 -0
  70. package/dist/types/site_info.d.mts +154 -0
  71. package/dist/types/vehicle.d.cts +27 -0
  72. package/dist/types/vehicle.d.mts +27 -0
  73. package/dist/types/vehicle_data.d.cts +278 -0
  74. package/dist/types/vehicle_data.d.mts +278 -0
  75. package/dist/types.cjs +0 -0
  76. package/dist/types.d.cts +9 -0
  77. package/dist/types.d.mts +9 -0
  78. package/dist/types.mjs +1 -0
  79. package/dist/user.cjs +28 -0
  80. package/dist/user.d.cts +17 -0
  81. package/dist/user.d.mts +16 -0
  82. package/dist/user.mjs +28 -0
  83. package/dist/vehicle.cjs +804 -0
  84. package/dist/vehicle.d.cts +550 -0
  85. package/dist/vehicle.d.mts +549 -0
  86. package/dist/vehicle.mjs +804 -0
  87. package/dist/vehiclesigned.cjs +20 -0
  88. package/dist/vehiclesigned.d.cts +14 -0
  89. package/dist/{vehiclesigned.d.ts → vehiclesigned.d.mts} +3 -3
  90. package/dist/vehiclesigned.mjs +20 -0
  91. package/dist/vehiclespecific.cjs +604 -0
  92. package/dist/vehiclespecific.d.cts +433 -0
  93. package/dist/vehiclespecific.d.mts +432 -0
  94. package/dist/vehiclespecific.mjs +604 -0
  95. package/package.json +108 -35
  96. package/dist/charging.d.ts +0 -30
  97. package/dist/charging.js +0 -51
  98. package/dist/charging.js.map +0 -1
  99. package/dist/commands.d.ts +0 -352
  100. package/dist/commands.js +0 -875
  101. package/dist/commands.js.map +0 -1
  102. package/dist/energy.d.ts +0 -94
  103. package/dist/energy.js +0 -125
  104. package/dist/energy.js.map +0 -1
  105. package/dist/energyspecific.d.ts +0 -77
  106. package/dist/energyspecific.js +0 -97
  107. package/dist/energyspecific.js.map +0 -1
  108. package/dist/helpers.d.ts +0 -2
  109. package/dist/helpers.js +0 -10
  110. package/dist/helpers.js.map +0 -1
  111. package/dist/index.d.ts +0 -15
  112. package/dist/index.js +0 -15
  113. package/dist/index.js.map +0 -1
  114. package/dist/partner.d.ts +0 -23
  115. package/dist/partner.js +0 -31
  116. package/dist/partner.js.map +0 -1
  117. package/dist/signing/crypto.d.ts +0 -10
  118. package/dist/signing/crypto.js +0 -26
  119. package/dist/signing/crypto.js.map +0 -1
  120. package/dist/signing/errors.d.ts +0 -29
  121. package/dist/signing/errors.js +0 -40
  122. package/dist/signing/errors.js.map +0 -1
  123. package/dist/signing/session.d.ts +0 -69
  124. package/dist/signing/session.js +0 -102
  125. package/dist/signing/session.js.map +0 -1
  126. package/dist/tariff.js +0 -302
  127. package/dist/tariff.js.map +0 -1
  128. package/dist/teslafleetapi.d.ts +0 -58
  129. package/dist/teslafleetapi.js +0 -120
  130. package/dist/teslafleetapi.js.map +0 -1
  131. package/dist/teslemetry.d.ts +0 -29
  132. package/dist/teslemetry.js +0 -39
  133. package/dist/teslemetry.js.map +0 -1
  134. package/dist/tessie.d.ts +0 -23
  135. package/dist/tessie.js +0 -28
  136. package/dist/tessie.js.map +0 -1
  137. package/dist/types/commands.d.ts +0 -44
  138. package/dist/types/commands.js +0 -11
  139. package/dist/types/commands.js.map +0 -1
  140. package/dist/types/live_status.d.ts +0 -26
  141. package/dist/types/live_status.js +0 -2
  142. package/dist/types/live_status.js.map +0 -1
  143. package/dist/types/products.d.ts +0 -54
  144. package/dist/types/products.js +0 -2
  145. package/dist/types/products.js.map +0 -1
  146. package/dist/types/responses.d.ts +0 -5
  147. package/dist/types/responses.js +0 -2
  148. package/dist/types/responses.js.map +0 -1
  149. package/dist/types/site_info.d.ts +0 -150
  150. package/dist/types/site_info.js +0 -2
  151. package/dist/types/site_info.js.map +0 -1
  152. package/dist/types/vehicle.d.ts +0 -23
  153. package/dist/types/vehicle.js +0 -10
  154. package/dist/types/vehicle.js.map +0 -1
  155. package/dist/types/vehicle_data.d.ts +0 -274
  156. package/dist/types/vehicle_data.js +0 -2
  157. package/dist/types/vehicle_data.js.map +0 -1
  158. package/dist/user.d.ts +0 -16
  159. package/dist/user.js +0 -26
  160. package/dist/user.js.map +0 -1
  161. package/dist/vehicle.d.ts +0 -548
  162. package/dist/vehicle.js +0 -774
  163. package/dist/vehicle.js.map +0 -1
  164. package/dist/vehiclesigned.js +0 -19
  165. package/dist/vehiclesigned.js.map +0 -1
  166. package/dist/vehiclespecific.d.ts +0 -432
  167. package/dist/vehiclespecific.js +0 -601
  168. package/dist/vehiclespecific.js.map +0 -1
  169. package/src/charging.ts +0 -66
  170. package/src/commands.ts +0 -1134
  171. package/src/energyspecific.ts +0 -116
  172. package/src/helpers.ts +0 -11
  173. package/src/index.ts +0 -21
  174. package/src/partner.ts +0 -37
  175. package/src/signing/crypto.ts +0 -29
  176. package/src/signing/errors.ts +0 -50
  177. package/src/signing/session.ts +0 -132
  178. package/src/tariff.ts +0 -375
  179. package/src/teslafleetapi.ts +0 -182
  180. package/src/teslemetry.ts +0 -54
  181. package/src/tessie.ts +0 -42
  182. package/src/types/commands.ts +0 -62
  183. package/src/types/live_status.ts +0 -27
  184. package/src/types/products.ts +0 -61
  185. package/src/types/responses.ts +0 -1
  186. package/src/types/site_info.ts +0 -159
  187. package/src/types/vehicle.ts +0 -33
  188. package/src/types/vehicle_data.ts +0 -286
  189. package/src/user.ts +0 -35
  190. package/src/vehicle.ts +0 -886
  191. package/src/vehiclesigned.ts +0 -20
  192. package/src/vehiclespecific.ts +0 -818
package/dist/const.cjs ADDED
@@ -0,0 +1,300 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ // src/const.ts
3
+ const SERVERS = Object.freeze({
4
+ na: "https://fleet-api.prd.na.vn.cloud.tesla.com",
5
+ eu: "https://fleet-api.prd.eu.vn.cloud.tesla.com",
6
+ cn: "https://fleet-api.prd.cn.vn.cloud.tesla.cn"
7
+ });
8
+ const TOKEN_URLS = Object.freeze({
9
+ na: "https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token",
10
+ eu: "https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token",
11
+ cn: "https://auth.tesla.cn/oauth2/v3/token"
12
+ });
13
+ /** Check if a string is a valid region and narrow its type. */
14
+ function is_valid_region(value) {
15
+ return Object.hasOwn(SERVERS, value);
16
+ }
17
+ /** Model name keyed by the fourth character of the VIN. */
18
+ const Models = Object.freeze({
19
+ S: "Model S",
20
+ X: "Model X",
21
+ "3": "Model 3",
22
+ Y: "Model Y",
23
+ C: "Cybertruck",
24
+ R: "Roadster",
25
+ T: "Semi",
26
+ A: "Cybercab"
27
+ });
28
+ /** HTTP methods. */
29
+ const Method = Object.freeze({
30
+ GET: "GET",
31
+ POST: "POST",
32
+ DELETE: "DELETE",
33
+ PATCH: "PATCH"
34
+ });
35
+ const Trunk = Object.freeze({
36
+ FRONT: "front",
37
+ REAR: "rear"
38
+ });
39
+ /** REST `seat_position` values for seat heating. */
40
+ const Seats = Object.freeze({
41
+ FRONT_LEFT: 0,
42
+ FRONT_RIGHT: 1,
43
+ REAR_LEFT: 2,
44
+ REAR_LEFT_BACK: 3,
45
+ /** @deprecated Misspelling kept for parity with Python's `Seat.REAT_LEFT_BACK`; use `REAR_LEFT_BACK`. */
46
+ REAT_LEFT_BACK: 3,
47
+ REAR_CENTER: 4,
48
+ REAR_RIGHT: 5,
49
+ REAR_RIGHT_BACK: 6,
50
+ THIRD_LEFT: 7,
51
+ THIRD_RIGHT: 8,
52
+ /** Alias of `THIRD_LEFT`. */
53
+ THIRD_ROW_LEFT: 7,
54
+ /** Alias of `THIRD_RIGHT`. */
55
+ THIRD_ROW_RIGHT: 8
56
+ });
57
+ /** REST `auto_seat_position` values for auto seat climate, which are 1-indexed unlike `Seats`. */
58
+ const AutoSeat = Object.freeze({
59
+ FRONT_LEFT: 1,
60
+ FRONT_RIGHT: 2
61
+ });
62
+ /** Rendered vehicle image kinds, matching the proto `VehicleImageStateType` enum. */
63
+ const VehicleImageType = Object.freeze({
64
+ AUTOPILOT_VISUALIZATION_WRAP: 1,
65
+ LICENSE_PLATE: 2
66
+ });
67
+ const Level = Object.freeze({
68
+ OFF: 0,
69
+ LOW: 1,
70
+ MEDIUM: 2,
71
+ HIGH: 3
72
+ });
73
+ const ClimateKeeperMode = Object.freeze({
74
+ OFF: 0,
75
+ KEEP_MODE: 1,
76
+ DOG_MODE: 2,
77
+ CAMP_MODE: 3
78
+ });
79
+ /** Climate keeper modes keyed by the short names Node's commands accept. */
80
+ const ClimateModes = Object.freeze({
81
+ Off: 0,
82
+ Keep: 1,
83
+ Dog: 2,
84
+ Camp: 3
85
+ });
86
+ const CabinOverheatProtectionTemp = Object.freeze({
87
+ LOW: 0,
88
+ MEDIUM: 1,
89
+ HIGH: 2
90
+ });
91
+ const VehicleDataEndpoint = Object.freeze({
92
+ CHARGE_STATE: "charge_state",
93
+ CLIMATE_STATE: "climate_state",
94
+ CLOSURES_STATE: "closures_state",
95
+ DRIVE_STATE: "drive_state",
96
+ GUI_SETTINGS: "gui_settings",
97
+ LOCATION_DATA: "location_data",
98
+ CHARGE_SCHEDULE_DATA: "charge_schedule_data",
99
+ PRECONDITIONING_SCHEDULE_DATA: "preconditioning_schedule_data",
100
+ VEHICLE_CONFIG: "vehicle_config",
101
+ VEHICLE_STATE: "vehicle_state",
102
+ VEHICLE_DATA_COMBO: "vehicle_data_combo"
103
+ });
104
+ const SunRoofCommand = Object.freeze({
105
+ STOP: "stop",
106
+ CLOSE: "close",
107
+ VENT: "vent"
108
+ });
109
+ const WindowCommand = Object.freeze({
110
+ VENT: "vent",
111
+ CLOSE: "close"
112
+ });
113
+ const DeviceType = Object.freeze({
114
+ ANDROID: "android",
115
+ IOS_DEVELOPMENT: "ios-development",
116
+ IOS_ENTERPRISE: "ios-enterprise",
117
+ IOS_BETA: "ios-beta",
118
+ IOS_PRODUCTION: "ios-production"
119
+ });
120
+ /** Fleet API OAuth scopes. */
121
+ const Scope = Object.freeze({
122
+ OPENID: "openid",
123
+ EMAIL: "email",
124
+ PROFILE: "profile",
125
+ METADATA: "metadata",
126
+ OFFLINE_ACCESS: "offline_access",
127
+ USER_DATA: "user_data",
128
+ VEHICLE_DEVICE_DATA: "vehicle_device_data",
129
+ VEHICLE_LOCATION: "vehicle_location",
130
+ VEHICLE_CMDS: "vehicle_cmds",
131
+ VEHICLE_CHARGING_CMDS: "vehicle_charging_cmds",
132
+ ENERGY_DEVICE_DATA: "energy_device_data",
133
+ ENERGY_CMDS: "energy_cmds"
134
+ });
135
+ const EnergyOperationMode = Object.freeze({
136
+ AUTONOMOUS: "autonomous",
137
+ SELF_CONSUMPTION: "self_consumption",
138
+ BACKUP: "backup"
139
+ });
140
+ const EnergyExportMode = Object.freeze({
141
+ BATTERY_OK: "battery_ok",
142
+ PV_ONLY: "pv_only",
143
+ NEVER: "never"
144
+ });
145
+ /** Period for energy site history. */
146
+ const TeslaEnergyPeriod = Object.freeze({
147
+ DAY: "day",
148
+ WEEK: "week",
149
+ MONTH: "month",
150
+ YEAR: "year",
151
+ LIFETIME: "lifetime"
152
+ });
153
+ /**
154
+ * Island mode values for `setIslandModeRequest`. `OFF_GRID` (6) opens the grid
155
+ * contactor when sent with force; `ON_GRID` (1) closes it. Mode 2 only sets a
156
+ * preference and does not operate the contactor.
157
+ */
158
+ const EnergyIslandMode = Object.freeze({
159
+ ON_GRID: 1,
160
+ OFF_GRID: 6
161
+ });
162
+ /** Identifier type for energy device gRPC commands. */
163
+ const EnergyDeviceIdentifierType = Object.freeze({
164
+ GATEWAY_DIN: 1,
165
+ SITE_UUID: 2,
166
+ SOLAR_INVERTER_DIN: 3,
167
+ WALL_CONNECTOR_DIN: 4
168
+ });
169
+ /** Key type for energy gateway authorized clients. */
170
+ const AuthorizedClientKeyType = Object.freeze({
171
+ INVALID: 0,
172
+ RSA: 1,
173
+ ECC: 2
174
+ });
175
+ /** Client type used when registering an authorized client on an energy gateway. */
176
+ const AuthorizedClientType = Object.freeze({
177
+ INVALID: 0,
178
+ CUSTOMER_MOBILE_APP: 1,
179
+ VEHICLE: 2
180
+ });
181
+ /**
182
+ * State of an authorized client on an energy gateway. `PENDING_VERIFICATION_TIMEOUT`
183
+ * is terminal: the presence-proof window expired, so a pairing poll must stop on it.
184
+ */
185
+ const AuthorizedClientState = Object.freeze({
186
+ INVALID: 0,
187
+ PENDING_VERIFICATION: 1,
188
+ PENDING_VERIFICATION_TIMEOUT: 2,
189
+ VERIFIED: 3,
190
+ REMOVED: 4
191
+ });
192
+ /** Role granted to an authorized client on an energy gateway. */
193
+ const AuthorizationRole = Object.freeze({
194
+ INVALID: 0,
195
+ CUSTOMER: 1,
196
+ VEHICLE: 2
197
+ });
198
+ /** How an authorized client's presence was verified on an energy gateway. */
199
+ const AuthorizedVerificationType = Object.freeze({
200
+ INVALID: 0,
201
+ PRESENCE_PROOF: 1,
202
+ BLE: 2,
203
+ SIGNED: 3,
204
+ HERMES_COMMAND: 4
205
+ });
206
+ const ClosureState = Object.freeze({
207
+ NONE: "none",
208
+ MOVE: "move",
209
+ STOP: "stop",
210
+ OPEN: "open",
211
+ CLOSE: "close"
212
+ });
213
+ const SeatHeaterLevel = Object.freeze({
214
+ OFF: "off",
215
+ LOW: "low",
216
+ MEDIUM: "medium",
217
+ HIGH: "high"
218
+ });
219
+ const TemperatureUnit = Object.freeze({
220
+ FAHRENHEIT: 0,
221
+ CELSIUS: 1
222
+ });
223
+ const DistanceUnit = Object.freeze({
224
+ MILES: 0,
225
+ KILOMETERS: 1
226
+ });
227
+ const TimeDisplayFormat = Object.freeze({
228
+ HOUR_12: 0,
229
+ HOUR_24: 1
230
+ });
231
+ const TirePressureUnit = Object.freeze({
232
+ PSI: 0,
233
+ BAR: 1
234
+ });
235
+ const EnergyDisplayFormat = Object.freeze({
236
+ PERCENTAGE: 0,
237
+ DISTANCE: 1
238
+ });
239
+ const PhoneFontSize = Object.freeze({
240
+ STANDARD: 0,
241
+ LARGE: 1
242
+ });
243
+ const BluetoothVehicleData = Object.freeze({
244
+ CHARGE_STATE: "GetChargeState",
245
+ CLIMATE_STATE: "GetClimateState",
246
+ DRIVE_STATE: "GetDriveState",
247
+ LOCATION_STATE: "GetLocationState",
248
+ CLOSURES_STATE: "GetClosuresState",
249
+ CHARGE_SCHEDULE_STATE: "GetChargeScheduleState",
250
+ PRECONDITIONING_SCHEDULE_STATE: "GetPreconditioningScheduleState",
251
+ TIRE_PRESSURE_STATE: "GetTirePressureState",
252
+ MEDIA_STATE: "GetMediaState",
253
+ MEDIA_DETAIL_STATE: "GetMediaDetailState",
254
+ SOFTWARE_UPDATE_STATE: "GetSoftwareUpdateState",
255
+ PARENTAL_CONTROLS_STATE: "GetParentalControlsState",
256
+ GUI_SETTINGS: "GetGuiSettings",
257
+ PARKED_ACCESSORY_STATE: "GetParkedAccessoryState",
258
+ LEGACY_VEHICLE_STATE: "GetLegacyVehicleState",
259
+ ALERT_STATE: "GetAlertState",
260
+ LIGHT_SHOW_STATE: "GetLightShowState",
261
+ SUSPENSION_STATE: "GetSuspensionState",
262
+ CHILD_PRESENCE_DETECTION_STATE: "GetChildPresenceDetectionState"
263
+ });
264
+ exports.AuthorizationRole = AuthorizationRole;
265
+ exports.AuthorizedClientKeyType = AuthorizedClientKeyType;
266
+ exports.AuthorizedClientState = AuthorizedClientState;
267
+ exports.AuthorizedClientType = AuthorizedClientType;
268
+ exports.AuthorizedVerificationType = AuthorizedVerificationType;
269
+ exports.AutoSeat = AutoSeat;
270
+ exports.BluetoothVehicleData = BluetoothVehicleData;
271
+ exports.CabinOverheatProtectionTemp = CabinOverheatProtectionTemp;
272
+ exports.ClimateKeeperMode = ClimateKeeperMode;
273
+ exports.ClimateModes = ClimateModes;
274
+ exports.ClosureState = ClosureState;
275
+ exports.DeviceType = DeviceType;
276
+ exports.DistanceUnit = DistanceUnit;
277
+ exports.EnergyDeviceIdentifierType = EnergyDeviceIdentifierType;
278
+ exports.EnergyDisplayFormat = EnergyDisplayFormat;
279
+ exports.EnergyExportMode = EnergyExportMode;
280
+ exports.EnergyIslandMode = EnergyIslandMode;
281
+ exports.EnergyOperationMode = EnergyOperationMode;
282
+ exports.Level = Level;
283
+ exports.Method = Method;
284
+ exports.Models = Models;
285
+ exports.PhoneFontSize = PhoneFontSize;
286
+ exports.SERVERS = SERVERS;
287
+ exports.Scope = Scope;
288
+ exports.SeatHeaterLevel = SeatHeaterLevel;
289
+ exports.Seats = Seats;
290
+ exports.SunRoofCommand = SunRoofCommand;
291
+ exports.TOKEN_URLS = TOKEN_URLS;
292
+ exports.TemperatureUnit = TemperatureUnit;
293
+ exports.TeslaEnergyPeriod = TeslaEnergyPeriod;
294
+ exports.TimeDisplayFormat = TimeDisplayFormat;
295
+ exports.TirePressureUnit = TirePressureUnit;
296
+ exports.Trunk = Trunk;
297
+ exports.VehicleDataEndpoint = VehicleDataEndpoint;
298
+ exports.VehicleImageType = VehicleImageType;
299
+ exports.WindowCommand = WindowCommand;
300
+ exports.is_valid_region = is_valid_region;
@@ -0,0 +1,287 @@
1
+ /**
2
+ * Tesla Fleet API constants, ported from `python-tesla-fleet-api`'s `const.py`.
3
+ *
4
+ * Each Python enum is a frozen object of the same member names and values, with
5
+ * a same-named type for the union of its values.
6
+ */
7
+ export type Region = "na" | "eu" | "cn";
8
+ /** BLE command-confirmation ladder depth. */
9
+ export type BluetoothConfirmation = "optimistic" | "ack" | "verify";
10
+ export declare const SERVERS: Readonly<Record<Region, string>>;
11
+ export declare const TOKEN_URLS: Readonly<Record<Region, string>>;
12
+ /** Check if a string is a valid region and narrow its type. */
13
+ export declare function is_valid_region(value: string): value is Region;
14
+ /** Model name keyed by the fourth character of the VIN. */
15
+ export declare const Models: Readonly<Record<string, string>>;
16
+ type ValueOf<T> = T[keyof T];
17
+ /** HTTP methods. */
18
+ export declare const Method: Readonly<{
19
+ readonly GET: "GET";
20
+ readonly POST: "POST";
21
+ readonly DELETE: "DELETE";
22
+ readonly PATCH: "PATCH";
23
+ }>;
24
+ export type Method = ValueOf<typeof Method>;
25
+ export declare const Trunk: Readonly<{
26
+ readonly FRONT: "front";
27
+ readonly REAR: "rear";
28
+ }>;
29
+ export type Trunk = ValueOf<typeof Trunk>;
30
+ /** REST `seat_position` values for seat heating. */
31
+ export declare const Seats: Readonly<{
32
+ readonly FRONT_LEFT: 0;
33
+ readonly FRONT_RIGHT: 1;
34
+ readonly REAR_LEFT: 2;
35
+ readonly REAR_LEFT_BACK: 3;
36
+ /** @deprecated Misspelling kept for parity with Python's `Seat.REAT_LEFT_BACK`; use `REAR_LEFT_BACK`. */
37
+ readonly REAT_LEFT_BACK: 3;
38
+ readonly REAR_CENTER: 4;
39
+ readonly REAR_RIGHT: 5;
40
+ readonly REAR_RIGHT_BACK: 6;
41
+ readonly THIRD_LEFT: 7;
42
+ readonly THIRD_RIGHT: 8;
43
+ /** Alias of `THIRD_LEFT`. */
44
+ readonly THIRD_ROW_LEFT: 7;
45
+ /** Alias of `THIRD_RIGHT`. */
46
+ readonly THIRD_ROW_RIGHT: 8;
47
+ }>;
48
+ /** A `Seats` member name. */
49
+ export type Seat = keyof typeof Seats;
50
+ /** REST `auto_seat_position` values for auto seat climate, which are 1-indexed unlike `Seats`. */
51
+ export declare const AutoSeat: Readonly<{
52
+ readonly FRONT_LEFT: 1;
53
+ readonly FRONT_RIGHT: 2;
54
+ }>;
55
+ export type AutoSeat = ValueOf<typeof AutoSeat>;
56
+ /** Rendered vehicle image kinds, matching the proto `VehicleImageStateType` enum. */
57
+ export declare const VehicleImageType: Readonly<{
58
+ readonly AUTOPILOT_VISUALIZATION_WRAP: 1;
59
+ readonly LICENSE_PLATE: 2;
60
+ }>;
61
+ export type VehicleImageType = ValueOf<typeof VehicleImageType>;
62
+ export declare const Level: Readonly<{
63
+ readonly OFF: 0;
64
+ readonly LOW: 1;
65
+ readonly MEDIUM: 2;
66
+ readonly HIGH: 3;
67
+ }>;
68
+ export type Level = ValueOf<typeof Level>;
69
+ export declare const ClimateKeeperMode: Readonly<{
70
+ readonly OFF: 0;
71
+ readonly KEEP_MODE: 1;
72
+ readonly DOG_MODE: 2;
73
+ readonly CAMP_MODE: 3;
74
+ }>;
75
+ export type ClimateKeeperMode = ValueOf<typeof ClimateKeeperMode>;
76
+ /** Climate keeper modes keyed by the short names Node's commands accept. */
77
+ export declare const ClimateModes: Readonly<{
78
+ readonly Off: 0;
79
+ readonly Keep: 1;
80
+ readonly Dog: 2;
81
+ readonly Camp: 3;
82
+ }>;
83
+ export type ClimateMode = keyof typeof ClimateModes;
84
+ export declare const CabinOverheatProtectionTemp: Readonly<{
85
+ readonly LOW: 0;
86
+ readonly MEDIUM: 1;
87
+ readonly HIGH: 2;
88
+ }>;
89
+ export type CabinOverheatProtectionTemp = ValueOf<typeof CabinOverheatProtectionTemp>;
90
+ export declare const VehicleDataEndpoint: Readonly<{
91
+ readonly CHARGE_STATE: "charge_state";
92
+ readonly CLIMATE_STATE: "climate_state";
93
+ readonly CLOSURES_STATE: "closures_state";
94
+ readonly DRIVE_STATE: "drive_state";
95
+ readonly GUI_SETTINGS: "gui_settings";
96
+ readonly LOCATION_DATA: "location_data";
97
+ readonly CHARGE_SCHEDULE_DATA: "charge_schedule_data";
98
+ readonly PRECONDITIONING_SCHEDULE_DATA: "preconditioning_schedule_data";
99
+ readonly VEHICLE_CONFIG: "vehicle_config";
100
+ readonly VEHICLE_STATE: "vehicle_state";
101
+ readonly VEHICLE_DATA_COMBO: "vehicle_data_combo";
102
+ }>;
103
+ export type VehicleDataEndpoint = ValueOf<typeof VehicleDataEndpoint>;
104
+ export declare const SunRoofCommand: Readonly<{
105
+ readonly STOP: "stop";
106
+ readonly CLOSE: "close";
107
+ readonly VENT: "vent";
108
+ }>;
109
+ export type SunRoofCommand = ValueOf<typeof SunRoofCommand>;
110
+ export declare const WindowCommand: Readonly<{
111
+ readonly VENT: "vent";
112
+ readonly CLOSE: "close";
113
+ }>;
114
+ export type WindowCommand = ValueOf<typeof WindowCommand>;
115
+ export declare const DeviceType: Readonly<{
116
+ readonly ANDROID: "android";
117
+ readonly IOS_DEVELOPMENT: "ios-development";
118
+ readonly IOS_ENTERPRISE: "ios-enterprise";
119
+ readonly IOS_BETA: "ios-beta";
120
+ readonly IOS_PRODUCTION: "ios-production";
121
+ }>;
122
+ export type DeviceType = ValueOf<typeof DeviceType>;
123
+ /** Fleet API OAuth scopes. */
124
+ export declare const Scope: Readonly<{
125
+ readonly OPENID: "openid";
126
+ readonly EMAIL: "email";
127
+ readonly PROFILE: "profile";
128
+ readonly METADATA: "metadata";
129
+ readonly OFFLINE_ACCESS: "offline_access";
130
+ readonly USER_DATA: "user_data";
131
+ readonly VEHICLE_DEVICE_DATA: "vehicle_device_data";
132
+ readonly VEHICLE_LOCATION: "vehicle_location";
133
+ readonly VEHICLE_CMDS: "vehicle_cmds";
134
+ readonly VEHICLE_CHARGING_CMDS: "vehicle_charging_cmds";
135
+ readonly ENERGY_DEVICE_DATA: "energy_device_data";
136
+ readonly ENERGY_CMDS: "energy_cmds";
137
+ }>;
138
+ export type Scope = ValueOf<typeof Scope>;
139
+ export declare const EnergyOperationMode: Readonly<{
140
+ readonly AUTONOMOUS: "autonomous";
141
+ readonly SELF_CONSUMPTION: "self_consumption";
142
+ readonly BACKUP: "backup";
143
+ }>;
144
+ export type EnergyOperationMode = ValueOf<typeof EnergyOperationMode>;
145
+ export declare const EnergyExportMode: Readonly<{
146
+ readonly BATTERY_OK: "battery_ok";
147
+ readonly PV_ONLY: "pv_only";
148
+ readonly NEVER: "never";
149
+ }>;
150
+ export type EnergyExportMode = ValueOf<typeof EnergyExportMode>;
151
+ /** Period for energy site history. */
152
+ export declare const TeslaEnergyPeriod: Readonly<{
153
+ readonly DAY: "day";
154
+ readonly WEEK: "week";
155
+ readonly MONTH: "month";
156
+ readonly YEAR: "year";
157
+ readonly LIFETIME: "lifetime";
158
+ }>;
159
+ export type TeslaEnergyPeriod = ValueOf<typeof TeslaEnergyPeriod>;
160
+ /**
161
+ * Island mode values for `setIslandModeRequest`. `OFF_GRID` (6) opens the grid
162
+ * contactor when sent with force; `ON_GRID` (1) closes it. Mode 2 only sets a
163
+ * preference and does not operate the contactor.
164
+ */
165
+ export declare const EnergyIslandMode: Readonly<{
166
+ readonly ON_GRID: 1;
167
+ readonly OFF_GRID: 6;
168
+ }>;
169
+ export type EnergyIslandMode = ValueOf<typeof EnergyIslandMode>;
170
+ /** Identifier type for energy device gRPC commands. */
171
+ export declare const EnergyDeviceIdentifierType: Readonly<{
172
+ readonly GATEWAY_DIN: 1;
173
+ readonly SITE_UUID: 2;
174
+ readonly SOLAR_INVERTER_DIN: 3;
175
+ readonly WALL_CONNECTOR_DIN: 4;
176
+ }>;
177
+ export type EnergyDeviceIdentifierType = ValueOf<typeof EnergyDeviceIdentifierType>;
178
+ /** Key type for energy gateway authorized clients. */
179
+ export declare const AuthorizedClientKeyType: Readonly<{
180
+ readonly INVALID: 0;
181
+ readonly RSA: 1;
182
+ readonly ECC: 2;
183
+ }>;
184
+ export type AuthorizedClientKeyType = ValueOf<typeof AuthorizedClientKeyType>;
185
+ /** Client type used when registering an authorized client on an energy gateway. */
186
+ export declare const AuthorizedClientType: Readonly<{
187
+ readonly INVALID: 0;
188
+ readonly CUSTOMER_MOBILE_APP: 1;
189
+ readonly VEHICLE: 2;
190
+ }>;
191
+ export type AuthorizedClientType = ValueOf<typeof AuthorizedClientType>;
192
+ /**
193
+ * State of an authorized client on an energy gateway. `PENDING_VERIFICATION_TIMEOUT`
194
+ * is terminal: the presence-proof window expired, so a pairing poll must stop on it.
195
+ */
196
+ export declare const AuthorizedClientState: Readonly<{
197
+ readonly INVALID: 0;
198
+ readonly PENDING_VERIFICATION: 1;
199
+ readonly PENDING_VERIFICATION_TIMEOUT: 2;
200
+ readonly VERIFIED: 3;
201
+ readonly REMOVED: 4;
202
+ }>;
203
+ export type AuthorizedClientState = ValueOf<typeof AuthorizedClientState>;
204
+ /** Role granted to an authorized client on an energy gateway. */
205
+ export declare const AuthorizationRole: Readonly<{
206
+ readonly INVALID: 0;
207
+ readonly CUSTOMER: 1;
208
+ readonly VEHICLE: 2;
209
+ }>;
210
+ export type AuthorizationRole = ValueOf<typeof AuthorizationRole>;
211
+ /** How an authorized client's presence was verified on an energy gateway. */
212
+ export declare const AuthorizedVerificationType: Readonly<{
213
+ readonly INVALID: 0;
214
+ readonly PRESENCE_PROOF: 1;
215
+ readonly BLE: 2;
216
+ readonly SIGNED: 3;
217
+ readonly HERMES_COMMAND: 4;
218
+ }>;
219
+ export type AuthorizedVerificationType = ValueOf<typeof AuthorizedVerificationType>;
220
+ export declare const ClosureState: Readonly<{
221
+ readonly NONE: "none";
222
+ readonly MOVE: "move";
223
+ readonly STOP: "stop";
224
+ readonly OPEN: "open";
225
+ readonly CLOSE: "close";
226
+ }>;
227
+ export type ClosureState = ValueOf<typeof ClosureState>;
228
+ export declare const SeatHeaterLevel: Readonly<{
229
+ readonly OFF: "off";
230
+ readonly LOW: "low";
231
+ readonly MEDIUM: "medium";
232
+ readonly HIGH: "high";
233
+ }>;
234
+ export type SeatHeaterLevel = ValueOf<typeof SeatHeaterLevel>;
235
+ export declare const TemperatureUnit: Readonly<{
236
+ readonly FAHRENHEIT: 0;
237
+ readonly CELSIUS: 1;
238
+ }>;
239
+ export type TemperatureUnit = ValueOf<typeof TemperatureUnit>;
240
+ export declare const DistanceUnit: Readonly<{
241
+ readonly MILES: 0;
242
+ readonly KILOMETERS: 1;
243
+ }>;
244
+ export type DistanceUnit = ValueOf<typeof DistanceUnit>;
245
+ export declare const TimeDisplayFormat: Readonly<{
246
+ readonly HOUR_12: 0;
247
+ readonly HOUR_24: 1;
248
+ }>;
249
+ export type TimeDisplayFormat = ValueOf<typeof TimeDisplayFormat>;
250
+ export declare const TirePressureUnit: Readonly<{
251
+ readonly PSI: 0;
252
+ readonly BAR: 1;
253
+ }>;
254
+ export type TirePressureUnit = ValueOf<typeof TirePressureUnit>;
255
+ export declare const EnergyDisplayFormat: Readonly<{
256
+ readonly PERCENTAGE: 0;
257
+ readonly DISTANCE: 1;
258
+ }>;
259
+ export type EnergyDisplayFormat = ValueOf<typeof EnergyDisplayFormat>;
260
+ export declare const PhoneFontSize: Readonly<{
261
+ readonly STANDARD: 0;
262
+ readonly LARGE: 1;
263
+ }>;
264
+ export type PhoneFontSize = ValueOf<typeof PhoneFontSize>;
265
+ export declare const BluetoothVehicleData: Readonly<{
266
+ readonly CHARGE_STATE: "GetChargeState";
267
+ readonly CLIMATE_STATE: "GetClimateState";
268
+ readonly DRIVE_STATE: "GetDriveState";
269
+ readonly LOCATION_STATE: "GetLocationState";
270
+ readonly CLOSURES_STATE: "GetClosuresState";
271
+ readonly CHARGE_SCHEDULE_STATE: "GetChargeScheduleState";
272
+ readonly PRECONDITIONING_SCHEDULE_STATE: "GetPreconditioningScheduleState";
273
+ readonly TIRE_PRESSURE_STATE: "GetTirePressureState";
274
+ readonly MEDIA_STATE: "GetMediaState";
275
+ readonly MEDIA_DETAIL_STATE: "GetMediaDetailState";
276
+ readonly SOFTWARE_UPDATE_STATE: "GetSoftwareUpdateState";
277
+ readonly PARENTAL_CONTROLS_STATE: "GetParentalControlsState";
278
+ readonly GUI_SETTINGS: "GetGuiSettings";
279
+ readonly PARKED_ACCESSORY_STATE: "GetParkedAccessoryState";
280
+ readonly LEGACY_VEHICLE_STATE: "GetLegacyVehicleState";
281
+ readonly ALERT_STATE: "GetAlertState";
282
+ readonly LIGHT_SHOW_STATE: "GetLightShowState";
283
+ readonly SUSPENSION_STATE: "GetSuspensionState";
284
+ readonly CHILD_PRESENCE_DETECTION_STATE: "GetChildPresenceDetectionState";
285
+ }>;
286
+ export type BluetoothVehicleData = ValueOf<typeof BluetoothVehicleData>;
287
+ export {};