@chaosity/location-client 0.11.0 → 0.13.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 +207 -40
- package/dist/adapters/GeoPlaces.d.ts +7 -1
- package/dist/adapters/GeoPlaces.js +64 -22
- package/dist/auth/TokenProvider.d.ts +24 -1
- package/dist/auth/TokenProvider.js +81 -12
- package/dist/auth/tokenHold.d.ts +81 -0
- package/dist/auth/tokenHold.js +174 -0
- package/dist/aws.d.ts +4 -0
- package/dist/aws.js +2 -0
- package/dist/cjs/adapters/GeoPlaces.d.ts +7 -1
- package/dist/cjs/adapters/GeoPlaces.js +63 -21
- package/dist/cjs/auth/TokenProvider.d.ts +24 -1
- package/dist/cjs/auth/TokenProvider.js +81 -12
- package/dist/cjs/auth/tokenHold.d.ts +81 -0
- package/dist/cjs/auth/tokenHold.js +181 -0
- package/dist/cjs/aws.d.ts +4 -0
- package/dist/cjs/aws.js +155 -0
- package/dist/cjs/client/GeoPlacesClient.d.ts +23 -3
- package/dist/cjs/client/GeoPlacesClient.js +50 -32
- package/dist/cjs/client/commands.d.ts +2 -3
- package/dist/cjs/errors/LocationServiceException.d.ts +30 -2
- package/dist/cjs/errors/LocationServiceException.js +53 -1
- package/dist/cjs/index.d.ts +5 -4
- package/dist/cjs/index.js +13 -8
- package/dist/cjs/maps/createTransformRequest.d.ts +25 -0
- package/dist/cjs/maps/createTransformRequest.js +1 -0
- package/dist/cjs/maps/mapPoi.d.ts +10 -5
- package/dist/cjs/maps/mapPoi.js +14 -5
- package/dist/cjs/maps/mapStyle.d.ts +9 -2
- package/dist/cjs/maps/mapStyle.js +16 -12
- package/dist/cjs/maps/mapToken.d.ts +84 -0
- package/dist/cjs/maps/mapToken.js +126 -0
- package/dist/cjs/maps/staticMap.d.ts +7 -3
- package/dist/cjs/maps/staticMap.js +13 -12
- package/dist/cjs/server/LocationServiceConnector.d.ts +20 -3
- package/dist/cjs/server/LocationServiceConnector.js +20 -22
- package/dist/cjs/server/getClientConfig.d.ts +10 -5
- package/dist/cjs/server/getClientConfig.js +43 -19
- package/dist/cjs/server/index.d.ts +1 -1
- package/dist/cjs/transport/errors.d.ts +14 -8
- package/dist/cjs/transport/errors.js +26 -18
- package/dist/cjs/transport/http.d.ts +18 -0
- package/dist/cjs/transport/http.js +39 -1
- package/dist/cjs/types/index.d.ts +26 -0
- package/dist/client/GeoPlacesClient.d.ts +23 -3
- package/dist/client/GeoPlacesClient.js +52 -34
- package/dist/client/commands.d.ts +2 -3
- package/dist/errors/LocationServiceException.d.ts +30 -2
- package/dist/errors/LocationServiceException.js +52 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +11 -7
- package/dist/maps/createTransformRequest.d.ts +25 -0
- package/dist/maps/createTransformRequest.js +1 -1
- package/dist/maps/mapPoi.d.ts +10 -5
- package/dist/maps/mapPoi.js +14 -5
- package/dist/maps/mapStyle.d.ts +9 -2
- package/dist/maps/mapStyle.js +17 -13
- package/dist/maps/mapToken.d.ts +84 -0
- package/dist/maps/mapToken.js +122 -0
- package/dist/maps/staticMap.d.ts +7 -3
- package/dist/maps/staticMap.js +14 -13
- package/dist/server/LocationServiceConnector.d.ts +20 -3
- package/dist/server/LocationServiceConnector.js +22 -24
- package/dist/server/getClientConfig.d.ts +10 -5
- package/dist/server/getClientConfig.js +43 -19
- package/dist/server/index.d.ts +1 -1
- package/dist/transport/errors.d.ts +14 -8
- package/dist/transport/errors.js +27 -19
- package/dist/transport/http.d.ts +18 -0
- package/dist/transport/http.js +37 -1
- package/dist/types/index.d.ts +26 -0
- package/package.json +3 -3
|
@@ -7,8 +7,14 @@ exports.TokenProvider = void 0;
|
|
|
7
7
|
const debug_1 = __importDefault(require("debug"));
|
|
8
8
|
const LocationServiceException_js_1 = require("../errors/LocationServiceException.js");
|
|
9
9
|
const http_js_1 = require("../transport/http.js");
|
|
10
|
+
const tokenHold_js_1 = require("./tokenHold.js");
|
|
10
11
|
const tokenRefresh_js_1 = require("./tokenRefresh.js");
|
|
11
12
|
const log = (0, debug_1.default)('location-client:auth');
|
|
13
|
+
/**
|
|
14
|
+
* #63: how close to its own `exp` a cached token may still be sent when a
|
|
15
|
+
* refresh fails. A margin for the clocks of this host and the API to disagree.
|
|
16
|
+
*/
|
|
17
|
+
const EXPIRY_SKEW_MS = 5000;
|
|
12
18
|
/**
|
|
13
19
|
* TokenProvider - SERVER-SIDE ONLY
|
|
14
20
|
*
|
|
@@ -39,6 +45,8 @@ const log = (0, debug_1.default)('location-client:auth');
|
|
|
39
45
|
*/
|
|
40
46
|
class TokenProvider {
|
|
41
47
|
constructor(config) {
|
|
48
|
+
/** A refusal or a Retry-After from `/auth/token`, until it lapses (#38). */
|
|
49
|
+
this.hold = new tokenHold_js_1.TokenHold();
|
|
42
50
|
// Runtime check: prevent usage in browser
|
|
43
51
|
if (typeof window !== 'undefined') {
|
|
44
52
|
throw new Error('TokenProvider cannot be used in browser environments. ' +
|
|
@@ -48,7 +56,7 @@ class TokenProvider {
|
|
|
48
56
|
log('Initializing TokenProvider for %s', config.apiUrl);
|
|
49
57
|
this.config = config;
|
|
50
58
|
}
|
|
51
|
-
async getToken(forceRefresh = false) {
|
|
59
|
+
async getToken(forceRefresh = false, options = {}) {
|
|
52
60
|
if (!forceRefresh && this.cachedToken && !this.isExpired()) {
|
|
53
61
|
const expiresIn = this.cachedExpiresAt
|
|
54
62
|
? Math.floor((this.cachedExpiresAt - Date.now()) / 1000)
|
|
@@ -60,10 +68,27 @@ class TokenProvider {
|
|
|
60
68
|
expiresAt: this.cachedExpiresAt,
|
|
61
69
|
};
|
|
62
70
|
}
|
|
71
|
+
// The endpoint refused these credentials, or asked us to wait, a moment
|
|
72
|
+
// ago: answer with that rather than ask again (#38). Forced or not — a
|
|
73
|
+
// forced refresh asks for a different token, and these credentials will
|
|
74
|
+
// not get one until the hold lapses.
|
|
75
|
+
const held = this.hold.check()?.error;
|
|
76
|
+
if (held) {
|
|
77
|
+
log('Token request held: %s', held.message);
|
|
78
|
+
const fallback = this.fallback(forceRefresh, options, held);
|
|
79
|
+
if (fallback)
|
|
80
|
+
return fallback;
|
|
81
|
+
throw held;
|
|
82
|
+
}
|
|
63
83
|
// If token fetch is already in progress, wait for it
|
|
64
84
|
if (this.tokenPromise) {
|
|
65
85
|
log('Token fetch in progress, waiting for existing request...');
|
|
66
|
-
return this.tokenPromise
|
|
86
|
+
return this.tokenPromise.catch((error) => {
|
|
87
|
+
const fallback = this.fallback(forceRefresh, options, error);
|
|
88
|
+
if (fallback)
|
|
89
|
+
return fallback;
|
|
90
|
+
throw error;
|
|
91
|
+
});
|
|
67
92
|
}
|
|
68
93
|
// Start new token fetch
|
|
69
94
|
const reason = forceRefresh
|
|
@@ -77,6 +102,12 @@ class TokenProvider {
|
|
|
77
102
|
const result = await this.tokenPromise;
|
|
78
103
|
return result;
|
|
79
104
|
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
const fallback = this.fallback(forceRefresh, options, error);
|
|
107
|
+
if (fallback)
|
|
108
|
+
return fallback;
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
80
111
|
finally {
|
|
81
112
|
// Clear promise after completion (success or failure)
|
|
82
113
|
this.tokenPromise = undefined;
|
|
@@ -99,16 +130,32 @@ class TokenProvider {
|
|
|
99
130
|
async fetchToken() {
|
|
100
131
|
const { clientId, clientSecret, apiUrl } = this.config;
|
|
101
132
|
const credentials = btoa(`${clientId}:${clientSecret}`);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
133
|
+
let data;
|
|
134
|
+
try {
|
|
135
|
+
data = await (0, http_js_1.requestJson)(`${apiUrl}/auth/token`, {
|
|
136
|
+
method: 'POST',
|
|
137
|
+
headers: {
|
|
138
|
+
Authorization: `Basic ${credentials}`,
|
|
139
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
140
|
+
},
|
|
141
|
+
body: new URLSearchParams({
|
|
142
|
+
grant_type: 'client_credentials',
|
|
143
|
+
}).toString(),
|
|
144
|
+
}, { retry: { maxAttempts: 3 } });
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
// Remembered, so the next call is answered without a request (#38), and
|
|
148
|
+
// a Retry-After is honoured across calls rather than only within this
|
|
149
|
+
// one (#63).
|
|
150
|
+
this.hold.remember(error);
|
|
151
|
+
// A refusal is about the credentials, so every token they minted is
|
|
152
|
+
// refused too — a suspended application's on its next use, a rotated
|
|
153
|
+
// secret's at once. Never hand the cached one out again. A Retry-After
|
|
154
|
+
// says nothing about it, and keeps it.
|
|
155
|
+
if ((0, tokenHold_js_1.isTokenRefusal)(error))
|
|
156
|
+
this.clearCache();
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
112
159
|
if (!data.access_token) {
|
|
113
160
|
throw new LocationServiceException_js_1.LocationServiceException({
|
|
114
161
|
code: 'InvalidCredentialsException',
|
|
@@ -116,6 +163,7 @@ class TokenProvider {
|
|
|
116
163
|
details: { source: 'client' },
|
|
117
164
|
});
|
|
118
165
|
}
|
|
166
|
+
this.hold.forget();
|
|
119
167
|
this.cachedToken = data.access_token;
|
|
120
168
|
// The token's own `exp` claim first — it is the only value that cannot
|
|
121
169
|
// disagree with what the API will actually accept. `expires_at` and
|
|
@@ -131,6 +179,27 @@ class TokenProvider {
|
|
|
131
179
|
expiresAt: this.cachedExpiresAt,
|
|
132
180
|
};
|
|
133
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* #63: the cached token, when the caller asked for it and the failure is one
|
|
184
|
+
* that waiting fixes. A refusal has already cleared the cache in fetchToken,
|
|
185
|
+
* so it can never be the cached token handed back here.
|
|
186
|
+
*/
|
|
187
|
+
fallback(forceRefresh, options, error) {
|
|
188
|
+
if (forceRefresh || !options.cachedUntilExpiry)
|
|
189
|
+
return undefined;
|
|
190
|
+
if ((0, tokenHold_js_1.isTokenRefusal)(error))
|
|
191
|
+
return undefined;
|
|
192
|
+
if (!this.cachedToken || !this.cachedExpiresAt)
|
|
193
|
+
return undefined;
|
|
194
|
+
if (Date.now() >= this.cachedExpiresAt - EXPIRY_SKEW_MS)
|
|
195
|
+
return undefined;
|
|
196
|
+
log('Refresh failed (%s); the cached token is valid for %ds more, sending it', error instanceof Error ? error.message : String(error), Math.floor((this.cachedExpiresAt - Date.now()) / 1000));
|
|
197
|
+
return {
|
|
198
|
+
success: true,
|
|
199
|
+
token: this.cachedToken,
|
|
200
|
+
expiresAt: this.cachedExpiresAt,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
134
203
|
isExpired(bufferSeconds = tokenRefresh_js_1.TOKEN_REFRESH_BUFFER_SECONDS) {
|
|
135
204
|
if (!this.cachedExpiresAt)
|
|
136
205
|
return true;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { LocationServiceException } from '../errors/LocationServiceException.js';
|
|
2
|
+
/**
|
|
3
|
+
* How long a refusal is remembered: a token the API refused, or a token
|
|
4
|
+
* request `/auth/token` refused (#38).
|
|
5
|
+
*
|
|
6
|
+
* A refusal — a 401 or a 403 — is not something asking again can change. A
|
|
7
|
+
* suspended application is refused on every data route and on `/auth/token`
|
|
8
|
+
* alike, and nothing used to remember that, so every request a busy server
|
|
9
|
+
* served paid for a doomed data request and a doomed token request, all
|
|
10
|
+
* against the application's own token-route throttle.
|
|
11
|
+
*
|
|
12
|
+
* Thirty seconds is short beside the API's own waits: it accepts a
|
|
13
|
+
* reactivated application again within five minutes, and refuses a newly
|
|
14
|
+
* created or reactivated one for up to about thirty seconds while its key goes
|
|
15
|
+
* live. So this side adds at most thirty seconds to either, and turns a
|
|
16
|
+
* request rate into a trickle meanwhile.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TOKEN_REFUSAL_HOLD_MS = 30000;
|
|
19
|
+
/**
|
|
20
|
+
* A 401 or a 403: the server refused, and a retry gets the same answer.
|
|
21
|
+
*
|
|
22
|
+
* Wider than `isTokenRejected`, which is the 401 a new token can fix. This is
|
|
23
|
+
* about the token SOURCE: `/auth/token` refusing the credentials (401), or
|
|
24
|
+
* the application's key not live on its plan (403), and neither changes by
|
|
25
|
+
* asking again.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isTokenRefusal(err: unknown): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* How long `err` says asking again cannot help, in milliseconds; 0 when it
|
|
30
|
+
* says nothing, and the next call may ask at once.
|
|
31
|
+
*
|
|
32
|
+
* Only the server's own word counts: a refusal, or a `Retry-After`. A network
|
|
33
|
+
* fault, a timeout or a 500 carries neither, so it is not remembered, and the
|
|
34
|
+
* next call tries again as it always has — the transport has already retried
|
|
35
|
+
* it with backoff inside the call that failed.
|
|
36
|
+
*/
|
|
37
|
+
export declare function holdFor(err: unknown): number;
|
|
38
|
+
/**
|
|
39
|
+
* One remembered failure, re-thrown instead of asking again until it lapses.
|
|
40
|
+
*
|
|
41
|
+
* Shared by every place that used to ask again on every call: the server
|
|
42
|
+
* `TokenProvider` (a refused or throttled token request), and the two send
|
|
43
|
+
* paths (a token the API refused, and the refresh that could not replace it,
|
|
44
|
+
* or — in `GeoPlacesClient` — could not supply a first one). A send path
|
|
45
|
+
* remembers the failure against the token it concerns, because a DIFFERENT
|
|
46
|
+
* token is a new situation — a background refresh that landed, or a caller's
|
|
47
|
+
* own source that moved on — and ends the hold at once.
|
|
48
|
+
*
|
|
49
|
+
* `askAgain` is the one case where the source may still be asked: the API
|
|
50
|
+
* refused the token, and the refresh that followed failed with nothing to say
|
|
51
|
+
* about when to try again — a network fault, or a rejection that lost its
|
|
52
|
+
* fields crossing a Server Action boundary, as `@chaosity/location-client-react`
|
|
53
|
+
* delivers one. The token is still refused, so it is not sent again; the
|
|
54
|
+
* source is asked on the next send, as it always was.
|
|
55
|
+
*/
|
|
56
|
+
export declare class TokenHold {
|
|
57
|
+
private held?;
|
|
58
|
+
/** Remember `err` for as long as it says; a failure that says nothing is not remembered. */
|
|
59
|
+
remember(err: unknown, token?: string, { askAgain }?: {
|
|
60
|
+
askAgain?: boolean | undefined;
|
|
61
|
+
}): void;
|
|
62
|
+
/**
|
|
63
|
+
* The remembered failure while it stands, as a new exception to throw — for
|
|
64
|
+
* `token`, if one was remembered with it — and whether the source may still
|
|
65
|
+
* be asked. Anything else ends the hold.
|
|
66
|
+
*/
|
|
67
|
+
check(token?: string): {
|
|
68
|
+
error: LocationServiceException;
|
|
69
|
+
askAgain: boolean;
|
|
70
|
+
} | undefined;
|
|
71
|
+
forget(): void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Send with `token`, and after a 401 once more with `refresh()`'s token when it
|
|
75
|
+
* is a DIFFERENT one, remembering on `hold` what the API and the source said,
|
|
76
|
+
* against the token it concerns (#38).
|
|
77
|
+
*
|
|
78
|
+
* The one copy of the 401 retry: both send paths and the two map fetches (#72)
|
|
79
|
+
* call it, so when to ask again is decided here and nowhere else.
|
|
80
|
+
*/
|
|
81
|
+
export declare function sendRetryingOnce<T>(hold: TokenHold, token: string, send: (token: string) => Promise<T>, refresh: () => Promise<string | undefined>, onRetry?: () => void): Promise<T>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenHold = exports.TOKEN_REFUSAL_HOLD_MS = void 0;
|
|
4
|
+
exports.isTokenRefusal = isTokenRefusal;
|
|
5
|
+
exports.holdFor = holdFor;
|
|
6
|
+
exports.sendRetryingOnce = sendRetryingOnce;
|
|
7
|
+
const LocationServiceException_js_1 = require("../errors/LocationServiceException.js");
|
|
8
|
+
const errors_js_1 = require("../transport/errors.js");
|
|
9
|
+
/**
|
|
10
|
+
* How long a refusal is remembered: a token the API refused, or a token
|
|
11
|
+
* request `/auth/token` refused (#38).
|
|
12
|
+
*
|
|
13
|
+
* A refusal — a 401 or a 403 — is not something asking again can change. A
|
|
14
|
+
* suspended application is refused on every data route and on `/auth/token`
|
|
15
|
+
* alike, and nothing used to remember that, so every request a busy server
|
|
16
|
+
* served paid for a doomed data request and a doomed token request, all
|
|
17
|
+
* against the application's own token-route throttle.
|
|
18
|
+
*
|
|
19
|
+
* Thirty seconds is short beside the API's own waits: it accepts a
|
|
20
|
+
* reactivated application again within five minutes, and refuses a newly
|
|
21
|
+
* created or reactivated one for up to about thirty seconds while its key goes
|
|
22
|
+
* live. So this side adds at most thirty seconds to either, and turns a
|
|
23
|
+
* request rate into a trickle meanwhile.
|
|
24
|
+
*/
|
|
25
|
+
exports.TOKEN_REFUSAL_HOLD_MS = 30000;
|
|
26
|
+
/**
|
|
27
|
+
* A 401 or a 403: the server refused, and a retry gets the same answer.
|
|
28
|
+
*
|
|
29
|
+
* Wider than `isTokenRejected`, which is the 401 a new token can fix. This is
|
|
30
|
+
* about the token SOURCE: `/auth/token` refusing the credentials (401), or
|
|
31
|
+
* the application's key not live on its plan (403), and neither changes by
|
|
32
|
+
* asking again.
|
|
33
|
+
*/
|
|
34
|
+
function isTokenRefusal(err) {
|
|
35
|
+
return (err instanceof LocationServiceException_js_1.LocationServiceException &&
|
|
36
|
+
(err.statusCode === 401 || err.statusCode === 403));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* How long `err` says asking again cannot help, in milliseconds; 0 when it
|
|
40
|
+
* says nothing, and the next call may ask at once.
|
|
41
|
+
*
|
|
42
|
+
* Only the server's own word counts: a refusal, or a `Retry-After`. A network
|
|
43
|
+
* fault, a timeout or a 500 carries neither, so it is not remembered, and the
|
|
44
|
+
* next call tries again as it always has — the transport has already retried
|
|
45
|
+
* it with backoff inside the call that failed.
|
|
46
|
+
*/
|
|
47
|
+
function holdFor(err) {
|
|
48
|
+
if (!(err instanceof LocationServiceException_js_1.LocationServiceException))
|
|
49
|
+
return 0;
|
|
50
|
+
return Math.max(isTokenRefusal(err) ? exports.TOKEN_REFUSAL_HOLD_MS : 0, err.retryAfterMs ?? 0);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* One remembered failure, re-thrown instead of asking again until it lapses.
|
|
54
|
+
*
|
|
55
|
+
* Shared by every place that used to ask again on every call: the server
|
|
56
|
+
* `TokenProvider` (a refused or throttled token request), and the two send
|
|
57
|
+
* paths (a token the API refused, and the refresh that could not replace it,
|
|
58
|
+
* or — in `GeoPlacesClient` — could not supply a first one). A send path
|
|
59
|
+
* remembers the failure against the token it concerns, because a DIFFERENT
|
|
60
|
+
* token is a new situation — a background refresh that landed, or a caller's
|
|
61
|
+
* own source that moved on — and ends the hold at once.
|
|
62
|
+
*
|
|
63
|
+
* `askAgain` is the one case where the source may still be asked: the API
|
|
64
|
+
* refused the token, and the refresh that followed failed with nothing to say
|
|
65
|
+
* about when to try again — a network fault, or a rejection that lost its
|
|
66
|
+
* fields crossing a Server Action boundary, as `@chaosity/location-client-react`
|
|
67
|
+
* delivers one. The token is still refused, so it is not sent again; the
|
|
68
|
+
* source is asked on the next send, as it always was.
|
|
69
|
+
*/
|
|
70
|
+
class TokenHold {
|
|
71
|
+
/** Remember `err` for as long as it says; a failure that says nothing is not remembered. */
|
|
72
|
+
remember(err, token, { askAgain = false } = {}) {
|
|
73
|
+
const ms = holdFor(err);
|
|
74
|
+
if (ms > 0) {
|
|
75
|
+
this.held = {
|
|
76
|
+
error: err,
|
|
77
|
+
until: Date.now() + ms,
|
|
78
|
+
token,
|
|
79
|
+
askAgain,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The remembered failure while it stands, as a new exception to throw — for
|
|
85
|
+
* `token`, if one was remembered with it — and whether the source may still
|
|
86
|
+
* be asked. Anything else ends the hold.
|
|
87
|
+
*/
|
|
88
|
+
check(token) {
|
|
89
|
+
const held = this.held;
|
|
90
|
+
if (!held)
|
|
91
|
+
return undefined;
|
|
92
|
+
const remaining = held.until - Date.now();
|
|
93
|
+
if (remaining <= 0 || (held.token !== undefined && held.token !== token)) {
|
|
94
|
+
this.held = undefined;
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
const { error, askAgain } = held;
|
|
98
|
+
return {
|
|
99
|
+
askAgain,
|
|
100
|
+
error: new LocationServiceException_js_1.LocationServiceException({
|
|
101
|
+
code: error.code,
|
|
102
|
+
message: error.message,
|
|
103
|
+
statusCode: error.statusCode,
|
|
104
|
+
requestId: error.requestId,
|
|
105
|
+
details: error.details,
|
|
106
|
+
// What is left of a Retry-After, so a caller that schedules on it waits
|
|
107
|
+
// the right amount. A refusal carries none, and gains none here.
|
|
108
|
+
retryAfterMs: error.retryAfterMs === undefined ? undefined : remaining,
|
|
109
|
+
cause: error,
|
|
110
|
+
}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
forget() {
|
|
114
|
+
this.held = undefined;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.TokenHold = TokenHold;
|
|
118
|
+
/**
|
|
119
|
+
* Send with `token`, and after a 401 once more with `refresh()`'s token when it
|
|
120
|
+
* is a DIFFERENT one, remembering on `hold` what the API and the source said,
|
|
121
|
+
* against the token it concerns (#38).
|
|
122
|
+
*
|
|
123
|
+
* The one copy of the 401 retry: both send paths and the two map fetches (#72)
|
|
124
|
+
* call it, so when to ask again is decided here and nowhere else.
|
|
125
|
+
*/
|
|
126
|
+
async function sendRetryingOnce(hold, token, send, refresh, onRetry) {
|
|
127
|
+
// This token was refused a moment ago and nothing has replaced it: answer
|
|
128
|
+
// with that refusal rather than send it, and ask the source again. A
|
|
129
|
+
// different token ends the hold. When the refresh that followed said nothing
|
|
130
|
+
// about when to ask again, it is asked now — but the refused token is still
|
|
131
|
+
// not sent.
|
|
132
|
+
const held = hold.check(token);
|
|
133
|
+
if (held && !held.askAgain)
|
|
134
|
+
throw held.error;
|
|
135
|
+
let rejected = held?.error;
|
|
136
|
+
if (!held) {
|
|
137
|
+
try {
|
|
138
|
+
return await send(token);
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
if (!(0, errors_js_1.isTokenRejected)(err))
|
|
142
|
+
throw err;
|
|
143
|
+
rejected = err;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// One retry, and only when the replacement is genuinely a different token.
|
|
147
|
+
// That single comparison covers every source: a fixed `token` string, a
|
|
148
|
+
// `getToken` that ignores `forceRefresh`, a `refreshToken` that hands back
|
|
149
|
+
// what it had, and a cached token the API has revoked before its `exp` —
|
|
150
|
+
// re-sending any of them is a second doomed request for the same answer.
|
|
151
|
+
let fresh;
|
|
152
|
+
try {
|
|
153
|
+
fresh = await refresh();
|
|
154
|
+
}
|
|
155
|
+
catch (refusal) {
|
|
156
|
+
// A rotated secret's token route refuses the refresh as the data route
|
|
157
|
+
// refused its token. Without this, every send asked again. A refusal that
|
|
158
|
+
// says nothing — a network fault, or a Server Action's error without its
|
|
159
|
+
// fields — leaves the source to be asked again, but not the token sent.
|
|
160
|
+
if (holdFor(refusal) > 0)
|
|
161
|
+
hold.remember(refusal, token);
|
|
162
|
+
// Only when no hold stands: one already standing keeps its own end, so
|
|
163
|
+
// the refused token is tried again once per hold rather than never.
|
|
164
|
+
else if (!held)
|
|
165
|
+
hold.remember(rejected, token, { askAgain: true });
|
|
166
|
+
throw refusal;
|
|
167
|
+
}
|
|
168
|
+
if (!fresh || fresh === token) {
|
|
169
|
+
hold.remember(rejected, token);
|
|
170
|
+
throw rejected;
|
|
171
|
+
}
|
|
172
|
+
onRetry?.();
|
|
173
|
+
try {
|
|
174
|
+
return await send(fresh);
|
|
175
|
+
}
|
|
176
|
+
catch (again) {
|
|
177
|
+
if ((0, errors_js_1.isTokenRejected)(again))
|
|
178
|
+
hold.remember(again, fresh);
|
|
179
|
+
throw again;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type * from '@aws-sdk/client-geo-places';
|
|
2
|
+
export { $Command, AccessDeniedException, AccessDeniedException$, AccessPoint$, AccessPointType, AccessRestriction$, Address$, AddressComponentMatchScores$, AddressComponentPhonemes$, AddressTranslationComponent, AdminNames$, AdminNamesPreference, Autocomplete$, AutocompleteAdditionalFeature, AutocompleteAddressHighlights$, AutocompleteFilter$, AutocompleteFilterPlaceType, AutocompleteHighlights$, AutocompleteIntendedUse, AutocompleteRequest$, AutocompleteResponse$, AutocompleteResultItem$, BusinessChain$, Category$, ComponentMatchScores$, ContactDetails$, Contacts$, Country$, CountryHighlights$, CrossReference$, FilterCircle$, FoodType$, GeoPlacesServiceException, GeoPlacesServiceException$, Geocode$, GeocodeAdditionalFeature, GeocodeAddressNamesMode, GeocodeFilter$, GeocodeFilterPlaceType, GeocodeIntendedUse, GeocodeParsedQuery$, GeocodeParsedQueryAddressComponents$, GeocodeQueryComponents$, GeocodeRequest$, GeocodeResponse$, GeocodeResultItem$, GetPlace$, GetPlaceAdditionalFeature, GetPlaceAddressNamesMode, GetPlaceIntendedUse, GetPlaceRequest$, GetPlaceResponse$, Highlight$, InternalServerException, InternalServerException$, Intersection$, MatchScoreDetails$, OpeningHours$, OpeningHoursComponents$, ParsedQueryComponent$, ParsedQuerySecondaryAddressComponent$, PhonemeDetails$, PhonemeTranscription$, PlaceAttribute, PlaceType, PostalAuthority, PostalCodeDetails$, PostalCodeMode, PostalCodeType, QueryRefinement$, QueryType, RecordTypeCode, Region$, RegionHighlights$, RelatedPlace$, ReverseGeocode$, ReverseGeocodeAdditionalFeature, ReverseGeocodeAddressNamesMode, ReverseGeocodeFilter$, ReverseGeocodeFilterPlaceType, ReverseGeocodeIntendedUse, ReverseGeocodeRequest$, ReverseGeocodeResponse$, ReverseGeocodeResultItem$, SearchNearby$, SearchNearbyAdditionalFeature, SearchNearbyFilter$, SearchNearbyIntendedUse, SearchNearbyRequest$, SearchNearbyResponse$, SearchNearbyResultItem$, SearchText$, SearchTextAdditionalFeature, SearchTextFilter$, SearchTextIntendedUse, SearchTextRequest$, SearchTextResponse$, SearchTextResultItem$, SearchTextTravelMode, SecondaryAddressComponent$, SecondaryAddressComponentMatchScore$, StreetComponents$, SubRegion$, SubRegionHighlights$, Suggest$, SuggestAdditionalFeature, SuggestAddressHighlights$, SuggestFilter$, SuggestHighlights$, SuggestIntendedUse, SuggestPlaceResult$, SuggestQueryResult$, SuggestRequest$, SuggestResponse$, SuggestResultItem$, SuggestResultItemType, SuggestTravelMode, ThrottlingException, ThrottlingException$, TimeZone$, TranslationDetails$, TranslationName$, TranslationNameType, TypePlacement, UspsZip$, UspsZipPlus4$, ValidationException, ValidationException$, ValidationExceptionField$, ValidationExceptionReason, ZipClassificationCode, __Client, errorTypeRegistries, } from '@aws-sdk/client-geo-places';
|
|
3
|
+
export type * from '@aws/amazon-location-utilities-datatypes';
|
|
4
|
+
export { calculateIsolinesResponseToFeatureCollection, calculateRoutesResponseToFeatureCollections, devicePositionsToFeatureCollection, featureCollectionToGeofence, geocodeResponseToFeatureCollection, geofencesToFeatureCollection, getPlaceResponseToFeatureCollection, optimizeWaypointsResponseToFeatureCollection, placeToFeatureCollection, reverseGeocodeResponseToFeatureCollection, routeToFeatureCollection, searchNearbyResponseToFeatureCollection, searchTextResponseToFeatureCollection, snapToRoadsResponseToFeatureCollection, suggestResponseToFeatureCollection, } from '@aws/amazon-location-utilities-datatypes';
|
package/dist/cjs/aws.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPlaceIntendedUse = exports.GetPlaceAddressNamesMode = exports.GetPlaceAdditionalFeature = exports.GetPlace$ = exports.GeocodeResultItem$ = exports.GeocodeResponse$ = exports.GeocodeRequest$ = exports.GeocodeQueryComponents$ = exports.GeocodeParsedQueryAddressComponents$ = exports.GeocodeParsedQuery$ = exports.GeocodeIntendedUse = exports.GeocodeFilterPlaceType = exports.GeocodeFilter$ = exports.GeocodeAddressNamesMode = exports.GeocodeAdditionalFeature = exports.Geocode$ = exports.GeoPlacesServiceException$ = exports.GeoPlacesServiceException = exports.FoodType$ = exports.FilterCircle$ = exports.CrossReference$ = exports.CountryHighlights$ = exports.Country$ = exports.Contacts$ = exports.ContactDetails$ = exports.ComponentMatchScores$ = exports.Category$ = exports.BusinessChain$ = exports.AutocompleteResultItem$ = exports.AutocompleteResponse$ = exports.AutocompleteRequest$ = exports.AutocompleteIntendedUse = exports.AutocompleteHighlights$ = exports.AutocompleteFilterPlaceType = exports.AutocompleteFilter$ = exports.AutocompleteAddressHighlights$ = exports.AutocompleteAdditionalFeature = exports.Autocomplete$ = exports.AdminNamesPreference = exports.AdminNames$ = exports.AddressTranslationComponent = exports.AddressComponentPhonemes$ = exports.AddressComponentMatchScores$ = exports.Address$ = exports.AccessRestriction$ = exports.AccessPointType = exports.AccessPoint$ = exports.AccessDeniedException$ = exports.AccessDeniedException = exports.$Command = void 0;
|
|
4
|
+
exports.SecondaryAddressComponent$ = exports.SearchTextTravelMode = exports.SearchTextResultItem$ = exports.SearchTextResponse$ = exports.SearchTextRequest$ = exports.SearchTextIntendedUse = exports.SearchTextFilter$ = exports.SearchTextAdditionalFeature = exports.SearchText$ = exports.SearchNearbyResultItem$ = exports.SearchNearbyResponse$ = exports.SearchNearbyRequest$ = exports.SearchNearbyIntendedUse = exports.SearchNearbyFilter$ = exports.SearchNearbyAdditionalFeature = exports.SearchNearby$ = exports.ReverseGeocodeResultItem$ = exports.ReverseGeocodeResponse$ = exports.ReverseGeocodeRequest$ = exports.ReverseGeocodeIntendedUse = exports.ReverseGeocodeFilterPlaceType = exports.ReverseGeocodeFilter$ = exports.ReverseGeocodeAddressNamesMode = exports.ReverseGeocodeAdditionalFeature = exports.ReverseGeocode$ = exports.RelatedPlace$ = exports.RegionHighlights$ = exports.Region$ = exports.RecordTypeCode = exports.QueryType = exports.QueryRefinement$ = exports.PostalCodeType = exports.PostalCodeMode = exports.PostalCodeDetails$ = exports.PostalAuthority = exports.PlaceType = exports.PlaceAttribute = exports.PhonemeTranscription$ = exports.PhonemeDetails$ = exports.ParsedQuerySecondaryAddressComponent$ = exports.ParsedQueryComponent$ = exports.OpeningHoursComponents$ = exports.OpeningHours$ = exports.MatchScoreDetails$ = exports.Intersection$ = exports.InternalServerException$ = exports.InternalServerException = exports.Highlight$ = exports.GetPlaceResponse$ = exports.GetPlaceRequest$ = void 0;
|
|
5
|
+
exports.suggestResponseToFeatureCollection = exports.snapToRoadsResponseToFeatureCollection = exports.searchTextResponseToFeatureCollection = exports.searchNearbyResponseToFeatureCollection = exports.routeToFeatureCollection = exports.reverseGeocodeResponseToFeatureCollection = exports.placeToFeatureCollection = exports.optimizeWaypointsResponseToFeatureCollection = exports.getPlaceResponseToFeatureCollection = exports.geofencesToFeatureCollection = exports.geocodeResponseToFeatureCollection = exports.featureCollectionToGeofence = exports.devicePositionsToFeatureCollection = exports.calculateRoutesResponseToFeatureCollections = exports.calculateIsolinesResponseToFeatureCollection = exports.errorTypeRegistries = exports.__Client = exports.ZipClassificationCode = exports.ValidationExceptionReason = exports.ValidationExceptionField$ = exports.ValidationException$ = exports.ValidationException = exports.UspsZipPlus4$ = exports.UspsZip$ = exports.TypePlacement = exports.TranslationNameType = exports.TranslationName$ = exports.TranslationDetails$ = exports.TimeZone$ = exports.ThrottlingException$ = exports.ThrottlingException = exports.SuggestTravelMode = exports.SuggestResultItemType = exports.SuggestResultItem$ = exports.SuggestResponse$ = exports.SuggestRequest$ = exports.SuggestQueryResult$ = exports.SuggestPlaceResult$ = exports.SuggestIntendedUse = exports.SuggestHighlights$ = exports.SuggestFilter$ = exports.SuggestAddressHighlights$ = exports.SuggestAdditionalFeature = exports.Suggest$ = exports.SubRegionHighlights$ = exports.SubRegion$ = exports.StreetComponents$ = exports.SecondaryAddressComponentMatchScore$ = void 0;
|
|
6
|
+
var client_geo_places_1 = require("@aws-sdk/client-geo-places");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return client_geo_places_1.$Command; } });
|
|
8
|
+
Object.defineProperty(exports, "AccessDeniedException", { enumerable: true, get: function () { return client_geo_places_1.AccessDeniedException; } });
|
|
9
|
+
Object.defineProperty(exports, "AccessDeniedException$", { enumerable: true, get: function () { return client_geo_places_1.AccessDeniedException$; } });
|
|
10
|
+
Object.defineProperty(exports, "AccessPoint$", { enumerable: true, get: function () { return client_geo_places_1.AccessPoint$; } });
|
|
11
|
+
Object.defineProperty(exports, "AccessPointType", { enumerable: true, get: function () { return client_geo_places_1.AccessPointType; } });
|
|
12
|
+
Object.defineProperty(exports, "AccessRestriction$", { enumerable: true, get: function () { return client_geo_places_1.AccessRestriction$; } });
|
|
13
|
+
Object.defineProperty(exports, "Address$", { enumerable: true, get: function () { return client_geo_places_1.Address$; } });
|
|
14
|
+
Object.defineProperty(exports, "AddressComponentMatchScores$", { enumerable: true, get: function () { return client_geo_places_1.AddressComponentMatchScores$; } });
|
|
15
|
+
Object.defineProperty(exports, "AddressComponentPhonemes$", { enumerable: true, get: function () { return client_geo_places_1.AddressComponentPhonemes$; } });
|
|
16
|
+
Object.defineProperty(exports, "AddressTranslationComponent", { enumerable: true, get: function () { return client_geo_places_1.AddressTranslationComponent; } });
|
|
17
|
+
Object.defineProperty(exports, "AdminNames$", { enumerable: true, get: function () { return client_geo_places_1.AdminNames$; } });
|
|
18
|
+
Object.defineProperty(exports, "AdminNamesPreference", { enumerable: true, get: function () { return client_geo_places_1.AdminNamesPreference; } });
|
|
19
|
+
Object.defineProperty(exports, "Autocomplete$", { enumerable: true, get: function () { return client_geo_places_1.Autocomplete$; } });
|
|
20
|
+
Object.defineProperty(exports, "AutocompleteAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteAdditionalFeature; } });
|
|
21
|
+
Object.defineProperty(exports, "AutocompleteAddressHighlights$", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteAddressHighlights$; } });
|
|
22
|
+
Object.defineProperty(exports, "AutocompleteFilter$", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteFilter$; } });
|
|
23
|
+
Object.defineProperty(exports, "AutocompleteFilterPlaceType", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteFilterPlaceType; } });
|
|
24
|
+
Object.defineProperty(exports, "AutocompleteHighlights$", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteHighlights$; } });
|
|
25
|
+
Object.defineProperty(exports, "AutocompleteIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteIntendedUse; } });
|
|
26
|
+
Object.defineProperty(exports, "AutocompleteRequest$", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteRequest$; } });
|
|
27
|
+
Object.defineProperty(exports, "AutocompleteResponse$", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteResponse$; } });
|
|
28
|
+
Object.defineProperty(exports, "AutocompleteResultItem$", { enumerable: true, get: function () { return client_geo_places_1.AutocompleteResultItem$; } });
|
|
29
|
+
Object.defineProperty(exports, "BusinessChain$", { enumerable: true, get: function () { return client_geo_places_1.BusinessChain$; } });
|
|
30
|
+
Object.defineProperty(exports, "Category$", { enumerable: true, get: function () { return client_geo_places_1.Category$; } });
|
|
31
|
+
Object.defineProperty(exports, "ComponentMatchScores$", { enumerable: true, get: function () { return client_geo_places_1.ComponentMatchScores$; } });
|
|
32
|
+
Object.defineProperty(exports, "ContactDetails$", { enumerable: true, get: function () { return client_geo_places_1.ContactDetails$; } });
|
|
33
|
+
Object.defineProperty(exports, "Contacts$", { enumerable: true, get: function () { return client_geo_places_1.Contacts$; } });
|
|
34
|
+
Object.defineProperty(exports, "Country$", { enumerable: true, get: function () { return client_geo_places_1.Country$; } });
|
|
35
|
+
Object.defineProperty(exports, "CountryHighlights$", { enumerable: true, get: function () { return client_geo_places_1.CountryHighlights$; } });
|
|
36
|
+
Object.defineProperty(exports, "CrossReference$", { enumerable: true, get: function () { return client_geo_places_1.CrossReference$; } });
|
|
37
|
+
Object.defineProperty(exports, "FilterCircle$", { enumerable: true, get: function () { return client_geo_places_1.FilterCircle$; } });
|
|
38
|
+
Object.defineProperty(exports, "FoodType$", { enumerable: true, get: function () { return client_geo_places_1.FoodType$; } });
|
|
39
|
+
Object.defineProperty(exports, "GeoPlacesServiceException", { enumerable: true, get: function () { return client_geo_places_1.GeoPlacesServiceException; } });
|
|
40
|
+
Object.defineProperty(exports, "GeoPlacesServiceException$", { enumerable: true, get: function () { return client_geo_places_1.GeoPlacesServiceException$; } });
|
|
41
|
+
Object.defineProperty(exports, "Geocode$", { enumerable: true, get: function () { return client_geo_places_1.Geocode$; } });
|
|
42
|
+
Object.defineProperty(exports, "GeocodeAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.GeocodeAdditionalFeature; } });
|
|
43
|
+
Object.defineProperty(exports, "GeocodeAddressNamesMode", { enumerable: true, get: function () { return client_geo_places_1.GeocodeAddressNamesMode; } });
|
|
44
|
+
Object.defineProperty(exports, "GeocodeFilter$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeFilter$; } });
|
|
45
|
+
Object.defineProperty(exports, "GeocodeFilterPlaceType", { enumerable: true, get: function () { return client_geo_places_1.GeocodeFilterPlaceType; } });
|
|
46
|
+
Object.defineProperty(exports, "GeocodeIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.GeocodeIntendedUse; } });
|
|
47
|
+
Object.defineProperty(exports, "GeocodeParsedQuery$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeParsedQuery$; } });
|
|
48
|
+
Object.defineProperty(exports, "GeocodeParsedQueryAddressComponents$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeParsedQueryAddressComponents$; } });
|
|
49
|
+
Object.defineProperty(exports, "GeocodeQueryComponents$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeQueryComponents$; } });
|
|
50
|
+
Object.defineProperty(exports, "GeocodeRequest$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeRequest$; } });
|
|
51
|
+
Object.defineProperty(exports, "GeocodeResponse$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeResponse$; } });
|
|
52
|
+
Object.defineProperty(exports, "GeocodeResultItem$", { enumerable: true, get: function () { return client_geo_places_1.GeocodeResultItem$; } });
|
|
53
|
+
Object.defineProperty(exports, "GetPlace$", { enumerable: true, get: function () { return client_geo_places_1.GetPlace$; } });
|
|
54
|
+
Object.defineProperty(exports, "GetPlaceAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.GetPlaceAdditionalFeature; } });
|
|
55
|
+
Object.defineProperty(exports, "GetPlaceAddressNamesMode", { enumerable: true, get: function () { return client_geo_places_1.GetPlaceAddressNamesMode; } });
|
|
56
|
+
Object.defineProperty(exports, "GetPlaceIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.GetPlaceIntendedUse; } });
|
|
57
|
+
Object.defineProperty(exports, "GetPlaceRequest$", { enumerable: true, get: function () { return client_geo_places_1.GetPlaceRequest$; } });
|
|
58
|
+
Object.defineProperty(exports, "GetPlaceResponse$", { enumerable: true, get: function () { return client_geo_places_1.GetPlaceResponse$; } });
|
|
59
|
+
Object.defineProperty(exports, "Highlight$", { enumerable: true, get: function () { return client_geo_places_1.Highlight$; } });
|
|
60
|
+
Object.defineProperty(exports, "InternalServerException", { enumerable: true, get: function () { return client_geo_places_1.InternalServerException; } });
|
|
61
|
+
Object.defineProperty(exports, "InternalServerException$", { enumerable: true, get: function () { return client_geo_places_1.InternalServerException$; } });
|
|
62
|
+
Object.defineProperty(exports, "Intersection$", { enumerable: true, get: function () { return client_geo_places_1.Intersection$; } });
|
|
63
|
+
Object.defineProperty(exports, "MatchScoreDetails$", { enumerable: true, get: function () { return client_geo_places_1.MatchScoreDetails$; } });
|
|
64
|
+
Object.defineProperty(exports, "OpeningHours$", { enumerable: true, get: function () { return client_geo_places_1.OpeningHours$; } });
|
|
65
|
+
Object.defineProperty(exports, "OpeningHoursComponents$", { enumerable: true, get: function () { return client_geo_places_1.OpeningHoursComponents$; } });
|
|
66
|
+
Object.defineProperty(exports, "ParsedQueryComponent$", { enumerable: true, get: function () { return client_geo_places_1.ParsedQueryComponent$; } });
|
|
67
|
+
Object.defineProperty(exports, "ParsedQuerySecondaryAddressComponent$", { enumerable: true, get: function () { return client_geo_places_1.ParsedQuerySecondaryAddressComponent$; } });
|
|
68
|
+
Object.defineProperty(exports, "PhonemeDetails$", { enumerable: true, get: function () { return client_geo_places_1.PhonemeDetails$; } });
|
|
69
|
+
Object.defineProperty(exports, "PhonemeTranscription$", { enumerable: true, get: function () { return client_geo_places_1.PhonemeTranscription$; } });
|
|
70
|
+
Object.defineProperty(exports, "PlaceAttribute", { enumerable: true, get: function () { return client_geo_places_1.PlaceAttribute; } });
|
|
71
|
+
Object.defineProperty(exports, "PlaceType", { enumerable: true, get: function () { return client_geo_places_1.PlaceType; } });
|
|
72
|
+
Object.defineProperty(exports, "PostalAuthority", { enumerable: true, get: function () { return client_geo_places_1.PostalAuthority; } });
|
|
73
|
+
Object.defineProperty(exports, "PostalCodeDetails$", { enumerable: true, get: function () { return client_geo_places_1.PostalCodeDetails$; } });
|
|
74
|
+
Object.defineProperty(exports, "PostalCodeMode", { enumerable: true, get: function () { return client_geo_places_1.PostalCodeMode; } });
|
|
75
|
+
Object.defineProperty(exports, "PostalCodeType", { enumerable: true, get: function () { return client_geo_places_1.PostalCodeType; } });
|
|
76
|
+
Object.defineProperty(exports, "QueryRefinement$", { enumerable: true, get: function () { return client_geo_places_1.QueryRefinement$; } });
|
|
77
|
+
Object.defineProperty(exports, "QueryType", { enumerable: true, get: function () { return client_geo_places_1.QueryType; } });
|
|
78
|
+
Object.defineProperty(exports, "RecordTypeCode", { enumerable: true, get: function () { return client_geo_places_1.RecordTypeCode; } });
|
|
79
|
+
Object.defineProperty(exports, "Region$", { enumerable: true, get: function () { return client_geo_places_1.Region$; } });
|
|
80
|
+
Object.defineProperty(exports, "RegionHighlights$", { enumerable: true, get: function () { return client_geo_places_1.RegionHighlights$; } });
|
|
81
|
+
Object.defineProperty(exports, "RelatedPlace$", { enumerable: true, get: function () { return client_geo_places_1.RelatedPlace$; } });
|
|
82
|
+
Object.defineProperty(exports, "ReverseGeocode$", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocode$; } });
|
|
83
|
+
Object.defineProperty(exports, "ReverseGeocodeAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeAdditionalFeature; } });
|
|
84
|
+
Object.defineProperty(exports, "ReverseGeocodeAddressNamesMode", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeAddressNamesMode; } });
|
|
85
|
+
Object.defineProperty(exports, "ReverseGeocodeFilter$", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeFilter$; } });
|
|
86
|
+
Object.defineProperty(exports, "ReverseGeocodeFilterPlaceType", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeFilterPlaceType; } });
|
|
87
|
+
Object.defineProperty(exports, "ReverseGeocodeIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeIntendedUse; } });
|
|
88
|
+
Object.defineProperty(exports, "ReverseGeocodeRequest$", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeRequest$; } });
|
|
89
|
+
Object.defineProperty(exports, "ReverseGeocodeResponse$", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeResponse$; } });
|
|
90
|
+
Object.defineProperty(exports, "ReverseGeocodeResultItem$", { enumerable: true, get: function () { return client_geo_places_1.ReverseGeocodeResultItem$; } });
|
|
91
|
+
Object.defineProperty(exports, "SearchNearby$", { enumerable: true, get: function () { return client_geo_places_1.SearchNearby$; } });
|
|
92
|
+
Object.defineProperty(exports, "SearchNearbyAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.SearchNearbyAdditionalFeature; } });
|
|
93
|
+
Object.defineProperty(exports, "SearchNearbyFilter$", { enumerable: true, get: function () { return client_geo_places_1.SearchNearbyFilter$; } });
|
|
94
|
+
Object.defineProperty(exports, "SearchNearbyIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.SearchNearbyIntendedUse; } });
|
|
95
|
+
Object.defineProperty(exports, "SearchNearbyRequest$", { enumerable: true, get: function () { return client_geo_places_1.SearchNearbyRequest$; } });
|
|
96
|
+
Object.defineProperty(exports, "SearchNearbyResponse$", { enumerable: true, get: function () { return client_geo_places_1.SearchNearbyResponse$; } });
|
|
97
|
+
Object.defineProperty(exports, "SearchNearbyResultItem$", { enumerable: true, get: function () { return client_geo_places_1.SearchNearbyResultItem$; } });
|
|
98
|
+
Object.defineProperty(exports, "SearchText$", { enumerable: true, get: function () { return client_geo_places_1.SearchText$; } });
|
|
99
|
+
Object.defineProperty(exports, "SearchTextAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.SearchTextAdditionalFeature; } });
|
|
100
|
+
Object.defineProperty(exports, "SearchTextFilter$", { enumerable: true, get: function () { return client_geo_places_1.SearchTextFilter$; } });
|
|
101
|
+
Object.defineProperty(exports, "SearchTextIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.SearchTextIntendedUse; } });
|
|
102
|
+
Object.defineProperty(exports, "SearchTextRequest$", { enumerable: true, get: function () { return client_geo_places_1.SearchTextRequest$; } });
|
|
103
|
+
Object.defineProperty(exports, "SearchTextResponse$", { enumerable: true, get: function () { return client_geo_places_1.SearchTextResponse$; } });
|
|
104
|
+
Object.defineProperty(exports, "SearchTextResultItem$", { enumerable: true, get: function () { return client_geo_places_1.SearchTextResultItem$; } });
|
|
105
|
+
Object.defineProperty(exports, "SearchTextTravelMode", { enumerable: true, get: function () { return client_geo_places_1.SearchTextTravelMode; } });
|
|
106
|
+
Object.defineProperty(exports, "SecondaryAddressComponent$", { enumerable: true, get: function () { return client_geo_places_1.SecondaryAddressComponent$; } });
|
|
107
|
+
Object.defineProperty(exports, "SecondaryAddressComponentMatchScore$", { enumerable: true, get: function () { return client_geo_places_1.SecondaryAddressComponentMatchScore$; } });
|
|
108
|
+
Object.defineProperty(exports, "StreetComponents$", { enumerable: true, get: function () { return client_geo_places_1.StreetComponents$; } });
|
|
109
|
+
Object.defineProperty(exports, "SubRegion$", { enumerable: true, get: function () { return client_geo_places_1.SubRegion$; } });
|
|
110
|
+
Object.defineProperty(exports, "SubRegionHighlights$", { enumerable: true, get: function () { return client_geo_places_1.SubRegionHighlights$; } });
|
|
111
|
+
Object.defineProperty(exports, "Suggest$", { enumerable: true, get: function () { return client_geo_places_1.Suggest$; } });
|
|
112
|
+
Object.defineProperty(exports, "SuggestAdditionalFeature", { enumerable: true, get: function () { return client_geo_places_1.SuggestAdditionalFeature; } });
|
|
113
|
+
Object.defineProperty(exports, "SuggestAddressHighlights$", { enumerable: true, get: function () { return client_geo_places_1.SuggestAddressHighlights$; } });
|
|
114
|
+
Object.defineProperty(exports, "SuggestFilter$", { enumerable: true, get: function () { return client_geo_places_1.SuggestFilter$; } });
|
|
115
|
+
Object.defineProperty(exports, "SuggestHighlights$", { enumerable: true, get: function () { return client_geo_places_1.SuggestHighlights$; } });
|
|
116
|
+
Object.defineProperty(exports, "SuggestIntendedUse", { enumerable: true, get: function () { return client_geo_places_1.SuggestIntendedUse; } });
|
|
117
|
+
Object.defineProperty(exports, "SuggestPlaceResult$", { enumerable: true, get: function () { return client_geo_places_1.SuggestPlaceResult$; } });
|
|
118
|
+
Object.defineProperty(exports, "SuggestQueryResult$", { enumerable: true, get: function () { return client_geo_places_1.SuggestQueryResult$; } });
|
|
119
|
+
Object.defineProperty(exports, "SuggestRequest$", { enumerable: true, get: function () { return client_geo_places_1.SuggestRequest$; } });
|
|
120
|
+
Object.defineProperty(exports, "SuggestResponse$", { enumerable: true, get: function () { return client_geo_places_1.SuggestResponse$; } });
|
|
121
|
+
Object.defineProperty(exports, "SuggestResultItem$", { enumerable: true, get: function () { return client_geo_places_1.SuggestResultItem$; } });
|
|
122
|
+
Object.defineProperty(exports, "SuggestResultItemType", { enumerable: true, get: function () { return client_geo_places_1.SuggestResultItemType; } });
|
|
123
|
+
Object.defineProperty(exports, "SuggestTravelMode", { enumerable: true, get: function () { return client_geo_places_1.SuggestTravelMode; } });
|
|
124
|
+
Object.defineProperty(exports, "ThrottlingException", { enumerable: true, get: function () { return client_geo_places_1.ThrottlingException; } });
|
|
125
|
+
Object.defineProperty(exports, "ThrottlingException$", { enumerable: true, get: function () { return client_geo_places_1.ThrottlingException$; } });
|
|
126
|
+
Object.defineProperty(exports, "TimeZone$", { enumerable: true, get: function () { return client_geo_places_1.TimeZone$; } });
|
|
127
|
+
Object.defineProperty(exports, "TranslationDetails$", { enumerable: true, get: function () { return client_geo_places_1.TranslationDetails$; } });
|
|
128
|
+
Object.defineProperty(exports, "TranslationName$", { enumerable: true, get: function () { return client_geo_places_1.TranslationName$; } });
|
|
129
|
+
Object.defineProperty(exports, "TranslationNameType", { enumerable: true, get: function () { return client_geo_places_1.TranslationNameType; } });
|
|
130
|
+
Object.defineProperty(exports, "TypePlacement", { enumerable: true, get: function () { return client_geo_places_1.TypePlacement; } });
|
|
131
|
+
Object.defineProperty(exports, "UspsZip$", { enumerable: true, get: function () { return client_geo_places_1.UspsZip$; } });
|
|
132
|
+
Object.defineProperty(exports, "UspsZipPlus4$", { enumerable: true, get: function () { return client_geo_places_1.UspsZipPlus4$; } });
|
|
133
|
+
Object.defineProperty(exports, "ValidationException", { enumerable: true, get: function () { return client_geo_places_1.ValidationException; } });
|
|
134
|
+
Object.defineProperty(exports, "ValidationException$", { enumerable: true, get: function () { return client_geo_places_1.ValidationException$; } });
|
|
135
|
+
Object.defineProperty(exports, "ValidationExceptionField$", { enumerable: true, get: function () { return client_geo_places_1.ValidationExceptionField$; } });
|
|
136
|
+
Object.defineProperty(exports, "ValidationExceptionReason", { enumerable: true, get: function () { return client_geo_places_1.ValidationExceptionReason; } });
|
|
137
|
+
Object.defineProperty(exports, "ZipClassificationCode", { enumerable: true, get: function () { return client_geo_places_1.ZipClassificationCode; } });
|
|
138
|
+
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return client_geo_places_1.__Client; } });
|
|
139
|
+
Object.defineProperty(exports, "errorTypeRegistries", { enumerable: true, get: function () { return client_geo_places_1.errorTypeRegistries; } });
|
|
140
|
+
var amazon_location_utilities_datatypes_1 = require("@aws/amazon-location-utilities-datatypes");
|
|
141
|
+
Object.defineProperty(exports, "calculateIsolinesResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.calculateIsolinesResponseToFeatureCollection; } });
|
|
142
|
+
Object.defineProperty(exports, "calculateRoutesResponseToFeatureCollections", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.calculateRoutesResponseToFeatureCollections; } });
|
|
143
|
+
Object.defineProperty(exports, "devicePositionsToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.devicePositionsToFeatureCollection; } });
|
|
144
|
+
Object.defineProperty(exports, "featureCollectionToGeofence", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.featureCollectionToGeofence; } });
|
|
145
|
+
Object.defineProperty(exports, "geocodeResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.geocodeResponseToFeatureCollection; } });
|
|
146
|
+
Object.defineProperty(exports, "geofencesToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.geofencesToFeatureCollection; } });
|
|
147
|
+
Object.defineProperty(exports, "getPlaceResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.getPlaceResponseToFeatureCollection; } });
|
|
148
|
+
Object.defineProperty(exports, "optimizeWaypointsResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.optimizeWaypointsResponseToFeatureCollection; } });
|
|
149
|
+
Object.defineProperty(exports, "placeToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.placeToFeatureCollection; } });
|
|
150
|
+
Object.defineProperty(exports, "reverseGeocodeResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.reverseGeocodeResponseToFeatureCollection; } });
|
|
151
|
+
Object.defineProperty(exports, "routeToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.routeToFeatureCollection; } });
|
|
152
|
+
Object.defineProperty(exports, "searchNearbyResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.searchNearbyResponseToFeatureCollection; } });
|
|
153
|
+
Object.defineProperty(exports, "searchTextResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.searchTextResponseToFeatureCollection; } });
|
|
154
|
+
Object.defineProperty(exports, "snapToRoadsResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.snapToRoadsResponseToFeatureCollection; } });
|
|
155
|
+
Object.defineProperty(exports, "suggestResponseToFeatureCollection", { enumerable: true, get: function () { return amazon_location_utilities_datatypes_1.suggestResponseToFeatureCollection; } });
|