@azure/arm-attestation 2.0.3-alpha.20221102.1 → 2.1.0-alpha.20221117.2

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 (35) hide show
  1. package/CHANGELOG.md +9 -11
  2. package/dist/index.js +101 -11
  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/attestationManagementClient.d.ts +2 -0
  7. package/dist-esm/src/attestationManagementClient.d.ts.map +1 -1
  8. package/dist-esm/src/attestationManagementClient.js +54 -6
  9. package/dist-esm/src/attestationManagementClient.js.map +1 -1
  10. package/dist-esm/src/index.d.ts +1 -0
  11. package/dist-esm/src/index.d.ts.map +1 -1
  12. package/dist-esm/src/index.js +1 -0
  13. package/dist-esm/src/index.js.map +1 -1
  14. package/dist-esm/src/models/index.d.ts +20 -6
  15. package/dist-esm/src/models/index.d.ts.map +1 -1
  16. package/dist-esm/src/models/index.js +14 -0
  17. package/dist-esm/src/models/index.js.map +1 -1
  18. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  19. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  20. package/dist-esm/src/operations/privateEndpointConnections.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/dist-esm/test/attestation_examples.d.ts.map +1 -1
  26. package/dist-esm/test/attestation_examples.js +16 -18
  27. package/dist-esm/test/attestation_examples.js.map +1 -1
  28. package/package.json +13 -9
  29. package/review/arm-attestation.api.md +13 -24
  30. package/src/attestationManagementClient.ts +69 -5
  31. package/src/index.ts +1 -0
  32. package/src/models/index.ts +20 -6
  33. package/src/operations/privateEndpointConnections.ts +15 -5
  34. package/src/pagingHelper.ts +39 -0
  35. package/types/arm-attestation.d.ts +31 -6
package/CHANGELOG.md CHANGED
@@ -1,15 +1,13 @@
1
1
  # Release History
2
-
3
- ## 2.0.3 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
2
+
3
+ ## 2.1.0 (2022-11-16)
4
+
5
+ **Features**
6
+
7
+ - Added Interface AttestationProvider
8
+ - Added Interface PrivateEndpointConnection
9
+ - Added Interface TrackedResource
10
+
13
11
  ## 2.0.2 (2022-10-08)
14
12
 
15
13
  **Bugs Fixed**
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var coreClient = require('@azure/core-client');
6
5
  var tslib = require('tslib');
6
+ var coreClient = require('@azure/core-client');
7
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
7
8
 
