@azure/arm-confidentialledger 1.1.1-alpha.20230127.1 → 1.2.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 (51) hide show
  1. package/CHANGELOG.md +8 -10
  2. package/LICENSE +1 -1
  3. package/dist/index.js +107 -42
  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/checkNameAvailabilitySample.js +10 -2
  8. package/dist-esm/samples-dev/checkNameAvailabilitySample.js.map +1 -1
  9. package/dist-esm/samples-dev/ledgerCreateSample.js +12 -3
  10. package/dist-esm/samples-dev/ledgerCreateSample.js.map +1 -1
  11. package/dist-esm/samples-dev/ledgerDeleteSample.js +12 -3
  12. package/dist-esm/samples-dev/ledgerDeleteSample.js.map +1 -1
  13. package/dist-esm/samples-dev/ledgerGetSample.js +12 -3
  14. package/dist-esm/samples-dev/ledgerGetSample.js.map +1 -1
  15. package/dist-esm/samples-dev/ledgerListByResourceGroupSample.js +12 -3
  16. package/dist-esm/samples-dev/ledgerListByResourceGroupSample.js.map +1 -1
  17. package/dist-esm/samples-dev/ledgerListBySubscriptionSample.js +10 -2
  18. package/dist-esm/samples-dev/ledgerListBySubscriptionSample.js.map +1 -1
  19. package/dist-esm/samples-dev/ledgerUpdateSample.js +12 -3
  20. package/dist-esm/samples-dev/ledgerUpdateSample.js.map +1 -1
  21. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  22. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  23. package/dist-esm/src/confidentialLedgerClient.d.ts.map +1 -1
  24. package/dist-esm/src/confidentialLedgerClient.js +20 -18
  25. package/dist-esm/src/confidentialLedgerClient.js.map +1 -1
  26. package/dist-esm/src/index.d.ts +1 -0
  27. package/dist-esm/src/index.d.ts.map +1 -1
  28. package/dist-esm/src/index.js +1 -0
  29. package/dist-esm/src/index.js.map +1 -1
  30. package/dist-esm/src/models/index.d.ts +0 -4
  31. package/dist-esm/src/models/index.d.ts.map +1 -1
  32. package/dist-esm/src/operations/ledger.d.ts.map +1 -1
  33. package/dist-esm/src/operations/ledger.js +37 -16
  34. package/dist-esm/src/operations/ledger.js.map +1 -1
  35. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  36. package/dist-esm/src/operations/operations.js +19 -8
  37. package/dist-esm/src/operations/operations.js.map +1 -1
  38. package/dist-esm/src/pagingHelper.d.ts +13 -0
  39. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  40. package/dist-esm/src/pagingHelper.js +32 -0
  41. package/dist-esm/src/pagingHelper.js.map +1 -0
  42. package/package.json +7 -5
  43. package/review/arm-confidentialledger.api.md +3 -2
  44. package/src/confidentialLedgerClient.ts +26 -20
  45. package/src/index.ts +1 -0
  46. package/src/models/index.ts +2 -8
  47. package/src/operations/ledger.ts +46 -19
  48. package/src/operations/operations.ts +21 -9
  49. package/src/pagingHelper.ts +39 -0
  50. package/types/arm-confidentialledger.d.ts +9 -4
  51. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,15 +1,13 @@
1
1
  # Release History
2
+
3
+ ## 1.2.0 (2023-01-12)
4
+
5
+ **Features**
2
6
 
3
- ## 1.1.1 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
7
+ - Interface LedgerListByResourceGroupNextOptionalParams no longer has parameter filter
8
+ - Interface LedgerListBySubscriptionNextOptionalParams no longer has parameter filter
9
+
10
+
13
11
  ## 1.1.0 (2022-07-05)
14
12
 
15
13
  **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
