@mxpicture/tesla-superchargers-api 0.1.47 → 0.1.49

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.
@@ -0,0 +1,20 @@
1
+ import { type ZipCodesImportResult } from "@mxpicture/tesla-superchargers-mate/store";
2
+ import { IApi } from "./IApi.js";
3
+ /**
4
+ * Imports the zauberware postal-code dataset into `pic_zip_codes`, which is
5
+ * what lets `pic_addresses_v` print the post town of a rural address — OSM
6
+ * gives TeslaMate the hamlet ("Rannetsreit"), never "Eging am See".
7
+ *
8
+ * Manual only: nothing schedules this. The dataset changes a few times a year,
9
+ * and a stale row is a slightly wrong label, not a wrong price.
10
+ */
11
+ export declare class ZipCodesApi extends IApi {
12
+ /**
13
+ * Import one or more countries, e.g. `"DE"` or `"DE,AT"`. `dir` reads
14
+ * `<dir>/<CC>.zip` from disk instead of downloading. Unknown country codes
15
+ * throw before anything is fetched or written.
16
+ */
17
+ importCountries(countries: string, dir?: string): Promise<ZipCodesImportResult[]>;
18
+ }
19
+ export declare const zipCodesApi: () => ZipCodesApi;
20
+ //# sourceMappingURL=ZipCodesApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZipCodesApi.d.ts","sourceRoot":"","sources":["../../src/api/ZipCodesApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,2CAA2C,CAAC;AAMnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;GAOG;AACH,qBAAa,WAAY,SAAQ,IAAI;IACnC;;;;OAIG;IACU,eAAe,CAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAiBnC;AAGD,eAAO,MAAM,WAAW,mBAAqC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { picZipCodesStore, } from "@mxpicture/tesla-superchargers-mate/store";
2
+ import { fetchCountryCsv, parseCountryCodes, ZIPCODE_COUNTRIES, } from "../common/zipcodes.common.js";
3
+ import { IApi } from "./IApi.js";
4
+ /**
5
+ * Imports the zauberware postal-code dataset into `pic_zip_codes`, which is
6
+ * what lets `pic_addresses_v` print the post town of a rural address — OSM
7
+ * gives TeslaMate the hamlet ("Rannetsreit"), never "Eging am See".
8
+ *
9
+ * Manual only: nothing schedules this. The dataset changes a few times a year,
10
+ * and a stale row is a slightly wrong label, not a wrong price.
11
+ */
12
+ export class ZipCodesApi extends IApi {
13
+ /**
14
+ * Import one or more countries, e.g. `"DE"` or `"DE,AT"`. `dir` reads
15
+ * `<dir>/<CC>.zip` from disk instead of downloading. Unknown country codes
16
+ * throw before anything is fetched or written.
17
+ */
18
+ async importCountries(countries, dir) {
19
+ const codes = parseCountryCodes(countries);
20
+ const store = picZipCodesStore();
21
+ // The FK target has to exist before any of that country's codes land.
22
+ await store.upsertCountries(codes.map((country_code) => ({
23
+ country_code,
24
+ country_name: ZIPCODE_COUNTRIES[country_code],
25
+ })));
26
+ const results = [];
27
+ for (const code of codes)
28
+ results.push(await store.importCsv(code, await fetchCountryCsv(code, dir)));
29
+ return results;
30
+ }
31
+ }
32
+ let _api = null;
33
+ export const zipCodesApi = () => (_api ??= new ZipCodesApi());
34
+ //# sourceMappingURL=ZipCodesApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZipCodesApi.js","sourceRoot":"","sources":["../../src/api/ZipCodesApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAEjB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI;IACnC;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAC1B,SAAiB,EACjB,GAAY;QAEZ,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QAEjC,sEAAsE;QACtE,MAAM,KAAK,CAAC,eAAe,CACzB,KAAK,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAC3B,YAAY;YACZ,YAAY,EAAE,iBAAiB,CAAC,YAAY,CAAC;SAC9C,CAAC,CAAC,CACJ,CAAC;QAEF,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9E,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED,IAAI,IAAI,GAAuB,IAAI,CAAC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,WAAW,EAAE,CAAC,CAAC"}
@@ -4,4 +4,5 @@ export * from "./FailuresApi.js";
4
4
  export * from "./IApi.js";
5
5
  export * from "./InvoicesApi.js";
6
6
  export * from "./SlugsApi.js";
