easy-google-places 1.1.1 → 1.2.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- # Easy Google Restaurants
1
+ # Easy Google Places
2
2
 
3
3
  A TypeScript library to query Google Places API with automatic area subdivision used to bypass result limits.
4
4
 
@@ -34,7 +34,7 @@ const location = { latitude: 48.8566, longitude: 2.3522 };
34
34
 
35
35
  await getGooglePlaces(location)
36
36
  .radius(2000) // Search within 2km radius
37
- .placesType("restaurant")
37
+ .placesTypes(["restaurant"])
38
38
  .fields(["displayName", "rating", "formattedAddress", "id"]) // Specify fields!
39
39
  .apiKey("YOUR_GOOGLE_MAPS_API_KEY")
40
40
  .showLogs()
@@ -57,7 +57,7 @@ const location = { latitude: 48.8566, longitude: 2.3522 };
57
57
 
58
58
  await getLegacyGooglePlaces(location)
59
59
  .radius(2000)
60
- .placesType("restaurant")
60
+ .placesTypes(["restaurant"])
61
61
  .apiKey("YOUR_GOOGLE_MAPS_API_KEY")
62
62
  .showLogs()
63
63
  .onFinished((places) => {
package/dist/api.d.ts CHANGED
@@ -3,10 +3,10 @@ import { Coordinate, MapsPlaceResult, PlaceResult } from "./types";
3
3
  * Fetches places using the Legacy Google Places API (Nearby Search).
4
4
  * Matches the original behavior of this library.
5
5
  */
6
- export declare function fetchLegacyPlaces(location: Coordinate, radius: number, type: string, apiKey: string, onProgress?: (count: number) => void, allowClosedStores?: boolean): Promise<MapsPlaceResult[]>;
6
+ export declare function fetchLegacyPlaces(location: Coordinate, radius: number, types: string[], apiKey: string, onProgress?: (count: number) => void, allowClosedStores?: boolean): Promise<MapsPlaceResult[]>;
7
7
  /**
8
8
  * Fetches places using the New Google Places API (v1).
9
9
  * Allows specifying fields to retrieve.
10
10
  */
11
- export declare function fetchNewPlaces(location: Coordinate, radius: number, type: string, apiKey: string, fields: string[], onProgress?: (count: number) => void, allowClosedStores?: boolean, excludedPrimaryTypes?: string[]): Promise<PlaceResult[]>;
11
+ export declare function fetchNewPlaces(location: Coordinate, radius: number, types: string[], apiKey: string, fields: string[], onProgress?: (count: number) => void, allowClosedStores?: boolean, excludedPrimaryTypes?: string[]): Promise<PlaceResult[]>;
12
12
  //# sourceMappingURL=api.d.ts.map
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACpC,iBAAiB,GAAE,OAAe,GACjC,OAAO,CAAC,eAAe,EAAE,CAAC,CA+D5B;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACpC,iBAAiB,GAAE,OAAe,EAClC,oBAAoB,GAAE,MAAM,EAAO,GAClC,OAAO,CAAC,WAAW,EAAE,CAAC,CAmExB"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACpC,iBAAiB,GAAE,OAAe,GACjC,OAAO,CAAC,eAAe,EAAE,CAAC,CAiE5B;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACpC,iBAAiB,GAAE,OAAe,EAClC,oBAAoB,GAAE,MAAM,EAAO,GAClC,OAAO,CAAC,WAAW,EAAE,CAAC,CAmExB"}
package/dist/core.d.ts CHANGED
@@ -10,7 +10,12 @@ export declare class PlaceQueryBuilder {
10
10
  private _subRadius;
11
11
  private _minRate;
12
12
  private _limitCount;
13
- private _type;
13
+ /**
14
+ * The types of places to search for.
15
+ * See [the API documentation](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)
16
+ * @example ["bar", "pub", "restaurant", "cafe"]
17
+ */
18
+ private _types;
14
19
  private _onFinished?;
15
20
  private _showLogs;
16
21
  private _showProgress;
@@ -18,7 +23,7 @@ export declare class PlaceQueryBuilder {
18
23
  private _forceQueryClosedStores;
19
24
  private _excludedPrimaryTypes;
20
25
  constructor(location: Coordinate);
21
- placesType(type: string): this;
26
+ placesTypes(types: string[]): this;
22
27
  radius(radius: number): this;
23
28
  minRate(rate: number): this;
24
29
  limit(max: number): this;
@@ -40,7 +45,12 @@ export declare class NewPlaceQueryBuilder {
40
45
  private _subRadius;
41
46
  private _minRate;
42
47
  private _limitCount;
43
- private _type;
48
+ /**
49
+ * The types of places to search for.
50
+ * See [the API documentation](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)
51
+ * @example ["bar", "pub", "restaurant", "cafe"]
52
+ */
53
+ private _types;
44
54
  private _fields;
45
55
  private _onFinished?;
46
56
  private _showLogs;
@@ -49,7 +59,7 @@ export declare class NewPlaceQueryBuilder {
49
59
  private _forceQueryClosedStores;
50
60
  private _excludedPrimaryTypes;
51
61
  constructor(location: Coordinate);
52
- placesType(type: string): this;
62
+ placesTypes(types: string[]): this;
53
63
  radius(radius: number): this;
54
64
  minRate(rate: number): this;
55
65
  limit(max: number): this;
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3F,KAAK,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC,CAAC;AAC3E,KAAK,eAAe,GAAG,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC,CAAC;AAE1E;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,UAAU,CAAe;IACjC,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,WAAW,CAAC,CAAe;IACnC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,OAAO,CAAqB;IAEpC,OAAO,CAAC,uBAAuB,CAAkB;IACjD,OAAO,CAAC,qBAAqB,CAAgB;gBAEjC,QAAQ,EAAE,UAAU;IAMzB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK9B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK5B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IA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AC,MAAM,EAAE,eAAe,GAAG,IAAI;IAKzC,QAAQ,IAAI,IAAI;IAKhB,YAAY,IAAI,IAAI;IAKpB,iBAAiB,IAAI,IAAI;IAKhC;;;;;;OAMG;IACI,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAKrC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAwEjC,OAAO,CAAC,YAAY;CAwBrB;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,UAAU,qBAEzD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,UAAU,wBAEnD"}
package/dist/index.js CHANGED
@@ -30,13 +30,15 @@ function generateSubCircles(center, radius, subRadius = 500) {
30
30
  return coordinates;
31
31
  }
32
32
  // src/api.ts
33
- async function fetchLegacyPlaces(location, radius, type, apiKey, onProgress, allowClosedStores = false) {
33
+ async function fetchLegacyPlaces(location, radius, types, apiKey, onProgress, allowClosedStores = false) {
34
34
  const allPlaces = [];
35
35
  const maxPages = 3;
36
36
  const url = new URL("https://maps.googleapis.com/maps/api/place/nearbysearch/json");
37
37
  url.searchParams.append("location", `${location.latitude},${location.longitude}`);
38
38
  url.searchParams.append("radius", radius.toString());
39
- url.searchParams.append("type", type);
39
+ for (const type of types) {
40
+ url.searchParams.append("type", type);
41
+ }
40
42
  url.searchParams.append("key", apiKey);
41
43
  let nextPageToken = undefined;
42
44
  for (let i = 0;i < maxPages; i++) {
@@ -75,7 +77,7 @@ async function fetchLegacyPlaces(location, radius, type, apiKey, onProgress, all
75
77
  }
76
78
  return allPlaces;
77
79
  }
78
- async function fetchNewPlaces(location, radius, type, apiKey, fields, onProgress, allowClosedStores = false, excludedPrimaryTypes = []) {
80
+ async function fetchNewPlaces(location, radius, types, apiKey, fields, onProgress, allowClosedStores = false, excludedPrimaryTypes = []) {
79
81
  const allPlaces = [];
80
82
  const url = "https://places.googleapis.com/v1/places:searchNearby";
81
83
  const formattedFields = fields.map((f) => f.startsWith("places.") ? f : `places.${f}`).join(",");
@@ -89,7 +91,7 @@ async function fetchNewPlaces(location, radius, type, apiKey, fields, onProgress
89
91
  radius
90
92
  }
91
93
  },
92
- includedTypes: [type],
94
+ includedTypes: types,
93
95
  maxResultCount: 20
94
96
  };
95
97
  if (excludedPrimaryTypes.length > 0) {
@@ -136,7 +138,7 @@ class PlaceQueryBuilder {
136
138
  _subRadius = 500;
137
139
  _minRate = 4.1;
138
140
  _limitCount;
139
- _type = "restaurant";
141
+ _types = [];
140
142
  _onFinished;
141
143
  _showLogs = false;
142
144
  _showProgress = false;
@@ -147,8 +149,8 @@ class PlaceQueryBuilder {
147
149
  this._location = location;
148
150
  this._apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;
149
151
  }
150
- placesType(type) {
151
- this._type = type;
152
+ placesTypes(types) {
153
+ this._types = types;
152
154
  return this;
153
155
  }
154
156
  radius(radius) {
@@ -215,7 +217,7 @@ class PlaceQueryBuilder {
215
217
  for (const circle of subCircles) {
216
218
  if (this._showLogs)
217
219
  console.log(`Querying batch ${processedBatches + 1}/${totalBatches} at ${circle.latitude}, ${circle.longitude}...`);
218
- const places = await fetchLegacyPlaces(circle, this._subRadius, this._type, this._apiKey, (count) => {}, this._forceQueryClosedStores);
220
+ const places = await fetchLegacyPlaces(circle, this._subRadius, this._types, this._apiKey, (count) => {}, this._forceQueryClosedStores);
219
221
  for (const place of places) {
220
222
  if (place.place_id) {
221
223
  allPlacesMap.set(place.place_id, place);
@@ -287,8 +289,8 @@ class NewPlaceQueryBuilder {
287
289
  _subRadius = 500;
288
290
  _minRate = 4.1;
289
291
  _limitCount;
290
- _type = "restaurant";
291
- _fields = ["name", "displayName", "id", "formattedAddress", "rating", "location", "nationalPhoneNumber", "internationalPhoneNumber", "websiteUri", "googleMapsUri", "regularOpeningHours", "reservable", "parkingOptions", "priceLevel", "businessStatus", "accessibilityOptions", "utcOffsetMinutes", "userRatingCount", "types", "primaryType", "primaryTypeDisplayName"];
292
+ _types = [];
293
+ _fields = ["name", "displayName", "id", "formattedAddress", "rating", "location", "nationalPhoneNumber", "internationalPhoneNumber", "websiteUri", "googleMapsUri", "regularOpeningHours", "reservable", "parkingOptions", "priceLevel", "businessStatus", "utcOffsetMinutes", "userRatingCount", "types", "primaryType", "primaryTypeDisplayName"];
292
294
  _onFinished;
293
295
  _showLogs = false;
294
296
  _showProgress = false;
@@ -299,8 +301,8 @@ class NewPlaceQueryBuilder {
299
301
  this._location = location;
300
302
  this._apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;
301
303
  }
302
- placesType(type) {
303
- this._type = type;
304
+ placesTypes(types) {
305
+ this._types = types;
304
306
  return this;
305
307
  }
306
308
  radius(radius) {
@@ -369,7 +371,7 @@ class NewPlaceQueryBuilder {
369
371
  for (const circle of subCircles) {
370
372
  if (this._showLogs)
371
373
  console.log(`Querying batch ${processedBatches + 1}/${totalBatches}...`);
372
- const places = await fetchNewPlaces(circle, this._subRadius, this._type, this._apiKey, this._fields, (count) => {}, this._forceQueryClosedStores, this._excludedPrimaryTypes);
374
+ const places = await fetchNewPlaces(circle, this._subRadius, this._types, this._apiKey, this._fields, (count) => {}, this._forceQueryClosedStores, this._excludedPrimaryTypes);
373
375
  for (const place of places) {
374
376
  if (place.id) {
375
377
  allPlacesMap.set(place.id, place);
@@ -438,4 +440,4 @@ export {
438
440
  NewPlaceQueryBuilder
439
441
  };
440
442
 
441
- //# debugId=46C505C9C3EFEA1464756E2164756E21
443
+ //# debugId=76E2A899F11EDB4F64756E2164756E21
package/dist/index.js.map CHANGED
@@ -3,10 +3,10 @@
3
3
  "sources": ["../src/geometry.ts", "../src/api.ts", "../src/core.ts"],
4
4
  "sourcesContent": [
5
5
  "import { Coordinate } from \"./types\";\n\n\n/**\n * Generates a list of coordinates for sub-circles that cover a larger circle.\n * Uses a hexagonal packing strategy to ensure coverage.\n * \n * @param center The center of the main search area.\n * @param radius The radius of the main search area in meters.\n * @param subRadius The radius of each sub-circle in meters (default 500m).\n * @returns Array of coordinates for the centers of the sub-circles.\n */\nexport function generateSubCircles(\n center: Coordinate,\n radius: number,\n subRadius: number = 500\n): Coordinate[] {\n // If the main radius is smaller than the subRadius, just return the center.\n if (radius <= subRadius) {\n return [center];\n }\n\n const coordinates: Coordinate[] = [];\n \n // Earth's radius in meters\n const R = 6371000;\n \n // Convert latitude to radians to calculate longitude offsets correctly\n const latRad = (center.latitude * Math.PI) / 180;\n \n // Distance between centers of hexagonally packed circles to ensure coverage.\n // Ideally, for r=subRadius, the distance should be approx r * sqrt(3) for tight packing without gaps,\n // but to be safe and ensure overlap (so we don't miss spots), we can use a slightly tighter spacing.\n // Using subRadius * 1.5 is a reasonable approximation for coverage with overlap.\n const step = subRadius * 1.5; \n\n // Simple grid or spiral generation could work, but let's do a bounding box scan\n // We scan a square area around the center and keep points within the radius.\n \n // Degrees per meter (approximate)\n const latDegPerMeter = 1 / 111320; \n const lonDegPerMeter = 1 / (111320 * Math.cos(latRad));\n\n const latStep = step * latDegPerMeter;\n const lonStep = step * lonDegPerMeter;\n\n // Calculate bounds\n const numSteps = Math.ceil(radius / step);\n \n for (let i = -numSteps; i <= numSteps; i++) {\n for (let j = -numSteps; j <= numSteps; j++) {\n // Offset based on hexagonal-like grid (shift every other row)\n const xOffset = j * lonStep + (i % 2 === 0 ? 0 : lonStep / 2);\n const yOffset = i * latStep * (Math.sqrt(3) / 2); // Hexagonal height factor\n\n // Calculate distance from center in meters (approx)\n const distX = xOffset / lonDegPerMeter;\n const distY = yOffset / latDegPerMeter;\n const distance = Math.sqrt(distX * distX + distY * distY);\n\n // We include the circle if its center is within (ParentRadius + epsilon) \n // or if it covers any part of the parent circle. \n // Being generous: if distance - subRadius < radius\n if (distance - subRadius < radius) {\n coordinates.push({\n latitude: center.latitude + yOffset,\n longitude: center.longitude + xOffset\n });\n }\n }\n }\n\n return coordinates;\n}\n",
6
- "import { Coordinate, MapsPlaceResult, PlaceResult } from \"./types\";\n\n/**\n * Fetches places using the Legacy Google Places API (Nearby Search).\n * Matches the original behavior of this library.\n */\nexport async function fetchLegacyPlaces(\n location: Coordinate,\n radius: number,\n type: string,\n apiKey: string,\n onProgress?: (count: number) => void,\n allowClosedStores: boolean = false\n): Promise<MapsPlaceResult[]> {\n const allPlaces: MapsPlaceResult[] = [];\n const maxPages = 3;\n \n const url = new URL(\n \"https://maps.googleapis.com/maps/api/place/nearbysearch/json\"\n );\n url.searchParams.append(\"location\", `${location.latitude},${location.longitude}`);\n url.searchParams.append(\"radius\", radius.toString());\n url.searchParams.append(\"type\", type);\n // Important: Google Places API does not support explicit pagination by page number,\n // only by next_page_token.\n url.searchParams.append(\"key\", apiKey);\n\n let nextPageToken: string | undefined = undefined;\n\n for (let i = 0; i < maxPages; i++) {\n if (i > 0 && !nextPageToken) {\n break;\n }\n\n const currentUrl = new URL(url.toString());\n if (nextPageToken) {\n currentUrl.searchParams.append(\"pagetoken\", nextPageToken);\n // Determine if we need to wait.\n // Google requires a short delay before the next_page_token becomes valid.\n await new Promise((resolve) => setTimeout(resolve, 2000));\n }\n\n try {\n const response = await fetch(currentUrl.toString());\n const data = await response.json();\n\n if (data.status !== \"OK\" && data.status !== \"ZERO_RESULTS\") {\n console.error(\"Google Places API error:\", data.status, data.error_message);\n break;\n }\n\n if (data.results) {\n let activePlaces: MapsPlaceResult[] = [];\n if (!allowClosedStores) {\n activePlaces = (data.results as MapsPlaceResult[]).filter(\n (place) => place.business_status !== \"CLOSED_TEMPORARILY\"\n );\n } else {\n activePlaces = data.results as MapsPlaceResult[];\n }\n \n allPlaces.push(...activePlaces);\n\n if (onProgress) {\n onProgress(activePlaces.length);\n }\n }\n\n nextPageToken = data.next_page_token;\n } catch (error) {\n console.error(\"Network error fetching places:\", error);\n break;\n }\n }\n\n return allPlaces;\n}\n\n/**\n * Fetches places using the New Google Places API (v1).\n * Allows specifying fields to retrieve.\n */\nexport async function fetchNewPlaces(\n location: Coordinate,\n radius: number,\n type: string,\n apiKey: string,\n fields: string[],\n onProgress?: (count: number) => void,\n allowClosedStores: boolean = false,\n excludedPrimaryTypes: string[] = []\n): Promise<PlaceResult[]> {\n const allPlaces: PlaceResult[] = [];\n \n const url = \"https://places.googleapis.com/v1/places:searchNearby\";\n\n // Ensure fields are properly formatted (prefixed with 'places.')\n const formattedFields = fields.map(f => f.startsWith(\"places.\") ? f : `places.${f}`).join(\",\");\n \n // Implementation for single call:\n const requestBody: any = {\n locationRestriction: {\n circle: {\n center: {\n latitude: location.latitude,\n longitude: location.longitude,\n },\n radius: radius,\n },\n },\n includedTypes: [type],\n maxResultCount: 20\n };\n\n if (excludedPrimaryTypes.length > 0) {\n requestBody.excludedPrimaryTypes = excludedPrimaryTypes;\n }\n\n try {\n const response = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Goog-Api-Key\": apiKey,\n \"X-Goog-FieldMask\": formattedFields,\n },\n body: JSON.stringify(requestBody),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n console.error(\"Google Places API error:\", data.error?.message || data.error || data);\n return [];\n }\n\n if (data.places) {\n let activePlaces: PlaceResult[] = [];\n // Filter closed stores if needed.\n if (!allowClosedStores) {\n activePlaces = (data.places as PlaceResult[]).filter(\n (place) => place.businessStatus !== \"CLOSED_TEMPORARILY\" && place.businessStatus !== \"CLOSED_PERMANENTLY\"\n );\n } else {\n activePlaces = data.places as PlaceResult[];\n }\n\n allPlaces.push(...activePlaces);\n\n if (onProgress) {\n onProgress(activePlaces.length);\n }\n }\n } catch (error) {\n console.error(\"Network error fetching places:\", error);\n }\n \n return allPlaces;\n}\n",
7
- "import { generateSubCircles } from \"./geometry\";\nimport { fetchLegacyPlaces, fetchNewPlaces } from \"./api\";\nimport { writeFileSync } from \"fs\";\nimport { Coordinate, MapsPlaceResult, NearbySearchAttributes, PlaceResult } from \"./types\";\n\ntype OutputFormat = \"csv\" | \"json\" | ((places: MapsPlaceResult[]) => void);\ntype NewOutputFormat = \"csv\" | \"json\" | ((places: PlaceResult[]) => void);\n\n/**\n * Legacy Query Builder using the original Maps API (Nearby Search).\n */\nexport class PlaceQueryBuilder {\n private _location: Coordinate;\n private _radius: number = 4000; // Default 4km\n private _subRadius: number = 500; // Default 500m\n private _minRate: number = 4.1;\n private _limitCount: number | undefined;\n private _type: string = \"restaurant\";\n private _onFinished?: OutputFormat;\n private _showLogs: boolean = false;\n private _showProgress: boolean = false;\n private _apiKey: string | undefined;\n\n private _forceQueryClosedStores: boolean = false;\n private _excludedPrimaryTypes: string[] = [];\n\n constructor(location: Coordinate) {\n this._location = location;\n // Try to load API Key from env if available (Bun loads .env automatically)\n this._apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;\n }\n\n public placesType(type: string): this {\n this._type = type;\n return this;\n }\n\n public radius(radius: number): this {\n this._radius = radius;\n return this;\n }\n\n public minRate(rate: number): this {\n this._minRate = rate;\n return this;\n }\n\n public limit(max: number): this {\n this._limitCount = max;\n return this;\n }\n\n public apiKey(key: string): this {\n this._apiKey = key;\n return this;\n }\n\n public onFinished(format: OutputFormat): this {\n this._onFinished = format;\n return this;\n }\n\n public showLogs(): this {\n this._showLogs = true;\n return this;\n }\n\n public showProgress(): this {\n this._showProgress = true;\n return this;\n }\n\n public allowClosedStores(): this {\n this._forceQueryClosedStores = true;\n return this;\n }\n\n public excludedPrimaryTypes(types: string[]): this {\n this._excludedPrimaryTypes = types;\n return this;\n }\n\n public async run(): Promise<void> {\n if (!this._apiKey) {\n throw new Error(\"API Key is required. Set it via .apiKey() or NEXT_PUBLIC_GOOGLE_MAPS_API_KEY env var.\");\n }\n if (!this._onFinished) {\n throw new Error(\"onFinished callback or format is required.\");\n }\n\n if (this._showLogs) console.log(\"Starting Google Places (Legacy) query...\");\n\n // 1. Generate sub-circles\n let subCircles = generateSubCircles(this._location, this._radius, this._subRadius);\n \n // Optimization: If limit is set, reduce the number of batches\n if (this._limitCount) {\n const maxBatches = Math.ceil(this._limitCount / 60);\n if (subCircles.length > maxBatches) {\n // Shuffle array to get random circles\n for (let i = subCircles.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [subCircles[i], subCircles[j]] = [subCircles[j], subCircles[i]];\n }\n // Slice to the max needed matches\n subCircles = subCircles.slice(0, maxBatches);\n if (this._showLogs) console.log(`Optimization: Limiting to ${maxBatches} batches based on limit of ${this._limitCount}`);\n }\n }\n\n const totalBatches = subCircles.length;\n const allPlacesMap = new Map<string, MapsPlaceResult>();\n let processedBatches = 0;\n \n for (const circle of subCircles) {\n if (this._showLogs) console.log(`Querying batch ${processedBatches + 1}/${totalBatches} at ${circle.latitude}, ${circle.longitude}...`);\n \n const places = await fetchLegacyPlaces(\n circle, \n this._subRadius, \n this._type, \n this._apiKey,\n (count) => {},\n this._forceQueryClosedStores\n );\n\n for (const place of places) {\n if (place.place_id) {\n allPlacesMap.set(place.place_id, place);\n }\n }\n\n processedBatches++;\n \n if (this._showProgress) {\n const percentage = ((processedBatches / totalBatches) * 100).toFixed(1);\n console.log(`Progress: ${percentage}% (${processedBatches}/${totalBatches} batches)`);\n }\n\n await new Promise(r => setTimeout(r, 200)); \n if(processedBatches % 20 === 0) {\n await new Promise(r => setTimeout(r, 2000));\n }\n }\n\n let uniquePlaces = Array.from(allPlacesMap.values());\n \n // Filter by minRate\n uniquePlaces = uniquePlaces.filter(p => (p.rating || 0) >= this._minRate);\n\n // Filter by excludedPrimaryTypes (Client-side for Legacy API)\n if (this._excludedPrimaryTypes.length > 0) {\n uniquePlaces = uniquePlaces.filter(p => {\n if (!p.types) return true;\n // If any of the place's types are in the excluded list, filter it out.\n // Legacy API types are an array of strings.\n return !p.types.some(t => this._excludedPrimaryTypes.includes(t));\n });\n if (this._showLogs) console.log(`Filtered out places based on excluded types: ${this._excludedPrimaryTypes.join(\", \")}`);\n }\n\n // Apply limit\n if (this._limitCount && uniquePlaces.length > this._limitCount) {\n uniquePlaces = uniquePlaces.slice(0, this._limitCount);\n }\n if (this._showLogs) console.log(`Finished! Found ${uniquePlaces.length} unique places.`);\n\n this.handleOutput(uniquePlaces);\n }\n\n private handleOutput(places: MapsPlaceResult[]) {\n if (typeof this._onFinished === \"function\") {\n this._onFinished(places);\n } else if (this._onFinished === \"json\") {\n const jsonContent = JSON.stringify(places, null, 2);\n writeFileSync(\"maps_places_output.json\", jsonContent);\n if (this._showLogs) console.log(\"Saved results to maps_places_output.json\");\n } else if (this._onFinished === \"csv\") {\n const headers = [\"name\", \"address\", \"rating\", \"user_ratings_total\", \"place_id\", \"lat\", \"lng\"];\n const csvContent = [\n headers.join(\",\"),\n ...places.map(p => {\n return [\n `\"${(p.name || \"\").replace(/\"/g, '\"\"')}\"`,\n `\"${(p.formatted_address || \"\").replace(/\"/g, '\"\"')}\"`,\n p.rating || \"\",\n p.user_ratings_total || \"\",\n p.place_id,\n p.geometry?.location?.lat || \"\",\n p.geometry?.location?.lng || \"\"\n ].join(\",\")\n })\n ].join(\"\\n\");\n writeFileSync(\"maps_places_output.csv\", csvContent);\n if (this._showLogs) console.log(\"Saved results to maps_places_output.csv\");\n }\n }\n}\n\n/**\n * New Places API Query Builder (v1).\n */\nexport class NewPlaceQueryBuilder {\n private _location: Coordinate;\n private _radius: number = 4000;\n private _subRadius: number = 500; \n private _minRate: number = 4.1;\n private _limitCount: number | undefined;\n private _type: string = \"restaurant\";\n private _fields: NearbySearchAttributes[] = [\"name\", \"displayName\", \"id\", \"formattedAddress\", \"rating\", \"location\", \"nationalPhoneNumber\", \"internationalPhoneNumber\", \"websiteUri\", \"googleMapsUri\", \"regularOpeningHours\", \"reservable\", \"parkingOptions\", \"priceLevel\", \"businessStatus\", \"accessibilityOptions\", \"utcOffsetMinutes\", \"userRatingCount\", \"types\", \"primaryType\", \"primaryTypeDisplayName\"]; // Defaults\n private _onFinished?: NewOutputFormat;\n private _showLogs: boolean = false;\n private _showProgress: boolean = false;\n private _apiKey: string | undefined;\n\n private _forceQueryClosedStores: boolean = false;\n private _excludedPrimaryTypes: string[] = [];\n\n constructor(location: Coordinate) {\n this._location = location;\n this._apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;\n }\n\n public placesType(type: string): this {\n this._type = type;\n return this;\n }\n\n public radius(radius: number): this {\n this._radius = radius;\n return this;\n }\n\n public minRate(rate: number): this {\n this._minRate = rate;\n return this;\n }\n\n public limit(max: number): this {\n this._limitCount = max;\n return this;\n }\n\n public apiKey(key: string): this {\n this._apiKey = key;\n return this;\n }\n\n /**\n * Specifies fields to return from the New Places API.\n * e.g. [\"displayName\", \"rating\", \"formattedAddress\"]\n */\n public fields(fields: NearbySearchAttributes[]): this {\n this._fields = [...this._fields, ...fields];\n return this;\n }\n\n public onFinished(format: NewOutputFormat): this {\n this._onFinished = format;\n return this;\n }\n\n public showLogs(): this {\n this._showLogs = true;\n return this;\n }\n\n public showProgress(): this {\n this._showProgress = true;\n return this;\n }\n\n public allowClosedStores(): this {\n this._forceQueryClosedStores = true;\n return this;\n }\n\n /**\n * Some of the types includes `chinese_restaurant`, `japanese_restaurant`, `italian_restaurant`, etc.\n * \n * You can see the types [here](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)\n * @param types \n * @returns \n */\n public excludedPrimaryTypes(types: string[]): this {\n this._excludedPrimaryTypes = types;\n return this;\n }\n\n public async run(): Promise<void> {\n if (!this._apiKey) {\n throw new Error(\"API Key is required.\");\n }\n if (!this._onFinished) {\n throw new Error(\"onFinished callback or format is required.\");\n }\n\n if (this._showLogs) console.log(\"Starting Google Places (New) query...\");\n\n let subCircles = generateSubCircles(this._location, this._radius, this._subRadius);\n \n // Same optimization logic\n if (this._limitCount) {\n const maxBatches = Math.ceil(this._limitCount / 20); // Note: New API limit is 20 per call\n if (subCircles.length > maxBatches) {\n for (let i = subCircles.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [subCircles[i], subCircles[j]] = [subCircles[j], subCircles[i]];\n }\n subCircles = subCircles.slice(0, maxBatches);\n }\n }\n\n const totalBatches = subCircles.length;\n const allPlacesMap = new Map<string, PlaceResult>();\n let processedBatches = 0;\n \n for (const circle of subCircles) {\n if (this._showLogs) console.log(`Querying batch ${processedBatches + 1}/${totalBatches}...`);\n \n const places = await fetchNewPlaces(\n circle, \n this._subRadius, \n this._type, \n this._apiKey,\n this._fields,\n (count) => {},\n this._forceQueryClosedStores,\n this._excludedPrimaryTypes\n );\n\n for (const place of places) {\n if (place.id) {\n allPlacesMap.set(place.id, place);\n }\n }\n\n processedBatches++;\n \n if (this._showProgress) {\n const percentage = ((processedBatches / totalBatches) * 100).toFixed(1);\n console.log(`Progress: ${percentage}%`);\n }\n\n await new Promise(r => setTimeout(r, 200)); \n if(processedBatches % 20 === 0) {\n await new Promise(r => setTimeout(r, 2000));\n }\n }\n\n let uniquePlaces = Array.from(allPlacesMap.values());\n uniquePlaces = uniquePlaces.filter(p => (p.rating || 0) >= this._minRate);\n\n if (this._limitCount && uniquePlaces.length > this._limitCount) {\n uniquePlaces = uniquePlaces.slice(0, this._limitCount);\n }\n if (this._showLogs) console.log(`Finished! Found ${uniquePlaces.length} unique places.`);\n\n this.handleOutput(uniquePlaces);\n }\n\n private handleOutput(places: PlaceResult[]) {\n if (typeof this._onFinished === \"function\") {\n this._onFinished(places);\n } else if (this._onFinished === \"json\") {\n const jsonContent = JSON.stringify(places, null, 2);\n writeFileSync(\"places_output.json\", jsonContent);\n if (this._showLogs) console.log(\"Saved results to places_output.json\");\n } else if (this._onFinished === \"csv\") {\n const headers = [\"id\", \"rating\", \"formattedAddress\", \"displayName\"];\n const csvContent = [\n headers.join(\",\"),\n ...places.map(p => {\n return [\n p.id,\n p.rating || \"\",\n `\"${(p.formattedAddress || \"\").replace(/\"/g, '\"\"')}\"`,\n `\"${(p.displayName?.text || p.name || \"\").replace(/\"/g, '\"\"')}\"`\n ].join(\",\")\n })\n ].join(\"\\n\");\n writeFileSync(\"places_output.csv\", csvContent);\n if (this._showLogs) console.log(\"Saved results to places_output.csv\");\n }\n }\n}\n\nexport function getLegacyGooglePlaces(location: Coordinate) {\n return new PlaceQueryBuilder(location);\n}\n\nexport function getGooglePlaces(location: Coordinate) {\n return new NewPlaceQueryBuilder(location);\n}\n"
6
+ "import { Coordinate, MapsPlaceResult, PlaceResult } from \"./types\";\n\n/**\n * Fetches places using the Legacy Google Places API (Nearby Search).\n * Matches the original behavior of this library.\n */\nexport async function fetchLegacyPlaces(\n location: Coordinate,\n radius: number,\n types: string[],\n apiKey: string,\n onProgress?: (count: number) => void,\n allowClosedStores: boolean = false\n): Promise<MapsPlaceResult[]> {\n const allPlaces: MapsPlaceResult[] = [];\n const maxPages = 3;\n \n const url = new URL(\n \"https://maps.googleapis.com/maps/api/place/nearbysearch/json\"\n );\n url.searchParams.append(\"location\", `${location.latitude},${location.longitude}`);\n url.searchParams.append(\"radius\", radius.toString());\n for (const type of types) {\n url.searchParams.append(\"type\", type);\n }\n // Important: Google Places API does not support explicit pagination by page number,\n // only by next_page_token.\n url.searchParams.append(\"key\", apiKey);\n\n let nextPageToken: string | undefined = undefined;\n\n for (let i = 0; i < maxPages; i++) {\n if (i > 0 && !nextPageToken) {\n break;\n }\n\n const currentUrl = new URL(url.toString());\n if (nextPageToken) {\n currentUrl.searchParams.append(\"pagetoken\", nextPageToken);\n // Determine if we need to wait.\n // Google requires a short delay before the next_page_token becomes valid.\n await new Promise((resolve) => setTimeout(resolve, 2000));\n }\n\n try {\n const response = await fetch(currentUrl.toString());\n const data = await response.json();\n\n if (data.status !== \"OK\" && data.status !== \"ZERO_RESULTS\") {\n console.error(\"Google Places API error:\", data.status, data.error_message);\n break;\n }\n\n if (data.results) {\n let activePlaces: MapsPlaceResult[] = [];\n if (!allowClosedStores) {\n activePlaces = (data.results as MapsPlaceResult[]).filter(\n (place) => place.business_status !== \"CLOSED_TEMPORARILY\"\n );\n } else {\n activePlaces = data.results as MapsPlaceResult[];\n }\n \n allPlaces.push(...activePlaces);\n\n if (onProgress) {\n onProgress(activePlaces.length);\n }\n }\n\n nextPageToken = data.next_page_token;\n } catch (error) {\n console.error(\"Network error fetching places:\", error);\n break;\n }\n }\n\n return allPlaces;\n}\n\n/**\n * Fetches places using the New Google Places API (v1).\n * Allows specifying fields to retrieve.\n */\nexport async function fetchNewPlaces(\n location: Coordinate,\n radius: number,\n types: string[],\n apiKey: string,\n fields: string[],\n onProgress?: (count: number) => void,\n allowClosedStores: boolean = false,\n excludedPrimaryTypes: string[] = []\n): Promise<PlaceResult[]> {\n const allPlaces: PlaceResult[] = [];\n \n const url = \"https://places.googleapis.com/v1/places:searchNearby\";\n\n // Ensure fields are properly formatted (prefixed with 'places.')\n const formattedFields = fields.map(f => f.startsWith(\"places.\") ? f : `places.${f}`).join(\",\");\n \n // Implementation for single call:\n const requestBody: any = {\n locationRestriction: {\n circle: {\n center: {\n latitude: location.latitude,\n longitude: location.longitude,\n },\n radius: radius,\n },\n },\n includedTypes: types,\n maxResultCount: 20\n };\n\n if (excludedPrimaryTypes.length > 0) {\n requestBody.excludedPrimaryTypes = excludedPrimaryTypes;\n }\n\n try {\n const response = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Goog-Api-Key\": apiKey,\n \"X-Goog-FieldMask\": formattedFields,\n },\n body: JSON.stringify(requestBody),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n console.error(\"Google Places API error:\", data.error?.message || data.error || data);\n return [];\n }\n\n if (data.places) {\n let activePlaces: PlaceResult[] = [];\n // Filter closed stores if needed.\n if (!allowClosedStores) {\n activePlaces = (data.places as PlaceResult[]).filter(\n (place) => place.businessStatus !== \"CLOSED_TEMPORARILY\" && place.businessStatus !== \"CLOSED_PERMANENTLY\"\n );\n } else {\n activePlaces = data.places as PlaceResult[];\n }\n\n allPlaces.push(...activePlaces);\n\n if (onProgress) {\n onProgress(activePlaces.length);\n }\n }\n } catch (error) {\n console.error(\"Network error fetching places:\", error);\n }\n \n return allPlaces;\n}\n",
7
+ "import { generateSubCircles } from \"./geometry\";\nimport { fetchLegacyPlaces, fetchNewPlaces } from \"./api\";\nimport { writeFileSync } from \"fs\";\nimport { Coordinate, MapsPlaceResult, NearbySearchAttributes, PlaceResult } from \"./types\";\n\ntype OutputFormat = \"csv\" | \"json\" | ((places: MapsPlaceResult[]) => void);\ntype NewOutputFormat = \"csv\" | \"json\" | ((places: PlaceResult[]) => void);\n\n/**\n * Legacy Query Builder using the original Maps API (Nearby Search).\n */\nexport class PlaceQueryBuilder {\n private _location: Coordinate;\n private _radius: number = 4000; // Default 4km\n private _subRadius: number = 500; // Default 500m\n private _minRate: number = 4.1;\n private _limitCount: number | undefined;\n /**\n * The types of places to search for.\n * See [the API documentation](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)\n * @example [\"bar\", \"pub\", \"restaurant\", \"cafe\"]\n */\n private _types: string[] = [];\n private _onFinished?: OutputFormat;\n private _showLogs: boolean = false;\n private _showProgress: boolean = false;\n private _apiKey: string | undefined;\n\n private _forceQueryClosedStores: boolean = false;\n private _excludedPrimaryTypes: string[] = [];\n\n constructor(location: Coordinate) {\n this._location = location;\n // Try to load API Key from env if available (Bun loads .env automatically)\n this._apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;\n }\n\n public placesTypes(types: string[]): this {\n this._types = types;\n return this;\n }\n\n public radius(radius: number): this {\n this._radius = radius;\n return this;\n }\n\n public minRate(rate: number): this {\n this._minRate = rate;\n return this;\n }\n\n public limit(max: number): this {\n this._limitCount = max;\n return this;\n }\n\n public apiKey(key: string): this {\n this._apiKey = key;\n return this;\n }\n\n public onFinished(format: OutputFormat): this {\n this._onFinished = format;\n return this;\n }\n\n public showLogs(): this {\n this._showLogs = true;\n return this;\n }\n\n public showProgress(): this {\n this._showProgress = true;\n return this;\n }\n\n public allowClosedStores(): this {\n this._forceQueryClosedStores = true;\n return this;\n }\n\n public excludedPrimaryTypes(types: string[]): this {\n this._excludedPrimaryTypes = types;\n return this;\n }\n\n public async run(): Promise<void> {\n if (!this._apiKey) {\n throw new Error(\"API Key is required. Set it via .apiKey() or NEXT_PUBLIC_GOOGLE_MAPS_API_KEY env var.\");\n }\n if (!this._onFinished) {\n throw new Error(\"onFinished callback or format is required.\");\n }\n\n if (this._showLogs) console.log(\"Starting Google Places (Legacy) query...\");\n\n // 1. Generate sub-circles\n let subCircles = generateSubCircles(this._location, this._radius, this._subRadius);\n \n // Optimization: If limit is set, reduce the number of batches\n if (this._limitCount) {\n const maxBatches = Math.ceil(this._limitCount / 60);\n if (subCircles.length > maxBatches) {\n // Shuffle array to get random circles\n for (let i = subCircles.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [subCircles[i], subCircles[j]] = [subCircles[j], subCircles[i]];\n }\n // Slice to the max needed matches\n subCircles = subCircles.slice(0, maxBatches);\n if (this._showLogs) console.log(`Optimization: Limiting to ${maxBatches} batches based on limit of ${this._limitCount}`);\n }\n }\n\n const totalBatches = subCircles.length;\n const allPlacesMap = new Map<string, MapsPlaceResult>();\n let processedBatches = 0;\n \n for (const circle of subCircles) {\n if (this._showLogs) console.log(`Querying batch ${processedBatches + 1}/${totalBatches} at ${circle.latitude}, ${circle.longitude}...`);\n \n const places = await fetchLegacyPlaces(\n circle, \n this._subRadius, \n this._types, \n this._apiKey,\n (count) => {},\n this._forceQueryClosedStores\n );\n\n for (const place of places) {\n if (place.place_id) {\n allPlacesMap.set(place.place_id, place);\n }\n }\n\n processedBatches++;\n \n if (this._showProgress) {\n const percentage = ((processedBatches / totalBatches) * 100).toFixed(1);\n console.log(`Progress: ${percentage}% (${processedBatches}/${totalBatches} batches)`);\n }\n\n await new Promise(r => setTimeout(r, 200)); \n if(processedBatches % 20 === 0) {\n await new Promise(r => setTimeout(r, 2000));\n }\n }\n\n let uniquePlaces = Array.from(allPlacesMap.values());\n \n // Filter by minRate\n uniquePlaces = uniquePlaces.filter(p => (p.rating || 0) >= this._minRate);\n\n // Filter by excludedPrimaryTypes (Client-side for Legacy API)\n if (this._excludedPrimaryTypes.length > 0) {\n uniquePlaces = uniquePlaces.filter(p => {\n if (!p.types) return true;\n // If any of the place's types are in the excluded list, filter it out.\n // Legacy API types are an array of strings.\n return !p.types.some(t => this._excludedPrimaryTypes.includes(t));\n });\n if (this._showLogs) console.log(`Filtered out places based on excluded types: ${this._excludedPrimaryTypes.join(\", \")}`);\n }\n\n // Apply limit\n if (this._limitCount && uniquePlaces.length > this._limitCount) {\n uniquePlaces = uniquePlaces.slice(0, this._limitCount);\n }\n if (this._showLogs) console.log(`Finished! Found ${uniquePlaces.length} unique places.`);\n\n this.handleOutput(uniquePlaces);\n }\n\n private handleOutput(places: MapsPlaceResult[]) {\n if (typeof this._onFinished === \"function\") {\n this._onFinished(places);\n } else if (this._onFinished === \"json\") {\n const jsonContent = JSON.stringify(places, null, 2);\n writeFileSync(\"maps_places_output.json\", jsonContent);\n if (this._showLogs) console.log(\"Saved results to maps_places_output.json\");\n } else if (this._onFinished === \"csv\") {\n const headers = [\"name\", \"address\", \"rating\", \"user_ratings_total\", \"place_id\", \"lat\", \"lng\"];\n const csvContent = [\n headers.join(\",\"),\n ...places.map(p => {\n return [\n `\"${(p.name || \"\").replace(/\"/g, '\"\"')}\"`,\n `\"${(p.formatted_address || \"\").replace(/\"/g, '\"\"')}\"`,\n p.rating || \"\",\n p.user_ratings_total || \"\",\n p.place_id,\n p.geometry?.location?.lat || \"\",\n p.geometry?.location?.lng || \"\"\n ].join(\",\")\n })\n ].join(\"\\n\");\n writeFileSync(\"maps_places_output.csv\", csvContent);\n if (this._showLogs) console.log(\"Saved results to maps_places_output.csv\");\n }\n }\n}\n\n/**\n * New Places API Query Builder (v1).\n */\nexport class NewPlaceQueryBuilder {\n private _location: Coordinate;\n private _radius: number = 4000;\n private _subRadius: number = 500; \n private _minRate: number = 4.1;\n private _limitCount: number | undefined;\n /**\n * The types of places to search for.\n * See [the API documentation](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)\n * @example [\"bar\", \"pub\", \"restaurant\", \"cafe\"]\n */\n private _types: string[] = [];\n private _fields: NearbySearchAttributes[] = [\"name\", \"displayName\", \"id\", \"formattedAddress\", \"rating\", \"location\", \"nationalPhoneNumber\", \"internationalPhoneNumber\", \"websiteUri\", \"googleMapsUri\", \"regularOpeningHours\", \"reservable\", \"parkingOptions\", \"priceLevel\", \"businessStatus\", \"utcOffsetMinutes\", \"userRatingCount\", \"types\", \"primaryType\", \"primaryTypeDisplayName\"]; // Defaults\n private _onFinished?: NewOutputFormat;\n private _showLogs: boolean = false;\n private _showProgress: boolean = false;\n private _apiKey: string | undefined;\n\n private _forceQueryClosedStores: boolean = false;\n private _excludedPrimaryTypes: string[] = [];\n\n constructor(location: Coordinate) {\n this._location = location;\n this._apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;\n }\n\n public placesTypes(types: string[]): this {\n this._types = types;\n return this;\n }\n\n public radius(radius: number): this {\n this._radius = radius;\n return this;\n }\n\n public minRate(rate: number): this {\n this._minRate = rate;\n return this;\n }\n\n public limit(max: number): this {\n this._limitCount = max;\n return this;\n }\n\n public apiKey(key: string): this {\n this._apiKey = key;\n return this;\n }\n\n /**\n * Specifies fields to return from the New Places API.\n * e.g. [\"displayName\", \"rating\", \"formattedAddress\"]\n */\n public fields(fields: NearbySearchAttributes[]): this {\n this._fields = [...this._fields, ...fields];\n return this;\n }\n\n public onFinished(format: NewOutputFormat): this {\n this._onFinished = format;\n return this;\n }\n\n public showLogs(): this {\n this._showLogs = true;\n return this;\n }\n\n public showProgress(): this {\n this._showProgress = true;\n return this;\n }\n\n public allowClosedStores(): this {\n this._forceQueryClosedStores = true;\n return this;\n }\n\n /**\n * Some of the types includes `chinese_restaurant`, `japanese_restaurant`, `italian_restaurant`, etc.\n * \n * You can see the types [here](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)\n * @param types \n * @returns \n */\n public excludedPrimaryTypes(types: string[]): this {\n this._excludedPrimaryTypes = types;\n return this;\n }\n\n public async run(): Promise<void> {\n if (!this._apiKey) {\n throw new Error(\"API Key is required.\");\n }\n if (!this._onFinished) {\n throw new Error(\"onFinished callback or format is required.\");\n }\n\n if (this._showLogs) console.log(\"Starting Google Places (New) query...\");\n\n let subCircles = generateSubCircles(this._location, this._radius, this._subRadius);\n \n // Same optimization logic\n if (this._limitCount) {\n const maxBatches = Math.ceil(this._limitCount / 20); // Note: New API limit is 20 per call\n if (subCircles.length > maxBatches) {\n for (let i = subCircles.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [subCircles[i], subCircles[j]] = [subCircles[j], subCircles[i]];\n }\n subCircles = subCircles.slice(0, maxBatches);\n }\n }\n\n const totalBatches = subCircles.length;\n const allPlacesMap = new Map<string, PlaceResult>();\n let processedBatches = 0;\n \n for (const circle of subCircles) {\n if (this._showLogs) console.log(`Querying batch ${processedBatches + 1}/${totalBatches}...`);\n \n const places = await fetchNewPlaces(\n circle, \n this._subRadius, \n this._types,\n this._apiKey,\n this._fields,\n (count) => {},\n this._forceQueryClosedStores,\n this._excludedPrimaryTypes\n );\n\n for (const place of places) {\n if (place.id) {\n allPlacesMap.set(place.id, place);\n }\n }\n\n processedBatches++;\n \n if (this._showProgress) {\n const percentage = ((processedBatches / totalBatches) * 100).toFixed(1);\n console.log(`Progress: ${percentage}%`);\n }\n\n await new Promise(r => setTimeout(r, 200)); \n if(processedBatches % 20 === 0) {\n await new Promise(r => setTimeout(r, 2000));\n }\n }\n\n let uniquePlaces = Array.from(allPlacesMap.values());\n uniquePlaces = uniquePlaces.filter(p => (p.rating || 0) >= this._minRate);\n\n if (this._limitCount && uniquePlaces.length > this._limitCount) {\n uniquePlaces = uniquePlaces.slice(0, this._limitCount);\n }\n if (this._showLogs) console.log(`Finished! Found ${uniquePlaces.length} unique places.`);\n\n this.handleOutput(uniquePlaces);\n }\n\n private handleOutput(places: PlaceResult[]) {\n if (typeof this._onFinished === \"function\") {\n this._onFinished(places);\n } else if (this._onFinished === \"json\") {\n const jsonContent = JSON.stringify(places, null, 2);\n writeFileSync(\"places_output.json\", jsonContent);\n if (this._showLogs) console.log(\"Saved results to places_output.json\");\n } else if (this._onFinished === \"csv\") {\n const headers = [\"id\", \"rating\", \"formattedAddress\", \"displayName\"];\n const csvContent = [\n headers.join(\",\"),\n ...places.map(p => {\n return [\n p.id,\n p.rating || \"\",\n `\"${(p.formattedAddress || \"\").replace(/\"/g, '\"\"')}\"`,\n `\"${(p.displayName?.text || p.name || \"\").replace(/\"/g, '\"\"')}\"`\n ].join(\",\")\n })\n ].join(\"\\n\");\n writeFileSync(\"places_output.csv\", csvContent);\n if (this._showLogs) console.log(\"Saved results to places_output.csv\");\n }\n }\n}\n\nexport function getLegacyGooglePlaces(location: Coordinate) {\n return new PlaceQueryBuilder(location);\n}\n\nexport function getGooglePlaces(location: Coordinate) {\n return new NewPlaceQueryBuilder(location);\n}\n"
8
8
  ],
9
- "mappings": ";AAYO,SAAS,kBAAkB,CAChC,QACA,QACA,YAAoB,KACN;AAAA,EAEd,IAAI,UAAU,WAAW;AAAA,IACvB,OAAO,CAAC,MAAM;AAAA,EAChB;AAAA,EAEA,MAAM,cAA4B,CAAC;AAAA,EAGnC,MAAM,IAAI;AAAA,EAGV,MAAM,SAAU,OAAO,WAAW,KAAK,KAAM;AAAA,EAM7C,MAAM,OAAO,YAAY;AAAA,EAMzB,MAAM,iBAAiB,IAAI;AAAA,EAC3B,MAAM,iBAAiB,KAAK,SAAS,KAAK,IAAI,MAAM;AAAA,EAEpD,MAAM,UAAU,OAAO;AAAA,EACvB,MAAM,UAAU,OAAO;AAAA,EAGvB,MAAM,WAAW,KAAK,KAAK,SAAS,IAAI;AAAA,EAExC,SAAS,IAAI,CAAC,SAAU,KAAK,UAAU,KAAK;AAAA,IAC1C,SAAS,IAAI,CAAC,SAAU,KAAK,UAAU,KAAK;AAAA,MAE1C,MAAM,UAAU,IAAI,WAAW,IAAI,MAAM,IAAI,IAAI,UAAU;AAAA,MAC3D,MAAM,UAAU,IAAI,WAAW,KAAK,KAAK,CAAC,IAAI;AAAA,MAG9C,MAAM,QAAQ,UAAU;AAAA,MACxB,MAAM,Q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1
  {
2
2
  "name": "easy-google-places",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Query Google Places API with automatic area subdivision to maximize results.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",