@azure/arm-agrifood 1.0.0-beta.2 → 1.0.0-beta.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 (47) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.js +143 -47
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/src/agriFoodMgmtClient.d.ts.map +1 -1
  7. package/dist-esm/src/agriFoodMgmtClient.js +4 -4
  8. package/dist-esm/src/agriFoodMgmtClient.js.map +1 -1
  9. package/dist-esm/src/index.d.ts +1 -0
  10. package/dist-esm/src/index.d.ts.map +1 -1
  11. package/dist-esm/src/index.js +1 -0
  12. package/dist-esm/src/index.js.map +1 -1
  13. package/dist-esm/src/operations/extensions.d.ts.map +1 -1
  14. package/dist-esm/src/operations/extensions.js +19 -7
  15. package/dist-esm/src/operations/extensions.js.map +1 -1
  16. package/dist-esm/src/operations/farmBeatsExtensions.d.ts.map +1 -1
  17. package/dist-esm/src/operations/farmBeatsExtensions.js +19 -7
  18. package/dist-esm/src/operations/farmBeatsExtensions.js.map +1 -1
  19. package/dist-esm/src/operations/farmBeatsModels.d.ts.map +1 -1
  20. package/dist-esm/src/operations/farmBeatsModels.js +37 -14
  21. package/dist-esm/src/operations/farmBeatsModels.js.map +1 -1
  22. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  23. package/dist-esm/src/operations/operations.js +19 -7
  24. package/dist-esm/src/operations/operations.js.map +1 -1
  25. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  26. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  27. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  28. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -1
  29. package/dist-esm/src/operations/privateLinkResources.js +8 -4
  30. package/dist-esm/src/operations/privateLinkResources.js.map +1 -1
  31. package/dist-esm/src/pagingHelper.d.ts +13 -0
  32. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  33. package/dist-esm/src/pagingHelper.js +32 -0
  34. package/dist-esm/src/pagingHelper.js.map +1 -0
  35. package/package.json +6 -5
  36. package/review/arm-agrifood.api.md +3 -0
  37. package/src/agriFoodMgmtClient.ts +5 -3
  38. package/src/index.ts +1 -0
  39. package/src/operations/extensions.ts +27 -13
  40. package/src/operations/farmBeatsExtensions.ts +21 -8
  41. package/src/operations/farmBeatsModels.ts +46 -17
  42. package/src/operations/operations.ts +21 -8
  43. package/src/operations/privateEndpointConnections.ts +13 -7
  44. package/src/operations/privateLinkResources.ts +11 -5
  45. package/src/pagingHelper.ts +39 -0
  46. package/types/arm-agrifood.d.ts +9 -0
  47. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
1
  # Release History
2
+
3
+ ## 1.0.0-beta.4 (2022-11-14)
4
+
5
+ **Features**
6
+
7
+ - Bugs Fixed
8
+
9
+ ## 1.0.0-beta.3 (2022-10-08)
10
+
11
+ **Bugs Fixed**
12
+
13
+ - revert credential scopes
2
14
 
3
15
  ## 1.0.0-beta.2 (2022-09-30)
4
16
 
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.
@@ -1467,20 +1499,31 @@ class ExtensionsImpl {
1467
1499
  [Symbol.asyncIterator]() {
1468
1500
  return this;
1469
1501
  },
1470
- byPage: () => {
1471
- return this.listByFarmBeatsPagingPage(resourceGroupName, farmBeatsResourceName, options);
1502
+ byPage: (settings) => {
1503
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1504
+ throw new Error("maxPageSize is not supported by this operation.");
1505
+ }
1506
+ return this.listByFarmBeatsPagingPage(resourceGroupName, farmBeatsResourceName, options, settings);
1472
1507
  }
1473
1508
  };
1474
1509
  }
1475
- listByFarmBeatsPagingPage(resourceGroupName, farmBeatsResourceName, options) {
1510
+ listByFarmBeatsPagingPage(resourceGroupName, farmBeatsResourceName, options, settings) {
1476
1511
  return tslib.__asyncGenerator(this, arguments, function* listByFarmBeatsPagingPage_1() {
1477
- let result = yield tslib.__await(this._listByFarmBeats(resourceGroupName, farmBeatsResourceName, options));
1478
- yield yield tslib.__await(result.value || []);
1479
- let continuationToken = result.nextLink;
1512
+ let result;
1513
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1514
+ if (!continuationToken) {
1515
+ result = yield tslib.__await(this._listByFarmBeats(resourceGroupName, farmBeatsResourceName, options));
1516
+ let page = result.value || [];
1517
+ continuationToken = result.nextLink;
1518
+ setContinuationToken(page, continuationToken);
1519
+ yield yield tslib.__await(page);
1520
+ }
1480
1521
  while (continuationToken) {
1481
1522
  result = yield tslib.__await(this._listByFarmBeatsNext(resourceGroupName, farmBeatsResourceName, continuationToken, options));
1482
1523
  continuationToken = result.nextLink;
1483
- yield yield tslib.__await(result.value || []);
1524
+ let page = result.value || [];
1525
+ setContinuationToken(page, continuationToken);
1526
+ yield yield tslib.__await(page);
1484
1527
  }
1485
1528
  });
1486
1529
  }
@@ -1737,20 +1780,31 @@ class FarmBeatsExtensionsImpl {
1737
1780
  [Symbol.asyncIterator]() {
1738
1781
  return this;
1739
1782
  },
1740
- byPage: () => {
1741
- return this.listPagingPage(options);
1783
+ byPage: (settings) => {
1784
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1785
+ throw new Error("maxPageSize is not supported by this operation.");
1786
+ }
1787
+ return this.listPagingPage(options, settings);
1742
1788
  }
1743
1789
  };
1744
1790
  }
