apple-maps-server-sdk 1.1.3 → 1.1.5

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/lib/index.d.ts CHANGED
@@ -30,4 +30,5 @@ declare class AppleMaps {
30
30
  */
31
31
  search(input: SearchInput): Promise<SearchResponse>;
32
32
  }
33
+ export type { GeocodeInput, GeocodeResponse, ReverseGeocodeInput, ReverseGeocodeResponse, ETAInput, ETAResponse, SearchInput, SearchResponse, };
33
34
  export default AppleMaps;
package/lib/index.js CHANGED
@@ -71,10 +71,12 @@ class AppleMaps {
71
71
  if (err instanceof axios_1.AxiosError) {
72
72
  if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
73
73
  if (this.accessTokenRetries > 3) {
74
+ this.accessTokenRetries = 0;
74
75
  throw new Error("Unable to get access token");
75
76
  }
76
77
  this.accessTokenRetries++;
77
78
  yield this.getAccessToken();
79
+ this.accessTokenRetries = 0;
78
80
  return callback();
79
81
  }
80
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-maps-server-sdk",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "An SDK for the Apple Maps Server API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/index.ts CHANGED
@@ -56,12 +56,14 @@ class AppleMaps {
56
56
  if (err instanceof AxiosError) {
57
57
  if (err.response?.status === 401) {
58
58
  if (this.accessTokenRetries > 3) {
59
+ this.accessTokenRetries = 0;
59
60
  throw new Error("Unable to get access token");
60
61
  }
61
62
 
62
63
  this.accessTokenRetries++;
63
64
 
64
65
  await this.getAccessToken();
66
+ this.accessTokenRetries = 0;
65
67
  return callback();
66
68
  }
67
69
  }
@@ -144,4 +146,15 @@ class AppleMaps {
144
146
  }
145
147
  }
146
148
 
149
+ export type {
150
+ GeocodeInput,
151
+ GeocodeResponse,
152
+ ReverseGeocodeInput,
153
+ ReverseGeocodeResponse,
154
+ ETAInput,
155
+ ETAResponse,
156
+ SearchInput,
157
+ SearchResponse,
158
+ };
159
+
147
160
  export default AppleMaps;