Skip to content

Commit d722cb7

Browse files
Merge pull request #214 from tomtom-international/chore/ev-availability-sdk-todo
Bump maps-sdk to 0.49.0; pass apiKey directly to EV availability (maps-sdk-js#1888)
2 parents b7c1c4f + ec04255 commit d722cb7

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@rollup/plugin-json": "^6.1.0",
2121
"@rollup/plugin-node-resolve": "^16.0.3",
2222
"@rollup/plugin-typescript": "^12.3.0",
23-
"@tomtom-org/maps-sdk": "^0.48.3",
23+
"@tomtom-org/maps-sdk": "^0.49.0",
2424
"@turf/buffer": "^7.3.4",
2525
"@types/pako": "^2.0.4",
2626
"axios": "^1.13.6",
@@ -3239,9 +3239,9 @@
32393239
"license": "MIT"
32403240
},
32413241
"node_modules/@tomtom-org/maps-sdk": {
3242-
"version": "0.48.3",
3243-
"resolved": "https://registry.npmjs.org/@tomtom-org/maps-sdk/-/maps-sdk-0.48.3.tgz",
3244-
"integrity": "sha512-9rmR5xihcWr5UZgzkRQdTLz6QqpUWg1LZ5qMt9cxcGlYadd5o06wMw4r/ndFoTuGatCDr5ujHNtAlQ2M/+plug==",
3242+
"version": "0.49.0",
3243+
"resolved": "https://registry.npmjs.org/@tomtom-org/maps-sdk/-/maps-sdk-0.49.0.tgz",
3244+
"integrity": "sha512-id8i6jJvxtQU84gBw8867CiA4L5l5uPO75fMPew7+i3dPyzLQQve4KsWsP7alwVnlpwM9WxDWbEUEULj62bXNA==",
32453245
"hasInstallScript": true,
32463246
"license": "See in LICENSE.txt",
32473247
"engines": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@rollup/plugin-json": "^6.1.0",
6060
"@rollup/plugin-node-resolve": "^16.0.3",
6161
"@rollup/plugin-typescript": "^12.3.0",
62-
"@tomtom-org/maps-sdk": "^0.48.3",
62+
"@tomtom-org/maps-sdk": "^0.49.0",
6363
"@turf/buffer": "^7.3.4",
6464
"@types/pako": "^2.0.4",
6565
"axios": "^1.13.6",

src/services/search/searchOrbisService.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { getEffectiveApiKey } from "../base/tomtomClient";
3737
import { logger } from "../../utils/logger";
3838
import buffer from "@turf/buffer";
3939
import type { Polygon, Position } from "geojson";
40-
import { TomTomConfig } from "@tomtom-org/maps-sdk/core";
4140
import type { BBox, Language, Places, POICategory, Routes } from "@tomtom-org/maps-sdk/core";
4241

4342
// Options shared by multiple search functions
@@ -428,11 +427,10 @@ export async function searchEVStations(params: EVSearchParams): Promise<Places>
428427
// Enrich with real-time availability if requested
429428
if (params.includeAvailability !== false && filteredResult.features?.length > 0) {
430429
try {
431-
// getPlacesWithEVAvailability takes no key argument — it reads the API key
432-
// from the SDK global config, which the per-call search() path never set,
433-
// so the availability requests went out unauthenticated and were dropped.
434-
TomTomConfig.instance.put({ apiKey });
435-
const enriched = await getPlacesWithEVAvailability(filteredResult);
430+
// Forward the API key to the per-station availability requests. Since SDK
431+
// 0.49.0 (maps-sdk-js#1888) this helper accepts common service params;
432+
// otherwise it reads the key from global config, which we never set.
433+
const enriched = await getPlacesWithEVAvailability(filteredResult, { apiKey });
436434
logger.debug(
437435
{ stationCount: enriched.features?.length },
438436
"EV availability enrichment successful"

0 commit comments

Comments
 (0)