tesla-fleet-api 0.4.0 → 0.5.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/README.md +284 -1
- package/dist/_virtual/_rolldown/runtime.cjs +10 -0
- package/dist/bluetooth/adapters/shared.cjs +38 -0
- package/dist/bluetooth/adapters/shared.mjs +36 -0
- package/dist/bluetooth/async.cjs +121 -0
- package/dist/bluetooth/async.d.cts +10 -0
- package/dist/bluetooth/async.d.mts +10 -0
- package/dist/bluetooth/async.mjs +116 -0
- package/dist/bluetooth/broadcast.cjs +153 -0
- package/dist/bluetooth/broadcast.d.cts +59 -0
- package/dist/bluetooth/broadcast.d.mts +59 -0
- package/dist/bluetooth/broadcast.mjs +151 -0
- package/dist/bluetooth/constants.cjs +99 -0
- package/dist/bluetooth/constants.d.cts +70 -0
- package/dist/bluetooth/constants.d.mts +70 -0
- package/dist/bluetooth/constants.mjs +72 -0
- package/dist/bluetooth/esphome.cjs +292 -0
- package/dist/bluetooth/esphome.d.cts +83 -0
- package/dist/bluetooth/esphome.d.mts +83 -0
- package/dist/bluetooth/esphome.mjs +291 -0
- package/dist/bluetooth/framing.cjs +125 -0
- package/dist/bluetooth/framing.d.cts +45 -0
- package/dist/bluetooth/framing.d.mts +45 -0
- package/dist/bluetooth/framing.mjs +122 -0
- package/dist/bluetooth/homey.cjs +155 -0
- package/dist/bluetooth/homey.d.cts +75 -0
- package/dist/bluetooth/homey.d.mts +75 -0
- package/dist/bluetooth/homey.mjs +150 -0
- package/dist/bluetooth/names.cjs +24 -0
- package/dist/bluetooth/names.d.cts +10 -0
- package/dist/bluetooth/names.d.mts +10 -0
- package/dist/bluetooth/names.mjs +20 -0
- package/dist/bluetooth/noble.cjs +178 -0
- package/dist/bluetooth/noble.d.cts +58 -0
- package/dist/bluetooth/noble.d.mts +58 -0
- package/dist/bluetooth/noble.mjs +177 -0
- package/dist/bluetooth/streamglue.cjs +157 -0
- package/dist/bluetooth/streamglue.d.cts +37 -0
- package/dist/bluetooth/streamglue.d.mts +37 -0
- package/dist/bluetooth/streamglue.mjs +154 -0
- package/dist/bluetooth/teslabluetooth.cjs +67 -0
- package/dist/bluetooth/teslabluetooth.d.cts +41 -0
- package/dist/bluetooth/teslabluetooth.d.mts +41 -0
- package/dist/bluetooth/teslabluetooth.mjs +66 -0
- package/dist/bluetooth/transport.cjs +10 -0
- package/dist/bluetooth/transport.d.cts +95 -0
- package/dist/bluetooth/transport.d.mts +95 -0
- package/dist/bluetooth/transport.mjs +10 -0
- package/dist/bluetooth/vehiclebluetooth.cjs +1272 -0
- package/dist/bluetooth/vehiclebluetooth.d.cts +495 -0
- package/dist/bluetooth/vehiclebluetooth.d.mts +495 -0
- package/dist/bluetooth/vehiclebluetooth.mjs +1270 -0
- package/dist/bluetooth/verify.cjs +93 -0
- package/dist/bluetooth/verify.d.cts +35 -0
- package/dist/bluetooth/verify.d.mts +35 -0
- package/dist/bluetooth/verify.mjs +91 -0
- package/dist/bluetooth.cjs +53 -0
- package/dist/bluetooth.d.cts +10 -0
- package/dist/bluetooth.d.mts +10 -0
- package/dist/bluetooth.mjs +9 -0
- package/dist/commands.cjs +1080 -85
- package/dist/commands.d.cts +585 -54
- package/dist/commands.d.mts +583 -51
- package/dist/commands.mjs +1084 -93
- package/dist/const.cjs +22 -0
- package/dist/const.d.cts +21 -0
- package/dist/const.d.mts +21 -0
- package/dist/const.mjs +20 -1
- package/dist/energy.cjs +24 -19
- package/dist/energy.d.cts +21 -15
- package/dist/energy.d.mts +21 -15
- package/dist/energy.mjs +24 -19
- package/dist/energyisland.cjs +38 -0
- package/dist/energyisland.mjs +37 -0
- package/dist/energyparsers.cjs +118 -0
- package/dist/energyparsers.d.cts +39 -0
- package/dist/energyparsers.d.mts +39 -0
- package/dist/energyparsers.mjs +116 -0
- package/dist/energyspecific.cjs +375 -17
- package/dist/energyspecific.d.cts +199 -19
- package/dist/energyspecific.d.mts +197 -16
- package/dist/energyspecific.mjs +370 -18
- package/dist/exceptions.cjs +3 -2
- package/dist/exceptions.d.cts +3 -2
- package/dist/exceptions.d.mts +3 -2
- package/dist/exceptions.mjs +3 -2
- package/dist/funnel.cjs +297 -0
- package/dist/funnel.d.cts +118 -0
- package/dist/funnel.d.mts +118 -0
- package/dist/funnel.mjs +292 -0
- package/dist/index.cjs +61 -0
- package/dist/index.d.cts +22 -8
- package/dist/index.d.mts +22 -8
- package/dist/index.mjs +19 -6
- package/dist/log.cjs +75 -0
- package/dist/log.d.cts +4 -0
- package/dist/log.d.mts +4 -0
- package/dist/log.mjs +71 -0
- package/dist/oauth.cjs +143 -0
- package/dist/oauth.d.cts +69 -0
- package/dist/oauth.d.mts +69 -0
- package/dist/oauth.mjs +143 -0
- package/dist/powerwall/client.cjs +818 -0
- package/dist/powerwall/client.d.cts +297 -0
- package/dist/powerwall/client.d.mts +297 -0
- package/dist/powerwall/client.mjs +807 -0
- package/dist/powerwall/components.cjs +188 -0
- package/dist/powerwall/components.d.cts +45 -0
- package/dist/powerwall/components.d.mts +45 -0
- package/dist/powerwall/components.mjs +182 -0
- package/dist/powerwall/energysite.cjs +216 -0
- package/dist/powerwall/energysite.d.cts +104 -0
- package/dist/powerwall/energysite.d.mts +104 -0
- package/dist/powerwall/energysite.mjs +214 -0
- package/dist/powerwall/exceptions.cjs +59 -0
- package/dist/powerwall/exceptions.d.cts +38 -0
- package/dist/powerwall/exceptions.d.mts +38 -0
- package/dist/powerwall/exceptions.mjs +51 -0
- package/dist/powerwall/gateway.cjs +102 -0
- package/dist/powerwall/gateway.d.cts +57 -0
- package/dist/powerwall/gateway.d.mts +57 -0
- package/dist/powerwall/gateway.mjs +101 -0
- package/dist/powerwall/merge.cjs +163 -0
- package/dist/powerwall/merge.d.cts +63 -0
- package/dist/powerwall/merge.d.mts +63 -0
- package/dist/powerwall/merge.mjs +159 -0
- package/dist/powerwall/models.d.cts +95 -0
- package/dist/powerwall/models.d.mts +95 -0
- package/dist/powerwall/queries.cjs +17 -0
- package/dist/powerwall/queries.mjs +10 -0
- package/dist/powerwall/transport.cjs +232 -0
- package/dist/powerwall/transport.mjs +227 -0
- package/dist/powerwall.cjs +47 -0
- package/dist/powerwall.d.cts +9 -0
- package/dist/powerwall.d.mts +9 -0
- package/dist/powerwall.mjs +8 -0
- package/dist/router/base.cjs +203 -0
- package/dist/router/base.d.cts +112 -0
- package/dist/router/base.d.mts +112 -0
- package/dist/router/base.mjs +200 -0
- package/dist/router/energysite.cjs +65 -0
- package/dist/router/energysite.d.cts +47 -0
- package/dist/router/energysite.d.mts +47 -0
- package/dist/router/energysite.mjs +60 -0
- package/dist/router.cjs +13 -0
- package/dist/router.d.cts +3 -1
- package/dist/router.d.mts +3 -1
- package/dist/router.mjs +3 -1
- package/dist/signing/crypto.cjs +28 -0
- package/dist/signing/crypto.mjs +26 -1
- package/dist/signing/energy.cjs +123 -0
- package/dist/signing/energy.d.cts +45 -0
- package/dist/signing/energy.d.mts +45 -0
- package/dist/signing/energy.mjs +120 -0
- package/dist/signing/jws.cjs +229 -0
- package/dist/signing/jws.d.cts +45 -0
- package/dist/signing/jws.d.mts +45 -0
- package/dist/signing/jws.mjs +211 -0
- package/dist/signing/keys.cjs +191 -0
- package/dist/signing/keys.d.cts +21 -0
- package/dist/signing/keys.d.mts +21 -0
- package/dist/signing/keys.mjs +182 -0
- package/dist/signing/session.cjs +104 -30
- package/dist/signing/session.d.cts +60 -23
- package/dist/signing/session.d.mts +60 -23
- package/dist/signing/session.mjs +105 -31
- package/dist/tariff.cjs +27 -0
- package/dist/tariff.d.cts +11 -0
- package/dist/tariff.d.mts +11 -0
- package/dist/tariff.mjs +27 -1
- package/dist/teslafleetapi.cjs +256 -55
- package/dist/teslafleetapi.d.cts +110 -14
- package/dist/teslafleetapi.d.mts +110 -14
- package/dist/teslafleetapi.mjs +258 -57
- package/dist/teslemetry.cjs +152 -5
- package/dist/teslemetry.d.cts +95 -5
- package/dist/teslemetry.d.mts +93 -3
- package/dist/teslemetry.mjs +151 -6
- package/dist/teslemetryenergy.cjs +287 -0
- package/dist/teslemetryenergy.d.cts +154 -0
- package/dist/teslemetryenergy.d.mts +154 -0
- package/dist/teslemetryenergy.mjs +282 -0
- package/dist/teslemetryvehicle.cjs +407 -0
- package/dist/teslemetryvehicle.d.cts +238 -0
- package/dist/teslemetryvehicle.d.mts +238 -0
- package/dist/teslemetryvehicle.mjs +405 -0
- package/dist/tessie.cjs +42 -5
- package/dist/tessie.d.cts +51 -5
- package/dist/tessie.d.mts +49 -3
- package/dist/tessie.mjs +42 -5
- package/dist/tessievehicle.cjs +514 -0
- package/dist/tessievehicle.d.cts +333 -0
- package/dist/tessievehicle.d.mts +333 -0
- package/dist/tessievehicle.mjs +513 -0
- package/dist/types/live_status.d.cts +16 -16
- package/dist/types/live_status.d.mts +16 -16
- package/dist/types/responses.d.cts +5 -1
- package/dist/types/responses.d.mts +5 -1
- package/dist/types/vehicle.d.cts +7 -1
- package/dist/types/vehicle.d.mts +7 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.mts +3 -3
- package/dist/util.cjs +41 -0
- package/dist/util.d.cts +18 -0
- package/dist/util.d.mts +18 -0
- package/dist/util.mjs +40 -0
- package/dist/vehicle.cjs +79 -36
- package/dist/vehicle.d.cts +42 -26
- package/dist/vehicle.d.mts +42 -26
- package/dist/vehicle.mjs +80 -37
- package/dist/vehiclesigned.cjs +20 -5
- package/dist/vehiclesigned.d.cts +14 -5
- package/dist/vehiclesigned.d.mts +14 -5
- package/dist/vehiclesigned.mjs +20 -5
- package/dist/vehiclespecific.cjs +126 -15
- package/dist/vehiclespecific.d.cts +82 -18
- package/dist/vehiclespecific.d.mts +82 -18
- package/dist/vehiclespecific.mjs +126 -15
- package/package.json +70 -3
package/dist/funnel.mjs
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { errorText } from "./log.mjs";
|
|
2
|
+
import { ClosureStateE, VehicleLockStateE } from "@teslemetry/tesla-protocol/command/vcsec";
|
|
3
|
+
// src/funnel.ts
|
|
4
|
+
/**
|
|
5
|
+
* A canonical routable field, valued to match its public signal name. A compound
|
|
6
|
+
* signal is split into one path per facet, because a broadcast and a
|
|
7
|
+
* `vehicle_data` result each expose individual leaves.
|
|
8
|
+
*/
|
|
9
|
+
const FieldPath = Object.freeze({
|
|
10
|
+
LOCKED: "Locked",
|
|
11
|
+
CHARGE_PORT_DOOR_OPEN: "ChargePortDoorOpen",
|
|
12
|
+
DOOR_STATE_TRUNK_FRONT: "DoorState.TrunkFront"
|
|
13
|
+
});
|
|
14
|
+
function noop() {}
|
|
15
|
+
/**
|
|
16
|
+
* Funnels observations from every attached publisher into one listener set.
|
|
17
|
+
*
|
|
18
|
+
* Many to one: a listener registered for a field receives what any publisher
|
|
19
|
+
* reports for it, in arrival order. There is no source selection, ranking, or
|
|
20
|
+
* health model here, and detaching or silencing a publisher produces no value of
|
|
21
|
+
* its own. The only arbitration, dropping older observations and skipping
|
|
22
|
+
* unchanged values, is hard-coded.
|
|
23
|
+
*/
|
|
24
|
+
var ObservationFunnel = class {
|
|
25
|
+
#publishers = [];
|
|
26
|
+
#listeners = /* @__PURE__ */ new Map();
|
|
27
|
+
#demandObservers = [];
|
|
28
|
+
#observed = /* @__PURE__ */ new Map();
|
|
29
|
+
#logger;
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this.#logger = options.logger;
|
|
32
|
+
}
|
|
33
|
+
/** Attach `publisher` and return its detach closure. */
|
|
34
|
+
attach(publisher) {
|
|
35
|
+
const attached = {
|
|
36
|
+
publisher,
|
|
37
|
+
detach: noop
|
|
38
|
+
};
|
|
39
|
+
this.#publishers.push(attached);
|
|
40
|
+
attached.detach = publisher.attach(this);
|
|
41
|
+
const active = this.#activePaths(publisher);
|
|
42
|
+
if (active.size > 0) publisher.request(active);
|
|
43
|
+
return () => {
|
|
44
|
+
const index = this.#publishers.indexOf(attached);
|
|
45
|
+
if (index === -1) return;
|
|
46
|
+
this.#publishers.splice(index, 1);
|
|
47
|
+
const stillActive = this.#activePaths(publisher);
|
|
48
|
+
if (stillActive.size > 0) publisher.release(stillActive);
|
|
49
|
+
attached.detach();
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
#activePaths(publisher) {
|
|
53
|
+
return new Set([...publisher.paths].filter((path) => this.#listeners.get(path)?.length));
|
|
54
|
+
}
|
|
55
|
+
/** Accept one observation from any publisher and fan it out. */
|
|
56
|
+
publish(observation) {
|
|
57
|
+
const { path } = observation;
|
|
58
|
+
const previous = this.#observed.get(path);
|
|
59
|
+
if (previous !== void 0 && observation.observed_at < previous.observed_at) return;
|
|
60
|
+
this.#observed.set(path, observation);
|
|
61
|
+
if (previous !== void 0 && previous.value === observation.value) return;
|
|
62
|
+
for (const callback of [...this.#listeners.get(path) ?? []]) {
|
|
63
|
+
if (this.#observed.get(path) !== observation) return;
|
|
64
|
+
this.#dispatch(callback, observation.value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The last value observed for `path`. Null means there is no reading: either
|
|
69
|
+
* nothing has ever been observed, or a source reported the field as unavailable.
|
|
70
|
+
*/
|
|
71
|
+
value(path) {
|
|
72
|
+
return this.#observed.get(path)?.value ?? null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Register a listener for `path`, called on each changed value. The first
|
|
76
|
+
* listener for a path activates it on every capable publisher; the last one
|
|
77
|
+
* to leave releases it. Registration dispatches nothing: the value standing at
|
|
78
|
+
* that moment is `value()`.
|
|
79
|
+
*/
|
|
80
|
+
listen(path, callback) {
|
|
81
|
+
let listeners = this.#listeners.get(path);
|
|
82
|
+
if (listeners === void 0) {
|
|
83
|
+
listeners = [];
|
|
84
|
+
this.#listeners.set(path, listeners);
|
|
85
|
+
}
|
|
86
|
+
const registered = listeners;
|
|
87
|
+
registered.push(callback);
|
|
88
|
+
if (registered.length === 1) this.#forCapable(path, (publisher, paths) => publisher.request(paths));
|
|
89
|
+
this.#notifyDemand();
|
|
90
|
+
let released = false;
|
|
91
|
+
return () => {
|
|
92
|
+
if (released) return;
|
|
93
|
+
released = true;
|
|
94
|
+
registered.splice(registered.indexOf(callback), 1);
|
|
95
|
+
if (registered.length === 0) this.#forCapable(path, (publisher, paths) => publisher.release(paths));
|
|
96
|
+
this.#notifyDemand();
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
#forCapable(path, action) {
|
|
100
|
+
const paths = /* @__PURE__ */ new Set([path]);
|
|
101
|
+
for (const { publisher } of [...this.#publishers]) if (publisher.paths.has(path)) action(publisher, paths);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Observe whether any of `paths` has at least one live listener. Derived from
|
|
105
|
+
* the activation counts the funnel already keeps. It reports; it never starts
|
|
106
|
+
* work of its own.
|
|
107
|
+
*/
|
|
108
|
+
listen_demand(paths, callback) {
|
|
109
|
+
const observer = {
|
|
110
|
+
paths,
|
|
111
|
+
callback,
|
|
112
|
+
active: this.#demand(paths)
|
|
113
|
+
};
|
|
114
|
+
this.#demandObservers.push(observer);
|
|
115
|
+
this.#dispatch(callback, observer.active);
|
|
116
|
+
let released = false;
|
|
117
|
+
return () => {
|
|
118
|
+
if (released) return;
|
|
119
|
+
released = true;
|
|
120
|
+
const index = this.#demandObservers.indexOf(observer);
|
|
121
|
+
if (index !== -1) this.#demandObservers.splice(index, 1);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
#demand(paths) {
|
|
125
|
+
return [...paths].some((path) => this.#listeners.get(path)?.length);
|
|
126
|
+
}
|
|
127
|
+
#notifyDemand() {
|
|
128
|
+
for (const observer of [...this.#demandObservers]) {
|
|
129
|
+
const active = this.#demand(observer.paths);
|
|
130
|
+
if (active !== observer.active) {
|
|
131
|
+
observer.active = active;
|
|
132
|
+
this.#dispatch(observer.callback, active);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** A listener's error stays with that listener: the rest still hear the value. */
|
|
137
|
+
#dispatch(callback, value) {
|
|
138
|
+
try {
|
|
139
|
+
callback(value);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
this.#logger?.debug(`observation funnel listener callback failed error=${errorText(error)}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const LOCK_STATES = /* @__PURE__ */ new Map([
|
|
146
|
+
[VehicleLockStateE.VEHICLELOCKSTATE_LOCKED, true],
|
|
147
|
+
[VehicleLockStateE.VEHICLELOCKSTATE_UNLOCKED, false],
|
|
148
|
+
[VehicleLockStateE.VEHICLELOCKSTATE_INTERNAL_LOCKED, true],
|
|
149
|
+
[VehicleLockStateE.VEHICLELOCKSTATE_SELECTIVE_UNLOCKED, false]
|
|
150
|
+
]);
|
|
151
|
+
const CLOSURE_STATES = /* @__PURE__ */ new Map([
|
|
152
|
+
[ClosureStateE.CLOSURESTATE_CLOSED, false],
|
|
153
|
+
[ClosureStateE.CLOSURESTATE_OPEN, true],
|
|
154
|
+
[ClosureStateE.CLOSURESTATE_AJAR, true],
|
|
155
|
+
[ClosureStateE.CLOSURESTATE_OPENING, true],
|
|
156
|
+
[ClosureStateE.CLOSURESTATE_CLOSING, true]
|
|
157
|
+
]);
|
|
158
|
+
/** `paths` of a passive publisher: every field. */
|
|
159
|
+
const ALL_PATHS = new Set(Object.values(FieldPath));
|
|
160
|
+
const monotonicSeconds = () => performance.now() / 1e3;
|
|
161
|
+
const ABSENT = Symbol("absent");
|
|
162
|
+
function isMapping(value) {
|
|
163
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
164
|
+
}
|
|
165
|
+
/** A present leaf, or `ABSENT`: a missing key is not a null reading. */
|
|
166
|
+
function leaf(section, key) {
|
|
167
|
+
return isMapping(section) && Object.hasOwn(section, key) ? section[key] : ABSENT;
|
|
168
|
+
}
|
|
169
|
+
/** A value usable as a reading: a boolean, or null for an explicit "unavailable". */
|
|
170
|
+
function isReading(value) {
|
|
171
|
+
return value === null || typeof value === "boolean";
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* A source whose readings are handed to it as arguments. It holds no client,
|
|
175
|
+
* session, endpoint, or callable able to obtain one, so nothing here can originate
|
|
176
|
+
* a request, and activation subscribes to nothing.
|
|
177
|
+
*/
|
|
178
|
+
var SuppliedPublisher = class {
|
|
179
|
+
#clock;
|
|
180
|
+
#sink = null;
|
|
181
|
+
constructor(options = {}) {
|
|
182
|
+
this.#clock = options.clock ?? monotonicSeconds;
|
|
183
|
+
}
|
|
184
|
+
get paths() {
|
|
185
|
+
return ALL_PATHS;
|
|
186
|
+
}
|
|
187
|
+
attach(sink) {
|
|
188
|
+
this.#sink = sink;
|
|
189
|
+
return () => {
|
|
190
|
+
this.#sink = null;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
request(_paths) {}
|
|
194
|
+
release(_paths) {}
|
|
195
|
+
_publish(input, observed_at) {
|
|
196
|
+
const observations = this._translate(input, observed_at ?? this.#clock());
|
|
197
|
+
const sink = this.#sink;
|
|
198
|
+
if (sink !== null) for (const observation of observations) sink.publish(observation);
|
|
199
|
+
return observations;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
/** Translates a caller-supplied `vehicle_data` result into observations. */
|
|
203
|
+
var VehicleDataResultPublisher = class extends SuppliedPublisher {
|
|
204
|
+
/** Translate a supplied result and feed the audited leaves to the sink. */
|
|
205
|
+
publish_result(result, options = {}) {
|
|
206
|
+
return this._publish(result, options.observed_at);
|
|
207
|
+
}
|
|
208
|
+
_translate(result, observed_at) {
|
|
209
|
+
const response = leaf(result, "response");
|
|
210
|
+
const payload = isMapping(response) ? response : result;
|
|
211
|
+
const vehicle_state = leaf(payload, "vehicle_state");
|
|
212
|
+
const charge_state = leaf(payload, "charge_state");
|
|
213
|
+
const observations = [];
|
|
214
|
+
const locked = leaf(vehicle_state, "locked");
|
|
215
|
+
if (isReading(locked)) observations.push({
|
|
216
|
+
path: FieldPath.LOCKED,
|
|
217
|
+
value: locked,
|
|
218
|
+
observed_at
|
|
219
|
+
});
|
|
220
|
+
const charge_port = leaf(charge_state, "charge_port_door_open");
|
|
221
|
+
if (isReading(charge_port)) observations.push({
|
|
222
|
+
path: FieldPath.CHARGE_PORT_DOOR_OPEN,
|
|
223
|
+
value: charge_port,
|
|
224
|
+
observed_at
|
|
225
|
+
});
|
|
226
|
+
const front_trunk = leaf(vehicle_state, "ft");
|
|
227
|
+
if (front_trunk === null) observations.push({
|
|
228
|
+
path: FieldPath.DOOR_STATE_TRUNK_FRONT,
|
|
229
|
+
value: null,
|
|
230
|
+
observed_at
|
|
231
|
+
});
|
|
232
|
+
else if (front_trunk === 0 || front_trunk === 1) observations.push({
|
|
233
|
+
path: FieldPath.DOOR_STATE_TRUNK_FRONT,
|
|
234
|
+
value: front_trunk === 1,
|
|
235
|
+
observed_at
|
|
236
|
+
});
|
|
237
|
+
return observations;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* `"true"` and `"false"` become real booleans; anything else passes through. Some
|
|
242
|
+
* vehicles stream a boolean signal as that literal string even when the stream
|
|
243
|
+
* prefers typed values.
|
|
244
|
+
*/
|
|
245
|
+
function coerceStreamBool(value) {
|
|
246
|
+
if (value === "true") return true;
|
|
247
|
+
if (value === "false") return false;
|
|
248
|
+
return value;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Translates a caller-supplied Teslemetry stream signal update into observations.
|
|
252
|
+
* The update is keyed by signal name the way a stream push is (`Locked`,
|
|
253
|
+
* `ChargePortDoorOpen`, `DoorState` with a nested `TrunkFront`). `@teslemetry/api`
|
|
254
|
+
* owns the stream client; the two meet here.
|
|
255
|
+
*/
|
|
256
|
+
var TeslemetryStreamPublisher = class extends SuppliedPublisher {
|
|
257
|
+
/** Translate a supplied stream signal update and feed it to the sink. */
|
|
258
|
+
publish_update(data, options = {}) {
|
|
259
|
+
return this._publish(data, options.observed_at);
|
|
260
|
+
}
|
|
261
|
+
_translate(data, observed_at) {
|
|
262
|
+
const observations = [];
|
|
263
|
+
const locked = coerceStreamBool(leaf(data, "Locked"));
|
|
264
|
+
if (isReading(locked)) observations.push({
|
|
265
|
+
path: FieldPath.LOCKED,
|
|
266
|
+
value: locked,
|
|
267
|
+
observed_at
|
|
268
|
+
});
|
|
269
|
+
const charge_port = coerceStreamBool(leaf(data, "ChargePortDoorOpen"));
|
|
270
|
+
if (isReading(charge_port)) observations.push({
|
|
271
|
+
path: FieldPath.CHARGE_PORT_DOOR_OPEN,
|
|
272
|
+
value: charge_port,
|
|
273
|
+
observed_at
|
|
274
|
+
});
|
|
275
|
+
const door_state = leaf(data, "DoorState");
|
|
276
|
+
if (door_state === null) observations.push({
|
|
277
|
+
path: FieldPath.DOOR_STATE_TRUNK_FRONT,
|
|
278
|
+
value: null,
|
|
279
|
+
observed_at
|
|
280
|
+
});
|
|
281
|
+
else if (isMapping(door_state)) {
|
|
282
|
+
const trunk_front = coerceStreamBool(leaf(door_state, "TrunkFront"));
|
|
283
|
+
if (isReading(trunk_front)) observations.push({
|
|
284
|
+
path: FieldPath.DOOR_STATE_TRUNK_FRONT,
|
|
285
|
+
value: trunk_front,
|
|
286
|
+
observed_at
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
return observations;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
export { CLOSURE_STATES, FieldPath, LOCK_STATES, ObservationFunnel, TeslemetryStreamPublisher, VehicleDataResultPublisher };
|
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_charging = require("./charging.cjs");
|
|
2
3
|
const require_commands = require("./commands.cjs");
|
|
3
4
|
const require_energy = require("./energy.cjs");
|
|
4
5
|
const require_energyspecific = require("./energyspecific.cjs");
|
|
6
|
+
const require_partner = require("./partner.cjs");
|
|
5
7
|
const require_teslafleetapi = require("./teslafleetapi.cjs");
|
|
8
|
+
const require_oauth = require("./oauth.cjs");
|
|
6
9
|
const require_teslemetry = require("./teslemetry.cjs");
|
|
7
10
|
const require_tessie = require("./tessie.cjs");
|
|
11
|
+
const require_user = require("./user.cjs");
|
|
8
12
|
const require_vehicle = require("./vehicle.cjs");
|
|
9
13
|
const require_vehiclesigned = require("./vehiclesigned.cjs");
|
|
10
14
|
const require_vehiclespecific = require("./vehiclespecific.cjs");
|
|
15
|
+
const require_teslemetryvehicle = require("./teslemetryvehicle.cjs");
|
|
16
|
+
const require_tessievehicle = require("./tessievehicle.cjs");
|
|
17
|
+
const require_energy$1 = require("./signing/energy.cjs");
|
|
18
|
+
const require_teslemetryenergy = require("./teslemetryenergy.cjs");
|
|
19
|
+
const require_energyparsers = require("./energyparsers.cjs");
|
|
20
|
+
const require_funnel = require("./funnel.cjs");
|
|
11
21
|
const require_session = require("./signing/session.cjs");
|
|
22
|
+
const require_jws = require("./signing/jws.cjs");
|
|
23
|
+
const require_keys = require("./signing/keys.cjs");
|
|
12
24
|
const require_exceptions = require("./exceptions.cjs");
|
|
13
25
|
const require_tariff = require("./tariff.cjs");
|
|
26
|
+
const require_util = require("./util.cjs");
|
|
14
27
|
const require_const = require("./const.cjs");
|
|
15
28
|
exports.AESDecryptAuthFault = require_exceptions.AESDecryptAuthFault;
|
|
16
29
|
exports.AuthorizationRole = require_const.AuthorizationRole;
|
|
@@ -28,7 +41,9 @@ exports.BluetoothTimeout = require_exceptions.BluetoothTimeout;
|
|
|
28
41
|
exports.BluetoothTransportError = require_exceptions.BluetoothTransportError;
|
|
29
42
|
exports.BluetoothUnconfirmedCommand = require_exceptions.BluetoothUnconfirmedCommand;
|
|
30
43
|
exports.BluetoothVehicleData = require_const.BluetoothVehicleData;
|
|
44
|
+
exports.CLOSURE_STATES = require_funnel.CLOSURE_STATES;
|
|
31
45
|
exports.CabinOverheatProtectionTemp = require_const.CabinOverheatProtectionTemp;
|
|
46
|
+
exports.Charging = require_charging.default;
|
|
32
47
|
exports.ClientClosedRequest = require_exceptions.ClientClosedRequest;
|
|
33
48
|
exports.ClimateKeeperMode = require_const.ClimateKeeperMode;
|
|
34
49
|
exports.ClimateModes = require_const.ClimateModes;
|
|
@@ -37,19 +52,26 @@ exports.Commands = require_commands.default;
|
|
|
37
52
|
exports.CouldNotHashMetadataFault = require_exceptions.CouldNotHashMetadataFault;
|
|
38
53
|
exports.CouldNotRetrieveKeyFault = require_exceptions.CouldNotRetrieveKeyFault;
|
|
39
54
|
exports.CouldNotRetrieveTokenFault = require_exceptions.CouldNotRetrieveTokenFault;
|
|
55
|
+
exports.DAY_OF_WEEK_BITS = require_commands.DAY_OF_WEEK_BITS;
|
|
56
|
+
exports.DEFAULT_LOCALE = require_const.DEFAULT_LOCALE;
|
|
57
|
+
exports.DEFAULT_PAIRING_POLL_INTERVAL = require_teslemetryenergy.DEFAULT_PAIRING_POLL_INTERVAL;
|
|
58
|
+
exports.DEFAULT_PAIRING_TIMEOUT = require_teslemetryenergy.DEFAULT_PAIRING_TIMEOUT;
|
|
40
59
|
exports.DeviceType = require_const.DeviceType;
|
|
41
60
|
exports.DeviceUnexpectedResponse = require_exceptions.DeviceUnexpectedResponse;
|
|
42
61
|
exports.DistanceUnit = require_const.DistanceUnit;
|
|
43
62
|
exports.ECDSAInputFault = require_exceptions.ECDSAInputFault;
|
|
44
63
|
exports.ECDSASignatureFault = require_exceptions.ECDSASignatureFault;
|
|
64
|
+
exports.ENERGY_SIGNATURE_TTL_SECONDS = require_energy$1.ENERGY_SIGNATURE_TTL_SECONDS;
|
|
45
65
|
exports.Energy = require_energy.default;
|
|
46
66
|
exports.EnergyDeviceIdentifierType = require_const.EnergyDeviceIdentifierType;
|
|
67
|
+
exports.EnergyDeviceSigner = require_energy$1.EnergyDeviceSigner;
|
|
47
68
|
exports.EnergyDisplayFormat = require_const.EnergyDisplayFormat;
|
|
48
69
|
exports.EnergyExportMode = require_const.EnergyExportMode;
|
|
49
70
|
exports.EnergyGatewayUnreachable = require_exceptions.EnergyGatewayUnreachable;
|
|
50
71
|
exports.EnergyIslandMode = require_const.EnergyIslandMode;
|
|
51
72
|
exports.EnergyOperationMode = require_const.EnergyOperationMode;
|
|
52
73
|
exports.EnergySpecific = require_energyspecific.default;
|
|
74
|
+
exports.FieldPath = require_funnel.FieldPath;
|
|
53
75
|
exports.Forbidden = require_exceptions.Forbidden;
|
|
54
76
|
exports.GatewayTimeout = require_exceptions.GatewayTimeout;
|
|
55
77
|
exports.INFORMATION_FAULTS = require_exceptions.INFORMATION_FAULTS;
|
|
@@ -73,12 +95,14 @@ exports.InvalidTessieToken = require_exceptions.InvalidTessieToken;
|
|
|
73
95
|
exports.InvalidToken = require_exceptions.InvalidToken;
|
|
74
96
|
exports.InvalidTokenFault = require_exceptions.InvalidTokenFault;
|
|
75
97
|
exports.KEY_REJECTED_FAULTS = require_exceptions.KEY_REJECTED_FAULTS;
|
|
98
|
+
exports.LOCK_STATES = require_funnel.LOCK_STATES;
|
|
76
99
|
exports.Level = require_const.Level;
|
|
77
100
|
exports.LibraryError = require_exceptions.LibraryError;
|
|
78
101
|
exports.LocalEntityResultFault = require_exceptions.LocalEntityResultFault;
|
|
79
102
|
exports.LocalEntityStartFault = require_exceptions.LocalEntityStartFault;
|
|
80
103
|
exports.Locked = require_exceptions.Locked;
|
|
81
104
|
exports.LoginRequired = require_exceptions.LoginRequired;
|
|
105
|
+
exports.MAX_DISPATCH_DURATION_SECONDS = require_energyspecific.MAX_DISPATCH_DURATION_SECONDS;
|
|
82
106
|
exports.MESSAGE_FAULTS = require_exceptions.MESSAGE_FAULTS;
|
|
83
107
|
exports.Method = require_const.Method;
|
|
84
108
|
exports.MissingTeslemetryToken = require_exceptions.MissingTeslemetryToken;
|
|
@@ -93,10 +117,13 @@ exports.NotOnWhitelistFault = require_exceptions.NotOnWhitelistFault;
|
|
|
93
117
|
exports.NotProvisionedWithIdentityFault = require_exceptions.NotProvisionedWithIdentityFault;
|
|
94
118
|
exports.OAuthExpired = require_exceptions.OAuthExpired;
|
|
95
119
|
exports.OAuthInvalid = require_exceptions.OAuthInvalid;
|
|
120
|
+
exports.ObservationFunnel = require_funnel.ObservationFunnel;
|
|
121
|
+
exports.Partner = require_partner.default;
|
|
96
122
|
exports.PaymentRequired = require_exceptions.PaymentRequired;
|
|
97
123
|
exports.PhoneFontSize = require_const.PhoneFontSize;
|
|
98
124
|
exports.PreconditionFailed = require_exceptions.PreconditionFailed;
|
|
99
125
|
exports.PrivateKeyError = require_exceptions.PrivateKeyError;
|
|
126
|
+
exports.REGISTER_URL = require_teslemetry.REGISTER_URL;
|
|
100
127
|
exports.RateLimited = require_exceptions.RateLimited;
|
|
101
128
|
exports.ResourceUnavailableForLegalReasons = require_exceptions.ResourceUnavailableForLegalReasons;
|
|
102
129
|
exports.ResponseError = require_exceptions.ResponseError;
|
|
@@ -132,6 +159,7 @@ exports.SignedMessageInformationFaultTokenAndCounterInvalid = require_exceptions
|
|
|
132
159
|
exports.SignedMessageInformationFaultTokenIsIncorrectLength = require_exceptions.SignedMessageInformationFaultTokenIsIncorrectLength;
|
|
133
160
|
exports.SignedMessageInformationFaultUnknown = require_exceptions.SignedMessageInformationFaultUnknown;
|
|
134
161
|
exports.SigningDisabled = require_exceptions.SigningDisabled;
|
|
162
|
+
exports.SnapshotTopic = require_const.SnapshotTopic;
|
|
135
163
|
exports.SubscriptionRequired = require_exceptions.SubscriptionRequired;
|
|
136
164
|
exports.SunRoofCommand = require_const.SunRoofCommand;
|
|
137
165
|
exports.TOKEN_URLS = require_const.TOKEN_URLS;
|
|
@@ -170,26 +198,39 @@ exports.TeslaFleetMessageFaultTimeToLiveTooLong = require_exceptions.TeslaFleetM
|
|
|
170
198
|
exports.TeslaFleetMessageFaultTimeout = require_exceptions.TeslaFleetMessageFaultTimeout;
|
|
171
199
|
exports.TeslaFleetMessageFaultUnknownKeyId = require_exceptions.TeslaFleetMessageFaultUnknownKeyId;
|
|
172
200
|
exports.TeslaFleetMessageFaultWrongPersonalization = require_exceptions.TeslaFleetMessageFaultWrongPersonalization;
|
|
201
|
+
exports.TeslaFleetOAuth = require_oauth.default;
|
|
173
202
|
exports.Teslemetry = require_teslemetry.default;
|
|
203
|
+
exports.TeslemetryEnergySite = require_teslemetryenergy.TeslemetryEnergySite;
|
|
204
|
+
exports.TeslemetryEnergySites = require_teslemetryenergy.TeslemetryEnergySites;
|
|
174
205
|
exports.TeslemetryRegistrationError = require_exceptions.TeslemetryRegistrationError;
|
|
206
|
+
exports.TeslemetryStreamPublisher = require_funnel.TeslemetryStreamPublisher;
|
|
207
|
+
exports.TeslemetryVehicle = require_teslemetryvehicle.TeslemetryVehicle;
|
|
208
|
+
exports.TeslemetryVehicleTelemetry = require_teslemetryvehicle.TeslemetryVehicleTelemetry;
|
|
209
|
+
exports.TeslemetryVehicles = require_teslemetryvehicle.TeslemetryVehicles;
|
|
175
210
|
exports.Tessie = require_tessie.default;
|
|
211
|
+
exports.TessieVehicle = require_tessievehicle.TessieVehicle;
|
|
212
|
+
exports.TessieVehicles = require_tessievehicle.TessieVehicles;
|
|
176
213
|
exports.TimeDisplayFormat = require_const.TimeDisplayFormat;
|
|
177
214
|
exports.TimeExpiredFault = require_exceptions.TimeExpiredFault;
|
|
178
215
|
exports.TirePressureUnit = require_const.TirePressureUnit;
|
|
179
216
|
exports.TokenAndCounterInvalidFault = require_exceptions.TokenAndCounterInvalidFault;
|
|
180
217
|
exports.TokenIsIncorrectLengthFault = require_exceptions.TokenIsIncorrectLengthFault;
|
|
181
218
|
exports.Trunk = require_const.Trunk;
|
|
219
|
+
exports.UNSIGNED_DEVICE_COMMANDS = require_energyspecific.UNSIGNED_DEVICE_COMMANDS;
|
|
182
220
|
exports.UnauthorizedClient = require_exceptions.UnauthorizedClient;
|
|
183
221
|
exports.UnknownFault = require_exceptions.UnknownFault;
|
|
184
222
|
exports.UnsupportedVehicle = require_exceptions.UnsupportedVehicle;
|
|
223
|
+
exports.User = require_user.default;
|
|
185
224
|
exports.Vehicle = require_vehicle.default;
|
|
186
225
|
exports.VehicleDataEndpoint = require_const.VehicleDataEndpoint;
|
|
226
|
+
exports.VehicleDataResultPublisher = require_funnel.VehicleDataResultPublisher;
|
|
187
227
|
exports.VehicleImageType = require_const.VehicleImageType;
|
|
188
228
|
exports.VehicleOffline = require_exceptions.VehicleOffline;
|
|
189
229
|
exports.VehicleSigned = require_vehiclesigned.default;
|
|
190
230
|
exports.VehicleSpecific = require_vehiclespecific.default;
|
|
191
231
|
exports.VehicleSubscriptionRequired = require_exceptions.VehicleSubscriptionRequired;
|
|
192
232
|
exports.WHITELIST_OPERATION_STATUS = require_exceptions.WHITELIST_OPERATION_STATUS;
|
|
233
|
+
exports.WaitTopic = require_const.WaitTopic;
|
|
193
234
|
exports.WhitelistOperationAttemptingToAddExistingKey = require_exceptions.WhitelistOperationAttemptingToAddExistingKey;
|
|
194
235
|
exports.WhitelistOperationAttemptingToAddKeyWithServiceRole = require_exceptions.WhitelistOperationAttemptingToAddKeyWithServiceRole;
|
|
195
236
|
exports.WhitelistOperationAttemptingToAddKeyWithoutRole = require_exceptions.WhitelistOperationAttemptingToAddKeyWithoutRole;
|
|
@@ -220,7 +261,27 @@ exports.WhitelistOperationStatus = require_exceptions.WhitelistOperationStatus;
|
|
|
220
261
|
exports.WhitelistOperationUndocumentedError = require_exceptions.WhitelistOperationUndocumentedError;
|
|
221
262
|
exports.WhitelistOperationWhitelistFull = require_exceptions.WhitelistOperationWhitelistFull;
|
|
222
263
|
exports.WindowCommand = require_const.WindowCommand;
|
|
264
|
+
exports.days_of_week_mask = require_commands.days_of_week_mask;
|
|
265
|
+
exports.ec_private_key_from_pem = require_keys.ec_private_key_from_pem;
|
|
266
|
+
exports.firmwareAtLeast = require_util.firmwareAtLeast;
|
|
267
|
+
exports.firmwareCompare = require_util.firmwareCompare;
|
|
268
|
+
exports.generate_ec_private_key_pem = require_keys.generate_ec_private_key_pem;
|
|
269
|
+
exports.generate_rsa_private_key_pem = require_keys.generate_rsa_private_key_pem;
|
|
223
270
|
exports.getTariffPeriods = require_tariff.getTariffPeriods;
|
|
271
|
+
exports.infotainment_command_name = require_commands.infotainment_command_name;
|
|
224
272
|
exports.is_key_rejected = require_exceptions.is_key_rejected;
|
|
225
273
|
exports.is_valid_region = require_const.is_valid_region;
|
|
274
|
+
Object.defineProperty(exports, "jws", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
get: function() {
|
|
277
|
+
return require_jws.jws_exports;
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
exports.parse_authorized_clients = require_energyparsers.parse_authorized_clients;
|
|
281
|
+
exports.parse_gateway_address = require_energyparsers.parse_gateway_address;
|
|
226
282
|
exports.raise_for_status = require_exceptions.raise_for_status;
|
|
283
|
+
exports.register_client = require_teslemetry.register_client;
|
|
284
|
+
exports.rsa_public_der_pkcs1 = require_keys.rsa_public_der_pkcs1;
|
|
285
|
+
exports.unwrapTariffV2 = require_tariff.unwrapTariffV2;
|
|
286
|
+
exports.validate_dispatch_battery_power = require_energyspecific.validate_dispatch_battery_power;
|
|
287
|
+
exports.vcsec_command_name = require_commands.vcsec_command_name;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Charging from "./charging.cjs";
|
|
2
|
+
import Commands, { DAY_OF_WEEK_BITS, SendOptions, SendRequires, SignedCommandResponse, SignedReply, days_of_week_mask, infotainment_command_name, vcsec_command_name } from "./commands.cjs";
|
|
2
3
|
import Energy from "./energy.cjs";
|
|
3
|
-
import EnergySpecific from "./energyspecific.cjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import EnergySpecific, { MAX_DISPATCH_DURATION_SECONDS, UNSIGNED_DEVICE_COMMANDS, validate_dispatch_battery_power } from "./energyspecific.cjs";
|
|
5
|
+
import Partner from "./partner.cjs";
|
|
6
|
+
import TeslaFleetApi, { AccessToken } from "./teslafleetapi.cjs";
|
|
7
|
+
import TeslaFleetOAuth, { RefreshedToken, TeslaFleetOAuthOptions } from "./oauth.cjs";
|
|
8
|
+
import Teslemetry, { REGISTER_URL, TeslemetryClientRegistration, register_client } from "./teslemetry.cjs";
|
|
9
|
+
import Tessie, { TessieAllBatteryHealthOptions, TessieChargingInvoicesOptions, TessieOptions } from "./tessie.cjs";
|
|
10
|
+
import User from "./user.cjs";
|
|
7
11
|
import Vehicle from "./vehicle.cjs";
|
|
8
12
|
import VehicleSigned from "./vehiclesigned.cjs";
|
|
9
13
|
import VehicleSpecific from "./vehiclespecific.cjs";
|
|
14
|
+
import { ClosureOptions, SeatHeaterOptions, TelemetryTopics, TeslemetryVehicle, TeslemetryVehicleTelemetry, TeslemetryVehicles } from "./teslemetryvehicle.cjs";
|
|
15
|
+
import { TessieChargeScheduleOptions, TessieChargesOptions, TessieDriveTagOptions, TessieDrivesOptions, TessieIdlesOptions, TessieMapOptions, TessiePathOptions, TessiePreconditionScheduleOptions, TessieScheduledDepartureOptions, TessieStatesOptions, TessieVehicle, TessieVehicles } from "./tessievehicle.cjs";
|
|
16
|
+
import { ENERGY_SIGNATURE_TTL_SECONDS, EnergyDeviceSigner } from "./signing/energy.cjs";
|
|
17
|
+
import { AuthorizedClient, AuthorizedClients, parse_authorized_clients, parse_gateway_address } from "./energyparsers.cjs";
|
|
18
|
+
import { Logger } from "./log.cjs";
|
|
19
|
+
import { DEFAULT_PAIRING_POLL_INTERVAL, DEFAULT_PAIRING_TIMEOUT, TeslemetryEnergySite, TeslemetryEnergySites } from "./teslemetryenergy.cjs";
|
|
20
|
+
import { CLOSURE_STATES, Clock, FieldPath, LOCK_STATES, Observation, ObservationFunnel, ObservationSink, Publisher, TeslemetryStreamPublisher, Unsubscribe, Value, VehicleDataResultPublisher } from "./funnel.cjs";
|
|
10
21
|
import { Session } from "./signing/session.cjs";
|
|
22
|
+
import { jws_d_exports } from "./signing/jws.cjs";
|
|
23
|
+
import { ec_private_key_from_pem, generate_ec_private_key_pem, generate_rsa_private_key_pem, rsa_public_der_pkcs1 } from "./signing/keys.cjs";
|
|
11
24
|
import { AESDecryptAuthFault, AuthorizedClientPairingTimedOut, AuthorizedClientWaitExpired, BadGateway, BluetoothCloudUnavailableError, BluetoothCommandFailed, BluetoothTimeout, BluetoothTransportError, BluetoothUnconfirmedCommand, ClientClosedRequest, CouldNotHashMetadataFault, CouldNotRetrieveKeyFault, CouldNotRetrieveTokenFault, DeviceUnexpectedResponse, ECDSAInputFault, ECDSASignatureFault, EnergyGatewayUnreachable, Forbidden, GatewayTimeout, INFORMATION_FAULTS, IVIncorrectLengthFault, IVSmallerThanExpectedFault, IncorrectEpochFault, InsufficientCredits, InternalServerError, InvalidAuthCode, InvalidCommand, InvalidField, InvalidMethod, InvalidRedirectUrl, InvalidRegion, InvalidRequest, InvalidResource, InvalidResponse, InvalidScope, InvalidTeslemetryToken, InvalidTessieToken, InvalidToken, InvalidTokenFault, KEY_REJECTED_FAULTS, LibraryError, LocalEntityResultFault, LocalEntityStartFault, Locked, LoginRequired, MESSAGE_FAULTS, MissingTeslemetryToken, MissingTessieToken, MissingToken, MobileAccessDisabled, NotAcceptable, NotAllowed, NotFound, NotOnWhitelistFault, NotProvisionedWithIdentityFault, OAuthExpired, OAuthInvalid, PaymentRequired, PreconditionFailed, PrivateKeyError, RateLimited, ResourceUnavailableForLegalReasons, ResponseError, SIGNED_MESSAGE_INFORMATION_FAULTS, ServiceUnavailable, SessionInfoAuthenticationFault, SignatureTooShortFault, SignedCommandRequired, SignedCommandResponseReplayed, SignedMessageInformationFault, SignedMessageInformationFaultAESDecryptAuth, SignedMessageInformationFaultCouldNotHashMetadata, SignedMessageInformationFaultCouldNotRetrieveKey, SignedMessageInformationFaultCouldNotRetrieveToken, SignedMessageInformationFaultECDSAInput, SignedMessageInformationFaultECDSASignature, SignedMessageInformationFaultIVIncorrectLength, SignedMessageInformationFaultIVSmallerThanExpected, SignedMessageInformationFaultIncorrectEpoch, SignedMessageInformationFaultInvalidToken, SignedMessageInformationFaultLocalEntityResult, SignedMessageInformationFaultLocalEntityStart, SignedMessageInformationFaultNotOnWhitelist, SignedMessageInformationFaultNotProvisionedWithIdentity, SignedMessageInformationFaultSignatureTooShort, SignedMessageInformationFaultTimeExpired, SignedMessageInformationFaultTokenAndCounterInvalid, SignedMessageInformationFaultTokenIsIncorrectLength, SignedMessageInformationFaultUnknown, SigningDisabled, SubscriptionRequired, TeslaFleetConnectionError, TeslaFleetError, TeslaFleetErrorData, TeslaFleetInformationFault, TeslaFleetMessageFault, TeslaFleetMessageFaultBadParameter, TeslaFleetMessageFaultBusy, TeslaFleetMessageFaultCommandRequiresAccountCredentials, TeslaFleetMessageFaultCouldNotHashMetadata, TeslaFleetMessageFaultDecoding, TeslaFleetMessageFaultFieldExceedsMTU, TeslaFleetMessageFaultIVIncorrectLength, TeslaFleetMessageFaultInactiveKey, TeslaFleetMessageFaultIncorrectEpoch, TeslaFleetMessageFaultInsufficientPrivileges, TeslaFleetMessageFaultInternal, TeslaFleetMessageFaultInvalidCommand, TeslaFleetMessageFaultInvalidDomains, TeslaFleetMessageFaultInvalidKeyHandle, TeslaFleetMessageFaultInvalidSignature, TeslaFleetMessageFaultInvalidTokenOrCounter, TeslaFleetMessageFaultKeychainIsFull, TeslaFleetMessageFaultNotProvisionedWithIdentity, TeslaFleetMessageFaultRemoteAccessDisabled, TeslaFleetMessageFaultRemoteServiceAccessDisabled, TeslaFleetMessageFaultRepeatedCounter, TeslaFleetMessageFaultRequiresResponseEncryption, TeslaFleetMessageFaultResponseSizeExceedsMTU, TeslaFleetMessageFaultTimeExpired, TeslaFleetMessageFaultTimeToLiveTooLong, TeslaFleetMessageFaultTimeout, TeslaFleetMessageFaultUnknownKeyId, TeslaFleetMessageFaultWrongPersonalization, TeslemetryRegistrationError, TimeExpiredFault, TokenAndCounterInvalidFault, TokenIsIncorrectLengthFault, UnauthorizedClient, UnknownFault, UnsupportedVehicle, VehicleOffline, VehicleSubscriptionRequired, WHITELIST_OPERATION_STATUS, WhitelistOperationAttemptingToAddExistingKey, WhitelistOperationAttemptingToAddKeyWithServiceRole, WhitelistOperationAttemptingToAddKeyWithoutRole, WhitelistOperationAttemptingToDemoteSuperiorToOneself, WhitelistOperationAttemptingToElevateOthersAboveOneself, WhitelistOperationAttemptingToRemoveOwnPermissions, WhitelistOperationCouldNotStartLocalEntityAuth, WhitelistOperationFMAttemptingToAddPermanentKey, WhitelistOperationFMAttemptingToRemovePermanentKey, WhitelistOperationFMModifyingOutsideOfFMode, WhitelistOperationInvalidPublicKey, WhitelistOperationKeychainWhileFSFull, WhitelistOperationKeyfobSlotsFull, WhitelistOperationLocalEntityAuthFailedCancelled, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck, WhitelistOperationLocalEntityAuthFailedUIDenied, WhitelistOperationLocalEntityAuthFailedValetMode, WhitelistOperationNoPermissionToAdd, WhitelistOperationNoPermissionToChangePermissions, WhitelistOperationNoPermissionToRemove, WhitelistOperationNoPermissionToRemoveOneself, WhitelistOperationNonServiceKeyAttemptingToAddServiceTech, WhitelistOperationNotAllowedToAddUnlessOnReader, WhitelistOperationPublicKeyNotOnWhitelist, WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode, WhitelistOperationStatus, WhitelistOperationUndocumentedError, WhitelistOperationWhitelistFull, is_key_rejected, raise_for_status } from "./exceptions.cjs";
|
|
12
|
-
import { TariffPeriod, TariffRate, TariffResolution, getTariffPeriods } from "./tariff.cjs";
|
|
13
|
-
import {
|
|
14
|
-
|
|
25
|
+
import { TariffPeriod, TariffRate, TariffResolution, getTariffPeriods, unwrapTariffV2 } from "./tariff.cjs";
|
|
26
|
+
import { firmwareAtLeast, firmwareCompare } from "./util.cjs";
|
|
27
|
+
import { AuthorizationRole, AuthorizedClientKeyType, AuthorizedClientState, AuthorizedClientType, AuthorizedVerificationType, AutoSeat, BluetoothConfirmation, BluetoothVehicleData, CabinOverheatProtectionTemp, ClimateKeeperMode, ClimateMode, ClimateModes, ClosureState, DEFAULT_LOCALE, DeviceType, DistanceUnit, EnergyDeviceIdentifierType, EnergyDisplayFormat, EnergyExportMode, EnergyIslandMode, EnergyOperationMode, Level, Method, Models, PhoneFontSize, Region, SERVERS, Scope, Seat, SeatHeaterLevel, Seats, SnapshotTopic, SunRoofCommand, TOKEN_URLS, TemperatureUnit, TeslaEnergyPeriod, TimeDisplayFormat, TirePressureUnit, Trunk, VehicleDataEndpoint, VehicleImageType, WaitTopic, WindowCommand, is_valid_region } from "./const.cjs";
|
|
28
|
+
export { AESDecryptAuthFault, type AccessToken, AuthorizationRole, type AuthorizedClient, AuthorizedClientKeyType, AuthorizedClientPairingTimedOut, AuthorizedClientState, AuthorizedClientType, AuthorizedClientWaitExpired, type AuthorizedClients, AuthorizedVerificationType, AutoSeat, BadGateway, BluetoothCloudUnavailableError, BluetoothCommandFailed, BluetoothConfirmation, BluetoothTimeout, BluetoothTransportError, BluetoothUnconfirmedCommand, BluetoothVehicleData, CLOSURE_STATES, CabinOverheatProtectionTemp, Charging, ClientClosedRequest, ClimateKeeperMode, ClimateMode, ClimateModes, type Clock, type ClosureOptions, ClosureState, Commands, CouldNotHashMetadataFault, CouldNotRetrieveKeyFault, CouldNotRetrieveTokenFault, DAY_OF_WEEK_BITS, DEFAULT_LOCALE, DEFAULT_PAIRING_POLL_INTERVAL, DEFAULT_PAIRING_TIMEOUT, DeviceType, DeviceUnexpectedResponse, DistanceUnit, ECDSAInputFault, ECDSASignatureFault, ENERGY_SIGNATURE_TTL_SECONDS, Energy, EnergyDeviceIdentifierType, EnergyDeviceSigner, EnergyDisplayFormat, EnergyExportMode, EnergyGatewayUnreachable, EnergyIslandMode, EnergyOperationMode, EnergySpecific, FieldPath, Forbidden, GatewayTimeout, INFORMATION_FAULTS, IVIncorrectLengthFault, IVSmallerThanExpectedFault, IncorrectEpochFault, InsufficientCredits, InternalServerError, InvalidAuthCode, InvalidCommand, InvalidField, InvalidMethod, InvalidRedirectUrl, InvalidRegion, InvalidRequest, InvalidResource, InvalidResponse, InvalidScope, InvalidTeslemetryToken, InvalidTessieToken, InvalidToken, InvalidTokenFault, KEY_REJECTED_FAULTS, LOCK_STATES, Level, LibraryError, LocalEntityResultFault, LocalEntityStartFault, Locked, type Logger, LoginRequired, MAX_DISPATCH_DURATION_SECONDS, MESSAGE_FAULTS, Method, MissingTeslemetryToken, MissingTessieToken, MissingToken, MobileAccessDisabled, Models, NotAcceptable, NotAllowed, NotFound, NotOnWhitelistFault, NotProvisionedWithIdentityFault, OAuthExpired, OAuthInvalid, type Observation, ObservationFunnel, type ObservationSink, Partner, PaymentRequired, PhoneFontSize, PreconditionFailed, PrivateKeyError, type Publisher, REGISTER_URL, RateLimited, type RefreshedToken, Region, ResourceUnavailableForLegalReasons, ResponseError, SERVERS, SIGNED_MESSAGE_INFORMATION_FAULTS, Scope, Seat, SeatHeaterLevel, type SeatHeaterOptions, Seats, type SendOptions, type SendRequires, ServiceUnavailable, Session, SessionInfoAuthenticationFault, SignatureTooShortFault, SignedCommandRequired, type SignedCommandResponse, SignedCommandResponseReplayed, SignedMessageInformationFault, SignedMessageInformationFaultAESDecryptAuth, SignedMessageInformationFaultCouldNotHashMetadata, SignedMessageInformationFaultCouldNotRetrieveKey, SignedMessageInformationFaultCouldNotRetrieveToken, SignedMessageInformationFaultECDSAInput, SignedMessageInformationFaultECDSASignature, SignedMessageInformationFaultIVIncorrectLength, SignedMessageInformationFaultIVSmallerThanExpected, SignedMessageInformationFaultIncorrectEpoch, SignedMessageInformationFaultInvalidToken, SignedMessageInformationFaultLocalEntityResult, SignedMessageInformationFaultLocalEntityStart, SignedMessageInformationFaultNotOnWhitelist, SignedMessageInformationFaultNotProvisionedWithIdentity, SignedMessageInformationFaultSignatureTooShort, SignedMessageInformationFaultTimeExpired, SignedMessageInformationFaultTokenAndCounterInvalid, SignedMessageInformationFaultTokenIsIncorrectLength, SignedMessageInformationFaultUnknown, type SignedReply, SigningDisabled, SnapshotTopic, SubscriptionRequired, SunRoofCommand, TOKEN_URLS, type TariffPeriod, type TariffRate, type TariffResolution, type TelemetryTopics, TemperatureUnit, TeslaEnergyPeriod, TeslaFleetApi, TeslaFleetConnectionError, TeslaFleetError, TeslaFleetErrorData, TeslaFleetInformationFault, TeslaFleetMessageFault, TeslaFleetMessageFaultBadParameter, TeslaFleetMessageFaultBusy, TeslaFleetMessageFaultCommandRequiresAccountCredentials, TeslaFleetMessageFaultCouldNotHashMetadata, TeslaFleetMessageFaultDecoding, TeslaFleetMessageFaultFieldExceedsMTU, TeslaFleetMessageFaultIVIncorrectLength, TeslaFleetMessageFaultInactiveKey, TeslaFleetMessageFaultIncorrectEpoch, TeslaFleetMessageFaultInsufficientPrivileges, TeslaFleetMessageFaultInternal, TeslaFleetMessageFaultInvalidCommand, TeslaFleetMessageFaultInvalidDomains, TeslaFleetMessageFaultInvalidKeyHandle, TeslaFleetMessageFaultInvalidSignature, TeslaFleetMessageFaultInvalidTokenOrCounter, TeslaFleetMessageFaultKeychainIsFull, TeslaFleetMessageFaultNotProvisionedWithIdentity, TeslaFleetMessageFaultRemoteAccessDisabled, TeslaFleetMessageFaultRemoteServiceAccessDisabled, TeslaFleetMessageFaultRepeatedCounter, TeslaFleetMessageFaultRequiresResponseEncryption, TeslaFleetMessageFaultResponseSizeExceedsMTU, TeslaFleetMessageFaultTimeExpired, TeslaFleetMessageFaultTimeToLiveTooLong, TeslaFleetMessageFaultTimeout, TeslaFleetMessageFaultUnknownKeyId, TeslaFleetMessageFaultWrongPersonalization, TeslaFleetOAuth, type TeslaFleetOAuthOptions, Teslemetry, type TeslemetryClientRegistration, TeslemetryEnergySite, TeslemetryEnergySites, TeslemetryRegistrationError, TeslemetryStreamPublisher, TeslemetryVehicle, TeslemetryVehicleTelemetry, TeslemetryVehicles, Tessie, type TessieAllBatteryHealthOptions, type TessieChargeScheduleOptions, type TessieChargesOptions, type TessieChargingInvoicesOptions, type TessieDriveTagOptions, type TessieDrivesOptions, type TessieIdlesOptions, type TessieMapOptions, type TessieOptions, type TessiePathOptions, type TessiePreconditionScheduleOptions, type TessieScheduledDepartureOptions, type TessieStatesOptions, TessieVehicle, TessieVehicles, TimeDisplayFormat, TimeExpiredFault, TirePressureUnit, TokenAndCounterInvalidFault, TokenIsIncorrectLengthFault, Trunk, UNSIGNED_DEVICE_COMMANDS, UnauthorizedClient, UnknownFault, type Unsubscribe, UnsupportedVehicle, User, type Value, Vehicle, VehicleDataEndpoint, VehicleDataResultPublisher, VehicleImageType, VehicleOffline, VehicleSigned, VehicleSpecific, VehicleSubscriptionRequired, WHITELIST_OPERATION_STATUS, WaitTopic, WhitelistOperationAttemptingToAddExistingKey, WhitelistOperationAttemptingToAddKeyWithServiceRole, WhitelistOperationAttemptingToAddKeyWithoutRole, WhitelistOperationAttemptingToDemoteSuperiorToOneself, WhitelistOperationAttemptingToElevateOthersAboveOneself, WhitelistOperationAttemptingToRemoveOwnPermissions, WhitelistOperationCouldNotStartLocalEntityAuth, WhitelistOperationFMAttemptingToAddPermanentKey, WhitelistOperationFMAttemptingToRemovePermanentKey, WhitelistOperationFMModifyingOutsideOfFMode, WhitelistOperationInvalidPublicKey, WhitelistOperationKeychainWhileFSFull, WhitelistOperationKeyfobSlotsFull, WhitelistOperationLocalEntityAuthFailedCancelled, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck, WhitelistOperationLocalEntityAuthFailedUIDenied, WhitelistOperationLocalEntityAuthFailedValetMode, WhitelistOperationNoPermissionToAdd, WhitelistOperationNoPermissionToChangePermissions, WhitelistOperationNoPermissionToRemove, WhitelistOperationNoPermissionToRemoveOneself, WhitelistOperationNonServiceKeyAttemptingToAddServiceTech, WhitelistOperationNotAllowedToAddUnlessOnReader, WhitelistOperationPublicKeyNotOnWhitelist, WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode, WhitelistOperationStatus, WhitelistOperationUndocumentedError, WhitelistOperationWhitelistFull, WindowCommand, days_of_week_mask, ec_private_key_from_pem, firmwareAtLeast, firmwareCompare, generate_ec_private_key_pem, generate_rsa_private_key_pem, getTariffPeriods, infotainment_command_name, is_key_rejected, is_valid_region, jws_d_exports as jws, parse_authorized_clients, parse_gateway_address, raise_for_status, register_client, rsa_public_der_pkcs1, unwrapTariffV2, validate_dispatch_battery_power, vcsec_command_name };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Charging from "./charging.mjs";
|
|
2
|
+
import Commands, { DAY_OF_WEEK_BITS, SendOptions, SendRequires, SignedCommandResponse, SignedReply, days_of_week_mask, infotainment_command_name, vcsec_command_name } from "./commands.mjs";
|
|
2
3
|
import Energy from "./energy.mjs";
|
|
3
|
-
import EnergySpecific from "./energyspecific.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import EnergySpecific, { MAX_DISPATCH_DURATION_SECONDS, UNSIGNED_DEVICE_COMMANDS, validate_dispatch_battery_power } from "./energyspecific.mjs";
|
|
5
|
+
import Partner from "./partner.mjs";
|
|
6
|
+
import TeslaFleetApi, { AccessToken } from "./teslafleetapi.mjs";
|
|
7
|
+
import TeslaFleetOAuth, { RefreshedToken, TeslaFleetOAuthOptions } from "./oauth.mjs";
|
|
8
|
+
import Teslemetry, { REGISTER_URL, TeslemetryClientRegistration, register_client } from "./teslemetry.mjs";
|
|
9
|
+
import Tessie, { TessieAllBatteryHealthOptions, TessieChargingInvoicesOptions, TessieOptions } from "./tessie.mjs";
|
|
10
|
+
import User from "./user.mjs";
|
|
7
11
|
import Vehicle from "./vehicle.mjs";
|
|
8
12
|
import VehicleSigned from "./vehiclesigned.mjs";
|
|
9
13
|
import VehicleSpecific from "./vehiclespecific.mjs";
|
|
14
|
+
import { ClosureOptions, SeatHeaterOptions, TelemetryTopics, TeslemetryVehicle, TeslemetryVehicleTelemetry, TeslemetryVehicles } from "./teslemetryvehicle.mjs";
|
|
15
|
+
import { TessieChargeScheduleOptions, TessieChargesOptions, TessieDriveTagOptions, TessieDrivesOptions, TessieIdlesOptions, TessieMapOptions, TessiePathOptions, TessiePreconditionScheduleOptions, TessieScheduledDepartureOptions, TessieStatesOptions, TessieVehicle, TessieVehicles } from "./tessievehicle.mjs";
|
|
16
|
+
import { ENERGY_SIGNATURE_TTL_SECONDS, EnergyDeviceSigner } from "./signing/energy.mjs";
|
|
17
|
+
import { AuthorizedClient, AuthorizedClients, parse_authorized_clients, parse_gateway_address } from "./energyparsers.mjs";
|
|
18
|
+
import { Logger } from "./log.mjs";
|
|
19
|
+
import { DEFAULT_PAIRING_POLL_INTERVAL, DEFAULT_PAIRING_TIMEOUT, TeslemetryEnergySite, TeslemetryEnergySites } from "./teslemetryenergy.mjs";
|
|
20
|
+
import { CLOSURE_STATES, Clock, FieldPath, LOCK_STATES, Observation, ObservationFunnel, ObservationSink, Publisher, TeslemetryStreamPublisher, Unsubscribe, Value, VehicleDataResultPublisher } from "./funnel.mjs";
|
|
10
21
|
import { Session } from "./signing/session.mjs";
|
|
22
|
+
import { jws_d_exports } from "./signing/jws.mjs";
|
|
23
|
+
import { ec_private_key_from_pem, generate_ec_private_key_pem, generate_rsa_private_key_pem, rsa_public_der_pkcs1 } from "./signing/keys.mjs";
|
|
11
24
|
import { AESDecryptAuthFault, AuthorizedClientPairingTimedOut, AuthorizedClientWaitExpired, BadGateway, BluetoothCloudUnavailableError, BluetoothCommandFailed, BluetoothTimeout, BluetoothTransportError, BluetoothUnconfirmedCommand, ClientClosedRequest, CouldNotHashMetadataFault, CouldNotRetrieveKeyFault, CouldNotRetrieveTokenFault, DeviceUnexpectedResponse, ECDSAInputFault, ECDSASignatureFault, EnergyGatewayUnreachable, Forbidden, GatewayTimeout, INFORMATION_FAULTS, IVIncorrectLengthFault, IVSmallerThanExpectedFault, IncorrectEpochFault, InsufficientCredits, InternalServerError, InvalidAuthCode, InvalidCommand, InvalidField, InvalidMethod, InvalidRedirectUrl, InvalidRegion, InvalidRequest, InvalidResource, InvalidResponse, InvalidScope, InvalidTeslemetryToken, InvalidTessieToken, InvalidToken, InvalidTokenFault, KEY_REJECTED_FAULTS, LibraryError, LocalEntityResultFault, LocalEntityStartFault, Locked, LoginRequired, MESSAGE_FAULTS, MissingTeslemetryToken, MissingTessieToken, MissingToken, MobileAccessDisabled, NotAcceptable, NotAllowed, NotFound, NotOnWhitelistFault, NotProvisionedWithIdentityFault, OAuthExpired, OAuthInvalid, PaymentRequired, PreconditionFailed, PrivateKeyError, RateLimited, ResourceUnavailableForLegalReasons, ResponseError, SIGNED_MESSAGE_INFORMATION_FAULTS, ServiceUnavailable, SessionInfoAuthenticationFault, SignatureTooShortFault, SignedCommandRequired, SignedCommandResponseReplayed, SignedMessageInformationFault, SignedMessageInformationFaultAESDecryptAuth, SignedMessageInformationFaultCouldNotHashMetadata, SignedMessageInformationFaultCouldNotRetrieveKey, SignedMessageInformationFaultCouldNotRetrieveToken, SignedMessageInformationFaultECDSAInput, SignedMessageInformationFaultECDSASignature, SignedMessageInformationFaultIVIncorrectLength, SignedMessageInformationFaultIVSmallerThanExpected, SignedMessageInformationFaultIncorrectEpoch, SignedMessageInformationFaultInvalidToken, SignedMessageInformationFaultLocalEntityResult, SignedMessageInformationFaultLocalEntityStart, SignedMessageInformationFaultNotOnWhitelist, SignedMessageInformationFaultNotProvisionedWithIdentity, SignedMessageInformationFaultSignatureTooShort, SignedMessageInformationFaultTimeExpired, SignedMessageInformationFaultTokenAndCounterInvalid, SignedMessageInformationFaultTokenIsIncorrectLength, SignedMessageInformationFaultUnknown, SigningDisabled, SubscriptionRequired, TeslaFleetConnectionError, TeslaFleetError, TeslaFleetErrorData, TeslaFleetInformationFault, TeslaFleetMessageFault, TeslaFleetMessageFaultBadParameter, TeslaFleetMessageFaultBusy, TeslaFleetMessageFaultCommandRequiresAccountCredentials, TeslaFleetMessageFaultCouldNotHashMetadata, TeslaFleetMessageFaultDecoding, TeslaFleetMessageFaultFieldExceedsMTU, TeslaFleetMessageFaultIVIncorrectLength, TeslaFleetMessageFaultInactiveKey, TeslaFleetMessageFaultIncorrectEpoch, TeslaFleetMessageFaultInsufficientPrivileges, TeslaFleetMessageFaultInternal, TeslaFleetMessageFaultInvalidCommand, TeslaFleetMessageFaultInvalidDomains, TeslaFleetMessageFaultInvalidKeyHandle, TeslaFleetMessageFaultInvalidSignature, TeslaFleetMessageFaultInvalidTokenOrCounter, TeslaFleetMessageFaultKeychainIsFull, TeslaFleetMessageFaultNotProvisionedWithIdentity, TeslaFleetMessageFaultRemoteAccessDisabled, TeslaFleetMessageFaultRemoteServiceAccessDisabled, TeslaFleetMessageFaultRepeatedCounter, TeslaFleetMessageFaultRequiresResponseEncryption, TeslaFleetMessageFaultResponseSizeExceedsMTU, TeslaFleetMessageFaultTimeExpired, TeslaFleetMessageFaultTimeToLiveTooLong, TeslaFleetMessageFaultTimeout, TeslaFleetMessageFaultUnknownKeyId, TeslaFleetMessageFaultWrongPersonalization, TeslemetryRegistrationError, TimeExpiredFault, TokenAndCounterInvalidFault, TokenIsIncorrectLengthFault, UnauthorizedClient, UnknownFault, UnsupportedVehicle, VehicleOffline, VehicleSubscriptionRequired, WHITELIST_OPERATION_STATUS, WhitelistOperationAttemptingToAddExistingKey, WhitelistOperationAttemptingToAddKeyWithServiceRole, WhitelistOperationAttemptingToAddKeyWithoutRole, WhitelistOperationAttemptingToDemoteSuperiorToOneself, WhitelistOperationAttemptingToElevateOthersAboveOneself, WhitelistOperationAttemptingToRemoveOwnPermissions, WhitelistOperationCouldNotStartLocalEntityAuth, WhitelistOperationFMAttemptingToAddPermanentKey, WhitelistOperationFMAttemptingToRemovePermanentKey, WhitelistOperationFMModifyingOutsideOfFMode, WhitelistOperationInvalidPublicKey, WhitelistOperationKeychainWhileFSFull, WhitelistOperationKeyfobSlotsFull, WhitelistOperationLocalEntityAuthFailedCancelled, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck, WhitelistOperationLocalEntityAuthFailedUIDenied, WhitelistOperationLocalEntityAuthFailedValetMode, WhitelistOperationNoPermissionToAdd, WhitelistOperationNoPermissionToChangePermissions, WhitelistOperationNoPermissionToRemove, WhitelistOperationNoPermissionToRemoveOneself, WhitelistOperationNonServiceKeyAttemptingToAddServiceTech, WhitelistOperationNotAllowedToAddUnlessOnReader, WhitelistOperationPublicKeyNotOnWhitelist, WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode, WhitelistOperationStatus, WhitelistOperationUndocumentedError, WhitelistOperationWhitelistFull, is_key_rejected, raise_for_status } from "./exceptions.mjs";
|
|
12
|
-
import { TariffPeriod, TariffRate, TariffResolution, getTariffPeriods } from "./tariff.mjs";
|
|
13
|
-
import {
|
|
14
|
-
|
|
25
|
+
import { TariffPeriod, TariffRate, TariffResolution, getTariffPeriods, unwrapTariffV2 } from "./tariff.mjs";
|
|
26
|
+
import { firmwareAtLeast, firmwareCompare } from "./util.mjs";
|
|
27
|
+
import { AuthorizationRole, AuthorizedClientKeyType, AuthorizedClientState, AuthorizedClientType, AuthorizedVerificationType, AutoSeat, BluetoothConfirmation, BluetoothVehicleData, CabinOverheatProtectionTemp, ClimateKeeperMode, ClimateMode, ClimateModes, ClosureState, DEFAULT_LOCALE, DeviceType, DistanceUnit, EnergyDeviceIdentifierType, EnergyDisplayFormat, EnergyExportMode, EnergyIslandMode, EnergyOperationMode, Level, Method, Models, PhoneFontSize, Region, SERVERS, Scope, Seat, SeatHeaterLevel, Seats, SnapshotTopic, SunRoofCommand, TOKEN_URLS, TemperatureUnit, TeslaEnergyPeriod, TimeDisplayFormat, TirePressureUnit, Trunk, VehicleDataEndpoint, VehicleImageType, WaitTopic, WindowCommand, is_valid_region } from "./const.mjs";
|
|
28
|
+
export { AESDecryptAuthFault, type AccessToken, AuthorizationRole, type AuthorizedClient, AuthorizedClientKeyType, AuthorizedClientPairingTimedOut, AuthorizedClientState, AuthorizedClientType, AuthorizedClientWaitExpired, type AuthorizedClients, AuthorizedVerificationType, AutoSeat, BadGateway, BluetoothCloudUnavailableError, BluetoothCommandFailed, BluetoothConfirmation, BluetoothTimeout, BluetoothTransportError, BluetoothUnconfirmedCommand, BluetoothVehicleData, CLOSURE_STATES, CabinOverheatProtectionTemp, Charging, ClientClosedRequest, ClimateKeeperMode, ClimateMode, ClimateModes, type Clock, type ClosureOptions, ClosureState, Commands, CouldNotHashMetadataFault, CouldNotRetrieveKeyFault, CouldNotRetrieveTokenFault, DAY_OF_WEEK_BITS, DEFAULT_LOCALE, DEFAULT_PAIRING_POLL_INTERVAL, DEFAULT_PAIRING_TIMEOUT, DeviceType, DeviceUnexpectedResponse, DistanceUnit, ECDSAInputFault, ECDSASignatureFault, ENERGY_SIGNATURE_TTL_SECONDS, Energy, EnergyDeviceIdentifierType, EnergyDeviceSigner, EnergyDisplayFormat, EnergyExportMode, EnergyGatewayUnreachable, EnergyIslandMode, EnergyOperationMode, EnergySpecific, FieldPath, Forbidden, GatewayTimeout, INFORMATION_FAULTS, IVIncorrectLengthFault, IVSmallerThanExpectedFault, IncorrectEpochFault, InsufficientCredits, InternalServerError, InvalidAuthCode, InvalidCommand, InvalidField, InvalidMethod, InvalidRedirectUrl, InvalidRegion, InvalidRequest, InvalidResource, InvalidResponse, InvalidScope, InvalidTeslemetryToken, InvalidTessieToken, InvalidToken, InvalidTokenFault, KEY_REJECTED_FAULTS, LOCK_STATES, Level, LibraryError, LocalEntityResultFault, LocalEntityStartFault, Locked, type Logger, LoginRequired, MAX_DISPATCH_DURATION_SECONDS, MESSAGE_FAULTS, Method, MissingTeslemetryToken, MissingTessieToken, MissingToken, MobileAccessDisabled, Models, NotAcceptable, NotAllowed, NotFound, NotOnWhitelistFault, NotProvisionedWithIdentityFault, OAuthExpired, OAuthInvalid, type Observation, ObservationFunnel, type ObservationSink, Partner, PaymentRequired, PhoneFontSize, PreconditionFailed, PrivateKeyError, type Publisher, REGISTER_URL, RateLimited, type RefreshedToken, Region, ResourceUnavailableForLegalReasons, ResponseError, SERVERS, SIGNED_MESSAGE_INFORMATION_FAULTS, Scope, Seat, SeatHeaterLevel, type SeatHeaterOptions, Seats, type SendOptions, type SendRequires, ServiceUnavailable, Session, SessionInfoAuthenticationFault, SignatureTooShortFault, SignedCommandRequired, type SignedCommandResponse, SignedCommandResponseReplayed, SignedMessageInformationFault, SignedMessageInformationFaultAESDecryptAuth, SignedMessageInformationFaultCouldNotHashMetadata, SignedMessageInformationFaultCouldNotRetrieveKey, SignedMessageInformationFaultCouldNotRetrieveToken, SignedMessageInformationFaultECDSAInput, SignedMessageInformationFaultECDSASignature, SignedMessageInformationFaultIVIncorrectLength, SignedMessageInformationFaultIVSmallerThanExpected, SignedMessageInformationFaultIncorrectEpoch, SignedMessageInformationFaultInvalidToken, SignedMessageInformationFaultLocalEntityResult, SignedMessageInformationFaultLocalEntityStart, SignedMessageInformationFaultNotOnWhitelist, SignedMessageInformationFaultNotProvisionedWithIdentity, SignedMessageInformationFaultSignatureTooShort, SignedMessageInformationFaultTimeExpired, SignedMessageInformationFaultTokenAndCounterInvalid, SignedMessageInformationFaultTokenIsIncorrectLength, SignedMessageInformationFaultUnknown, type SignedReply, SigningDisabled, SnapshotTopic, SubscriptionRequired, SunRoofCommand, TOKEN_URLS, type TariffPeriod, type TariffRate, type TariffResolution, type TelemetryTopics, TemperatureUnit, TeslaEnergyPeriod, TeslaFleetApi, TeslaFleetConnectionError, TeslaFleetError, TeslaFleetErrorData, TeslaFleetInformationFault, TeslaFleetMessageFault, TeslaFleetMessageFaultBadParameter, TeslaFleetMessageFaultBusy, TeslaFleetMessageFaultCommandRequiresAccountCredentials, TeslaFleetMessageFaultCouldNotHashMetadata, TeslaFleetMessageFaultDecoding, TeslaFleetMessageFaultFieldExceedsMTU, TeslaFleetMessageFaultIVIncorrectLength, TeslaFleetMessageFaultInactiveKey, TeslaFleetMessageFaultIncorrectEpoch, TeslaFleetMessageFaultInsufficientPrivileges, TeslaFleetMessageFaultInternal, TeslaFleetMessageFaultInvalidCommand, TeslaFleetMessageFaultInvalidDomains, TeslaFleetMessageFaultInvalidKeyHandle, TeslaFleetMessageFaultInvalidSignature, TeslaFleetMessageFaultInvalidTokenOrCounter, TeslaFleetMessageFaultKeychainIsFull, TeslaFleetMessageFaultNotProvisionedWithIdentity, TeslaFleetMessageFaultRemoteAccessDisabled, TeslaFleetMessageFaultRemoteServiceAccessDisabled, TeslaFleetMessageFaultRepeatedCounter, TeslaFleetMessageFaultRequiresResponseEncryption, TeslaFleetMessageFaultResponseSizeExceedsMTU, TeslaFleetMessageFaultTimeExpired, TeslaFleetMessageFaultTimeToLiveTooLong, TeslaFleetMessageFaultTimeout, TeslaFleetMessageFaultUnknownKeyId, TeslaFleetMessageFaultWrongPersonalization, TeslaFleetOAuth, type TeslaFleetOAuthOptions, Teslemetry, type TeslemetryClientRegistration, TeslemetryEnergySite, TeslemetryEnergySites, TeslemetryRegistrationError, TeslemetryStreamPublisher, TeslemetryVehicle, TeslemetryVehicleTelemetry, TeslemetryVehicles, Tessie, type TessieAllBatteryHealthOptions, type TessieChargeScheduleOptions, type TessieChargesOptions, type TessieChargingInvoicesOptions, type TessieDriveTagOptions, type TessieDrivesOptions, type TessieIdlesOptions, type TessieMapOptions, type TessieOptions, type TessiePathOptions, type TessiePreconditionScheduleOptions, type TessieScheduledDepartureOptions, type TessieStatesOptions, TessieVehicle, TessieVehicles, TimeDisplayFormat, TimeExpiredFault, TirePressureUnit, TokenAndCounterInvalidFault, TokenIsIncorrectLengthFault, Trunk, UNSIGNED_DEVICE_COMMANDS, UnauthorizedClient, UnknownFault, type Unsubscribe, UnsupportedVehicle, User, type Value, Vehicle, VehicleDataEndpoint, VehicleDataResultPublisher, VehicleImageType, VehicleOffline, VehicleSigned, VehicleSpecific, VehicleSubscriptionRequired, WHITELIST_OPERATION_STATUS, WaitTopic, WhitelistOperationAttemptingToAddExistingKey, WhitelistOperationAttemptingToAddKeyWithServiceRole, WhitelistOperationAttemptingToAddKeyWithoutRole, WhitelistOperationAttemptingToDemoteSuperiorToOneself, WhitelistOperationAttemptingToElevateOthersAboveOneself, WhitelistOperationAttemptingToRemoveOwnPermissions, WhitelistOperationCouldNotStartLocalEntityAuth, WhitelistOperationFMAttemptingToAddPermanentKey, WhitelistOperationFMAttemptingToRemovePermanentKey, WhitelistOperationFMModifyingOutsideOfFMode, WhitelistOperationInvalidPublicKey, WhitelistOperationKeychainWhileFSFull, WhitelistOperationKeyfobSlotsFull, WhitelistOperationLocalEntityAuthFailedCancelled, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap, WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck, WhitelistOperationLocalEntityAuthFailedUIDenied, WhitelistOperationLocalEntityAuthFailedValetMode, WhitelistOperationNoPermissionToAdd, WhitelistOperationNoPermissionToChangePermissions, WhitelistOperationNoPermissionToRemove, WhitelistOperationNoPermissionToRemoveOneself, WhitelistOperationNonServiceKeyAttemptingToAddServiceTech, WhitelistOperationNotAllowedToAddUnlessOnReader, WhitelistOperationPublicKeyNotOnWhitelist, WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode, WhitelistOperationStatus, WhitelistOperationUndocumentedError, WhitelistOperationWhitelistFull, WindowCommand, days_of_week_mask, ec_private_key_from_pem, firmwareAtLeast, firmwareCompare, generate_ec_private_key_pem, generate_rsa_private_key_pem, getTariffPeriods, infotainment_command_name, is_key_rejected, is_valid_region, jws_d_exports as jws, parse_authorized_clients, parse_gateway_address, raise_for_status, register_client, rsa_public_der_pkcs1, unwrapTariffV2, validate_dispatch_battery_power, vcsec_command_name };
|