@azure-rest/arm-compute 1.0.0-alpha.20231207.1 → 1.0.0-alpha.20240115.1

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.
@@ -6,18 +6,23 @@ import { getClient } from "@azure-rest/core-client";
6
6
  * @param credentials type: TokenCredential
7
7
  */
8
8
  export default function createClient(credentials, options = {}) {
9
- var _a;
10
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `https://management.azure.com`;
11
- options = Object.assign(Object.assign({}, options), { credentials: {
9
+ const baseUrl = options.baseUrl ?? `https://management.azure.com`;
10
+ options = {
11
+ ...options,
12
+ credentials: {
12
13
  scopes: ["https://management.azure.com/.default"],
13
- } });
14
+ },
15
+ };
14
16
  const userAgentInfo = `azsdk-js-arm-compute-rest/1.0.0-beta.1`;
15
17
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
16
18
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
17
19
  : `${userAgentInfo}`;
18
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
20
+ options = {
21
+ ...options,
22
+ userAgentOptions: {
19
23
  userAgentPrefix,
20
- } });
24
+ },
25
+ };
21
26
  const client = getClient(baseUrl, credentials, options);
22
27
  return client;
23
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"computeManagementClient.js","sourceRoot":"","sources":["../../src/computeManagementClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAInE;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,8BAA8B,CAAC;IAClE,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,uCAAuC,CAAC;SAClD,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA4B,CAAC;IAEnF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ComputeManagementClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class ComputeManagementClient class.\n * @param credentials type: TokenCredential\n */\nexport default function createClient(\n credentials: TokenCredential,\n options: ClientOptions = {}\n): ComputeManagementClient {\n const baseUrl = options.baseUrl ?? `https://management.azure.com`;\n options = {\n ...options,\n credentials: {\n scopes: [\"https://management.azure.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-arm-compute-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 ComputeManagementClient;\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"computeManagementClient.js","sourceRoot":"","sources":["../../src/computeManagementClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAInE;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA4B,EAC5B,UAAyB,EAAE;IAE3B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,8BAA8B,CAAC;IAClE,OAAO,GAAG;QACR,GAAG,OAAO;QACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,uCAAuC,CAAC;SAClD;KACF,CAAC;IAEF,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;KACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA4B,CAAC;IAEnF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ComputeManagementClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class ComputeManagementClient class.\n * @param credentials type: TokenCredential\n */\nexport default function createClient(\n credentials: TokenCredential,\n options: ClientOptions = {},\n): ComputeManagementClient {\n const baseUrl = options.baseUrl ?? `https://management.azure.com`;\n options = {\n ...options,\n credentials: {\n scopes: [\"https://management.azure.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-arm-compute-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 ComputeManagementClient;\n\n return client;\n}\n"]}
@@ -350,7 +350,7 @@ const responseMap = {
350
350
  };
351
351
  export function isUnexpected(response) {
352
352
  const lroOriginal = response.headers["x-ms-original-url"];
353
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
353
+ const url = new URL(lroOriginal ?? response.request.url);
354
354
  const method = response.request.method;
355
355
  let pathDetails = responseMap[`${method} ${url.pathname}`];
356
356
  if (!pathDetails) {
@@ -359,7 +359,6 @@ export function isUnexpected(response) {
359
359
  return !pathDetails.includes(response.status);
360
360
  }
361
361
  function geParametrizedPathSuccess(path) {
362
- var _a, _b;
363
362
  const pathParts = path.split("/");
364
363
  // Iterate the responseMap to find a match
365
364
  for (const [key, value] of Object.entries(responseMap)) {
@@ -374,7 +373,7 @@ function geParametrizedPathSuccess(path) {
374
373
  // track if we have found a match to return the values found.
375
374
  let found = true;
376
375
  for (let i = 0; i < candidateParts.length; i++) {
377
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.endsWith("}"))) {
376
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.endsWith("}")) {
378
377
  // If the current part of the candidate is a "template" part
379
378
  // it is a match with the actual path part on hand
380
379
  // skip as the parameterized part can match anything