@googlemaps/routing 0.5.1 → 0.6.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/CHANGELOG.md +7 -0
- package/README.md +5 -6
- package/build/protos/google/maps/routing/v2/localized_time.proto +40 -0
- package/build/protos/google/maps/routing/v2/location.proto +4 -4
- package/build/protos/google/maps/routing/v2/maneuver.proto +6 -0
- package/build/protos/google/maps/routing/v2/route.proto +220 -44
- package/build/protos/google/maps/routing/v2/route_modifiers.proto +9 -11
- package/build/protos/google/maps/routing/v2/route_travel_mode.proto +3 -0
- package/build/protos/google/maps/routing/v2/routes_service.proto +110 -9
- package/build/protos/google/maps/routing/v2/toll_passes.proto +11 -1
- package/build/protos/google/maps/routing/v2/traffic_model.proto +52 -0
- package/build/protos/google/maps/routing/v2/transit.proto +161 -0
- package/build/protos/google/maps/routing/v2/transit_preferences.proto +75 -0
- package/build/protos/google/maps/routing/v2/vehicle_info.proto +3 -3
- package/build/protos/protos.d.ts +2153 -186
- package/build/protos/protos.js +32922 -1
- package/build/protos/protos.json +3061 -1
- package/build/src/v2/routes_client.d.ts +67 -8
- package/build/src/v2/routes_client.js +26 -3
- package/package.json +9 -7
|
@@ -163,8 +163,16 @@ export declare class RoutesClient {
|
|
|
163
163
|
* Optional. Specifies the preferred encoding for the polyline.
|
|
164
164
|
* @param {google.protobuf.Timestamp} [request.departureTime]
|
|
165
165
|
* Optional. The departure time. If you don't set this value, then this value
|
|
166
|
-
* defaults to the time that you made the request.
|
|
167
|
-
*
|
|
166
|
+
* defaults to the time that you made the request.
|
|
167
|
+
* NOTE: You can only specify a `departure_time` in the past when
|
|
168
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
169
|
+
* `TRANSIT`.
|
|
170
|
+
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
171
|
+
* Optional. The arrival time.
|
|
172
|
+
* NOTE: Can only be set when
|
|
173
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
174
|
+
* `TRANSIT`. You can specify either departure_time or arrival_time, but not
|
|
175
|
+
* both.
|
|
168
176
|
* @param {boolean} [request.computeAlternativeRoutes]
|
|
169
177
|
* Optional. Specifies whether to calculate alternate routes in addition to
|
|
170
178
|
* the route. No alternative routes are returned for requests that have
|
|
@@ -184,12 +192,23 @@ export declare class RoutesClient {
|
|
|
184
192
|
* two-character value. For more information see
|
|
185
193
|
* https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
|
|
186
194
|
* @param {google.maps.routing.v2.Units} [request.units]
|
|
187
|
-
* Optional. Specifies the units of measure for the display fields.
|
|
188
|
-
*
|
|
195
|
+
* Optional. Specifies the units of measure for the display fields. These
|
|
196
|
+
* fields include the `instruction` field in
|
|
189
197
|
* {@link google.maps.routing.v2.NavigationInstruction|NavigationInstruction}. The
|
|
190
198
|
* units of measure used for the route, leg, step distance, and duration are
|
|
191
199
|
* not affected by this value. If you don't provide this value, then the
|
|
192
|
-
* display units are inferred from the location of the
|
|
200
|
+
* display units are inferred from the location of the first origin.
|
|
201
|
+
* @param {boolean} [request.optimizeWaypointOrder]
|
|
202
|
+
* Optional. If set to true, the service attempts to minimize the overall cost
|
|
203
|
+
* of the route by re-ordering the specified intermediate waypoints. The
|
|
204
|
+
* request fails if any of the intermediate waypoints is a `via` waypoint. Use
|
|
205
|
+
* `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to
|
|
206
|
+
* find the new ordering.
|
|
207
|
+
* If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is
|
|
208
|
+
* not requested in the `X-Goog-FieldMask` header, the request fails.
|
|
209
|
+
* If `optimize_waypoint_order` is set to false,
|
|
210
|
+
* `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be
|
|
211
|
+
* empty.
|
|
193
212
|
* @param {number[]} [request.requestedReferenceRoutes]
|
|
194
213
|
* Optional. Specifies what reference routes to calculate as part of the
|
|
195
214
|
* request in addition to the default route. A reference route is a route with
|
|
@@ -201,6 +220,23 @@ export declare class RoutesClient {
|
|
|
201
220
|
* request. Note: These extra computations may return extra fields on the
|
|
202
221
|
* response. These extra fields must also be specified in the field mask to be
|
|
203
222
|
* returned in the response.
|
|
223
|
+
* @param {google.maps.routing.v2.TrafficModel} [request.trafficModel]
|
|
224
|
+
* Optional. Specifies the assumptions to use when calculating time in
|
|
225
|
+
* 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
|
|
228
|
+
* time in traffic based on historical averages.
|
|
229
|
+
* `TrafficModel` is only available for requests that have set
|
|
230
|
+
* {@link google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
231
|
+
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
232
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
233
|
+
* Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
|
|
234
|
+
* specified.
|
|
235
|
+
* @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences]
|
|
236
|
+
* Optional. Specifies preferences that influence the route returned for
|
|
237
|
+
* `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
|
|
238
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
239
|
+
* `TRANSIT`.
|
|
204
240
|
* @param {object} [options]
|
|
205
241
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
206
242
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -280,9 +316,17 @@ export declare class RoutesClient {
|
|
|
280
316
|
* returned. You can specify this option only when the `travel_mode` is
|
|
281
317
|
* `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
|
|
282
318
|
* @param {google.protobuf.Timestamp} [request.departureTime]
|
|
283
|
-
* Optional. The departure time. If you don't set this value, this
|
|
284
|
-
* the time that you made the request.
|
|
285
|
-
*
|
|
319
|
+
* Optional. The departure time. If you don't set this value, then this value
|
|
320
|
+
* defaults to the time that you made the request.
|
|
321
|
+
* NOTE: You can only specify a `departure_time` in the past when
|
|
322
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
323
|
+
* `TRANSIT`.
|
|
324
|
+
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
325
|
+
* Optional. The arrival time.
|
|
326
|
+
* NOTE: Can only be set when
|
|
327
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
328
|
+
* `TRANSIT`. You can specify either departure_time or arrival_time, but not
|
|
329
|
+
* both.
|
|
286
330
|
* @param {string} [request.languageCode]
|
|
287
331
|
* Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
|
288
332
|
* information, see
|
|
@@ -299,6 +343,21 @@ export declare class RoutesClient {
|
|
|
299
343
|
* request. Note: These extra computations may return extra fields on the
|
|
300
344
|
* response. These extra fields must also be specified in the field mask to be
|
|
301
345
|
* returned in the response.
|
|
346
|
+
* @param {google.maps.routing.v2.TrafficModel} [request.trafficModel]
|
|
347
|
+
* Optional. Specifies the assumptions to use when calculating time in
|
|
348
|
+
* traffic. This setting affects the value returned in the duration field in
|
|
349
|
+
* the {@link google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
350
|
+
* contains the predicted time in traffic based on historical averages.
|
|
351
|
+
* {@link google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
352
|
+
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
353
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
354
|
+
* Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
|
|
355
|
+
* specified.
|
|
356
|
+
* @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences]
|
|
357
|
+
* Optional. Specifies preferences that influence the route returned for
|
|
358
|
+
* `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
|
|
359
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
360
|
+
* `TRANSIT`.
|
|
302
361
|
* @param {object} [options]
|
|
303
362
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
304
363
|
* @returns {Stream}
|
|
@@ -316,9 +316,17 @@ class RoutesClient {
|
|
|
316
316
|
* returned. You can specify this option only when the `travel_mode` is
|
|
317
317
|
* `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
|
|
318
318
|
* @param {google.protobuf.Timestamp} [request.departureTime]
|
|
319
|
-
* Optional. The departure time. If you don't set this value, this
|
|
320
|
-
* the time that you made the request.
|
|
321
|
-
*
|
|
319
|
+
* Optional. The departure time. If you don't set this value, then this value
|
|
320
|
+
* defaults to the time that you made the request.
|
|
321
|
+
* NOTE: You can only specify a `departure_time` in the past when
|
|
322
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
323
|
+
* `TRANSIT`.
|
|
324
|
+
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
325
|
+
* Optional. The arrival time.
|
|
326
|
+
* NOTE: Can only be set when
|
|
327
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
328
|
+
* `TRANSIT`. You can specify either departure_time or arrival_time, but not
|
|
329
|
+
* both.
|
|
322
330
|
* @param {string} [request.languageCode]
|
|
323
331
|
* Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
|
324
332
|
* information, see
|
|
@@ -335,6 +343,21 @@ class RoutesClient {
|
|
|
335
343
|
* request. Note: These extra computations may return extra fields on the
|
|
336
344
|
* response. These extra fields must also be specified in the field mask to be
|
|
337
345
|
* returned in the response.
|
|
346
|
+
* @param {google.maps.routing.v2.TrafficModel} [request.trafficModel]
|
|
347
|
+
* Optional. Specifies the assumptions to use when calculating time in
|
|
348
|
+
* traffic. This setting affects the value returned in the duration field in
|
|
349
|
+
* the {@link google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
350
|
+
* contains the predicted time in traffic based on historical averages.
|
|
351
|
+
* {@link google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
352
|
+
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
353
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
354
|
+
* Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
|
|
355
|
+
* specified.
|
|
356
|
+
* @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences]
|
|
357
|
+
* Optional. Specifies preferences that influence the route returned for
|
|
358
|
+
* `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
|
|
359
|
+
* {@link google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to
|
|
360
|
+
* `TRANSIT`.
|
|
338
361
|
* @param {object} [options]
|
|
339
362
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
340
363
|
* @returns {Stream}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@googlemaps/routing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": " client for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"clean": "gts clean",
|
|
34
|
-
"compile": "tsc -p . && cp -r protos build/
|
|
34
|
+
"compile": "tsc -p . && cp -r protos build/",
|
|
35
35
|
"compile-protos": "compileProtos src",
|
|
36
36
|
"docs": "jsdoc -c .jsdoc.js",
|
|
37
37
|
"predocs-test": "npm run docs",
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
"fix": "gts fix",
|
|
40
40
|
"lint": "gts check",
|
|
41
41
|
"prepare": "npm run compile-protos && npm run compile",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"samples-test": "
|
|
45
|
-
"
|
|
42
|
+
"prelint": "cd samples; npm link ../; npm i",
|
|
43
|
+
"postpack": "minifyProtoJson",
|
|
44
|
+
"samples-test": "cd samples/ && npm link ../ && npm i && npm test",
|
|
45
|
+
"system-test": "c8 mocha build/system-test",
|
|
46
|
+
"test": "c8 mocha build/test"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"google-gax": "^3.5.8"
|
|
@@ -56,7 +57,8 @@
|
|
|
56
57
|
"jsdoc": "^4.0.0",
|
|
57
58
|
"jsdoc-fresh": "^2.0.0",
|
|
58
59
|
"jsdoc-region-tag": "^2.0.0",
|
|
59
|
-
"linkinator": "
|
|
60
|
+
"linkinator": "4.1.2",
|
|
61
|
+
"long": "^5.2.3",
|
|
60
62
|
"mocha": "^9.2.2",
|
|
61
63
|
"null-loader": "^4.0.1",
|
|
62
64
|
"pack-n-play": "^1.0.0-2",
|