@@ -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.
@@ -763,20 +795,31 @@ class OperationsImpl {
763
795
  [Symbol.asyncIterator]() {
764
796
  return this;
765
797
  },
766
- byPage: () => {
767
- return this.listPagingPage(options);
798
+ byPage: (settings) => {
799
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
800
+ throw new Error("maxPageSize is not supported by this operation.");
801
+ }
802
+ return this.listPagingPage(options, settings);
768
803
  }
769
804
  };
770
805
  }
771
- listPagingPage(options) {
806
+ listPagingPage(options, settings) {
772
807
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
773
- let result = yield tslib.__await(this._list(options));
774
- yield yield tslib.__await(result.value || []);
775
- let continuationToken = result.nextLink;
808
+ let result;
809
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
810
+ if (!continuationToken) {
811
+ result = yield tslib.__await(this._list(options));
812
+ let page = result.value || [];
813
+ continuationToken = result.nextLink;
814
+ setContinuationToken(page, continuationToken);
815
+ yield yield tslib.__await(page);
816
+ }
776
817
  while (continuationToken) {
777
818
  result = yield tslib.__await(this._listNext(continuationToken, options));
778
819
  continuationToken = result.nextLink;
779
- yield yield tslib.__await(result.value || []);
820
+ let page = result.value || [];
821
+ setContinuationToken(page, continuationToken);
822
+ yield yield tslib.__await(page);
780
823
  }
781
824
  });
782
825
  }
@@ -843,7 +886,6 @@ const listNextOperationSpec = {
843
886
  bodyMapper: ErrorResponse
844
887
  }
845
888
  },
846
- queryParameters: [apiVersion],
847
889
  urlParameters: [$host, nextLink],
848
890
  headerParameters: [accept],
849
891
  serializer: serializer$2
@@ -908,20 +950,31 @@ class LedgerImpl {
908
950
  [Symbol.asyncIterator]() {
909
951
  return this;
910
952
  },
911
- byPage: () => {
912
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
953
+ byPage: (settings) => {
954
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
955
+ throw new Error("maxPageSize is not supported by this operation.");
956
+ }
957
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
913
958
  }
914
959
  };
915
960
  }
916
- listByResourceGroupPagingPage(resourceGroupName, options) {
961
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
917
962
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
918
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
919
- yield yield tslib.__await(result.value || []);
920
- let continuationToken = result.nextLink;
963
+ let result;
964
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
965
+ if (!continuationToken) {
966
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
967
+ let page = result.value || [];
968
+ continuationToken = result.nextLink;
969
+ setContinuationToken(page, continuationToken);
970
+ yield yield tslib.__await(page);
971
+ }
921
972
  while (continuationToken) {
922
973
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
923
974
  continuationToken = result.nextLink;
924
- yield yield tslib.__await(result.value || []);
975
+ let page = result.value || [];
976
+ setContinuationToken(page, continuationToken);
977
+ yield yield tslib.__await(page);
925
978
  }
926
979
  });
927
980
  }
@@ -956,20 +1009,31 @@ class LedgerImpl {
956
1009
  [Symbol.asyncIterator]() {
957
1010
  return this;
958
1011
  },
959
- byPage: () => {
960
- return this.listBySubscriptionPagingPage(options);
1012
+ byPage: (settings) => {
1013
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1014
+ throw new Error("maxPageSize is not supported by this operation.");
1015
+ }
1016
+ return this.listBySubscriptionPagingPage(options, settings);
961
1017
  }
962
1018
  };
963
1019
  }
