@mxpicture/tesla-superchargers-api 0.1.34 → 0.1.35
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/api/FxRatesApi.d.ts +2 -5
- package/dist/api/FxRatesApi.d.ts.map +1 -1
- package/dist/api/FxRatesApi.js +86 -31
- package/dist/api/FxRatesApi.js.map +1 -1
- package/dist/common/fx.common.d.ts +1 -0
- package/dist/common/fx.common.d.ts.map +1 -1
- package/dist/common/fx.common.js +3 -4
- package/dist/common/fx.common.js.map +1 -1
- package/dist/types/fx.types.d.ts +0 -2
- package/dist/types/fx.types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/api/FxRatesApi.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { IApi } from "./IApi.js";
|
|
2
2
|
import type { FxSyncSummary } from "../types/fx.types.js";
|
|
3
|
+
import type { FxRateRow } from "@mxpicture/tesla-superchargers-mate/types";
|
|
3
4
|
export declare class FxRatesApi extends IApi {
|
|
4
|
-
|
|
5
|
-
* Fill the window's missing (date, currency) rates and prune everything
|
|
6
|
-
* outside it. A date the feed has not published yet is reported in
|
|
7
|
-
* `missingDates` and retried by the next run, never a failure.
|
|
8
|
-
*/
|
|
5
|
+
syncDate(rateDate: string): Promise<FxRateRow[]>;
|
|
9
6
|
sync(): Promise<FxSyncSummary>;
|
|
10
7
|
}
|
|
11
8
|
export declare const fxRatesApi: () => FxRatesApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FxRatesApi.d.ts","sourceRoot":"","sources":["../../src/api/FxRatesApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FxRatesApi.d.ts","sourceRoot":"","sources":["../../src/api/FxRatesApi.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAY3E,qBAAa,UAAW,SAAQ,IAAI;IAkErB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAchD,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC;CAuC5C;AAGD,eAAO,MAAM,UAAU,kBAAoC,CAAC"}
|
package/dist/api/FxRatesApi.js
CHANGED
|
@@ -5,60 +5,115 @@
|
|
|
5
5
|
* and none at all once the window is fully cached. `fxToEur` keeps its lazy
|
|
6
6
|
* per-charge fetch as the fallback for what the window does not cover.
|
|
7
7
|
*/
|
|
8
|
-
import { picFxRatesStore
|
|
8
|
+
import { picFxRatesStore } from "@mxpicture/tesla-superchargers-mate/store";
|
|
9
9
|
import { IApi } from "./IApi.js";
|
|
10
|
-
import {
|
|
10
|
+
import { FX_SYNC_DAYS, fetchEurRates, rateToEur, toRateDate, } from "../common/fx.common.js";
|
|
11
11
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
12
12
|
/** The last `days` UTC calendar days as `YYYY-MM-DD`, oldest first, today last. */
|
|
13
13
|
const utcDates = (days) => {
|
|
14
14
|
const today = Date.now();
|
|
15
|
-
return Array.from({ length: days }, (_, i) => new Date(today - (days - 1 - i) * DAY_MS)
|
|
15
|
+
return Array.from({ length: days }, (_, i) => toRateDate(new Date(today - (days - 1 - i) * DAY_MS)));
|
|
16
16
|
};
|
|
17
17
|
export class FxRatesApi extends IApi {
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
// /**
|
|
19
|
+
// * Fill the window's missing (date, currency) rates and prune everything
|
|
20
|
+
// * outside it. A date the feed has not published yet is reported in
|
|
21
|
+
// * `missingDates` and retried by the next run, never a failure.
|
|
22
|
+
// */
|
|
23
|
+
// public async sync(): Promise<FxSyncSummary> {
|
|
24
|
+
// const currencies = (
|
|
25
|
+
// await picPricebooksStore().getDistinctCurrencies()
|
|
26
|
+
// ).filter((c) => c !== BASE_CURRENCY);
|
|
27
|
+
// const dates = utcDates(FX_SYNC_DAYS);
|
|
28
|
+
// const fromDate = dates[0];
|
|
29
|
+
// const fetchedDates: string[] = [];
|
|
30
|
+
// const missingDates: string[] = [];
|
|
31
|
+
// const unknownCurrencies = new Set<string>();
|
|
32
|
+
// const rows: {
|
|
33
|
+
// rateDate: string;
|
|
34
|
+
// quoteCurrency: string;
|
|
35
|
+
// rateToEur: string;
|
|
36
|
+
// }[] = [];
|
|
37
|
+
// if (currencies.length) {
|
|
38
|
+
// const coverage = new Set(
|
|
39
|
+
// (await picFxRatesStore().getCoverage(fromDate)).map(
|
|
40
|
+
// (row) =>
|
|
41
|
+
// `${toRateDate(row.rate_date)} ${row.quote_currency.toUpperCase()}`,
|
|
42
|
+
// ),
|
|
43
|
+
// );
|
|
44
|
+
// for (const rateDate of dates) {
|
|
45
|
+
// const missing = currencies.filter(
|
|
46
|
+
// (c) => !coverage.has(`${rateDate} ${c}`),
|
|
47
|
+
// );
|
|
48
|
+
// if (!missing.length) continue;
|
|
49
|
+
// const rates = await fetchEurRates(rateDate);
|
|
50
|
+
// if (!rates) {
|
|
51
|
+
// missingDates.push(rateDate);
|
|
52
|
+
// continue;
|
|
53
|
+
// }
|
|
54
|
+
// fetchedDates.push(rateDate);
|
|
55
|
+
// for (const quoteCurrency of missing) {
|
|
56
|
+
// const rate = rateToEur(rates[quoteCurrency.toLowerCase()]);
|
|
57
|
+
// if (rate === null) {
|
|
58
|
+
// unknownCurrencies.add(quoteCurrency);
|
|
59
|
+
// continue;
|
|
60
|
+
// }
|
|
61
|
+
// rows.push({ rateDate, quoteCurrency, rateToEur: String(rate) });
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
64
|
+
// }
|
|
65
|
+
// return {
|
|
66
|
+
// days: FX_SYNC_DAYS,
|
|
67
|
+
// fromDate,
|
|
68
|
+
// currencies,
|
|
69
|
+
// fetchedDates,
|
|
70
|
+
// missingDates,
|
|
71
|
+
// unknownCurrencies: [...unknownCurrencies],
|
|
72
|
+
// inserted: await picFxRatesStore().putRates(rows),
|
|
73
|
+
// deleted: await picFxRatesStore().deleteStale(fromDate, currencies),
|
|
74
|
+
// };
|
|
75
|
+
// }
|
|
76
|
+
async syncDate(rateDate) {
|
|
77
|
+
const rows = [];
|
|
78
|
+
const rates = await fetchEurRates(rateDate);
|
|
79
|
+
if (!rates)
|
|
80
|
+
return rows;
|
|
81
|
+
for (const [quoteCurrency, quotePerEur] of Object.entries(rates)) {
|
|
82
|
+
const rate = rateToEur(quotePerEur);
|
|
83
|
+
if (rate !== null)
|
|
84
|
+
rows.push({ rateDate, quoteCurrency, rateToEur: String(rate) });
|
|
85
|
+
}
|
|
86
|
+
return rows;
|
|
87
|
+
}
|
|
23
88
|
async sync() {
|
|
24
|
-
|
|
89
|
+
// todo implment + read pricing link --> persist link
|
|
25
90
|
const dates = utcDates(FX_SYNC_DAYS);
|
|
26
91
|
const fromDate = dates[0];
|
|
27
92
|
const fetchedDates = [];
|
|
28
93
|
const missingDates = [];
|
|
29
94
|
const unknownCurrencies = new Set();
|
|
30
95
|
const rows = [];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
missingDates.push(rateDate);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
fetchedDates.push(rateDate);
|
|
43
|
-
for (const quoteCurrency of missing) {
|
|
44
|
-
const rate = rateToEur(rates[quoteCurrency.toLowerCase()]);
|
|
45
|
-
if (rate === null) {
|
|
46
|
-
unknownCurrencies.add(quoteCurrency);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
rows.push({ rateDate, quoteCurrency, rateToEur: String(rate) });
|
|
50
|
-
}
|
|
96
|
+
const coverage = new Set((await picFxRatesStore().getCoverageDates(fromDate)).map(toRateDate));
|
|
97
|
+
for (const rateDate of dates) {
|
|
98
|
+
if (coverage.has(rateDate))
|
|
99
|
+
continue;
|
|
100
|
+
const dateRows = await this.syncDate(rateDate);
|
|
101
|
+
if (!dateRows.length) {
|
|
102
|
+
missingDates.push(rateDate);
|
|
103
|
+
continue;
|
|
51
104
|
}
|
|
105
|
+
// todo check for unknownCurrencies --> not working before pricing link
|
|
106
|
+
fetchedDates.push(rateDate);
|
|
107
|
+
rows.push(...dateRows);
|
|
52
108
|
}
|
|
53
109
|
return {
|
|
54
110
|
days: FX_SYNC_DAYS,
|
|
55
111
|
fromDate,
|
|
56
|
-
currencies,
|
|
57
112
|
fetchedDates,
|
|
58
113
|
missingDates,
|
|
59
114
|
unknownCurrencies: [...unknownCurrencies],
|
|
60
115
|
inserted: await picFxRatesStore().putRates(rows),
|
|
61
|
-
deleted: await picFxRatesStore().deleteStale(fromDate,
|
|
116
|
+
deleted: await picFxRatesStore().deleteStale(fromDate, []),
|
|
62
117
|
};
|
|
63
118
|
}
|
|
64
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FxRatesApi.js","sourceRoot":"","sources":["../../src/api/FxRatesApi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"FxRatesApi.js","sourceRoot":"","sources":["../../src/api/FxRatesApi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,GACX,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,mFAAmF;AACnF,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAY,EAAE;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC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,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QACzB,CAAC;QAED,OAAO;YACL,IAAI,EAAE,YAAY;YAClB,QAAQ;YACR,YAAY;YACZ,YAAY;YACZ,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,CAAC;YACzC,QAAQ,EAAE,MAAM,eAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;YAChD,OAAO,EAAE,MAAM,eAAe,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,IAAI,IAAI,GAAsB,IAAI,CAAC;AACnC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,UAAU,EAAE,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const BASE_CURRENCY = "EUR";
|
|
3
3
|
/** How many UTC days back the daily sync covers, today included. */
|
|
4
4
|
export declare const FX_SYNC_DAYS = 7;
|
|
5
|
+
export declare const toRateDate: (d: Date) => string;
|
|
5
6
|
/**
|
|
6
7
|
* All quote-per-EUR rates for a date, primary host then mirror; null when the
|
|
7
8
|
* date is not published yet or both hosts fail. One request serves every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx.common.d.ts","sourceRoot":"","sources":["../../src/common/fx.common.ts"],"names":[],"mappings":"AAYA,+DAA+D;AAC/D,eAAO,MAAM,aAAa,QAAQ,CAAC;AAEnC,oEAAoE;AACpE,eAAO,MAAM,YAAY,IAAI,CAAC;AAgB9B;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,KACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAevC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,SAAS,GAAI,aAAa,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"fx.common.d.ts","sourceRoot":"","sources":["../../src/common/fx.common.ts"],"names":[],"mappings":"AAYA,+DAA+D;AAC/D,eAAO,MAAM,aAAa,QAAQ,CAAC;AAEnC,oEAAoE;AACpE,eAAO,MAAM,YAAY,IAAI,CAAC;AAgB9B,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,WAAiC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,KACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAevC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,SAAS,GAAI,aAAa,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,IAG3D,CAAC;AAKX;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,cAAc,MAAM,EACpB,IAAI,IAAI,KACP,OAAO,CAAC,MAAM,GAAG,IAAI,CAgBvB,CAAC"}
|
package/dist/common/fx.common.js
CHANGED
|
@@ -25,6 +25,7 @@ const fxUrls = (rateDate, quoteLower) => [
|
|
|
25
25
|
`https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@${rateDate}/v1/currencies/${quoteLower}.json`,
|
|
26
26
|
`https://${rateDate}.currency-api.pages.dev/v1/currencies/${quoteLower}.json`,
|
|
27
27
|
];
|
|
28
|
+
export const toRateDate = (d) => d.toISOString().slice(0, 10);
|
|
28
29
|
/**
|
|
29
30
|
* All quote-per-EUR rates for a date, primary host then mirror; null when the
|
|
30
31
|
* date is not published yet or both hosts fail. One request serves every
|
|
@@ -49,9 +50,7 @@ export const fetchEurRates = async (rateDate) => {
|
|
|
49
50
|
return null;
|
|
50
51
|
};
|
|
51
52
|
/** Invert a quote-per-EUR rate into EUR per 1 unit; null when unusable. */
|
|
52
|
-
export const rateToEur = (quotePerEur) => quotePerEur !== undefined &&
|
|
53
|
-
Number.isFinite(quotePerEur) &&
|
|
54
|
-
quotePerEur > 0
|
|
53
|
+
export const rateToEur = (quotePerEur) => quotePerEur !== undefined && Number.isFinite(quotePerEur) && quotePerEur > 0
|
|
55
54
|
? 1 / quotePerEur
|
|
56
55
|
: null;
|
|
57
56
|
/** Coalesce concurrent lookups sharing a (date, currency) into one fetch. */
|
|
@@ -65,7 +64,7 @@ const fxInFlight = singleFlight();
|
|
|
65
64
|
export const fxToEur = async (currencyCode, at) => {
|
|
66
65
|
if (currencyCode.toUpperCase() === BASE_CURRENCY)
|
|
67
66
|
return 1;
|
|
68
|
-
const rateDate = at
|
|
67
|
+
const rateDate = toRateDate(at);
|
|
69
68
|
const quote = currencyCode.toUpperCase();
|
|
70
69
|
const cached = await picFxRatesStore().getRate(rateDate, quote);
|
|
71
70
|
if (cached !== null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx.common.js","sourceRoot":"","sources":["../../src/common/fx.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;AAEnC,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAE9B,yEAAyE;AACzE,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC;;;;;GAKG;AACH,MAAM,MAAM,GAAG,CAAC,QAAgB,EAAE,UAAkB,EAAY,EAAE,CAAC;IACjE,0DAA0D,QAAQ,kBAAkB,UAAU,OAAO;IACrG,WAAW,QAAQ,yCAAyC,UAAU,OAAO;CAC9E,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,QAAgB,EACwB,EAAE;IAC1C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC;Y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EzC,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAChE,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IAE3C,OAAO,MAAM,UAAU,CAAC,GAAG,QAAQ,IAAI,KAAK,EAAE,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAClE,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC/B,MAAM,eAAe,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/types/fx.types.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export interface FxSyncSummary {
|
|
|
3
3
|
days: number;
|
|
4
4
|
/** oldest date in the window; also the prune cut-off */
|
|
5
5
|
fromDate: string;
|
|
6
|
-
/** synced quote currencies (EUR excluded) */
|
|
7
|
-
currencies: string[];
|
|
8
6
|
/** dates an HTTP request was made for and parsed */
|
|
9
7
|
fetchedDates: string[];
|
|
10
8
|
/** dates not published yet / both hosts failed */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx.types.d.ts","sourceRoot":"","sources":["../../src/types/fx.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"fx.types.d.ts","sourceRoot":"","sources":["../../src/types/fx.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,kDAAkD;IAClD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxpicture/tesla-superchargers-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "Fetch + store Tesla Supercharger locations and pricing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "MXPicture",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@mxpicture/tesla-superchargers-generated": "^0.1.
|
|
48
|
-
"@mxpicture/tesla-superchargers-mate": "^0.1.
|
|
49
|
-
"@mxpicture/tesla-superchargers-cloud-store": "^0.1.
|
|
47
|
+
"@mxpicture/tesla-superchargers-generated": "^0.1.35",
|
|
48
|
+
"@mxpicture/tesla-superchargers-mate": "^0.1.35",
|
|
49
|
+
"@mxpicture/tesla-superchargers-cloud-store": "^0.1.35",
|
|
50
50
|
"csv-parse": "^7.0.1",
|
|
51
51
|
"json5": "^2.2.3",
|
|
52
52
|
"zod": "^4.4.3"
|