@googlemaps/routing 1.3.0 → 2.0.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 +24 -0
- package/build/protos/google/geo/type/viewport.proto +1 -1
- package/build/protos/google/maps/routing/v2/fallback_info.proto +1 -2
- package/build/protos/google/maps/routing/v2/geocoding_results.proto +1 -2
- package/build/protos/google/maps/routing/v2/localized_time.proto +1 -2
- package/build/protos/google/maps/routing/v2/location.proto +1 -2
- package/build/protos/google/maps/routing/v2/maneuver.proto +1 -2
- package/build/protos/google/maps/routing/v2/navigation_instruction.proto +1 -2
- package/build/protos/google/maps/routing/v2/polyline.proto +1 -2
- package/build/protos/google/maps/routing/v2/polyline_details.proto +84 -0
- package/build/protos/google/maps/routing/v2/route.proto +21 -14
- package/build/protos/google/maps/routing/v2/route_label.proto +4 -2
- package/build/protos/google/maps/routing/v2/route_modifiers.proto +1 -2
- package/build/protos/google/maps/routing/v2/route_travel_mode.proto +1 -2
- package/build/protos/google/maps/routing/v2/routes_service.proto +36 -5
- package/build/protos/google/maps/routing/v2/routing_preference.proto +1 -2
- package/build/protos/google/maps/routing/v2/speed_reading_interval.proto +1 -2
- package/build/protos/google/maps/routing/v2/toll_info.proto +1 -1
- package/build/protos/google/maps/routing/v2/toll_passes.proto +1 -2
- package/build/protos/google/maps/routing/v2/traffic_model.proto +1 -2
- package/build/protos/google/maps/routing/v2/transit.proto +1 -2
- package/build/protos/google/maps/routing/v2/transit_preferences.proto +1 -2
- package/build/protos/google/maps/routing/v2/units.proto +1 -2
- package/build/protos/google/maps/routing/v2/vehicle_emission_type.proto +1 -2
- package/build/protos/google/maps/routing/v2/vehicle_info.proto +1 -1
- package/build/protos/google/maps/routing/v2/waypoint.proto +1 -2
- package/build/protos/protos.d.ts +691 -253
- package/build/protos/protos.js +1623 -511
- package/build/protos/protos.json +141 -50
- package/build/src/index.js +1 -1
- package/build/src/v2/gapic_metadata.json +38 -0
- package/build/src/v2/index.js +1 -1
- package/build/src/v2/routes_client.d.ts +6 -2
- package/build/src/v2/routes_client.js +52 -21
- package/build/src/v2/routes_proto_list.json +27 -0
- package/package.json +16 -16
package/build/protos/protos.json
CHANGED
|
@@ -160,30 +160,6 @@
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
"Duration": {
|
|
164
|
-
"fields": {
|
|
165
|
-
"seconds": {
|
|
166
|
-
"type": "int64",
|
|
167
|
-
"id": 1
|
|
168
|
-
},
|
|
169
|
-
"nanos": {
|
|
170
|
-
"type": "int32",
|
|
171
|
-
"id": 2
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
"Timestamp": {
|
|
176
|
-
"fields": {
|
|
177
|
-
"seconds": {
|
|
178
|
-
"type": "int64",
|
|
179
|
-
"id": 1
|
|
180
|
-
},
|
|
181
|
-
"nanos": {
|
|
182
|
-
"type": "int32",
|
|
183
|
-
"id": 2
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
163
|
"FileDescriptorSet": {
|
|
188
164
|
"fields": {
|
|
189
165
|
"file": {
|
|
@@ -1447,6 +1423,30 @@
|
|
|
1447
1423
|
}
|
|
1448
1424
|
}
|
|
1449
1425
|
}
|
|
1426
|
+
},
|
|
1427
|
+
"Duration": {
|
|
1428
|
+
"fields": {
|
|
1429
|
+
"seconds": {
|
|
1430
|
+
"type": "int64",
|
|
1431
|
+
"id": 1
|
|
1432
|
+
},
|
|
1433
|
+
"nanos": {
|
|
1434
|
+
"type": "int32",
|
|
1435
|
+
"id": 2
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
"Timestamp": {
|
|
1440
|
+
"fields": {
|
|
1441
|
+
"seconds": {
|
|
1442
|
+
"type": "int64",
|
|
1443
|
+
"id": 1
|
|
1444
|
+
},
|
|
1445
|
+
"nanos": {
|
|
1446
|
+
"type": "int32",
|
|
1447
|
+
"id": 2
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
1452
|
},
|
|
@@ -1535,7 +1535,6 @@
|
|
|
1535
1535
|
"nested": {
|
|
1536
1536
|
"v2": {
|
|
1537
1537
|
"options": {
|
|
1538
|
-
"cc_enable_arenas": true,
|
|
1539
1538
|
"csharp_namespace": "Google.Maps.Routing.V2",
|
|
1540
1539
|
"go_package": "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb",
|
|
1541
1540
|
"java_multiple_files": true,
|
|
@@ -1543,7 +1542,8 @@
|
|
|
1543
1542
|
"java_package": "com.google.maps.routing.v2",
|
|
1544
1543
|
"objc_class_prefix": "GMRV2",
|
|
1545
1544
|
"php_namespace": "Google\\Maps\\Routing\\V2",
|
|
1546
|
-
"ruby_package": "Google::Maps::Routing::V2"
|
|
1545
|
+
"ruby_package": "Google::Maps::Routing::V2",
|
|
1546
|
+
"cc_enable_arenas": true
|
|
1547
1547
|
},
|
|
1548
1548
|
"nested": {
|
|
1549
1549
|
"FallbackInfo": {
|
|
@@ -1719,6 +1719,89 @@
|
|
|
1719
1719
|
"GEO_JSON_LINESTRING": 2
|
|
1720
1720
|
}
|
|
1721
1721
|
},
|
|
1722
|
+
"PolylineDetails": {
|
|
1723
|
+
"fields": {
|
|
1724
|
+
"flyoverInfo": {
|
|
1725
|
+
"rule": "repeated",
|
|
1726
|
+
"type": "FlyoverInfo",
|
|
1727
|
+
"id": 12
|
|
1728
|
+
},
|
|
1729
|
+
"narrowRoadInfo": {
|
|
1730
|
+
"rule": "repeated",
|
|
1731
|
+
"type": "NarrowRoadInfo",
|
|
1732
|
+
"id": 13
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1735
|
+
"nested": {
|
|
1736
|
+
"PolylinePointIndex": {
|
|
1737
|
+
"oneofs": {
|
|
1738
|
+
"_startIndex": {
|
|
1739
|
+
"oneof": [
|
|
1740
|
+
"startIndex"
|
|
1741
|
+
]
|
|
1742
|
+
},
|
|
1743
|
+
"_endIndex": {
|
|
1744
|
+
"oneof": [
|
|
1745
|
+
"endIndex"
|
|
1746
|
+
]
|
|
1747
|
+
}
|
|
1748
|
+
},
|
|
1749
|
+
"fields": {
|
|
1750
|
+
"startIndex": {
|
|
1751
|
+
"type": "int32",
|
|
1752
|
+
"id": 1,
|
|
1753
|
+
"options": {
|
|
1754
|
+
"proto3_optional": true
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
"endIndex": {
|
|
1758
|
+
"type": "int32",
|
|
1759
|
+
"id": 2,
|
|
1760
|
+
"options": {
|
|
1761
|
+
"proto3_optional": true
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
},
|
|
1766
|
+
"RoadFeatureState": {
|
|
1767
|
+
"values": {
|
|
1768
|
+
"ROAD_FEATURE_STATE_UNSPECIFIED": 0,
|
|
1769
|
+
"EXISTS": 1,
|
|
1770
|
+
"DOES_NOT_EXIST": 2
|
|
1771
|
+
}
|
|
1772
|
+
},
|
|
1773
|
+
"FlyoverInfo": {
|
|
1774
|
+
"fields": {
|
|
1775
|
+
"flyoverPresence": {
|
|
1776
|
+
"type": "RoadFeatureState",
|
|
1777
|
+
"id": 1,
|
|
1778
|
+
"options": {
|
|
1779
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
1780
|
+
}
|
|
1781
|
+
},
|
|
1782
|
+
"polylinePointIndex": {
|
|
1783
|
+
"type": "PolylinePointIndex",
|
|
1784
|
+
"id": 2
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
},
|
|
1788
|
+
"NarrowRoadInfo": {
|
|
1789
|
+
"fields": {
|
|
1790
|
+
"narrowRoadPresence": {
|
|
1791
|
+
"type": "RoadFeatureState",
|
|
1792
|
+
"id": 1,
|
|
1793
|
+
"options": {
|
|
1794
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
"polylinePointIndex": {
|
|
1798
|
+
"type": "PolylinePointIndex",
|
|
1799
|
+
"id": 2
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
},
|
|
1722
1805
|
"Route": {
|
|
1723
1806
|
"fields": {
|
|
1724
1807
|
"routeLabels": {
|
|
@@ -1776,6 +1859,10 @@
|
|
|
1776
1859
|
"routeToken": {
|
|
1777
1860
|
"type": "string",
|
|
1778
1861
|
"id": 12
|
|
1862
|
+
},
|
|
1863
|
+
"polylineDetails": {
|
|
1864
|
+
"type": "PolylineDetails",
|
|
1865
|
+
"id": 14
|
|
1779
1866
|
}
|
|
1780
1867
|
},
|
|
1781
1868
|
"nested": {
|
|
@@ -2089,7 +2176,8 @@
|
|
|
2089
2176
|
"ROUTE_LABEL_UNSPECIFIED": 0,
|
|
2090
2177
|
"DEFAULT_ROUTE": 1,
|
|
2091
2178
|
"DEFAULT_ROUTE_ALTERNATE": 2,
|
|
2092
|
-
"FUEL_EFFICIENT": 3
|
|
2179
|
+
"FUEL_EFFICIENT": 3,
|
|
2180
|
+
"SHORTER_DISTANCE": 4
|
|
2093
2181
|
}
|
|
2094
2182
|
},
|
|
2095
2183
|
"RouteTravelMode": {
|
|
@@ -2607,7 +2695,8 @@
|
|
|
2607
2695
|
"ReferenceRoute": {
|
|
2608
2696
|
"values": {
|
|
2609
2697
|
"REFERENCE_ROUTE_UNSPECIFIED": 0,
|
|
2610
|
-
"FUEL_EFFICIENT": 1
|
|
2698
|
+
"FUEL_EFFICIENT": 1,
|
|
2699
|
+
"SHORTER_DISTANCE": 2
|
|
2611
2700
|
}
|
|
2612
2701
|
},
|
|
2613
2702
|
"ExtraComputation": {
|
|
@@ -2616,7 +2705,9 @@
|
|
|
2616
2705
|
"TOLLS": 1,
|
|
2617
2706
|
"FUEL_CONSUMPTION": 2,
|
|
2618
2707
|
"TRAFFIC_ON_POLYLINE": 3,
|
|
2619
|
-
"HTML_FORMATTED_NAVIGATION_INSTRUCTIONS": 4
|
|
2708
|
+
"HTML_FORMATTED_NAVIGATION_INSTRUCTIONS": 4,
|
|
2709
|
+
"FLYOVER_INFO_ON_POLYLINE": 7,
|
|
2710
|
+
"NARROW_ROAD_INFO_ON_POLYLINE": 8
|
|
2620
2711
|
}
|
|
2621
2712
|
}
|
|
2622
2713
|
}
|
|
@@ -2986,14 +3077,33 @@
|
|
|
2986
3077
|
},
|
|
2987
3078
|
"api": {
|
|
2988
3079
|
"options": {
|
|
2989
|
-
"go_package": "google.golang.org/genproto/googleapis/api
|
|
3080
|
+
"go_package": "google.golang.org/genproto/googleapis/api;api",
|
|
2990
3081
|
"java_multiple_files": true,
|
|
2991
|
-
"java_outer_classname": "
|
|
3082
|
+
"java_outer_classname": "LaunchStageProto",
|
|
2992
3083
|
"java_package": "com.google.api",
|
|
2993
3084
|
"objc_class_prefix": "GAPI",
|
|
2994
3085
|
"cc_enable_arenas": true
|
|
2995
3086
|
},
|
|
2996
3087
|
"nested": {
|
|
3088
|
+
"fieldBehavior": {
|
|
3089
|
+
"rule": "repeated",
|
|
3090
|
+
"type": "google.api.FieldBehavior",
|
|
3091
|
+
"id": 1052,
|
|
3092
|
+
"extend": "google.protobuf.FieldOptions"
|
|
3093
|
+
},
|
|
3094
|
+
"FieldBehavior": {
|
|
3095
|
+
"values": {
|
|
3096
|
+
"FIELD_BEHAVIOR_UNSPECIFIED": 0,
|
|
3097
|
+
"OPTIONAL": 1,
|
|
3098
|
+
"REQUIRED": 2,
|
|
3099
|
+
"OUTPUT_ONLY": 3,
|
|
3100
|
+
"INPUT_ONLY": 4,
|
|
3101
|
+
"IMMUTABLE": 5,
|
|
3102
|
+
"UNORDERED_LIST": 6,
|
|
3103
|
+
"NON_EMPTY_DEFAULT": 7,
|
|
3104
|
+
"IDENTIFIER": 8
|
|
3105
|
+
}
|
|
3106
|
+
},
|
|
2997
3107
|
"http": {
|
|
2998
3108
|
"type": "HttpRule",
|
|
2999
3109
|
"id": 72295728,
|
|
@@ -3375,25 +3485,6 @@
|
|
|
3375
3485
|
"GA": 4,
|
|
3376
3486
|
"DEPRECATED": 5
|
|
3377
3487
|
}
|
|
3378
|
-
},
|
|
3379
|
-
"fieldBehavior": {
|
|
3380
|
-
"rule": "repeated",
|
|
3381
|
-
"type": "google.api.FieldBehavior",
|
|
3382
|
-
"id": 1052,
|
|
3383
|
-
"extend": "google.protobuf.FieldOptions"
|
|
3384
|
-
},
|
|
3385
|
-
"FieldBehavior": {
|
|
3386
|
-
"values": {
|
|
3387
|
-
"FIELD_BEHAVIOR_UNSPECIFIED": 0,
|
|
3388
|
-
"OPTIONAL": 1,
|
|
3389
|
-
"REQUIRED": 2,
|
|
3390
|
-
"OUTPUT_ONLY": 3,
|
|
3391
|
-
"INPUT_ONLY": 4,
|
|
3392
|
-
"IMMUTABLE": 5,
|
|
3393
|
-
"UNORDERED_LIST": 6,
|
|
3394
|
-
"NON_EMPTY_DEFAULT": 7,
|
|
3395
|
-
"IDENTIFIER": 8
|
|
3396
|
-
}
|
|
3397
3488
|
}
|
|
3398
3489
|
}
|
|
3399
3490
|
}
|
package/build/src/index.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "1.0",
|
|
3
|
+
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
|
|
4
|
+
"language": "typescript",
|
|
5
|
+
"protoPackage": "google.maps.routing.v2",
|
|
6
|
+
"libraryPackage": "@googlemaps/routing",
|
|
7
|
+
"services": {
|
|
8
|
+
"Routes": {
|
|
9
|
+
"clients": {
|
|
10
|
+
"grpc": {
|
|
11
|
+
"libraryClient": "RoutesClient",
|
|
12
|
+
"rpcs": {
|
|
13
|
+
"ComputeRoutes": {
|
|
14
|
+
"methods": [
|
|
15
|
+
"computeRoutes"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"ComputeRouteMatrix": {
|
|
19
|
+
"methods": [
|
|
20
|
+
"computeRouteMatrix"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"grpc-fallback": {
|
|
26
|
+
"libraryClient": "RoutesClient",
|
|
27
|
+
"rpcs": {
|
|
28
|
+
"ComputeRoutes": {
|
|
29
|
+
"methods": [
|
|
30
|
+
"computeRoutes"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
package/build/src/v2/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export declare class RoutesClient {
|
|
|
16
16
|
private _defaults;
|
|
17
17
|
private _universeDomain;
|
|
18
18
|
private _servicePath;
|
|
19
|
+
private _log;
|
|
19
20
|
auth: gax.GoogleAuth;
|
|
20
21
|
descriptors: Descriptors;
|
|
21
22
|
warn: (code: string, message: string, warnType?: string) => void;
|
|
@@ -47,7 +48,7 @@ export declare class RoutesClient {
|
|
|
47
48
|
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
48
49
|
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
49
50
|
* app is running in an environment which supports
|
|
50
|
-
* {@link https://
|
|
51
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
51
52
|
* your project ID will be detected automatically.
|
|
52
53
|
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
53
54
|
* API remote host.
|
|
@@ -225,7 +226,10 @@ export declare class RoutesClient {
|
|
|
225
226
|
* request in addition to the default route. A reference route is a route with
|
|
226
227
|
* a different route calculation objective than the default route. For example
|
|
227
228
|
* a `FUEL_EFFICIENT` reference route calculation takes into account various
|
|
228
|
-
* parameters that would generate an optimal fuel efficient route.
|
|
229
|
+
* parameters that would generate an optimal fuel efficient route. When using
|
|
230
|
+
* this feature, look for
|
|
231
|
+
* {@link protos.google.maps.routing.v2.Route.route_labels|`route_labels`} on the
|
|
232
|
+
* resulting routes.
|
|
229
233
|
* @param {number[]} [request.extraComputations]
|
|
230
234
|
* Optional. A list of extra computations which may be used to complete the
|
|
231
235
|
* request. Note: These extra computations may return extra fields on the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
exports.RoutesClient = void 0;
|
|
21
21
|
const stream_1 = require("stream");
|
|
22
22
|
const jsonProtos = require("../../protos/protos.json");
|
|
23
|
+
const google_gax_1 = require("google-gax");
|
|
23
24
|
/**
|
|
24
25
|
* Client JSON configuration object, loaded from
|
|
25
26
|
* `src/v2/routes_client_config.json`.
|
|
@@ -33,6 +34,26 @@ const version = require('../../../package.json').version;
|
|
|
33
34
|
* @memberof v2
|
|
34
35
|
*/
|
|
35
36
|
class RoutesClient {
|
|
37
|
+
_terminated = false;
|
|
38
|
+
_opts;
|
|
39
|
+
_providedCustomServicePath;
|
|
40
|
+
_gaxModule;
|
|
41
|
+
_gaxGrpc;
|
|
42
|
+
_protos;
|
|
43
|
+
_defaults;
|
|
44
|
+
_universeDomain;
|
|
45
|
+
_servicePath;
|
|
46
|
+
_log = google_gax_1.loggingUtils.log('routing');
|
|
47
|
+
auth;
|
|
48
|
+
descriptors = {
|
|
49
|
+
page: {},
|
|
50
|
+
stream: {},
|
|
51
|
+
longrunning: {},
|
|
52
|
+
batching: {},
|
|
53
|
+
};
|
|
54
|
+
warn;
|
|
55
|
+
innerApiCalls;
|
|
56
|
+
routesStub;
|
|
36
57
|
/**
|
|
37
58
|
* Construct an instance of RoutesClient.
|
|
38
59
|
*
|
|
@@ -55,7 +76,7 @@ class RoutesClient {
|
|
|
55
76
|
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
56
77
|
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
57
78
|
* app is running in an environment which supports
|
|
58
|
-
* {@link https://
|
|
79
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
59
80
|
* your project ID will be detected automatically.
|
|
60
81
|
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
61
82
|
* API remote host.
|
|
@@ -73,32 +94,28 @@ class RoutesClient {
|
|
|
73
94
|
* ```
|
|
74
95
|
*/
|
|
75
96
|
constructor(opts, gaxInstance) {
|
|
76
|
-
var _a, _b, _c, _d, _e;
|
|
77
|
-
this._terminated = false;
|
|
78
|
-
this.descriptors = {
|
|
79
|
-
page: {},
|
|
80
|
-
stream: {},
|
|
81
|
-
longrunning: {},
|
|
82
|
-
batching: {},
|
|
83
|
-
};
|
|
84
97
|
// Ensure that options include all the required fields.
|
|
85
98
|
const staticMembers = this.constructor;
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
if (opts?.universe_domain &&
|
|
100
|
+
opts?.universeDomain &&
|
|
101
|
+
opts?.universe_domain !== opts?.universeDomain) {
|
|
89
102
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
90
103
|
}
|
|
91
104
|
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
92
105
|
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
|
|
93
106
|
: undefined;
|
|
94
107
|
this._universeDomain =
|
|
95
|
-
|
|
108
|
+
opts?.universeDomain ??
|
|
109
|
+
opts?.universe_domain ??
|
|
110
|
+
universeDomainEnvVar ??
|
|
111
|
+
'googleapis.com';
|
|
96
112
|
this._servicePath = 'routes.' + this._universeDomain;
|
|
97
|
-
const servicePath =
|
|
98
|
-
this._providedCustomServicePath = !!(
|
|
99
|
-
const port =
|
|
100
|
-
const clientConfig =
|
|
101
|
-
const fallback =
|
|
113
|
+
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
114
|
+
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
115
|
+
const port = opts?.port || staticMembers.port;
|
|
116
|
+
const clientConfig = opts?.clientConfig ?? {};
|
|
117
|
+
const fallback = opts?.fallback ??
|
|
118
|
+
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
102
119
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
103
120
|
// Request numeric enum values if REST transport is used.
|
|
104
121
|
opts.numericEnums = true;
|
|
@@ -188,7 +205,7 @@ class RoutesClient {
|
|
|
188
205
|
const callPromise = this.routesStub.then(stub => (...args) => {
|
|
189
206
|
if (this._terminated) {
|
|
190
207
|
if (methodName in this.descriptors.stream) {
|
|
191
|
-
const stream = new stream_1.PassThrough();
|
|
208
|
+
const stream = new stream_1.PassThrough({ objectMode: true });
|
|
192
209
|
setImmediate(() => {
|
|
193
210
|
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.'));
|
|
194
211
|
});
|
|
@@ -281,7 +298,19 @@ class RoutesClient {
|
|
|
281
298
|
options.otherArgs = options.otherArgs || {};
|
|
282
299
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
283
300
|
this.initialize();
|
|
284
|
-
|
|
301
|
+
this._log.info('computeRoutes request %j', request);
|
|
302
|
+
const wrappedCallback = callback
|
|
303
|
+
? (error, response, options, rawResponse) => {
|
|
304
|
+
this._log.info('computeRoutes response %j', response);
|
|
305
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
306
|
+
}
|
|
307
|
+
: undefined;
|
|
308
|
+
return this.innerApiCalls
|
|
309
|
+
.computeRoutes(request, options, wrappedCallback)
|
|
310
|
+
?.then(([response, options, rawResponse]) => {
|
|
311
|
+
this._log.info('computeRoutes response %j', response);
|
|
312
|
+
return [response, options, rawResponse];
|
|
313
|
+
});
|
|
285
314
|
}
|
|
286
315
|
/**
|
|
287
316
|
* Takes in a list of origins and destinations and returns a stream containing
|
|
@@ -407,6 +436,7 @@ class RoutesClient {
|
|
|
407
436
|
options.otherArgs = options.otherArgs || {};
|
|
408
437
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
409
438
|
this.initialize();
|
|
439
|
+
this._log.info('computeRouteMatrix stream %j', options);
|
|
410
440
|
return this.innerApiCalls.computeRouteMatrix(request, options);
|
|
411
441
|
}
|
|
412
442
|
/**
|
|
@@ -418,6 +448,7 @@ class RoutesClient {
|
|
|
418
448
|
close() {
|
|
419
449
|
if (this.routesStub && !this._terminated) {
|
|
420
450
|
return this.routesStub.then(stub => {
|
|
451
|
+
this._log.info('ending gRPC channel');
|
|
421
452
|
this._terminated = true;
|
|
422
453
|
stub.close();
|
|
423
454
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[
|
|
2
|
+
"../../protos/google/geo/type/viewport.proto",
|
|
3
|
+
"../../protos/google/maps/routing/v2/fallback_info.proto",
|
|
4
|
+
"../../protos/google/maps/routing/v2/geocoding_results.proto",
|
|
5
|
+
"../../protos/google/maps/routing/v2/localized_time.proto",
|
|
6
|
+
"../../protos/google/maps/routing/v2/location.proto",
|
|
7
|
+
"../../protos/google/maps/routing/v2/maneuver.proto",
|
|
8
|
+
"../../protos/google/maps/routing/v2/navigation_instruction.proto",
|
|
9
|
+
"../../protos/google/maps/routing/v2/polyline.proto",
|
|
10
|
+
"../../protos/google/maps/routing/v2/polyline_details.proto",
|
|
11
|
+
"../../protos/google/maps/routing/v2/route.proto",
|
|
12
|
+
"../../protos/google/maps/routing/v2/route_label.proto",
|
|
13
|
+
"../../protos/google/maps/routing/v2/route_modifiers.proto",
|
|
14
|
+
"../../protos/google/maps/routing/v2/route_travel_mode.proto",
|
|
15
|
+
"../../protos/google/maps/routing/v2/routes_service.proto",
|
|
16
|
+
"../../protos/google/maps/routing/v2/routing_preference.proto",
|
|
17
|
+
"../../protos/google/maps/routing/v2/speed_reading_interval.proto",
|
|
18
|
+
"../../protos/google/maps/routing/v2/toll_info.proto",
|
|
19
|
+
"../../protos/google/maps/routing/v2/toll_passes.proto",
|
|
20
|
+
"../../protos/google/maps/routing/v2/traffic_model.proto",
|
|
21
|
+
"../../protos/google/maps/routing/v2/transit.proto",
|
|
22
|
+
"../../protos/google/maps/routing/v2/transit_preferences.proto",
|
|
23
|
+
"../../protos/google/maps/routing/v2/units.proto",
|
|
24
|
+
"../../protos/google/maps/routing/v2/vehicle_emission_type.proto",
|
|
25
|
+
"../../protos/google/maps/routing/v2/vehicle_info.proto",
|
|
26
|
+
"../../protos/google/maps/routing/v2/waypoint.proto"
|
|
27
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@googlemaps/routing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": " client for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,26 +46,26 @@
|
|
|
46
46
|
"test": "c8 mocha build/test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"google-gax": "^
|
|
49
|
+
"google-gax": "^5.0.0-rc.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/mocha": "^
|
|
53
|
-
"@types/node": "^
|
|
54
|
-
"@types/sinon": "^17.0.
|
|
55
|
-
"c8": "^
|
|
56
|
-
"gapic-tools": "^0.
|
|
57
|
-
"gts": "^
|
|
58
|
-
"jsdoc": "^4.0.
|
|
52
|
+
"@types/mocha": "^10.0.10",
|
|
53
|
+
"@types/node": "^22.13.9",
|
|
54
|
+
"@types/sinon": "^17.0.4",
|
|
55
|
+
"c8": "^10.1.3",
|
|
56
|
+
"gapic-tools": "^1.0.0",
|
|
57
|
+
"gts": "^6.0.2",
|
|
58
|
+
"jsdoc": "^4.0.4",
|
|
59
59
|
"jsdoc-fresh": "^3.0.0",
|
|
60
60
|
"jsdoc-region-tag": "^3.0.0",
|
|
61
|
-
"linkinator": "
|
|
62
|
-
"long": "^5.
|
|
63
|
-
"mocha": "^
|
|
64
|
-
"pack-n-play": "^
|
|
65
|
-
"sinon": "^
|
|
66
|
-
"typescript": "^5.
|
|
61
|
+
"linkinator": "^6.1.2",
|
|
62
|
+
"long": "^5.3.1",
|
|
63
|
+
"mocha": "^11.1.0",
|
|
64
|
+
"pack-n-play": "^3.0.0",
|
|
65
|
+
"sinon": "^19.0.2",
|
|
66
|
+
"typescript": "^5.8.2"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
69
|
+
"node": ">=18"
|
|
70
70
|
}
|
|
71
71
|
}
|