googlemaps-kit 0.1.3 → 0.2.1
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/README.md +146 -179
- package/dist/advanced/auth.d.ts +10 -0
- package/dist/advanced/auth.d.ts.map +1 -0
- package/dist/advanced/auth.js +8 -0
- package/dist/advanced/auth.js.map +1 -0
- package/dist/advanced/http.d.ts +10 -0
- package/dist/advanced/http.d.ts.map +1 -0
- package/dist/advanced/http.js +9 -0
- package/dist/advanced/http.js.map +1 -0
- package/dist/advanced/parsers.d.ts +28 -0
- package/dist/advanced/parsers.d.ts.map +1 -0
- package/dist/advanced/parsers.js +25 -0
- package/dist/advanced/parsers.js.map +1 -0
- package/dist/advanced/rpc.d.ts +29 -0
- package/dist/advanced/rpc.d.ts.map +1 -0
- package/dist/advanced/rpc.js +23 -0
- package/dist/advanced/rpc.js.map +1 -0
- package/dist/advanced/services.d.ts +34 -0
- package/dist/advanced/services.d.ts.map +1 -0
- package/dist/advanced/services.js +29 -0
- package/dist/advanced/services.js.map +1 -0
- package/dist/advanced/utils.d.ts +15 -0
- package/dist/advanced/utils.d.ts.map +1 -0
- package/dist/advanced/utils.js +13 -0
- package/dist/advanced/utils.js.map +1 -0
- package/dist/advanced.d.ts +43 -0
- package/dist/advanced.d.ts.map +1 -0
- package/dist/advanced.js +26 -0
- package/dist/advanced.js.map +1 -0
- package/dist/auth/session.d.ts +6 -1
- package/dist/auth/session.d.ts.map +1 -1
- package/dist/auth/session.js +23 -8
- package/dist/auth/session.js.map +1 -1
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +115 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/gmaps-client.d.ts +91 -52
- package/dist/client/gmaps-client.d.ts.map +1 -1
- package/dist/client/gmaps-client.js +209 -109
- package/dist/client/gmaps-client.js.map +1 -1
- package/dist/client/http-client.d.ts +28 -3
- package/dist/client/http-client.d.ts.map +1 -1
- package/dist/client/http-client.js +163 -14
- package/dist/client/http-client.js.map +1 -1
- package/dist/client/intent.d.ts +75 -0
- package/dist/client/intent.d.ts.map +1 -0
- package/dist/client/intent.js +546 -0
- package/dist/client/intent.js.map +1 -0
- package/dist/client/maps-tools.d.ts +80 -0
- package/dist/client/maps-tools.d.ts.map +1 -0
- package/dist/client/maps-tools.js +187 -0
- package/dist/client/maps-tools.js.map +1 -0
- package/dist/client/namespaces.d.ts +121 -0
- package/dist/client/namespaces.d.ts.map +1 -0
- package/dist/client/namespaces.js +169 -0
- package/dist/client/namespaces.js.map +1 -0
- package/dist/client/place-enrichment.d.ts +19 -0
- package/dist/client/place-enrichment.d.ts.map +1 -0
- package/dist/client/place-enrichment.js +71 -0
- package/dist/client/place-enrichment.js.map +1 -0
- package/dist/client/product-namespaces.d.ts +30 -0
- package/dist/client/product-namespaces.d.ts.map +1 -0
- package/dist/client/product-namespaces.js +47 -0
- package/dist/client/product-namespaces.js.map +1 -0
- package/dist/index.d.ts +31 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -28
- package/dist/index.js.map +1 -1
- package/dist/parsers/place.d.ts.map +1 -1
- package/dist/parsers/place.js +2 -0
- package/dist/parsers/place.js.map +1 -1
- package/dist/parsers/reviews.d.ts +0 -2
- package/dist/parsers/reviews.d.ts.map +1 -1
- package/dist/parsers/reviews.js +0 -2
- package/dist/parsers/reviews.js.map +1 -1
- package/dist/parsers/search.d.ts +13 -1
- package/dist/parsers/search.d.ts.map +1 -1
- package/dist/parsers/search.js +130 -71
- package/dist/parsers/search.js.map +1 -1
- package/dist/rpc/batch-execute.d.ts.map +1 -1
- package/dist/rpc/batch-execute.js +20 -3
- package/dist/rpc/batch-execute.js.map +1 -1
- package/dist/rpc/batch-rpc.d.ts.map +1 -1
- package/dist/rpc/batch-rpc.js +5 -6
- package/dist/rpc/batch-rpc.js.map +1 -1
- package/dist/rpc/batch-services.d.ts +2 -0
- package/dist/rpc/batch-services.d.ts.map +1 -1
- package/dist/rpc/batch-services.js +4 -0
- package/dist/rpc/batch-services.js.map +1 -1
- package/dist/rpc/pb-builders.d.ts +0 -2
- package/dist/rpc/pb-builders.d.ts.map +1 -1
- package/dist/rpc/pb-builders.js +2 -5
- package/dist/rpc/pb-builders.js.map +1 -1
- package/dist/rpc/rpc-client.d.ts +6 -2
- package/dist/rpc/rpc-client.d.ts.map +1 -1
- package/dist/rpc/rpc-client.js +26 -10
- package/dist/rpc/rpc-client.js.map +1 -1
- package/dist/rpc/rpc-methods.d.ts +0 -7
- package/dist/rpc/rpc-methods.d.ts.map +1 -1
- package/dist/rpc/rpc-methods.js +0 -7
- package/dist/rpc/rpc-methods.js.map +1 -1
- package/dist/services/ask-maps.js +1 -1
- package/dist/services/ask-maps.js.map +1 -1
- package/dist/services/directions.d.ts +3 -8
- package/dist/services/directions.d.ts.map +1 -1
- package/dist/services/directions.js +37 -13
- package/dist/services/directions.js.map +1 -1
- package/dist/services/geocode.js +1 -1
- package/dist/services/photos.d.ts.map +1 -1
- package/dist/services/photos.js +2 -5
- package/dist/services/photos.js.map +1 -1
- package/dist/services/places.d.ts.map +1 -1
- package/dist/services/places.js +13 -4
- package/dist/services/places.js.map +1 -1
- package/dist/services/reviews.d.ts +7 -0
- package/dist/services/reviews.d.ts.map +1 -1
- package/dist/services/reviews.js +10 -1
- package/dist/services/reviews.js.map +1 -1
- package/dist/services/search.d.ts +7 -5
- package/dist/services/search.d.ts.map +1 -1
- package/dist/services/search.js +46 -17
- package/dist/services/search.js.map +1 -1
- package/dist/services/ugc-aggregates.d.ts.map +1 -1
- package/dist/services/ugc-aggregates.js +1 -17
- package/dist/services/ugc-aggregates.js.map +1 -1
- package/dist/types/common.d.ts +92 -6
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +12 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/directions.d.ts +16 -2
- package/dist/types/directions.d.ts.map +1 -1
- package/dist/types/dx.d.ts +289 -0
- package/dist/types/dx.d.ts.map +1 -0
- package/dist/types/dx.js +7 -0
- package/dist/types/dx.js.map +1 -0
- package/dist/types/hooks.d.ts +48 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/hooks.js +5 -0
- package/dist/types/hooks.js.map +1 -0
- package/dist/utils/abort.d.ts +7 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +43 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/coords.d.ts +24 -0
- package/dist/utils/coords.d.ts.map +1 -0
- package/dist/utils/coords.js +37 -0
- package/dist/utils/coords.js.map +1 -0
- package/dist/utils/export-results.d.ts +24 -0
- package/dist/utils/export-results.d.ts.map +1 -0
- package/dist/utils/export-results.js +105 -0
- package/dist/utils/export-results.js.map +1 -0
- package/dist/utils/hooks.d.ts +10 -0
- package/dist/utils/hooks.d.ts.map +1 -0
- package/dist/utils/hooks.js +47 -0
- package/dist/utils/hooks.js.map +1 -0
- package/dist/utils/place-ref.d.ts +39 -0
- package/dist/utils/place-ref.d.ts.map +1 -0
- package/dist/utils/place-ref.js +109 -0
- package/dist/utils/place-ref.js.map +1 -0
- package/dist/utils/pooled.d.ts +2 -0
- package/dist/utils/pooled.d.ts.map +1 -1
- package/dist/utils/pooled.js +8 -0
- package/dist/utils/pooled.js.map +1 -1
- package/dist/utils/request-context.d.ts +9 -0
- package/dist/utils/request-context.d.ts.map +1 -0
- package/dist/utils/request-context.js +12 -0
- package/dist/utils/request-context.js.map +1 -0
- package/dist/utils/ttl-cache.d.ts +17 -0
- package/dist/utils/ttl-cache.d.ts.map +1 -0
- package/dist/utils/ttl-cache.js +43 -0
- package/dist/utils/ttl-cache.js.map +1 -0
- package/package.json +28 -13
- package/dist/internal.d.ts +0 -140
- package/dist/internal.d.ts.map +0 -1
- package/dist/internal.js +0 -97
- package/dist/internal.js.map +0 -1
- package/dist/server/api-server.d.ts +0 -9
- package/dist/server/api-server.d.ts.map +0 -1
- package/dist/server/api-server.js +0 -293
- package/dist/server/api-server.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/utils/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAErG,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAMtF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAMpF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAMpF;AAED,0DAA0D;AAC1D,wBAAsB,cAAc,CAAC,CAAC,EACpC,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAgBZ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fire lifecycle hooks without letting user callbacks break the call path.
|
|
3
|
+
*/
|
|
4
|
+
export function fireAction(hooks, event) {
|
|
5
|
+
try {
|
|
6
|
+
hooks?.onAction?.(event);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
// ignore hook failures
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function fireRetry(hooks, event) {
|
|
13
|
+
try {
|
|
14
|
+
hooks?.onRetry?.(event);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// ignore
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function fireError(hooks, event) {
|
|
21
|
+
try {
|
|
22
|
+
hooks?.onError?.(event);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// ignore
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Wrap an Intent call with onAction / onError timing. */
|
|
29
|
+
export async function withActionHook(hooks, type, fn) {
|
|
30
|
+
const start = performance.now();
|
|
31
|
+
try {
|
|
32
|
+
const result = await fn();
|
|
33
|
+
fireAction(hooks, { type, status: 'ok', durationMs: performance.now() - start });
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
fireAction(hooks, {
|
|
38
|
+
type,
|
|
39
|
+
status: 'error',
|
|
40
|
+
durationMs: performance.now() - start,
|
|
41
|
+
error,
|
|
42
|
+
});
|
|
43
|
+
fireError(hooks, { type, error });
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/utils/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,UAAU,UAAU,CAAC,KAA6B,EAAE,KAAsB;IAC9E,IAAI,CAAC;QACH,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,uBAAuB;IACzB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAA6B,EAAE,KAAqB;IAC5E,IAAI,CAAC;QACH,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAA6B,EAAE,KAAqB;IAC5E,IAAI,CAAC;QACH,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;AACH,CAAC;AAED,0DAA0D;AAC1D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAA6B,EAC7B,IAAY,EACZ,EAAoB;IAEpB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;QACjF,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,CAAC,KAAK,EAAE;YAChB,IAAI;YACJ,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK;YACrC,KAAK;SACN,CAAC,CAAC;QACH,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAClC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlaceRef + route endpoint normalization (shared by Intent API and services).
|
|
3
|
+
*/
|
|
4
|
+
import type { Coordinates } from '../types/common.js';
|
|
5
|
+
import type { NormalizedPlaceRef, PlaceRef } from '../types/dx.js';
|
|
6
|
+
/**
|
|
7
|
+
* Normalize a PlaceRef for service calls.
|
|
8
|
+
* Accepts: hexId string, ChIJ placeId string, or object with hexId and/or placeId.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizePlaceRef(ref: PlaceRef): NormalizedPlaceRef;
|
|
11
|
+
/** Resolve route endpoint: address string, coords, or PlaceRef with coords. */
|
|
12
|
+
export declare function resolveRouteEndpoint(value: string | Coordinates | PlaceRef | CoordLoose): string | Coordinates;
|
|
13
|
+
type CoordLoose = {
|
|
14
|
+
lat?: number;
|
|
15
|
+
lng?: number;
|
|
16
|
+
latitude?: number;
|
|
17
|
+
longitude?: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Resolve search bias center from Intent (`near`) or service (`location`) spelling.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveSearchCenter(options: {
|
|
23
|
+
near?: Coordinates | CoordLoose;
|
|
24
|
+
location?: Coordinates | CoordLoose;
|
|
25
|
+
}): Coordinates;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve directions endpoints from Intent (`from`/`to`) or service (`origin`/`destination`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveDirectionsEndpoints(options: {
|
|
30
|
+
from?: string | Coordinates | PlaceRef;
|
|
31
|
+
to?: string | Coordinates | PlaceRef;
|
|
32
|
+
origin?: string | Coordinates | PlaceRef;
|
|
33
|
+
destination?: string | Coordinates | PlaceRef;
|
|
34
|
+
}): {
|
|
35
|
+
origin: string | Coordinates;
|
|
36
|
+
destination: string | Coordinates;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=place-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-ref.d.ts","sourceRoot":"","sources":["../../src/utils/place-ref.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAenE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,kBAAkB,CAiDnE;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAClD,MAAM,GAAG,WAAW,CAgCtB;AAED,KAAK,UAAU,GAAG;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IAChC,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;CACrC,GAAG,WAAW,CAQd;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IAClD,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACvC,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC/C,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAYtE"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlaceRef + route endpoint normalization (shared by Intent API and services).
|
|
3
|
+
*/
|
|
4
|
+
import { GMapsError } from '../types/common.js';
|
|
5
|
+
import { placeIdToFeatureId } from './ids.js';
|
|
6
|
+
import { toCoordinates } from './coords.js';
|
|
7
|
+
const HEX_ID_RE = /^0x[0-9a-f]+:0x[0-9a-f]+$/i;
|
|
8
|
+
const PLACE_ID_RE = /^ChIJ[\w-]+$/;
|
|
9
|
+
function tryPlaceIdToHex(placeId) {
|
|
10
|
+
try {
|
|
11
|
+
return placeIdToFeatureId(placeId);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Normalize a PlaceRef for service calls.
|
|
19
|
+
* Accepts: hexId string, ChIJ placeId string, or object with hexId and/or placeId.
|
|
20
|
+
*/
|
|
21
|
+
export function normalizePlaceRef(ref) {
|
|
22
|
+
if (typeof ref === 'string') {
|
|
23
|
+
const trimmed = ref.trim();
|
|
24
|
+
if (!trimmed) {
|
|
25
|
+
throw new GMapsError('PlaceRef string must be a non-empty hexId or placeId');
|
|
26
|
+
}
|
|
27
|
+
if (HEX_ID_RE.test(trimmed)) {
|
|
28
|
+
return { hexId: trimmed };
|
|
29
|
+
}
|
|
30
|
+
if (PLACE_ID_RE.test(trimmed)) {
|
|
31
|
+
const hexId = tryPlaceIdToHex(trimmed);
|
|
32
|
+
if (!hexId) {
|
|
33
|
+
throw new GMapsError(`Could not convert placeId to hexId: ${trimmed}`);
|
|
34
|
+
}
|
|
35
|
+
return { hexId, placeId: trimmed };
|
|
36
|
+
}
|
|
37
|
+
throw new GMapsError('PlaceRef string must be a hexId (0x…:0x…) or ChIJ placeId — got an unrecognized id');
|
|
38
|
+
}
|
|
39
|
+
let hexId = ref.hexId?.trim();
|
|
40
|
+
const placeId = ref.placeId?.trim();
|
|
41
|
+
if (!hexId && placeId) {
|
|
42
|
+
hexId = tryPlaceIdToHex(placeId);
|
|
43
|
+
if (!hexId) {
|
|
44
|
+
throw new GMapsError(`PlaceRef has placeId but could not convert to hexId: ${placeId}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!hexId) {
|
|
48
|
+
throw new GMapsError('PlaceRef requires hexId (0x…:0x…) or placeId (ChIJ…). ' +
|
|
49
|
+
'If you called resolve(), check that the result includes hexId before profile/media/opinions.');
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
hexId,
|
|
53
|
+
name: ref.name,
|
|
54
|
+
lat: ref.lat ?? ref.latitude,
|
|
55
|
+
lng: ref.lng ?? ref.longitude,
|
|
56
|
+
placeId: placeId ?? ref.placeId,
|
|
57
|
+
ftid: ref.ftid,
|
|
58
|
+
reviewCount: ref.reviewCount,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Resolve route endpoint: address string, coords, or PlaceRef with coords. */
|
|
62
|
+
export function resolveRouteEndpoint(value) {
|
|
63
|
+
if (typeof value === 'string') {
|
|
64
|
+
const trimmed = value.trim();
|
|
65
|
+
if (HEX_ID_RE.test(trimmed)) {
|
|
66
|
+
throw new GMapsError('Route endpoint cannot be a bare hexId — pass { lat, lng }, a PlaceRef with coords, or an address string');
|
|
67
|
+
}
|
|
68
|
+
if (PLACE_ID_RE.test(trimmed)) {
|
|
69
|
+
throw new GMapsError('Route endpoint cannot be a bare placeId — pass { lat, lng } or an address string');
|
|
70
|
+
}
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
if (typeof value === 'object' && value !== null && 'hexId' in value && value.hexId) {
|
|
74
|
+
const place = normalizePlaceRef(value);
|
|
75
|
+
if (place.lat == null || place.lng == null) {
|
|
76
|
+
throw new GMapsError('PlaceRef route endpoint requires lat/lng (or latitude/longitude). Profile the place first or pass an address.');
|
|
77
|
+
}
|
|
78
|
+
return { lat: place.lat, lng: place.lng };
|
|
79
|
+
}
|
|
80
|
+
const coords = toCoordinates(value);
|
|
81
|
+
if (coords)
|
|
82
|
+
return coords;
|
|
83
|
+
throw new GMapsError('Invalid route endpoint — expected address string, { lat, lng }, or PlaceRef with coordinates');
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Resolve search bias center from Intent (`near`) or service (`location`) spelling.
|
|
87
|
+
*/
|
|
88
|
+
export function resolveSearchCenter(options) {
|
|
89
|
+
const coords = toCoordinates(options.near) ?? toCoordinates(options.location);
|
|
90
|
+
if (!coords) {
|
|
91
|
+
throw new GMapsError('Search requires a bias center — pass near: { lat, lng } (Intent) or location: { lat, lng } (search service)');
|
|
92
|
+
}
|
|
93
|
+
return coords;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolve directions endpoints from Intent (`from`/`to`) or service (`origin`/`destination`).
|
|
97
|
+
*/
|
|
98
|
+
export function resolveDirectionsEndpoints(options) {
|
|
99
|
+
const originRaw = options.from ?? options.origin;
|
|
100
|
+
const destRaw = options.to ?? options.destination;
|
|
101
|
+
if (originRaw == null || destRaw == null) {
|
|
102
|
+
throw new GMapsError('Directions require from/to (Intent) or origin/destination (directions service)');
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
origin: resolveRouteEndpoint(originRaw),
|
|
106
|
+
destination: resolveRouteEndpoint(destRaw),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=place-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-ref.js","sourceRoot":"","sources":["../../src/utils/place-ref.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,SAAS,GAAG,4BAA4B,CAAC;AAC/C,MAAM,WAAW,GAAG,cAAc,CAAC;AAEnC,SAAS,eAAe,CAAC,OAAe;IACtC,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAa;IAC7C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,UAAU,CAAC,sDAAsD,CAAC,CAAC;QAC/E,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,C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,CAAC,OAK1C;IACC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,WAAW,CAAC;IAClD,IAAI,SAAS,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACzC,MAAM,IAAI,UAAU,CAClB,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,oBAAoB,CAAC,SAAS,CAAC;QACvC,WAAW,EAAE,oBAAoB,CAAC,OAAO,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
package/dist/utils/pooled.d.ts
CHANGED
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* Run async tasks with bounded concurrency (same pattern as scripts/capture-maps-all.ts).
|
|
3
3
|
*/
|
|
4
4
|
export declare function pooled<T>(items: T[], limit: number, worker: (item: T, index: number) => Promise<void>): Promise<void>;
|
|
5
|
+
/** Like {@link pooled} but collects return values in input order. */
|
|
6
|
+
export declare function pooledMap<T, R>(items: T[], limit: number, worker: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
5
7
|
export declare function sleep(ms: number): Promise<void>;
|
|
6
8
|
//# sourceMappingURL=pooled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pooled.d.ts","sourceRoot":"","sources":["../../src/utils/pooled.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
|
|
1
|
+
{"version":3,"file":"pooled.d.ts","sourceRoot":"","sources":["../../src/utils/pooled.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,qEAAqE;AACrE,wBAAsB,SAAS,CAAC,CAAC,EAAE,CAAC,EAClC,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,EAAE,CAAC,CAMd;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
|
package/dist/utils/pooled.js
CHANGED
|
@@ -13,6 +13,14 @@ export async function pooled(items, limit, worker) {
|
|
|
13
13
|
});
|
|
14
14
|
await Promise.all(runners);
|
|
15
15
|
}
|
|
16
|
+
/** Like {@link pooled} but collects return values in input order. */
|
|
17
|
+
export async function pooledMap(items, limit, worker) {
|
|
18
|
+
const results = new Array(items.length);
|
|
19
|
+
await pooled(items, limit, async (item, index) => {
|
|
20
|
+
results[index] = await worker(item, index);
|
|
21
|
+
});
|
|
22
|
+
return results;
|
|
23
|
+
}
|
|
16
24
|
export function sleep(ms) {
|
|
17
25
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
18
26
|
}
|
package/dist/utils/pooled.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pooled.js","sourceRoot":"","sources":["../../src/utils/pooled.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,KAA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CAAC,KAAK,CAAC,KAAK,CAAE,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,KAAU,EACV,KAAa,EACb,MAA8C;IAE9C,MAAM,OAAO,GAAG,IAAI,KAAK,CAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-async-call request context (AbortSignal) without threading through every service.
|
|
3
|
+
*/
|
|
4
|
+
export interface RequestContext {
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export declare function runWithRequestContext<T>(ctx: RequestContext, fn: () => Promise<T>): Promise<T>;
|
|
8
|
+
export declare function getRequestSignal(): AbortSignal | undefined;
|
|
9
|
+
//# sourceMappingURL=request-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/utils/request-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAID,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,GAAG,EAAE,cAAc,EACnB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED,wBAAgB,gBAAgB,IAAI,WAAW,GAAG,SAAS,CAE1D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-async-call request context (AbortSignal) without threading through every service.
|
|
3
|
+
*/
|
|
4
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
5
|
+
const store = new AsyncLocalStorage();
|
|
6
|
+
export function runWithRequestContext(ctx, fn) {
|
|
7
|
+
return store.run(ctx, fn);
|
|
8
|
+
}
|
|
9
|
+
export function getRequestSignal() {
|
|
10
|
+
return store.getStore()?.signal;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=request-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../src/utils/request-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAMrD,MAAM,KAAK,GAAG,IAAI,iBAAiB,EAAkB,CAAC;AAEtD,MAAM,UAAU,qBAAqB,CACnC,GAAmB,EACnB,EAAoB;IAEpB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small in-memory TTL cache (Intent profile / discover).
|
|
3
|
+
*/
|
|
4
|
+
export declare class TtlCache<V> {
|
|
5
|
+
private readonly ttlMs;
|
|
6
|
+
private readonly maxEntries;
|
|
7
|
+
private readonly map;
|
|
8
|
+
constructor(options?: {
|
|
9
|
+
ttlMs?: number;
|
|
10
|
+
maxEntries?: number;
|
|
11
|
+
});
|
|
12
|
+
get(key: string): V | undefined;
|
|
13
|
+
set(key: string, value: V): void;
|
|
14
|
+
clear(): void;
|
|
15
|
+
get size(): number;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ttl-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ttl-cache.d.ts","sourceRoot":"","sources":["../../src/utils/ttl-cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,QAAQ,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsD;gBAE9D,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO;IAKjE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAa/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAUhC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small in-memory TTL cache (Intent profile / discover).
|
|
3
|
+
*/
|
|
4
|
+
export class TtlCache {
|
|
5
|
+
ttlMs;
|
|
6
|
+
maxEntries;
|
|
7
|
+
map = new Map();
|
|
8
|
+
constructor(options = {}) {
|
|
9
|
+
this.ttlMs = options.ttlMs ?? 60_000;
|
|
10
|
+
this.maxEntries = Math.max(1, options.maxEntries ?? 256);
|
|
11
|
+
}
|
|
12
|
+
get(key) {
|
|
13
|
+
const entry = this.map.get(key);
|
|
14
|
+
if (!entry)
|
|
15
|
+
return undefined;
|
|
16
|
+
if (Date.now() > entry.expiresAt) {
|
|
17
|
+
this.map.delete(key);
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
// refresh LRU order
|
|
21
|
+
this.map.delete(key);
|
|
22
|
+
this.map.set(key, entry);
|
|
23
|
+
return entry.value;
|
|
24
|
+
}
|
|
25
|
+
set(key, value) {
|
|
26
|
+
if (this.map.has(key))
|
|
27
|
+
this.map.delete(key);
|
|
28
|
+
while (this.map.size >= this.maxEntries) {
|
|
29
|
+
const oldest = this.map.keys().next().value;
|
|
30
|
+
if (oldest == null)
|
|
31
|
+
break;
|
|
32
|
+
this.map.delete(oldest);
|
|
33
|
+
}
|
|
34
|
+
this.map.set(key, { value, expiresAt: Date.now() + this.ttlMs });
|
|
35
|
+
}
|
|
36
|
+
clear() {
|
|
37
|
+
this.map.clear();
|
|
38
|
+
}
|
|
39
|
+
get size() {
|
|
40
|
+
return this.map.size;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ttl-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ttl-cache.js","sourceRoot":"","sources":["../../src/utils/ttl-cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,OAAO,QAAQ;IACF,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,GAAG,GAAG,IAAI,GAAG,EAA2C,CAAC;IAE1E,YAAY,UAAmD,EAAE;QAC/D,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,GAAG,CAAC,GAAW;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAC7B,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAA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K for Google Maps consumer HTTP surfaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,13 +12,16 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"./
|
|
15
|
+
"./advanced": {
|
|
16
16
|
"import": {
|
|
17
|
-
"types": "./dist/
|
|
18
|
-
"default": "./dist/
|
|
17
|
+
"types": "./dist/advanced.d.ts",
|
|
18
|
+
"default": "./dist/advanced.js"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"googlemaps-kit": "dist/cli.js"
|
|
24
|
+
},
|
|
22
25
|
"files": [
|
|
23
26
|
"dist",
|
|
24
27
|
"LICENSE",
|
|
@@ -34,7 +37,7 @@
|
|
|
34
37
|
"dev": "tsc --watch",
|
|
35
38
|
"clean": "rm -rf dist",
|
|
36
39
|
"type-check": "tsc -p tsconfig.check.json --noEmit",
|
|
37
|
-
"prepublishOnly": "npm run
|
|
40
|
+
"prepublishOnly": "npm run clean && npm run build && npm run type-check && npm test",
|
|
38
41
|
"test": "vitest run",
|
|
39
42
|
"test:watch": "vitest",
|
|
40
43
|
"preexample": "npm run build",
|
|
@@ -54,14 +57,26 @@
|
|
|
54
57
|
},
|
|
55
58
|
"keywords": [
|
|
56
59
|
"google-maps",
|
|
57
|
-
"maps",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"places",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
60
|
+
"google-maps-api",
|
|
61
|
+
"google-maps-scraper",
|
|
62
|
+
"google-places-api",
|
|
63
|
+
"places-api-alternative",
|
|
64
|
+
"google-maps-without-api-key",
|
|
65
|
+
"unofficial-google-maps-api",
|
|
66
|
+
"free-google-maps-api",
|
|
67
|
+
"reverse-engineering-google-maps",
|
|
68
|
+
"google-maps-reviews-api",
|
|
69
|
+
"google-maps-directions",
|
|
70
|
+
"local-business-scraper",
|
|
71
|
+
"maps-scraper",
|
|
72
|
+
"places-api",
|
|
73
|
+
"geocoding",
|
|
63
74
|
"directions",
|
|
64
|
-
"
|
|
75
|
+
"reviews",
|
|
76
|
+
"typescript",
|
|
77
|
+
"nodejs",
|
|
78
|
+
"no-api-key",
|
|
79
|
+
"sdk"
|
|
65
80
|
],
|
|
66
81
|
"author": "Kumar Vandit",
|
|
67
82
|
"license": "MIT",
|
|
@@ -72,7 +87,7 @@
|
|
|
72
87
|
"bugs": {
|
|
73
88
|
"url": "https://github.com/KumarVandit/googlemaps-kit/issues"
|
|
74
89
|
},
|
|
75
|
-
"homepage": "https://
|
|
90
|
+
"homepage": "https://googlemapskit.vaandeetttt.com",
|
|
76
91
|
"devDependencies": {
|
|
77
92
|
"@types/node": "^22.0.0",
|
|
78
93
|
"tsx": "^4.21.0",
|
package/dist/internal.d.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Advanced exports: RPC builders, parsers, registries, and wire-level helpers.
|
|
3
|
-
* Prefer the public API from 'googlemaps-kit' for application code.
|
|
4
|
-
*/
|
|
5
|
-
export { GMapsClient, createGMapsClient } from './client/gmaps-client.js';
|
|
6
|
-
export type { EnrichSearchOptions } from './client/gmaps-client.js';
|
|
7
|
-
export { HttpClient } from './client/http-client.js';
|
|
8
|
-
export { AskMapsService, buildAskMapsArgs, MAPS_AI_CAPABILITIES, PLATFORM_AI_FIELD_MASKS } from './services/ask-maps.js';
|
|
9
|
-
export type { AskMapsOptions, AskMapsResult, AskMapsPlaceRef, AskMapsHistoryThread, MapsAiCapability, PlatformAiFieldMask, } from './services/ask-maps.js';
|
|
10
|
-
export { SearchService, searchResultToPlaceDetails } from './services/search.js';
|
|
11
|
-
export { PlacesService } from './services/places.js';
|
|
12
|
-
export type { GetPlaceOptions, PlacePreviewFetchResult } from './services/places.js';
|
|
13
|
-
export { ReviewsService } from './services/reviews.js';
|
|
14
|
-
export type { GetReviewsOptions } from './services/reviews.js';
|
|
15
|
-
export { RevealService } from './services/reveal.js';
|
|
16
|
-
export type { RevealPlaceOptions, RevealedPlace, RevealPlaceResult } from './types/reveal.js';
|
|
17
|
-
export { PassiveAssistService } from './services/passiveassist.js';
|
|
18
|
-
export type { MintedViewportPsi, PassiveAssistChip, PassiveAssistOptions, PassiveAssistPsiContext, PassiveAssistResult, } from './types/passiveassist.js';
|
|
19
|
-
export { LocalPostsService } from './services/local-posts.js';
|
|
20
|
-
export type { GetLocalPostsOptions } from './services/local-posts.js';
|
|
21
|
-
export { KnowledgeService } from './services/knowledge.js';
|
|
22
|
-
export type { GetKnowledgeOptions } from './services/knowledge.js';
|
|
23
|
-
export { DirectionsService } from './services/directions.js';
|
|
24
|
-
export { SuggestService } from './services/suggest.js';
|
|
25
|
-
export { PanoramaService } from './services/panorama.js';
|
|
26
|
-
export { TilesService } from './services/tiles.js';
|
|
27
|
-
export { ListsService } from './services/lists.js';
|
|
28
|
-
export { GeocodeService } from './services/geocode.js';
|
|
29
|
-
export { PhotosService } from './services/photos.js';
|
|
30
|
-
export { LinksService } from './services/links.js';
|
|
31
|
-
export { TrafficService } from './services/traffic.js';
|
|
32
|
-
export { TransitService } from './services/transit.js';
|
|
33
|
-
export type { GetStationDeparturesOptions, ListTransitLinesOptions, TransitDeparture, TransitModeBoard, TransitStationBoard } from './types/transit.js';
|
|
34
|
-
export { CategoriesService } from './services/categories.js';
|
|
35
|
-
export { UgcAggregatesService } from './services/ugc-aggregates.js';
|
|
36
|
-
export { BatchUrlService } from './services/batch-url.js';
|
|
37
|
-
export { DistanceMatrixService } from './services/distance-matrix.js';
|
|
38
|
-
export { ElevationService } from './services/elevation.js';
|
|
39
|
-
export { TimezoneService } from './services/timezone.js';
|
|
40
|
-
export { StaticMapService } from './services/static-map.js';
|
|
41
|
-
/**
|
|
42
|
-
* Shareable google.com/maps links. Named *Link to avoid colliding with the
|
|
43
|
-
* build*Url helpers below, which build internal API request URLs.
|
|
44
|
-
*/
|
|
45
|
-
export { buildPlaceUrl as buildPlaceLink, buildSearchUrl as buildSearchLink, buildDirectionsUrl as buildDirectionsLink, buildViewportUrl as buildViewportLink, buildStreetViewUrl as buildStreetViewLink, buildEmbedUrl as buildEmbedLink, travelModeToCode, travelModeFromCode, } from './rpc/maps-url-builders.js';
|
|
46
|
-
export type { StaticMapOptions, StaticMapBoundsOptions, StaticMapResult, StaticMapMarker, StaticMapPath, StaticMapMarkerStyle, StaticMapScale, } from './types/static-map.js';
|
|
47
|
-
export type { BuildPlaceUrlOptions, BuildSearchUrlOptions, BuildDirectionsUrlOptions, BuildStreetViewUrlOptions, BuildEmbedUrlOptions, BuildViewportUrlOptions, EmbedUrlResult, MapsUrlMapAction, MapsUrlLayer, } from './types/maps-urls.js';
|
|
48
|
-
export type { SearchClientFilters, SearchFilters, SearchRatingFilter, SearchPriceLevel } from './types/search-filters.js';
|
|
49
|
-
export { decodeEncodedPolyline, encodePolyline } from './utils/encoded-polyline.js';
|
|
50
|
-
export type { DistanceMatrixOptions, DistanceMatrixResult, DistanceMatrixCell, } from './types/distance-matrix.js';
|
|
51
|
-
export type { ElevationPointOptions, ElevationPointResult, ElevationPathOptions, ElevationPathResult, } from './types/elevation.js';
|
|
52
|
-
export type { TimezoneOptions, TimezoneResult } from './types/timezone.js';
|
|
53
|
-
export type { DirectionsRoute, DirectionsWaypoint, DirectionsTransitDetails, LatLngBounds, StepManeuver, DirectionsUnits, DirectionsAvoid, } from './types/directions.js';
|
|
54
|
-
export { BATCH_SERVICES, BATCH_SERVICE_RPCIDS } from './rpc/batch-services.js';
|
|
55
|
-
export { buildAreaTrafficArgs, buildPlaceUgcAggregatesArgs } from './rpc/batch-request-builders.js';
|
|
56
|
-
export type { AreaTrafficReport, GetAreaTrafficOptions } from './types/traffic.js';
|
|
57
|
-
export type { CategoryNode, CategorySuggestion, PotentialDuplicate, PlaceInfoResult, SignedPlaceUrl, } from './types/categories.js';
|
|
58
|
-
export type { PlaceUgcAggregates, GetPlaceUgcAggregatesOptions } from './types/ugc-aggregates.js';
|
|
59
|
-
export type { DecodedMapsUrl, DecodeUrlOptions } from './types/batch-url.js';
|
|
60
|
-
export { buildSuggestCameraPb, buildSuggestUrl } from './rpc/suggest-pb.js';
|
|
61
|
-
export { buildRevealPb, buildRevealUrl, normalizeRevealFtid } from './rpc/reveal-pb.js';
|
|
62
|
-
export { buildListEntityPhotosPb, buildListEntityPhotosUrl, buildPhotometaPb, buildPhotometaUrl, buildCoverageTilePb, buildCoverageTileUrl, buildThumbnailUrl, buildTileUrl, } from './rpc/panorama-pb.js';
|
|
63
|
-
export { buildMapTilePb, buildMapTileUrl, buildIconUrl, DEFAULT_MAP_TILE_VERSION, DEFAULT_POI_ICON, } from './rpc/tiles-pb.js';
|
|
64
|
-
export { buildGetListPb, buildGetListUrl } from './rpc/lists-pb.js';
|
|
65
|
-
export { buildPlacePhotosPb, buildPlacePhotosUrl } from './rpc/photos-pb.js';
|
|
66
|
-
export { buildListEntityPhotosBatchArgs } from './rpc/batch-request-builders.js';
|
|
67
|
-
export { CAPTURED_FOOD_CATEGORY_TOKEN, CLIENT_FILTERABLE_CATEGORIES, encodePhotoCategoryToken, filterPhotosByCategory, isClientFilterableCategory, PHOTO_TAB_ID_LABELS, } from './rpc/photo-category-tokens.js';
|
|
68
|
-
export { extractSuggestions } from './parsers/suggest.js';
|
|
69
|
-
export { extractRevealPlace } from './parsers/reveal.js';
|
|
70
|
-
export { extractCoveragePanoramas, extractNearbyPanoramas, extractPanoramaMetadata, isPanoramaMetadataStub, } from './parsers/panorama.js';
|
|
71
|
-
export { findPngOffset, unwrapTilePng, readPngDimensions, isPngBytes, } from './parsers/tiles.js';
|
|
72
|
-
export { extractPlaceList, detectListErrorEnvelope, parseListIdFromInput, } from './parsers/lists.js';
|
|
73
|
-
export type { SuggestOptions, Suggestion, SuggestionKind, SuggestResult, } from './types/suggest.js';
|
|
74
|
-
export type { PanoramaSearchOptions, PanoramaGetOptions, PanoramaLocationOptions, PanoramaImageOptions, PanoramaRef, PanoramaLink, PanoramaMetadata, PanoramaHistoricalCapture, } from './types/panorama.js';
|
|
75
|
-
export type { TileCoordinates, MapTileLayer, MapTileEndpoint, MapTileSize, MapTileFetchOptions, MapTileLatLngOptions, MapTileResult, MapIconFetchOptions, MapIconResult, } from './types/tiles.js';
|
|
76
|
-
export type { GetListOptions, PlaceList, PlaceListEntry } from './types/lists.js';
|
|
77
|
-
export type { GeocodeOptions, ReverseGeocodeOptions, GeocodeResult, GeocodeResponse, AddressComponent, } from './types/geocode.js';
|
|
78
|
-
export { extractPlacePhotos, extractPlacePreviewPhotos, resizePhotoUrl } from './parsers/photos.js';
|
|
79
|
-
export type { PhotoCategory, PhotosSource, PlacePhoto, PhotosListResult, ListPlacePhotosOptions, ListAllPlacePhotosOptions, PhotoCategoryCount, } from './types/photos.js';
|
|
80
|
-
export { PHOTOS_SOURCE_METADATA } from './types/photos.js';
|
|
81
|
-
export { parseMapsUrl, isShortMapsLink } from './parsers/maps-url.js';
|
|
82
|
-
export type { ParsedMapsUrl } from './types/links.js';
|
|
83
|
-
export { buildSearchPb, buildSearchUrl, buildPlaceDetailPb, buildPlaceRichPb, buildPlacePb, buildPlaceUrl, buildReviewsPb, buildReviewsUrl, buildLocalPostsPb, buildLocalPostsUrl, buildDirectionsPb, buildDirectionsUrls, buildKnowledgePbVariants, buildKnowledgeUrl, } from './rpc/pb-builders.js';
|
|
84
|
-
export type { PlacePbMode } from './rpc/pb-builders.js';
|
|
85
|
-
export { BatchExecuteClient } from './rpc/batch-execute.js';
|
|
86
|
-
export { GMapsRpcClient } from './rpc/rpc-client.js';
|
|
87
|
-
export type { GMapsRpcClientConfig } from './rpc/rpc-client.js';
|
|
88
|
-
export { MapsRuntime } from './rpc/maps-runtime.js';
|
|
89
|
-
export type { MapsJsBundleInfo, MapsRuntimeSnapshot } from './rpc/maps-runtime.js';
|
|
90
|
-
export { buildEndpointRegistry, extractClosureModuleIds, extractModuleManifest, extractPathsFromHtml, extractProtoServiceIds, parseMapsPageTokens, } from './rpc/app-options.js';
|
|
91
|
-
export { MAPS_WIZ_UI_APP, MAPS_WIZ_UI_PATH, BATCH_EXECUTE_PATH, MAPS_UI_APP, RPC_LIST_UGC_POSTS, RPC_INFRA, FEATURE_RPC, MAPS_AI_AGENT_RPC, RPC_CANDIDATES, PREVIEW, RPC_HTTP, SERVICE_GET_LOCAL_BOQ_PROXY, BOQ_PROXY_MSC, REVIEW_SORT, PROTO_SERVICE_IDS, INITIAL_MODULES, } from './rpc/rpc-methods.js';
|
|
92
|
-
export { encodeRpcId, decodeRpcId, isNxaRpcId, } from './rpc/nxa.js';
|
|
93
|
-
export { getDescriptorRegistry, getRpcMethodById, getRpcMethodByField, getFeatureService, listFeatureServices, listMapsAiAgentRpcIds, resolveSemanticSurface, describeRpcId, } from './rpc/descriptor-registry.js';
|
|
94
|
-
export type { RpcMethodDescriptor, FeatureServiceDescriptor, DescriptorRegistry } from './rpc/descriptor-registry.js';
|
|
95
|
-
export { FeatureRpcService, createFeatureRpcService } from './rpc/feature-rpc.js';
|
|
96
|
-
export type { FeatureRpcName, FeatureRpcCallOptions } from './rpc/feature-rpc.js';
|
|
97
|
-
export { buildBoqReviewsPayload, buildBoqReviewsUrl } from './rpc/boq-reviews.js';
|
|
98
|
-
export type { BoqReviewsRequest } from './rpc/boq-reviews.js';
|
|
99
|
-
export { extractBusinesses } from './parsers/search.js';
|
|
100
|
-
export { extractGeocodeResults, toGeocodeResponse } from './parsers/geocode.js';
|
|
101
|
-
export { extractPlaceDetails, extractEmbeddedReviews, extractPhotosDeep, } from './parsers/place.js';
|
|
102
|
-
export { extractOpeningSchedule, extractAttributeGroups, extractAccessibilityFeatures, extractPlaceAggregateAttributes, extractPlusCode, extractTimezone, flattenAttributeLabels, } from './parsers/place-attributes.js';
|
|
103
|
-
export { extractListUgcReviews, extractReviews } from './parsers/reviews.js';
|
|
104
|
-
export { extractBoqReviews } from './parsers/boq-reviews.js';
|
|
105
|
-
export { applyReviewClientFilters } from './parsers/review-client-filters.js';
|
|
106
|
-
export { placeAggregatesToRatingDistribution, sumRatingDistribution, } from './parsers/review-aggregates.js';
|
|
107
|
-
export { extractLocalPosts } from './parsers/local-posts.js';
|
|
108
|
-
export { extractKnowledgeEntity, extractKnowledgeFromPlaceDetails } from './parsers/knowledge.js';
|
|
109
|
-
export { extractDirections } from './parsers/directions.js';
|
|
110
|
-
export { extractSearchPagination } from './parsers/search-pagination.js';
|
|
111
|
-
export type { SearchPaginationMeta } from './parsers/search-pagination.js';
|
|
112
|
-
export { KNOWN_SURFACES, getSurfaceInfo, listSurfacesByStatus, } from './known-surfaces.js';
|
|
113
|
-
export type { KnownSurfaceName, SurfaceInfo, SurfaceStatus } from './known-surfaces.js';
|
|
114
|
-
export { asPlaceDataNode, asSearchRoot, asPreviewResponse, asBoqRoot, asListUgcRoot, } from './types/protobuf.js';
|
|
115
|
-
export type { PbNode, PlaceDataNode, MapsPreviewPlaceResponse, SearchMapResponseRoot, BoqReviewsResponseRoot, ListUgcReviewsResponseRoot, DirectionsPreviewResponse, KnowledgeEntityResponse, } from './types/protobuf.js';
|
|
116
|
-
export { parseReviewCount, parseReviewCountFromBlock, parsePriceRange, parseWebsiteFromContact, collectHourDayEntries, } from './parsers/shared.js';
|
|
117
|
-
export type { HourDayEntry, RatingBlockNode } from './parsers/shared.js';
|
|
118
|
-
export { altitudeFromZoom, zoomFromAltitude, defaultViewportDist, webMercatorTile, haversineMeters, } from './utils/geo.js';
|
|
119
|
-
export { extractAppOptionsPsi } from './rpc/app-options.js';
|
|
120
|
-
export { dedupePhotos, normalizePhotoUrl } from './utils/photo-url.js';
|
|
121
|
-
export { loadProjectEnv } from './utils/load-env.js';
|
|
122
|
-
export { parseGoogleResponse, isValidResponseBody } from './utils/response-parser.js';
|
|
123
|
-
export { isListUgcUnauthenticatedStub, isBatchAuthStub, isEmptySuccessPayload, classifyThrottleFailure, } from './utils/throttle-detection.js';
|
|
124
|
-
export { backoffWithJitter, parseRetryAfterMs } from './utils/retry-backoff.js';
|
|
125
|
-
export { RequestScheduler } from './utils/request-scheduler.js';
|
|
126
|
-
export type { HttpClientStats } from './client/http-client.js';
|
|
127
|
-
export { safeGet } from './utils/safe-get.js';
|
|
128
|
-
export { parseReviewCountLabel } from './utils/feature-id.js';
|
|
129
|
-
export { parseFeatureId, toFeatureId, placeIdToFeatureId, placeIdToFeatureParts, featureIdToPlaceId, featureIdToLudocid, featurePartsToPlaceId, } from './utils/ids.js';
|
|
130
|
-
export type { FeatureIdParts } from './utils/ids.js';
|
|
131
|
-
export { bootstrapSession, buildBrowserHeaders, clearSessionCache, randomUserAgent, cookiesToHeader, DEFAULT_SOCS, getCachedSession, } from './auth/session.js';
|
|
132
|
-
export type { CookieJarState } from './auth/session.js';
|
|
133
|
-
export { AuthService, summarizeAuthStatus } from './auth/auth-status.js';
|
|
134
|
-
export type { AuthStatusOptions } from './auth/auth-status.js';
|
|
135
|
-
export { buildGoogleAuthorization, buildAuthenticatedHeaders, } from './auth/google-auth.js';
|
|
136
|
-
export { extractMapsPageTokens } from './auth/maps-tokens.js';
|
|
137
|
-
export type { GMapsConfig, Coordinates, AuthStatus, AuthCapabilities, SearchOptions, SearchResult, SearchPageResult, SearchFieldMask, SearchTextOptions, SearchTextResult, PlaceDetails, BusinessHours, PlaceOpeningSchedule, PlaceDaySchedule, PlaceHoursInterval, PlaceAttribute, PlaceAttributeGroup, PlaceAccessibilityFeature, WeekdayIndex, WeekdayName, Review, ReviewsResult, ReviewRatingDistribution, EnrichedSearchResult, GetPlaceFullOptions, GetPlaceCompleteOptions, PlaceFullResult, PlaceCompleteResult, PlaceFullMeta, LocalPost, KnowledgeEntity, DirectionsOptions, DirectionsResult, DirectionsLeg, DirectionsStep, TravelMode, RPCCall, RPCResponse, BatchExecuteConfig, MapsPageTokens, ReviewSortOrder, MapsEndpointRegistry, } from './types/common.js';
|
|
138
|
-
export type { PlaceReviewRatingDistribution, ReviewAttribute, ReviewClientFilters, ReviewOwnerReply, ReviewPhoto, ReviewerCredibility, ReviewTranslation, } from './types/reviews.js';
|
|
139
|
-
export { ENDPOINTS, GMapsError, GMapsAuthError, GMapsNetworkError, GMapsParseError, GMapsPhotosBlockedError, GMapsThrottleError, GMapsEmptyPayloadError, GMapsCookiesExpiredError, } from './types/common.js';
|
|
140
|
-
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACzH,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,iBAAiB,E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