@teslemetry/api 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -36
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +5 -36
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3359,37 +3359,6 @@ function formatDate(date) {
|
|
|
3359
3359
|
return date.toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
3360
3360
|
}
|
|
3361
3361
|
/**
|
|
3362
|
-
* Gets the start of today (midnight) in local timezone
|
|
3363
|
-
* @returns Date object set to today at 00:00:00.000
|
|
3364
|
-
*/
|
|
3365
|
-
function getStartOfToday() {
|
|
3366
|
-
const now = /* @__PURE__ */ new Date();
|
|
3367
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
|
|
3368
|
-
}
|
|
3369
|
-
/**
|
|
3370
|
-
* Gets the end of today (23:59:59.999) in local timezone
|
|
3371
|
-
* @returns Date object set to today at 23:59:59.999
|
|
3372
|
-
*/
|
|
3373
|
-
function getEndOfToday() {
|
|
3374
|
-
const now = /* @__PURE__ */ new Date();
|
|
3375
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
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);
|
|
3391
|
-
}
|
|
3392
|
-
/**
|
|
3393
3362
|
* Processes start_date and end_date inputs for API calls.
|
|
3394
3363
|
* Handles string (taken as-is), Date (formatted), or undefined (defaults to today).
|
|
3395
3364
|
*
|
|
@@ -3398,10 +3367,10 @@ function normalizeDateInput(input, defaultDate) {
|
|
|
3398
3367
|
* @returns Object with formatted start_date and end_date strings
|
|
3399
3368
|
*/
|
|
3400
3369
|
function processDateRange(start_date, end_date) {
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3370
|
+
const output = {};
|
|
3371
|
+
if (start_date) output.start_date = start_date instanceof Date ? formatDate(start_date) : start_date;
|
|
3372
|
+
if (end_date) output.end_date = end_date instanceof Date ? formatDate(end_date) : end_date;
|
|
3373
|
+
return output;
|
|
3405
3374
|
}
|
|
3406
3375
|
|
|
3407
3376
|
//#endregion
|
|
@@ -5235,7 +5204,7 @@ const consoleLogger = {
|
|
|
5235
5204
|
|
|
5236
5205
|
//#endregion
|
|
5237
5206
|
//#region package.json
|
|
5238
|
-
var version = "0.6.
|
|
5207
|
+
var version = "0.6.7";
|
|
5239
5208
|
|
|
5240
5209
|
//#endregion
|
|
5241
5210
|
//#region src/Teslemetry.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -9939,7 +9939,7 @@ type GetSseByVin_Response = GetSseByVin_Responses[keyof GetSseByVin_Responses];
|
|
|
9939
9939
|
/**
|
|
9940
9940
|
* Input type for date parameters - can be a string (used as-is), Date object, or undefined
|
|
9941
9941
|
*/
|
|
9942
|
-
type DateInput = string | Date
|
|
9942
|
+
type DateInput = string | Date;
|
|
9943
9943
|
//#endregion
|
|
9944
9944
|
//#region src/client/core/auth.gen.d.ts
|
|
9945
9945
|
type AuthToken = string | undefined;
|
package/dist/index.d.mts
CHANGED
|
@@ -9939,7 +9939,7 @@ type GetSseByVin_Response = GetSseByVin_Responses[keyof GetSseByVin_Responses];
|
|
|
9939
9939
|
/**
|
|
9940
9940
|
* Input type for date parameters - can be a string (used as-is), Date object, or undefined
|
|
9941
9941
|
*/
|
|
9942
|
-
type DateInput = string | Date
|
|
9942
|
+
type DateInput = string | Date;
|
|
9943
9943
|
//#endregion
|
|
9944
9944
|
//#region src/client/core/auth.gen.d.ts
|
|
9945
9945
|
type AuthToken = string | undefined;
|
package/dist/index.mjs
CHANGED
|
@@ -3359,37 +3359,6 @@ function formatDate(date) {
|
|
|
3359
3359
|
return date.toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
3360
3360
|
}
|
|
3361
3361
|
/**
|
|
3362
|
-
* Gets the start of today (midnight) in local timezone
|
|
3363
|
-
* @returns Date object set to today at 00:00:00.000
|
|
3364
|
-
*/
|
|
3365
|
-
function getStartOfToday() {
|
|
3366
|
-
const now = /* @__PURE__ */ new Date();
|
|
3367
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
|
|
3368
|
-
}
|
|
3369
|
-
/**
|
|
3370
|
-
* Gets the end of today (23:59:59.999) in local timezone
|
|
3371
|
-
* @returns Date object set to today at 23:59:59.999
|
|
3372
|
-
*/
|
|
3373
|
-
function getEndOfToday() {
|
|
3374
|
-
const now = /* @__PURE__ */ new Date();
|
|
3375
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
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);
|
|
3391
|
-
}
|
|
3392
|
-
/**
|
|
3393
3362
|
* Processes start_date and end_date inputs for API calls.
|
|
3394
3363
|
* Handles string (taken as-is), Date (formatted), or undefined (defaults to today).
|
|
3395
3364
|
*
|
|
@@ -3398,10 +3367,10 @@ function normalizeDateInput(input, defaultDate) {
|
|
|
3398
3367
|
* @returns Object with formatted start_date and end_date strings
|
|
3399
3368
|
*/
|
|
3400
3369
|
function processDateRange(start_date, end_date) {
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3370
|
+
const output = {};
|
|
3371
|
+
if (start_date) output.start_date = start_date instanceof Date ? formatDate(start_date) : start_date;
|
|
3372
|
+
if (end_date) output.end_date = end_date instanceof Date ? formatDate(end_date) : end_date;
|
|
3373
|
+
return output;
|
|
3405
3374
|
}
|
|
3406
3375
|
|
|
3407
3376
|
//#endregion
|
|
@@ -5235,7 +5204,7 @@ const consoleLogger = {
|
|
|
5235
5204
|
|
|
5236
5205
|
//#endregion
|
|
5237
5206
|
//#region package.json
|
|
5238
|
-
var version = "0.6.
|
|
5207
|
+
var version = "0.6.7";
|
|
5239
5208
|
|
|
5240
5209
|
//#endregion
|
|
5241
5210
|
//#region src/Teslemetry.ts
|