964
- listBySubscriptionPagingPage(options) {
1020
+ listBySubscriptionPagingPage(options, settings) {
965
1021
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
966
- let result = yield tslib.__await(this._listBySubscription(options));
967
- yield yield tslib.__await(result.value || []);
968
- let continuationToken = result.nextLink;
1022
+ let result;
1023
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1024
+ if (!continuationToken) {
1025
+ result = yield tslib.__await(this._listBySubscription(options));
1026
+ let page = result.value || [];
1027
+ continuationToken = result.nextLink;
1028
+ setContinuationToken(page, continuationToken);
1029
+ yield yield tslib.__await(page);
1030
+ }
969
1031
  while (continuationToken) {
970
1032
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
971
1033
  continuationToken = result.nextLink;
972
- yield yield tslib.__await(result.value || []);
1034
+ let page = result.value || [];
1035
+ setContinuationToken(page, continuationToken);
1036
+ yield yield tslib.__await(page);
973
1037
  }
974
1038
  });
975
1039
  }
@@ -1347,7 +1411,6 @@ const listByResourceGroupNextOperationSpec = {
1347
1411
  bodyMapper: ErrorResponse
1348
1412
  }
1349
1413
  },
1350
- queryParameters: [apiVersion, filter],
1351
1414
  urlParameters: [
1352
1415
  $host,
1353
1416
  nextLink,
@@ -1368,7 +1431,6 @@ const listBySubscriptionNextOperationSpec = {
1368
1431
  bodyMapper: ErrorResponse
1369
1432
  }
1370
1433
  },
1371
- queryParameters: [apiVersion, filter],
1372
1434
  urlParameters: [
1373
1435
  $host,
1374
1436
  nextLink,
@@ -1394,7 +1456,7 @@ class ConfidentialLedgerClient extends coreClient__namespace.ServiceClient {
1394
1456
  * @param options The parameter options
1395
1457
  */
1396
1458
  constructor(credentials, subscriptionId, options) {
1397
- var _a, _b;
1459
+ var _a, _b, _c;
1398
1460
  if (credentials === undefined) {
1399
1461
  throw new Error("'credentials' cannot be null");
1400
1462
  }
@@ -1409,32 +1471,34 @@ class ConfidentialLedgerClient extends coreClient__namespace.ServiceClient {
1409
1471
  requestContentType: "application/json; charset=utf-8",
1410
1472
  credential: credentials
1411
1473
  };
1412
- const packageDetails = `azsdk-js-arm-confidentialledger/1.1.1`;
1474
+ const packageDetails = `azsdk-js-arm-confidentialledger/1.2.0`;
1413
1475
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1414
1476
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1415
1477
  : `${packageDetails}`;
1416
- if (!options.credentialScopes) {
1417
- options.credentialScopes = ["https://management.azure.com/.default"];
1418
- }
1419
1478
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1420
1479
  userAgentPrefix
1421
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1480
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1422
1481
  super(optionsWithDefaults);
1482
+ let bearerTokenAuthenticationPolicyFound = false;
1423
1483
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1424
1484
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
1425
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1485
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1426
1486
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1427
- if (!bearerTokenAuthenticationPolicyFound) {
1428
- this.pipeline.removePolicy({
1429
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1430
- });
1431
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1432
- scopes: `${optionsWithDefaults.baseUri}/.default`,
1433
- challengeCallbacks: {
1434
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1435
- }
1436
- }));
1437
- }
1487
+ }
1488
+ if (!options ||
1489
+ !options.pipeline ||
1490
+ options.pipeline.getOrderedPolicies().length == 0 ||
1491
+ !bearerTokenAuthenticationPolicyFound) {
1492
+ this.pipeline.removePolicy({
1493
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1494
+ });
1495
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1496
+ credential: credentials,
1497
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
1498
+ challengeCallbacks: {
1499
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1500
+ }
1501
+ }));
1438
1502
  }
1439
1503
  // Parameter assignments
1440
1504
  this.subscriptionId = subscriptionId;
@@ -1503,4 +1567,5 @@ const checkNameAvailabilityOperationSpec = {
1503
1567
  };
1504
1568
 
1505
1569
  exports.ConfidentialLedgerClient = ConfidentialLedgerClient;
1570
+ exports.getContinuationToken = getContinuationToken;
1506
1571
  //# sourceMappingURL=index.js.map