@googlemaps/routing 0.6.0 → 1.0.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/CHANGELOG.md +23 -0
- package/README.md +1 -1
- package/build/src/v2/routes_client.d.ts +20 -23
- package/build/src/v2/routes_client.js +12 -14
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.1](https://github.com/googleapis/google-cloud-node/compare/routing-v1.0.0...routing-v1.0.1) (2023-09-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* [Many APIs] simplify logic for HTTP/1.1 REST fallback option ([#4589](https://github.com/googleapis/google-cloud-node/issues/4589)) ([07967ad](https://github.com/googleapis/google-cloud-node/commit/07967add1b5fc28b548cf74721b595ea0ba90d5b))
|
|
9
|
+
|
|
10
|
+
## [1.0.0](https://github.com/googleapis/google-cloud-node/compare/routing-v0.6.0...routing-v1.0.0) (2023-08-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443))
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* [Many APIs] fix typings for IAM methods ([#4466](https://github.com/googleapis/google-cloud-node/issues/4466)) ([fa1520c](https://github.com/googleapis/google-cloud-node/commit/fa1520c3eb526efd3523d9cea349ed31683d5889))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Miscellaneous Chores
|
|
23
|
+
|
|
24
|
+
* Migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) ([2260f12](https://github.com/googleapis/google-cloud-node/commit/2260f12543d171bda95345e53475f5f0fdc45770))
|
|
25
|
+
|
|
3
26
|
## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/routing-v0.5.1...routing-v0.6.0) (2023-07-04)
|
|
4
27
|
|
|
5
28
|
|
package/README.md
CHANGED
|
@@ -173,7 +173,7 @@ also contains samples.
|
|
|
173
173
|
|
|
174
174
|
## Supported Node.js Versions
|
|
175
175
|
|
|
176
|
-
Our client libraries follow the [Node.js release schedule](https://
|
|
176
|
+
Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule).
|
|
177
177
|
Libraries are compatible with all current _active_ and _maintenance_ versions of
|
|
178
178
|
Node.js.
|
|
179
179
|
If you are using an end-of-life version of Node.js, we recommend that you update
|
|
@@ -51,8 +51,7 @@ export declare class RoutesClient {
|
|
|
51
51
|
* API remote host.
|
|
52
52
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
53
53
|
* Follows the structure of {@link gapicConfig}.
|
|
54
|
-
* @param {boolean
|
|
55
|
-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
54
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
|
56
55
|
* For more information, please check the
|
|
57
56
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
58
57
|
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
@@ -60,7 +59,7 @@ export declare class RoutesClient {
|
|
|
60
59
|
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
61
60
|
* ```
|
|
62
61
|
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
63
|
-
* const client = new RoutesClient({fallback:
|
|
62
|
+
* const client = new RoutesClient({fallback: true}, gax);
|
|
64
63
|
* ```
|
|
65
64
|
*/
|
|
66
65
|
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
|
@@ -165,12 +164,12 @@ export declare class RoutesClient {
|
|
|
165
164
|
* Optional. The departure time. If you don't set this value, then this value
|
|
166
165
|
* defaults to the time that you made the request.
|
|
167
166
|
* NOTE: You can only specify a `departure_time` in the past when
|
|
168
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
167
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
169
168
|
* `TRANSIT`.
|
|
170
169
|
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
171
170
|
* Optional. The arrival time.
|
|
172
171
|
* NOTE: Can only be set when
|
|
173
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
172
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
174
173
|
* `TRANSIT`. You can specify either departure_time or arrival_time, but not
|
|
175
174
|
* both.
|
|
176
175
|
* @param {boolean} [request.computeAlternativeRoutes]
|
|
@@ -194,7 +193,7 @@ export declare class RoutesClient {
|
|
|
194
193
|
* @param {google.maps.routing.v2.Units} [request.units]
|
|
195
194
|
* Optional. Specifies the units of measure for the display fields. These
|
|
196
195
|
* fields include the `instruction` field in
|
|
197
|
-
* {@link google.maps.routing.v2.NavigationInstruction|NavigationInstruction}. The
|
|
196
|
+
* {@link protos.google.maps.routing.v2.NavigationInstruction|NavigationInstruction}. The
|
|
198
197
|
* units of measure used for the route, leg, step distance, and duration are
|
|
199
198
|
* not affected by this value. If you don't provide this value, then the
|
|
200
199
|
* display units are inferred from the location of the first origin.
|
|
@@ -223,26 +222,25 @@ export declare class RoutesClient {
|
|
|
223
222
|
* @param {google.maps.routing.v2.TrafficModel} [request.trafficModel]
|
|
224
223
|
* Optional. Specifies the assumptions to use when calculating time in
|
|
225
224
|
* traffic. This setting affects the value returned in the duration field in
|
|
226
|
-
* the {@link google.maps.routing.v2.Route|Route} and
|
|
227
|
-
* {@link google.maps.routing.v2.RouteLeg|RouteLeg} which contains the predicted
|
|
225
|
+
* the {@link protos.google.maps.routing.v2.Route|Route} and
|
|
226
|
+
* {@link protos.google.maps.routing.v2.RouteLeg|RouteLeg} which contains the predicted
|
|
228
227
|
* time in traffic based on historical averages.
|
|
229
228
|
* `TrafficModel` is only available for requests that have set
|
|
230
|
-
* {@link google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
229
|
+
* {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
231
230
|
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
232
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
231
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
233
232
|
* Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
|
|
234
233
|
* specified.
|
|
235
234
|
* @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences]
|
|
236
235
|
* Optional. Specifies preferences that influence the route returned for
|
|
237
236
|
* `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
|
|
238
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
237
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
239
238
|
* `TRANSIT`.
|
|
240
239
|
* @param {object} [options]
|
|
241
240
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
242
241
|
* @returns {Promise} - The promise which resolves to an array.
|
|
243
|
-
* The first element of the array is an object representing {@link google.maps.routing.v2.ComputeRoutesResponse
|
|
244
|
-
* Please see the
|
|
245
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
242
|
+
* The first element of the array is an object representing {@link protos.google.maps.routing.v2.ComputeRoutesResponse|ComputeRoutesResponse}.
|
|
243
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
246
244
|
* for more details and examples.
|
|
247
245
|
* @example <caption>include:samples/generated/v2/routes.compute_routes.js</caption>
|
|
248
246
|
* region_tag:routes_v2_generated_Routes_ComputeRoutes_async
|
|
@@ -319,12 +317,12 @@ export declare class RoutesClient {
|
|
|
319
317
|
* Optional. The departure time. If you don't set this value, then this value
|
|
320
318
|
* defaults to the time that you made the request.
|
|
321
319
|
* NOTE: You can only specify a `departure_time` in the past when
|
|
322
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
320
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
323
321
|
* `TRANSIT`.
|
|
324
322
|
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
325
323
|
* Optional. The arrival time.
|
|
326
324
|
* NOTE: Can only be set when
|
|
327
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
325
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
328
326
|
* `TRANSIT`. You can specify either departure_time or arrival_time, but not
|
|
329
327
|
* both.
|
|
330
328
|
* @param {string} [request.languageCode]
|
|
@@ -346,24 +344,23 @@ export declare class RoutesClient {
|
|
|
346
344
|
* @param {google.maps.routing.v2.TrafficModel} [request.trafficModel]
|
|
347
345
|
* Optional. Specifies the assumptions to use when calculating time in
|
|
348
346
|
* traffic. This setting affects the value returned in the duration field in
|
|
349
|
-
* the {@link google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
347
|
+
* the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
350
348
|
* contains the predicted time in traffic based on historical averages.
|
|
351
|
-
* {@link google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
349
|
+
* {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
352
350
|
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
353
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
351
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
354
352
|
* Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
|
|
355
353
|
* specified.
|
|
356
354
|
* @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences]
|
|
357
355
|
* Optional. Specifies preferences that influence the route returned for
|
|
358
356
|
* `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
|
|
359
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
357
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
360
358
|
* `TRANSIT`.
|
|
361
359
|
* @param {object} [options]
|
|
362
360
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
363
361
|
* @returns {Stream}
|
|
364
|
-
* An object stream which emits {@link google.maps.routing.v2.RouteMatrixElement
|
|
365
|
-
* Please see the
|
|
366
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming)
|
|
362
|
+
* An object stream which emits {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} on 'data' event.
|
|
363
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
367
364
|
* for more details and examples.
|
|
368
365
|
* @example <caption>include:samples/generated/v2/routes.compute_route_matrix.js</caption>
|
|
369
366
|
* region_tag:routes_v2_generated_Routes_ComputeRouteMatrix_async
|
|
@@ -61,8 +61,7 @@ class RoutesClient {
|
|
|
61
61
|
* API remote host.
|
|
62
62
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
63
63
|
* Follows the structure of {@link gapicConfig}.
|
|
64
|
-
* @param {boolean
|
|
65
|
-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
64
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
|
66
65
|
* For more information, please check the
|
|
67
66
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
68
67
|
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
@@ -70,7 +69,7 @@ class RoutesClient {
|
|
|
70
69
|
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
71
70
|
* ```
|
|
72
71
|
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
73
|
-
* const client = new RoutesClient({fallback:
|
|
72
|
+
* const client = new RoutesClient({fallback: true}, gax);
|
|
74
73
|
* ```
|
|
75
74
|
*/
|
|
76
75
|
constructor(opts, gaxInstance) {
|
|
@@ -127,7 +126,7 @@ class RoutesClient {
|
|
|
127
126
|
if (!opts.fallback) {
|
|
128
127
|
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
|
|
129
128
|
}
|
|
130
|
-
else
|
|
129
|
+
else {
|
|
131
130
|
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
|
|
132
131
|
}
|
|
133
132
|
if (opts.libName && opts.libVersion) {
|
|
@@ -138,7 +137,7 @@ class RoutesClient {
|
|
|
138
137
|
// Some of the methods on this service provide streaming responses.
|
|
139
138
|
// Provide descriptors for these.
|
|
140
139
|
this.descriptors.stream = {
|
|
141
|
-
computeRouteMatrix: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback
|
|
140
|
+
computeRouteMatrix: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback),
|
|
142
141
|
};
|
|
143
142
|
// Put together the default options sent with requests.
|
|
144
143
|
this._defaults = this._gaxGrpc.constructSettings('google.maps.routing.v2.Routes', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -319,12 +318,12 @@ class RoutesClient {
|
|
|
319
318
|
* Optional. The departure time. If you don't set this value, then this value
|
|
320
319
|
* defaults to the time that you made the request.
|
|
321
320
|
* NOTE: You can only specify a `departure_time` in the past when
|
|
322
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
321
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
323
322
|
* `TRANSIT`.
|
|
324
323
|
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
325
324
|
* Optional. The arrival time.
|
|
326
325
|
* NOTE: Can only be set when
|
|
327
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
326
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
328
327
|
* `TRANSIT`. You can specify either departure_time or arrival_time, but not
|
|
329
328
|
* both.
|
|
330
329
|
* @param {string} [request.languageCode]
|
|
@@ -346,24 +345,23 @@ class RoutesClient {
|
|
|
346
345
|
* @param {google.maps.routing.v2.TrafficModel} [request.trafficModel]
|
|
347
346
|
* Optional. Specifies the assumptions to use when calculating time in
|
|
348
347
|
* traffic. This setting affects the value returned in the duration field in
|
|
349
|
-
* the {@link google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
348
|
+
* the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
350
349
|
* contains the predicted time in traffic based on historical averages.
|
|
351
|
-
* {@link google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
350
|
+
* {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
352
351
|
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
353
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
352
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
354
353
|
* Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
|
|
355
354
|
* specified.
|
|
356
355
|
* @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences]
|
|
357
356
|
* Optional. Specifies preferences that influence the route returned for
|
|
358
357
|
* `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
|
|
359
|
-
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
358
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
360
359
|
* `TRANSIT`.
|
|
361
360
|
* @param {object} [options]
|
|
362
361
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
363
362
|
* @returns {Stream}
|
|
364
|
-
* An object stream which emits {@link google.maps.routing.v2.RouteMatrixElement
|
|
365
|
-
* Please see the
|
|
366
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming)
|
|
363
|
+
* An object stream which emits {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} on 'data' event.
|
|
364
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
367
365
|
* for more details and examples.
|
|
368
366
|
* @example <caption>include:samples/generated/v2/routes.compute_route_matrix.js</caption>
|
|
369
367
|
* region_tag:routes_v2_generated_Routes_ComputeRouteMatrix_async
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@googlemaps/routing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": " client for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,29 +46,26 @@
|
|
|
46
46
|
"test": "c8 mocha build/test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"google-gax": "^
|
|
49
|
+
"google-gax": "^4.0.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/mocha": "^9.0.0",
|
|
53
|
-
"@types/node": "^
|
|
53
|
+
"@types/node": "^20.4.5",
|
|
54
54
|
"@types/sinon": "^10.0.0",
|
|
55
|
-
"c8": "^
|
|
56
|
-
"
|
|
55
|
+
"c8": "^8.0.1",
|
|
56
|
+
"gapic-tools": "^0.1.8",
|
|
57
|
+
"gts": "^5.0.0",
|
|
57
58
|
"jsdoc": "^4.0.0",
|
|
58
|
-
"jsdoc-fresh": "^
|
|
59
|
-
"jsdoc-region-tag": "^
|
|
59
|
+
"jsdoc-fresh": "^3.0.0",
|
|
60
|
+
"jsdoc-region-tag": "^3.0.0",
|
|
60
61
|
"linkinator": "4.1.2",
|
|
61
62
|
"long": "^5.2.3",
|
|
62
63
|
"mocha": "^9.2.2",
|
|
63
|
-
"null-loader": "^4.0.1",
|
|
64
64
|
"pack-n-play": "^1.0.0-2",
|
|
65
65
|
"sinon": "^15.0.0",
|
|
66
|
-
"
|
|
67
|
-
"typescript": "^4.6.4",
|
|
68
|
-
"webpack": "^5.9.0",
|
|
69
|
-
"webpack-cli": "^5.0.0"
|
|
66
|
+
"typescript": "^5.1.6"
|
|
70
67
|
},
|
|
71
68
|
"engines": {
|
|
72
|
-
"node": ">=
|
|
69
|
+
"node": ">=14.0.0"
|
|
73
70
|
}
|
|
74
71
|
}
|