1745
- listPagingPage(options) {
1791
+ listPagingPage(options, settings) {
1746
1792
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1747
- let result = yield tslib.__await(this._list(options));
1748
- yield yield tslib.__await(result.value || []);
1749
- let continuationToken = result.nextLink;
1793
+ let result;
1794
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1795
+ if (!continuationToken) {
1796
+ result = yield tslib.__await(this._list(options));
1797
+ let page = result.value || [];
1798
+ continuationToken = result.nextLink;
1799
+ setContinuationToken(page, continuationToken);
1800
+ yield yield tslib.__await(page);
1801
+ }
1750
1802
  while (continuationToken) {
1751
1803
  result = yield tslib.__await(this._listNext(continuationToken, options));
1752
1804
  continuationToken = result.nextLink;
1753
- yield yield tslib.__await(result.value || []);
1805
+ let page = result.value || [];
1806
+ setContinuationToken(page, continuationToken);
1807
+ yield yield tslib.__await(page);
1754
1808
  }
1755
1809
  });
1756
1810
  }
@@ -1919,20 +1973,31 @@ class FarmBeatsModelsImpl {
1919
1973
  [Symbol.asyncIterator]() {
1920
1974
  return this;
1921
1975
  },
1922
- byPage: () => {
1923
- return this.listBySubscriptionPagingPage(options);
1976
+ byPage: (settings) => {
1977
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1978
+ throw new Error("maxPageSize is not supported by this operation.");
1979
+ }
1980
+ return this.listBySubscriptionPagingPage(options, settings);
1924
1981
  }
1925
1982
  };
1926
1983
  }
1927
- listBySubscriptionPagingPage(options) {
1984
+ listBySubscriptionPagingPage(options, settings) {
1928
1985
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1929
- let result = yield tslib.__await(this._listBySubscription(options));
1930
- yield yield tslib.__await(result.value || []);
1931
- let continuationToken = result.nextLink;
1986
+ let result;
1987
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1988
+ if (!continuationToken) {
1989
+ result = yield tslib.__await(this._listBySubscription(options));
1990
+ let page = result.value || [];
1991
+ continuationToken = result.nextLink;
1992
+ setContinuationToken(page, continuationToken);
1993
+ yield yield tslib.__await(page);
1994
+ }
1932
1995
  while (continuationToken) {
1933
1996
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1934
1997
  continuationToken = result.nextLink;
1935
- yield yield tslib.__await(result.value || []);
1998
+ let page = result.value || [];
1999
+ setContinuationToken(page, continuationToken);
2000
+ yield yield tslib.__await(page);
1936
2001
  }
1937
2002
  });
1938
2003
  }
@@ -1968,20 +2033,31 @@ class FarmBeatsModelsImpl {
1968
2033
  [Symbol.asyncIterator]() {
1969
2034
  return this;
1970
2035
  },
1971
- byPage: () => {
1972
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
2036
+ byPage: (settings) => {
2037
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2038
+ throw new Error("maxPageSize is not supported by this operation.");
2039
+ }
2040
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1973
2041
  }
1974
2042
  };
1975
2043
  }
1976
- listByResourceGroupPagingPage(resourceGroupName, options) {
2044
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1977
2045
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1978
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1979
- yield yield tslib.__await(result.value || []);
1980
- let continuationToken = result.nextLink;
2046
+ let result;
2047
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2048
+ if (!continuationToken) {
2049
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
2050
+ let page = result.value || [];
2051
+ continuationToken = result.nextLink;
2052
+ setContinuationToken(page, continuationToken);
2053
+ yield yield tslib.__await(page);
2054
+ }
1981
2055
  while (continuationToken) {
1982
2056
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1983
2057
  continuationToken = result.nextLink;
1984
- yield yield tslib.__await(result.value || []);
2058
+ let page = result.value || [];
2059
+ setContinuationToken(page, continuationToken);
2060
+ yield yield tslib.__await(page);
1985
2061
  }
1986
2062
  });
1987
2063
  }
@@ -2421,20 +2497,31 @@ class OperationsImpl {
2421
2497
  [Symbol.asyncIterator]() {
2422
2498
  return this;
2423
2499
  },
2424
- byPage: () => {
2425
- return this.listPagingPage(options);
2500
+ byPage: (settings) => {
2501
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2502
+ throw new Error("maxPageSize is not supported by this operation.");
2503
+ }
2504
+ return this.listPagingPage(options, settings);
2426
2505
  }
2427
2506
  };
2428
2507
  }
