@azure/arm-appcomplianceautomation 1.0.0-alpha.20221102.1 → 1.0.0-beta.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.
Files changed (33) hide show
  1. package/dist/index.js +90 -27
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.min.js +1 -1
  4. package/dist/index.min.js.map +1 -1
  5. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.d.ts.map +1 -1
  6. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.js +3 -6
  7. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.js.map +1 -1
  8. package/dist-esm/src/index.d.ts +1 -0
  9. package/dist-esm/src/index.d.ts.map +1 -1
  10. package/dist-esm/src/index.js +1 -0
  11. package/dist-esm/src/index.js.map +1 -1
  12. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  13. package/dist-esm/src/operations/operations.js +19 -7
  14. package/dist-esm/src/operations/operations.js.map +1 -1
  15. package/dist-esm/src/operations/reports.d.ts.map +1 -1
  16. package/dist-esm/src/operations/reports.js +19 -7
  17. package/dist-esm/src/operations/reports.js.map +1 -1
  18. package/dist-esm/src/operations/snapshots.d.ts.map +1 -1
  19. package/dist-esm/src/operations/snapshots.js +19 -7
  20. package/dist-esm/src/operations/snapshots.js.map +1 -1
  21. package/dist-esm/src/pagingHelper.d.ts +13 -0
  22. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  23. package/dist-esm/src/pagingHelper.js +32 -0
  24. package/dist-esm/src/pagingHelper.js.map +1 -0
  25. package/package.json +4 -4
  26. package/review/arm-appcomplianceautomation.api.md +3 -0
  27. package/src/appComplianceAutomationToolForMicrosoft365.ts +4 -5
  28. package/src/index.ts +1 -0
  29. package/src/operations/operations.ts +21 -8
  30. package/src/operations/reports.ts +21 -8
  31. package/src/operations/snapshots.ts +21 -8
  32. package/src/pagingHelper.ts +39 -0
  33. package/types/arm-appcomplianceautomation.d.ts +9 -0
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 a result page from a pageable operation, returns a
41
+ * continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page A result object from calling .byPage() on a paged operation.
44
+ * @returns The continuation token that can be passed into byPage().
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.
@@ -1582,20 +1614,31 @@ class OperationsImpl {
1582
1614
  [Symbol.asyncIterator]() {
1583
1615
  return this;
1584
1616
  },
1585
- byPage: () => {
1586
- return this.listPagingPage(options);
1617
+ byPage: (settings) => {
1618
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1619
+ throw new Error("maxPageSize is not supported by this operation.");
1620
+ }
1621
+ return this.listPagingPage(options, settings);
1587
1622
  }
1588
1623
  };
1589
1624
  }
1590
- listPagingPage(options) {
1625
+ listPagingPage(options, settings) {
1591
1626
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1592
- let result = yield tslib.__await(this._list(options));
1593
- yield yield tslib.__await(result.value || []);
1594
- let continuationToken = result.nextLink;
1627
+ let result;
1628
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1629
+ if (!continuationToken) {
1630
+ result = yield tslib.__await(this._list(options));
1631
+ let page = result.value || [];
1632
+ continuationToken = result.nextLink;
1633
+ setContinuationToken(page, continuationToken);
1634
+ yield yield tslib.__await(page);
1635
+ }
1595
1636
  while (continuationToken) {
1596
1637
  result = yield tslib.__await(this._listNext(continuationToken, options));
1597
1638
  continuationToken = result.nextLink;
1598
- yield yield tslib.__await(result.value || []);
1639
+ let page = result.value || [];
1640
+ setContinuationToken(page, continuationToken);
1641
+ yield yield tslib.__await(page);
1599
1642
  }
1600
1643
  });
1601
1644
  }
@@ -1698,20 +1741,31 @@ class ReportsImpl {
1698
1741
  [Symbol.asyncIterator]() {
1699
1742
  return this;
1700
1743
  },
1701
- byPage: () => {
1702
- return this.listPagingPage(options);
1744
+ byPage: (settings) => {
1745
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1746
+ throw new Error("maxPageSize is not supported by this operation.");
1747
+ }
1748
+ return this.listPagingPage(options, settings);
1703
1749
  }
1704
1750
  };
1705
1751
  }
