@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\n\nexport interface GeolocationGetLocationQueryParamProperties {\n /** The IP address. Both IPv4 and IPv6 are allowed. */\n ip: string;\n}\n\nexport interface GeolocationGetLocationQueryParam {\n queryParameters: GeolocationGetLocationQueryParamProperties;\n}\n\nexport type GeolocationGetLocationParameters =\n GeolocationGetLocationQueryParam & RequestParameters;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpResponse } from "@azure-rest/core-client";
|
|
2
|
+
import { IpAddressToLocationResultOutput, ErrorResponseOutput } from "./outputModels.js";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* 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.
|
|
6
|
+
*/
|
|
7
|
+
export interface GeolocationGetLocation200Response extends HttpResponse {
|
|
8
|
+
status: "200";
|
|
9
|
+
body: IpAddressToLocationResultOutput;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* 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.
|
|
14
|
+
*/
|
|
15
|
+
export interface GeolocationGetLocationDefaultResponse extends HttpResponse {
|
|
16
|
+
status: string;
|
|
17
|
+
body: ErrorResponseOutput;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,+BAA+B,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,qCAAsC,SAAQ,YAAY;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n IpAddressToLocationResultOutput,\n ErrorResponseOutput,\n} from \"./outputModels.js\";\n\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 */\nexport interface GeolocationGetLocation200Response extends HttpResponse {\n status: \"200\";\n body: IpAddressToLocationResultOutput;\n}\n\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 */\nexport interface GeolocationGetLocationDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsGeolocation from \"./MapsGeolocation.js\";\n\nexport * from \"./generated/index.js\";\nexport default MapsGeolocation;\n"]}
|
|
@@ -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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = MapsGeolocation;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const core_auth_1 = require("@azure/core-auth");
|
|
8
|
+
const maps_common_1 = require("@azure/maps-common");
|
|
9
|
+
const index_js_1 = tslib_1.__importDefault(require("./generated/index.js"));
|
|
10
|
+
const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
|
|
11
|
+
function MapsGeolocation(credential, clientIdOrOptions = {}, maybeOptions = {}) {
|
|
12
|
+
const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
|
|
13
|
+
/**
|
|
14
|
+
* maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
|
|
15
|
+
* So we need to do our own implementation.
|
|
16
|
+
* This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
|
|
17
|
+
*/
|
|
18
|
+
if ((0, core_auth_1.isTokenCredential)(credential)) {
|
|
19
|
+
const clientId = typeof clientIdOrOptions === "string" ? clientIdOrOptions : "";
|
|
20
|
+
if (!clientId) {
|
|
21
|
+
throw Error("Client id is needed for TokenCredential");
|
|
22
|
+
}
|
|
23
|
+
const client = (0, index_js_1.default)(undefined, options);
|
|
24
|
+
client.pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({
|
|
25
|
+
credential,
|
|
26
|
+
scopes: "https://atlas.microsoft.com/.default",
|
|
27
|
+
}));
|
|
28
|
+
client.pipeline.addPolicy((0, maps_common_1.createMapsClientIdPolicy)(clientId));
|
|
29
|
+
return client;
|
|
30
|
+
}
|
|
31
|
+
if ((0, core_auth_1.isSASCredential)(credential)) {
|
|
32
|
+
const client = (0, index_js_1.default)(undefined, options);
|
|
33
|
+
client.pipeline.addPolicy({
|
|
34
|
+
name: "mapsSASCredentialPolicy",
|
|
35
|
+
async sendRequest(request, next) {
|
|
36
|
+
request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
|
|
37
|
+
return next(request);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
return client;
|
|
41
|
+
}
|
|
42
|
+
return (0, index_js_1.default)(credential, options);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=MapsGeolocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapsGeolocation.js","sourceRoot":"","sources":["../../src/MapsGeolocation.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqElC,kCAyCC;;AA1GD,gDAAsE;AACtE,oDAA8D;AAE9D,4EAAgD;AAChD,kEAA4E;AA6D5E,SAAwB,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,IAAA,6BAAiB,EAAC,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,IAAA,kBAAY,EAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,IAAA,oDAA+B,EAAC;YAC9B,UAAU;YACV,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAA,sCAAwB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,IAAA,2BAAe,EAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,IAAA,kBAAY,EAAC,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,IAAA,kBAAY,EAAC,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,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const mapsGeolocationClient_js_1 = tslib_1.__importDefault(require("./mapsGeolocationClient.js"));
|
|
7
|
+
tslib_1.__exportStar(require("./mapsGeolocationClient.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./parameters.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./responses.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./clientDefinitions.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./isUnexpected.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./outputModels.js"), exports);
|
|
13
|
+
exports.default = mapsGeolocationClient_js_1.default;
|
|
14
|
+
//# 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,kGAA+D;AAE/D,qEAA2C;AAC3C,0DAAgC;AAChC,yDAA+B;AAC/B,iEAAuC;AACvC,4DAAkC;AAClC,4DAAkC;AAElC,kBAAe,kCAAqB,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,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isUnexpected = isUnexpected;
|
|
6
|
+
const responseMap = {
|
|
7
|
+
"GET /geolocation/ip/{format}": ["200"],
|
|
8
|
+
};
|
|
9
|
+
function isUnexpected(response) {
|
|
10
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
11
|
+
const url = new URL(lroOriginal ?? response.request.url);
|
|
12
|
+
const method = response.request.method;
|
|
13
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
14
|
+
if (!pathDetails) {
|
|
15
|
+
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
16
|
+
}
|
|
17
|
+
return !pathDetails.includes(response.status);
|
|
18
|
+
}
|
|
19
|
+
function getParametrizedPathSuccess(method, path) {
|
|
20
|
+
const pathParts = path.split("/");
|
|
21
|
+
// Traverse list to match the longest candidate
|
|
22
|
+
// matchedLen: the length of candidate path
|
|
23
|
+
// matchedValue: the matched status code array
|
|
24
|
+
let matchedLen = -1, matchedValue = [];
|
|
25
|
+
// Iterate the responseMap to find a match
|
|
26
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
27
|
+
// Extracting the path from the map key which is in format
|
|
28
|
+
// GET /path/foo
|
|
29
|
+
if (!key.startsWith(method)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const candidatePath = getPathFromMapKey(key);
|
|
33
|
+
// Get each part of the url path
|
|
34
|
+
const candidateParts = candidatePath.split("/");
|
|
35
|
+
// track if we have found a match to return the values found.
|
|
36
|
+
let found = true;
|
|
37
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
38
|
+
if (candidateParts[i]?.startsWith("{") &&
|
|
39
|
+
candidateParts[i]?.indexOf("}") !== -1) {
|
|
40
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
41
|
+
// If the current part of the candidate is a "template" part
|
|
42
|
+
// Try to use the suffix of pattern to match the path
|
|
43
|
+
// {guid} ==> $
|
|
44
|
+
// {guid}:export ==> :export$
|
|
45
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
46
|
+
if (!isMatched) {
|
|
47
|
+
found = false;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
// If the candidate part is not a template and
|
|
53
|
+
// the parts don't match mark the candidate as not found
|
|
54
|
+
// to move on with the next candidate path.
|
|
55
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
56
|
+
found = false;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// We finished evaluating the current candidate parts
|
|
61
|
+
// Update the matched value if and only if we found the longer pattern
|
|
62
|
+
if (found && candidatePath.length > matchedLen) {
|
|
63
|
+
matchedLen = candidatePath.length;
|
|
64
|
+
matchedValue = value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return matchedValue;
|
|
68
|
+
}
|
|
69
|
+
function getPathFromMapKey(mapKey) {
|
|
70
|
+
const pathStart = mapKey.indexOf("/");
|
|
71
|
+
return mapKey.slice(pathStart);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAgBlC,oCAaC;AAtBD,MAAM,WAAW,GAA6B;IAC5C,8BAA8B,EAAE,CAAC,KAAK,CAAC;CACxC,CAAC;AAOF,SAAgB,YAAY,CAC1B,QAEyC;IAEzC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,0BAA0B,CAAC,MAAc,EAAE,IAAY;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,+CAA+C;IAC/C,2CAA2C;IAC3C,8CAA8C;IAC9C,IAAI,UAAU,GAAG,CAAC,CAAC,EACjB,YAAY,GAAa,EAAE,CAAC;IAE9B,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,0DAA0D;QAC1D,gBAAgB;QAChB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QACD,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,6DAA6D;QAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,KACE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3D,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAChB,CAAC,EAAE,EAAE,CAAC,EAAE,EACR,CAAC;YACD,IACE,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC;gBAClC,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACtC,CAAC;gBACD,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAC1B,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAC1C,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBAE3B,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.logger = void 0;
|
|
6
|
+
const logger_1 = require("@azure/logger");
|
|
7
|
+
exports.logger = (0, logger_1.createClientLogger)("maps-geolocation");
|
|
8
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,0CAAmD;AACtC,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,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,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = createClient;
|
|
6
|
+
const core_client_1 = require("@azure-rest/core-client");
|
|
7
|
+
const logger_js_1 = require("./logger.js");
|
|
8
|
+
/**
|
|
9
|
+
* Initialize a new instance of `MapsGeolocationClient`
|
|
10
|
+
* @param credentials - uniquely identify client credential
|
|
11
|
+
* @param options - the parameter for all optional parameters
|
|
12
|
+
*/
|
|
13
|
+
function createClient(credentials, { apiVersion = "1.0", ...options } = {}) {
|
|
14
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;
|
|
15
|
+
const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.4`;
|
|
16
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
17
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
18
|
+
: `${userAgentInfo}`;
|
|
19
|
+
options = {
|
|
20
|
+
...options,
|
|
21
|
+
userAgentOptions: {
|
|
22
|
+
userAgentPrefix,
|
|
23
|
+
},
|
|
24
|
+
loggingOptions: {
|
|
25
|
+
logger: options.loggingOptions?.logger ?? logger_js_1.logger.info,
|
|
26
|
+
},
|
|
27
|
+
credentials: {
|
|
28
|
+
apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? "subscription-key",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const client = (0, core_client_1.getClient)(endpointUrl, credentials, options);
|
|
32
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
33
|
+
client.pipeline.addPolicy({
|
|
34
|
+
name: "ClientApiVersionPolicy",
|
|
35
|
+
sendRequest: (req, next) => {
|
|
36
|
+
// Use the apiVersion defined in request url directly
|
|
37
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
38
|
+
const url = new URL(req.url);
|
|
39
|
+
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
40
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
41
|
+
}
|
|
42
|
+
return next(req);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
return client;
|
|
46
|
+
}
|
|
47
|
+
//# 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;;AAkBlC,+BAgDC;AAhED,yDAAmE;AACnE,2CAAqC;AAUrC;;;;GAIG;AACH,SAAwB,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,kBAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,gBAAgB,EACd,OAAO,CAAC,WAAW,EAAE,gBAAgB,IAAI,kBAAkB;SAC9D;KACF,CAAC;IACF,MAAM,MAAM,GAAG,IAAA,uBAAS,EACtB,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\n\nexport interface GeolocationGetLocationQueryParamProperties {\n /** The IP address. Both IPv4 and IPv6 are allowed. */\n ip: string;\n}\n\nexport interface GeolocationGetLocationQueryParam {\n queryParameters: GeolocationGetLocationQueryParamProperties;\n}\n\nexport type GeolocationGetLocationParameters =\n GeolocationGetLocationQueryParam & RequestParameters;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpResponse } from "@azure-rest/core-client";
|
|
2
|
+
import { IpAddressToLocationResultOutput, ErrorResponseOutput } from "./outputModels.js";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* 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.
|
|
6
|
+
*/
|
|
7
|
+
export interface GeolocationGetLocation200Response extends HttpResponse {
|
|
8
|
+
status: "200";
|
|
9
|
+
body: IpAddressToLocationResultOutput;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* 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.
|
|
14
|
+
*/
|
|
15
|
+
export interface GeolocationGetLocationDefaultResponse extends HttpResponse {
|
|
16
|
+
status: string;
|
|
17
|
+
body: ErrorResponseOutput;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,+BAA+B,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,qCAAsC,SAAQ,YAAY;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n IpAddressToLocationResultOutput,\n ErrorResponseOutput,\n} from \"./outputModels.js\";\n\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 */\nexport interface GeolocationGetLocation200Response extends HttpResponse {\n status: \"200\";\n body: IpAddressToLocationResultOutput;\n}\n\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 */\nexport interface GeolocationGetLocationDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const MapsGeolocation_js_1 = tslib_1.__importDefault(require("./MapsGeolocation.js"));
|
|
7
|
+
tslib_1.__exportStar(require("./generated/index.js"), exports);
|
|
8
|
+
exports.default = MapsGeolocation_js_1.default;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,sFAAmD;AAEnD,+DAAqC;AACrC,kBAAe,4BAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsGeolocation from \"./MapsGeolocation.js\";\n\nexport * from \"./generated/index.js\";\nexport default MapsGeolocation;\n"]}
|