@azure-rest/maps-render 2.0.0-alpha.20241031.1 → 2.0.0-alpha.20241112.4
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/dist/index.js +66 -43
- package/dist/index.js.map +1 -1
- package/dist-esm/src/index.js +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/mapsRender.js +1 -1
- package/dist-esm/src/mapsRender.js.map +1 -1
- package/package.json +2 -2
- package/review/maps-render.api.md +22 -17
- package/types/maps-render-rest.d.ts +23 -17
- package/dist-esm/src/generated/clientDefinitions.js +0 -4
- package/dist-esm/src/generated/clientDefinitions.js.map +0 -1
- package/dist-esm/src/generated/index.js +0 -11
- package/dist-esm/src/generated/index.js.map +0 -1
- package/dist-esm/src/generated/isUnexpected.js +0 -77
- package/dist-esm/src/generated/isUnexpected.js.map +0 -1
- package/dist-esm/src/generated/mapsRenderClient.js +0 -25
- package/dist-esm/src/generated/mapsRenderClient.js.map +0 -1
- package/dist-esm/src/generated/outputModels.js +0 -4
- package/dist-esm/src/generated/outputModels.js.map +0 -1
- package/dist-esm/src/generated/parameters.js +0 -4
- package/dist-esm/src/generated/parameters.js.map +0 -1
- package/dist-esm/src/generated/responses.js +0 -4
- package/dist-esm/src/generated/responses.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -5,29 +5,50 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var coreAuth = require('@azure/core-auth');
|
|
6
6
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
7
|
var mapsCommon = require('@azure/maps-common');
|
|
8
|
+
var tslib = require('tslib');
|
|
8
9
|
var coreClient = require('@azure-rest/core-client');
|
|
10
|
+
var logger$1 = require('@azure/logger');
|
|
11
|
+
|
|
12
|
+
// Copyright (c) Microsoft Corporation.
|
|
13
|
+
// Licensed under the MIT License.
|
|
14
|
+
const logger = logger$1.createClientLogger("maps-render");
|
|
9
15
|
|
|
10
16
|
// Copyright (c) Microsoft Corporation.
|
|
11
17
|
// Licensed under the MIT License.
|
|
12
18
|
/**
|
|
13
|
-
* Initialize a new instance of
|
|
14
|
-
* @param credentials
|
|
19
|
+
* Initialize a new instance of `MapsRenderClient`
|
|
20
|
+
* @param credentials - uniquely identify client credential
|
|
21
|
+
* @param options - the parameter for all optional parameters
|
|
15
22
|
*/
|
|
16
|
-
function createClient(credentials,
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
21
|
-
apiKeyHeaderName: "subscription-key"
|
|
22
|
-
} });
|
|
23
|
+
function createClient(credentials, _a = {}) {
|
|
24
|
+
var _b, _c, _d, _e, _f, _g;
|
|
25
|
+
var { apiVersion = "2024-04-01" } = _a, options = tslib.__rest(_a, ["apiVersion"]);
|
|
26
|
+
const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
|
|
23
27
|
const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;
|
|
24
28
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
25
29
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
26
30
|
: `${userAgentInfo}`;
|
|
27
31
|
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
28
|
-
userAgentPrefix
|
|
32
|
+
userAgentPrefix,
|
|
33
|
+
}, loggingOptions: {
|
|
34
|
+
logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
|
|
35
|
+
}, credentials: {
|
|
36
|
+
apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
|
|
29
37
|
} });
|
|
30
|
-
const client = coreClient.getClient(
|
|
38
|
+
const client = coreClient.getClient(endpointUrl, credentials, options);
|
|
39
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
40
|
+
client.pipeline.addPolicy({
|
|
41
|
+
name: "ClientApiVersionPolicy",
|
|
42
|
+
sendRequest: (req, next) => {
|
|
43
|
+
// Use the apiVersion defined in request url directly
|
|
44
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
45
|
+
const url = new URL(req.url);
|
|
46
|
+
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
47
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
48
|
+
}
|
|
49
|
+
return next(req);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
31
52
|
return client;
|
|
32
53
|
}
|
|
33
54
|
|
|
@@ -78,7 +99,7 @@ const responseMap = {
|
|
|
78
99
|
"GET /map/static": ["200"],
|
|
79
100
|
"GET /map/copyright/bounding/{format}": ["200"],
|
|
80
101
|
"GET /map/copyright/tile/{format}": ["200"],
|
|
81
|
-
"GET /map/copyright/world/{format}": ["200"]
|
|
102
|
+
"GET /map/copyright/world/{format}": ["200"],
|
|
82
103
|
};
|
|
83
104
|
function isUnexpected(response) {
|
|
84
105
|
const lroOriginal = response.headers["x-ms-original-url"];
|
|
@@ -86,13 +107,17 @@ function isUnexpected(response) {
|
|
|
86
107
|
const method = response.request.method;
|
|
87
108
|
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
88
109
|
if (!pathDetails) {
|
|
89
|
-
pathDetails =
|
|
110
|
+
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
90
111
|
}
|
|
91
112
|
return !pathDetails.includes(response.status);
|
|
92
113
|
}
|
|
93
|
-
function
|
|
94
|
-
var _a, _b;
|
|
114
|
+
function getParametrizedPathSuccess(method, path) {
|
|
115
|
+
var _a, _b, _c, _d;
|
|
95
116
|
const pathParts = path.split("/");
|
|
117
|
+
// Traverse list to match the longest candidate
|
|
118
|
+
// matchedLen: the length of candidate path
|
|
119
|
+
// matchedValue: the matched status code array
|
|
120
|
+
let matchedLen = -1, matchedValue = [];
|
|
96
121
|
// Iterate the responseMap to find a match
|
|
97
122
|
for (const [key, value] of Object.entries(responseMap)) {
|
|
98
123
|
// Extracting the path from the map key which is in format
|
|
@@ -103,41 +128,39 @@ function geParametrizedPathSuccess(method, path) {
|
|
|
103
128
|
const candidatePath = getPathFromMapKey(key);
|
|
104
129
|
// Get each part of the url path
|
|
105
130
|
const candidateParts = candidatePath.split("/");
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
// If the candidate part is not a template and
|
|
121
|
-
// the parts don't match mark the candidate as not found
|
|
122
|
-
// to move on with the next candidate path.
|
|
123
|
-
if (candidateParts[i] !== pathParts[i]) {
|
|
131
|
+
// track if we have found a match to return the values found.
|
|
132
|
+
let found = true;
|
|
133
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
134
|
+
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
|
|
135
|
+
((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
136
|
+
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
137
|
+
// If the current part of the candidate is a "template" part
|
|
138
|
+
// Try to use the suffix of pattern to match the path
|
|
139
|
+
// {guid} ==> $
|
|
140
|
+
// {guid}:export ==> :export$
|
|
141
|
+
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
142
|
+
if (!isMatched) {
|
|
124
143
|
found = false;
|
|
125
144
|
break;
|
|
126
145
|
}
|
|
146
|
+
continue;
|
|
127
147
|
}
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
// the path
|
|
131
|
-
if (
|
|
132
|
-
|
|
148
|
+
// If the candidate part is not a template and
|
|
149
|
+
// the parts don't match mark the candidate as not found
|
|
150
|
+
// to move on with the next candidate path.
|
|
151
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
152
|
+
found = false;
|
|
153
|
+
break;
|
|
133
154
|
}
|
|
134
155
|
}
|
|
156
|
+
// We finished evaluating the current candidate parts
|
|
157
|
+
// Update the matched value if and only if we found the longer pattern
|
|
158
|
+
if (found && candidatePath.length > matchedLen) {
|
|
159
|
+
matchedLen = candidatePath.length;
|
|
160
|
+
matchedValue = value;
|
|
161
|
+
}
|
|
135
162
|
}
|
|
136
|
-
|
|
137
|
-
return [];
|
|
138
|
-
}
|
|
139
|
-
function hasParametrizedPath(path) {
|
|
140
|
-
return path.includes("/{");
|
|
163
|
+
return matchedValue;
|
|
141
164
|
}
|
|
142
165
|
function getPathFromMapKey(mapKey) {
|
|
143
166
|
const pathStart = mapKey.indexOf("/");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/generated/mapsRenderClient.ts","../src/mapsRender.ts","../src/generated/isUnexpected.ts","../src/positionToTileXY.ts","../src/createMultiCollection.ts","../src/createPinsQuery.ts","../src/createPathQuery.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsRenderClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsRenderClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsRenderClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"2024-04-01\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;\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 };\n\n const client = getClient(baseUrl, credentials, options) as MapsRenderClient;\n\n return client;\n}\n","// 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 { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsRenderClient } from \"./generated\";\nimport createClient from \"./generated/mapsRenderClient\";\n\n/**\n * Creates an instance of MapsRenderClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-Render\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRender(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRenderClient from \"@azure-rest/maps-render\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(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 Render Client\n */\nexport default function MapsRender(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-render\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRender(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRenderClient;\nexport default function MapsRender(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRenderClient {\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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /map/tile\": [\"200\"],\n \"GET /map/tileset\": [\"200\"],\n \"GET /map/attribution\": [\"200\"],\n \"GET /map/statetile\": [\"200\"],\n \"GET /map/copyright/caption/{format}\": [\"200\"],\n \"GET /map/static\": [\"200\"],\n \"GET /map/copyright/bounding/{format}\": [\"200\"],\n \"GET /map/copyright/tile/{format}\": [\"200\"],\n \"GET /map/copyright/world/{format}\": [\"200\"]\n};\n\nexport function isUnexpected(\n response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n): response is RenderGetMapTileDefaultResponse;\nexport function isUnexpected(\n response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n): response is RenderGetMapTilesetDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n): response is RenderGetMapAttributionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n): response is RenderGetMapStateTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n): response is RenderGetCopyrightCaptionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n): response is RenderGetMapStaticImageDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n): response is RenderGetCopyrightFromBoundingBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n): response is RenderGetCopyrightForTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is RenderGetCopyrightForWorldDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapTile200Response\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTileset200Response\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorldDefaultResponse {\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 = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\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 // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (\n candidateParts.length === pathParts.length &&\n hasParametrizedPath(key)\n ) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.endsWith(\"}\")\n ) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\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[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\n\nfunction clip(n: number, minValue: number, maxValue: number): number {\n return Math.min(Math.max(n, minValue), maxValue);\n}\n\nconst MIN_LATITUDE = -85.05112878;\nconst MAX_LATITUDE = 85.05112878;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n/**\n * Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level.\n * Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code\n *\n * @example\n * ```ts\n * const zoom = 6;\n * const { x, y } = positionToTileXY([47.61559, -122.33817], 6, \"256\");\n * const response = await client\n * .path(\"/map/tile\")\n * .get({\n * queryParameters: { tilesetId: \"microsoft.base.road\", zoom, x, y },\n * })\n * ```\n *\n * @param position - Position coordinate in the format [latitude, longitude].\n * @param zoom - Zoom level.\n * @param tileSize - The size of the tiles in the tile pyramid.\n * @returns Tile XY coordinates.\n */\nexport function positionToTileXY(\n position: LatLon,\n zoom: number,\n tileSize: \"512\" | \"256\",\n): { x: number; y: number } {\n const latitude = clip(position[0], MIN_LATITUDE, MAX_LATITUDE);\n const longitude = clip(position[1], MIN_LONGITUDE, MAX_LONGITUDE);\n\n const x = (longitude + 180) / 360;\n const sinLatitude = Math.sin((latitude * Math.PI) / 180);\n const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);\n\n const tileSizeInNum = parseInt(tileSize);\n // tileSize needed in calculations as in rare cases the multiplying/rounding/dividing can make the difference of a pixel which can result in a completely different tile.\n const mapSize = Math.ceil(tileSizeInNum * Math.pow(2, zoom));\n\n return {\n x: Math.floor(clip(x * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n y: Math.floor(clip(y * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).\n * This should be removed once the core-client support collectionFormat: multi.\n */\nexport function createMultiCollection(key: string, values: string[]): string {\n return values.slice(1).reduce((acc, value) => {\n return `${acc}&${key}=${value}`;\n }, values[0] || \"\");\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * Specify how the pin's position and label text.\n */\nexport interface Pin {\n /** The coordinate of the pin. */\n coordinate: LatLon;\n /** The label text for the pin. */\n label?: string;\n}\n\n/**\n * The pin options for default/none image style..\n */\nexport interface PinOptions {\n /** The opacity of the pin. Range from 0 to 1 */\n opacity?: number;\n /**\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below).\n * To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.\n * These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down.\n * For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use \\{labelAnchor: [10, -4]\\}\n * */\n labelAnchor?: [number, number];\n /** Color of the label. Range from 000000 to FFFFFF */\n labelColor?: string;\n /** Size of the label in pixels. */\n labelSizeInPixels?: number;\n /**\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight.\n * To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.\n * For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using \\{pinAnchor: [0, 0]\\}\n */\n pinAnchor?: [number, number];\n /** The ration of the pin. Range from -360 to 360*/\n rotationInDegree?: number;\n /** The scale of the pin. Should be greater than 0. */\n scale?: number;\n /** Color of the pin. Range from 000000 to FFFFFF */\n pinColor?: string;\n}\n\nconst optionKeyMap: Record<keyof PinOptions, string> = {\n opacity: \"al\",\n labelAnchor: \"la\",\n labelColor: \"lc\",\n labelSizeInPixels: \"ls\",\n pinAnchor: \"an\",\n rotationInDegree: \"ro\",\n scale: \"sc\",\n pinColor: \"co\",\n};\n\nfunction isOptionKeyMap(key: any): key is keyof PinOptions {\n return key in optionKeyMap;\n}\n\nexport interface PinSet {\n pins: Pin[];\n pinImage?: \"default\" | \"none\" | string;\n options?: PinOptions;\n}\n/**\n * Create a pin query string for _get map static image_\n *\n * @example\n * ```ts\n *\n * const pins = {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"<image source url || default || none>\"\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * }\n * );\n * const res = await client\n * .path(\"/map/static/{format}\", \"png\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * pins: pins,\n * },\n * skipUrlEncoding: true,\n * })\n * ```\n *\n * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.\n * @param pinImage - Specify the image source for custom pin. Set this to \"none\" if you don't want to show a pin image.\n * @param options - The style options of the pins. See {@link PinOptions}\n * @returns - The composed query string.\n */\n\nexport function createPinsQuery(pinSets: PinSet[]): string {\n const pinsQueries = pinSets.map(({ pins, pinImage = \"default\", options = {} }) => {\n // compose the pins' position query string\n const pinsQueryStr = pins\n .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : \"\"}${lon} ${lat}`)\n .join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKeyMap(key)) throw Error(`Unexpected option: ${key}`);\n if (Array.isArray(val)) return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);\n return (queryStr += `|${optionKeyMap[key]}${val}`);\n }, \"\");\n if (pinImage === \"none\" || pinImage === \"default\") {\n return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;\n }\n return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;\n });\n return createMultiCollection(\"pins\", pinsQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * The options that modify the style of a circular path.\n */\nexport interface CircularPathOptions {\n /** The line color of the path. Range from 000000 to FFFFFF. */\n lineColor?: string;\n /** The line opacity of the path. Range from 0 to 1. */\n lineOpacity?: number;\n /** The line width of the line. Should be greater than 0. */\n lineWidthInPixels?: number;\n}\n\n/**\n * The options that modify the style of a polygonal path.\n */\nexport interface PolygonalPathOptions extends CircularPathOptions {\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 000000 to FFFFFF.*/\n fillColor?: string;\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 0 to 1.*/\n fillOpacity?: number;\n}\n\ninterface PathOptionsForRequest extends PolygonalPathOptions {\n radius?: number;\n}\n\n/**\n * Specify a circular path.\n */\nexport interface CircularPath {\n /** The center of the circular path. */\n center: LatLon;\n /** The radius of the circular path. */\n radiusInMeters: number;\n /** The options that modify the style of the circular path. */\n options?: CircularPathOptions;\n}\n\nfunction isCircularPath(path: PolygonalPath | CircularPath): path is CircularPath {\n return \"center\" in path;\n}\n/**\n * Specify a polygonal path.\n */\nexport interface PolygonalPath {\n /** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/\n coordinates: LatLon[];\n /** The options that modify the style of the polygonal path. */\n options?: PolygonalPathOptions;\n}\n\nconst optionKeyMap: Record<keyof PathOptionsForRequest, string> = {\n lineColor: \"lc\",\n lineOpacity: \"la\",\n fillColor: \"fc\",\n fillOpacity: \"fa\",\n lineWidthInPixels: \"lw\",\n radius: \"ra\",\n};\n\nfunction isOptionKey(key: any): key is keyof PathOptionsForRequest {\n return key in optionKeyMap;\n}\n\nfunction comosePathVal(coordinates: LatLon[], options: PathOptionsForRequest): string {\n // compose the coordinates query string\n const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKey(key)) throw Error(`Unknown key ${key}`);\n queryStr += `${queryStr ? \"|\" : \"\"}${optionKeyMap[key]}${val}`;\n return queryStr;\n }, \"\");\n return optionsQueryStr + \"||\" + coordinatesQueryStr;\n}\n\n/**\n * Create a path query string for _get map static image_ request.\n *\n * @example\n * ```ts\n * const circularPath = {\n * center: [52.4559, 13.228],\n * radiusInMeters: 10000,\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const linearPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const polygonPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * [52.577, 13.35],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * fillColor: \"FFFFFF\",\n * fillOpacity: 0.8,\n * },\n * };\n *\n * const path = createPathQuery([circularPath, linearPath, polygonPath]);\n * // Send the request\n * const response = await client.path(\"/map/static/{format}\", \"png\").get({\n * queryParameters: {\n * bbox: [13.228,52.4559,13.5794,52.629],\n * path: path\n * }\n * });\n * ```\n *\n * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.\n * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.\n */\nexport function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string {\n const pathQueries = paths.map((path) => {\n if (isCircularPath(path)) {\n const { center, radiusInMeters, options } = path;\n return comosePathVal([center], { ...options, radius: radiusInMeters });\n }\n return comosePathVal(path.coordinates, path.options || {});\n });\n return createMultiCollection(\"path\", pathQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRender from \"./mapsRender\";\n\nexport * from \"./generated\";\nexport * from \"./positionToTileXY\";\nexport * from \"./createPinsQuery\";\nexport * from \"./createPathQuery\";\nexport default MapsRender;\n"],"names":["getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsCl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A,CAAG;;AAExE,QAAA,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;AAC5D,KAAC,CAAC;AACF,IAAA,OAAO,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC;AACnD;;ACpJA;AACA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../generated/logger.ts","../generated/mapsRenderClient.ts","../src/mapsRender.ts","../generated/isUnexpected.ts","../src/positionToTileXY.ts","../src/createMultiCollection.ts","../src/createPinsQuery.ts","../src/createPathQuery.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-render\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsRenderClient } from \"./clientDefinitions\";\n\n/** The optional parameters for the client */\nexport interface MapsRenderClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsRenderClient`\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 = \"2024-04-01\", ...options }: MapsRenderClientOptions = {},\n): MapsRenderClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;\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 MapsRenderClient;\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","// 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 { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsRenderClient } from \"../generated\";\nimport createClient from \"../generated/mapsRenderClient\";\n\n/**\n * Creates an instance of MapsRenderClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-Render\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRender(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRenderClient from \"@azure-rest/maps-render\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(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 Render Client\n */\nexport default function MapsRender(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-render\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRender(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRenderClient;\nexport default function MapsRender(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRenderClient {\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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /map/tile\": [\"200\"],\n \"GET /map/tileset\": [\"200\"],\n \"GET /map/attribution\": [\"200\"],\n \"GET /map/statetile\": [\"200\"],\n \"GET /map/copyright/caption/{format}\": [\"200\"],\n \"GET /map/static\": [\"200\"],\n \"GET /map/copyright/bounding/{format}\": [\"200\"],\n \"GET /map/copyright/tile/{format}\": [\"200\"],\n \"GET /map/copyright/world/{format}\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse,\n): response is RenderGetMapTileDefaultResponse;\nexport function isUnexpected(\n response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse,\n): response is RenderGetMapTilesetDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse,\n): response is RenderGetMapAttributionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse,\n): response is RenderGetMapStateTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse,\n): response is RenderGetCopyrightCaptionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse,\n): response is RenderGetMapStaticImageDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse,\n): response is RenderGetCopyrightFromBoundingBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse,\n): response is RenderGetCopyrightForTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse,\n): response is RenderGetCopyrightForWorldDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapTile200Response\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTileset200Response\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse,\n): response is\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorldDefaultResponse {\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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\n\nfunction clip(n: number, minValue: number, maxValue: number): number {\n return Math.min(Math.max(n, minValue), maxValue);\n}\n\nconst MIN_LATITUDE = -85.05112878;\nconst MAX_LATITUDE = 85.05112878;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n/**\n * Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level.\n * Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code\n *\n * @example\n * ```ts\n * const zoom = 6;\n * const { x, y } = positionToTileXY([47.61559, -122.33817], 6, \"256\");\n * const response = await client\n * .path(\"/map/tile\")\n * .get({\n * queryParameters: { tilesetId: \"microsoft.base.road\", zoom, x, y },\n * })\n * ```\n *\n * @param position - Position coordinate in the format [latitude, longitude].\n * @param zoom - Zoom level.\n * @param tileSize - The size of the tiles in the tile pyramid.\n * @returns Tile XY coordinates.\n */\nexport function positionToTileXY(\n position: LatLon,\n zoom: number,\n tileSize: \"512\" | \"256\",\n): { x: number; y: number } {\n const latitude = clip(position[0], MIN_LATITUDE, MAX_LATITUDE);\n const longitude = clip(position[1], MIN_LONGITUDE, MAX_LONGITUDE);\n\n const x = (longitude + 180) / 360;\n const sinLatitude = Math.sin((latitude * Math.PI) / 180);\n const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);\n\n const tileSizeInNum = parseInt(tileSize);\n // tileSize needed in calculations as in rare cases the multiplying/rounding/dividing can make the difference of a pixel which can result in a completely different tile.\n const mapSize = Math.ceil(tileSizeInNum * Math.pow(2, zoom));\n\n return {\n x: Math.floor(clip(x * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n y: Math.floor(clip(y * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).\n * This should be removed once the core-client support collectionFormat: multi.\n */\nexport function createMultiCollection(key: string, values: string[]): string {\n return values.slice(1).reduce((acc, value) => {\n return `${acc}&${key}=${value}`;\n }, values[0] || \"\");\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * Specify how the pin's position and label text.\n */\nexport interface Pin {\n /** The coordinate of the pin. */\n coordinate: LatLon;\n /** The label text for the pin. */\n label?: string;\n}\n\n/**\n * The pin options for default/none image style..\n */\nexport interface PinOptions {\n /** The opacity of the pin. Range from 0 to 1 */\n opacity?: number;\n /**\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below).\n * To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.\n * These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down.\n * For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use \\{labelAnchor: [10, -4]\\}\n * */\n labelAnchor?: [number, number];\n /** Color of the label. Range from 000000 to FFFFFF */\n labelColor?: string;\n /** Size of the label in pixels. */\n labelSizeInPixels?: number;\n /**\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight.\n * To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.\n * For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using \\{pinAnchor: [0, 0]\\}\n */\n pinAnchor?: [number, number];\n /** The ration of the pin. Range from -360 to 360*/\n rotationInDegree?: number;\n /** The scale of the pin. Should be greater than 0. */\n scale?: number;\n /** Color of the pin. Range from 000000 to FFFFFF */\n pinColor?: string;\n}\n\nconst optionKeyMap: Record<keyof PinOptions, string> = {\n opacity: \"al\",\n labelAnchor: \"la\",\n labelColor: \"lc\",\n labelSizeInPixels: \"ls\",\n pinAnchor: \"an\",\n rotationInDegree: \"ro\",\n scale: \"sc\",\n pinColor: \"co\",\n};\n\nfunction isOptionKeyMap(key: any): key is keyof PinOptions {\n return key in optionKeyMap;\n}\n\nexport interface PinSet {\n pins: Pin[];\n pinImage?: \"default\" | \"none\" | string;\n options?: PinOptions;\n}\n/**\n * Create a pin query string for _get map static image_\n *\n * @example\n * ```ts\n *\n * const pins = {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"<image source url || default || none>\"\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * }\n * );\n * const res = await client\n * .path(\"/map/static/{format}\", \"png\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * pins: pins,\n * },\n * skipUrlEncoding: true,\n * })\n * ```\n *\n * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.\n * @param pinImage - Specify the image source for custom pin. Set this to \"none\" if you don't want to show a pin image.\n * @param options - The style options of the pins. See {@link PinOptions}\n * @returns - The composed query string.\n */\n\nexport function createPinsQuery(pinSets: PinSet[]): string {\n const pinsQueries = pinSets.map(({ pins, pinImage = \"default\", options = {} }) => {\n // compose the pins' position query string\n const pinsQueryStr = pins\n .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : \"\"}${lon} ${lat}`)\n .join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKeyMap(key)) throw Error(`Unexpected option: ${key}`);\n if (Array.isArray(val)) return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);\n return (queryStr += `|${optionKeyMap[key]}${val}`);\n }, \"\");\n if (pinImage === \"none\" || pinImage === \"default\") {\n return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;\n }\n return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;\n });\n return createMultiCollection(\"pins\", pinsQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * The options that modify the style of a circular path.\n */\nexport interface CircularPathOptions {\n /** The line color of the path. Range from 000000 to FFFFFF. */\n lineColor?: string;\n /** The line opacity of the path. Range from 0 to 1. */\n lineOpacity?: number;\n /** The line width of the line. Should be greater than 0. */\n lineWidthInPixels?: number;\n}\n\n/**\n * The options that modify the style of a polygonal path.\n */\nexport interface PolygonalPathOptions extends CircularPathOptions {\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 000000 to FFFFFF.*/\n fillColor?: string;\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 0 to 1.*/\n fillOpacity?: number;\n}\n\ninterface PathOptionsForRequest extends PolygonalPathOptions {\n radius?: number;\n}\n\n/**\n * Specify a circular path.\n */\nexport interface CircularPath {\n /** The center of the circular path. */\n center: LatLon;\n /** The radius of the circular path. */\n radiusInMeters: number;\n /** The options that modify the style of the circular path. */\n options?: CircularPathOptions;\n}\n\nfunction isCircularPath(path: PolygonalPath | CircularPath): path is CircularPath {\n return \"center\" in path;\n}\n/**\n * Specify a polygonal path.\n */\nexport interface PolygonalPath {\n /** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/\n coordinates: LatLon[];\n /** The options that modify the style of the polygonal path. */\n options?: PolygonalPathOptions;\n}\n\nconst optionKeyMap: Record<keyof PathOptionsForRequest, string> = {\n lineColor: \"lc\",\n lineOpacity: \"la\",\n fillColor: \"fc\",\n fillOpacity: \"fa\",\n lineWidthInPixels: \"lw\",\n radius: \"ra\",\n};\n\nfunction isOptionKey(key: any): key is keyof PathOptionsForRequest {\n return key in optionKeyMap;\n}\n\nfunction comosePathVal(coordinates: LatLon[], options: PathOptionsForRequest): string {\n // compose the coordinates query string\n const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKey(key)) throw Error(`Unknown key ${key}`);\n queryStr += `${queryStr ? \"|\" : \"\"}${optionKeyMap[key]}${val}`;\n return queryStr;\n }, \"\");\n return optionsQueryStr + \"||\" + coordinatesQueryStr;\n}\n\n/**\n * Create a path query string for _get map static image_ request.\n *\n * @example\n * ```ts\n * const circularPath = {\n * center: [52.4559, 13.228],\n * radiusInMeters: 10000,\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const linearPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const polygonPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * [52.577, 13.35],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * fillColor: \"FFFFFF\",\n * fillOpacity: 0.8,\n * },\n * };\n *\n * const path = createPathQuery([circularPath, linearPath, polygonPath]);\n * // Send the request\n * const response = await client.path(\"/map/static/{format}\", \"png\").get({\n * queryParameters: {\n * bbox: [13.228,52.4559,13.5794,52.629],\n * path: path\n * }\n * });\n * ```\n *\n * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.\n * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.\n */\nexport function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string {\n const pathQueries = paths.map((path) => {\n if (isCircularPath(path)) {\n const { center, radiusInMeters, options } = path;\n return comosePathVal([center], { ...options, radius: radiusInMeters });\n }\n return comosePathVal(path.coordinates, path.options || {});\n });\n return createMultiCollection(\"path\", pathQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRender from \"./mapsRender\";\n\nexport * from \"../generated\";\nexport * from \"./positionToTileXY\";\nexport * from \"./createPinsQuery\";\nexport * from \"./createPathQuery\";\nexport default MapsRender;\n"],"names":["createClientLogger","__rest","getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential","optionKeyMap"],"mappings":";;;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,aAAa,CAAC;;ACJvD;AACA;AAaA;;;;AAIG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,KAAqE,EAAE,EAAA;;QAAvE,EAAE,UAAU,GAAG,YAAY,EAAA,GAAA,EAA4C,EAAvC,OAAO,GAAAC,YAAA,CAAA,EAAA,EAAvC,cAAyC,CAAF;AAEvC,IAAA,MAAM,WAAW,GACf,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,OAAO,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,OAAO,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,6BAA6B;IACtE,MAAM,aAAa,GAAG,CAAA,sCAAA,CAAwC;IAC9D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC;UACjD,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAI,CAAA,EAAA,aAAa,CAAE;AAChE,UAAE,CAAA,EAAG,aAAa,CAAA,CAAE;AACxB,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,gBAAgB,EAAE;YAChB,eAAe;AAChB,SAAA,EACD,cAAc,EAAE;YACd,MA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
|
-
export * from "
|
|
4
|
+
export * from "../generated";
|
|
5
5
|
export * from "./positionToTileXY";
|
|
6
6
|
export * from "./createPinsQuery";
|
|
7
7
|
export * from "./createPathQuery";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,eAAe,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRender from \"./mapsRender\";\n\nexport * from \"../generated\";\nexport * from \"./positionToTileXY\";\nexport * from \"./createPinsQuery\";\nexport * from \"./createPathQuery\";\nexport default MapsRender;\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { isSASCredential, isTokenCredential } from "@azure/core-auth";
|
|
4
4
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
5
5
|
import { createMapsClientIdPolicy } from "@azure/maps-common";
|
|
6
|
-
import createClient from "
|
|
6
|
+
import createClient from "../generated/mapsRenderClient";
|
|
7
7
|
export default function MapsRender(credential, clientIdOrOptions = {}, maybeOptions = {}) {
|
|
8
8
|
const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapsRender.js","sourceRoot":"","sources":["../../src/mapsRender.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,O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,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 { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsRenderClient } from \"../generated\";\nimport createClient from \"../generated/mapsRenderClient\";\n\n/**\n * Creates an instance of MapsRenderClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-Render\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRender(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRenderClient from \"@azure-rest/maps-render\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(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 Render Client\n */\nexport default function MapsRender(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-render\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRender(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRenderClient;\nexport default function MapsRender(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRenderClient {\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"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/maps-render",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "2.0.0-alpha.
|
|
5
|
+
"version": "2.0.0-alpha.20241112.4",
|
|
6
6
|
"description": "A generated SDK for MapsRenderClient.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"@azure/core-auth": "^1.3.0",
|
|
66
66
|
"@azure/core-rest-pipeline": "^1.8.0",
|
|
67
67
|
"@azure/maps-common": "1.0.0-beta.2",
|
|
68
|
+
"@azure/logger": "^1.0.0",
|
|
68
69
|
"tslib": "^2.2.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
@@ -80,7 +81,6 @@
|
|
|
80
81
|
"@types/node": "^18.0.0",
|
|
81
82
|
"autorest": "latest",
|
|
82
83
|
"chai": "^4.2.0",
|
|
83
|
-
"cross-env": "^7.0.2",
|
|
84
84
|
"dotenv": "^16.0.0",
|
|
85
85
|
"eslint": "^9.9.0",
|
|
86
86
|
"karma": "^6.2.0",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { AzureKeyCredential } from '@azure/core-auth';
|
|
8
8
|
import type { AzureSASCredential } from '@azure/core-auth';
|
|
9
9
|
import { Client } from '@azure-rest/core-client';
|
|
10
|
-
import
|
|
10
|
+
import { ClientOptions } from '@azure-rest/core-client';
|
|
11
11
|
import { HttpResponse } from '@azure-rest/core-client';
|
|
12
12
|
import type { LatLon } from '@azure/maps-common';
|
|
13
13
|
import { RawHttpHeaders } from '@azure/core-rest-pipeline';
|
|
@@ -31,15 +31,15 @@ export interface CircularPathOptions {
|
|
|
31
31
|
|
|
32
32
|
// @public
|
|
33
33
|
export interface CopyrightCaptionOutput {
|
|
34
|
-
copyrightsCaption: string;
|
|
35
|
-
formatVersion?: string;
|
|
34
|
+
readonly copyrightsCaption: string;
|
|
35
|
+
readonly formatVersion?: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// @public
|
|
39
39
|
export interface CopyrightOutput {
|
|
40
|
-
formatVersion?: string;
|
|
41
|
-
generalCopyrights?: Array<string>;
|
|
42
|
-
regions?: Array<RegionCopyrightsOutput>;
|
|
40
|
+
readonly formatVersion?: string;
|
|
41
|
+
readonly generalCopyrights?: Array<string>;
|
|
42
|
+
readonly regions?: Array<RegionCopyrightsOutput>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// @public
|
|
@@ -50,17 +50,17 @@ export function createPinsQuery(pinSets: PinSet[]): string;
|
|
|
50
50
|
|
|
51
51
|
// @public
|
|
52
52
|
export interface ErrorAdditionalInfoOutput {
|
|
53
|
-
info?: Record<string, unknown>;
|
|
54
|
-
type?: string;
|
|
53
|
+
readonly info?: Record<string, unknown>;
|
|
54
|
+
readonly type?: string;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// @public
|
|
58
58
|
export interface ErrorDetailOutput {
|
|
59
|
-
additionalInfo?: Array<ErrorAdditionalInfoOutput>;
|
|
60
|
-
code?: string;
|
|
61
|
-
details?: Array<ErrorDetailOutput>;
|
|
62
|
-
message?: string;
|
|
63
|
-
target?: string;
|
|
59
|
+
readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;
|
|
60
|
+
readonly code?: string;
|
|
61
|
+
readonly details?: Array<ErrorDetailOutput>;
|
|
62
|
+
readonly message?: string;
|
|
63
|
+
readonly target?: string;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// @public
|
|
@@ -160,6 +160,11 @@ export type MapsRenderClient = Client & {
|
|
|
160
160
|
path: Routes;
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
+
// @public
|
|
164
|
+
export interface MapsRenderClientOptions extends ClientOptions {
|
|
165
|
+
apiVersion?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
163
168
|
// @public
|
|
164
169
|
export interface MapTilesetOutput {
|
|
165
170
|
attribution?: string;
|
|
@@ -227,14 +232,14 @@ export function positionToTileXY(position: LatLon, zoom: number, tileSize: "512"
|
|
|
227
232
|
|
|
228
233
|
// @public
|
|
229
234
|
export interface RegionCopyrightsCountryOutput {
|
|
230
|
-
ISO3: string;
|
|
231
|
-
label: string;
|
|
235
|
+
readonly ISO3: string;
|
|
236
|
+
readonly label: string;
|
|
232
237
|
}
|
|
233
238
|
|
|
234
239
|
// @public (undocumented)
|
|
235
240
|
export interface RegionCopyrightsOutput {
|
|
236
|
-
copyrights: Array<string>;
|
|
237
|
-
country: RegionCopyrightsCountryOutput;
|
|
241
|
+
readonly copyrights: Array<string>;
|
|
242
|
+
readonly country: RegionCopyrightsCountryOutput;
|
|
238
243
|
}
|
|
239
244
|
|
|
240
245
|
// @public
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AzureKeyCredential } from '@azure/core-auth';
|
|
2
2
|
import type { AzureSASCredential } from '@azure/core-auth';
|
|
3
3
|
import { Client } from '@azure-rest/core-client';
|
|
4
|
-
import
|
|
4
|
+
import { ClientOptions } from '@azure-rest/core-client';
|
|
5
5
|
import { HttpResponse } from '@azure-rest/core-client';
|
|
6
6
|
import type { LatLon } from '@azure/maps-common';
|
|
7
7
|
import { RawHttpHeaders } from '@azure/core-rest-pipeline';
|
|
@@ -36,19 +36,19 @@ export declare interface CircularPathOptions {
|
|
|
36
36
|
/** This object is returned from a successful copyright call */
|
|
37
37
|
export declare interface CopyrightCaptionOutput {
|
|
38
38
|
/** Format Version property */
|
|
39
|
-
formatVersion?: string;
|
|
39
|
+
readonly formatVersion?: string;
|
|
40
40
|
/** Copyrights Caption property */
|
|
41
|
-
copyrightsCaption: string;
|
|
41
|
+
readonly copyrightsCaption: string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/** This object is returned from a successful copyright request */
|
|
45
45
|
export declare interface CopyrightOutput {
|
|
46
46
|
/** Format Version property */
|
|
47
|
-
formatVersion?: string;
|
|
47
|
+
readonly formatVersion?: string;
|
|
48
48
|
/** General Copyrights array */
|
|
49
|
-
generalCopyrights?: Array<string>;
|
|
49
|
+
readonly generalCopyrights?: Array<string>;
|
|
50
50
|
/** Regions array */
|
|
51
|
-
regions?: Array<RegionCopyrightsOutput>;
|
|
51
|
+
readonly regions?: Array<RegionCopyrightsOutput>;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -151,23 +151,23 @@ export declare function createPinsQuery(pinSets: PinSet[]): string;
|
|
|
151
151
|
/** The resource management error additional info. */
|
|
152
152
|
export declare interface ErrorAdditionalInfoOutput {
|
|
153
153
|
/** The additional info type. */
|
|
154
|
-
type?: string;
|
|
154
|
+
readonly type?: string;
|
|
155
155
|
/** The additional info. */
|
|
156
|
-
info?: Record<string, unknown>;
|
|
156
|
+
readonly info?: Record<string, unknown>;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/** The error detail. */
|
|
160
160
|
export declare interface ErrorDetailOutput {
|
|
161
161
|
/** The error code. */
|
|
162
|
-
code?: string;
|
|
162
|
+
readonly code?: string;
|
|
163
163
|
/** The error message. */
|
|
164
|
-
message?: string;
|
|
164
|
+
readonly message?: string;
|
|
165
165
|
/** The error target. */
|
|
166
|
-
target?: string;
|
|
166
|
+
readonly target?: string;
|
|
167
167
|
/** The error details. */
|
|
168
|
-
details?: Array<ErrorDetailOutput>;
|
|
168
|
+
readonly details?: Array<ErrorDetailOutput>;
|
|
169
169
|
/** The error additional info. */
|
|
170
|
-
additionalInfo?: Array<ErrorAdditionalInfoOutput>;
|
|
170
|
+
readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
|
|
@@ -369,6 +369,12 @@ export declare type MapsRenderClient = Client & {
|
|
|
369
369
|
path: Routes;
|
|
370
370
|
};
|
|
371
371
|
|
|
372
|
+
/** The optional parameters for the client */
|
|
373
|
+
export declare interface MapsRenderClientOptions extends ClientOptions {
|
|
374
|
+
/** The api version option of the client */
|
|
375
|
+
apiVersion?: string;
|
|
376
|
+
}
|
|
377
|
+
|
|
372
378
|
/** Metadata for a tileset in the TileJSON format. */
|
|
373
379
|
export declare interface MapTilesetOutput {
|
|
374
380
|
/** Describes the version of the TileJSON spec that is implemented by this JSON object. */
|
|
@@ -498,16 +504,16 @@ export declare function positionToTileXY(position: LatLon, zoom: number, tileSiz
|
|
|
498
504
|
/** Country property */
|
|
499
505
|
export declare interface RegionCopyrightsCountryOutput {
|
|
500
506
|
/** ISO3 property */
|
|
501
|
-
ISO3: string;
|
|
507
|
+
readonly ISO3: string;
|
|
502
508
|
/** Label property */
|
|
503
|
-
label: string;
|
|
509
|
+
readonly label: string;
|
|
504
510
|
}
|
|
505
511
|
|
|
506
512
|
export declare interface RegionCopyrightsOutput {
|
|
507
513
|
/** Copyrights array */
|
|
508
|
-
copyrights: Array<string>;
|
|
514
|
+
readonly copyrights: Array<string>;
|
|
509
515
|
/** Country property */
|
|
510
|
-
country: RegionCopyrightsCountryOutput;
|
|
516
|
+
readonly country: RegionCopyrightsCountryOutput;
|
|
511
517
|
}
|
|
512
518
|
|
|
513
519
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
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 {\n RenderGetMapTileParameters,\n RenderGetMapTilesetParameters,\n RenderGetMapAttributionParameters,\n RenderGetMapStateTileParameters,\n RenderGetCopyrightCaptionParameters,\n RenderGetMapStaticImageParameters,\n RenderGetCopyrightFromBoundingBoxParameters,\n RenderGetCopyrightForTileParameters,\n RenderGetCopyrightForWorldParameters\n} from \"./parameters\";\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetMapTile {\n /**\n *\n * The `Get Map Tiles` API in an HTTP GET request that allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk).\n */\n get(\n options: RenderGetMapTileParameters\n ): StreamableMethod<\n RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n >;\n}\n\nexport interface GetMapTileset {\n /**\n *\n * The Get Map Tileset API allows users to request metadata for a tileset.\n */\n get(\n options: RenderGetMapTilesetParameters\n ): StreamableMethod<\n RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n >;\n}\n\nexport interface GetMapAttribution {\n /**\n *\n * The `Get Map Attribution` API allows users to request map copyright attribution information for a section of a tileset.\n */\n get(\n options: RenderGetMapAttributionParameters\n ): StreamableMethod<\n RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse\n >;\n}\n\nexport interface GetMapStateTile {\n /**\n *\n * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see [Zoom Levels and Tile Grid](/azure/location-based-services/zoom-levels-and-tile-grid).\n */\n get(\n options: RenderGetMapStateTileParameters\n ): StreamableMethod<\n RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightCaption {\n /**\n *\n * The `Get Copyright Caption` API is an HTTP GET request designed to serve copyright information to be used with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions.\n *\n * As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map.\n */\n get(\n options?: RenderGetCopyrightCaptionParameters\n ): StreamableMethod<\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n >;\n}\n\nexport interface GetMapStaticImage {\n /**\n * This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications.\n *\n * This API includes parameters for basic data visualization:\n *\n * - Labeled pushpins in multiple styles.\n * - Render circle, path, and polygon geometry types.\n *\n * For more information and detailed examples, see [Render custom data on a raster map](/azure/azure-maps/how-to-render-custom-data).\n * <br><br>\n * The dimensions of the bbox parameter are constrained, depending on the zoom level. This ensures the resulting image has an appropriate level of detail.\n * <br><br>\n *\n * |Zoom Level | Min Lon Range | Max Lon Range | Min Lat Range| Max Lat Range|\n * |:----------|:----------------|:----------------|:----------------|:-------------|\n * |0 | 56.25 | 360.0 | 30.1105585173 | 180.0 |\n * |1 | 28.125 | 360.0 | 14.87468995 | 180.0 |\n * |2 | 14.063 | 351.5625 | 7.4130741851 | 137.9576312246 |\n * |3 | 7.03125 | 175.78125 | 3.7034501005 | 73.6354071932 |\n * |4 | 3.515625 | 87.890625 | 1.8513375155 | 35.4776115315 |\n * |5 | 1.7578125 | 43.9453125 | 0.925620264 | 17.4589959239 |\n * |6 | 0.87890625 | 21.97265625 | 0.4628040687 | 8.6907788223 |\n * |7 | 0.439453125 | 10.986328125 | 0.2314012764 | 4.3404320789 |\n * |8 | 0.2197265625 | 5.4931640625 | 0.1157005434 | 2.1695927024 |\n * |9 | 0.1098632812 | 2.7465820312 | 0.0578502599 | 1.0847183194 |\n * |10 | 0.0549316406 | 1.3732910156 | 0.0289251285 | 0.5423494021 |\n * |11 | 0.0274658203 | 0.6866455078 | 0.014462564 | 0.2711734813 |\n * |12 | 0.0137329102 | 0.3433227539 | 0.007231282 | 0.1355865882 |\n * |13 | 0.0068664551 | 0.171661377 | 0.003615641 | 0.067793275 |\n * |14 | 0.0034332275 | 0.0858306885 | 0.0018078205 | 0.0338966351 |\n * |15 | 0.0017166138 | 0.0429153442 | 0.0009039102 | 0.0169483173 |\n * |16 | 0.0008583069 | 0.0214576721 | 0.0004519551 | 0.0084741586 |\n * |17 | 0.0004291534 | 0.0107288361 | 0.0002259776 | 0.0042370793 |\n * |18 | 0.0002145767 | 0.005364418 | 0.0001129888 | 0.0021185396 |\n * |19 | 0.0001072884 | 0.002682209 | 5.64944E-05 | 0.0010592698 |\n * |20 | 5.36442E-05 | 0.0013411045 | 2.82472E-05 | 0.0005296349 |\n *\n * _Note_ : Either **center** or **bbox** parameter must be supplied to the API.\n */\n get(\n options?: RenderGetMapStaticImageParameters\n ): StreamableMethod<\n RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse\n >;\n}\n\nexport interface GetCopyrightFromBoundingBox {\n /**\n *\n * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates\n */\n get(\n options: RenderGetCopyrightFromBoundingBoxParameters\n ): StreamableMethod<\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForTile {\n /**\n *\n * To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid).\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\n get(\n options: RenderGetCopyrightForTileParameters\n ): StreamableMethod<\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForWorld {\n /**\n *\n * Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box.\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\n get(\n options?: RenderGetCopyrightForWorldParameters\n ): StreamableMethod<\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/map/tile' has methods for the following verbs: get */\n (path: \"/map/tile\"): GetMapTile;\n /** Resource for '/map/tileset' has methods for the following verbs: get */\n (path: \"/map/tileset\"): GetMapTileset;\n /** Resource for '/map/attribution' has methods for the following verbs: get */\n (path: \"/map/attribution\"): GetMapAttribution;\n /** Resource for '/map/statetile' has methods for the following verbs: get */\n (path: \"/map/statetile\"): GetMapStateTile;\n /** Resource for '/map/copyright/caption/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/caption/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightCaption;\n /** Resource for '/map/static' has methods for the following verbs: get */\n (path: \"/map/static\"): GetMapStaticImage;\n /** Resource for '/map/copyright/bounding/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/bounding/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightFromBoundingBox;\n /** Resource for '/map/copyright/tile/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/tile/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightForTile;\n /** Resource for '/map/copyright/world/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/world/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightForWorld;\n}\n\nexport type MapsRenderClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import MapsRenderClient from "./mapsRenderClient";
|
|
4
|
-
export * from "./mapsRenderClient";
|
|
5
|
-
export * from "./parameters";
|
|
6
|
-
export * from "./responses";
|
|
7
|
-
export * from "./clientDefinitions";
|
|
8
|
-
export * from "./isUnexpected";
|
|
9
|
-
export * from "./outputModels";
|
|
10
|
-
export default MapsRenderClient;
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRenderClient from \"./mapsRenderClient\";\n\nexport * from \"./mapsRenderClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./outputModels\";\n\nexport default MapsRenderClient;\n"]}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
const responseMap = {
|
|
4
|
-
"GET /map/tile": ["200"],
|
|
5
|
-
"GET /map/tileset": ["200"],
|
|
6
|
-
"GET /map/attribution": ["200"],
|
|
7
|
-
"GET /map/statetile": ["200"],
|
|
8
|
-
"GET /map/copyright/caption/{format}": ["200"],
|
|
9
|
-
"GET /map/static": ["200"],
|
|
10
|
-
"GET /map/copyright/bounding/{format}": ["200"],
|
|
11
|
-
"GET /map/copyright/tile/{format}": ["200"],
|
|
12
|
-
"GET /map/copyright/world/{format}": ["200"]
|
|
13
|
-
};
|
|
14
|
-
export function isUnexpected(response) {
|
|
15
|
-
const lroOriginal = response.headers["x-ms-original-url"];
|
|
16
|
-
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
17
|
-
const method = response.request.method;
|
|
18
|
-
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
19
|
-
if (!pathDetails) {
|
|
20
|
-
pathDetails = geParametrizedPathSuccess(method, url.pathname);
|
|
21
|
-
}
|
|
22
|
-
return !pathDetails.includes(response.status);
|
|
23
|
-
}
|
|
24
|
-
function geParametrizedPathSuccess(method, path) {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
const pathParts = path.split("/");
|
|
27
|
-
// Iterate the responseMap to find a match
|
|
28
|
-
for (const [key, value] of Object.entries(responseMap)) {
|
|
29
|
-
// Extracting the path from the map key which is in format
|
|
30
|
-
// GET /path/foo
|
|
31
|
-
if (!key.startsWith(method)) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
const candidatePath = getPathFromMapKey(key);
|
|
35
|
-
// Get each part of the url path
|
|
36
|
-
const candidateParts = candidatePath.split("/");
|
|
37
|
-
// If the candidate and actual paths don't match in size
|
|
38
|
-
// we move on to the next candidate path
|
|
39
|
-
if (candidateParts.length === pathParts.length &&
|
|
40
|
-
hasParametrizedPath(key)) {
|
|
41
|
-
// track if we have found a match to return the values found.
|
|
42
|
-
let found = true;
|
|
43
|
-
for (let i = 0; i < candidateParts.length; i++) {
|
|
44
|
-
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
|
|
45
|
-
((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.endsWith("}"))) {
|
|
46
|
-
// If the current part of the candidate is a "template" part
|
|
47
|
-
// it is a match with the actual path part on hand
|
|
48
|
-
// skip as the parameterized part can match anything
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
// If the candidate part is not a template and
|
|
52
|
-
// the parts don't match mark the candidate as not found
|
|
53
|
-
// to move on with the next candidate path.
|
|
54
|
-
if (candidateParts[i] !== pathParts[i]) {
|
|
55
|
-
found = false;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// We finished evaluating the current candidate parts
|
|
60
|
-
// if all parts matched we return the success values form
|
|
61
|
-
// the path mapping.
|
|
62
|
-
if (found) {
|
|
63
|
-
return value;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// No match was found, return an empty array.
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
function hasParametrizedPath(path) {
|
|
71
|
-
return path.includes("/{");
|
|
72
|
-
}
|
|
73
|
-
function getPathFromMapKey(mapKey) {
|
|
74
|
-
const pathStart = mapKey.indexOf("/");
|
|
75
|
-
return mapKey.slice(pathStart);
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuBlC,MAAM,WAAW,GAA6B;IAC5C,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,kBAAkB,EAAE,CAAC,KAAK,CAAC;IAC3B,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,oBAAoB,EAAE,CAAC,KAAK,CAAC;IAC7B,qCAAqC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oft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /map/tile\": [\"200\"],\n \"GET /map/tileset\": [\"200\"],\n \"GET /map/attribution\": [\"200\"],\n \"GET /map/statetile\": [\"200\"],\n \"GET /map/copyright/caption/{format}\": [\"200\"],\n \"GET /map/static\": [\"200\"],\n \"GET /map/copyright/bounding/{format}\": [\"200\"],\n \"GET /map/copyright/tile/{format}\": [\"200\"],\n \"GET /map/copyright/world/{format}\": [\"200\"]\n};\n\nexport function isUnexpected(\n response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n): response is RenderGetMapTileDefaultResponse;\nexport function isUnexpected(\n response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n): response is RenderGetMapTilesetDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n): response is RenderGetMapAttributionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n): response is RenderGetMapStateTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n): response is RenderGetCopyrightCaptionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n): response is RenderGetMapStaticImageDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n): response is RenderGetCopyrightFromBoundingBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n): response is RenderGetCopyrightForTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is RenderGetCopyrightForWorldDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapTile200Response\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTileset200Response\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorldDefaultResponse {\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 = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\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 // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (\n candidateParts.length === pathParts.length &&\n hasParametrizedPath(key)\n ) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.endsWith(\"}\")\n ) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\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[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { getClient } from "@azure-rest/core-client";
|
|
4
|
-
/**
|
|
5
|
-
* Initialize a new instance of the class MapsRenderClient class.
|
|
6
|
-
* @param credentials type: KeyCredential
|
|
7
|
-
*/
|
|
8
|
-
export default function createClient(credentials, options = {}) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `https://atlas.microsoft.com`;
|
|
11
|
-
options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2024-04-01";
|
|
12
|
-
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
13
|
-
apiKeyHeaderName: "subscription-key"
|
|
14
|
-
} });
|
|
15
|
-
const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;
|
|
16
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
17
|
-
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
18
|
-
: `${userAgentInfo}`;
|
|
19
|
-
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
20
|
-
userAgentPrefix
|
|
21
|
-
} });
|
|
22
|
-
const client = getClient(baseUrl, credentials, options);
|
|
23
|
-
return client;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=mapsRenderClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapsRenderClient.js","sourceRoot":"","sources":["../../../src/generated/mapsRenderClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AAInE;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,gBAAgB,EAAE,kBAAkB;SACrC,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,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,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAqB,CAAC;IAE5E,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 { KeyCredential } from \"@azure/core-auth\";\nimport { MapsRenderClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsRenderClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsRenderClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"2024-04-01\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;\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 };\n\n const client = getClient(baseUrl, credentials, options) as MapsRenderClient;\n\n return client;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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/** 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 code?: string;\n /** The error message. */\n message?: string;\n /** The error target. */\n target?: string;\n /** The error details. */\n details?: Array<ErrorDetailOutput>;\n /** The error additional info. */\n additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n type?: string;\n /** The additional info. */\n info?: Record<string, unknown>;\n}\n\n/** Metadata for a tileset in the TileJSON format. */\nexport interface MapTilesetOutput {\n /** Describes the version of the TileJSON spec that is implemented by this JSON object. */\n tilejson: string;\n /** A name describing the tileset. The name can contain any legal character. Implementations SHOULD NOT interpret the name as HTML. */\n name?: string;\n /** Text description of the tileset. The description can contain any legal character. Implementations SHOULD NOT interpret the description as HTML. */\n description?: string;\n /** A semver.org style version number for the tiles contained within the tileset. When changes across tiles are introduced, the minor version MUST change. */\n version?: string;\n /** Copyright attribution to be displayed on the map. Implementations MAY decide to treat this as HTML or literal text. For security reasons, make absolutely sure that this field can't be abused as a vector for XSS or beacon tracking. */\n attribution?: string;\n /** A mustache template to be used to format data from grids for interaction. */\n template?: string;\n /** A legend to be displayed with the map. Implementations MAY decide to treat this as HTML or literal text. For security reasons, make absolutely sure that this field can't be abused as a vector for XSS or beacon tracking. */\n legend?: string;\n /** Default: \"xyz\". Either \"xyz\" or \"tms\". Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed. */\n scheme?: string;\n /** An array of tile endpoints. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint. */\n tiles: Array<string>;\n /** An array of interactivity endpoints. */\n grids?: Array<string>;\n /** An array of data files in GeoJSON format. */\n data?: Array<string>;\n /** The minimum zoom level. */\n minzoom?: number;\n /** The maximum zoom level. */\n maxzoom?: number;\n /** The maximum extent of available map tiles. Bounds MUST define an area covered by all zoom levels. The bounds are represented in WGS:84 latitude and longitude values, in the order left, bottom, right, top. Values may be integers or floating point numbers. */\n bounds?: Array<number>;\n /** The default location of the tileset in the form [longitude, latitude, zoom]. The zoom level MUST be between minzoom and maxzoom. Implementations can use this value to set the default location. */\n center?: Array<number>;\n}\n\n/** Copyright attribution for the requested section of a tileset. */\nexport interface MapAttributionOutput {\n /** A list of copyright strings. */\n copyrights: Array<string>;\n}\n\n/** This object is returned from a successful copyright call */\nexport interface CopyrightCaptionOutput {\n /** Format Version property */\n formatVersion?: string;\n /** Copyrights Caption property */\n copyrightsCaption: string;\n}\n\n/** This object is returned from a successful copyright request */\nexport interface CopyrightOutput {\n /** Format Version property */\n formatVersion?: string;\n /** General Copyrights array */\n generalCopyrights?: Array<string>;\n /** Regions array */\n regions?: Array<RegionCopyrightsOutput>;\n}\n\nexport interface RegionCopyrightsOutput {\n /** Copyrights array */\n copyrights: Array<string>;\n /** Country property */\n country: RegionCopyrightsCountryOutput;\n}\n\n/** Country property */\nexport interface RegionCopyrightsCountryOutput {\n /** ISO3 property */\n ISO3: string;\n /** Label property */\n label: string;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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 RenderGetMapTileQueryParamProperties {\n /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/rest/api/maps-creator/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */\n tilesetId:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n /**\n * Zoom level for the desired tile.\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n zoom: number;\n /**\n * X coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n x: number;\n /**\n * Y coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n y: number;\n /**\n * The desired date and time of the requested tile. This parameter must be specified in the standard date-time format (e.g. 2019-11-14T16:03:00-08:00), as defined by [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). This parameter is only supported when tilesetId parameter is set to one of the values below.\n *\n * * microsoft.weather.infrared.main: We provide tiles up to 3 hours in the past. Tiles are available in 10-minute intervals. We round the timeStamp value to the nearest 10-minute time frame.\n * * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in the past and up to 2 hours in the future. Tiles are available in 5-minute intervals. We round the timeStamp value to the nearest 5-minute time frame.\n */\n timeStamp?: Date | string;\n /** The size of the returned map tile in pixels. */\n tileSize?: \"256\" | \"512\";\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface RenderGetMapTileQueryParam {\n queryParameters: RenderGetMapTileQueryParamProperties;\n}\n\nexport type RenderGetMapTileParameters = RenderGetMapTileQueryParam &\n RequestParameters;\n\nexport interface RenderGetMapTilesetQueryParamProperties {\n /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/rest/api/maps-creator/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */\n tilesetId:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n}\n\nexport interface RenderGetMapTilesetQueryParam {\n queryParameters: RenderGetMapTilesetQueryParamProperties;\n}\n\nexport type RenderGetMapTilesetParameters = RenderGetMapTilesetQueryParam &\n RequestParameters;\n\nexport interface RenderGetMapAttributionQueryParamProperties {\n /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/rest/api/maps-creator/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */\n tilesetId:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n /** Zoom level for the desired map attribution. */\n zoom: number;\n /** The string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`. */\n bounds: Array<number>;\n}\n\nexport interface RenderGetMapAttributionQueryParam {\n queryParameters: RenderGetMapAttributionQueryParamProperties;\n}\n\nexport type RenderGetMapAttributionParameters = RenderGetMapAttributionQueryParam &\n RequestParameters;\n\nexport interface RenderGetMapStateTileQueryParamProperties {\n /**\n * Zoom level for the desired tile.\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n zoom: number;\n /**\n * X coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n x: number;\n /**\n * Y coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n y: number;\n /** The stateset id. */\n statesetId: string;\n}\n\nexport interface RenderGetMapStateTileQueryParam {\n queryParameters: RenderGetMapStateTileQueryParamProperties;\n}\n\nexport type RenderGetMapStateTileParameters = RenderGetMapStateTileQueryParam &\n RequestParameters;\nexport type RenderGetCopyrightCaptionParameters = RequestParameters;\n\nexport interface RenderGetMapStaticImageQueryParamProperties {\n /** Map style to be returned. Possible values are microsoft.base.road, microsoft.base.darkgrey, and microsoft.imagery. Default value is set to be microsoft.base.road. For more information, see [Render TilesetId](https://learn.microsoft.com/en-us/rest/api/maps/render/get-map-tileset?view=rest-maps-2023-06-01&tabs=HTTP#tilesetid). */\n tilesetId?:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n /** Optional Value, indicating no traffic flow overlaid on the image result. Possible values are microsoft.traffic.relative.main and none. Default value is none, indicating no traffic flow returned. If traffic related tilesetId is provided, will return map image with corresponding traffic layer. For more information, see [Render TilesetId](https://learn.microsoft.com/en-us/rest/api/maps/render/get-map-tileset?view=rest-maps-2023-06-01&tabs=HTTP#tilesetid). */\n trafficLayer?: \"microsoft.traffic.relative.main\" | \"none\";\n /** Desired zoom level of the map. Support zoom value range from 0-20 (inclusive) for tilesetId being microsoft.base.road or microsoft.base.darkgrey. Support zoom value range from 0-19 (inclusive) for tilesetId being microsoft.imagery. Default value is 12.<br><br>For more information, see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid). */\n zoom?: number;\n /**\n * Coordinates of the center point in double. Format: 'lon,lat'. Longitude range: -180 to 180. Latitude range: -90 to 90.\n *\n * Note: Either center or bbox are required parameters. They are\n * mutually exclusive.\n */\n center?: Array<number>;\n /**\n * A bounding box is defined by two latitudes and two longitudes that represent the four sides of a rectangular area on the Earth. Format : 'minLon, minLat,\n * maxLon, maxLat' (in double).\n *\n * Note: Either bbox or center are required\n * parameters. They are mutually exclusive. bbox shouldn’t be used with\n * height or width.\n *\n * The maximum and minimum allowed ranges for Lat and Lon are defined for each zoom level\n * in the table at the top of this page.\n */\n bbox?: Array<number>;\n /**\n * Height of the resulting image in pixels. Range from 80 to 1500. Default\n * is 512. It shouldn’t be used with bbox.\n */\n height?: number;\n /** Width of the resulting image in pixels. Range from 80 to 2000. Default is 512. It should not be used with bbox. */\n width?: number;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Pushpin style and instances. Use this parameter to optionally add pushpins to the image.\n * The pushpin style describes the appearance of the pushpins, and the instances specify\n * the coordinates of the pushpins (in double) and optional labels for each pin. (Be sure to properly URL-encode values of this\n * parameter since it will contain reserved characters such as pipes and punctuation.)\n *\n * The Azure Maps account S0 SKU only supports a single instance of the pins parameter and the number of locations is limited to 5 per pin. Other SKUs\n * allow up to 25 instances of the pins parameter to specify multiple pin styles, and the number of locations is limited to 50 per pin.\n *\n * To render a pushpin at latitude 45°N and longitude 122°W using the default built-in pushpin style, add the\n * querystring parameter\n *\n * `pins=default||-122 45`\n *\n * Note that the longitude comes before the latitude.\n * After URL encoding this will look like\n *\n * `pins=default%7C%7C-122+45`\n *\n * All of the examples here show the pins\n * parameter without URL encoding, for clarity.\n *\n * To render a pin at multiple locations, separate each location with a pipe character. For example, use\n *\n * `pins=default||-122 45|-119.5 43.2|-121.67 47.12`\n *\n * The S0 Azure Maps account SKU only allows five pushpins. Other account SKUs do not have this limitation.\n *\n * ### Style Modifiers\n *\n * You can modify the appearance of the pins by adding style modifiers. These are added after the style but before\n * the locations and labels. Style modifiers each have a two-letter name. These abbreviated names are used to help\n * reduce the length of the URL.\n *\n * To change the color of the pushpin, use the 'co' style modifier and specify the color using the HTML/CSS RGB color\n * format which is a six-digit hexadecimal number (the three-digit form is not supported). For example, to use\n * a deep pink color which you would specify as #FF1493 in CSS, use\n *\n * `pins=default|coFF1493||-122 45`\n *\n * ### Pushpin Labels\n *\n * To add a label to the pins, put the label in single quotes just before the coordinates. Avoid using special character such as `|` or `||` in label. For example, to label\n * three pins with the values '1', '2', and '3', use\n *\n * `pins=default||'1'-122 45|'2'-119.5 43.2|'3'-121.67 47.12`\n *\n * There is a built-in pushpin style called 'none' that does not display a pushpin image. You can use this if\n * you want to display labels without any pin image. For example,\n *\n * `pins=none||'A'-122 45|'B'-119.5 43.2`\n *\n * To change the color of the pushpin labels, use the 'lc' label color style modifier. For example, to use pink\n * pushpins with black labels, use\n *\n * `pins=default|coFF1493|lc000000||-122 45`\n *\n * To change the size of the labels, use the 'ls' label size style modifier. The label size represents the approximate\n * height of the label text in pixels. For example, to increase the label size to 12, use\n *\n * `pins=default|ls12||'A'-122 45|'B'-119 43`\n *\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and\n * is at the top center of custom pushpins (see below). To override the label anchor, using the 'la' style modifier\n * and provide X and Y pixel coordinates for the anchor. These coordinates are relative to the top left corner of the\n * pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down. For example,\n * to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image,\n * use\n *\n * `pins=default|la10 -4||'A'-122 45|'B'-119 43`\n *\n * ### Custom Pushpins\n *\n * To use a custom pushpin image, use the word 'custom' as the pin style name, and then specify a URL after the\n * location and label information. The maximum allowed size for a customized label image is 65,536 pixels. Use two pipe characters to indicate that you're done specifying locations and are\n * starting the URL. For example,\n *\n * `pins=custom||-122 45||http://contoso.com/pushpins/red.png`\n *\n * After URL encoding, this would look like\n *\n * `pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png`\n *\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures\n * the location that you're trying to highlight. To override the anchor location of the pin image, use the 'an'\n * style modifier. This uses the same format as the 'la' label anchor style modifier. For example, if your custom\n * pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by\n * using\n *\n * `pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png`\n *\n * Note: If you use the 'co' color modifier with a custom pushpin image, the specified color will replace the RGB\n * channels of the pixels in the image but will leave the alpha (opacity) channel unchanged. This would usually\n * only be done with a solid-color custom image.\n *\n * ### Scale, Rotation, and Opacity\n *\n * You can make pushpins and their labels larger or smaller by using the 'sc' scale style modifier. This is a\n * value greater than zero. A value of 1 is the standard scale. Values larger than 1 will make the pins larger, and\n * values smaller than 1 will make them smaller. For example, to draw the pushpins 50% larger than normal, use\n *\n * `pins=default|sc1.5||-122 45`\n *\n * You can rotate pushpins and their labels by using the 'ro' rotation style modifier. This is a number of degrees\n * of clockwise rotation. Use a negative number to rotate counter-clockwise. For example, to rotate the pushpins\n * 90 degrees clockwise and double their size, use\n *\n * `pins=default|ro90|sc2||-122 45`\n *\n * You can make pushpins and their labels partially transparent by specifying the 'al' alpha style modifier.\n * This is a number between 0 and 1 indicating the opacity of the pushpins. Zero makes them completely transparent\n * (and not visible) and 1 makes them completely opaque (which is the default). For example, to make pushpins\n * and their labels only 67% opaque, use\n *\n * `pins=default|al.67||-122 45`\n *\n * ### Style Modifier Summary\n *\n * Modifier | Description | Type | Range\n * :--------:|---------------|--------|----------\n * al | Alpha (opacity) | float | 0 to 1\n * an | Pin anchor | <int32, int32> | *\n * co | Pin color | string | 000000 to FFFFFF\n * la | Label anchor | <int32, int32> | *\n * lc | Label color | string | 000000 to FFFFFF\n * ls | Label size | float | Greater than 0\n * ro | Rotation | float | -360 to 360\n * sc | Scale | float | Greater than 0\n *\n * * X and Y coordinates can be anywhere within pin image or a margin around it.\n * The margin size is the minimum of the pin width and height.\n */\n pins?: string;\n /**\n * Path style and locations (in double). Use this parameter to optionally add lines, polygons or circles to the image.\n * The path style describes the appearance of the line and fill. (Be sure to properly URL-encode values of this\n * parameter since it will contain reserved characters such as pipes and punctuation.)\n *\n * Path parameter is supported in Azure Maps account SKU starting with S1. Multiple instances of the path parameter\n * allow to specify multiple geometries with their styles. Number of parameters per request is limited to 10 and\n * number of locations is limited to 100 per path.\n *\n * To render a circle with radius 100 meters and center point at latitude 45°N and longitude 122°W using the default style, add the\n * querystring parameter\n *\n * `path=ra100||-122 45`\n *\n * Note that the longitude comes before the latitude.\n * After URL encoding this will look like\n *\n * `path=ra100%7C%7C-122+45`\n *\n * All of the examples here show the path parameter without URL encoding, for clarity.\n *\n * To render a line, separate each location with a pipe character. For example, use\n *\n * `path=||-122 45|-119.5 43.2|-121.67 47.12`\n *\n * A polygon is specified with a closed path, where the first and last points are equal. For example, use\n *\n * `path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45`\n *\n * Longitude value for locations of lines and polygons can be in the range from -360 to 360 to allow for rendering of geometries crossing the anti-meridian.\n *\n * ### Style Modifiers\n *\n * You can modify the appearance of the path by adding style modifiers. These are added before the locations.\n * Style modifiers each have a two-letter name. These abbreviated names are used to help reduce the length\n * of the URL.\n *\n * To change the color of the outline, use the 'lc' style modifier and specify the color using the HTML/CSS RGB color\n * format which is a six-digit hexadecimal number (the three-digit form is not supported). For example, to use\n * a deep pink color which you would specify as #FF1493 in CSS, use\n *\n * `path=lcFF1493||-122 45|-119.5 43.2`\n *\n * Multiple style modifiers may be combined to create a more complex visual style.\n *\n * `lc0000FF|lw3|la0.60|fa0.50||-122.2 47.6|-122.2 47.7|-122.3 47.7|-122.3 47.6|-122.2 47.6`\n *\n * ### Style Modifier Summary\n *\n * Modifier | Description | Type | Range\n * :--------:|---------------|--------|----------\n * lc | Line color | string | 000000 to FFFFFF\n * fc | Fill color | string | 000000 to FFFFFF\n * la | Line alpha (opacity) | float | 0 to 1\n * fa | Fill alpha (opacity) | float | 0 to 1\n * lw | Line width |int32 | (0, 50]\n * ra | Circle radius (meters) | float | Greater than 0\n */\n path?: string;\n}\n\nexport interface RenderGetMapStaticImageQueryParam {\n queryParameters?: RenderGetMapStaticImageQueryParamProperties;\n}\n\nexport type RenderGetMapStaticImageParameters = RenderGetMapStaticImageQueryParam &\n RequestParameters;\n\nexport interface RenderGetCopyrightFromBoundingBoxQueryParamProperties {\n /** Minimum coordinates (south-west point) of bounding box in latitude longitude coordinate system. E.g. 52.41064,4.84228 */\n mincoordinates: Array<number>;\n /** Maximum coordinates (north-east point) of bounding box in latitude longitude coordinate system. E.g. 52.41064,4.84228 */\n maxcoordinates: Array<number>;\n /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */\n text?: \"yes\" | \"no\";\n}\n\nexport interface RenderGetCopyrightFromBoundingBoxQueryParam {\n queryParameters: RenderGetCopyrightFromBoundingBoxQueryParamProperties;\n}\n\nexport type RenderGetCopyrightFromBoundingBoxParameters = RenderGetCopyrightFromBoundingBoxQueryParam &\n RequestParameters;\n\nexport interface RenderGetCopyrightForTileQueryParamProperties {\n /**\n * Zoom level for the desired tile.\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n zoom: number;\n /**\n * X coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n x: number;\n /**\n * Y coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n y: number;\n /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */\n text?: \"yes\" | \"no\";\n}\n\nexport interface RenderGetCopyrightForTileQueryParam {\n queryParameters: RenderGetCopyrightForTileQueryParamProperties;\n}\n\nexport type RenderGetCopyrightForTileParameters = RenderGetCopyrightForTileQueryParam &\n RequestParameters;\n\nexport interface RenderGetCopyrightForWorldQueryParamProperties {\n /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */\n text?: \"yes\" | \"no\";\n}\n\nexport interface RenderGetCopyrightForWorldQueryParam {\n queryParameters?: RenderGetCopyrightForWorldQueryParamProperties;\n}\n\nexport type RenderGetCopyrightForWorldParameters = RenderGetCopyrightForWorldQueryParam &\n RequestParameters;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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 { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n ErrorResponseOutput,\n MapTilesetOutput,\n MapAttributionOutput,\n CopyrightCaptionOutput,\n CopyrightOutput\n} from \"./outputModels\";\n\nexport interface RenderGetMapTile200Headers {\n /** The content-type for the response. */\n \"content-type\"?: string;\n}\n\n/**\n *\n * The `Get Map Tiles` API in an HTTP GET request that allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk).\n */\nexport interface RenderGetMapTile200Response extends HttpResponse {\n status: \"200\";\n /** Value may contain any sequence of octets */\n body: Uint8Array;\n headers: RawHttpHeaders & RenderGetMapTile200Headers;\n}\n\n/**\n *\n * The `Get Map Tiles` API in an HTTP GET request that allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk).\n */\nexport interface RenderGetMapTileDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n *\n * The Get Map Tileset API allows users to request metadata for a tileset.\n */\nexport interface RenderGetMapTileset200Response extends HttpResponse {\n status: \"200\";\n body: MapTilesetOutput;\n}\n\n/**\n *\n * The Get Map Tileset API allows users to request metadata for a tileset.\n */\nexport interface RenderGetMapTilesetDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n *\n * The `Get Map Attribution` API allows users to request map copyright attribution information for a section of a tileset.\n */\nexport interface RenderGetMapAttribution200Response extends HttpResponse {\n status: \"200\";\n body: MapAttributionOutput;\n}\n\n/**\n *\n * The `Get Map Attribution` API allows users to request map copyright attribution information for a section of a tileset.\n */\nexport interface RenderGetMapAttributionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\nexport interface RenderGetMapStateTile200Headers {\n /** The content-type for the response. */\n \"content-type\"?: string;\n}\n\n/**\n *\n * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see [Zoom Levels and Tile Grid](/azure/location-based-services/zoom-levels-and-tile-grid).\n */\nexport interface RenderGetMapStateTile200Response extends HttpResponse {\n status: \"200\";\n /** Value may contain any sequence of octets */\n body: Uint8Array;\n headers: RawHttpHeaders & RenderGetMapStateTile200Headers;\n}\n\n/**\n *\n * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see [Zoom Levels and Tile Grid](/azure/location-based-services/zoom-levels-and-tile-grid).\n */\nexport interface RenderGetMapStateTileDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n *\n * The `Get Copyright Caption` API is an HTTP GET request designed to serve copyright information to be used with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions.\n *\n * As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map.\n */\nexport interface RenderGetCopyrightCaption200Response extends HttpResponse {\n status: \"200\";\n body: CopyrightCaptionOutput;\n}\n\n/**\n *\n * The `Get Copyright Caption` API is an HTTP GET request designed to serve copyright information to be used with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions.\n *\n * As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map.\n */\nexport interface RenderGetCopyrightCaptionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\nexport interface RenderGetMapStaticImage200Headers {\n /** The content-type for the response. */\n \"content-type\"?: string;\n}\n\n/**\n * This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications.\n *\n * This API includes parameters for basic data visualization:\n *\n * - Labeled pushpins in multiple styles.\n * - Render circle, path, and polygon geometry types.\n *\n * For more information and detailed examples, see [Render custom data on a raster map](/azure/azure-maps/how-to-render-custom-data).\n * <br><br>\n * The dimensions of the bbox parameter are constrained, depending on the zoom level. This ensures the resulting image has an appropriate level of detail.\n * <br><br>\n *\n * |Zoom Level | Min Lon Range | Max Lon Range | Min Lat Range| Max Lat Range|\n * |:----------|:----------------|:----------------|:----------------|:-------------|\n * |0 | 56.25 | 360.0 | 30.1105585173 | 180.0 |\n * |1 | 28.125 | 360.0 | 14.87468995 | 180.0 |\n * |2 | 14.063 | 351.5625 | 7.4130741851 | 137.9576312246 |\n * |3 | 7.03125 | 175.78125 | 3.7034501005 | 73.6354071932 |\n * |4 | 3.515625 | 87.890625 | 1.8513375155 | 35.4776115315 |\n * |5 | 1.7578125 | 43.9453125 | 0.925620264 | 17.4589959239 |\n * |6 | 0.87890625 | 21.97265625 | 0.4628040687 | 8.6907788223 |\n * |7 | 0.439453125 | 10.986328125 | 0.2314012764 | 4.3404320789 |\n * |8 | 0.2197265625 | 5.4931640625 | 0.1157005434 | 2.1695927024 |\n * |9 | 0.1098632812 | 2.7465820312 | 0.0578502599 | 1.0847183194 |\n * |10 | 0.0549316406 | 1.3732910156 | 0.0289251285 | 0.5423494021 |\n * |11 | 0.0274658203 | 0.6866455078 | 0.014462564 | 0.2711734813 |\n * |12 | 0.0137329102 | 0.3433227539 | 0.007231282 | 0.1355865882 |\n * |13 | 0.0068664551 | 0.171661377 | 0.003615641 | 0.067793275 |\n * |14 | 0.0034332275 | 0.0858306885 | 0.0018078205 | 0.0338966351 |\n * |15 | 0.0017166138 | 0.0429153442 | 0.0009039102 | 0.0169483173 |\n * |16 | 0.0008583069 | 0.0214576721 | 0.0004519551 | 0.0084741586 |\n * |17 | 0.0004291534 | 0.0107288361 | 0.0002259776 | 0.0042370793 |\n * |18 | 0.0002145767 | 0.005364418 | 0.0001129888 | 0.0021185396 |\n * |19 | 0.0001072884 | 0.002682209 | 5.64944E-05 | 0.0010592698 |\n * |20 | 5.36442E-05 | 0.0013411045 | 2.82472E-05 | 0.0005296349 |\n *\n * _Note_ : Either **center** or **bbox** parameter must be supplied to the API.\n */\nexport interface RenderGetMapStaticImage200Response extends HttpResponse {\n status: \"200\";\n /** Value may contain any sequence of octets */\n body: Uint8Array;\n headers: RawHttpHeaders & RenderGetMapStaticImage200Headers;\n}\n\n/**\n * This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications.\n *\n * This API includes parameters for basic data visualization:\n *\n * - Labeled pushpins in multiple styles.\n * - Render circle, path, and polygon geometry types.\n *\n * For more information and detailed examples, see [Render custom data on a raster map](/azure/azure-maps/how-to-render-custom-data).\n * <br><br>\n * The dimensions of the bbox parameter are constrained, depending on the zoom level. This ensures the resulting image has an appropriate level of detail.\n * <br><br>\n *\n * |Zoom Level | Min Lon Range | Max Lon Range | Min Lat Range| Max Lat Range|\n * |:----------|:----------------|:----------------|:----------------|:-------------|\n * |0 | 56.25 | 360.0 | 30.1105585173 | 180.0 |\n * |1 | 28.125 | 360.0 | 14.87468995 | 180.0 |\n * |2 | 14.063 | 351.5625 | 7.4130741851 | 137.9576312246 |\n * |3 | 7.03125 | 175.78125 | 3.7034501005 | 73.6354071932 |\n * |4 | 3.515625 | 87.890625 | 1.8513375155 | 35.4776115315 |\n * |5 | 1.7578125 | 43.9453125 | 0.925620264 | 17.4589959239 |\n * |6 | 0.87890625 | 21.97265625 | 0.4628040687 | 8.6907788223 |\n * |7 | 0.439453125 | 10.986328125 | 0.2314012764 | 4.3404320789 |\n * |8 | 0.2197265625 | 5.4931640625 | 0.1157005434 | 2.1695927024 |\n * |9 | 0.1098632812 | 2.7465820312 | 0.0578502599 | 1.0847183194 |\n * |10 | 0.0549316406 | 1.3732910156 | 0.0289251285 | 0.5423494021 |\n * |11 | 0.0274658203 | 0.6866455078 | 0.014462564 | 0.2711734813 |\n * |12 | 0.0137329102 | 0.3433227539 | 0.007231282 | 0.1355865882 |\n * |13 | 0.0068664551 | 0.171661377 | 0.003615641 | 0.067793275 |\n * |14 | 0.0034332275 | 0.0858306885 | 0.0018078205 | 0.0338966351 |\n * |15 | 0.0017166138 | 0.0429153442 | 0.0009039102 | 0.0169483173 |\n * |16 | 0.0008583069 | 0.0214576721 | 0.0004519551 | 0.0084741586 |\n * |17 | 0.0004291534 | 0.0107288361 | 0.0002259776 | 0.0042370793 |\n * |18 | 0.0002145767 | 0.005364418 | 0.0001129888 | 0.0021185396 |\n * |19 | 0.0001072884 | 0.002682209 | 5.64944E-05 | 0.0010592698 |\n * |20 | 5.36442E-05 | 0.0013411045 | 2.82472E-05 | 0.0005296349 |\n *\n * _Note_ : Either **center** or **bbox** parameter must be supplied to the API.\n */\nexport interface RenderGetMapStaticImageDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n *\n * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates\n */\nexport interface RenderGetCopyrightFromBoundingBox200Response\n extends HttpResponse {\n status: \"200\";\n body: CopyrightOutput;\n}\n\n/**\n *\n * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates\n */\nexport interface RenderGetCopyrightFromBoundingBoxDefaultResponse\n extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n *\n * To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid).\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\nexport interface RenderGetCopyrightForTile200Response extends HttpResponse {\n status: \"200\";\n body: CopyrightOutput;\n}\n\n/**\n *\n * To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid).\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\nexport interface RenderGetCopyrightForTileDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n *\n * Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box.\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\nexport interface RenderGetCopyrightForWorld200Response extends HttpResponse {\n status: \"200\";\n body: CopyrightOutput;\n}\n\n/**\n *\n * Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box.\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\nexport interface RenderGetCopyrightForWorldDefaultResponse\n extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}
|