@azure-rest/maps-route 1.0.0-beta.3 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,SAAS,cAAc,CAAC,WAAmB;IACzC,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,WAAqB;IAChE,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAC/C,oBAAmE;IAEnE,OAAO;QACL,UAAU,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACpD,KAAK,EACH,GAAG;gBACH,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;qBACvB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;oBACd,mBAAmB;oBACnB,IAAI,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,EAAE;wBAC1C,OAAO,EAAE,CAAC;qBACX;oBACD,oCAAoC;oBACpC,IAAI,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE;wBAC/D,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;qBAClC;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 { 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"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,SAAS,cAAc,CAAC,WAAmB;IACzC,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,WAAqB;IAChE,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAC/C,oBAAmE;IAEnE,OAAO;QACL,UAAU,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACpD,KAAK,EACH,GAAG;gBACH,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;qBACvB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,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"]}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import MapsRoute from "./mapsRoute";
4
- export * from "./generated";
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,aAAa,CAAC;AAC5B,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
+ {"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 license.
3
- import { isSASCredential, 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 "./generated";
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 AAD.
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,7 +19,7 @@ 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: `${options.baseUrl || "https://atlas.microsoft.com"}/.default`,
22
+ scopes: "https://atlas.microsoft.com/.default",
23
23
  }));
24
24
  client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));
25
25
  return client;
