@azure-rest/maps-geolocation 1.0.0-beta.4 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/LICENSE +4 -4
- package/README.md +33 -24
- package/dist/browser/MapsGeolocation.d.ts +53 -0
- package/dist/browser/MapsGeolocation.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/MapsGeolocation.js +1 -1
- package/dist/browser/MapsGeolocation.js.map +1 -0
- package/dist/browser/generated/clientDefinitions.d.ts +18 -0
- package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/generated/clientDefinitions.js +4 -0
- package/dist/browser/generated/clientDefinitions.js.map +1 -0
- package/dist/browser/generated/index.d.ts +9 -0
- package/dist/browser/generated/index.d.ts.map +1 -0
- package/dist/browser/generated/index.js +11 -0
- package/dist/browser/generated/index.js.map +1 -0
- package/dist/browser/generated/isUnexpected.d.ts +3 -0
- package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
- package/dist/browser/generated/isUnexpected.js +70 -0
- package/dist/browser/generated/isUnexpected.js.map +1 -0
- package/dist/browser/generated/logger.d.ts +2 -0
- package/dist/browser/generated/logger.d.ts.map +1 -0
- package/dist/browser/generated/logger.js +5 -0
- package/dist/browser/generated/logger.js.map +1 -0
- package/dist/browser/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/browser/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/browser/generated/mapsGeolocationClient.js +44 -0
- package/dist/browser/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/browser/generated/outputModels.d.ts +38 -0
- package/dist/browser/generated/outputModels.d.ts.map +1 -0
- package/dist/browser/generated/outputModels.js +4 -0
- package/dist/browser/generated/outputModels.js.map +1 -0
- package/dist/browser/generated/parameters.d.ts +10 -0
- package/dist/browser/generated/parameters.d.ts.map +1 -0
- package/dist/browser/generated/parameters.js +4 -0
- package/dist/browser/generated/parameters.js.map +1 -0
- package/dist/browser/generated/responses.d.ts +19 -0
- package/dist/browser/generated/responses.d.ts.map +1 -0
- package/dist/browser/generated/responses.js +4 -0
- package/dist/browser/generated/responses.js.map +1 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +6 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/commonjs/MapsGeolocation.d.ts +53 -0
- package/dist/commonjs/MapsGeolocation.d.ts.map +1 -0
- package/dist/commonjs/MapsGeolocation.js +44 -0
- package/dist/commonjs/MapsGeolocation.js.map +1 -0
- package/dist/commonjs/generated/clientDefinitions.d.ts +18 -0
- package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/generated/clientDefinitions.js +5 -0
- package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +9 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +14 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/isUnexpected.d.ts +3 -0
- package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/generated/isUnexpected.js +73 -0
- package/dist/commonjs/generated/isUnexpected.js.map +1 -0
- package/dist/commonjs/generated/logger.d.ts +2 -0
- package/dist/commonjs/generated/logger.d.ts.map +1 -0
- package/dist/commonjs/generated/logger.js +8 -0
- package/dist/commonjs/generated/logger.js.map +1 -0
- package/dist/commonjs/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/commonjs/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/commonjs/generated/mapsGeolocationClient.js +47 -0
- package/dist/commonjs/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/commonjs/generated/outputModels.d.ts +38 -0
- package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
- package/dist/commonjs/generated/outputModels.js +5 -0
- package/dist/commonjs/generated/outputModels.js.map +1 -0
- package/dist/commonjs/generated/parameters.d.ts +10 -0
- package/dist/commonjs/generated/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/parameters.js +5 -0
- package/dist/commonjs/generated/parameters.js.map +1 -0
- package/dist/commonjs/generated/responses.d.ts +19 -0
- package/dist/commonjs/generated/responses.d.ts.map +1 -0
- package/dist/commonjs/generated/responses.js +5 -0
- package/dist/commonjs/generated/responses.js.map +1 -0
- package/dist/commonjs/index.d.ts +4 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +9 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/MapsGeolocation.d.ts +53 -0
- package/dist/esm/MapsGeolocation.d.ts.map +1 -0
- package/dist/esm/MapsGeolocation.js +40 -0
- package/dist/esm/MapsGeolocation.js.map +1 -0
- package/dist/esm/generated/clientDefinitions.d.ts +18 -0
- package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/generated/clientDefinitions.js +4 -0
- package/dist/esm/generated/clientDefinitions.js.map +1 -0
- package/dist/esm/generated/index.d.ts +9 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +11 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/isUnexpected.d.ts +3 -0
- package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
- package/dist/esm/generated/isUnexpected.js +70 -0
- package/dist/esm/generated/isUnexpected.js.map +1 -0
- package/dist/esm/generated/logger.d.ts +2 -0
- package/dist/esm/generated/logger.d.ts.map +1 -0
- package/dist/esm/generated/logger.js +5 -0
- package/dist/esm/generated/logger.js.map +1 -0
- package/dist/esm/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/esm/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/esm/generated/mapsGeolocationClient.js +44 -0
- package/dist/esm/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/esm/generated/outputModels.d.ts +38 -0
- package/dist/esm/generated/outputModels.d.ts.map +1 -0
- package/dist/esm/generated/outputModels.js +4 -0
- package/dist/esm/generated/outputModels.js.map +1 -0
- package/dist/esm/generated/parameters.d.ts +10 -0
- package/dist/esm/generated/parameters.d.ts.map +1 -0
- package/dist/esm/generated/parameters.js +4 -0
- package/dist/esm/generated/parameters.js.map +1 -0
- package/dist/esm/generated/responses.d.ts +19 -0
- package/dist/esm/generated/responses.d.ts.map +1 -0
- package/dist/esm/generated/responses.js +4 -0
- package/dist/esm/generated/responses.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/react-native/MapsGeolocation.d.ts +53 -0
- package/dist/react-native/MapsGeolocation.d.ts.map +1 -0
- package/dist/react-native/MapsGeolocation.js +40 -0
- package/dist/react-native/MapsGeolocation.js.map +1 -0
- package/dist/react-native/generated/clientDefinitions.d.ts +18 -0
- package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/generated/clientDefinitions.js +4 -0
- package/dist/react-native/generated/clientDefinitions.js.map +1 -0
- package/dist/react-native/generated/index.d.ts +9 -0
- package/dist/react-native/generated/index.d.ts.map +1 -0
- package/dist/react-native/generated/index.js +11 -0
- package/dist/react-native/generated/index.js.map +1 -0
- package/dist/react-native/generated/isUnexpected.d.ts +3 -0
- package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/generated/isUnexpected.js +70 -0
- package/dist/react-native/generated/isUnexpected.js.map +1 -0
- package/dist/react-native/generated/logger.d.ts +2 -0
- package/dist/react-native/generated/logger.d.ts.map +1 -0
- package/dist/react-native/generated/logger.js +5 -0
- package/dist/react-native/generated/logger.js.map +1 -0
- package/dist/react-native/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/react-native/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/react-native/generated/mapsGeolocationClient.js +44 -0
- package/dist/react-native/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/react-native/generated/outputModels.d.ts +38 -0
- package/dist/react-native/generated/outputModels.d.ts.map +1 -0
- package/dist/react-native/generated/outputModels.js +4 -0
- package/dist/react-native/generated/outputModels.js.map +1 -0
- package/dist/react-native/generated/parameters.d.ts +10 -0
- package/dist/react-native/generated/parameters.d.ts.map +1 -0
- package/dist/react-native/generated/parameters.js +4 -0
- package/dist/react-native/generated/parameters.js.map +1 -0
- package/dist/react-native/generated/responses.d.ts +19 -0
- package/dist/react-native/generated/responses.d.ts.map +1 -0
- package/dist/react-native/generated/responses.js +4 -0
- package/dist/react-native/generated/responses.js.map +1 -0
- package/dist/react-native/index.d.ts +4 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +6 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/package.json +86 -72
- package/dist/index.js +0 -167
- package/dist/index.js.map +0 -1
- package/dist-esm/src/MapsGeolocation.js.map +0 -1
- package/dist-esm/src/index.js +0 -6
- package/dist-esm/src/index.js.map +0 -1
- package/types/maps-geolocation-rest.d.ts +0 -159
- /package/review/{maps-geolocation.api.md → maps-geolocation-node.api.md} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Release History
|
|
2
|
+
|
|
3
|
+
## 1.0.0-beta.6 (Unreleased)
|
|
4
|
+
|
|
5
|
+
### Features Added
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
### Bugs Fixed
|
|
10
|
+
|
|
11
|
+
### Other Changes
|
|
12
|
+
|
|
13
|
+
## 1.0.0-beta.5 (2025-03-14)
|
|
14
|
+
|
|
15
|
+
### Bugs Fixed
|
|
16
|
+
|
|
17
|
+
- Fix ESM module file not found.
|
|
18
|
+
|
|
19
|
+
## 1.0.0-beta.4 (2024-12-10)
|
|
20
|
+
|
|
21
|
+
### Breaking Changes
|
|
22
|
+
|
|
23
|
+
- Marked fields in various interfaces as readonly, which may impact code that previously modified these properties.
|
|
24
|
+
|
|
25
|
+
### Bugs Fixed
|
|
26
|
+
|
|
27
|
+
- Fix the Microsoft Entra ID authentication when providing `baseUrl`.
|
|
28
|
+
|
|
29
|
+
## 1.0.0-beta.3 (2024-01-09)
|
|
30
|
+
|
|
31
|
+
### Features Added
|
|
32
|
+
|
|
33
|
+
- Support SAS token authentication.
|
|
34
|
+
|
|
35
|
+
## 1.0.0-beta.2 (2023-07-11)
|
|
36
|
+
|
|
37
|
+
### Other Changes
|
|
38
|
+
|
|
39
|
+
- Update README.
|
|
40
|
+
|
|
41
|
+
## 1.0.0-beta.1 (2023-01-10)
|
|
42
|
+
|
|
43
|
+
### Features Added
|
|
44
|
+
|
|
45
|
+
- Initial Release
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MIT License
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -12,10 +12,10 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -58,11 +58,12 @@ You'll need to register the new Microsoft Entra ID application and grant access
|
|
|
58
58
|
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
|
|
59
59
|
|
|
60
60
|
You will also need to specify the Azure Maps resource you intend to use by specifying the `clientId` in the client options.
|
|
61
|
-
The Azure Maps resource client id can be found in the Authentication sections in the Azure Maps resource. Please refer to the [documentation](https://
|
|
61
|
+
The Azure Maps resource client id can be found in the Authentication sections in the Azure Maps resource. Please refer to the [documentation](https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details) on how to find it.
|
|
62
|
+
|
|
63
|
+
```ts snippet:ReadmeSampleCreateClient_TokenCredential
|
|
64
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
65
|
+
import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
62
66
|
|
|
63
|
-
```javascript
|
|
64
|
-
const MapsGeolocation = require("@azure-rest/maps-geolocation").default;
|
|
65
|
-
const { DefaultAzureCredential } = require("@azure/identity");
|
|
66
67
|
const credential = new DefaultAzureCredential();
|
|
67
68
|
const client = MapsGeolocation(credential, "<maps-account-client-id>");
|
|
68
69
|
```
|
|
@@ -75,9 +76,10 @@ You can authenticate with your Azure Maps Subscription Key. Please install the["
|
|
|
75
76
|
npm install @azure/core-auth
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
```ts snippet:ReadmeSampleCreateClient_SubscriptionKey
|
|
80
|
+
import { AzureKeyCredential } from "@azure/core-auth";
|
|
81
|
+
import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
82
|
+
|
|
81
83
|
const credential = new AzureKeyCredential("<subscription-key>");
|
|
82
84
|
const client = MapsGeolocation(credential);
|
|
83
85
|
```
|
|
@@ -98,11 +100,11 @@ npm install @azure/core-auth
|
|
|
98
100
|
|
|
99
101
|
Finally, you can use the SAS token to authenticate the client:
|
|
100
102
|
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
```ts snippet:ReadmeSampleCreateClient_SAS
|
|
104
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
105
|
+
import { AzureMapsManagementClient } from "@azure/arm-maps";
|
|
106
|
+
import { AzureSASCredential } from "@azure/core-auth";
|
|
107
|
+
import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
106
108
|
|
|
107
109
|
const subscriptionId = "<subscription ID of the map account>";
|
|
108
110
|
const resourceGroupName = "<resource group name of the map account>";
|
|
@@ -114,6 +116,7 @@ const mapsAccountSasParameters = {
|
|
|
114
116
|
principalId: "<principle ID (object ID) of the managed identity>",
|
|
115
117
|
signingKey: "primaryKey",
|
|
116
118
|
};
|
|
119
|
+
|
|
117
120
|
const credential = new DefaultAzureCredential();
|
|
118
121
|
const managementClient = new AzureMapsManagementClient(credential, subscriptionId);
|
|
119
122
|
const { accountSasToken } = await managementClient.accounts.listSas(
|
|
@@ -121,9 +124,11 @@ const { accountSasToken } = await managementClient.accounts.listSas(
|
|
|
121
124
|
accountName,
|
|
122
125
|
mapsAccountSasParameters,
|
|
123
126
|
);
|
|
127
|
+
|
|
124
128
|
if (accountSasToken === undefined) {
|
|
125
129
|
throw new Error("No accountSasToken was found for the Maps Account.");
|
|
126
130
|
}
|
|
131
|
+
|
|
127
132
|
const sasCredential = new AzureSASCredential(accountSasToken);
|
|
128
133
|
const client = MapsGeolocation(sasCredential);
|
|
129
134
|
```
|
|
@@ -138,8 +143,12 @@ const client = MapsGeolocation(sasCredential);
|
|
|
138
143
|
|
|
139
144
|
You can get the country code from a IP address:
|
|
140
145
|
|
|
141
|
-
```
|
|
142
|
-
|
|
146
|
+
```ts snippet:ReadmeSampleGetCountryCode
|
|
147
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
148
|
+
import MapsGeolocation, { isUnexpected } from "@azure-rest/maps-geolocation";
|
|
149
|
+
|
|
150
|
+
const credential = new DefaultAzureCredential();
|
|
151
|
+
const client = MapsGeolocation(credential, "<maps-account-client-id>");
|
|
143
152
|
|
|
144
153
|
const result = await client.path("/geolocation/ip/{format}", "json").get({
|
|
145
154
|
queryParameters: { ip: "2001:4898:80e8:b::189" },
|
|
@@ -148,9 +157,11 @@ const result = await client.path("/geolocation/ip/{format}", "json").get({
|
|
|
148
157
|
if (isUnexpected(result)) {
|
|
149
158
|
throw result.body.error;
|
|
150
159
|
}
|
|
160
|
+
|
|
151
161
|
if (!result.body.countryRegion) {
|
|
152
162
|
throw new Error("No country region was found for the IP address.");
|
|
153
163
|
}
|
|
164
|
+
|
|
154
165
|
console.log(`The country code for the IP address is ${result.body.countryRegion.isoCode}`);
|
|
155
166
|
```
|
|
156
167
|
|
|
@@ -160,26 +171,24 @@ console.log(`The country code for the IP address is ${result.body.countryRegion.
|
|
|
160
171
|
|
|
161
172
|
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
162
173
|
|
|
163
|
-
```
|
|
164
|
-
|
|
174
|
+
```ts snippet:SetLogLevel
|
|
175
|
+
import { setLogLevel } from "@azure/logger";
|
|
165
176
|
|
|
166
177
|
setLogLevel("info");
|
|
167
178
|
```
|
|
168
179
|
|
|
169
180
|
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
170
181
|
|
|
171
|
-

|
|
172
|
-
|
|
173
182
|
[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-geolocation-rest
|
|
174
183
|
[npm_package]: https://www.npmjs.com/package/@azure-rest/maps-geolocation
|
|
175
|
-
[api_ref]: https://
|
|
184
|
+
[api_ref]: https://learn.microsoft.com/javascript/api/@azure-rest/maps-geolocation?view=azure-node-preview
|
|
176
185
|
[samples]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-geolocation-rest/samples
|
|
177
186
|
[product_info]: https://learn.microsoft.com/rest/api/maps/geolocation
|
|
178
187
|
[az_subscription]: https://azure.microsoft.com/free/
|
|
179
|
-
[az_maps_account_management]: https://
|
|
188
|
+
[az_maps_account_management]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys
|
|
180
189
|
[azure_portal]: https://portal.azure.com
|
|
181
|
-
[azure_powershell]: https://
|
|
182
|
-
[azure_cli]: https://
|
|
183
|
-
[az_map_pricing]: https://
|
|
184
|
-
[az_map_az_cli]: https://
|
|
190
|
+
[azure_powershell]: https://learn.microsoft.com/powershell/module/az.maps/new-azmapsaccount
|
|
191
|
+
[azure_cli]: https://learn.microsoft.com/cli/azure
|
|
192
|
+
[az_map_pricing]: https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier
|
|
193
|
+
[az_map_az_cli]: https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create
|
|
185
194
|
[az_map_auth]: https://learn.microsoft.com/azure/azure-maps/azure-maps-authentication
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import type { AzureKeyCredential, AzureSASCredential, TokenCredential } from "@azure/core-auth";
|
|
3
|
+
import type { MapsGeolocationClient } from "./generated/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates an instance of MapsGeolocationClient from a subscription key.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts snippet:ReadmeSampleCreateClient_SubscriptionKey
|
|
9
|
+
* import { AzureKeyCredential } from "@azure/core-auth";
|
|
10
|
+
* import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
11
|
+
*
|
|
12
|
+
* const credential = new AzureKeyCredential("<subscription-key>");
|
|
13
|
+
* const client = MapsGeolocation(credential);
|
|
14
|
+
*```
|
|
15
|
+
*
|
|
16
|
+
* @param credential - An AzureKeyCredential instance used to authenticate requests to the service
|
|
17
|
+
* @param options - Options used to configure the Geolocation Client
|
|
18
|
+
*/
|
|
19
|
+
export default function MapsGeolocation(credential: AzureKeyCredential, options?: ClientOptions): MapsGeolocationClient;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts snippet:ReadmeSampleCreateClient_TokenCredential
|
|
25
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
26
|
+
* import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
27
|
+
*
|
|
28
|
+
* const credential = new DefaultAzureCredential();
|
|
29
|
+
* const client = MapsGeolocation(credential, "<maps-account-client-id>");
|
|
30
|
+
*```
|
|
31
|
+
*
|
|
32
|
+
* @param credential - An TokenCredential instance used to authenticate requests to the service
|
|
33
|
+
* @param mapsAccountClientId - The Azure Maps client id of a specific map resource
|
|
34
|
+
* @param options - Options used to configure the Route Client
|
|
35
|
+
*/
|
|
36
|
+
export default function MapsGeolocation(credential: TokenCredential, mapsAccountClientId: string, options?: ClientOptions): MapsGeolocationClient;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts snippet:ReadmeSampleCreateClient_SASToken
|
|
42
|
+
* import { AzureSASCredential } from "@azure/core-auth";
|
|
43
|
+
* import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
44
|
+
*
|
|
45
|
+
* const credential = new AzureSASCredential("<SAS Token>");
|
|
46
|
+
* const client = MapsGeolocation(credential);
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @param credential - An AzureSASCredential instance used to authenticate requests to the service
|
|
50
|
+
* @param options - Options used to configure the Geolocation Client
|
|
51
|
+
*/
|
|
52
|
+
export default function MapsGeolocation(credential: AzureSASCredential, options?: ClientOptions): MapsGeolocationClient;
|
|
53
|
+
//# sourceMappingURL=MapsGeolocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapsGeolocation.d.ts","sourceRoot":"","sources":["../../src/MapsGeolocation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,CAAC,EAAE,aAAa,GACtB,qBAAqB,CAAC;AACzB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAU,EAAE,eAAe,EAC3B,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,aAAa,GACtB,qBAAqB,CAAC;AACzB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,CAAC,EAAE,aAAa,GACtB,qBAAqB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { isSASCredential, isTokenCredential } from "@azure/core-auth";
|
|
4
4
|
import { createMapsClientIdPolicy } from "@azure/maps-common";
|
|
5
|
-
import createClient from "
|
|
5
|
+
import createClient from "./generated/index.js";
|
|
6
6
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
7
7
|
export default function MapsGeolocation(credential, clientIdOrOptions = {}, maybeOptions = {}) {
|
|
8
8
|
const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapsGeolocation.js","sourceRoot":"","sources":["../../src/MapsGeolocation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AA6D5E,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAqE,EACrE,oBAA4C,EAAE,EAC9C,eAA8B,EAAE;IAEhC,MAAM,OAAO,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEzF;;;;OAIG;IACH,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,+BAA+B,CAAC;YAC9B,UAAU;YACV,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;gBACxE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport type { AzureKeyCredential, AzureSASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsGeolocationClient } from \"./generated/index.js\";\nimport createClient from \"./generated/index.js\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsGeolocationClient from a subscription key.\n *\n * @example\n * ```ts snippet:ReadmeSampleCreateClient_SubscriptionKey\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsGeolocation(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts snippet:ReadmeSampleCreateClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsGeolocation(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsGeolocation(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts snippet:ReadmeSampleCreateClient_SASToken\n * import { AzureSASCredential } from \"@azure/core-auth\";\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsGeolocation(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\nexport default function MapsGeolocation(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsGeolocationClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard Microsoft Entra ID.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: \"https://atlas.microsoft.com/.default\",\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GeolocationGetLocationParameters } from "./parameters.js";
|
|
2
|
+
import { GeolocationGetLocation200Response, GeolocationGetLocationDefaultResponse } from "./responses.js";
|
|
3
|
+
import { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
4
|
+
export interface GetLocation {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.
|
|
8
|
+
*/
|
|
9
|
+
get(options: GeolocationGetLocationParameters): StreamableMethod<GeolocationGetLocation200Response | GeolocationGetLocationDefaultResponse>;
|
|
10
|
+
}
|
|
11
|
+
export interface Routes {
|
|
12
|
+
/** Resource for '/geolocation/ip/\{format\}' has methods for the following verbs: get */
|
|
13
|
+
(path: "/geolocation/ip/{format}", format: "json"): GetLocation;
|
|
14
|
+
}
|
|
15
|
+
export type MapsGeolocationClient = Client & {
|
|
16
|
+
path: Routes;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=clientDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,iCAAiC,EACjC,qCAAqC,EACtC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,gCAAgC,GACxC,gBAAgB,CACjB,iCAAiC,GAAG,qCAAqC,CAC1E,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,yFAAyF;IACzF,CAAC,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;CACjE;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { GeolocationGetLocationParameters } from \"./parameters.js\";\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse,\n} from \"./responses.js\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetLocation {\n /**\n *\n * The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.\n */\n get(\n options: GeolocationGetLocationParameters,\n ): StreamableMethod<\n GeolocationGetLocation200Response | GeolocationGetLocationDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/geolocation/ip/\\{format\\}' has methods for the following verbs: get */\n (path: \"/geolocation/ip/{format}\", format: \"json\"): GetLocation;\n}\n\nexport type MapsGeolocationClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import MapsGeolocationClient from "./mapsGeolocationClient.js";
|
|
2
|
+
export * from "./mapsGeolocationClient.js";
|
|
3
|
+
export * from "./parameters.js";
|
|
4
|
+
export * from "./responses.js";
|
|
5
|
+
export * from "./clientDefinitions.js";
|
|
6
|
+
export * from "./isUnexpected.js";
|
|
7
|
+
export * from "./outputModels.js";
|
|
8
|
+
export default MapsGeolocationClient;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAE/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAElC,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import MapsGeolocationClient from "./mapsGeolocationClient.js";
|
|
4
|
+
export * from "./mapsGeolocationClient.js";
|
|
5
|
+
export * from "./parameters.js";
|
|
6
|
+
export * from "./responses.js";
|
|
7
|
+
export * from "./clientDefinitions.js";
|
|
8
|
+
export * from "./isUnexpected.js";
|
|
9
|
+
export * from "./outputModels.js";
|
|
10
|
+
export default MapsGeolocationClient;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAE/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAElC,eAAe,qBAAqB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsGeolocationClient from \"./mapsGeolocationClient.js\";\n\nexport * from \"./mapsGeolocationClient.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./outputModels.js\";\n\nexport default MapsGeolocationClient;\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GeolocationGetLocation200Response, GeolocationGetLocationDefaultResponse } from "./responses.js";
|
|
2
|
+
export declare function isUnexpected(response: GeolocationGetLocation200Response | GeolocationGetLocationDefaultResponse): response is GeolocationGetLocationDefaultResponse;
|
|
3
|
+
//# sourceMappingURL=isUnexpected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iCAAiC,EACjC,qCAAqC,EACtC,MAAM,gBAAgB,CAAC;AAMxB,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,iCAAiC,GACjC,qCAAqC,GACxC,QAAQ,IAAI,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
const responseMap = {
|
|
4
|
+
"GET /geolocation/ip/{format}": ["200"],
|
|
5
|
+
};
|
|
6
|
+
export function isUnexpected(response) {
|
|
7
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
8
|
+
const url = new URL(lroOriginal ?? response.request.url);
|
|
9
|
+
const method = response.request.method;
|
|
10
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
11
|
+
if (!pathDetails) {
|
|
12
|
+
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
13
|
+
}
|
|
14
|
+
return !pathDetails.includes(response.status);
|
|
15
|
+
}
|
|
16
|
+
function getParametrizedPathSuccess(method, path) {
|
|
17
|
+
const pathParts = path.split("/");
|
|
18
|
+
// Traverse list to match the longest candidate
|
|
19
|
+
// matchedLen: the length of candidate path
|
|
20
|
+
// matchedValue: the matched status code array
|
|
21
|
+
let matchedLen = -1, matchedValue = [];
|
|
22
|
+
// Iterate the responseMap to find a match
|
|
23
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
24
|
+
// Extracting the path from the map key which is in format
|
|
25
|
+
// GET /path/foo
|
|
26
|
+
if (!key.startsWith(method)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const candidatePath = getPathFromMapKey(key);
|
|
30
|
+
// Get each part of the url path
|
|
31
|
+
const candidateParts = candidatePath.split("/");
|
|
32
|
+
// track if we have found a match to return the values found.
|
|
33
|
+
let found = true;
|
|
34
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
35
|
+
if (candidateParts[i]?.startsWith("{") &&
|
|
36
|
+
candidateParts[i]?.indexOf("}") !== -1) {
|
|
37
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
38
|
+
// If the current part of the candidate is a "template" part
|
|
39
|
+
// Try to use the suffix of pattern to match the path
|
|
40
|
+
// {guid} ==> $
|
|
41
|
+
// {guid}:export ==> :export$
|
|
42
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
43
|
+
if (!isMatched) {
|
|
44
|
+
found = false;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
// If the candidate part is not a template and
|
|
50
|
+
// the parts don't match mark the candidate as not found
|
|
51
|
+
// to move on with the next candidate path.
|
|
52
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
53
|
+
found = false;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// We finished evaluating the current candidate parts
|
|
58
|
+
// Update the matched value if and only if we found the longer pattern
|
|
59
|
+
if (found && candidatePath.length > matchedLen) {
|
|
60
|
+
matchedLen = candidatePath.length;
|
|
61
|
+
matchedValue = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return matchedValue;
|
|
65
|
+
}
|
|
66
|
+
function getPathFromMapKey(mapKey) {
|
|
67
|
+
const pathStart = mapKey.indexOf("/");
|
|
68
|
+
return mapKey.slice(pathStart);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /geolocation/ip/{format}\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | GeolocationGetLocation200Response\n | GeolocationGetLocationDefaultResponse,\n): response is GeolocationGetLocationDefaultResponse;\nexport function isUnexpected(\n response:\n | GeolocationGetLocation200Response\n | GeolocationGetLocationDefaultResponse,\n): response is GeolocationGetLocationDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (\n let i = candidateParts.length - 1, j = pathParts.length - 1;\n i >= 1 && j >= 1;\n i--, j--\n ) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.indexOf(\"}\") !== -1\n ) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(\n `${candidateParts[i]?.slice(start, end)}`,\n ).test(pathParts[j] || \"\");\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-geolocation\");\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import { KeyCredential } from "@azure/core-auth";
|
|
3
|
+
import { MapsGeolocationClient } from "./clientDefinitions.js";
|
|
4
|
+
/** The optional parameters for the client */
|
|
5
|
+
export interface MapsGeolocationClientOptions extends ClientOptions {
|
|
6
|
+
/** The api version option of the client */
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Initialize a new instance of `MapsGeolocationClient`
|
|
11
|
+
* @param credentials - uniquely identify client credential
|
|
12
|
+
* @param options - the parameter for all optional parameters
|
|
13
|
+
*/
|
|
14
|
+
export default function createClient(credentials: KeyCredential, { apiVersion, ...options }?: MapsGeolocationClientOptions): MapsGeolocationClient;
|
|
15
|
+
//# sourceMappingURL=mapsGeolocationClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapsGeolocationClient.d.ts","sourceRoot":"","sources":["../../../src/generated/mapsGeolocationClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,6CAA6C;AAC7C,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAAW,EAAE,aAAa,EAC1B,EAAE,UAAkB,EAAE,GAAG,OAAO,EAAE,GAAE,4BAAiC,GACpE,qBAAqB,CA6CvB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { getClient } from "@azure-rest/core-client";
|
|
4
|
+
import { logger } from "./logger.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialize a new instance of `MapsGeolocationClient`
|
|
7
|
+
* @param credentials - uniquely identify client credential
|
|
8
|
+
* @param options - the parameter for all optional parameters
|
|
9
|
+
*/
|
|
10
|
+
export default function createClient(credentials, { apiVersion = "1.0", ...options } = {}) {
|
|
11
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;
|
|
12
|
+
const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.4`;
|
|
13
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
14
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
15
|
+
: `${userAgentInfo}`;
|
|
16
|
+
options = {
|
|
17
|
+
...options,
|
|
18
|
+
userAgentOptions: {
|
|
19
|
+
userAgentPrefix,
|
|
20
|
+
},
|
|
21
|
+
loggingOptions: {
|
|
22
|
+
logger: options.loggingOptions?.logger ?? logger.info,
|
|
23
|
+
},
|
|
24
|
+
credentials: {
|
|
25
|
+
apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? "subscription-key",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const client = getClient(endpointUrl, credentials, options);
|
|
29
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
30
|
+
client.pipeline.addPolicy({
|
|
31
|
+
name: "ClientApiVersionPolicy",
|
|
32
|
+
sendRequest: (req, next) => {
|
|
33
|
+
// Use the apiVersion defined in request url directly
|
|
34
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
35
|
+
const url = new URL(req.url);
|
|
36
|
+
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
37
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
38
|
+
}
|
|
39
|
+
return next(req);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
return client;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=mapsGeolocationClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapsGeolocationClient.js","sourceRoot":"","sources":["../../../src/generated/mapsGeolocationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,OAAO,KAAmC,EAAE;IAErE,MAAM,WAAW,GACf,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACvE,MAAM,aAAa,GAAG,6CAA6C,CAAC;IACpE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,gBAAgB,EACd,OAAO,CAAC,WAAW,EAAE,gBAAgB,IAAI,kBAAkB;SAC9D;KACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CACtB,WAAW,EACX,WAAW,EACX,OAAO,CACiB,CAAC;IAE3B,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsGeolocationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface MapsGeolocationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsGeolocationClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"1.0\", ...options }: MapsGeolocationClientOptions = {},\n): MapsGeolocationClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.4`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsGeolocationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** This object is returned from a successful call to IP Address to country/region API */
|
|
2
|
+
export interface IpAddressToLocationResultOutput {
|
|
3
|
+
/** The object containing the country/region information. */
|
|
4
|
+
readonly countryRegion?: CountryRegionOutput;
|
|
5
|
+
/** The IP Address of the request. */
|
|
6
|
+
readonly ipAddress?: string;
|
|
7
|
+
}
|
|
8
|
+
/** The object containing the country/region information. */
|
|
9
|
+
export interface CountryRegionOutput {
|
|
10
|
+
/** The IP Address's 2-character code [(ISO 3166-1)](https://www.iso.org/iso-3166-country-codes.html) of the country or region. Please note, IP address in ranges reserved for special purpose will return Null for country/region. */
|
|
11
|
+
readonly isoCode?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
|
|
14
|
+
export interface ErrorResponseOutput {
|
|
15
|
+
/** The error object. */
|
|
16
|
+
error?: ErrorDetailOutput;
|
|
17
|
+
}
|
|
18
|
+
/** The error detail. */
|
|
19
|
+
export interface ErrorDetailOutput {
|
|
20
|
+
/** The error code. */
|
|
21
|
+
readonly code?: string;
|
|
22
|
+
/** The error message. */
|
|
23
|
+
readonly message?: string;
|
|
24
|
+
/** The error target. */
|
|
25
|
+
readonly target?: string;
|
|
26
|
+
/** The error details. */
|
|
27
|
+
readonly details?: Array<ErrorDetailOutput>;
|
|
28
|
+
/** The error additional info. */
|
|
29
|
+
readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;
|
|
30
|
+
}
|
|
31
|
+
/** The resource management error additional info. */
|
|
32
|
+
export interface ErrorAdditionalInfoOutput {
|
|
33
|
+
/** The additional info type. */
|
|
34
|
+
readonly type?: string;
|
|
35
|
+
/** The additional info. */
|
|
36
|
+
readonly info?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=outputModels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../../src/generated/outputModels.ts"],"names":[],"mappings":"AAGA,yFAAyF;AACzF,MAAM,WAAW,+BAA+B;IAC9C,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC;IAC7C,qCAAqC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,sOAAsO;IACtO,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qKAAqK;AACrK,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,wBAAwB;AACxB,MAAM,WAAW,iBAAiB;IAChC,sBAAsB;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC5C,iCAAiC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;CAC5D;AAED,qDAAqD;AACrD,MAAM,WAAW,yBAAyB;IACxC,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../src/generated/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** This object is returned from a successful call to IP Address to country/region API */\nexport interface IpAddressToLocationResultOutput {\n /** The object containing the country/region information. */\n readonly countryRegion?: CountryRegionOutput;\n /** The IP Address of the request. */\n readonly ipAddress?: string;\n}\n\n/** The object containing the country/region information. */\nexport interface CountryRegionOutput {\n /** The IP Address's 2-character code [(ISO 3166-1)](https://www.iso.org/iso-3166-country-codes.html) of the country or region. Please note, IP address in ranges reserved for special purpose will return Null for country/region. */\n readonly isoCode?: string;\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */\nexport interface ErrorResponseOutput {\n /** The error object. */\n error?: ErrorDetailOutput;\n}\n\n/** The error detail. */\nexport interface ErrorDetailOutput {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: Array<ErrorDetailOutput>;\n /** The error additional info. */\n readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: Record<string, unknown>;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RequestParameters } from "@azure-rest/core-client";
|
|
2
|
+
export interface GeolocationGetLocationQueryParamProperties {
|
|
3
|
+
/** The IP address. Both IPv4 and IPv6 are allowed. */
|
|
4
|
+
ip: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GeolocationGetLocationQueryParam {
|
|
7
|
+
queryParameters: GeolocationGetLocationQueryParamProperties;
|
|
8
|
+
}
|
|
9
|
+
export type GeolocationGetLocationParameters = GeolocationGetLocationQueryParam & RequestParameters;
|
|
10
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,WAAW,0CAA0C;IACzD,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,gCAAgC;IAC/C,eAAe,EAAE,0CAA0C,CAAC;CAC7D;AAED,MAAM,MAAM,gCAAgC,GAC1C,gCAAgC,GAAG,iBAAiB,CAAC"}
|