@azure/arm-storageimportexport 2.0.3-alpha.20230202.1 → 2.1.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +9 -10
  2. package/LICENSE +1 -1
  3. package/dist/index.js +113 -46
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/bitLockerKeysListSample.js +11 -3
  8. package/dist-esm/samples-dev/bitLockerKeysListSample.js.map +1 -1
  9. package/dist-esm/samples-dev/jobsCreateSample.js +16 -7
  10. package/dist-esm/samples-dev/jobsCreateSample.js.map +1 -1
  11. package/dist-esm/samples-dev/jobsDeleteSample.js +11 -3
  12. package/dist-esm/samples-dev/jobsDeleteSample.js.map +1 -1
  13. package/dist-esm/samples-dev/jobsGetSample.js +15 -6
  14. package/dist-esm/samples-dev/jobsGetSample.js.map +1 -1
  15. package/dist-esm/samples-dev/jobsListByResourceGroupSample.js +11 -3
  16. package/dist-esm/samples-dev/jobsListByResourceGroupSample.js.map +1 -1
  17. package/dist-esm/samples-dev/jobsListBySubscriptionSample.js +10 -2
  18. package/dist-esm/samples-dev/jobsListBySubscriptionSample.js.map +1 -1
  19. package/dist-esm/samples-dev/jobsUpdateSample.js +15 -6
  20. package/dist-esm/samples-dev/jobsUpdateSample.js.map +1 -1
  21. package/dist-esm/samples-dev/locationsGetSample.js +10 -2
  22. package/dist-esm/samples-dev/locationsGetSample.js.map +1 -1
  23. package/dist-esm/samples-dev/locationsListSample.js +10 -2
  24. package/dist-esm/samples-dev/locationsListSample.js.map +1 -1
  25. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  26. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  27. package/dist-esm/src/index.d.ts +1 -0
  28. package/dist-esm/src/index.d.ts.map +1 -1
  29. package/dist-esm/src/index.js +1 -0
  30. package/dist-esm/src/index.js.map +1 -1
  31. package/dist-esm/src/models/index.d.ts +0 -8
  32. package/dist-esm/src/models/index.d.ts.map +1 -1
  33. package/dist-esm/src/operations/bitLockerKeys.d.ts.map +1 -1
  34. package/dist-esm/src/operations/bitLockerKeys.js +8 -4
  35. package/dist-esm/src/operations/bitLockerKeys.js.map +1 -1
  36. package/dist-esm/src/operations/jobs.d.ts.map +1 -1
  37. package/dist-esm/src/operations/jobs.js +37 -16
  38. package/dist-esm/src/operations/jobs.js.map +1 -1
  39. package/dist-esm/src/operations/locations.d.ts.map +1 -1
  40. package/dist-esm/src/operations/locations.js +8 -4
  41. package/dist-esm/src/operations/locations.js.map +1 -1
  42. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  43. package/dist-esm/src/operations/operations.js +8 -4
  44. package/dist-esm/src/operations/operations.js.map +1 -1
  45. package/dist-esm/src/pagingHelper.d.ts +13 -0
  46. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  47. package/dist-esm/src/pagingHelper.js +32 -0
  48. package/dist-esm/src/pagingHelper.js.map +1 -0
  49. package/dist-esm/src/storageImportExport.d.ts.map +1 -1
  50. package/dist-esm/src/storageImportExport.js +20 -18
  51. package/dist-esm/src/storageImportExport.js.map +1 -1
  52. package/package.json +7 -5
  53. package/review/arm-storageimportexport.api.md +3 -4
  54. package/src/index.ts +1 -0
  55. package/src/models/index.ts +2 -12
  56. package/src/operations/bitLockerKeys.ts +15 -5
  57. package/src/operations/jobs.ts +45 -18
  58. package/src/operations/locations.ts +10 -5
  59. package/src/operations/operations.ts +10 -5
  60. package/src/pagingHelper.ts +39 -0
  61. package/src/storageImportExport.ts +26 -20
  62. package/types/arm-storageimportexport.d.ts +9 -8
package/CHANGELOG.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # Release History
2
+
3
+ ## 2.1.0 (2023-02-02)
4
+
5
+ **Features**
2
6
 
3
- ## 2.0.3 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
7
+ - Interface JobsListByResourceGroupNextOptionalParams no longer has parameter filter
8
+ - Interface JobsListByResourceGroupNextOptionalParams no longer has parameter top
9
+ - Interface JobsListBySubscriptionNextOptionalParams no longer has parameter filter
10
+ - Interface JobsListBySubscriptionNextOptionalParams no longer has parameter top
11
+
13
12
  ## 2.0.2 (2022-07-05)
14
13
 