@@ -1 +1 @@
1
- {"version":3,"file":"mapsRoute.js","sourceRoot":"","sources":["../../src/mapsRoute.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAIL,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AA6D5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,UAAqE,EACrE,oBAA4C,EAAE,EAC9C,eAA8B,EAAE;IAEhC,MAAM,OAAO,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEzF;;;;OAIG;IACH,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE;QACjC,MAAM,QAAQ,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,KAAK,CAAC,yCAAyC,CAAC,CAAC;SACxD;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,+BAA+B,CAAC;YAC9B,UAAU;YACV,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,WAAW;SACvE,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;KACf;IAED,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE;QAC/B,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;KACf;IAED,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport {\n AzureKeyCredential,\n AzureSASCredential,\n TokenCredential,\n isSASCredential,\n isTokenCredential,\n} 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-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 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\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"]}
1
+ {"version":3,"file":"mapsRoute.js","sourceRoot":"","sources":["../../src/mapsRoute.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AA6D5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,UAAqE,EACrE,oBAA4C,EAAE,EAC9C,eAA8B,EAAE;IAEhC,MAAM,OAAO,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEzF;;;;OAIG;IACH,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,+BAA+B,CAAC;YAC9B,UAAU;YACV,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;gBACxE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport type { AzureKeyCredential, AzureSASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { 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.3",
5
+ "version": "1.0.0-beta.4",
6
6
  "description": "A client library for Azure Maps maps-route",
7
7
  "keywords": [
8
8
  "node",
@@ -55,76 +55,72 @@
55
55
  "node": ">=18.0.0"
56
56
  },
57
57
  "scripts": {
58
- "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
58
+ "build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
59
59
  "build:browser": "tsc -p . && dev-tool run bundle",
60
+ "build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
60
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
- "build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
64
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": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
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 && api-extractor run --local",
67
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
68
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
- "integration-test": "npm run integration-test:node && npm run integration-test:browser",
73
- "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
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
- "build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local"
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/core-auth": "^1.3.0",
88
87
  "@azure-rest/core-client": "^1.0.0",
88
+ "@azure/core-auth": "^1.3.0",
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": "^18.0.0",
99
- "dotenv": "^16.0.0",
100
- "eslint": "^8.0.0",
101
- "mkdirp": "^1.0.4",
102
- "rimraf": "^3.0.0",
103
- "source-map-support": "^0.5.9",
104
- "typescript": "~5.2.0",
105
- "@azure/dev-tool": "^1.0.0",
106
- "@azure/eslint-plugin-azure-sdk": "^3.0.0",
107
97
  "@azure-tools/test-credential": "^1.0.0",
108
- "@azure/identity": "^3.3.0",
109
98
  "@azure-tools/test-recorder": "^3.0.0",
110
- "mocha": "^10.0.0",
111
- "cross-env": "^7.0.2",
99
+ "@azure/dev-tool": "^1.0.0",
100
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
101
+ "@azure/identity": "^4.0.1",
112
102
  "@types/chai": "^4.2.8",
103
+ "@types/mocha": "^10.0.0",
104
+ "@types/node": "^18.0.0",
105
+ "autorest": "latest",
113
106
  "chai": "^4.2.0",
107
+ "dotenv": "^16.0.0",
108
+ "eslint": "^9.9.0",
109
+ "karma": "^6.2.0",
114
110
  "karma-chrome-launcher": "^3.0.0",
115
111
  "karma-coverage": "^2.0.0",
116
112
  "karma-env-preprocessor": "^0.1.1",
117
113
  "karma-firefox-launcher": "^1.1.0",
118
114
  "karma-junit-reporter": "^2.0.1",
119
- "karma-mocha-reporter": "^2.2.5",
120
115
  "karma-mocha": "^2.0.1",
116
+ "karma-mocha-reporter": "^2.2.5",
121
117
  "karma-source-map-support": "~1.4.0",
122
118
  "karma-sourcemap-loader": "^0.3.8",
123
- "karma": "^6.2.0",
124
- "c8": "^8.0.0",
125
- "@types/mocha": "^10.0.0",
119
+ "mocha": "^10.0.0",
120
+ "nyc": "^17.0.0",
121
+ "source-map-support": "^0.5.9",
126
122
  "ts-node": "^10.0.0",
127
- "esm": "^3.2.18"
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"
@@ -4,19 +4,20 @@
4
4
 
5
5
  ```ts
6
6
 
7
- import { AzureKeyCredential } from '@azure/core-auth';
8
- import { AzureSASCredential } from '@azure/core-auth';
7
+ import { AbortSignalLike } from '@azure/abort-controller';
8
+ import type { AzureKeyCredential } from '@azure/core-auth';
9
+ import type { AzureSASCredential } from '@azure/core-auth';
10
+ import { CancelOnProgress } from '@azure/core-lro';
9
11
  import { Client } from '@azure-rest/core-client';
10
12
  import { ClientOptions } from '@azure-rest/core-client';
13
+ import { CreateHttpPollerOptions } from '@azure/core-lro';
11
14
  import { HttpResponse } from '@azure-rest/core-client';
12
- import { LatLon } from '@azure/maps-common';
13
- import { LroEngineOptions } from '@azure/core-lro';
14
- import { PollerLike } from '@azure/core-lro';
15
- import { PollOperationState } from '@azure/core-lro';
15
+ import type { LatLon } from '@azure/maps-common';
16
+ import { OperationState } from '@azure/core-lro';
16
17
  import { RawHttpHeaders } from '@azure/core-rest-pipeline';
17
18
  import { RequestParameters } from '@azure-rest/core-client';
18
19
  import { StreamableMethod } from '@azure-rest/core-client';
19
- import { TokenCredential } from '@azure/core-auth';
20
+ import type { TokenCredential } from '@azure/core-auth';
20
21
 
21
22
  // @public
22
23
  export interface BatchRequest {
@@ -30,33 +31,36 @@ export interface BatchRequestItem {
30
31
 
31
32
  // @public
32
33
  export interface BatchResultItemOutput {
33
- statusCode: number;
34
+ readonly statusCode: number;
34
35
  }
35
36
 
36
37
  // @public
37
38
  export interface BatchResultOutput {
38
- summary: BatchResultSummaryOutput;
39
+ readonly summary: BatchResultSummaryOutput;
39
40
  }
40
41
 
41
42
  // @public
42
43
  export interface BatchResultSummaryOutput {
43
- successfulRequests: number;
44
- totalRequests: number;
44
+ readonly successfulRequests: number;
45
+ readonly totalRequests: number;
45
46
  }
46
47
 
48
+ // @public (undocumented)
49
+ export function buildMultiCollection(items: string[], parameterName: string): string;
50
+
47
51
  // @public
48
52
  export function createRouteDirectionsBatchRequest(queryParamProperties: RouteGetRouteDirectionsQueryParamProperties[]): BatchRequest;
49
53
 
50
54
  // @public
51
55
  export interface EffectiveSettingOutput {
52
- key: string;
53
- value: string;
56
+ readonly key: string;
57
+ readonly value: string;
54
58
  }
55
59
 
56
60
  // @public
57
61
  export interface ErrorDetailOutput {
58
- code?: string;
59
- message?: string;
62
+ readonly code?: string;
63
+ readonly message?: string;
60
64
  }
61
65
 
62
66
  // @public
@@ -185,7 +189,7 @@ export interface GeoJsonPolygonData {
185
189
  }
186
190
 
187
191
  // @public
188
- export function getLongRunningPoller<TResult extends HttpResponse>(client: Client, initialResponse: TResult, options?: LroEngineOptions<TResult, PollOperationState<TResult>>): PollerLike<PollOperationState<TResult>, TResult>;
192
+ export function getLongRunningPoller<TResult extends HttpResponse>(client: Client, initialResponse: TResult, options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;
189
193
 
190
194
  // @public (undocumented)
191
195
  export interface GetRouteDirections {
@@ -234,6 +238,11 @@ export type MapsRouteClient = Client & {
234
238
  path: Routes;
235
239
  };
236
240
 
241
+ // @public
242
+ export interface MapsRouteClientOptions extends ClientOptions {
243
+ apiVersion?: string;
244
+ }
245
+
237
246
  // @public (undocumented)
238
247
  export interface RequestRouteDirectionsBatch {
239
248
  get(options?: RouteGetRouteDirectionsBatchParameters): StreamableMethod<RouteGetRouteDirectionsBatch200Response | RouteGetRouteDirectionsBatch202Response>;
@@ -266,7 +275,7 @@ export interface RouteDirectionParameters {
266
275
 
267
276
  // @public
268
277
  export interface RouteDirectionsBatchItemOutput extends BatchResultItemOutput {
269
- response: RouteDirectionsBatchItemResponseOutput;
278
+ readonly response: RouteDirectionsBatchItemResponseOutput;
270
279
  }
271
280
 
272
281
  // @public
@@ -275,15 +284,15 @@ export interface RouteDirectionsBatchItemResponseOutput extends RouteDirectionsO
275
284
 
276
285
  // @public
277
286
  export interface RouteDirectionsBatchResultOutput extends BatchResultOutput {
278
- batchItems: Array<RouteDirectionsBatchItemOutput>;
287
+ readonly batchItems: Array<RouteDirectionsBatchItemOutput>;
279
288
  }
280
289
 
281
290
  // @public
282
291
  export interface RouteDirectionsOutput {
283
- formatVersion?: string;
284
- optimizedWaypoints?: Array<RouteOptimizedWaypointOutput>;
292
+ readonly formatVersion?: string;
293
+ readonly optimizedWaypoints?: Array<RouteOptimizedWaypointOutput>;
285
294
  report?: RouteReportOutput;
286
- routes: Array<RouteOutput>;
295
+ readonly routes: Array<RouteOutput>;
287
296
  }
288
297
 
289
298
  // @public
@@ -309,8 +318,6 @@ export interface RouteGetRouteDirectionsBatch202Headers {
309
318
 
310
319
  // @public
311
320
  export interface RouteGetRouteDirectionsBatch202Response extends HttpResponse {
312
- // (undocumented)
313
- body: Record<string, unknown>;
314
321
  // (undocumented)
315
322
  headers: RawHttpHeaders & RouteGetRouteDirectionsBatch202Headers;
316
323
  // (undocumented)
@@ -366,7 +373,7 @@ export interface RouteGetRouteDirectionsQueryParamProperties {
366
373
  report?: "effectiveSettings";
367
374
  routeRepresentation?: "polyline" | "summaryOnly" | "none";
368
375
  routeType?: "fastest" | "shortest" | "eco" | "thrilling";
369
- sectionType?: "carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban";
376
+ sectionType?: Array<"carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban">;
370
377
  traffic?: boolean;
371
378
  travelMode?: "car" | "truck" | "taxi" | "bus" | "van" | "motorcycle" | "bicycle" | "pedestrian";
372
379
  uphillEfficiency?: number;
@@ -447,7 +454,7 @@ export interface RouteGetRouteDirectionsWithAdditionalParametersQueryParamProper
447
454
  report?: "effectiveSettings";
448
455
  routeRepresentation?: "polyline" | "summaryOnly" | "none";
449
456
  routeType?: "fastest" | "shortest" | "eco" | "thrilling";
450
- sectionType?: "carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban";
457
+ sectionType?: Array<"carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban">;
451
458
  traffic?: boolean;
452
459
  travelMode?: "car" | "truck" | "taxi" | "bus" | "van" | "motorcycle" | "bicycle" | "pedestrian";
453
460
  uphillEfficiency?: number;
@@ -479,8 +486,6 @@ export interface RouteGetRouteMatrix202Headers {
479
486
 
480
487
  // @public
481
488
  export interface RouteGetRouteMatrix202Response extends HttpResponse {
482
- // (undocumented)
483
- body: Record<string, unknown>;
484
489
  // (undocumented)
485
490
  headers: RawHttpHeaders & RouteGetRouteMatrix202Headers;
486
491
  // (undocumented)
@@ -554,51 +559,51 @@ export interface RouteGetRouteRangeQueryParamProperties {
554
559
 
555
560
  // @public
556
561
  export interface RouteGuidanceOutput {
557
- instructionGroups: Array<RouteInstructionGroupOutput>;
558
- instructions: Array<RouteInstructionOutput>;
562
+ readonly instructionGroups: Array<RouteInstructionGroupOutput>;
563
+ readonly instructions: Array<RouteInstructionOutput>;
559
564
  }
560
565
 
561
566
  // @public
562
567
  export interface RouteInstructionGroupOutput {
563
- firstInstructionIndex?: number;
564
- groupLengthInMeters?: number;
565
- groupMessage?: string;
566
- lastInstructionIndex?: number;
568
+ readonly firstInstructionIndex?: number;
569
+ readonly groupLengthInMeters?: number;
570
+ readonly groupMessage?: string;
571
+ readonly lastInstructionIndex?: number;
567
572
  }
568
573
 
569
574
  // @public
570
575
  export interface RouteInstructionOutput {
571
- combinedMessage?: string;
572
- countryCode?: string;
573
- drivingSide?: "LEFT" | "RIGHT";
574
- exitNumber?: string;
576
+ readonly combinedMessage?: string;
577
+ readonly countryCode?: string;
578
+ readonly drivingSide?: "LEFT" | "RIGHT";
579
+ readonly exitNumber?: string;
575
580
  instructionType?: "TURN" | "ROAD_CHANGE" | "LOCATION_DEPARTURE" | "LOCATION_ARRIVAL" | "DIRECTION_INFO" | "LOCATION_WAYPOINT";
576
- junctionType?: "REGULAR" | "ROUNDABOUT" | "BIFURCATION";
577
- maneuver?: "ARRIVE" | "ARRIVE_LEFT" | "ARRIVE_RIGHT" | "DEPART" | "STRAIGHT" | "KEEP_RIGHT" | "BEAR_RIGHT" | "TURN_RIGHT" | "SHARP_RIGHT" | "KEEP_LEFT" | "BEAR_LEFT" | "TURN_LEFT" | "SHARP_LEFT" | "MAKE_UTURN" | "ENTER_MOTORWAY" | "ENTER_FREEWAY" | "ENTER_HIGHWAY" | "TAKE_EXIT" | "MOTORWAY_EXIT_LEFT" | "MOTORWAY_EXIT_RIGHT" | "TAKE_FERRY" | "ROUNDABOUT_CROSS" | "ROUNDABOUT_RIGHT" | "ROUNDABOUT_LEFT" | "ROUNDABOUT_BACK" | "TRY_MAKE_UTURN" | "FOLLOW" | "SWITCH_PARALLEL_ROAD" | "SWITCH_MAIN_ROAD" | "ENTRANCE_RAMP" | "WAYPOINT_LEFT" | "WAYPOINT_RIGHT" | "WAYPOINT_REACHED";
578
- message?: string;
581
+ readonly junctionType?: "REGULAR" | "ROUNDABOUT" | "BIFURCATION";
582
+ readonly maneuver?: "ARRIVE" | "ARRIVE_LEFT" | "ARRIVE_RIGHT" | "DEPART" | "STRAIGHT" | "KEEP_RIGHT" | "BEAR_RIGHT" | "TURN_RIGHT" | "SHARP_RIGHT" | "KEEP_LEFT" | "BEAR_LEFT" | "TURN_LEFT" | "SHARP_LEFT" | "MAKE_UTURN" | "ENTER_MOTORWAY" | "ENTER_FREEWAY" | "ENTER_HIGHWAY" | "TAKE_EXIT" | "MOTORWAY_EXIT_LEFT" | "MOTORWAY_EXIT_RIGHT" | "TAKE_FERRY" | "ROUNDABOUT_CROSS" | "ROUNDABOUT_RIGHT" | "ROUNDABOUT_LEFT" | "ROUNDABOUT_BACK" | "TRY_MAKE_UTURN" | "FOLLOW" | "SWITCH_PARALLEL_ROAD" | "SWITCH_MAIN_ROAD" | "ENTRANCE_RAMP" | "WAYPOINT_LEFT" | "WAYPOINT_RIGHT" | "WAYPOINT_REACHED";
583
+ readonly message?: string;
579
584
  point?: LatLongPairOutput;
580
- pointIndex?: number;
581
- possibleCombineWithNext?: boolean;
582
- roadNumbers?: Array<string>;
583
- roundaboutExitNumber?: string;
584
- routeOffsetInMeters?: number;
585
- signpostText?: string;
586
- stateCode?: string;
587
- street?: string;
588
- travelTimeInSeconds?: number;
589
- turnAngleInDecimalDegrees?: number;
585
+ readonly pointIndex?: number;
586
+ readonly possibleCombineWithNext?: boolean;
587
+ readonly roadNumbers?: Array<string>;
588
+ readonly roundaboutExitNumber?: number;
589
+ readonly routeOffsetInMeters?: number;
590
+ readonly signpostText?: string;
591
+ readonly stateCode?: string;
592
+ readonly street?: string;
593
+ readonly travelTimeInSeconds?: number;
594
+ readonly turnAngleInDecimalDegrees?: number;
590
595
  }
591
596
 
592
597
  // @public
593
598
  export interface RouteLegOutput {
594
- points: Array<LatLongPairOutput>;
595
- summary: RouteSummaryOutput;
599
+ readonly points: Array<LatLongPairOutput>;
600
+ readonly summary: RouteSummaryOutput;
596
601
  }
597
602
 
598
603
  // @public
599
604
  export interface RouteMatrixOutput {
600
- response?: RouteMatrixResultResponseOutput;
601
- statusCode: number;
605
+ readonly response?: RouteMatrixResultResponseOutput;
606
+ readonly statusCode: number;
602
607
  }
603
608
 
604
609
  // @public
@@ -609,52 +614,52 @@ export interface RouteMatrixQuery {
609
614
 
610
615
  // @public
611
616
  export interface RouteMatrixResultOutput {
612
- formatVersion?: string;
613
- matrix: Array<Array<RouteMatrixOutput>>;
614
- summary: RouteMatrixSummaryOutput;
617
+ readonly formatVersion?: string;
618
+ readonly matrix: Array<Array<RouteMatrixOutput>>;
619
+ readonly summary: RouteMatrixSummaryOutput;
615
620
  }
616
621
 
617
622
  // @public
618
623
  export interface RouteMatrixResultResponseOutput {
619
- routeSummary?: RouteSummaryOutput;
624
+ readonly routeSummary?: RouteSummaryOutput;
620
625
  }
621
626
 
622
627
  // @public
623
628
  export interface RouteMatrixSummaryOutput {
624
- successfulRoutes: number;
625
- totalRoutes: number;
629
+ readonly successfulRoutes: number;
630
+ readonly totalRoutes: number;
626
631
  }
627
632
 
628
633
  // @public
629
634
  export interface RouteOptimizedWaypointOutput {
630
- optimizedIndex: number;
631
- providedIndex: number;
635
+ readonly optimizedIndex: number;
636
+ readonly providedIndex: number;
632
637
  }
633
638
 
634
639
  // @public (undocumented)
635
640
  export interface RouteOutput {
636
- guidance?: RouteGuidanceOutput;
637
- legs: Array<RouteLegOutput>;
638
- sections?: Array<RouteSectionOutput>;
639
- summary: RouteSummaryOutput;
641
+ readonly guidance?: RouteGuidanceOutput;
642
+ readonly legs: Array<RouteLegOutput>;
643
+ readonly sections?: Array<RouteSectionOutput>;
644
+ readonly summary: RouteSummaryOutput;
640
645
  }
641
646
 
642
647
  // @public
643
648
  export interface RouteRangeOutput {
644
- boundary: Array<LatLongPairOutput>;
649
+ readonly boundary: Array<LatLongPairOutput>;
645
650
  center: LatLongPairOutput;
646
651
  }
647
652
 
648
653
  // @public
649
654
  export interface RouteRangeResultOutput {
650
- formatVersion?: string;
655
+ readonly formatVersion?: string;
651
656
  reachableRange: RouteRangeOutput;
652
657
  report?: RouteReportOutput;
653
658
  }
654
659
 
655
660
  // @public
656
661
  export interface RouteReportOutput {
657
- effectiveSettings: Array<EffectiveSettingOutput>;
662
+ readonly effectiveSettings: Array<EffectiveSettingOutput>;
658
663
  }
659
664
 
660
665
  // @public
@@ -672,8 +677,6 @@ export interface RouteRequestRouteDirectionsBatch202Headers {
672
677
 
673
678
  // @public
674
679
  export interface RouteRequestRouteDirectionsBatch202Response extends HttpResponse {
675
- // (undocumented)
676
- body: Record<string, unknown>;
677
680
  // (undocumented)
678
681
  headers: RawHttpHeaders & RouteRequestRouteDirectionsBatch202Headers;
679
682
  // (undocumented)
@@ -745,8 +748,6 @@ export interface RouteRequestRouteMatrix202Headers {
745
748
 
746
749
  // @public
747
750
  export interface RouteRequestRouteMatrix202Response extends HttpResponse {
748
- // (undocumented)
749
- body: Record<string, unknown>;
750
751
  // (undocumented)
751
752
  headers: RawHttpHeaders & RouteRequestRouteMatrix202Headers;
752
753
  // (undocumented)
@@ -780,7 +781,7 @@ export interface RouteRequestRouteMatrixQueryParamProperties {
780
781
  departAt?: Date | string;
781
782
  hilliness?: "low" | "normal" | "high";
782
783
  routeType?: "fastest" | "shortest" | "eco" | "thrilling";
783
- sectionType?: "carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban";
784
+ sectionType?: Array<"carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban">;
784
785
  traffic?: boolean;
785
786
  travelMode?: "car" | "truck" | "taxi" | "bus" | "van" | "motorcycle" | "bicycle" | "pedestrian";
786
787
  vehicleAxleWeight?: number;
@@ -845,7 +846,7 @@ export interface RouteRequestRouteMatrixSyncQueryParamProperties {
845
846
  departAt?: Date | string;
846
847
  hilliness?: "low" | "normal" | "high";
847
848
  routeType?: "fastest" | "shortest" | "eco" | "thrilling";
848
- sectionType?: "carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban";
849
+ sectionType?: Array<"carTrain" | "country" | "ferry" | "motorway" | "pedestrian" | "tollRoad" | "tollVignette" | "traffic" | "travelMode" | "tunnel" | "carpool" | "urban">;
849
850
  traffic?: boolean;
850
851
  travelMode?: "car" | "truck" | "taxi" | "bus" | "van" | "motorcycle" | "bicycle" | "pedestrian";
851
852
  vehicleAxleWeight?: number;
@@ -871,36 +872,58 @@ export interface Routes {
871
872
 
872
873
  // @public
873
874
  export interface RouteSectionOutput {
874
- delayInSeconds?: number;
875
- effectiveSpeedInKmh?: number;
876
- endPointIndex: number;
877
- magnitudeOfDelay?: "0" | "1" | "2" | "3" | "4";
878
- sectionType: "CAR_TRAIN" | "COUNTRY" | "FERRY" | "MOTORWAY" | "PEDESTRIAN" | "TOLL_ROAD" | "TOLL_VIGNETTE" | "TRAFFIC" | "TRAVEL_MODE" | "TUNNEL" | "CARPOOL" | "URBAN";
879
- simpleCategory?: "JAM" | "ROAD_WORK" | "ROAD_CLOSURE" | "OTHER";
880
- startPointIndex: number;
875
+ readonly delayInSeconds?: number;
876
+ readonly effectiveSpeedInKmh?: number;
877
+ readonly endPointIndex: number;
878
+ readonly magnitudeOfDelay?: "0" | "1" | "2" | "3" | "4";
879
+ readonly sectionType: "CAR_TRAIN" | "COUNTRY" | "FERRY" | "MOTORWAY" | "PEDESTRIAN" | "TOLL_ROAD" | "TOLL_VIGNETTE" | "TRAFFIC" | "TRAVEL_MODE" | "TUNNEL" | "CARPOOL" | "URBAN";
880
+ readonly simpleCategory?: "JAM" | "ROAD_WORK" | "ROAD_CLOSURE" | "OTHER";
881
+ readonly startPointIndex: number;
881
882
  tec?: RouteSectionTecOutput;
882
- travelMode?: "car" | "truck" | "taxi" | "bus" | "van" | "motorcycle" | "bicycle" | "pedestrian" | "other";
883
+ readonly travelMode?: "car" | "truck" | "taxi" | "bus" | "van" | "motorcycle" | "bicycle" | "pedestrian" | "other";
883
884
  }
884
885
 
885
886
  // @public
886
887
  export interface RouteSectionTecCauseOutput {
887
- mainCauseCode?: number;
888
- subCauseCode?: number;
888
+ readonly mainCauseCode?: number;
889
+ readonly subCauseCode?: number;
889
890
  }
890
891
 
891
892
  // @public
892
893
  export interface RouteSectionTecOutput {
893
894
  causes?: Array<RouteSectionTecCauseOutput>;
894
- effectCode?: number;
895
+ readonly effectCode?: number;
895
896
  }
896
897
 
897
898
  // @public
898
899
  export interface RouteSummaryOutput {
899
- arrivalTime: string;
900
- departureTime: string;
901
- lengthInMeters: number;
902
- trafficDelayInSeconds: number;
903
- travelTimeInSeconds: number;
900
+ readonly arrivalTime: string;
901
+ readonly departureTime: string;
902
+ readonly lengthInMeters: number;
903
+ readonly trafficDelayInSeconds: number;
904
+ readonly travelTimeInSeconds: number;
905
+ }
906
+
907
+ // @public
908
+ export interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {
909
+ getOperationState(): TState;
910
+ getResult(): TResult | undefined;
911
+ isDone(): boolean;
912
+ // @deprecated
913
+ isStopped(): boolean;
914
+ onProgress(callback: (state: TState) => void): CancelOnProgress;
915
+ poll(options?: {
916
+ abortSignal?: AbortSignalLike;
917
+ }): Promise<TState>;
918
+ pollUntilDone(pollOptions?: {
919
+ abortSignal?: AbortSignalLike;
920
+ }): Promise<TResult>;
921
+ serialize(): Promise<string>;
922
+ // @deprecated
923
+ stopPolling(): void;
924
+ submitted(): Promise<void>;
925
+ // @deprecated
926
+ toString(): string;
904
927
  }
905
928
 
906
929
  // @public