@teslemetry/api 0.6.6 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -23
- package/dist/index.d.cts +52 -64
- package/dist/index.d.mts +52 -64
- package/dist/index.mjs +8 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3043,7 +3043,7 @@ var TeslemetryVehicleStream = class extends events.EventEmitter {
|
|
|
3043
3043
|
this._pendingFields = {};
|
|
3044
3044
|
} else this.logger.error(`Error updating streaming config for ${this.vin}`, data);
|
|
3045
3045
|
this._debounceTimeout = null;
|
|
3046
|
-
},
|
|
3046
|
+
}, 1e3);
|
|
3047
3047
|
}
|
|
3048
3048
|
/** Modify the field configuration of the vehicle */
|
|
3049
3049
|
async patchConfig(fields) {
|
|
@@ -3372,22 +3372,7 @@ function getStartOfToday() {
|
|
|
3372
3372
|
*/
|
|
3373
3373
|
function getEndOfToday() {
|
|
3374
3374
|
const now = /* @__PURE__ */ new Date();
|
|
3375
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(),
|
|
3376
|
-
}
|
|
3377
|
-
/**
|
|
3378
|
-
* Normalizes a date input to an ISO string format suitable for API calls.
|
|
3379
|
-
* - If input is a string, it is returned as-is
|
|
3380
|
-
* - If input is a Date, it is converted to ISO string without milliseconds
|
|
3381
|
-
* - If input is undefined, the default date is used and converted
|
|
3382
|
-
*
|
|
3383
|
-
* @param input The date input (string, Date, or undefined)
|
|
3384
|
-
* @param defaultDate The default Date to use if input is undefined
|
|
3385
|
-
* @returns Formatted date string
|
|
3386
|
-
*/
|
|
3387
|
-
function normalizeDateInput(input, defaultDate) {
|
|
3388
|
-
if (typeof input === "string") return input;
|
|
3389
|
-
if (input instanceof Date) return formatDate(input);
|
|
3390
|
-
return formatDate(defaultDate);
|
|
3375
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0, 0);
|
|
3391
3376
|
}
|
|
3392
3377
|
/**
|
|
3393
3378
|
* Processes start_date and end_date inputs for API calls.
|
|
@@ -3398,10 +3383,10 @@ function normalizeDateInput(input, defaultDate) {
|
|
|
3398
3383
|
* @returns Object with formatted start_date and end_date strings
|
|
3399
3384
|
*/
|
|
3400
3385
|
function processDateRange(start_date, end_date) {
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3386
|
+
const output = {};
|
|
3387
|
+
if (start_date) output.start_date = start_date instanceof Date ? formatDate(start_date) : start_date;
|
|
3388
|
+
if (end_date) output.end_date = end_date instanceof Date ? formatDate(end_date) : end_date;
|
|
3389
|
+
return output;
|
|
3405
3390
|
}
|
|
3406
3391
|
|
|
3407
3392
|
//#endregion
|
|
@@ -3628,7 +3613,7 @@ var TeslemetryEnergyApi = class extends events.EventEmitter {
|
|
|
3628
3613
|
const { data } = await getApi1EnergySitesByIdTelemetryHistory({
|
|
3629
3614
|
query: {
|
|
3630
3615
|
kind: "charge",
|
|
3631
|
-
...processDateRange(start_date, end_date),
|
|
3616
|
+
...processDateRange(start_date ?? getStartOfToday(), end_date ?? getEndOfToday()),
|
|
3632
3617
|
time_zone
|
|
3633
3618
|
},
|
|
3634
3619
|
path: { id: this.siteId },
|
|
@@ -5235,7 +5220,7 @@ const consoleLogger = {
|
|
|
5235
5220
|
|
|
5236
5221
|
//#endregion
|
|
5237
5222
|
//#region package.json
|
|
5238
|
-
var version = "0.6.
|
|
5223
|
+
var version = "0.6.8";
|
|
5239
5224
|
|
|
5240
5225
|
//#endregion
|
|
5241
5226
|
//#region src/Teslemetry.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -2,6 +2,17 @@ import { EventEmitter } from "events";
|
|
|
2
2
|
|
|
3
3
|
//#region src/client/types.gen.d.ts
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* errorResponse
|
|
7
|
+
*
|
|
8
|
+
* Error response
|
|
9
|
+
*/
|
|
10
|
+
type Def0 = {
|
|
11
|
+
response?: null;
|
|
12
|
+
error: string;
|
|
13
|
+
error_description?: string;
|
|
14
|
+
[key: string]: unknown | null | string | undefined;
|
|
15
|
+
};
|
|
5
16
|
type GetApiMetadataResponses = {
|
|
6
17
|
/**
|
|
7
18
|
* Default Response
|
|
@@ -8003,8 +8014,7 @@ type GetApi1EnergySitesByIdTelemetryHistoryResponses = {
|
|
|
8003
8014
|
*/
|
|
8004
8015
|
200: {
|
|
8005
8016
|
response?: {
|
|
8006
|
-
|
|
8007
|
-
time_series?: Array<{
|
|
8017
|
+
charge_history?: Array<{
|
|
8008
8018
|
charge_start_time?: {
|
|
8009
8019
|
seconds?: number;
|
|
8010
8020
|
};
|
|
@@ -8012,6 +8022,10 @@ type GetApi1EnergySitesByIdTelemetryHistoryResponses = {
|
|
|
8012
8022
|
seconds?: number;
|
|
8013
8023
|
};
|
|
8014
8024
|
energy_added_wh?: number;
|
|
8025
|
+
target_id?: {
|
|
8026
|
+
text?: string;
|
|
8027
|
+
};
|
|
8028
|
+
din?: string;
|
|
8015
8029
|
}>;
|
|
8016
8030
|
};
|
|
8017
8031
|
};
|
|
@@ -9939,7 +9953,7 @@ type GetSseByVin_Response = GetSseByVin_Responses[keyof GetSseByVin_Responses];
|
|
|
9939
9953
|
/**
|
|
9940
9954
|
* Input type for date parameters - can be a string (used as-is), Date object, or undefined
|
|
9941
9955
|
*/
|
|
9942
|
-
type DateInput = string | Date
|
|
9956
|
+
type DateInput = string | Date;
|
|
9943
9957
|
//#endregion
|
|
9944
9958
|
//#region src/client/core/auth.gen.d.ts
|
|
9945
9959
|
type AuthToken = string | undefined;
|
|
@@ -10590,8 +10604,7 @@ declare class TeslemetryEnergyApi extends EventEmitter {
|
|
|
10590
10604
|
*/
|
|
10591
10605
|
getTelemetryHistory(start_date?: DateInput, end_date?: DateInput, time_zone?: string): Promise<{
|
|
10592
10606
|
response?: {
|
|
10593
|
-
|
|
10594
|
-
time_series?: Array<{
|
|
10607
|
+
charge_history?: Array<{
|
|
10595
10608
|
charge_start_time?: {
|
|
10596
10609
|
seconds?: number;
|
|
10597
10610
|
};
|
|
@@ -10599,6 +10612,10 @@ declare class TeslemetryEnergyApi extends EventEmitter {
|
|
|
10599
10612
|
seconds?: number;
|
|
10600
10613
|
};
|
|
10601
10614
|
energy_added_wh?: number;
|
|
10615
|
+
target_id?: {
|
|
10616
|
+
text?: string;
|
|
10617
|
+
};
|
|
10618
|
+
din?: string;
|
|
10602
10619
|
}>;
|
|
10603
10620
|
};
|
|
10604
10621
|
}>;
|
|
@@ -10756,7 +10773,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10756
10773
|
* Refresh the cached vehicle data immediately. Consumes 2 command credits.
|
|
10757
10774
|
* @return Promise to an object with response containing confirmation of refresh
|
|
10758
10775
|
*/
|
|
10759
|
-
refreshData(): Promise<
|
|
10776
|
+
refreshData(): Promise<Def0>;
|
|
10760
10777
|
/**
|
|
10761
10778
|
* Get the saved vehicle config.
|
|
10762
10779
|
* @return Promise to an object with response containing the vehicle configuration
|
|
@@ -10827,11 +10844,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10827
10844
|
BrakePedalPos?: {
|
|
10828
10845
|
interval_seconds: number;
|
|
10829
10846
|
resend_interval_seconds?: number;
|
|
10830
|
-
minimum_delta
|
|
10831
|
-
/**
|
|
10832
|
-
* Stops climate preconditioning.
|
|
10833
|
-
* @return Promise to an object with response containing auto conditioning stop result
|
|
10834
|
-
*/?: number;
|
|
10847
|
+
minimum_delta?: number;
|
|
10835
10848
|
};
|
|
10836
10849
|
BrickVoltageMax?: {
|
|
10837
10850
|
interval_seconds: number;
|
|
@@ -10876,12 +10889,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10876
10889
|
};
|
|
10877
10890
|
ChargeEnableRequest?: {
|
|
10878
10891
|
interval_seconds: number;
|
|
10879
|
-
resend_interval_seconds
|
|
10880
|
-
/**
|
|
10881
|
-
* Skips to the next track in media playback.
|
|
10882
|
-
* @return Promise to an object with response containing media next track result
|
|
10883
|
-
*/
|
|
10884
|
-
: number;
|
|
10892
|
+
resend_interval_seconds?: number;
|
|
10885
10893
|
};
|
|
10886
10894
|
ChargeLimitSoc?: {
|
|
10887
10895
|
interval_seconds: number;
|
|
@@ -10890,7 +10898,18 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10890
10898
|
};
|
|
10891
10899
|
ChargePort?: {
|
|
10892
10900
|
interval_seconds: number;
|
|
10893
|
-
resend_interval_seconds
|
|
10901
|
+
resend_interval_seconds
|
|
10902
|
+
/**
|
|
10903
|
+
* Enable/disable guest mode.
|
|
10904
|
+
* @param enable Whether to enable guest mode
|
|
10905
|
+
* @return Promise to an object with response containing guest mode set result
|
|
10906
|
+
*/?
|
|
10907
|
+
/**
|
|
10908
|
+
* Enable/disable guest mode.
|
|
10909
|
+
* @param enable Whether to enable guest mode
|
|
10910
|
+
* @return Promise to an object with response containing guest mode set result
|
|
10911
|
+
*/
|
|
10912
|
+
: number;
|
|
10894
10913
|
};
|
|
10895
10914
|
ChargePortColdWeatherMode?: {
|
|
10896
10915
|
interval_seconds: number;
|
|
@@ -10931,7 +10950,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10931
10950
|
interval_seconds: number;
|
|
10932
10951
|
resend_interval_seconds?: number;
|
|
10933
10952
|
};
|
|
10934
|
-
ClimateSeatCoolingFrontLeft
|
|
10953
|
+
ClimateSeatCoolingFrontLeft
|
|
10954
|
+
/**
|
|
10955
|
+
* Starts the vehicle remotely.
|
|
10956
|
+
* @return Promise to an object with response containing remote start result
|
|
10957
|
+
*/?: {
|
|
10935
10958
|
interval_seconds: number;
|
|
10936
10959
|
resend_interval_seconds?: number;
|
|
10937
10960
|
minimum_delta?: number;
|
|
@@ -10941,21 +10964,9 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10941
10964
|
resend_interval_seconds?: number;
|
|
10942
10965
|
minimum_delta?: number;
|
|
10943
10966
|
};
|
|
10944
|
-
CruiseFollowDistance
|
|
10945
|
-
/**
|
|
10946
|
-
* Sets the target temperature for the driver and passenger.
|
|
10947
|
-
* @param driver_temp Driver temperature in Celsius
|
|
10948
|
-
* @param passenger_temp Passenger temperature in Celsius
|
|
10949
|
-
* @return Promise to an object with response containing temperature set result
|
|
10950
|
-
*/?: {
|
|
10967
|
+
CruiseFollowDistance?: {
|
|
10951
10968
|
interval_seconds: number;
|
|
10952
|
-
resend_interval_seconds
|
|
10953
|
-
/**
|
|
10954
|
-
* Sets the target temperature for the driver and passenger.
|
|
10955
|
-
* @param driver_temp Driver temperature in Celsius
|
|
10956
|
-
* @param passenger_temp Passenger temperature in Celsius
|
|
10957
|
-
* @return Promise to an object with response containing temperature set result
|
|
10958
|
-
*/?: number;
|
|
10969
|
+
resend_interval_seconds?: number;
|
|
10959
10970
|
};
|
|
10960
10971
|
CruiseSetSpeed?: {
|
|
10961
10972
|
interval_seconds: number;
|
|
@@ -11054,16 +11065,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11054
11065
|
DiInverterTREL?: {
|
|
11055
11066
|
interval_seconds: number;
|
|
11056
11067
|
resend_interval_seconds?: number;
|
|
11057
|
-
minimum_delta
|
|
11058
|
-
/**
|
|
11059
|
-
* Opens the charge port door.
|
|
11060
|
-
* @return Promise to an object with response containing charge port open result
|
|
11061
|
-
*/?
|
|
11062
|
-
/**
|
|
11063
|
-
* Opens the charge port door.
|
|
11064
|
-
* @return Promise to an object with response containing charge port open result
|
|
11065
|
-
*/
|
|
11066
|
-
: number;
|
|
11068
|
+
minimum_delta?: number;
|
|
11067
11069
|
};
|
|
11068
11070
|
DiInverterTRER?: {
|
|
11069
11071
|
interval_seconds: number;
|
|
@@ -11325,26 +11327,12 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11325
11327
|
};
|
|
11326
11328
|
IdealBatteryRange?: {
|
|
11327
11329
|
interval_seconds: number;
|
|
11328
|
-
resend_interval_seconds
|
|
11329
|
-
/**
|
|
11330
|
-
* Revokes a share invitation.
|
|
11331
|
-
* @param id The invitation ID to revoke
|
|
11332
|
-
* @return Promise to an object with response containing invitation revocation result
|
|
11333
|
-
*/
|
|
11334
|
-
: number;
|
|
11330
|
+
resend_interval_seconds?: number;
|
|
11335
11331
|
minimum_delta?: number;
|
|
11336
11332
|
};
|
|
11337
|
-
InsideTemp
|
|
11338
|
-
/**
|
|
11339
|
-
* Sends a ping command to the vehicle.
|
|
11340
|
-
* @return Promise to an object with response containing ping result
|
|
11341
|
-
*/?: {
|
|
11333
|
+
InsideTemp?: {
|
|
11342
11334
|
interval_seconds: number;
|
|
11343
|
-
resend_interval_seconds
|
|
11344
|
-
/**
|
|
11345
|
-
* Sends a ping command to the vehicle.
|
|
11346
|
-
* @return Promise to an object with response containing ping result
|
|
11347
|
-
*/?: number;
|
|
11335
|
+
resend_interval_seconds?: number;
|
|
11348
11336
|
minimum_delta?: number;
|
|
11349
11337
|
};
|
|
11350
11338
|
IsolationResistance?: {
|
|
@@ -12033,7 +12021,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
12033
12021
|
* Returns the charge history for the vehicle.
|
|
12034
12022
|
* @return Promise to an object with response containing charge history
|
|
12035
12023
|
*/
|
|
12036
|
-
chargeHistory(): Promise<
|
|
12024
|
+
chargeHistory(): Promise<Def0>;
|
|
12037
12025
|
/**
|
|
12038
12026
|
* Wakes the vehicle from sleep. This command costs 20 command credits
|
|
12039
12027
|
* @return Promise to an object with response containing wake up confirmation
|
|
@@ -14345,13 +14333,13 @@ declare class TeslemetryChargingApi extends EventEmitter {
|
|
|
14345
14333
|
* @param query.vin Vehicle Identification Number (VIN) of the selected vehicle
|
|
14346
14334
|
* @return Promise to an object with response containing paginated charging history records
|
|
14347
14335
|
*/
|
|
14348
|
-
getChargingHistory(query: GetApi1DxChargingHistoryData["query"]): Promise<
|
|
14336
|
+
getChargingHistory(query: GetApi1DxChargingHistoryData["query"]): Promise<Def0>;
|
|
14349
14337
|
/**
|
|
14350
14338
|
* Returns a charging invoice pdf for an event from charging history.
|
|
14351
14339
|
* @param id The charging session ID
|
|
14352
14340
|
* @return Promise to an object with response containing charging invoice PDF URL
|
|
14353
14341
|
*/
|
|
14354
|
-
getInvoice(id: string): Promise<
|
|
14342
|
+
getInvoice(id: string): Promise<Def0>;
|
|
14355
14343
|
/**
|
|
14356
14344
|
* Returns the charging session information including pricing and energy data. This endpoint is only available for business accounts that own a fleet of vehicles.
|
|
14357
14345
|
* @param query Query parameters for filtering charging sessions
|
|
@@ -14362,7 +14350,7 @@ declare class TeslemetryChargingApi extends EventEmitter {
|
|
|
14362
14350
|
* @param query.vin Vehicle Identification Number (VIN) of the selected vehicle
|
|
14363
14351
|
* @return Promise to an object with response containing charging session information with pricing and energy data
|
|
14364
14352
|
*/
|
|
14365
|
-
getChargingSessions(query?: GetApi1DxChargingSessionsData["query"]): Promise<
|
|
14353
|
+
getChargingSessions(query?: GetApi1DxChargingSessionsData["query"]): Promise<Def0>;
|
|
14366
14354
|
}
|
|
14367
14355
|
//#endregion
|
|
14368
14356
|
//#region src/TeslemetryUserApi.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,17 @@ import { EventEmitter } from "events";
|
|
|
2
2
|
|
|
3
3
|
//#region src/client/types.gen.d.ts
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* errorResponse
|
|
7
|
+
*
|
|
8
|
+
* Error response
|
|
9
|
+
*/
|
|
10
|
+
type Def0 = {
|
|
11
|
+
response?: null;
|
|
12
|
+
error: string;
|
|
13
|
+
error_description?: string;
|
|
14
|
+
[key: string]: unknown | null | string | undefined;
|
|
15
|
+
};
|
|
5
16
|
type GetApiMetadataResponses = {
|
|
6
17
|
/**
|
|
7
18
|
* Default Response
|
|
@@ -8003,8 +8014,7 @@ type GetApi1EnergySitesByIdTelemetryHistoryResponses = {
|
|
|
8003
8014
|
*/
|
|
8004
8015
|
200: {
|
|
8005
8016
|
response?: {
|
|
8006
|
-
|
|
8007
|
-
time_series?: Array<{
|
|
8017
|
+
charge_history?: Array<{
|
|
8008
8018
|
charge_start_time?: {
|
|
8009
8019
|
seconds?: number;
|
|
8010
8020
|
};
|
|
@@ -8012,6 +8022,10 @@ type GetApi1EnergySitesByIdTelemetryHistoryResponses = {
|
|
|
8012
8022
|
seconds?: number;
|
|
8013
8023
|
};
|
|
8014
8024
|
energy_added_wh?: number;
|
|
8025
|
+
target_id?: {
|
|
8026
|
+
text?: string;
|
|
8027
|
+
};
|
|
8028
|
+
din?: string;
|
|
8015
8029
|
}>;
|
|
8016
8030
|
};
|
|
8017
8031
|
};
|
|
@@ -9939,7 +9953,7 @@ type GetSseByVin_Response = GetSseByVin_Responses[keyof GetSseByVin_Responses];
|
|
|
9939
9953
|
/**
|
|
9940
9954
|
* Input type for date parameters - can be a string (used as-is), Date object, or undefined
|
|
9941
9955
|
*/
|
|
9942
|
-
type DateInput = string | Date
|
|
9956
|
+
type DateInput = string | Date;
|
|
9943
9957
|
//#endregion
|
|
9944
9958
|
//#region src/client/core/auth.gen.d.ts
|
|
9945
9959
|
type AuthToken = string | undefined;
|
|
@@ -10590,8 +10604,7 @@ declare class TeslemetryEnergyApi extends EventEmitter {
|
|
|
10590
10604
|
*/
|
|
10591
10605
|
getTelemetryHistory(start_date?: DateInput, end_date?: DateInput, time_zone?: string): Promise<{
|
|
10592
10606
|
response?: {
|
|
10593
|
-
|
|
10594
|
-
time_series?: Array<{
|
|
10607
|
+
charge_history?: Array<{
|
|
10595
10608
|
charge_start_time?: {
|
|
10596
10609
|
seconds?: number;
|
|
10597
10610
|
};
|
|
@@ -10599,6 +10612,10 @@ declare class TeslemetryEnergyApi extends EventEmitter {
|
|
|
10599
10612
|
seconds?: number;
|
|
10600
10613
|
};
|
|
10601
10614
|
energy_added_wh?: number;
|
|
10615
|
+
target_id?: {
|
|
10616
|
+
text?: string;
|
|
10617
|
+
};
|
|
10618
|
+
din?: string;
|
|
10602
10619
|
}>;
|
|
10603
10620
|
};
|
|
10604
10621
|
}>;
|
|
@@ -10756,7 +10773,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10756
10773
|
* Refresh the cached vehicle data immediately. Consumes 2 command credits.
|
|
10757
10774
|
* @return Promise to an object with response containing confirmation of refresh
|
|
10758
10775
|
*/
|
|
10759
|
-
refreshData(): Promise<
|
|
10776
|
+
refreshData(): Promise<Def0>;
|
|
10760
10777
|
/**
|
|
10761
10778
|
* Get the saved vehicle config.
|
|
10762
10779
|
* @return Promise to an object with response containing the vehicle configuration
|
|
@@ -10827,11 +10844,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10827
10844
|
BrakePedalPos?: {
|
|
10828
10845
|
interval_seconds: number;
|
|
10829
10846
|
resend_interval_seconds?: number;
|
|
10830
|
-
minimum_delta
|
|
10831
|
-
/**
|
|
10832
|
-
* Stops climate preconditioning.
|
|
10833
|
-
* @return Promise to an object with response containing auto conditioning stop result
|
|
10834
|
-
*/?: number;
|
|
10847
|
+
minimum_delta?: number;
|
|
10835
10848
|
};
|
|
10836
10849
|
BrickVoltageMax?: {
|
|
10837
10850
|
interval_seconds: number;
|
|
@@ -10876,12 +10889,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10876
10889
|
};
|
|
10877
10890
|
ChargeEnableRequest?: {
|
|
10878
10891
|
interval_seconds: number;
|
|
10879
|
-
resend_interval_seconds
|
|
10880
|
-
/**
|
|
10881
|
-
* Skips to the next track in media playback.
|
|
10882
|
-
* @return Promise to an object with response containing media next track result
|
|
10883
|
-
*/
|
|
10884
|
-
: number;
|
|
10892
|
+
resend_interval_seconds?: number;
|
|
10885
10893
|
};
|
|
10886
10894
|
ChargeLimitSoc?: {
|
|
10887
10895
|
interval_seconds: number;
|
|
@@ -10890,7 +10898,18 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10890
10898
|
};
|
|
10891
10899
|
ChargePort?: {
|
|
10892
10900
|
interval_seconds: number;
|
|
10893
|
-
resend_interval_seconds
|
|
10901
|
+
resend_interval_seconds
|
|
10902
|
+
/**
|
|
10903
|
+
* Enable/disable guest mode.
|
|
10904
|
+
* @param enable Whether to enable guest mode
|
|
10905
|
+
* @return Promise to an object with response containing guest mode set result
|
|
10906
|
+
*/?
|
|
10907
|
+
/**
|
|
10908
|
+
* Enable/disable guest mode.
|
|
10909
|
+
* @param enable Whether to enable guest mode
|
|
10910
|
+
* @return Promise to an object with response containing guest mode set result
|
|
10911
|
+
*/
|
|
10912
|
+
: number;
|
|
10894
10913
|
};
|
|
10895
10914
|
ChargePortColdWeatherMode?: {
|
|
10896
10915
|
interval_seconds: number;
|
|
@@ -10931,7 +10950,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10931
10950
|
interval_seconds: number;
|
|
10932
10951
|
resend_interval_seconds?: number;
|
|
10933
10952
|
};
|
|
10934
|
-
ClimateSeatCoolingFrontLeft
|
|
10953
|
+
ClimateSeatCoolingFrontLeft
|
|
10954
|
+
/**
|
|
10955
|
+
* Starts the vehicle remotely.
|
|
10956
|
+
* @return Promise to an object with response containing remote start result
|
|
10957
|
+
*/?: {
|
|
10935
10958
|
interval_seconds: number;
|
|
10936
10959
|
resend_interval_seconds?: number;
|
|
10937
10960
|
minimum_delta?: number;
|
|
@@ -10941,21 +10964,9 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10941
10964
|
resend_interval_seconds?: number;
|
|
10942
10965
|
minimum_delta?: number;
|
|
10943
10966
|
};
|
|
10944
|
-
CruiseFollowDistance
|
|
10945
|
-
/**
|
|
10946
|
-
* Sets the target temperature for the driver and passenger.
|
|
10947
|
-
* @param driver_temp Driver temperature in Celsius
|
|
10948
|
-
* @param passenger_temp Passenger temperature in Celsius
|
|
10949
|
-
* @return Promise to an object with response containing temperature set result
|
|
10950
|
-
*/?: {
|
|
10967
|
+
CruiseFollowDistance?: {
|
|
10951
10968
|
interval_seconds: number;
|
|
10952
|
-
resend_interval_seconds
|
|
10953
|
-
/**
|
|
10954
|
-
* Sets the target temperature for the driver and passenger.
|
|
10955
|
-
* @param driver_temp Driver temperature in Celsius
|
|
10956
|
-
* @param passenger_temp Passenger temperature in Celsius
|
|
10957
|
-
* @return Promise to an object with response containing temperature set result
|
|
10958
|
-
*/?: number;
|
|
10969
|
+
resend_interval_seconds?: number;
|
|
10959
10970
|
};
|
|
10960
10971
|
CruiseSetSpeed?: {
|
|
10961
10972
|
interval_seconds: number;
|
|
@@ -11054,16 +11065,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11054
11065
|
DiInverterTREL?: {
|
|
11055
11066
|
interval_seconds: number;
|
|
11056
11067
|
resend_interval_seconds?: number;
|
|
11057
|
-
minimum_delta
|
|
11058
|
-
/**
|
|
11059
|
-
* Opens the charge port door.
|
|
11060
|
-
* @return Promise to an object with response containing charge port open result
|
|
11061
|
-
*/?
|
|
11062
|
-
/**
|
|
11063
|
-
* Opens the charge port door.
|
|
11064
|
-
* @return Promise to an object with response containing charge port open result
|
|
11065
|
-
*/
|
|
11066
|
-
: number;
|
|
11068
|
+
minimum_delta?: number;
|
|
11067
11069
|
};
|
|
11068
11070
|
DiInverterTRER?: {
|
|
11069
11071
|
interval_seconds: number;
|
|
@@ -11325,26 +11327,12 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11325
11327
|
};
|
|
11326
11328
|
IdealBatteryRange?: {
|
|
11327
11329
|
interval_seconds: number;
|
|
11328
|
-
resend_interval_seconds
|
|
11329
|
-
/**
|
|
11330
|
-
* Revokes a share invitation.
|
|
11331
|
-
* @param id The invitation ID to revoke
|
|
11332
|
-
* @return Promise to an object with response containing invitation revocation result
|
|
11333
|
-
*/
|
|
11334
|
-
: number;
|
|
11330
|
+
resend_interval_seconds?: number;
|
|
11335
11331
|
minimum_delta?: number;
|
|
11336
11332
|
};
|
|
11337
|
-
InsideTemp
|
|
11338
|
-
/**
|
|
11339
|
-
* Sends a ping command to the vehicle.
|
|
11340
|
-
* @return Promise to an object with response containing ping result
|
|
11341
|
-
*/?: {
|
|
11333
|
+
InsideTemp?: {
|
|
11342
11334
|
interval_seconds: number;
|
|
11343
|
-
resend_interval_seconds
|
|
11344
|
-
/**
|
|
11345
|
-
* Sends a ping command to the vehicle.
|
|
11346
|
-
* @return Promise to an object with response containing ping result
|
|
11347
|
-
*/?: number;
|
|
11335
|
+
resend_interval_seconds?: number;
|
|
11348
11336
|
minimum_delta?: number;
|
|
11349
11337
|
};
|
|
11350
11338
|
IsolationResistance?: {
|
|
@@ -12033,7 +12021,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
12033
12021
|
* Returns the charge history for the vehicle.
|
|
12034
12022
|
* @return Promise to an object with response containing charge history
|
|
12035
12023
|
*/
|
|
12036
|
-
chargeHistory(): Promise<
|
|
12024
|
+
chargeHistory(): Promise<Def0>;
|
|
12037
12025
|
/**
|
|
12038
12026
|
* Wakes the vehicle from sleep. This command costs 20 command credits
|
|
12039
12027
|
* @return Promise to an object with response containing wake up confirmation
|
|
@@ -14345,13 +14333,13 @@ declare class TeslemetryChargingApi extends EventEmitter {
|
|
|
14345
14333
|
* @param query.vin Vehicle Identification Number (VIN) of the selected vehicle
|
|
14346
14334
|
* @return Promise to an object with response containing paginated charging history records
|
|
14347
14335
|
*/
|
|
14348
|
-
getChargingHistory(query: GetApi1DxChargingHistoryData["query"]): Promise<
|
|
14336
|
+
getChargingHistory(query: GetApi1DxChargingHistoryData["query"]): Promise<Def0>;
|
|
14349
14337
|
/**
|
|
14350
14338
|
* Returns a charging invoice pdf for an event from charging history.
|
|
14351
14339
|
* @param id The charging session ID
|
|
14352
14340
|
* @return Promise to an object with response containing charging invoice PDF URL
|
|
14353
14341
|
*/
|
|
14354
|
-
getInvoice(id: string): Promise<
|
|
14342
|
+
getInvoice(id: string): Promise<Def0>;
|
|
14355
14343
|
/**
|
|
14356
14344
|
* Returns the charging session information including pricing and energy data. This endpoint is only available for business accounts that own a fleet of vehicles.
|
|
14357
14345
|
* @param query Query parameters for filtering charging sessions
|
|
@@ -14362,7 +14350,7 @@ declare class TeslemetryChargingApi extends EventEmitter {
|
|
|
14362
14350
|
* @param query.vin Vehicle Identification Number (VIN) of the selected vehicle
|
|
14363
14351
|
* @return Promise to an object with response containing charging session information with pricing and energy data
|
|
14364
14352
|
*/
|
|
14365
|
-
getChargingSessions(query?: GetApi1DxChargingSessionsData["query"]): Promise<
|
|
14353
|
+
getChargingSessions(query?: GetApi1DxChargingSessionsData["query"]): Promise<Def0>;
|
|
14366
14354
|
}
|
|
14367
14355
|
//#endregion
|
|
14368
14356
|
//#region src/TeslemetryUserApi.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -3043,7 +3043,7 @@ var TeslemetryVehicleStream = class extends EventEmitter {
|
|
|
3043
3043
|
this._pendingFields = {};
|
|
3044
3044
|
} else this.logger.error(`Error updating streaming config for ${this.vin}`, data);
|
|
3045
3045
|
this._debounceTimeout = null;
|
|
3046
|
-
},
|
|
3046
|
+
}, 1e3);
|
|
3047
3047
|
}
|
|
3048
3048
|
/** Modify the field configuration of the vehicle */
|
|
3049
3049
|
async patchConfig(fields) {
|
|
@@ -3372,22 +3372,7 @@ function getStartOfToday() {
|
|
|
3372
3372
|
*/
|
|
3373
3373
|
function getEndOfToday() {
|
|
3374
3374
|
const now = /* @__PURE__ */ new Date();
|
|
3375
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(),
|
|
3376
|
-
}
|
|
3377
|
-
/**
|
|
3378
|
-
* Normalizes a date input to an ISO string format suitable for API calls.
|
|
3379
|
-
* - If input is a string, it is returned as-is
|
|
3380
|
-
* - If input is a Date, it is converted to ISO string without milliseconds
|
|
3381
|
-
* - If input is undefined, the default date is used and converted
|
|
3382
|
-
*
|
|
3383
|
-
* @param input The date input (string, Date, or undefined)
|
|
3384
|
-
* @param defaultDate The default Date to use if input is undefined
|
|
3385
|
-
* @returns Formatted date string
|
|
3386
|
-
*/
|
|
3387
|
-
function normalizeDateInput(input, defaultDate) {
|
|
3388
|
-
if (typeof input === "string") return input;
|
|
3389
|
-
if (input instanceof Date) return formatDate(input);
|
|
3390
|
-
return formatDate(defaultDate);
|
|
3375
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0, 0);
|
|
3391
3376
|
}
|
|
3392
3377
|
/**
|
|
3393
3378
|
* Processes start_date and end_date inputs for API calls.
|
|
@@ -3398,10 +3383,10 @@ function normalizeDateInput(input, defaultDate) {
|
|
|
3398
3383
|
* @returns Object with formatted start_date and end_date strings
|
|
3399
3384
|
*/
|
|
3400
3385
|
function processDateRange(start_date, end_date) {
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3386
|
+
const output = {};
|
|
3387
|
+
if (start_date) output.start_date = start_date instanceof Date ? formatDate(start_date) : start_date;
|
|
3388
|
+
if (end_date) output.end_date = end_date instanceof Date ? formatDate(end_date) : end_date;
|
|
3389
|
+
return output;
|
|
3405
3390
|
}
|
|
3406
3391
|
|
|
3407
3392
|
//#endregion
|
|
@@ -3628,7 +3613,7 @@ var TeslemetryEnergyApi = class extends EventEmitter {
|
|
|
3628
3613
|
const { data } = await getApi1EnergySitesByIdTelemetryHistory({
|
|
3629
3614
|
query: {
|
|
3630
3615
|
kind: "charge",
|
|
3631
|
-
...processDateRange(start_date, end_date),
|
|
3616
|
+
...processDateRange(start_date ?? getStartOfToday(), end_date ?? getEndOfToday()),
|
|
3632
3617
|
time_zone
|
|
3633
3618
|
},
|
|
3634
3619
|
path: { id: this.siteId },
|
|
@@ -5235,7 +5220,7 @@ const consoleLogger = {
|
|
|
5235
5220
|
|
|
5236
5221
|
//#endregion
|
|
5237
5222
|
//#region package.json
|
|
5238
|
-
var version = "0.6.
|
|
5223
|
+
var version = "0.6.8";
|
|
5239
5224
|
|
|
5240
5225
|
//#endregion
|
|
5241
5226
|
//#region src/Teslemetry.ts
|