15
14
  **Features**
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Microsoft
3
+ Copyright (c) 2023 Microsoft
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -27,6 +27,38 @@ function _interopNamespace(e) {
27
27
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
28
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
29
29
 
30
+ /*
31
+ * Copyright (c) Microsoft Corporation.
32
+ * Licensed under the MIT License.
33
+ *
34
+ * Code generated by Microsoft (R) AutoRest Code Generator.
35
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
36
+ */
37
+ const pageMap = new WeakMap();
38
+ /**
39
+ * Given the last `.value` produced by the `byPage` iterator,
40
+ * returns a continuation token that can be used to begin paging from
41
+ * that point later.
42
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
43
+ * @returns The continuation token that can be passed into byPage() during future calls.
44
+ */
45
+ function getContinuationToken(page) {
46
+ var _a;
47
+ if (typeof page !== "object" || page === null) {
48
+ return undefined;
49
+ }
50
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
51
+ }
52
+ function setContinuationToken(page, continuationToken) {
53
+ var _a;
54
+ if (typeof page !== "object" || page === null || !continuationToken) {
55
+ return;
56
+ }
57
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
58
+ pageInfo.continuationToken = continuationToken;
59
+ pageMap.set(page, pageInfo);
60
+ }
61
+
30
62
  /*
31
63
  * Copyright (c) Microsoft Corporation.
32
64
  * Licensed under the MIT License.
@@ -1352,14 +1384,18 @@ class LocationsImpl {
1352
1384
  [Symbol.asyncIterator]() {
1353
1385
  return this;
1354
1386
  },
1355
- byPage: () => {
1356
- return this.listPagingPage(options);
1387
+ byPage: (settings) => {
1388
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1389
+ throw new Error("maxPageSize is not supported by this operation.");
1390
+ }
1391
+ return this.listPagingPage(options, settings);
1357
1392
  }
1358
1393
  };
1359
1394
  }
1360
- listPagingPage(options) {
1395
+ listPagingPage(options, _settings) {
1361
1396
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1362
- let result = yield tslib.__await(this._list(options));
1397
+ let result;
1398
+ result = yield tslib.__await(this._list(options));
1363
1399
  yield yield tslib.__await(result.value || []);
1364
1400
  });
1365
1401
  }
@@ -1464,20 +1500,31 @@ class JobsImpl {
1464
1500
  [Symbol.asyncIterator]() {
1465
1501
  return this;
1466
1502
  },
1467
- byPage: () => {
1468
- return this.listBySubscriptionPagingPage(options);
1503
+ byPage: (settings) => {
1504
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1505
+ throw new Error("maxPageSize is not supported by this operation.");
1506
+ }
1507
+ return this.listBySubscriptionPagingPage(options, settings);
1469
1508
  }
1470
1509
  };
1471
1510
  }
1472
- listBySubscriptionPagingPage(options) {
1511
+ listBySubscriptionPagingPage(options, settings) {
1473
1512
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1474
- let result = yield tslib.__await(this._listBySubscription(options));
1475
- yield yield tslib.__await(result.value || []);
1476
- let continuationToken = result.nextLink;
1513
+ let result;
1514
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1515
+ if (!continuationToken) {
1516
+ result = yield tslib.__await(this._listBySubscription(options));
1517
+ let page = result.value || [];
1518
+ continuationToken = result.nextLink;
1519
+ setContinuationToken(page, continuationToken);
1520
+ yield yield tslib.__await(page);
1521
+ }
1477
1522
  while (continuationToken) {
1478
1523
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1479
1524
  continuationToken = result.nextLink;
1480
- yield yield tslib.__await(result.value || []);
1525
+ let page = result.value || [];
1526
+ setContinuationToken(page, continuationToken);
1527
+ yield yield tslib.__await(page);
1481
1528
  }
1482
1529
  });
1483
1530
  }
@@ -1514,20 +1561,31 @@ class JobsImpl {
1514
1561
  [Symbol.asyncIterator]() {
1515
1562
  return this;
1516
1563
  },
1517
- byPage: () => {
1518
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1564
+ byPage: (settings) => {
1565
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1566
+ throw new Error("maxPageSize is not supported by this operation.");
1567
+ }
1568
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1519
1569
  }
1520
1570
  };
1521
1571
  }
1522
- listByResourceGroupPagingPage(resourceGroupName, options) {
1572
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1523
1573
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1524
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1525
- yield yield tslib.__await(result.value || []);
1526
- let continuationToken = result.nextLink;
1574
+ let result;
1575
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1576
+ if (!continuationToken) {
1577
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1578
+ let page = result.value || [];
1579
+ continuationToken = result.nextLink;
1580
+ setContinuationToken(page, continuationToken);
1581
+ yield yield tslib.__await(page);
1582
+ }
1527
1583
  while (continuationToken) {
1528
1584
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1529
1585
  continuationToken = result.nextLink;
1530
- yield yield tslib.__await(result.value || []);
1586
+ let page = result.value || [];
1587
+ setContinuationToken(page, continuationToken);
1588
+ yield yield tslib.__await(page);
1531
1589
  }
1532
1590
  });
1533
1591
  }
@@ -1775,7 +1833,6 @@ const listBySubscriptionNextOperationSpec = {
1775
1833
  bodyMapper: ErrorResponse
1776
1834
  }
1777
1835
  },
1778
- queryParameters: [apiVersion, top, filter],
1779
1836
  urlParameters: [
1780
1837
  $host,
1781
1838
  subscriptionId,
@@ -1795,7 +1852,6 @@ const listByResourceGroupNextOperationSpec = {
1795
1852
  bodyMapper: ErrorResponse
1796
1853
  }
1797
1854
  },
1798
- queryParameters: [apiVersion, top, filter],
1799
1855
  urlParameters: [
1800
1856
  $host,
1801
1857
  subscriptionId,
@@ -1839,14 +1895,18 @@ class BitLockerKeysImpl {
1839
1895
  [Symbol.asyncIterator]() {
1840
1896
  return this;
1841
1897
  },
1842
- byPage: () => {
1843
- return this.listPagingPage(jobName, resourceGroupName, options);
1898
+ byPage: (settings) => {
1899
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1900
+ throw new Error("maxPageSize is not supported by this operation.");
1901
+ }
1902
+ return this.listPagingPage(jobName, resourceGroupName, options, settings);
1844
1903
  }
1845
1904
  };
1846
1905
  }
1847
- listPagingPage(jobName, resourceGroupName, options) {
1906
+ listPagingPage(jobName, resourceGroupName, options, _settings) {
1848
1907
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1849
- let result = yield tslib.__await(this._list(jobName, resourceGroupName, options));
1908
+ let result;
1909
+ result = yield tslib.__await(this._list(jobName, resourceGroupName, options));
1850
1910
  yield yield tslib.__await(result.value || []);
1851
1911
  });
1852
1912
  }
@@ -1933,14 +1993,18 @@ class OperationsImpl {
1933
1993
  [Symbol.asyncIterator]() {
1934
1994
  return this;
1935
1995
  },
1936
- byPage: () => {
1937
- return this.listPagingPage(options);
1996
+ byPage: (settings) => {
1997
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1998
+ throw new Error("maxPageSize is not supported by this operation.");
1999
+ }
2000
+ return this.listPagingPage(options, settings);
1938
2001
  }
1939
2002
  };
1940
2003
  }
1941
- listPagingPage(options) {
2004
+ listPagingPage(options, _settings) {
1942
2005
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1943
- let result = yield tslib.__await(this._list(options));
2006
+ let result;
2007
+ result = yield tslib.__await(this._list(options));
1944
2008
  yield yield tslib.__await(result.value || []);
1945
2009
  });
1946
2010
  }
@@ -2004,7 +2068,7 @@ class StorageImportExport extends coreClient__namespace.ServiceClient {
2004
2068
  * @param options The parameter options
2005
2069
  */
2006
2070
  constructor(credentials, subscriptionId, options) {
2007
- var _a, _b;
2071
+ var _a, _b, _c;
2008
2072
  if (credentials === undefined) {
2009
2073
  throw new Error("'credentials' cannot be null");
2010
2074
  }
@@ -2019,32 +2083,34 @@ class StorageImportExport extends coreClient__namespace.ServiceClient {
2019
2083
  requestContentType: "application/json; charset=utf-8",
2020
2084
  credential: credentials
2021
2085
  };
2022
- const packageDetails = `azsdk-js-arm-storageimportexport/2.0.3`;
2086
+ const packageDetails = `azsdk-js-arm-storageimportexport/2.1.0`;
2023
2087
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2024
2088
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2025
2089
  : `${packageDetails}`;
2026
- if (!options.credentialScopes) {
2027
- options.credentialScopes = ["https://management.azure.com/.default"];
2028
- }
2029
2090
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2030
2091
  userAgentPrefix
2031
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2092
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2032
2093
  super(optionsWithDefaults);
2094
+ let bearerTokenAuthenticationPolicyFound = false;
2033
2095
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2034
2096
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
2035
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2097
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2036
2098
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2037
- if (!bearerTokenAuthenticationPolicyFound) {
2038
- this.pipeline.removePolicy({
2039
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2040
- });
2041
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2042
- scopes: `${optionsWithDefaults.baseUri}/.default`,
2043
- challengeCallbacks: {
2044
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2045
- }
2046
- }));
2047
- }
2099
+ }
2100
+ if (!options ||
2101
+ !options.pipeline ||
2102
+ options.pipeline.getOrderedPolicies().length == 0 ||
2103
+ !bearerTokenAuthenticationPolicyFound) {
2104
+ this.pipeline.removePolicy({
2105
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2106
+ });
2107
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2108
+ credential: credentials,
2109
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2110
+ challengeCallbacks: {
2111
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2112
+ }
2113
+ }));
2048
2114
  }
2049
2115
  // Parameter assignments
2050
2116
  this.subscriptionId = subscriptionId;
@@ -2087,4 +2153,5 @@ class StorageImportExport extends coreClient__namespace.ServiceClient {
2087
2153
  }
2088
2154
 
2089
2155
  exports.StorageImportExport = StorageImportExport;
2156
+ exports.getContinuationToken = getContinuationToken;
2090
2157
  //# sourceMappingURL=index.js.map