@aws-sdk/client-geo-places 3.683.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/LICENSE +201 -0
- package/README.md +297 -0
- package/dist-cjs/GeoPlaces.js +25 -0
- package/dist-cjs/GeoPlacesClient.js +50 -0
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
- package/dist-cjs/commands/AutocompleteCommand.js +27 -0
- package/dist-cjs/commands/GeocodeCommand.js +27 -0
- package/dist-cjs/commands/GetPlaceCommand.js +27 -0
- package/dist-cjs/commands/ReverseGeocodeCommand.js +27 -0
- package/dist-cjs/commands/SearchNearbyCommand.js +27 -0
- package/dist-cjs/commands/SearchTextCommand.js +27 -0
- package/dist-cjs/commands/SuggestCommand.js +27 -0
- package/dist-cjs/commands/index.js +10 -0
- package/dist-cjs/endpoint/EndpointParameters.js +18 -0
- package/dist-cjs/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +10 -0
- package/dist-cjs/models/GeoPlacesServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +379 -0
- package/dist-cjs/protocols/Aws_restJson1.js +690 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +34 -0
- package/dist-cjs/runtimeExtensions.js +25 -0
- package/dist-es/GeoPlaces.js +21 -0
- package/dist-es/GeoPlacesClient.js +46 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
- package/dist-es/commands/AutocompleteCommand.js +23 -0
- package/dist-es/commands/GeocodeCommand.js +23 -0
- package/dist-es/commands/GetPlaceCommand.js +23 -0
- package/dist-es/commands/ReverseGeocodeCommand.js +23 -0
- package/dist-es/commands/SearchNearbyCommand.js +23 -0
- package/dist-es/commands/SearchTextCommand.js +23 -0
- package/dist-es/commands/SuggestCommand.js +23 -0
- package/dist-es/commands/index.js +7 -0
- package/dist-es/endpoint/EndpointParameters.js +14 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +5 -0
- package/dist-es/models/GeoPlacesServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +345 -0
- package/dist-es/protocols/Aws_restJson1.js +673 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +30 -0
- package/dist-es/runtimeExtensions.js +21 -0
- package/dist-types/GeoPlaces.d.ts +97 -0
- package/dist-types/GeoPlacesClient.d.ts +212 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/dist-types/commands/AutocompleteCommand.d.ts +204 -0
- package/dist-types/commands/GeocodeCommand.d.ts +231 -0
- package/dist-types/commands/GetPlaceCommand.d.ts +312 -0
- package/dist-types/commands/ReverseGeocodeCommand.d.ts +196 -0
- package/dist-types/commands/SearchNearbyCommand.d.ts +335 -0
- package/dist-types/commands/SearchTextCommand.d.ts +326 -0
- package/dist-types/commands/SuggestCommand.d.ts +289 -0
- package/dist-types/commands/index.d.ts +7 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +40 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +49 -0
- package/dist-types/models/GeoPlacesServiceException.d.ts +14 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +2871 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +65 -0
- package/dist-types/runtimeConfig.browser.d.ts +48 -0
- package/dist-types/runtimeConfig.d.ts +48 -0
- package/dist-types/runtimeConfig.native.d.ts +47 -0
- package/dist-types/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/GeoPlaces.d.ts +126 -0
- package/dist-types/ts3.4/GeoPlacesClient.d.ts +160 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/dist-types/ts3.4/commands/AutocompleteCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/GeocodeCommand.d.ts +45 -0
- package/dist-types/ts3.4/commands/GetPlaceCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/ReverseGeocodeCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/SearchNearbyCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/SearchTextCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/SuggestCommand.d.ts +43 -0
- package/dist-types/ts3.4/commands/index.d.ts +7 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/index.d.ts +8 -0
- package/dist-types/ts3.4/models/GeoPlacesServiceException.d.ts +9 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +786 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +89 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +94 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +87 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +101 -0
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
2
|
+
import { requestBuilder as rb } from "@smithy/core";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { GeoPlacesServiceException as __BaseException } from "../models/GeoPlacesServiceException";
|
|
5
|
+
import { AccessDeniedException, InternalServerException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const se_AutocompleteCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
b.bp("/autocomplete");
|
|
12
|
+
const query = map({
|
|
13
|
+
[_k]: [, input[_K]],
|
|
14
|
+
});
|
|
15
|
+
let body;
|
|
16
|
+
body = JSON.stringify(take(input, {
|
|
17
|
+
AdditionalFeatures: (_) => _json(_),
|
|
18
|
+
BiasPosition: (_) => se_Position(_, context),
|
|
19
|
+
Filter: (_) => se_AutocompleteFilter(_, context),
|
|
20
|
+
IntendedUse: [],
|
|
21
|
+
Language: [],
|
|
22
|
+
MaxResults: [],
|
|
23
|
+
PoliticalView: [],
|
|
24
|
+
PostalCodeMode: [],
|
|
25
|
+
QueryText: [],
|
|
26
|
+
}));
|
|
27
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
28
|
+
return b.build();
|
|
29
|
+
};
|
|
30
|
+
export const se_GeocodeCommand = async (input, context) => {
|
|
31
|
+
const b = rb(input, context);
|
|
32
|
+
const headers = {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
};
|
|
35
|
+
b.bp("/geocode");
|
|
36
|
+
const query = map({
|
|
37
|
+
[_k]: [, input[_K]],
|
|
38
|
+
});
|
|
39
|
+
let body;
|
|
40
|
+
body = JSON.stringify(take(input, {
|
|
41
|
+
AdditionalFeatures: (_) => _json(_),
|
|
42
|
+
BiasPosition: (_) => se_Position(_, context),
|
|
43
|
+
Filter: (_) => _json(_),
|
|
44
|
+
IntendedUse: [],
|
|
45
|
+
Language: [],
|
|
46
|
+
MaxResults: [],
|
|
47
|
+
PoliticalView: [],
|
|
48
|
+
QueryComponents: (_) => _json(_),
|
|
49
|
+
QueryText: [],
|
|
50
|
+
}));
|
|
51
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
52
|
+
return b.build();
|
|
53
|
+
};
|
|
54
|
+
export const se_GetPlaceCommand = async (input, context) => {
|
|
55
|
+
const b = rb(input, context);
|
|
56
|
+
const headers = {};
|
|
57
|
+
b.bp("/place/{PlaceId}");
|
|
58
|
+
b.p("PlaceId", () => input.PlaceId, "{PlaceId}", false);
|
|
59
|
+
const query = map({
|
|
60
|
+
[_af]: [() => input.AdditionalFeatures !== void 0, () => input[_AF] || []],
|
|
61
|
+
[_l]: [, input[_L]],
|
|
62
|
+
[_pv]: [, input[_PV]],
|
|
63
|
+
[_iu]: [, input[_IU]],
|
|
64
|
+
[_k]: [, input[_K]],
|
|
65
|
+
});
|
|
66
|
+
let body;
|
|
67
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
68
|
+
return b.build();
|
|
69
|
+
};
|
|
70
|
+
export const se_ReverseGeocodeCommand = async (input, context) => {
|
|
71
|
+
const b = rb(input, context);
|
|
72
|
+
const headers = {
|
|
73
|
+
"content-type": "application/json",
|
|
74
|
+
};
|
|
75
|
+
b.bp("/reverse-geocode");
|
|
76
|
+
const query = map({
|
|
77
|
+
[_k]: [, input[_K]],
|
|
78
|
+
});
|
|
79
|
+
let body;
|
|
80
|
+
body = JSON.stringify(take(input, {
|
|
81
|
+
AdditionalFeatures: (_) => _json(_),
|
|
82
|
+
Filter: (_) => _json(_),
|
|
83
|
+
IntendedUse: [],
|
|
84
|
+
Language: [],
|
|
85
|
+
MaxResults: [],
|
|
86
|
+
PoliticalView: [],
|
|
87
|
+
QueryPosition: (_) => se_Position(_, context),
|
|
88
|
+
QueryRadius: [],
|
|
89
|
+
}));
|
|
90
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
91
|
+
return b.build();
|
|
92
|
+
};
|
|
93
|
+
export const se_SearchNearbyCommand = async (input, context) => {
|
|
94
|
+
const b = rb(input, context);
|
|
95
|
+
const headers = {
|
|
96
|
+
"content-type": "application/json",
|
|
97
|
+
};
|
|
98
|
+
b.bp("/search-nearby");
|
|
99
|
+
const query = map({
|
|
100
|
+
[_k]: [, input[_K]],
|
|
101
|
+
});
|
|
102
|
+
let body;
|
|
103
|
+
body = JSON.stringify(take(input, {
|
|
104
|
+
AdditionalFeatures: (_) => _json(_),
|
|
105
|
+
Filter: (_) => se_SearchNearbyFilter(_, context),
|
|
106
|
+
IntendedUse: [],
|
|
107
|
+
Language: [],
|
|
108
|
+
MaxResults: [],
|
|
109
|
+
NextToken: [],
|
|
110
|
+
PoliticalView: [],
|
|
111
|
+
QueryPosition: (_) => se_Position(_, context),
|
|
112
|
+
QueryRadius: [],
|
|
113
|
+
}));
|
|
114
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
115
|
+
return b.build();
|
|
116
|
+
};
|
|
117
|
+
export const se_SearchTextCommand = async (input, context) => {
|
|
118
|
+
const b = rb(input, context);
|
|
119
|
+
const headers = {
|
|
120
|
+
"content-type": "application/json",
|
|
121
|
+
};
|
|
122
|
+
b.bp("/search-text");
|
|
123
|
+
const query = map({
|
|
124
|
+
[_k]: [, input[_K]],
|
|
125
|
+
});
|
|
126
|
+
let body;
|
|
127
|
+
body = JSON.stringify(take(input, {
|
|
128
|
+
AdditionalFeatures: (_) => _json(_),
|
|
129
|
+
BiasPosition: (_) => se_Position(_, context),
|
|
130
|
+
Filter: (_) => se_SearchTextFilter(_, context),
|
|
131
|
+
IntendedUse: [],
|
|
132
|
+
Language: [],
|
|
133
|
+
MaxResults: [],
|
|
134
|
+
NextToken: [],
|
|
135
|
+
PoliticalView: [],
|
|
136
|
+
QueryId: [],
|
|
137
|
+
QueryText: [],
|
|
138
|
+
}));
|
|
139
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
140
|
+
return b.build();
|
|
141
|
+
};
|
|
142
|
+
export const se_SuggestCommand = async (input, context) => {
|
|
143
|
+
const b = rb(input, context);
|
|
144
|
+
const headers = {
|
|
145
|
+
"content-type": "application/json",
|
|
146
|
+
};
|
|
147
|
+
b.bp("/suggest");
|
|
148
|
+
const query = map({
|
|
149
|
+
[_k]: [, input[_K]],
|
|
150
|
+
});
|
|
151
|
+
let body;
|
|
152
|
+
body = JSON.stringify(take(input, {
|
|
153
|
+
AdditionalFeatures: (_) => _json(_),
|
|
154
|
+
BiasPosition: (_) => se_Position(_, context),
|
|
155
|
+
Filter: (_) => se_SuggestFilter(_, context),
|
|
156
|
+
IntendedUse: [],
|
|
157
|
+
Language: [],
|
|
158
|
+
MaxQueryRefinements: [],
|
|
159
|
+
MaxResults: [],
|
|
160
|
+
PoliticalView: [],
|
|
161
|
+
QueryText: [],
|
|
162
|
+
}));
|
|
163
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
164
|
+
return b.build();
|
|
165
|
+
};
|
|
166
|
+
export const de_AutocompleteCommand = async (output, context) => {
|
|
167
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
168
|
+
return de_CommandError(output, context);
|
|
169
|
+
}
|
|
170
|
+
const contents = map({
|
|
171
|
+
$metadata: deserializeMetadata(output),
|
|
172
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
173
|
+
});
|
|
174
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
175
|
+
const doc = take(data, {
|
|
176
|
+
ResultItems: _json,
|
|
177
|
+
});
|
|
178
|
+
Object.assign(contents, doc);
|
|
179
|
+
return contents;
|
|
180
|
+
};
|
|
181
|
+
export const de_GeocodeCommand = async (output, context) => {
|
|
182
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
183
|
+
return de_CommandError(output, context);
|
|
184
|
+
}
|
|
185
|
+
const contents = map({
|
|
186
|
+
$metadata: deserializeMetadata(output),
|
|
187
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
188
|
+
});
|
|
189
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
190
|
+
const doc = take(data, {
|
|
191
|
+
ResultItems: (_) => de_GeocodeResultItemList(_, context),
|
|
192
|
+
});
|
|
193
|
+
Object.assign(contents, doc);
|
|
194
|
+
return contents;
|
|
195
|
+
};
|
|
196
|
+
export const de_GetPlaceCommand = async (output, context) => {
|
|
197
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
198
|
+
return de_CommandError(output, context);
|
|
199
|
+
}
|
|
200
|
+
const contents = map({
|
|
201
|
+
$metadata: deserializeMetadata(output),
|
|
202
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
203
|
+
});
|
|
204
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
205
|
+
const doc = take(data, {
|
|
206
|
+
AccessPoints: (_) => de_AccessPointList(_, context),
|
|
207
|
+
AccessRestrictions: _json,
|
|
208
|
+
Address: _json,
|
|
209
|
+
AddressNumberCorrected: __expectBoolean,
|
|
210
|
+
BusinessChains: _json,
|
|
211
|
+
Categories: _json,
|
|
212
|
+
Contacts: _json,
|
|
213
|
+
FoodTypes: _json,
|
|
214
|
+
MapView: (_) => de_BoundingBox(_, context),
|
|
215
|
+
OpeningHours: _json,
|
|
216
|
+
Phonemes: _json,
|
|
217
|
+
PlaceId: __expectString,
|
|
218
|
+
PlaceType: __expectString,
|
|
219
|
+
PoliticalView: __expectString,
|
|
220
|
+
Position: (_) => de_Position(_, context),
|
|
221
|
+
PostalCodeDetails: _json,
|
|
222
|
+
TimeZone: _json,
|
|
223
|
+
Title: __expectString,
|
|
224
|
+
});
|
|
225
|
+
Object.assign(contents, doc);
|
|
226
|
+
return contents;
|
|
227
|
+
};
|
|
228
|
+
export const de_ReverseGeocodeCommand = async (output, context) => {
|
|
229
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
230
|
+
return de_CommandError(output, context);
|
|
231
|
+
}
|
|
232
|
+
const contents = map({
|
|
233
|
+
$metadata: deserializeMetadata(output),
|
|
234
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
235
|
+
});
|
|
236
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
237
|
+
const doc = take(data, {
|
|
238
|
+
ResultItems: (_) => de_ReverseGeocodeResultItemList(_, context),
|
|
239
|
+
});
|
|
240
|
+
Object.assign(contents, doc);
|
|
241
|
+
return contents;
|
|
242
|
+
};
|
|
243
|
+
export const de_SearchNearbyCommand = async (output, context) => {
|
|
244
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
245
|
+
return de_CommandError(output, context);
|
|
246
|
+
}
|
|
247
|
+
const contents = map({
|
|
248
|
+
$metadata: deserializeMetadata(output),
|
|
249
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
250
|
+
});
|
|
251
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
252
|
+
const doc = take(data, {
|
|
253
|
+
NextToken: __expectString,
|
|
254
|
+
ResultItems: (_) => de_SearchNearbyResultItemList(_, context),
|
|
255
|
+
});
|
|
256
|
+
Object.assign(contents, doc);
|
|
257
|
+
return contents;
|
|
258
|
+
};
|
|
259
|
+
export const de_SearchTextCommand = async (output, context) => {
|
|
260
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
261
|
+
return de_CommandError(output, context);
|
|
262
|
+
}
|
|
263
|
+
const contents = map({
|
|
264
|
+
$metadata: deserializeMetadata(output),
|
|
265
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
266
|
+
});
|
|
267
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
268
|
+
const doc = take(data, {
|
|
269
|
+
NextToken: __expectString,
|
|
270
|
+
ResultItems: (_) => de_SearchTextResultItemList(_, context),
|
|
271
|
+
});
|
|
272
|
+
Object.assign(contents, doc);
|
|
273
|
+
return contents;
|
|
274
|
+
};
|
|
275
|
+
export const de_SuggestCommand = async (output, context) => {
|
|
276
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
277
|
+
return de_CommandError(output, context);
|
|
278
|
+
}
|
|
279
|
+
const contents = map({
|
|
280
|
+
$metadata: deserializeMetadata(output),
|
|
281
|
+
[_PB]: [, output.headers[_xagpb]],
|
|
282
|
+
});
|
|
283
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
284
|
+
const doc = take(data, {
|
|
285
|
+
QueryRefinements: _json,
|
|
286
|
+
ResultItems: (_) => de_SuggestResultItemList(_, context),
|
|
287
|
+
});
|
|
288
|
+
Object.assign(contents, doc);
|
|
289
|
+
return contents;
|
|
290
|
+
};
|
|
291
|
+
const de_CommandError = async (output, context) => {
|
|
292
|
+
const parsedOutput = {
|
|
293
|
+
...output,
|
|
294
|
+
body: await parseErrorBody(output.body, context),
|
|
295
|
+
};
|
|
296
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
297
|
+
switch (errorCode) {
|
|
298
|
+
case "AccessDeniedException":
|
|
299
|
+
case "com.amazonaws.geoplaces#AccessDeniedException":
|
|
300
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
301
|
+
case "InternalServerException":
|
|
302
|
+
case "com.amazonaws.geoplaces#InternalServerException":
|
|
303
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
304
|
+
case "ThrottlingException":
|
|
305
|
+
case "com.amazonaws.geoplaces#ThrottlingException":
|
|
306
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
307
|
+
case "ValidationException":
|
|
308
|
+
case "com.amazonaws.geoplaces#ValidationException":
|
|
309
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
310
|
+
default:
|
|
311
|
+
const parsedBody = parsedOutput.body;
|
|
312
|
+
return throwDefaultError({
|
|
313
|
+
output,
|
|
314
|
+
parsedBody,
|
|
315
|
+
errorCode,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
320
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
321
|
+
const contents = map({});
|
|
322
|
+
const data = parsedOutput.body;
|
|
323
|
+
const doc = take(data, {
|
|
324
|
+
Message: [, __expectString, `message`],
|
|
325
|
+
});
|
|
326
|
+
Object.assign(contents, doc);
|
|
327
|
+
const exception = new AccessDeniedException({
|
|
328
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
329
|
+
...contents,
|
|
330
|
+
});
|
|
331
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
332
|
+
};
|
|
333
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
334
|
+
const contents = map({});
|
|
335
|
+
const data = parsedOutput.body;
|
|
336
|
+
const doc = take(data, {
|
|
337
|
+
Message: [, __expectString, `message`],
|
|
338
|
+
});
|
|
339
|
+
Object.assign(contents, doc);
|
|
340
|
+
const exception = new InternalServerException({
|
|
341
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
342
|
+
...contents,
|
|
343
|
+
});
|
|
344
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
345
|
+
};
|
|
346
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
347
|
+
const contents = map({});
|
|
348
|
+
const data = parsedOutput.body;
|
|
349
|
+
const doc = take(data, {
|
|
350
|
+
Message: [, __expectString, `message`],
|
|
351
|
+
});
|
|
352
|
+
Object.assign(contents, doc);
|
|
353
|
+
const exception = new ThrottlingException({
|
|
354
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
355
|
+
...contents,
|
|
356
|
+
});
|
|
357
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
358
|
+
};
|
|
359
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
360
|
+
const contents = map({});
|
|
361
|
+
const data = parsedOutput.body;
|
|
362
|
+
const doc = take(data, {
|
|
363
|
+
FieldList: [, (_) => de_ValidationExceptionFieldList(_, context), `fieldList`],
|
|
364
|
+
Message: [, __expectString, `message`],
|
|
365
|
+
Reason: [, __expectString, `reason`],
|
|
366
|
+
});
|
|
367
|
+
Object.assign(contents, doc);
|
|
368
|
+
const exception = new ValidationException({
|
|
369
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
370
|
+
...contents,
|
|
371
|
+
});
|
|
372
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
373
|
+
};
|
|
374
|
+
const se_AutocompleteFilter = (input, context) => {
|
|
375
|
+
return take(input, {
|
|
376
|
+
BoundingBox: (_) => se_BoundingBox(_, context),
|
|
377
|
+
Circle: (_) => se_FilterCircle(_, context),
|
|
378
|
+
IncludeCountries: _json,
|
|
379
|
+
IncludePlaceTypes: _json,
|
|
380
|
+
});
|
|
381
|
+
};
|
|
382
|
+
const se_BoundingBox = (input, context) => {
|
|
383
|
+
return input
|
|
384
|
+
.filter((e) => e != null)
|
|
385
|
+
.map((entry) => {
|
|
386
|
+
return __serializeFloat(entry);
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
const se_FilterCircle = (input, context) => {
|
|
390
|
+
return take(input, {
|
|
391
|
+
Center: (_) => se_Position(_, context),
|
|
392
|
+
Radius: [],
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
const se_Position = (input, context) => {
|
|
396
|
+
return input
|
|
397
|
+
.filter((e) => e != null)
|
|
398
|
+
.map((entry) => {
|
|
399
|
+
return __serializeFloat(entry);
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
const se_SearchNearbyFilter = (input, context) => {
|
|
403
|
+
return take(input, {
|
|
404
|
+
BoundingBox: (_) => se_BoundingBox(_, context),
|
|
405
|
+
ExcludeBusinessChains: _json,
|
|
406
|
+
ExcludeCategories: _json,
|
|
407
|
+
ExcludeFoodTypes: _json,
|
|
408
|
+
IncludeBusinessChains: _json,
|
|
409
|
+
IncludeCategories: _json,
|
|
410
|
+
IncludeCountries: _json,
|
|
411
|
+
IncludeFoodTypes: _json,
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
const se_SearchTextFilter = (input, context) => {
|
|
415
|
+
return take(input, {
|
|
416
|
+
BoundingBox: (_) => se_BoundingBox(_, context),
|
|
417
|
+
Circle: (_) => se_FilterCircle(_, context),
|
|
418
|
+
IncludeCountries: _json,
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
const se_SuggestFilter = (input, context) => {
|
|
422
|
+
return take(input, {
|
|
423
|
+
BoundingBox: (_) => se_BoundingBox(_, context),
|
|
424
|
+
Circle: (_) => se_FilterCircle(_, context),
|
|
425
|
+
IncludeCountries: _json,
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
const de_AccessPoint = (output, context) => {
|
|
429
|
+
return take(output, {
|
|
430
|
+
Position: (_) => de_Position(_, context),
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
const de_AccessPointList = (output, context) => {
|
|
434
|
+
const retVal = (output || [])
|
|
435
|
+
.filter((e) => e != null)
|
|
436
|
+
.map((entry) => {
|
|
437
|
+
return de_AccessPoint(entry, context);
|
|
438
|
+
});
|
|
439
|
+
return retVal;
|
|
440
|
+
};
|
|
441
|
+
const de_AddressComponentMatchScores = (output, context) => {
|
|
442
|
+
return take(output, {
|
|
443
|
+
AddressNumber: __limitedParseDouble,
|
|
444
|
+
Block: __limitedParseDouble,
|
|
445
|
+
Building: __limitedParseDouble,
|
|
446
|
+
Country: __limitedParseDouble,
|
|
447
|
+
District: __limitedParseDouble,
|
|
448
|
+
Intersection: (_) => de_MatchScoreList(_, context),
|
|
449
|
+
Locality: __limitedParseDouble,
|
|
450
|
+
PostalCode: __limitedParseDouble,
|
|
451
|
+
Region: __limitedParseDouble,
|
|
452
|
+
SubBlock: __limitedParseDouble,
|
|
453
|
+
SubDistrict: __limitedParseDouble,
|
|
454
|
+
SubRegion: __limitedParseDouble,
|
|
455
|
+
});
|
|
456
|
+
};
|
|
457
|
+
const de_BoundingBox = (output, context) => {
|
|
458
|
+
const retVal = (output || [])
|
|
459
|
+
.filter((e) => e != null)
|
|
460
|
+
.map((entry) => {
|
|
461
|
+
return __limitedParseDouble(entry);
|
|
462
|
+
});
|
|
463
|
+
return retVal;
|
|
464
|
+
};
|
|
465
|
+
const de_ComponentMatchScores = (output, context) => {
|
|
466
|
+
return take(output, {
|
|
467
|
+
Address: (_) => de_AddressComponentMatchScores(_, context),
|
|
468
|
+
Title: __limitedParseDouble,
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
const de_GeocodeResultItem = (output, context) => {
|
|
472
|
+
return take(output, {
|
|
473
|
+
AccessPoints: (_) => de_AccessPointList(_, context),
|
|
474
|
+
Address: _json,
|
|
475
|
+
AddressNumberCorrected: __expectBoolean,
|
|
476
|
+
Categories: _json,
|
|
477
|
+
Distance: __expectLong,
|
|
478
|
+
FoodTypes: _json,
|
|
479
|
+
MapView: (_) => de_BoundingBox(_, context),
|
|
480
|
+
MatchScores: (_) => de_MatchScoreDetails(_, context),
|
|
481
|
+
PlaceId: __expectString,
|
|
482
|
+
PlaceType: __expectString,
|
|
483
|
+
PoliticalView: __expectString,
|
|
484
|
+
Position: (_) => de_Position(_, context),
|
|
485
|
+
PostalCodeDetails: _json,
|
|
486
|
+
TimeZone: _json,
|
|
487
|
+
Title: __expectString,
|
|
488
|
+
});
|
|
489
|
+
};
|
|
490
|
+
const de_GeocodeResultItemList = (output, context) => {
|
|
491
|
+
const retVal = (output || [])
|
|
492
|
+
.filter((e) => e != null)
|
|
493
|
+
.map((entry) => {
|
|
494
|
+
return de_GeocodeResultItem(entry, context);
|
|
495
|
+
});
|
|
496
|
+
return retVal;
|
|
497
|
+
};
|
|
498
|
+
const de_MatchScoreDetails = (output, context) => {
|
|
499
|
+
return take(output, {
|
|
500
|
+
Components: (_) => de_ComponentMatchScores(_, context),
|
|
501
|
+
Overall: __limitedParseDouble,
|
|
502
|
+
});
|
|
503
|
+
};
|
|
504
|
+
const de_MatchScoreList = (output, context) => {
|
|
505
|
+
const retVal = (output || [])
|
|
506
|
+
.filter((e) => e != null)
|
|
507
|
+
.map((entry) => {
|
|
508
|
+
return __limitedParseDouble(entry);
|
|
509
|
+
});
|
|
510
|
+
return retVal;
|
|
511
|
+
};
|
|
512
|
+
const de_Position = (output, context) => {
|
|
513
|
+
const retVal = (output || [])
|
|
514
|
+
.filter((e) => e != null)
|
|
515
|
+
.map((entry) => {
|
|
516
|
+
return __limitedParseDouble(entry);
|
|
517
|
+
});
|
|
518
|
+
return retVal;
|
|
519
|
+
};
|
|
520
|
+
const de_ReverseGeocodeResultItem = (output, context) => {
|
|
521
|
+
return take(output, {
|
|
522
|
+
AccessPoints: (_) => de_AccessPointList(_, context),
|
|
523
|
+
Address: _json,
|
|
524
|
+
AddressNumberCorrected: __expectBoolean,
|
|
525
|
+
Categories: _json,
|
|
526
|
+
Distance: __expectLong,
|
|
527
|
+
FoodTypes: _json,
|
|
528
|
+
MapView: (_) => de_BoundingBox(_, context),
|
|
529
|
+
PlaceId: __expectString,
|
|
530
|
+
PlaceType: __expectString,
|
|
531
|
+
PoliticalView: __expectString,
|
|
532
|
+
Position: (_) => de_Position(_, context),
|
|
533
|
+
PostalCodeDetails: _json,
|
|
534
|
+
TimeZone: _json,
|
|
535
|
+
Title: __expectString,
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
const de_ReverseGeocodeResultItemList = (output, context) => {
|
|
539
|
+
const retVal = (output || [])
|
|
540
|
+
.filter((e) => e != null)
|
|
541
|
+
.map((entry) => {
|
|
542
|
+
return de_ReverseGeocodeResultItem(entry, context);
|
|
543
|
+
});
|
|
544
|
+
return retVal;
|
|
545
|
+
};
|
|
546
|
+
const de_SearchNearbyResultItem = (output, context) => {
|
|
547
|
+
return take(output, {
|
|
548
|
+
AccessPoints: (_) => de_AccessPointList(_, context),
|
|
549
|
+
AccessRestrictions: _json,
|
|
550
|
+
Address: _json,
|
|
551
|
+
AddressNumberCorrected: __expectBoolean,
|
|
552
|
+
BusinessChains: _json,
|
|
553
|
+
Categories: _json,
|
|
554
|
+
Contacts: _json,
|
|
555
|
+
Distance: __expectLong,
|
|
556
|
+
FoodTypes: _json,
|
|
557
|
+
MapView: (_) => de_BoundingBox(_, context),
|
|
558
|
+
OpeningHours: _json,
|
|
559
|
+
Phonemes: _json,
|
|
560
|
+
PlaceId: __expectString,
|
|
561
|
+
PlaceType: __expectString,
|
|
562
|
+
PoliticalView: __expectString,
|
|
563
|
+
Position: (_) => de_Position(_, context),
|
|
564
|
+
TimeZone: _json,
|
|
565
|
+
Title: __expectString,
|
|
566
|
+
});
|
|
567
|
+
};
|
|
568
|
+
const de_SearchNearbyResultItemList = (output, context) => {
|
|
569
|
+
const retVal = (output || [])
|
|
570
|
+
.filter((e) => e != null)
|
|
571
|
+
.map((entry) => {
|
|
572
|
+
return de_SearchNearbyResultItem(entry, context);
|
|
573
|
+
});
|
|
574
|
+
return retVal;
|
|
575
|
+
};
|
|
576
|
+
const de_SearchTextResultItem = (output, context) => {
|
|
577
|
+
return take(output, {
|
|
578
|
+
AccessPoints: (_) => de_AccessPointList(_, context),
|
|
579
|
+
AccessRestrictions: _json,
|
|
580
|
+
Address: _json,
|
|
581
|
+
AddressNumberCorrected: __expectBoolean,
|
|
582
|
+
BusinessChains: _json,
|
|
583
|
+
Categories: _json,
|
|
584
|
+
Contacts: _json,
|
|
585
|
+
Distance: __expectLong,
|
|
586
|
+
FoodTypes: _json,
|
|
587
|
+
MapView: (_) => de_BoundingBox(_, context),
|
|
588
|
+
OpeningHours: _json,
|
|
589
|
+
Phonemes: _json,
|
|
590
|
+
PlaceId: __expectString,
|
|
591
|
+
PlaceType: __expectString,
|
|
592
|
+
PoliticalView: __expectString,
|
|
593
|
+
Position: (_) => de_Position(_, context),
|
|
594
|
+
TimeZone: _json,
|
|
595
|
+
Title: __expectString,
|
|
596
|
+
});
|
|
597
|
+
};
|
|
598
|
+
const de_SearchTextResultItemList = (output, context) => {
|
|
599
|
+
const retVal = (output || [])
|
|
600
|
+
.filter((e) => e != null)
|
|
601
|
+
.map((entry) => {
|
|
602
|
+
return de_SearchTextResultItem(entry, context);
|
|
603
|
+
});
|
|
604
|
+
return retVal;
|
|
605
|
+
};
|
|
606
|
+
const de_SuggestPlaceResult = (output, context) => {
|
|
607
|
+
return take(output, {
|
|
608
|
+
AccessPoints: (_) => de_AccessPointList(_, context),
|
|
609
|
+
AccessRestrictions: _json,
|
|
610
|
+
Address: _json,
|
|
611
|
+
BusinessChains: _json,
|
|
612
|
+
Categories: _json,
|
|
613
|
+
Distance: __expectLong,
|
|
614
|
+
FoodTypes: _json,
|
|
615
|
+
MapView: (_) => de_BoundingBox(_, context),
|
|
616
|
+
Phonemes: _json,
|
|
617
|
+
PlaceId: __expectString,
|
|
618
|
+
PlaceType: __expectString,
|
|
619
|
+
PoliticalView: __expectString,
|
|
620
|
+
Position: (_) => de_Position(_, context),
|
|
621
|
+
TimeZone: _json,
|
|
622
|
+
});
|
|
623
|
+
};
|
|
624
|
+
const de_SuggestResultItem = (output, context) => {
|
|
625
|
+
return take(output, {
|
|
626
|
+
Highlights: _json,
|
|
627
|
+
Place: (_) => de_SuggestPlaceResult(_, context),
|
|
628
|
+
Query: _json,
|
|
629
|
+
SuggestResultItemType: __expectString,
|
|
630
|
+
Title: __expectString,
|
|
631
|
+
});
|
|
632
|
+
};
|
|
633
|
+
const de_SuggestResultItemList = (output, context) => {
|
|
634
|
+
const retVal = (output || [])
|
|
635
|
+
.filter((e) => e != null)
|
|
636
|
+
.map((entry) => {
|
|
637
|
+
return de_SuggestResultItem(entry, context);
|
|
638
|
+
});
|
|
639
|
+
return retVal;
|
|
640
|
+
};
|
|
641
|
+
const de_ValidationExceptionField = (output, context) => {
|
|
642
|
+
return take(output, {
|
|
643
|
+
Message: [, __expectString, `message`],
|
|
644
|
+
Name: [, __expectString, `name`],
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
const de_ValidationExceptionFieldList = (output, context) => {
|
|
648
|
+
const retVal = (output || [])
|
|
649
|
+
.filter((e) => e != null)
|
|
650
|
+
.map((entry) => {
|
|
651
|
+
return de_ValidationExceptionField(entry, context);
|
|
652
|
+
});
|
|
653
|
+
return retVal;
|
|
654
|
+
};
|
|
655
|
+
const deserializeMetadata = (output) => ({
|
|
656
|
+
httpStatusCode: output.statusCode,
|
|
657
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
658
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
659
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
660
|
+
});
|
|
661
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
662
|
+
const _AF = "AdditionalFeatures";
|
|
663
|
+
const _IU = "IntendedUse";
|
|
664
|
+
const _K = "Key";
|
|
665
|
+
const _L = "Language";
|
|
666
|
+
const _PB = "PricingBucket";
|
|
667
|
+
const _PV = "PoliticalView";
|
|
668
|
+
const _af = "additional-features";
|
|
669
|
+
const _iu = "intended-use";
|
|
670
|
+
const _k = "key";
|
|
671
|
+
const _l = "language";
|
|
672
|
+
const _pv = "political-view";
|
|
673
|
+
const _xagpb = "x-amz-geo-pricing-bucket";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
24
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
28
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
29
|
+
sha256: config?.sha256 ?? Sha256,
|
|
30
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
33
|
+
};
|
|
34
|
+
};
|