@aws/amazon-location-client 1.0.2 → 1.1.1
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/Notice.txt +1 -1
- package/README.md +86 -47
- package/dist/amazonLocationClient.js +16972 -14793
- package/dist/cjs/amazonLocationClient.cjs +56 -8
- package/package.json +13 -9
package/Notice.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Amazon Location JavaScript Client
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
|
|
4
4
|
This product includes software developed at
|
|
5
5
|
Amazon Web Services, Inc. (http://aws.amazon.com/).
|
package/README.md
CHANGED
|
@@ -1,82 +1,121 @@
|
|
|
1
1
|
# Amazon Location JavaScript Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is a distribution of the [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3) containing the standalone [Maps](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-maps/), [Places](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-places/), and [Routes](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-routes/) SDKs, the [Location SDK](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/), our [authentication helper](https://github.com/aws-geospatial/amazon-location-utilities-auth-helper-js), and [credential providers](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-credential-providers/) intended for use in browsers.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Usage with a browser
|
|
8
8
|
|
|
9
9
|
Add the script to an HTML file for usage directly in the browser.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<script src="https://
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/npm/@aws/amazon-location-client@1"></script>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### Usage with modules
|
|
16
16
|
|
|
17
|
-
We recommend
|
|
17
|
+
We recommend using [@aws-sdk/client-geo-maps](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-maps/), [@aws-sdk/client-geo-places](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-places/), [@aws-sdk/client-geo-routes](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-routes/), [@aws-sdk/client-location](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/) and [@aws-sdk/credential-providers](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-credential-providers/) from the [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3) if possible to get the full benefit of the modularized AWS SDK.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Usage
|
|
20
20
|
|
|
21
|
-
All
|
|
21
|
+
All functions are available under the `amazonLocationClient` global.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
### API Key
|
|
24
|
+
|
|
25
|
+
This example uses the Amazon Location Client to make a request that authenticates using an API key.
|
|
24
26
|
|
|
25
27
|
```html
|
|
26
|
-
<!--
|
|
27
|
-
<script src="https://
|
|
28
|
+
<!-- Import the Amazon Location Client -->
|
|
29
|
+
<script src="https://cdn.jsdelivr.net/npm/@aws/amazon-location-client@1"></script>
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
```javascript
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
credentials: amazonLocationClient.fromCognitoIdentityPool({
|
|
36
|
-
clientConfig: {
|
|
37
|
-
region: "<Region>", // region containing Amazon Cognito Identity Pool
|
|
38
|
-
},
|
|
39
|
-
identityPoolId
|
|
40
|
-
})
|
|
41
|
-
});
|
|
33
|
+
// Create an authentication helper instance using an API key and region
|
|
34
|
+
const authHelper = await amazonLocationClient.withAPIKey("<API Key>", "<Region>");
|
|
35
|
+
|
|
36
|
+
const client = new amazonLocationClient.GeoRoutesClient(authHelper.getClientConfig());
|
|
42
37
|
const input = { ... };
|
|
43
|
-
const command = new amazonLocationClient.
|
|
38
|
+
const command = new amazonLocationClient.routes.CalculateRoutesCommand(input);
|
|
44
39
|
const response = await client.send(command);
|
|
45
40
|
```
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
### Cognito
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
This example uses the Amazon Location Client to make a request that authenticates using Amazon Cognito. For more information on setting up Amazon Cognito identity pools, please refer to this [guide](https://docs.aws.amazon.com/location/latest/developerguide/authenticating-using-cognito.html).
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
// Create an authentication helper instance using credentials from Amazon Cognito
|
|
48
|
+
const authHelper = await amazonLocationClient.withIdentityPoolId("<Identity Pool ID>");
|
|
49
|
+
|
|
50
|
+
const client = new amazonLocationClient.GeoRoutesClient(authHelper.getClientConfig());
|
|
51
|
+
const input = { ... };
|
|
52
|
+
const command = new amazonLocationClient.routes.CalculateRoutesCommand(input);
|
|
53
|
+
const response = await client.send(command);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
The APIs for the different client SDKs are grouped separately.
|
|
59
|
+
|
|
60
|
+
### [@aws-sdk/client-geo-maps](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-maps/)
|
|
61
|
+
|
|
62
|
+
The standalone Maps SDK commands are grouped into a `maps` namespace. For example:
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
// Create an authentication helper instance using an API key and region
|
|
66
|
+
const authHelper = await amazonLocationClient.withAPIKey("<API Key>", "<Region>");
|
|
67
|
+
|
|
68
|
+
const client = new amazonLocationClient.GeoMapsClient(authHelper.getClientConfig());
|
|
69
|
+
const input = { ... };
|
|
70
|
+
const command = new amazonLocationClient.maps.GetStaticMapCommand(input);
|
|
71
|
+
const response = await client.send(command);
|
|
54
72
|
```
|
|
55
73
|
|
|
74
|
+
### [@aws-sdk/client-geo-places](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-places/)
|
|
75
|
+
|
|
76
|
+
The standalone Places SDK commands are grouped into a `places` namespace. For example:
|
|
77
|
+
|
|
56
78
|
```javascript
|
|
57
|
-
|
|
79
|
+
// Create an authentication helper instance using an API key and region
|
|
80
|
+
const authHelper = await amazonLocationClient.withAPIKey("<API Key>", "<Region>");
|
|
81
|
+
|
|
82
|
+
const client = new amazonLocationClient.GeoPlacesClient(authHelper.getClientConfig());
|
|
83
|
+
const input = { ... };
|
|
84
|
+
const command = new amazonLocationClient.places.GetPlaceCommand(input);
|
|
85
|
+
const response = await client.send(command);
|
|
86
|
+
```
|
|
58
87
|
|
|
59
|
-
|
|
60
|
-
const authHelper = await amazonLocationAuthHelper.withIdentityPoolId(identityPoolId);
|
|
88
|
+
### [@aws-sdk/client-geo-routes](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-routes/)
|
|
61
89
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
90
|
+
The standalone Routes SDK commands are grouped into a `routes` namespace. For example:
|
|
91
|
+
|
|
92
|
+
```javascript
|
|
93
|
+
// Create an authentication helper instance using an API key and region
|
|
94
|
+
const authHelper = await amazonLocationClient.withAPIKey("<API Key>", "<Region>");
|
|
95
|
+
|
|
96
|
+
const client = new amazonLocationClient.GeoRoutesClient(authHelper.getClientConfig());
|
|
66
97
|
const input = { ... };
|
|
67
|
-
const command = new amazonLocationClient.
|
|
98
|
+
const command = new amazonLocationClient.routes.CalculateRoutesCommand(input);
|
|
68
99
|
const response = await client.send(command);
|
|
69
100
|
```
|
|
70
101
|
|
|
71
|
-
|
|
102
|
+
### [@aws-sdk/client-location](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/)
|
|
103
|
+
|
|
104
|
+
The Location SDK commands are under the top-level namespace. For example:
|
|
72
105
|
|
|
73
|
-
|
|
106
|
+
```javascript
|
|
107
|
+
// Create an authentication helper instance using an API key and region
|
|
108
|
+
const authHelper = await amazonLocationClient.withAPIKey("<API Key>", "<Region>");
|
|
74
109
|
|
|
75
|
-
|
|
110
|
+
const client = new amazonLocationClient.LocationClient(authHelper.getClientConfig());
|
|
111
|
+
const input = { ... };
|
|
112
|
+
const command = new amazonLocationClient.ListGeofencesCommand(input);
|
|
113
|
+
const response = await client.send(command);
|
|
114
|
+
```
|
|
76
115
|
|
|
77
|
-
|
|
116
|
+
Refer to [@aws-sdk/client-geo-maps](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-maps/), [@aws-sdk/client-geo-places](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-places/), [@aws-sdk/client-geo-routes](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/geo-routes/), [@aws-sdk/client-location](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/) and [@aws-sdk/credential-providers](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-credential-providers/) for further documentation.
|
|
78
117
|
|
|
79
|
-
|
|
118
|
+
## Getting Help
|
|
80
119
|
|
|
81
120
|
The best way to interact with our team is through GitHub.
|
|
82
121
|
You can [open an issue](https://github.com/aws-geospatial/amazon-location-client-js/issues/new/choose) and choose from one of our templates for
|
|
@@ -85,15 +124,15 @@ You can [open an issue](https://github.com/aws-geospatial/amazon-location-client
|
|
|
85
124
|
or [guidance](https://github.com/aws-geospatial/amazon-location-client-js/issues/new?assignees=&labels=guidance%2C+needs-triage&template=---questions---help.md&title=).
|
|
86
125
|
If you have a support plan with [AWS Support](https://aws.amazon.com/premiumsupport/), you can also create a new support case.
|
|
87
126
|
|
|
88
|
-
Please make sure to check out
|
|
127
|
+
Please make sure to check out the following resources before opening an issue:
|
|
89
128
|
|
|
90
|
-
- Our [Changelog](
|
|
129
|
+
- Our [Changelog](CHANGELOG.md) for recent changes.
|
|
91
130
|
|
|
92
|
-
|
|
131
|
+
## Contributing
|
|
93
132
|
|
|
94
|
-
We welcome community contributions and pull requests. See [CONTRIBUTING.md](
|
|
133
|
+
We welcome community contributions and pull requests. See [CONTRIBUTING.md](CONTRIBUTING.md) for information on how to set up a development environment and submit code.
|
|
95
134
|
|
|
96
|
-
|
|
135
|
+
## License
|
|
97
136
|
|
|
98
137
|
Amazon Location JavaScript Client is distributed under the
|
|
99
138
|
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
|