@googlemaps/places 2.1.0 → 2.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,24 +1,24 @@
1
1
  [//]: # "This README.md file is auto-generated, all changes to this file will be lost."
2
- [//]: # "To regenerate it, use `python -m synthtool`."
2
+ [//]: # "The comments you see below are used to generate those parts of the template in later states."
3
3
  <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
4
4
 
5
- # [Places API (New): Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places)
6
-
7
- [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
8
- [![npm version](https://img.shields.io/npm/v/@googlemaps/places.svg)](https://www.npmjs.org/package/@googlemaps/places)
9
-
5
+ # [Places API (New): Nodejs Client][homepage]
10
6
 
7
+ This library is considered to be in **preview**. This means it is still a
8
+ work-in-progress and under active development. Any release is subject to
9
+ backwards-incompatible changes at any time.
11
10
 
11
+ [![npm version](https://img.shields.io/npm/v/@googlemaps/places.svg)](https://www.npmjs.org/package/@googlemaps/places)
12
12
 
13
13
  Places API (New) client for Node.js
14
14
 
15
+ [//]: # "partials.introduction"
15
16
 
16
17
  A comprehensive list of changes in each version may be found in
17
- [the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places/CHANGELOG.md).
18
+ [the CHANGELOG][homepage_changelog].
18
19
 
19
- * [Places API (New) Node.js Client API Reference][client-docs]
20
- * [Places API (New) Documentation][product-docs]
21
- * [github.com/googleapis/google-cloud-node/packages/google-maps-places](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places)
20
+ * [Places API (New) Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/places/latest)
21
+ * [Places API (New) Documentation](https://developers.google.com/maps/documentation/places/web-service/)
22
22
 
23
23
  Read more about the client libraries for Cloud APIs, including the older
24
24
  Google APIs Client Libraries, in [Client Libraries Explained][explained].
@@ -27,18 +27,15 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
27
27
 
28
28
  **Table of contents:**
29
29
 
30
-
31
30
  * [Quickstart](#quickstart)
32
31
  * [Before you begin](#before-you-begin)
33
32
  * [Installing the client library](#installing-the-client-library)
34
- * [Using the client library](#using-the-client-library)
35
- * [Samples](#samples)
33
+
36
34
  * [Versioning](#versioning)
37
35
  * [Contributing](#contributing)
38
36
  * [License](#license)
39
37
 
40
38
  ## Quickstart
41
-
42
39
  ### Before you begin
43
40
 
44
41
  1. [Select or create a Cloud Platform project][projects].
@@ -46,64 +43,47 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
46
43
  1. [Enable the Places API (New) API][enable_api].
47
44
  1. [Set up authentication][auth] so you can access the
48
45
  API from your local workstation.
49
-
50
46
  ### Installing the client library
51
47
 
52
48
  ```bash
53
49
  npm install @googlemaps/places
54
50
  ```
55
51
 
52
+ ## Terms of Service
56
53
 
57
- ### Using the client library
58
-
59
- ```javascript
60
-
61
- // Imports the Places library
62
- const {PlacesClient} = require('@googlemaps/places').v1;
63
-
64
- // Instantiates a client
65
- const placesClient = new PlacesClient();
66
-
67
- async function callSearchText() {
68
- // Construct request
69
- const request = {
70
- textQuery,
71
- };
54
+ `@googlemaps/places` uses Google Maps Platform services. Use of Google
55
+ Maps Platform services through this library is subject to the
56
+ [Google Maps Platform Terms of Service][gmp-tos].
72
57
 
73
- // Run request
74
- const response = await placesClient.searchText(request, {
75
- otherArgs: {
76
- headers: {
77
- 'X-Goog-FieldMask': 'places.displayName',
78
- },
79
- },
80
- });
81
- console.log(response);
82
- }
58
+ This library is not a Google Maps Platform Core Service.
59
+ Therefore, the Google Maps Platform Terms of Service (e.g., Technical
60
+ Support Services, Service Level Agreements, and Deprecation Policy)
61
+ do not apply to this library.
83
62
 
84
- callSearchText();
85
-
86
- ```
63
+ ### European Economic Area (EEA) developers
87
64
 
65
+ If your billing address is in the European Economic Area, effective on
66
+ 8 July 2025, the [Google Maps Platform EEA Terms of Service][gmp-tos-eea]
67
+ will apply to your use of the Services. Functionality varies by region.
68
+ [Learn more][gmp-tos-eea-faq].
88
69
 
70
+ [gmp-tos]: https://cloud.google.com/maps-platform/terms
71
+ [gmp-tos-eea]: https://cloud.google.com/terms/maps-platform/eea
72
+ [gmp-tos-eea-faq]: https://developers.google.com/maps/comms/eea/faq
89
73
 
90
74
  ## Samples
91
75
 
92
- Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places/samples) directory. Each sample's `README.md` has instructions for running its sample.
93
-
94
- | Sample | Source Code | Try it |
95
- | --------------------------- | --------------------------------- | ------ |
96
- | Places.autocomplete_places | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.autocomplete_places.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-places/samples/generated/v1/places.autocomplete_places.js,packages/google-maps-places/samples/README.md) |
97
- | Places.get_photo_media | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.get_photo_media.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-places/samples/generated/v1/places.get_photo_media.js,packages/google-maps-places/samples/README.md) |
98
- | Places.get_place | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.get_place.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-places/samples/generated/v1/places.get_place.js,packages/google-maps-places/samples/README.md) |
99
- | Places.search_nearby | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.search_nearby.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-places/samples/generated/v1/places.search_nearby.js,packages/google-maps-places/samples/README.md) |
100
- | Places.search_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.search_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-places/samples/generated/v1/places.search_text.js,packages/google-maps-places/samples/README.md) |
101
- | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-places/samples/quickstart.js,packages/google-maps-places/samples/README.md) |
102
-
76
+ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample.
103
77
 
78
+ | Sample | Source Code |
79
+ | --------------------------- | --------------------------------- |
80
+ | autocomplete places | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.autocomplete_places.js) |
81
+ | get photo media | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.get_photo_media.js) |
82
+ | get place | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.get_place.js) |
83
+ | search nearby | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.search_nearby.js) |
84
+ | search text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/places.search_text.js) |
85
+ | maps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json) |
104
86
 
105
- The [Places API (New) Node.js Client API Reference][client-docs] documentation
106
- also contains samples.
107
87
 
108
88
  ## Supported Node.js Versions
109
89
 
@@ -130,41 +110,29 @@ for versions compatible with Node.js 8.
130
110
 
131
111
  This library follows [Semantic Versioning](http://semver.org/).
132
112
 
133
-
134
-
135
-
136
-
137
-
138
-
139
- This library is considered to be in **preview**. This means it is still a
140
- work-in-progress and under active development. Any release is subject to
141
- backwards-incompatible changes at any time.
142
-
143
-
144
113
  More Information: [Google Cloud Platform Launch Stages][launch_stages]
145
114
 
146
115
  [launch_stages]: https://cloud.google.com/terms/launch-stages
147
116
 
148
117
  ## Contributing
149
118
 
150
- Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md).
119
+ Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/CONTRIBUTING.md).
151
120
 
152
- Please note that this `README.md`, the `samples/README.md`,
121
+ Please note that this `README.md`
153
122
  and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
154
- are generated from a central template. To edit one of these files, make an edit
155
- to its templates in
156
- [directory](https://github.com/googleapis/synthtool).
123
+ are generated from a central template.
157
124
 
158
125
  ## License
159
126
 
160
127
  Apache Version 2.0
161
128
 
162
- See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
129
+ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/LICENSE)
163
130
 
164
- [client-docs]: https://cloud.google.com/nodejs/docs/reference/places/latest
165
- [product-docs]: https://developers.google.com/maps/documentation/places/web-service/
166
131
  [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
167
132
  [projects]: https://console.cloud.google.com/project
168
133
  [billing]: https://support.google.com/cloud/answer/6293499#enable-billing
169
134
  [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=places.googleapis.com
170
135
  [auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
136
+ [homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/samples
137
+ [homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places/CHANGELOG.md
138
+ [homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-places
@@ -360,6 +360,9 @@ message Place {
360
360
  // (and its localized variants). This will be in the language specified in
361
361
  // the request if available.
362
362
  google.type.LocalizedText disclosure_text = 3;
363
+
364
+ // A link to show reviews of this place on Google Maps.
365
+ string reviews_uri = 4;
363
366
  }
364
367
 
365
368
  // The summary of amenities near the EV charging station. This only applies to
@@ -376,7 +379,7 @@ message Place {
376
379
  // A summary of the nearby restaurants.
377
380
  ContentBlock restaurant = 3;
378
381
 
379
- // A summary of the nearby gas stations.
382
+ // A summary of the nearby stores.
380
383
  ContentBlock store = 4;
381
384
 
382
385
  // A link where users can flag a problem with the summary.
@@ -405,6 +408,43 @@ message Place {
405
408
  google.type.LocalizedText disclosure_text = 4;
406
409
  }
407
410
 
411
+ // The consumer alert message for the place when we detect suspicious review
412
+ // activity on a business or a business violates our policies.
413
+ message ConsumerAlert {
414
+ // The details of the consumer alert message.
415
+ message Details {
416
+ // The link to show together with the description to provide more
417
+ // information.
418
+ message Link {
419
+ // The title to show for the link.
420
+ string title = 1;
421
+
422
+ // The uri of the link.
423
+ string uri = 2;
424
+ }
425
+
426
+ // The title to show together with the description.
427
+ string title = 1;
428
+
429
+ // The description of the consumer alert message.
430
+ string description = 2;
431
+
432
+ // The link to show together with the description to provide more
433
+ // information.
434
+ Link about_link = 3;
435
+ }
436
+
437
+ // The overview of the consumer alert message.
438
+ string overview = 1;
439
+
440
+ // The details of the consumer alert message.
441
+ Details details = 2;
442
+
443
+ // The language code of the consumer alert message. This is a BCP 47
444
+ // language code.
445
+ string language_code = 3;
446
+ }
447
+
408
448
  // This Place's resource name, in `places/{place_id}` format. Can be used to
409
449
  // look up the Place.
410
450
  string name = 1;
@@ -693,6 +733,25 @@ message Place {
693
733
 
694
734
  // A summary of points of interest near the place.
695
735
  NeighborhoodSummary neighborhood_summary = 91;
736
+
737
+ // The consumer alert message for the place when we detect suspicious review
738
+ // activity on a business or a business violates our policies.
739
+ ConsumerAlert consumer_alert = 92;
740
+
741
+ // If this Place is permanently closed and has moved to a new Place, this
742
+ // field contains the new Place's resource name, in `places/{place_id}`
743
+ // format. If this Place moved multiple times, this field will represent the
744
+ // first moved place. This field will not be populated if this Place has not
745
+ // moved.
746
+ string moved_place = 93 [
747
+ (google.api.resource_reference) = { type: "places.googleapis.com/Place" }
748
+ ];
749
+
750
+ // If this Place is permanently closed and has moved to a new Place, this
751
+ // field contains the new Place's place ID. If this Place moved multiple
752
+ // times, this field will represent the first moved Place. This field will not
753
+ // be populated if this Place has not moved.
754
+ string moved_place_id = 94;
696
755
  }
697
756
 
698
757
  // Price level of the place.
@@ -68,4 +68,8 @@ message Review {
68
68
 
69
69
  // A link to show the review on Google Maps.
70
70
  string google_maps_uri = 16;
71
+
72
+ // The date when the author visited the place. This is truncated to the year
73
+ // and month of the visit.
74
+ google.type.Date visit_date = 17;
71
75
  }