@azure/keyvault-admin 4.2.0-alpha.20211105.1 → 4.2.0-alpha.20211210.3

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.
package/dist/index.js CHANGED
@@ -1,63 +1,31 @@
1
- /*!
2
- * Copyright (c) Microsoft and contributors. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
5
- *
6
- * Azure KeyVault Admin SDK for JavaScript - 4.2.0-alpha.20211105.1
7
- */
8
1
  'use strict';
9
2
 
10
3
  Object.defineProperty(exports, '__esModule', { value: true });
11
4
 
12
5
  var tslib = require('tslib');
13
- var coreTracing = require('@azure/core-tracing');
14
6
  var coreClient = require('@azure/core-client');
15
- var logger$1 = require('@azure/logger');
16
- var uuid = require('uuid');
17
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
18
8
  require('@azure/core-http');
19
9
  require('url');
10
+ var coreTracing = require('@azure/core-tracing');
11
+ var logger$1 = require('@azure/logger');
12
+ var uuid = require('uuid');
20
13
  var coreLro = require('@azure/core-lro');
21
14
 
22
15
  // Copyright (c) Microsoft Corporation.
16
+ // Licensed under the MIT license.
23
17
  /**
24
- * Returns a function that can be used for tracing options.
25
- *
26
- * @param prefix - The prefix to use, likely the name of the class / client.
27
- *
28
- * @example const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient")
29
- *
30
- * @internal
18
+ * Current version of the Key Vault Admin SDK.
31
19
  */
32
- function createTraceFunction(prefix) {
33
- const createSpan = coreTracing.createSpanFunction({
34
- namespace: "Microsoft.KeyVault",
35
- packagePrefix: prefix
36
- });
37
- return async function (operationName, options, cb) {
38
- const { updatedOptions, span } = createSpan(operationName, options);
39
- try {
40
- // NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly
41
- // close the span.
42
- const result = await cb(updatedOptions, span);
43
- // otel 0.16+ needs this or else the code ends up being set as UNSET
44
- span.setStatus({
45
- code: coreTracing.SpanStatusCode.OK
46
- });
47
- return result;
48
- }
49
- catch (err) {
50
- span.setStatus({
51
- code: coreTracing.SpanStatusCode.ERROR,
52
- message: err.message
53
- });
54
- throw err;
55
- }
56
- finally {
57
- span.end();
58
- }
59
- };
60
- }
20
+ const SDK_VERSION = "4.2.0-beta.2";
21
+ /**
22
+ * The latest supported Key Vault service API version.
23
+ */
24
+ const LATEST_API_VERSION = "7.3-preview";
25
+ /**
26
+ * Authentication scopes
27
+ */
28
+ const authenticationScopes = ["https://managedhsm.azure.net/.default"];
61
29
 
62
30
  /*
63
31
  * Copyright (c) Microsoft Corporation.
@@ -1443,75 +1411,6 @@ const selectiveKeyRestoreOperationOperationSpec = {
1443
1411
  serializer: serializer$2
1444
1412
  };
1445
1413
 
1446
- // Copyright (c) Microsoft Corporation.
1447
- // Licensed under the MIT license.
1448
- /**
1449
- * Current version of the Key Vault Admin SDK.
1450
- */
1451
- const SDK_VERSION = "4.2.0-beta.2";
1452
- /**
1453
- * The latest supported Key Vault service API version.
1454
- */
1455
- const LATEST_API_VERSION = "7.3-preview";
1456
- /**
1457
- * Authentication scopes
1458
- */
1459
- const authenticationScopes = ["https://managedhsm.azure.net/.default"];
1460
-
1461
- // Copyright (c) Microsoft Corporation.
1462
- // Licensed under the MIT license.
1463
- const mappings = {
1464
- roleAssignment: {
1465
- generatedToPublic(roleAssignment) {
1466
- const { id, name, type, properties } = roleAssignment;
1467
- const { scope, roleDefinitionId, principalId } = properties || {};
1468
- return {
1469
- id: id,
1470
- name: name,
1471
- kind: type,
1472
- properties: {
1473
- scope: scope,
1474
- roleDefinitionId: roleDefinitionId,
1475
- principalId: principalId
1476
- }
1477
- };
1478
- }
1479
- },
1480
- roleDefinition: {
1481
- generatedToPublic(roleDefinition) {
1482
- const { id, name, type, roleName, description, roleType, permissions, assignableScopes } = roleDefinition;
1483
- return {
1484
- id: id,
1485
- name: name,
1486
- kind: type,
1487
- roleName: roleName,
1488
- description: description,
1489
- roleType: roleType,
1490
- permissions: permissions,
1491
- assignableScopes: assignableScopes
1492
- };
1493
- }
1494
- },
1495
- folderUriParts(folderUri) {
1496
- const uriParts = folderUri.split("/");
1497
- const folderName = uriParts.pop();
1498
- const storageUri = uriParts.join("/");
1499
- if (!folderName) {
1500
- throw new Error("The provided folder URI is missing the folder name.");
1501
- }
1502
- return {
1503
- folderName,
1504
- folderUri: storageUri
1505
- };
1506
- }
1507
- };
1508
-
1509
- // Copyright (c) Microsoft Corporation.
1510
- /**
1511
- * The \@azure/logger configuration for this package.
1512
- */
1513
- const logger = logger$1.createClientLogger("keyvault-admin");
1514
-
1515
1414
  // Copyright (c) Microsoft Corporation.