8
9
  function _interopNamespace(e) {
9
10
  if (e && e.__esModule) return e;
@@ -24,6 +25,30 @@ function _interopNamespace(e) {
24
25
  }
25
26
 
26
27
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
29
+
30
+ /*
31
+ * Copyright (c) Microsoft Corporation.
32
+ * Licensed under the MIT License.
33
+ *
34
+ * Code generated by Microsoft (R) AutoRest Code Generator.
35
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
36
+ */
37
+ const pageMap = new WeakMap();
38
+ /**
39
+ * Given a result page from a pageable operation, returns a
40
+ * continuation token that can be used to begin paging from
41
+ * that point later.
42
+ * @param page A result object from calling .byPage() on a paged operation.
43
+ * @returns The continuation token that can be passed into byPage().
44
+ */
45
+ function getContinuationToken(page) {
46
+ var _a;
47
+ if (typeof page !== "object" || page === null) {
48
+ return undefined;
49
+ }
50
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
51
+ }
27
52
 
28
53
  /*
29
54
  * Copyright (c) Microsoft Corporation.
@@ -35,31 +60,45 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
35
60
  /** Known values of {@link CreatedByType} that the service accepts. */
36
61
  exports.KnownCreatedByType = void 0;
37
62
  (function (KnownCreatedByType) {
63
+ /** User */
38
64
  KnownCreatedByType["User"] = "User";
65
+ /** Application */
39
66
  KnownCreatedByType["Application"] = "Application";
67
+ /** ManagedIdentity */
40
68
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
69
+ /** Key */
41
70
  KnownCreatedByType["Key"] = "Key";
42
71
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
43
72
  /** Known values of {@link AttestationServiceStatus} that the service accepts. */
44
73
  exports.KnownAttestationServiceStatus = void 0;
45
74
  (function (KnownAttestationServiceStatus) {
75
+ /** Ready */
46
76
  KnownAttestationServiceStatus["Ready"] = "Ready";
77
+ /** NotReady */
47
78
  KnownAttestationServiceStatus["NotReady"] = "NotReady";
79
+ /** Error */
48
80
  KnownAttestationServiceStatus["Error"] = "Error";
49
81
  })(exports.KnownAttestationServiceStatus || (exports.KnownAttestationServiceStatus = {}));
50
82
  /** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */
51
83
  exports.KnownPrivateEndpointServiceConnectionStatus = void 0;
52
84
  (function (KnownPrivateEndpointServiceConnectionStatus) {
85
+ /** Pending */
53
86
  KnownPrivateEndpointServiceConnectionStatus["Pending"] = "Pending";
87
+ /** Approved */
54
88
  KnownPrivateEndpointServiceConnectionStatus["Approved"] = "Approved";
89
+ /** Rejected */
55
90
  KnownPrivateEndpointServiceConnectionStatus["Rejected"] = "Rejected";
56
91
  })(exports.KnownPrivateEndpointServiceConnectionStatus || (exports.KnownPrivateEndpointServiceConnectionStatus = {}));
57
92
  /** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */
58
93
  exports.KnownPrivateEndpointConnectionProvisioningState = void 0;
59
94
  (function (KnownPrivateEndpointConnectionProvisioningState) {
95
+ /** Succeeded */
60
96
  KnownPrivateEndpointConnectionProvisioningState["Succeeded"] = "Succeeded";
97
+ /** Creating */
61
98
  KnownPrivateEndpointConnectionProvisioningState["Creating"] = "Creating";
99
+ /** Deleting */
62
100
  KnownPrivateEndpointConnectionProvisioningState["Deleting"] = "Deleting";
101
+ /** Failed */
63
102
  KnownPrivateEndpointConnectionProvisioningState["Failed"] = "Failed";
64
103
  })(exports.KnownPrivateEndpointConnectionProvisioningState || (exports.KnownPrivateEndpointConnectionProvisioningState = {}));
65
104
 
@@ -1112,14 +1151,18 @@ class PrivateEndpointConnectionsImpl {
1112
1151
  [Symbol.asyncIterator]() {
1113
1152
  return this;
1114
1153
  },
1115
- byPage: () => {
1116
- return this.listPagingPage(resourceGroupName, providerName, options);
1154
+ byPage: (settings) => {
1155
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1156
+ throw new Error("maxPageSize is not supported by this operation.");
1157
+ }
1158
+ return this.listPagingPage(resourceGroupName, providerName, options, settings);
1117
1159
  }
1118
1160
  };
1119
1161
  }
1120
- listPagingPage(resourceGroupName, providerName, options) {
1162
+ listPagingPage(resourceGroupName, providerName, options, _settings) {
1121
1163
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1122
- let result = yield tslib.__await(this._list(resourceGroupName, providerName, options));
1164
+ let result;
1165
+ result = yield tslib.__await(this._list(resourceGroupName, providerName, options));
1123
1166
  yield yield tslib.__await(result.value || []);
1124
1167
  });
1125
1168
  }
@@ -1307,7 +1350,7 @@ class AttestationManagementClient extends coreClient__namespace.ServiceClient {
1307
1350
  * @param options The parameter options
1308
1351
  */
1309
1352
  constructor(credentials, subscriptionId, options) {
1310
- var _a, _b;
1353
+ var _a, _b, _c;
1311
1354
  if (credentials === undefined) {
1312
1355
  throw new Error("'credentials' cannot be null");
1313
1356
  }
@@ -1322,17 +1365,35 @@ class AttestationManagementClient extends coreClient__namespace.ServiceClient {
1322
1365
  requestContentType: "application/json; charset=utf-8",
1323
1366
  credential: credentials
1324
1367
  };
1325
- const packageDetails = `azsdk-js-arm-attestation/2.0.3`;
1368
+ const packageDetails = `azsdk-js-arm-attestation/2.1.0`;
1326
1369
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1327
1370
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1328
1371
  : `${packageDetails}`;
1329
- if (!options.credentialScopes) {
1330
- options.credentialScopes = ["https://management.azure.com/.default"];
1331
- }
1332
1372
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1333
1373
  userAgentPrefix
1334
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1374
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1335
1375
  super(optionsWithDefaults);
1376
+ let bearerTokenAuthenticationPolicyFound = false;
1377
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1378
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1379
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1380
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1381
+ }
1382
+ if (!options ||
1383
+ !options.pipeline ||
1384
+ options.pipeline.getOrderedPolicies().length == 0 ||
1385
+ !bearerTokenAuthenticationPolicyFound) {
1386
+ this.pipeline.removePolicy({
1387
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1388
+ });
1389
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1390
+ credential: credentials,
1391
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
1392
+ challengeCallbacks: {
1393
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1394
+ }
1395
+ }));
1396
+ }
1336
1397
  // Parameter assignments
1337
1398
  this.subscriptionId = subscriptionId;
1338
1399
  // Assigning values to Constant parameters
@@ -1341,8 +1402,37 @@ class AttestationManagementClient extends coreClient__namespace.ServiceClient {
1341
1402
  this.operations = new OperationsImpl(this);
1342
1403
  this.attestationProviders = new AttestationProvidersImpl(this);
1343
1404
  this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
1405
+ this.addCustomApiVersionPolicy(options.apiVersion);
1406
+ }
1407
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1408
+ addCustomApiVersionPolicy(apiVersion) {
1409
+ if (!apiVersion) {
1410
+ return;
1411
+ }
1412
+ const apiVersionPolicy = {
1413
+ name: "CustomApiVersionPolicy",
1414
+ sendRequest(request, next) {
1415
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1416
+ const param = request.url.split("?");
1417
+ if (param.length > 1) {
1418
+ const newParams = param[1].split("&").map((item) => {
1419
+ if (item.indexOf("api-version") > -1) {
1420
+ return "api-version=" + apiVersion;
1421
+ }
1422
+ else {
1423
+ return item;
1424
+ }
1425
+ });
1426
+ request.url = param[0] + "?" + newParams.join("&");
1427
+ }
1428
+ return next(request);
1429
+ });
1430
+ }
1431
+ };
1432
+ this.pipeline.addPolicy(apiVersionPolicy);
1344
1433
  }
1345
1434
  }
1346
1435
 
1347
1436
  exports.AttestationManagementClient = AttestationManagementClient;
1437
+ exports.getContinuationToken = getContinuationToken;
1348
1438
  //# sourceMappingURL=index.js.map