1706
- listPagingPage(options) {
1752
+ listPagingPage(options, settings) {
1707
1753
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1708
- let result = yield tslib.__await(this._list(options));
1709
- yield yield tslib.__await(result.value || []);
1710
- let continuationToken = result.nextLink;
1754
+ let result;
1755
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1756
+ if (!continuationToken) {
1757
+ result = yield tslib.__await(this._list(options));
1758
+ let page = result.value || [];
1759
+ continuationToken = result.nextLink;
1760
+ setContinuationToken(page, continuationToken);
1761
+ yield yield tslib.__await(page);
1762
+ }
1711
1763
  while (continuationToken) {
1712
1764
  result = yield tslib.__await(this._listNext(continuationToken, options));
1713
1765
  continuationToken = result.nextLink;
1714
- yield yield tslib.__await(result.value || []);
1766
+ let page = result.value || [];
1767
+ setContinuationToken(page, continuationToken);
1768
+ yield yield tslib.__await(page);
1715
1769
  }
1716
1770
  });
1717
1771
  }
@@ -2126,20 +2180,31 @@ class SnapshotsImpl {
2126
2180
  [Symbol.asyncIterator]() {
2127
2181
  return this;
2128
2182
  },
2129
- byPage: () => {
2130
- return this.listPagingPage(reportName, options);
2183
+ byPage: (settings) => {
2184
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2185
+ throw new Error("maxPageSize is not supported by this operation.");
2186
+ }
2187
+ return this.listPagingPage(reportName, options, settings);
2131
2188
  }
2132
2189
  };
2133
2190
  }
2134
- listPagingPage(reportName, options) {
2191
+ listPagingPage(reportName, options, settings) {
2135
2192
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2136
- let result = yield tslib.__await(this._list(reportName, options));
2137
- yield yield tslib.__await(result.value || []);
2138
- let continuationToken = result.nextLink;
2193
+ let result;
2194
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2195
+ if (!continuationToken) {
2196
+ result = yield tslib.__await(this._list(reportName, options));
2197
+ let page = result.value || [];
2198
+ continuationToken = result.nextLink;
2199
+ setContinuationToken(page, continuationToken);
2200
+ yield yield tslib.__await(page);
2201
+ }
2139
2202
  while (continuationToken) {
2140
2203
  result = yield tslib.__await(this._listNext(reportName, continuationToken, options));
2141
2204
  continuationToken = result.nextLink;
2142
- yield yield tslib.__await(result.value || []);
2205
+ let page = result.value || [];
2206
+ setContinuationToken(page, continuationToken);
2207
+ yield yield tslib.__await(page);
2143
2208
  }
2144
2209
  });
2145
2210
  }
@@ -2376,7 +2441,7 @@ class AppComplianceAutomationToolForMicrosoft365 extends coreClient__namespace.S
2376
2441
  * @param options The parameter options
2377
2442
  */
2378
2443
  constructor(credentials, options) {
2379
- var _a, _b;
2444
+ var _a, _b, _c;
2380
2445
  if (credentials === undefined) {
2381
2446
  throw new Error("'credentials' cannot be null");
2382
2447
  }
@@ -2392,12 +2457,9 @@ class AppComplianceAutomationToolForMicrosoft365 extends coreClient__namespace.S
2392
2457
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2393
2458
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2394
2459
  : `${packageDetails}`;
2395
- if (!options.credentialScopes) {
2396
- options.credentialScopes = ["https://management.azure.com/.default"];
2397
- }
2398
2460
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2399
2461
  userAgentPrefix
2400
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2462
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2401
2463
  super(optionsWithDefaults);
2402
2464
  let bearerTokenAuthenticationPolicyFound = false;
2403
2465
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
@@ -2414,7 +2476,7 @@ class AppComplianceAutomationToolForMicrosoft365 extends coreClient__namespace.S
2414
2476
  });
2415
2477
  this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2416
2478
  credential: credentials,
2417
- scopes: `${optionsWithDefaults.credentialScopes}`,
2479
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2418
2480
  challengeCallbacks: {
2419
2481
  authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2420
2482
  }
@@ -2460,4 +2522,5 @@ class AppComplianceAutomationToolForMicrosoft365 extends coreClient__namespace.S
2460
2522
  }
2461
2523
 
2462
2524
  exports.AppComplianceAutomationToolForMicrosoft365 = AppComplianceAutomationToolForMicrosoft365;
2525
+ exports.getContinuationToken = getContinuationToken;
2463
2526
  //# sourceMappingURL=index.js.map