@azure/arm-elasticsan 1.0.0-alpha.20230104.1 → 1.0.0-alpha.20230111.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +5 -5
  2. package/LICENSE +1 -1
  3. package/dist/index.js +124 -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/elasticSansCreateSample.js +13 -6
  8. package/dist-esm/samples-dev/elasticSansCreateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/elasticSansDeleteSample.js +13 -6
  10. package/dist-esm/samples-dev/elasticSansDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/elasticSansGetSample.js +13 -6
  12. package/dist-esm/samples-dev/elasticSansGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js +13 -6
  14. package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js.map +1 -1
  15. package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js +11 -4
  16. package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js.map +1 -1
  17. package/dist-esm/samples-dev/elasticSansUpdateSample.js +13 -6
  18. package/dist-esm/samples-dev/elasticSansUpdateSample.js.map +1 -1
  19. package/dist-esm/samples-dev/operationsListSample.js +13 -4
  20. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  21. package/dist-esm/samples-dev/skusListSample.js +11 -4
  22. package/dist-esm/samples-dev/skusListSample.js.map +1 -1
  23. package/dist-esm/samples-dev/volumeGroupsCreateSample.js +13 -6
  24. package/dist-esm/samples-dev/volumeGroupsCreateSample.js.map +1 -1
  25. package/dist-esm/samples-dev/volumeGroupsDeleteSample.js +13 -6
  26. package/dist-esm/samples-dev/volumeGroupsDeleteSample.js.map +1 -1
  27. package/dist-esm/samples-dev/volumeGroupsGetSample.js +13 -6
  28. package/dist-esm/samples-dev/volumeGroupsGetSample.js.map +1 -1
  29. package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js +13 -6
  30. package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js.map +1 -1
  31. package/dist-esm/samples-dev/volumeGroupsUpdateSample.js +13 -6
  32. package/dist-esm/samples-dev/volumeGroupsUpdateSample.js.map +1 -1
  33. package/dist-esm/samples-dev/volumesCreateSample.js +13 -6
  34. package/dist-esm/samples-dev/volumesCreateSample.js.map +1 -1
  35. package/dist-esm/samples-dev/volumesDeleteSample.js +13 -6
  36. package/dist-esm/samples-dev/volumesDeleteSample.js.map +1 -1
  37. package/dist-esm/samples-dev/volumesGetSample.js +13 -6
  38. package/dist-esm/samples-dev/volumesGetSample.js.map +1 -1
  39. package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js +13 -6
  40. package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js.map +1 -1
  41. package/dist-esm/samples-dev/volumesUpdateSample.js +13 -6
  42. package/dist-esm/samples-dev/volumesUpdateSample.js.map +1 -1
  43. package/dist-esm/src/elasticSanManagement.d.ts.map +1 -1
  44. package/dist-esm/src/elasticSanManagement.js +3 -6
  45. package/dist-esm/src/elasticSanManagement.js.map +1 -1
  46. package/dist-esm/src/index.d.ts +1 -0
  47. package/dist-esm/src/index.d.ts.map +1 -1
  48. package/dist-esm/src/index.js +1 -0
  49. package/dist-esm/src/index.js.map +1 -1
  50. package/dist-esm/src/operations/elasticSans.d.ts.map +1 -1
  51. package/dist-esm/src/operations/elasticSans.js +37 -16
  52. package/dist-esm/src/operations/elasticSans.js.map +1 -1
  53. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  54. package/dist-esm/src/operations/operations.js +8 -4
  55. package/dist-esm/src/operations/operations.js.map +1 -1
  56. package/dist-esm/src/operations/skus.d.ts.map +1 -1
  57. package/dist-esm/src/operations/skus.js +8 -4
  58. package/dist-esm/src/operations/skus.js.map +1 -1
  59. package/dist-esm/src/operations/volumeGroups.d.ts.map +1 -1
  60. package/dist-esm/src/operations/volumeGroups.js +19 -8
  61. package/dist-esm/src/operations/volumeGroups.js.map +1 -1
  62. package/dist-esm/src/operations/volumes.d.ts.map +1 -1
  63. package/dist-esm/src/operations/volumes.js +19 -8
  64. package/dist-esm/src/operations/volumes.js.map +1 -1
  65. package/dist-esm/src/pagingHelper.d.ts +13 -0
  66. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  67. package/dist-esm/src/pagingHelper.js +32 -0
  68. package/dist-esm/src/pagingHelper.js.map +1 -0
  69. package/package.json +4 -3
  70. package/review/arm-elasticsan.api.md +3 -0
  71. package/src/elasticSanManagement.ts +4 -5
  72. package/src/index.ts +1 -0
  73. package/src/operations/elasticSans.ts +45 -18
  74. package/src/operations/operations.ts +10 -5
  75. package/src/operations/skus.ts +10 -5
  76. package/src/operations/volumeGroups.ts +26 -13
  77. package/src/operations/volumes.ts +28 -15
  78. package/src/pagingHelper.ts +39 -0
  79. package/types/arm-elasticsan.d.ts +9 -0