2429
- listPagingPage(options) {
2508
+ listPagingPage(options, settings) {
2430
2509
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2431
- let result = yield tslib.__await(this._list(options));
2432
- yield yield tslib.__await(result.value || []);
2433
- let continuationToken = result.nextLink;
2510
+ let result;
2511
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2512
+ if (!continuationToken) {
2513
+ result = yield tslib.__await(this._list(options));
2514
+ let page = result.value || [];
2515
+ continuationToken = result.nextLink;
2516
+ setContinuationToken(page, continuationToken);
2517
+ yield yield tslib.__await(page);
2518
+ }
2434
2519
  while (continuationToken) {
2435
2520
  result = yield tslib.__await(this._listNext(continuationToken, options));
2436
2521
  continuationToken = result.nextLink;
2437
- yield yield tslib.__await(result.value || []);
2522
+ let page = result.value || [];
2523
+ setContinuationToken(page, continuationToken);
2524
+ yield yield tslib.__await(page);
2438
2525
  }
2439
2526
  });
2440
2527
  }
@@ -2539,14 +2626,18 @@ class PrivateEndpointConnectionsImpl {
2539
2626
  [Symbol.asyncIterator]() {
2540
2627
  return this;
2541
2628
  },
2542
- byPage: () => {
2543
- return this.listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options);
2629
+ byPage: (settings) => {
2630
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2631
+ throw new Error("maxPageSize is not supported by this operation.");
2632
+ }
2633
+ return this.listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options, settings);
2544
2634
  }
2545
2635
  };
2546
2636
  }
2547
- listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options) {
2637
+ listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options, _settings) {
2548
2638
  return tslib.__asyncGenerator(this, arguments, function* listByResourcePagingPage_1() {
2549
- let result = yield tslib.__await(this._listByResource(resourceGroupName, farmBeatsResourceName, options));
2639
+ let result;
2640
+ result = yield tslib.__await(this._listByResource(resourceGroupName, farmBeatsResourceName, options));
2550
2641
  yield yield tslib.__await(result.value || []);
2551
2642
  });
2552
2643
  }
@@ -2798,14 +2889,18 @@ class PrivateLinkResourcesImpl {
2798
2889
  [Symbol.asyncIterator]() {
2799
2890
  return this;
2800
2891
  },
2801
- byPage: () => {
2802
- return this.listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options);
2892
+ byPage: (settings) => {
2893
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2894
+ throw new Error("maxPageSize is not supported by this operation.");
2895
+ }
2896
+ return this.listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options, settings);
2803
2897
  }
2804
2898
  };
2805
2899
  }
2806
- listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options) {
2900
+ listByResourcePagingPage(resourceGroupName, farmBeatsResourceName, options, _settings) {
2807
2901
  return tslib.__asyncGenerator(this, arguments, function* listByResourcePagingPage_1() {
2808
- let result = yield tslib.__await(this._listByResource(resourceGroupName, farmBeatsResourceName, options));
2902
+ let result;
2903
+ result = yield tslib.__await(this._listByResource(resourceGroupName, farmBeatsResourceName, options));
2809
2904
  yield yield tslib.__await(result.value || []);
2810
2905
  });
2811
2906
  }
@@ -2912,7 +3007,7 @@ class AgriFoodMgmtClient extends coreClient__namespace.ServiceClient {
2912
3007
  * @param options The parameter options
2913
3008
  */
2914
3009
  constructor(credentials, subscriptionId, options) {
2915
- var _a, _b;
3010
+ var _a, _b, _c;
2916
3011
  if (credentials === undefined) {
2917
3012
  throw new Error("'credentials' cannot be null");
2918
3013
  }
@@ -2927,13 +3022,13 @@ class AgriFoodMgmtClient extends coreClient__namespace.ServiceClient {
2927
3022
  requestContentType: "application/json; charset=utf-8",
2928
3023
  credential: credentials
2929
3024
  };
2930
- const packageDetails = `azsdk-js-arm-agrifood/1.0.0-beta.2`;
3025
+ const packageDetails = `azsdk-js-arm-agrifood/1.0.0-beta.4`;
2931
3026
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2932
3027
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2933
3028
  : `${packageDetails}`;
2934
3029
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2935
3030
  userAgentPrefix
2936
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3031
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2937
3032
  super(optionsWithDefaults);
2938
3033
  let bearerTokenAuthenticationPolicyFound = false;
2939
3034
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
@@ -2950,7 +3045,7 @@ class AgriFoodMgmtClient extends coreClient__namespace.ServiceClient {
2950
3045
  });
2951
3046
  this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2952
3047
  credential: credentials,
2953
- scopes: `${optionsWithDefaults.credentialScopes}`,
3048
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2954
3049
  challengeCallbacks: {
2955
3050
  authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2956
3051
  }
@@ -3000,4 +3095,5 @@ class AgriFoodMgmtClient extends coreClient__namespace.ServiceClient {
3000
3095
  }
3001
3096
 
3002
3097
  exports.AgriFoodMgmtClient = AgriFoodMgmtClient;
3098
+ exports.getContinuationToken = getContinuationToken;
3003
3099
  //# sourceMappingURL=index.js.map