@azure-rest/maps-route 1.0.0-beta.2 → 1.0.0-beta.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/README.md +68 -20
- package/dist/index.js +169 -63
- package/dist/index.js.map +1 -1
- package/dist-esm/src/helpers.js +1 -1
- package/dist-esm/src/helpers.js.map +1 -1
- package/dist-esm/src/index.js +2 -2
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/mapsRoute.js +16 -5
- package/dist-esm/src/mapsRoute.js.map +1 -1
- package/package.json +35 -39
- package/review/maps-route.api.md +117 -90
- package/types/maps-route-rest.d.ts +517 -271
- 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 -13
- 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/mapsRouteClient.js +0 -25
- package/dist-esm/src/generated/mapsRouteClient.js.map +0 -1
- package/dist-esm/src/generated/models.js +0 -4
- package/dist-esm/src/generated/models.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/pollingHelper.js +0 -51
- package/dist-esm/src/generated/pollingHelper.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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/generated/mapsRouteClient.ts","../src/generated/isUnexpected.ts","../src/generated/pollingHelper.ts","../src/mapsRoute.ts","../src/helpers.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 { MapsRouteClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsRouteClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsRouteClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"1.0\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-route-rest/1.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 MapsRouteClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n RouteRequestRouteMatrixSync200Response,\n RouteRequestRouteMatrixSync408Response,\n RouteRequestRouteMatrixSyncDefaultResponse,\n RouteGetRouteDirections200Response,\n RouteGetRouteDirectionsDefaultResponse,\n RouteGetRouteDirectionsWithAdditionalParameters200Response,\n RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse,\n RouteGetRouteRange200Response,\n RouteGetRouteRangeDefaultResponse,\n RouteRequestRouteDirectionsBatchSync200Response,\n RouteRequestRouteDirectionsBatchSync408Response,\n RouteRequestRouteDirectionsBatchSyncDefaultResponse\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /route/matrix/{format}\": [\"200\", \"202\"],\n \"GET /route/matrix/{format}\": [\"200\", \"202\"],\n \"POST /route/matrix/sync/{format}\": [\"200\"],\n \"GET /route/directions/{format}\": [\"200\"],\n \"POST /route/directions/{format}\": [\"200\"],\n \"GET /route/range/{format}\": [\"200\"],\n \"POST /route/directions/batch/{format}\": [\"200\", \"202\"],\n \"GET /route/directions/batch/{format}\": [\"200\", \"202\"],\n \"POST /route/directions/batch/sync/{format}\": [\"200\"]\n};\n\nexport function isUnexpected(\n response:\n | RouteRequestRouteMatrixSync200Response\n | RouteRequestRouteMatrixSync408Response\n | RouteRequestRouteMatrixSyncDefaultResponse\n): response is RouteRequestRouteMatrixSync408Response;\nexport function isUnexpected(\n response:\n | RouteGetRouteDirections200Response\n | RouteGetRouteDirectionsDefaultResponse\n): response is RouteGetRouteDirectionsDefaultResponse;\nexport function isUnexpected(\n response:\n | RouteGetRouteDirectionsWithAdditionalParameters200Response\n | RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse\n): response is RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse;\nexport function isUnexpected(\n response: RouteGetRouteRange200Response | RouteGetRouteRangeDefaultResponse\n): response is RouteGetRouteRangeDefaultResponse;\nexport function isUnexpected(\n response:\n | RouteRequestRouteDirectionsBatchSync200Response\n | RouteRequestRouteDirectionsBatchSync408Response\n | RouteRequestRouteDirectionsBatchSyncDefaultResponse\n): response is RouteRequestRouteDirectionsBatchSync408Response;\nexport function isUnexpected(\n response:\n | RouteRequestRouteMatrixSync200Response\n | RouteRequestRouteMatrixSync408Response\n | RouteRequestRouteMatrixSyncDefaultResponse\n | RouteGetRouteDirections200Response\n | RouteGetRouteDirectionsDefaultResponse\n | RouteGetRouteDirectionsWithAdditionalParameters200Response\n | RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse\n | RouteGetRouteRange200Response\n | RouteGetRouteRangeDefaultResponse\n | RouteRequestRouteDirectionsBatchSync200Response\n | RouteRequestRouteDirectionsBatchSync408Response\n | RouteRequestRouteDirectionsBatchSyncDefaultResponse\n): response is\n | RouteRequestRouteMatrixSync408Response\n | RouteRequestRouteMatrixSyncDefaultResponse\n | RouteGetRouteDirectionsDefaultResponse\n | RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse\n | RouteGetRouteRangeDefaultResponse\n | RouteRequestRouteDirectionsBatchSync408Response\n | RouteRequestRouteDirectionsBatchSyncDefaultResponse {\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 { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollerLike,\n PollOperationState\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] =\n initialResponse.request.url;\n return lroResponse;\n }\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult\n): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(\n `Status code of the response is not a number. Value: ${response.status}`\n );\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body\n }\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport { AzureKeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport { MapsRouteClient } from \"./generated\";\nimport createClient from \"./generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsRouteClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRoute(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: AzureKeyCredential,\n options?: ClientOptions\n): MapsRouteClient;\n/**\n * Creates an instance of MapsRoute from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure/maps-route\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRoute(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions\n): MapsRouteClient;\nexport default function MapsRoute(\n credential: TokenCredential | AzureKeyCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {}\n): MapsRouteClient {\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 AAD.\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: `${options.baseUrl || \"https://atlas.microsoft.com\"}/.default`,\n })\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n return createClient(credential, options);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { BatchRequest, RouteGetRouteDirectionsQueryParamProperties } from \"./generated\";\n\nfunction toLatLonString(coordinates: LatLon): string {\n return `${coordinates[0]},${coordinates[1]}`;\n}\n\n/**\n * Transform an array of [Latitude, Longtitute] to a string in the following format:\n * \"Latitude_1,Longtitute_1:Latitude_2,Longtitute_2:...\"\n *\n * @param coordinates - An array of Latitude/Longtitute pair to transform.\n * @returns The transformed string.\n */\nexport function toColonDelimitedLatLonString(coordinates: LatLon[]): string {\n return coordinates.map((c) => toLatLonString(c)).join(\":\");\n}\n\n/**\n * Create a batch request body of a bunch of route direction requests.\n *\n * @param queryParamProperties - An object of the query parameters for a route direction request\n * @returns The composed batch request.\n */\nexport function createRouteDirectionsBatchRequest(\n queryParamProperties: RouteGetRouteDirectionsQueryParamProperties[]\n): BatchRequest {\n return {\n batchItems: queryParamProperties.map((queryParam) => ({\n query:\n \"?\" +\n Object.entries(queryParam)\n .map(([k, v]) => {\n // Skip if no value\n if (typeof v === \"undefined\" || v === null) {\n return \"\";\n }\n // Check name mappings: Array values\n if ((k === \"departAt\" || k === \"arriveAt\") && v instanceof Date) {\n return `${k}=${v.toISOString()}`;\n }\n return `${k}=${v}`;\n })\n .filter((s) => s !== \"\")\n .join(\"&\"),\n })),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport MapsRoute from \"./mapsRoute\";\n\nexport * from \"./generated\";\nexport * from \"./helpers\";\n\nexport default MapsRoute;\n"],"names":["getClient","LroEngine","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsCl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,CAAI,CAAA,EAAA,WAAW,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;AAC/C,CAAC;AAED;;;;;;AAMG;AACG,SAAU,4BAA4B,CAAC,WAAqB,EAAA;AAChE,IAAA,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;AAKG;AACG,SAAU,iCAAiC,CAC/C,oBAAmE,EAAA;IAEnE,OAAO;QACL,UAAU,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC,UAAU,MAAM;AACpD,YAAA,KAAK,EACH,GAAG;AACH,gBAAA,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;qBACvB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAI;;oBAEd,IAAI,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,EAAE;AAC1C,wBAAA,OAAO,EAAE,CAAC;AACX,qBAAA;;AAED,oBAAA,IAAI,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,UAAU,KAAK,CAAC,YAAY,IAAI,EAAE;wBAC/D,OAAO,CAAA,EAAG,CAAC,CAAI,CAAA,EAAA,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;AAClC,qBAAA;AACD,oBAAA,OAAO,CAAG,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,EAAE,CAAC;AACrB,iBAAC,CAAC;qBACD,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;qBACvB,IAAI,CAAC,GAAG,CAAC;AACf,SAAA,CAAC,CAAC;KACJ,CAAC;AACJ;;AClDA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../generated/logger.ts","../generated/mapsRouteClient.ts","../generated/isUnexpected.ts","../generated/pollingHelper.ts","../generated/serializeHelper.ts","../src/mapsRoute.ts","../src/helpers.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-route\");\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 { MapsRouteClient } from \"./clientDefinitions\";\n\n/** The optional parameters for the client */\nexport interface MapsRouteClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsRouteClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"1.0\", ...options }: MapsRouteClientOptions = {},\n): MapsRouteClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-route-rest/1.0.0-beta.4`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsRouteClient;\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 {\n RouteRequestRouteMatrixSync200Response,\n RouteRequestRouteMatrixSync408Response,\n RouteRequestRouteMatrixSyncDefaultResponse,\n RouteGetRouteDirections200Response,\n RouteGetRouteDirectionsDefaultResponse,\n RouteGetRouteDirectionsWithAdditionalParameters200Response,\n RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse,\n RouteGetRouteRange200Response,\n RouteGetRouteRangeDefaultResponse,\n RouteRequestRouteDirectionsBatchSync200Response,\n RouteRequestRouteDirectionsBatchSync408Response,\n RouteRequestRouteDirectionsBatchSyncDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /route/matrix/{format}\": [\"200\", \"202\"],\n \"POST /route/matrix/{format}\": [\"200\", \"202\"],\n \"POST /route/matrix/sync/{format}\": [\"200\"],\n \"GET /route/directions/{format}\": [\"200\"],\n \"POST /route/directions/{format}\": [\"200\"],\n \"GET /route/range/{format}\": [\"200\"],\n \"GET /route/directions/batch/{format}\": [\"200\", \"202\"],\n \"POST /route/directions/batch/{format}\": [\"200\", \"202\"],\n \"POST /route/directions/batch/sync/{format}\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | RouteRequestRouteMatrixSync200Response\n | RouteRequestRouteMatrixSync408Response\n | RouteRequestRouteMatrixSyncDefaultResponse,\n): response is RouteRequestRouteMatrixSync408Response;\nexport function isUnexpected(\n response:\n | RouteGetRouteDirections200Response\n | RouteGetRouteDirectionsDefaultResponse,\n): response is RouteGetRouteDirectionsDefaultResponse;\nexport function isUnexpected(\n response:\n | RouteGetRouteDirectionsWithAdditionalParameters200Response\n | RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse,\n): response is RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse;\nexport function isUnexpected(\n response: RouteGetRouteRange200Response | RouteGetRouteRangeDefaultResponse,\n): response is RouteGetRouteRangeDefaultResponse;\nexport function isUnexpected(\n response:\n | RouteRequestRouteDirectionsBatchSync200Response\n | RouteRequestRouteDirectionsBatchSync408Response\n | RouteRequestRouteDirectionsBatchSyncDefaultResponse,\n): response is RouteRequestRouteDirectionsBatchSync408Response;\nexport function isUnexpected(\n response:\n | RouteRequestRouteMatrixSync200Response\n | RouteRequestRouteMatrixSync408Response\n | RouteRequestRouteMatrixSyncDefaultResponse\n | RouteGetRouteDirections200Response\n | RouteGetRouteDirectionsDefaultResponse\n | RouteGetRouteDirectionsWithAdditionalParameters200Response\n | RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse\n | RouteGetRouteRange200Response\n | RouteGetRouteRangeDefaultResponse\n | RouteRequestRouteDirectionsBatchSync200Response\n | RouteRequestRouteDirectionsBatchSync408Response\n | RouteRequestRouteDirectionsBatchSyncDefaultResponse,\n): response is\n | RouteRequestRouteMatrixSync408Response\n | RouteRequestRouteMatrixSyncDefaultResponse\n | RouteGetRouteDirectionsDefaultResponse\n | RouteGetRouteDirectionsWithAdditionalParametersDefaultResponse\n | RouteGetRouteRangeDefaultResponse\n | RouteRequestRouteDirectionsBatchSync408Response\n | RouteRequestRouteDirectionsBatchSyncDefaultResponse {\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 { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n CancelOnProgress,\n CreateHttpPollerOptions,\n RunningOperation,\n OperationResponse,\n OperationState,\n createHttpPoller,\n} from \"@azure/core-lro\";\n\n/**\n * A simple poller that can be used to poll a long running operation.\n */\nexport interface SimplePollerLike<\n TState extends OperationState<TResult>,\n TResult,\n> {\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Returns the state of the operation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: {\n abortSignal?: AbortSignalLike;\n }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n\n /**\n * Returns a promise that could be used for serialized version of the poller's operation\n * by invoking the operation's serialize method.\n */\n serialize(): Promise<string>;\n\n /**\n * Wait the poller to be submitted.\n */\n submitted(): Promise<void>;\n\n /**\n * Returns a string representation of the poller's operation. Similar to serialize but returns a string.\n * @deprecated Use serialize() instead.\n */\n toString(): string;\n\n /**\n * Stops the poller from continuing to poll. Please note this will only stop the client-side polling\n * @deprecated Use abortSignal to stop polling instead.\n */\n stopPolling(): void;\n\n /**\n * Returns true if the poller is stopped.\n * @deprecated Use abortSignal status to track this instead.\n */\n isStopped(): boolean;\n}\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport async function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {},\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {\n const abortController = new AbortController();\n const poller: RunningOperation<TResult> = {\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (\n path: string,\n pollOptions?: { abortSignal?: AbortSignalLike },\n ) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get({ abortSignal });\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] =\n initialResponse.request.url;\n return lroResponse;\n },\n };\n\n options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;\n const httpPoller = createHttpPoller(poller, options);\n const simplePoller: SimplePollerLike<OperationState<TResult>, TResult> = {\n isDone() {\n return httpPoller.isDone;\n },\n isStopped() {\n return abortController.signal.aborted;\n },\n getOperationState() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return httpPoller.operationState;\n },\n getResult() {\n return httpPoller.result;\n },\n toString() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return JSON.stringify({\n state: httpPoller.operationState,\n });\n },\n stopPolling() {\n abortController.abort();\n },\n onProgress: httpPoller.onProgress,\n poll: httpPoller.poll,\n pollUntilDone: httpPoller.pollUntilDone,\n serialize: httpPoller.serialize,\n submitted: httpPoller.submitted,\n };\n return simplePoller;\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult,\n): OperationResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(\n `Status code of the response is not a number. Value: ${response.status}`,\n );\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport function buildMultiCollection(\n items: string[],\n parameterName: string,\n): string {\n return items\n .map((item, index) => {\n if (index === 0) {\n return item;\n }\n return `${parameterName}=${item}`;\n })\n .join(\"&\");\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 { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsRouteClient } from \"../generated\";\nimport createClient from \"../generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsRouteClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRoute(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRouteClient;\n/**\n * Creates an instance of MapsRoute from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRoute(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRouteClient;\n/**\n * Creates an instance of MapsRoute from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRoute(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRouteClient;\nexport default function MapsRoute(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRouteClient {\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 type { LatLon } from \"@azure/maps-common\";\nimport type { BatchRequest, RouteGetRouteDirectionsQueryParamProperties } from \"../generated\";\n\nfunction toLatLonString(coordinates: LatLon): string {\n return `${coordinates[0]},${coordinates[1]}`;\n}\n\n/**\n * Transform an array of [Latitude, Longtitute] to a string in the following format:\n * \"Latitude_1,Longtitute_1:Latitude_2,Longtitute_2:...\"\n *\n * @param coordinates - An array of Latitude/Longtitute pair to transform.\n * @returns The transformed string.\n */\nexport function toColonDelimitedLatLonString(coordinates: LatLon[]): string {\n return coordinates.map((c) => toLatLonString(c)).join(\":\");\n}\n\n/**\n * Create a batch request body of a bunch of route direction requests.\n *\n * @param queryParamProperties - An object of the query parameters for a route direction request\n * @returns The composed batch request.\n */\nexport function createRouteDirectionsBatchRequest(\n queryParamProperties: RouteGetRouteDirectionsQueryParamProperties[],\n): BatchRequest {\n return {\n batchItems: queryParamProperties.map((queryParam) => ({\n query:\n \"?\" +\n Object.entries(queryParam)\n .map(([k, v]) => {\n // Skip if no value\n if (typeof v === \"undefined\" || v === null) {\n return \"\";\n }\n // Check name mappings: Array values\n if ((k === \"departAt\" || k === \"arriveAt\") && v instanceof Date) {\n return `${k}=${v.toISOString()}`;\n }\n return `${k}=${v}`;\n })\n .filter((s) => s !== \"\")\n .join(\"&\"),\n })),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRoute from \"./mapsRoute\";\n\nexport * from \"../generated\";\nexport * from \"./helpers\";\n\nexport default MapsRoute;\n"],"names":["createClientLogger","__rest","getClient","createHttpPoller","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,YAAY,CAAC;;ACJtD;AACA;AAaA;;;;AAIG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,KAA6D,EAAE,EAAA;;QAA/D,EAAE,UAAU,GAAG,KAAK,EAAA,GAAA,EAA2C,EAAtC,OAAO,GAAAC,YAAA,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C,CAAC,EAAE,EAAE;oBACd,mBAAmB;oBACnB,IAAI,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC3C,OAAO,EAAE,CAAC;oBACZ,CAAC;oBACD,oCAAoC;oBACpC,IAAI,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;wBAChE,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;oBACnC,CAAC;oBACD,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,CAAC,CAAC;qBACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;qBACvB,IAAI,CAAC,GAAG,CAAC;SACf,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport type { BatchRequest, RouteGetRouteDirectionsQueryParamProperties } from \"../generated\";\n\nfunction toLatLonString(coordinates: LatLon): string {\n return `${coordinates[0]},${coordinates[1]}`;\n}\n\n/**\n * Transform an array of [Latitude, Longtitute] to a string in the following format:\n * \"Latitude_1,Longtitute_1:Latitude_2,Longtitute_2:...\"\n *\n * @param coordinates - An array of Latitude/Longtitute pair to transform.\n * @returns The transformed string.\n */\nexport function toColonDelimitedLatLonString(coordinates: LatLon[]): string {\n return coordinates.map((c) => toLatLonString(c)).join(\":\");\n}\n\n/**\n * Create a batch request body of a bunch of route direction requests.\n *\n * @param queryParamProperties - An object of the query parameters for a route direction request\n * @returns The composed batch request.\n */\nexport function createRouteDirectionsBatchRequest(\n queryParamProperties: RouteGetRouteDirectionsQueryParamProperties[],\n): BatchRequest {\n return {\n batchItems: queryParamProperties.map((queryParam) => ({\n query:\n \"?\" +\n Object.entries(queryParam)\n .map(([k, v]) => {\n // Skip if no value\n if (typeof v === \"undefined\" || v === null) {\n return \"\";\n }\n // Check name mappings: Array values\n if ((k === \"departAt\" || k === \"arriveAt\") && v instanceof Date) {\n return `${k}=${v.toISOString()}`;\n }\n return `${k}=${v}`;\n })\n .filter((s) => s !== \"\")\n .join(\"&\"),\n })),\n };\n}\n"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
3
|
import MapsRoute from "./mapsRoute";
|
|
4
|
-
export * from "
|
|
4
|
+
export * from "../generated";
|
|
5
5
|
export * from "./helpers";
|
|
6
6
|
export default MapsRoute;
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAE1B,eAAe,SAAS,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRoute from \"./mapsRoute\";\n\nexport * from \"../generated\";\nexport * from \"./helpers\";\n\nexport default MapsRoute;\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
3
|
-
import { isTokenCredential } from "@azure/core-auth";
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { isSASCredential, isTokenCredential } from "@azure/core-auth";
|
|
4
4
|
import { createMapsClientIdPolicy } from "@azure/maps-common";
|
|
5
|
-
import createClient from "
|
|
5
|
+
import createClient from "../generated";
|
|
6
6
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
7
7
|
export default function MapsRoute(credential, clientIdOrOptions = {}, maybeOptions = {}) {
|
|
8
8
|
const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
|
|
9
9
|
/**
|
|
10
|
-
* maps service requires a header "ms-x-client-id", which is different from the standard
|
|
10
|
+
* maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
|
|
11
11
|
* So we need to do our own implementation.
|
|
12
12
|
* This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
|
|
13
13
|
*/
|
|
@@ -19,11 +19,22 @@ export default function MapsRoute(credential, clientIdOrOptions = {}, maybeOptio
|
|
|
19
19
|
const client = createClient(undefined, options);
|
|
20
20
|
client.pipeline.addPolicy(bearerTokenAuthenticationPolicy({
|
|
21
21
|
credential,
|
|
22
|
-
scopes:
|
|
22
|
+
scopes: "https://atlas.microsoft.com/.default",
|
|
23
23
|
}));
|
|
24
24
|
client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));
|
|
25
25
|
return client;
|
|
26
26
|
}
|
|
27
|
+
if (isSASCredential(credential)) {
|
|
28
|
+
const client = createClient(undefined, options);
|
|
29
|
+
client.pipeline.addPolicy({
|
|
30
|
+
name: "mapsSASCredentialPolicy",
|
|
31
|
+
async sendRequest(request, next) {
|
|
32
|
+
request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
|
|
33
|
+
return next(request);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return client;
|
|
37
|
+
}
|
|
27
38
|
return createClient(credential, options);
|
|
28
39
|
}
|
|
29
40
|
//# sourceMappingURL=mapsRoute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapsRoute.js","sourceRoot":"","sources":["../../src/mapsRo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AAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;gBACxE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport type { AzureKeyCredential, AzureSASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsRouteClient } from \"../generated\";\nimport createClient from \"../generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsRouteClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRoute(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRouteClient;\n/**\n * Creates an instance of MapsRoute from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRoute(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRouteClient;\n/**\n * Creates an instance of MapsRoute from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRoute from \"@azure-rest/maps-route\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRoute(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsRoute(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRouteClient;\nexport default function MapsRoute(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRouteClient {\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-route",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-beta.
|
|
5
|
+
"version": "1.0.0-beta.4",
|
|
6
6
|
"description": "A client library for Azure Maps maps-route",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -52,79 +52,75 @@
|
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
|
-
"node": ">=
|
|
55
|
+
"node": ">=18.0.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
|
-
"
|
|
59
|
-
"build:browser": "tsc -p . &&
|
|
60
|
-
"build:
|
|
58
|
+
"build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
|
|
59
|
+
"build:browser": "tsc -p . && dev-tool run bundle",
|
|
60
|
+
"build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
|
|
61
|
+
"build:node": "tsc -p . && dev-tool run bundle --browser-test false",
|
|
61
62
|
"build:samples": "dev-tool samples publish --force",
|
|
62
63
|
"build:test": "tsc -p . && dev-tool run bundle",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
64
|
+
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
65
|
+
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
66
66
|
"execute:samples": "dev-tool samples run samples-dev",
|
|
67
|
-
"extract-api": "rimraf review && mkdirp ./review &&
|
|
68
|
-
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
67
|
+
"extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
|
|
68
|
+
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
69
69
|
"generate:client": "autorest --typescript swagger/README.md && npm run format",
|
|
70
|
+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
70
71
|
"integration-test:browser": "dev-tool run test:browser",
|
|
71
72
|
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
|
|
72
|
-
"
|
|
73
|
-
"lint:fix": "eslint package.json api-extractor.json src test --
|
|
74
|
-
"lint": "eslint package.json api-extractor.json src test --ext .ts",
|
|
73
|
+
"lint": "eslint package.json api-extractor.json src test",
|
|
74
|
+
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
|
|
75
75
|
"pack": "npm pack 2>&1",
|
|
76
|
+
"test": "npm run clean && npm run build:test && npm run unit-test",
|
|
76
77
|
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
|
|
77
78
|
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
|
|
78
|
-
"test": "npm run clean && npm run build:test && npm run unit-test",
|
|
79
79
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
80
|
-
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
81
80
|
"unit-test:browser": "dev-tool run test:browser",
|
|
82
|
-
"
|
|
81
|
+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
82
|
+
"update-snippets": "echo skipped"
|
|
83
83
|
},
|
|
84
84
|
"sideEffects": false,
|
|
85
85
|
"autoPublish": false,
|
|
86
86
|
"dependencies": {
|
|
87
|
+
"@azure-rest/core-client": "^1.0.0",
|
|
87
88
|
"@azure/core-auth": "^1.3.0",
|
|
88
|
-
"@azure
|
|
89
|
+
"@azure/core-lro": "^3.1.0",
|
|
89
90
|
"@azure/core-rest-pipeline": "^1.8.0",
|
|
90
91
|
"@azure/logger": "^1.0.0",
|
|
91
|
-
"@azure/core-lro": "^2.2.0",
|
|
92
92
|
"@azure/maps-common": "1.0.0-beta.2",
|
|
93
|
-
"tslib": "^2.4.0"
|
|
93
|
+
"tslib": "^2.4.0",
|
|
94
|
+
"@azure/abort-controller": "^2.1.2"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
|
-
"@microsoft/api-extractor": "^7.31.1",
|
|
97
|
-
"autorest": "latest",
|
|
98
|
-
"@types/node": "^14.0.0",
|
|
99
|
-
"dotenv": "^16.0.0",
|
|
100
|
-
"eslint": "^8.0.0",
|
|
101
|
-
"mkdirp": "^1.0.4",
|
|
102
|
-
"prettier": "^2.5.1",
|
|
103
|
-
"rimraf": "^3.0.0",
|
|
104
|
-
"source-map-support": "^0.5.9",
|
|
105
|
-
"typescript": "~5.0.0",
|
|
106
|
-
"@azure/dev-tool": "^1.0.0",
|
|
107
|
-
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
108
97
|
"@azure-tools/test-credential": "^1.0.0",
|
|
109
|
-
"@azure/identity": "^2.0.1",
|
|
110
98
|
"@azure-tools/test-recorder": "^3.0.0",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
99
|
+
"@azure/dev-tool": "^1.0.0",
|
|
100
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
101
|
+
"@azure/identity": "^4.0.1",
|
|
114
102
|
"@types/chai": "^4.2.8",
|
|
103
|
+
"@types/mocha": "^10.0.0",
|
|
104
|
+
"@types/node": "^18.0.0",
|
|
105
|
+
"autorest": "latest",
|
|
115
106
|
"chai": "^4.2.0",
|
|
107
|
+
"dotenv": "^16.0.0",
|
|
108
|
+
"eslint": "^9.9.0",
|
|
109
|
+
"karma": "^6.2.0",
|
|
116
110
|
"karma-chrome-launcher": "^3.0.0",
|
|
117
111
|
"karma-coverage": "^2.0.0",
|
|
118
112
|
"karma-env-preprocessor": "^0.1.1",
|
|
119
113
|
"karma-firefox-launcher": "^1.1.0",
|
|
120
114
|
"karma-junit-reporter": "^2.0.1",
|
|
121
|
-
"karma-mocha-reporter": "^2.2.5",
|
|
122
115
|
"karma-mocha": "^2.0.1",
|
|
116
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
123
117
|
"karma-source-map-support": "~1.4.0",
|
|
124
118
|
"karma-sourcemap-loader": "^0.3.8",
|
|
125
|
-
"
|
|
126
|
-
"nyc": "^
|
|
127
|
-
"
|
|
119
|
+
"mocha": "^10.0.0",
|
|
120
|
+
"nyc": "^17.0.0",
|
|
121
|
+
"source-map-support": "^0.5.9",
|
|
122
|
+
"ts-node": "^10.0.0",
|
|
123
|
+
"typescript": "~5.6.2"
|
|
128
124
|
},
|
|
129
125
|
"browser": {
|
|
130
126
|
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
|