package/CHANGELOG.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # Release History
2
2
 
3
- ## 1.0.0-beta.2 (Unreleased)
3
+ ## 1.0.0-beta.2 (2023-01-10)
4
4
 
5
- ### Features Added
5
+ **Features**
6
6
 
7
- ### Breaking Changes
7
+ -  Exposes `getContinuationToken` helper function to extract continuation token
8
8
 
9
- ### Bugs Fixed
9
+ **Bugs Fixed**
10
10
 
11
- ### Other Changes
11
+ - A series of small bug fixs relevant to authentication and apiVersion policy
12
12
 
13
13
  ## 1.0.0-beta.1 (2022-10-21)
14
14
 
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
@@ -28,6 +28,38 @@ function _interopNamespace(e) {
28
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
29
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
30
 
31
+ /*
32
+ * Copyright (c) Microsoft Corporation.
33
+ * Licensed under the MIT License.
34
+ *
35
+ * Code generated by Microsoft (R) AutoRest Code Generator.
36
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
37
+ */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given the last `.value` produced by the `byPage` iterator,
41
+ * returns a continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
44
+ * @returns The continuation token that can be passed into byPage() during future calls.
45
+ */
46
+ function getContinuationToken(page) {
47
+ var _a;
48
+ if (typeof page !== "object" || page === null) {
49
+ return undefined;
50
+ }
51
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
52
+ }
53
+ function setContinuationToken(page, continuationToken) {
54
+ var _a;
55
+ if (typeof page !== "object" || page === null || !continuationToken) {
56
+ return;
57
+ }
58
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
59
+ pageInfo.continuationToken = continuationToken;
60
+ pageMap.set(page, pageInfo);
61
+ }
62
+
31
63
  /*
32
64
  * Copyright (c) Microsoft Corporation.
33
65
  * Licensed under the MIT License.
@@ -1223,14 +1255,18 @@ class OperationsImpl {
1223
1255
  [Symbol.asyncIterator]() {
1224
1256
  return this;
1225
1257
  },
1226
- byPage: () => {
1227
- return this.listPagingPage(options);
1258
+ byPage: (settings) => {
1259
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1260
+ throw new Error("maxPageSize is not supported by this operation.");
1261
+ }
1262
+ return this.listPagingPage(options, settings);
1228
1263
  }
1229
1264
  };
1230
1265
  }
1231
- listPagingPage(options) {
1266
+ listPagingPage(options, _settings) {
1232
1267
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1233
- let result = yield tslib.__await(this._list(options));
1268
+ let result;
1269
+ result = yield tslib.__await(this._list(options));
1234
1270
  yield yield tslib.__await(result.value || []);
1235
1271
  });
1236
1272
  }
@@ -1309,14 +1345,18 @@ class SkusImpl {
1309
1345
  [Symbol.asyncIterator]() {
1310
1346
  return this;
1311
1347
  },
1312
- byPage: () => {
1313
- return this.listPagingPage(options);
1348
+ byPage: (settings) => {
1349
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1350
+ throw new Error("maxPageSize is not supported by this operation.");
1351
+ }
1352
+ return this.listPagingPage(options, settings);
1314
1353
  }
1315
1354
  };
1316
1355
  }
1317
- listPagingPage(options) {
1356
+ listPagingPage(options, _settings) {
1318
1357
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1319
- let result = yield tslib.__await(this._list(options));
1358
+ let result;
1359
+ result = yield tslib.__await(this._list(options));
1320
1360
  yield yield tslib.__await(result.value || []);
1321
1361
  });
1322
1362
  }
@@ -1423,20 +1463,31 @@ class ElasticSansImpl {
1423
1463
  [Symbol.asyncIterator]() {
1424
1464
  return this;
1425
1465
  },
1426
- byPage: () => {
1427
- return this.listBySubscriptionPagingPage(options);
1466
+ byPage: (settings) => {
1467
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1468
+ throw new Error("maxPageSize is not supported by this operation.");
1469
+ }
1470
+ return this.listBySubscriptionPagingPage(options, settings);
1428
1471
  }
1429
1472
  };
1430
1473
  }
1431
- listBySubscriptionPagingPage(options) {
1474
+ listBySubscriptionPagingPage(options, settings) {
1432
1475
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1433
- let result = yield tslib.__await(this._listBySubscription(options));
1434
- yield yield tslib.__await(result.value || []);
1435
- let continuationToken = result.nextLink;
1476
+ let result;
1477
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1478
+ if (!continuationToken) {
1479
+ result = yield tslib.__await(this._listBySubscription(options));
1480
+ let page = result.value || [];
1481
+ continuationToken = result.nextLink;
1482
+ setContinuationToken(page, continuationToken);
1483
+ yield yield tslib.__await(page);
1484
+ }
1436
1485
  while (continuationToken) {
1437
1486
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1438
1487
  continuationToken = result.nextLink;
1439
- yield yield tslib.__await(result.value || []);
1488
+ let page = result.value || [];
1489
+ setContinuationToken(page, continuationToken);
1490
+ yield yield tslib.__await(page);
1440
1491
  }
1441
1492
  });
1442
1493
  }
@@ -1472,20 +1523,31 @@ class ElasticSansImpl {
1472
1523
  [Symbol.asyncIterator]() {
1473
1524
  return this;
1474
1525
  },
1475
- byPage: () => {
1476
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1526
+ byPage: (settings) => {
1527
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1528
+ throw new Error("maxPageSize is not supported by this operation.");
1529
+ }
1530
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1477
1531
  }
1478
1532
  };
1479
1533
  }
1480
- listByResourceGroupPagingPage(resourceGroupName, options) {
1534
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1481
1535
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1482
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1483
- yield yield tslib.__await(result.value || []);
1484
- let continuationToken = result.nextLink;
1536
+ let result;
1537
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1538
+ if (!continuationToken) {
1539
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1540
+ let page = result.value || [];
1541
+ continuationToken = result.nextLink;
1542
+ setContinuationToken(page, continuationToken);
1543
+ yield yield tslib.__await(page);
1544
+ }
1485
1545
  while (continuationToken) {
1486
1546
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1487
1547
  continuationToken = result.nextLink;
1488
- yield yield tslib.__await(result.value || []);
1548
+ let page = result.value || [];
1549
+ setContinuationToken(page, continuationToken);
1550
+ yield yield tslib.__await(page);
1489
1551
  }
1490
1552
  });
1491
1553
  }
@@ -1865,7 +1927,6 @@ const listBySubscriptionNextOperationSpec = {
1865
1927
  bodyMapper: ErrorModel
1866
1928
  }
1867
1929
  },
1868
- queryParameters: [apiVersion],
1869
1930
  urlParameters: [
1870
1931
  $host,
1871
1932
  subscriptionId,
@@ -1885,7 +1946,6 @@ const listByResourceGroupNextOperationSpec = {
1885
1946
  bodyMapper: ErrorModel
1886
1947
  }
1887
1948
  },
1888
- queryParameters: [apiVersion],
1889
1949
  urlParameters: [
1890
1950
  $host,
1891
1951
  subscriptionId,
@@ -1928,20 +1988,31 @@ class VolumeGroupsImpl {
1928
1988
  [Symbol.asyncIterator]() {
1929
1989
  return this;
1930
1990
  },
1931
- byPage: () => {
1932
- return this.listByElasticSanPagingPage(resourceGroupName, elasticSanName, options);
1991
+ byPage: (settings) => {
1992
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1993
+ throw new Error("maxPageSize is not supported by this operation.");
1994
+ }
1995
+ return this.listByElasticSanPagingPage(resourceGroupName, elasticSanName, options, settings);
1933
1996
  }
1934
1997
  };
1935
1998
  }
1936
- listByElasticSanPagingPage(resourceGroupName, elasticSanName, options) {
1999
+ listByElasticSanPagingPage(resourceGroupName, elasticSanName, options, settings) {
1937
2000
  return tslib.__asyncGenerator(this, arguments, function* listByElasticSanPagingPage_1() {
1938
- let result = yield tslib.__await(this._listByElasticSan(resourceGroupName, elasticSanName, options));
1939
- yield yield tslib.__await(result.value || []);
1940
- let continuationToken = result.nextLink;
2001
+ let result;
2002
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2003
+ if (!continuationToken) {
2004
+ result = yield tslib.__await(this._listByElasticSan(resourceGroupName, elasticSanName, options));
2005
+ let page = result.value || [];
2006
+ continuationToken = result.nextLink;
2007
+ setContinuationToken(page, continuationToken);
2008
+ yield yield tslib.__await(page);
2009
+ }
1941
2010
  while (continuationToken) {
1942
2011
  result = yield tslib.__await(this._listByElasticSanNext(resourceGroupName, elasticSanName, continuationToken, options));
1943
2012
  continuationToken = result.nextLink;
1944
- yield yield tslib.__await(result.value || []);
2013
+ let page = result.value || [];
2014
+ setContinuationToken(page, continuationToken);
2015
+ yield yield tslib.__await(page);
1945
2016
  }
1946
2017
  });
1947
2018
  }
@@ -2316,7 +2387,6 @@ const listByElasticSanNextOperationSpec = {
2316
2387
  bodyMapper: ErrorModel
2317
2388
  }
2318
2389
  },
2319
- queryParameters: [apiVersion],
2320
2390
  urlParameters: [
2321
2391
  $host,
2322
2392
  subscriptionId,
@@ -2361,20 +2431,31 @@ class VolumesImpl {
2361
2431
  [Symbol.asyncIterator]() {
2362
2432
  return this;
2363
2433
  },
2364
- byPage: () => {
2365
- return this.listByVolumeGroupPagingPage(resourceGroupName, elasticSanName, volumeGroupName, options);
2434
+ byPage: (settings) => {
2435
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2436
+ throw new Error("maxPageSize is not supported by this operation.");
2437
+ }
2438
+ return this.listByVolumeGroupPagingPage(resourceGroupName, elasticSanName, volumeGroupName, options, settings);
2366
2439
  }
2367
2440
  };
2368
2441
  }
2369
- listByVolumeGroupPagingPage(resourceGroupName, elasticSanName, volumeGroupName, options) {
2442
+ listByVolumeGroupPagingPage(resourceGroupName, elasticSanName, volumeGroupName, options, settings) {
2370
2443
  return tslib.__asyncGenerator(this, arguments, function* listByVolumeGroupPagingPage_1() {
2371
- let result = yield tslib.__await(this._listByVolumeGroup(resourceGroupName, elasticSanName, volumeGroupName, options));
2372
- yield yield tslib.__await(result.value || []);
2373
- let continuationToken = result.nextLink;
2444
+ let result;
2445
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2446
+ if (!continuationToken) {
2447
+ result = yield tslib.__await(this._listByVolumeGroup(resourceGroupName, elasticSanName, volumeGroupName, options));
2448
+ let page = result.value || [];
2449
+ continuationToken = result.nextLink;
2450
+ setContinuationToken(page, continuationToken);
2451
+ yield yield tslib.__await(page);
2452
+ }
2374
2453
  while (continuationToken) {
2375
2454
  result = yield tslib.__await(this._listByVolumeGroupNext(resourceGroupName, elasticSanName, volumeGroupName, continuationToken, options));
2376
2455
  continuationToken = result.nextLink;
2377
- yield yield tslib.__await(result.value || []);
2456
+ let page = result.value || [];
2457
+ setContinuationToken(page, continuationToken);
2458
+ yield yield tslib.__await(page);
2378
2459
  }
2379
2460
  });
2380
2461
  }
@@ -2777,7 +2858,6 @@ const listByVolumeGroupNextOperationSpec = {
2777
2858
  bodyMapper: ErrorModel
2778
2859
  }
2779
2860
  },
2780
- queryParameters: [apiVersion],
2781
2861
  urlParameters: [
2782
2862
  $host,
2783
2863
  subscriptionId,
@@ -2805,7 +2885,7 @@ class ElasticSanManagement extends coreClient__namespace.ServiceClient {
2805
2885
  * @param options The parameter options
2806
2886
  */
2807
2887
  constructor(credentials, subscriptionId, options) {
2808
- var _a, _b;
2888
+ var _a, _b, _c;
2809
2889
  if (credentials === undefined) {
2810
2890
  throw new Error("'credentials' cannot be null");
2811
2891
  }
@@ -2824,12 +2904,9 @@ class ElasticSanManagement extends coreClient__namespace.ServiceClient {
2824
2904
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2825
2905
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2826
2906
  : `${packageDetails}`;
2827
- if (!options.credentialScopes) {
2828
- options.credentialScopes = ["https://management.azure.com/.default"];
2829
- }
2830
2907
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2831
2908
  userAgentPrefix
2832
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2909
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2833
2910
  super(optionsWithDefaults);
2834
2911
  let bearerTokenAuthenticationPolicyFound = false;
2835
2912
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
@@ -2846,7 +2923,7 @@ class ElasticSanManagement extends coreClient__namespace.ServiceClient {
2846
2923
  });
2847
2924
  this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2848
2925
  credential: credentials,
2849
- scopes: `${optionsWithDefaults.credentialScopes}`,
2926
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2850
2927
  challengeCallbacks: {
2851
2928
  authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2852
2929
  }
@@ -2894,4 +2971,5 @@ class ElasticSanManagement extends coreClient__namespace.ServiceClient {
2894
2971
  }
2895
2972
 
2896
2973
  exports.ElasticSanManagement = ElasticSanManagement;
2974
+ exports.getContinuationToken = getContinuationToken;
2897
2975
  //# sourceMappingURL=index.js.map