1516
1415
  // Licensed under the MIT license.
1517
1416
  /**
@@ -1643,6 +1542,100 @@ function createChallengeCallbacks() {
1643
1542
  };
1644
1543
  }
1645
1544
 
1545
+ // Copyright (c) Microsoft Corporation.
1546
+ /**
1547
+ * Returns a function that can be used for tracing options.
1548
+ *
1549
+ * @param prefix - The prefix to use, likely the name of the class / client.
1550
+ *
1551
+ * @example const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient")
1552
+ *
1553
+ * @internal
1554
+ */
1555
+ function createTraceFunction(prefix) {
1556
+ const createSpan = coreTracing.createSpanFunction({
1557
+ namespace: "Microsoft.KeyVault",
1558
+ packagePrefix: prefix
1559
+ });
1560
+ return async function (operationName, options, cb) {
1561
+ const { updatedOptions, span } = createSpan(operationName, options);
1562
+ try {
1563
+ // NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly
1564
+ // close the span.
1565
+ const result = await cb(updatedOptions, span);
1566
+ // otel 0.16+ needs this or else the code ends up being set as UNSET
1567
+ span.setStatus({
1568
+ code: coreTracing.SpanStatusCode.OK
1569
+ });
1570
+ return result;
1571
+ }
1572
+ catch (err) {
1573
+ span.setStatus({
1574
+ code: coreTracing.SpanStatusCode.ERROR,
1575
+ message: err.message
1576
+ });
1577
+ throw err;
1578
+ }
1579
+ finally {
1580
+ span.end();
1581
+ }
1582
+ };
1583
+ }
1584
+
1585
+ // Copyright (c) Microsoft Corporation.
1586
+ /**
1587
+ * The \@azure/logger configuration for this package.
1588
+ */
1589
+ const logger = logger$1.createClientLogger("keyvault-admin");
1590
+
1591
+ // Copyright (c) Microsoft Corporation.
1592
+ // Licensed under the MIT license.
1593
+ const mappings = {
1594
+ roleAssignment: {
1595
+ generatedToPublic(roleAssignment) {
1596
+ const { id, name, type, properties } = roleAssignment;
1597
+ const { scope, roleDefinitionId, principalId } = properties || {};
1598
+ return {
1599
+ id: id,
1600
+ name: name,
1601
+ kind: type,
1602
+ properties: {
1603
+ scope: scope,
1604
+ roleDefinitionId: roleDefinitionId,
1605
+ principalId: principalId
1606
+ }
1607
+ };
1608
+ }
1609
+ },
1610
+ roleDefinition: {
1611
+ generatedToPublic(roleDefinition) {
1612
+ const { id, name, type, roleName, description, roleType, permissions, assignableScopes } = roleDefinition;
1613
+ return {
1614
+ id: id,
1615
+ name: name,
1616
+ kind: type,
1617
+ roleName: roleName,
1618
+ description: description,
1619
+ roleType: roleType,
1620
+ permissions: permissions,
1621
+ assignableScopes: assignableScopes
1622
+ };
1623
+ }
1624
+ },
1625
+ folderUriParts(folderUri) {
1626
+ const uriParts = folderUri.split("/");
1627
+ const folderName = uriParts.pop();
1628
+ const storageUri = uriParts.join("/");
1629
+ if (!folderName) {
1630
+ throw new Error("The provided folder URI is missing the folder name.");
1631
+ }
1632
+ return {
1633
+ folderName,
1634
+ folderUri: storageUri
1635
+ };
1636
+ }
1637
+ };
1638
+
1646
1639
  // Copyright (c) Microsoft Corporation.
1647
1640
  const withTrace = createTraceFunction("Azure.KeyVault.Admin.KeyVaultAccessControlClient");
1648
1641
  /**