7
+ export * from "./ZipCodesApi.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
package/dist/api/index.js CHANGED
@@ -5,4 +5,5 @@ export * from "./FailuresApi.js";
5
5
  export * from "./IApi.js";
6
6
  export * from "./InvoicesApi.js";
7
7
  export * from "./SlugsApi.js";
8
+ export * from "./ZipCodesApi.js";
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
@@ -7,4 +7,5 @@ export * from "./invoicesCsv.common.js";
7
7
  export * from "./pricebooks.common.js";
8
8
  export * from "./pushover.common.js";
9
9
  export * from "./sync.common.js";
10
+ export * from "./zipcodes.common.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
@@ -8,4 +8,5 @@ export * from "./invoicesCsv.common.js";
8
8
  export * from "./pricebooks.common.js";
9
9
  export * from "./pushover.common.js";
10
10
  export * from "./sync.common.js";
11
+ export * from "./zipcodes.common.js";
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /** The dataset's CSV header, verified byte-for-byte against DE/AT/CH/NL/GB/LU. */
2
+ export declare const ZIPCODE_CSV_HEADER = "country_code,zipcode,place,state,state_code,province,province_code,community,community_code,latitude,longitude";
3
+ /**
4
+ * Every country the dataset publishes, mapped to the English name stored in
5
+ * `pic_zip_country`. Doubles as the allow-list: `--countries` is validated
6
+ * against it before anything is downloaded. Taken from the dataset README,
7
+ * whose list matches `data/*.zip` exactly — the CSVs themselves carry no
8
+ * country name.
9
+ */
10
+ export declare const ZIPCODE_COUNTRIES: Readonly<Record<string, string>>;
11
+ /** ISO-2 codes the dataset covers, uppercased and de-duplicated, or a thrown error. */
12
+ export declare const parseCountryCodes: (input: string) => string[];
13
+ /**
14
+ * The CSV text for one country, from `dir/<CC>.zip` when `dir` is given and
15
+ * from the published archive otherwise. Only the CSV entry is inflated; the
16
+ * JSON and XML siblings (together ~7x its size) are skipped.
17
+ */
18
+ export declare const fetchCountryCsv: (country: string, dir?: string) => Promise<string>;
19
+ //# sourceMappingURL=zipcodes.common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zipcodes.common.d.ts","sourceRoot":"","sources":["../../src/common/zipcodes.common.ts"],"names":[],"mappings":"AAqBA,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,mHACmF,CAAC;AAEnH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0H9D,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,MAAM,EAgBvD,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EACf,MAAM,MAAM,KACX,OAAO,CAAC,MAAM,CAiBhB,CAAC"}
@@ -0,0 +1,195 @@
1
+ /**
2
+ * The zauberware/postal-codes-json-xml-csv dataset: one `<CC>.zip` per country,
3
+ * each holding `zipcodes.<cc>.{csv,json,xml}` at the archive root. Only the CSV
4
+ * is read — Postgres' own COPY parses RFC-4180 quoting, and 2 051 of the 23 297
5
+ * German rows carry a quoted comma in `place` ("RTS Rieger Team, Werbeagentur"),
6
+ * which naive splitting would corrupt silently.
7
+ *
8
+ * The archive is unzipped in-process with fflate rather than by shelling out to
9
+ * `unzip`, which is not guaranteed to exist in the container image.
10
+ */
11
+ import { unzipSync } from "fflate";
12
+ import { readFile } from "node:fs/promises";
13
+ import path from "node:path";
14
+ /** Where the archives are published when no local `--dir` is given. */
15
+ const DATA_BASE_URL = "https://raw.githubusercontent.com/zauberware/postal-codes-json-xml-csv/master/data";
16
+ /** A country archive is a few MiB; give it room but do not hang forever. */
17
+ const DOWNLOAD_TIMEOUT_MS = 60_000;
18
+ /** The dataset's CSV header, verified byte-for-byte against DE/AT/CH/NL/GB/LU. */
19
+ export const ZIPCODE_CSV_HEADER = "country_code,zipcode,place,state,state_code,province,province_code,community,community_code,latitude,longitude";
20
+ /**
21
+ * Every country the dataset publishes, mapped to the English name stored in
22
+ * `pic_zip_country`. Doubles as the allow-list: `--countries` is validated
23
+ * against it before anything is downloaded. Taken from the dataset README,
24
+ * whose list matches `data/*.zip` exactly — the CSVs themselves carry no
25
+ * country name.
26
+ */
27
+ export const ZIPCODE_COUNTRIES = {
28
+ AD: "Andorra",
29
+ AE: "United Arab Emirates",
30
+ AI: "Anguilla",
31
+ AL: "Albania",
32
+ AR: "Argentina",
33
+ AS: "American Samoa",
34
+ AT: "Austria",
35
+ AU: "Australia",
36
+ AX: "Åland",
37
+ AZ: "Azerbaijan",
38
+ BD: "Bangladesh",
39
+ BE: "Belgium",
40
+ BG: "Bulgaria",
41
+ BM: "Bermuda",
42
+ BR: "Brazil",
43
+ BY: "Belarus",
44
+ CA: "Canada",
45
+ CC: "Cocos (Keeling) Islands",
46
+ CH: "Switzerland",
47
+ CL: "Chile",
48
+ CN: "China",
49
+ CO: "Colombia",
50
+ CR: "Costa Rica",
51
+ CX: "Christmas Island",
52
+ CY: "Cyprus",
53
+ CZ: "Czechia",
54
+ DE: "Germany",
55
+ DK: "Denmark",
56
+ DO: "Dominican Republic",
57
+ DZ: "Algeria",
58
+ EC: "Ecuador",
59
+ EE: "Estonia",
60
+ ES: "Spain",
61
+ FI: "Finland",
62
+ FK: "Falkland Islands",
63
+ FM: "Micronesia",
64
+ FO: "Faroe Islands",
65
+ FR: "France",
66
+ GB: "United Kingdom",
67
+ GF: "French Guiana",
68
+ GG: "Guernsey",
69
+ GI: "Gibraltar",
70
+ GL: "Greenland",
71
+ GP: "Guadeloupe",
72
+ GS: "South Georgia and South Sandwich Islands",
73
+ GT: "Guatemala",
74
+ GU: "Guam",
75
+ HK: "Hong Kong",
76
+ HM: "Heard and McDonald Islands",
77
+ HN: "Honduras",
78
+ HR: "Croatia",
79
+ HT: "Haiti",
80
+ HU: "Hungary",
81
+ ID: "Indonesia",
82
+ IE: "Ireland",
83
+ IM: "Isle of Man",
84
+ IN: "India",
85
+ IO: "British Indian Ocean Territory",
86
+ IS: "Iceland",
87
+ IT: "Italy",
88
+ JE: "Jersey",
89
+ JP: "Japan",
90
+ KE: "Kenya",
91
+ KR: "South Korea",
92
+ LI: "Liechtenstein",
93
+ LK: "Sri Lanka",
94
+ LT: "Lithuania",
95
+ LU: "Luxembourg",
96
+ LV: "Latvia",
97
+ MA: "Morocco",
98
+ MC: "Monaco",
99
+ MD: "Moldova",
100
+ MH: "Marshall Islands",
101
+ MK: "North Macedonia",
102
+ MO: "Macao",
103
+ MP: "Northern Mariana Islands",
104
+ MQ: "Martinique",
105
+ MT: "Malta",
106
+ MW: "Malawi",
107
+ MX: "Mexico",
108
+ MY: "Malaysia",
109
+ NC: "New Caledonia",
110
+ NF: "Norfolk Island",
111
+ NL: "The Netherlands",
112
+ NO: "Norway",
113
+ NR: "Nauru",
114
+ NU: "Niue",
115
+ NZ: "New Zealand",
116
+ PA: "Panama",
117
+ PE: "Peru",
118
+ PF: "French Polynesia",
119
+ PH: "Philippines",
120
+ PK: "Pakistan",
121
+ PL: "Poland",
122
+ PM: "Saint Pierre and Miquelon",
123
+ PN: "Pitcairn Islands",
124
+ PR: "Puerto Rico",
125
+ PT: "Portugal",
126
+ PW: "Palau",
127
+ RE: "Réunion",
128
+ RO: "Romania",
129
+ RS: "Serbia",
130
+ RU: "Russia",
131
+ SE: "Sweden",
132
+ SG: "Singapore",
133
+ SI: "Slovenia",
134
+ SJ: "Svalbard and Jan Mayen",
135
+ SK: "Slovakia",
136
+ SM: "San Marino",
137
+ TC: "Turks and Caicos Islands",
138
+ TH: "Thailand",
139
+ TR: "Türkiye",
140
+ UA: "Ukraine",
141
+ US: "United States",
142
+ UY: "Uruguay",
143
+ VA: "Vatican City",
144
+ VI: "U.S. Virgin Islands",
145
+ WF: "Wallis and Futuna",
146
+ WS: "Samoa",
147
+ YT: "Mayotte",
148
+ ZA: "South Africa",
149
+ };
150
+ /** ISO-2 codes the dataset covers, uppercased and de-duplicated, or a thrown error. */
151
+ export const parseCountryCodes = (input) => {
152
+ const codes = input
153
+ .split(",")
154
+ .map((c) => c.trim().toUpperCase())
155
+ .filter((c) => c !== "");
156
+ if (codes.length === 0)
157
+ throw new Error("no country codes given");
158
+ const unknown = codes.filter((c) => !(c in ZIPCODE_COUNTRIES));
159
+ if (unknown.length > 0)
160
+ throw new Error(`unknown country code(s): ${unknown.join(", ")} — the dataset covers ${Object.keys(ZIPCODE_COUNTRIES).length} countries`);
161
+ return [...new Set(codes)];
162
+ };
163
+ /** `zipcodes.de.csv` for `DE`. */
164
+ const csvEntryName = (country) => `zipcodes.${country.toLowerCase()}.csv`;
165
+ const archiveBytes = async (country, dir) => {
166
+ if (dir !== undefined)
167
+ return new Uint8Array(await readFile(path.join(dir, `${country}.zip`)));
168
+ const url = `${DATA_BASE_URL}/${country}.zip`;
169
+ const res = await fetch(url, {
170
+ signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS),
171
+ });
172
+ if (!res.ok)
173
+ throw new Error(`GET ${url} failed: ${res.status} ${res.statusText}`);
174
+ return new Uint8Array(await res.arrayBuffer());
175
+ };
176
+ /**
177
+ * The CSV text for one country, from `dir/<CC>.zip` when `dir` is given and
178
+ * from the published archive otherwise. Only the CSV entry is inflated; the
179
+ * JSON and XML siblings (together ~7x its size) are skipped.
180
+ */
181
+ export const fetchCountryCsv = async (country, dir) => {
182
+ const entry = csvEntryName(country);
183
+ const unzipped = unzipSync(await archiveBytes(country, dir), {
184
+ filter: (file) => file.name === entry,
185
+ });
186
+ const csv = unzipped[entry];
187
+ if (csv === undefined)
188
+ throw new Error(`${country}.zip does not contain ${entry}`);
189
+ const text = new TextDecoder("utf-8").decode(csv);
190
+ const header = text.split("\n", 1)[0].replace(/\r$/, "");
191
+ if (header !== ZIPCODE_CSV_HEADER)
192
+ throw new Error(`${entry}: unexpected header\n got: ${header}\n expected: ${ZIPCODE_CSV_HEADER}`);
193
+ return text;
194
+ };
195
+ //# sourceMappingURL=zipcodes.common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zipcodes.common.js","sourceRoot":"","sources":["../../src/common/zipcodes.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,uEAAuE;AACvE,MAAM,aAAa,GACjB,oFAAoF,CAAC;AAEvF,4EAA4E;AAC5E,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAC7B,gHAAgH,CAAC;AAEnH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC;IACjE,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,sBAAsB;IAC1B,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,WAAW;IACf,EAAE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C,GAAG,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,MAAM,KAAK,kBAAkB;QAC/B,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,oCAAoC,MAAM,iBAAiB,kBAAkB,EAAE,CACxF,CAAC;IAEJ,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/tesla-superchargers-api",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
4
4
  "description": "Fetch + store Tesla Supercharger locations and pricing",
5
5
  "type": "module",
6
6
  "author": "MXPicture",
@@ -44,10 +44,11 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@mxpicture/tesla-superchargers-cloud-store": "^0.1.47",
48
- "@mxpicture/tesla-superchargers-generated": "^0.1.47",
49
- "@mxpicture/tesla-superchargers-mate": "^0.1.47",
47
+ "@mxpicture/tesla-superchargers-cloud-store": "^0.1.49",
48
+ "@mxpicture/tesla-superchargers-generated": "^0.1.49",
49
+ "@mxpicture/tesla-superchargers-mate": "^0.1.49",
50
50
  "csv-parse": "^7.0.1",
51
+ "fflate": "^0.8.3",
51
52
  "json5": "^2.2.3",
52
53
  "zod": "^4.4.3"
53
54
  },