@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
@@ -1 +1 @@
1
- {"version":3,"file":"snapshots.d.ts","sourceRoot":"","sources":["../../../src/operations/snapshots.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,0CAA0C,EAAE,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EACL,gBAAgB,EAEhB,2BAA2B,EAG5B,MAAM,WAAW,CAAC;AAGnB,6CAA6C;AAC7C,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;IAEpE;;;OAGG;gBACS,MAAM,EAAE,0CAA0C;IAI9D;;;;OAIG;IACI,IAAI,CACT,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,2BAA2B,GACpC,0BAA0B,CAAC,gBAAgB,CAAC;YAehC,cAAc;YAcd,aAAa;IAS5B;;;;OAIG;IACH,OAAO,CAAC,KAAK;IAUb;;;;;OAKG;IACH,OAAO,CAAC,SAAS;CAUlB"}
1
+ {"version":3,"file":"snapshots.d.ts","sourceRoot":"","sources":["../../../src/operations/snapshots.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,0BAA0B,EAAgB,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,0CAA0C,EAAE,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EACL,gBAAgB,EAEhB,2BAA2B,EAG5B,MAAM,WAAW,CAAC;AAGnB,6CAA6C;AAC7C,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;IAEpE;;;OAGG;gBACS,MAAM,EAAE,0CAA0C;IAI9D;;;;OAIG;IACI,IAAI,CACT,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,2BAA2B,GACpC,0BAA0B,CAAC,gBAAgB,CAAC;YAkBhC,cAAc;YAuBd,aAAa;IAS5B;;;;OAIG;IACH,OAAO,CAAC,KAAK;IAUb;;;;;OAKG;IACH,OAAO,CAAC,SAAS;CAUlB"}
@@ -6,6 +6,7 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
  import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
+ import { setContinuationToken } from "../pagingHelper";
9
10
  import * as coreClient from "@azure/core-client";
10
11
  import * as Mappers from "../models/mappers";
11
12
  import * as Parameters from "../models/parameters";
@@ -33,20 +34,31 @@ export class SnapshotsImpl {
33
34
  [Symbol.asyncIterator]() {
34
35
  return this;
35
36
  },
36
- byPage: () => {
37
- return this.listPagingPage(reportName, options);
37
+ byPage: (settings) => {
38
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
39
+ throw new Error("maxPageSize is not supported by this operation.");
40
+ }
41
+ return this.listPagingPage(reportName, options, settings);
38
42
  }
39
43
  };
40
44
  }
41
- listPagingPage(reportName, options) {
45
+ listPagingPage(reportName, options, settings) {
42
46
  return __asyncGenerator(this, arguments, function* listPagingPage_1() {
43
- let result = yield __await(this._list(reportName, options));
44
- yield yield __await(result.value || []);
45
- let continuationToken = result.nextLink;
47
+ let result;
48
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
49
+ if (!continuationToken) {
50
+ result = yield __await(this._list(reportName, options));
51
+ let page = result.value || [];
52
+ continuationToken = result.nextLink;
53
+ setContinuationToken(page, continuationToken);
54
+ yield yield __await(page);
55
+ }
46
56
  while (continuationToken) {
47
57
  result = yield __await(this._listNext(reportName, continuationToken, options));
48
58
  continuationToken = result.nextLink;
49
- yield yield __await(result.value || []);
59
+ let page = result.value || [];
60
+ setContinuationToken(page, continuationToken);
61
+ yield yield __await(page);
50
62
  }
51
63
  });
52
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../../src/operations/snapshots.ts"],"names":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M,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,oBAAoB;SACzC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,GAAG;QACd,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,qBAAqB;KACjC;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC7E,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC"}
1
+ {"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../../src/operations/snapshots.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAUnD,4CAA4C;AAC5C,6CAA6C;AAC7C,MAAM,OAAO,aAAa;IAGxB;;;OAGG;IACH,YAAY,MAAkD;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,IAAI,CACT,UAAkB,EAClB,OAAqC;QAErC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,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,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,oBAAoB;SACzC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,GAAG;QACd,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,qBAAqB;KACjC;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC7E,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface PageInfo {
2
+ continuationToken?: string;
3
+ }
4
+ /**
5
+ * Given a result page from a pageable operation, returns a
6
+ * continuation token that can be used to begin paging from
7
+ * that point later.
8
+ * @param page A result object from calling .byPage() on a paged operation.
9
+ * @returns The continuation token that can be passed into byPage().
10
+ */
11
+ export declare function getContinuationToken(page: unknown): string | undefined;
12
+ export declare function setContinuationToken(page: unknown, continuationToken: string | undefined): void;
13
+ //# sourceMappingURL=pagingHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagingHelper.d.ts","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,QAAQ;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKtE;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,MAAM,GAAG,SAAS,GACpC,IAAI,CAON"}
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ const pageMap = new WeakMap();
9
+ /**
10
+ * Given a result page from a pageable operation, returns a
11
+ * continuation token that can be used to begin paging from
12
+ * that point later.
13
+ * @param page A result object from calling .byPage() on a paged operation.
14
+ * @returns The continuation token that can be passed into byPage().
15
+ */
16
+ export function getContinuationToken(page) {
17
+ var _a;
18
+ if (typeof page !== "object" || page === null) {
19
+ return undefined;
20
+ }
21
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
22
+ }
23
+ export function setContinuationToken(page, continuationToken) {
24
+ var _a;
25
+ if (typeof page !== "object" || page === null || !continuationToken) {
26
+ return;
27
+ }
28
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
29
+ pageInfo.continuationToken = continuationToken;
30
+ pageMap.set(page, pageInfo);
31
+ }
32
+ //# sourceMappingURL=pagingHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;QAC7C,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,0CAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAa,EACb,iBAAqC;;IAErC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE;QACnE,OAAO;KACR;IACD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "mgmt",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "A generated SDK for AppComplianceAutomationToolForMicrosoft365.",
6
- "version": "1.0.0-alpha.20221102.1",
6
+ "version": "1.0.0-beta.1",
7
7
  "engines": {
8
8
  "node": ">=14.0.0"
9
9
  },
@@ -36,18 +36,18 @@
36
36
  "mkdirp": "^1.0.4",
37
37
  "rollup": "^2.66.1",
38
38
  "rollup-plugin-sourcemaps": "^0.6.3",
39
- "typescript": "~4.6.0",
39
+ "typescript": "~4.8.0",
40
40
  "uglify-js": "^3.4.9",
41
41
  "rimraf": "^3.0.0",
42
42
  "@azure/identity": "^2.0.1",
43
43
  "@azure-tools/test-recorder": "^2.0.0",
44
- "@azure-tools/test-credential": ">=1.0.0-alpha <1.0.0-alphb",
44
+ "@azure-tools/test-credential": "^1.0.0",
45
45
  "mocha": "^7.1.1",
46
46
  "@types/chai": "^4.2.8",
47
47
  "chai": "^4.2.0",
48
48
  "cross-env": "^7.0.2",
49
49
  "@types/node": "^14.0.0",
50
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb"
50
+ "@azure/dev-tool": "^1.0.0"
51
51
  },
52
52
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appcomplianceautomation/arm-appcomplianceautomation",
53
53
  "repository": {
@@ -177,6 +177,9 @@ export interface ErrorResponse {
177
177
  error?: ErrorDetail;
178
178
  }
179
179
 
180
+ // @public
181
+ export function getContinuationToken(page: unknown): string | undefined;
182
+
180
183
  // @public
181
184
  export type IsPass = string;
182
185
 
@@ -62,16 +62,13 @@ export class AppComplianceAutomationToolForMicrosoft365 extends coreClient.Servi
62
62
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
63
63
  : `${packageDetails}`;
64
64
 
65
- if (!options.credentialScopes) {
66
- options.credentialScopes = ["https://management.azure.com/.default"];
67
- }
68
65
  const optionsWithDefaults = {
69
66
  ...defaults,
70
67
  ...options,
71
68
  userAgentOptions: {
72
69
  userAgentPrefix
73
70
  },
74
- baseUri:
71
+ endpoint:
75
72
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
76
73
  };
77
74
  super(optionsWithDefaults);
@@ -97,7 +94,9 @@ export class AppComplianceAutomationToolForMicrosoft365 extends coreClient.Servi
97
94
  this.pipeline.addPolicy(
98
95
  coreRestPipeline.bearerTokenAuthenticationPolicy({
99
96
  credential: credentials,
100
- scopes: `${optionsWithDefaults.credentialScopes}`,
97
+ scopes:
98
+ optionsWithDefaults.credentialScopes ??
99
+ `${optionsWithDefaults.endpoint}/.default`,
101
100
  challengeCallbacks: {
102
101
  authorizeRequestOnChallenge:
103
102
  coreClient.authorizeRequestOnClaimChallenge
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  /// <reference lib="esnext.asynciterable" />
10
+ export { getContinuationToken } from "./pagingHelper";
10
11
  export * from "./models";
11
12
  export { AppComplianceAutomationToolForMicrosoft365 } from "./appComplianceAutomationToolForMicrosoft365";
12
13
  export * from "./operationsInterfaces";
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Operations } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: OperationsListOptionalParams
62
+ options?: OperationsListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<Operation[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: OperationsListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Reports } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -48,22 +49,34 @@ export class ReportsImpl implements Reports {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: ReportsListOptionalParams
62
+ options?: ReportsListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<ReportResource[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: ReportsListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Snapshots } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -50,23 +51,35 @@ export class SnapshotsImpl implements Snapshots {
50
51
  [Symbol.asyncIterator]() {
51
52
  return this;
52
53
  },
53
- byPage: () => {
54
- return this.listPagingPage(reportName, options);
54
+ byPage: (settings?: PageSettings) => {
55
+ if (settings?.maxPageSize) {
56
+ throw new Error("maxPageSize is not supported by this operation.");
57
+ }
58
+ return this.listPagingPage(reportName, options, settings);
55
59
  }
56
60
  };
57
61
  }
58
62
 
59
63
  private async *listPagingPage(
60
64
  reportName: string,
61
- options?: SnapshotsListOptionalParams
65
+ options?: SnapshotsListOptionalParams,
66
+ settings?: PageSettings
62
67
  ): AsyncIterableIterator<SnapshotResource[]> {
63
- let result = await this._list(reportName, options);
64
- yield result.value || [];
65
- let continuationToken = result.nextLink;
68
+ let result: SnapshotsListResponse;
69
+ let continuationToken = settings?.continuationToken;
70
+ if (!continuationToken) {
71
+ result = await this._list(reportName, options);
72
+ let page = result.value || [];
73
+ continuationToken = result.nextLink;
74
+ setContinuationToken(page, continuationToken);
75
+ yield page;
76
+ }
66
77
  while (continuationToken) {
67
78
  result = await this._listNext(reportName, continuationToken, options);
68
79
  continuationToken = result.nextLink;
69
- yield result.value || [];
80
+ let page = result.value || [];
81
+ setContinuationToken(page, continuationToken);
82
+ yield page;
70
83
  }
71
84
  }
72
85
 
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given a result page from a pageable operation, returns a
17
+ * continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page A result object from calling .byPage() on a paged operation.
20
+ * @returns The continuation token that can be passed into byPage().
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
@@ -479,6 +479,15 @@ export declare interface ErrorResponse {
479
479
  error?: ErrorDetail;
480
480
  }
481
481
 
482
+ /**
483
+ * Given a result page from a pageable operation, returns a
484
+ * continuation token that can be used to begin paging from
485
+ * that point later.
486
+ * @param page A result object from calling .byPage() on a paged operation.
487
+ * @returns The continuation token that can be passed into byPage().
488
+ */
489
+ export declare function getContinuationToken(page: unknown): string | undefined;
490
+
482
491
  /**
483
492
  * Defines values for IsPass. \
484
493
  * {@link KnownIsPass} can be used interchangeably with IsPass,