@azure/keyvault-certificates 4.4.0-beta.2 → 4.4.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 (48) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +14 -11
  3. package/dist/index.js +286 -153
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/keyvault-certificates/src/certificatesModels.js +42 -2
  6. package/dist-esm/keyvault-certificates/src/certificatesModels.js.map +1 -1
  7. package/dist-esm/keyvault-certificates/src/constants.js +1 -1
  8. package/dist-esm/keyvault-certificates/src/constants.js.map +1 -1
  9. package/dist-esm/keyvault-certificates/src/generated/keyVaultClient.js +1 -1
  10. package/dist-esm/keyvault-certificates/src/generated/keyVaultClient.js.map +1 -1
  11. package/dist-esm/keyvault-certificates/src/generated/keyVaultClientContext.js +6 -7
  12. package/dist-esm/keyvault-certificates/src/generated/keyVaultClientContext.js.map +1 -1
  13. package/dist-esm/keyvault-certificates/src/generated/models/index.js +55 -1
  14. package/dist-esm/keyvault-certificates/src/generated/models/index.js.map +1 -1
  15. package/dist-esm/keyvault-certificates/src/identifier.js.map +1 -1
  16. package/dist-esm/keyvault-certificates/src/index.js +27 -23
  17. package/dist-esm/keyvault-certificates/src/index.js.map +1 -1
  18. package/dist-esm/keyvault-certificates/src/lro/create/operation.js +2 -2
  19. package/dist-esm/keyvault-certificates/src/lro/create/operation.js.map +1 -1
  20. package/dist-esm/keyvault-certificates/src/lro/create/poller.js +2 -2
  21. package/dist-esm/keyvault-certificates/src/lro/create/poller.js.map +1 -1
  22. package/dist-esm/keyvault-certificates/src/lro/delete/operation.js +1 -1
  23. package/dist-esm/keyvault-certificates/src/lro/delete/operation.js.map +1 -1
  24. package/dist-esm/keyvault-certificates/src/lro/delete/poller.js +2 -2
  25. package/dist-esm/keyvault-certificates/src/lro/delete/poller.js.map +1 -1
  26. package/dist-esm/keyvault-certificates/src/lro/keyVaultCertificatePoller.js +2 -2
  27. package/dist-esm/keyvault-certificates/src/lro/keyVaultCertificatePoller.js.map +1 -1
  28. package/dist-esm/keyvault-certificates/src/lro/operation/operation.js +3 -3
  29. package/dist-esm/keyvault-certificates/src/lro/operation/operation.js.map +1 -1
  30. package/dist-esm/keyvault-certificates/src/lro/operation/poller.js +2 -2
  31. package/dist-esm/keyvault-certificates/src/lro/operation/poller.js.map +1 -1
  32. package/dist-esm/keyvault-certificates/src/lro/recover/operation.js +2 -2
  33. package/dist-esm/keyvault-certificates/src/lro/recover/operation.js.map +1 -1
  34. package/dist-esm/keyvault-certificates/src/lro/recover/poller.js +3 -3
  35. package/dist-esm/keyvault-certificates/src/lro/recover/poller.js.map +1 -1
  36. package/dist-esm/keyvault-certificates/src/transformations.js +23 -23
  37. package/dist-esm/keyvault-certificates/src/transformations.js.map +1 -1
  38. package/dist-esm/keyvault-certificates/src/utils.js.map +1 -1
  39. package/dist-esm/keyvault-common/src/challengeBasedAuthenticationPolicy.js +4 -4
  40. package/dist-esm/keyvault-common/src/challengeBasedAuthenticationPolicy.js.map +1 -1
  41. package/dist-esm/keyvault-common/src/parseKeyvaultIdentifier.js +1 -1
  42. package/dist-esm/keyvault-common/src/parseKeyvaultIdentifier.js.map +1 -1
  43. package/dist-esm/keyvault-common/src/parseWWWAuthenticate.js +1 -1
  44. package/dist-esm/keyvault-common/src/parseWWWAuthenticate.js.map +1 -1
  45. package/dist-esm/keyvault-common/src/tracingHelpers.js +4 -4
  46. package/dist-esm/keyvault-common/src/tracingHelpers.js.map +1 -1
  47. package/package.json +13 -28
  48. package/types/keyvault-certificates.d.ts +12 -8
package/dist/index.js CHANGED
@@ -1,10 +1,3 @@
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 Certificates SDK for JavaScript - 4.4.0-beta.2
7
- */
8
1
  'use strict';
9
2
 
10
3
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -13,9 +6,30 @@ var tslib = require('tslib');
13
6
  var coreHttp = require('@azure/core-http');
14
7
  var logger$1 = require('@azure/logger');
15
8
  require('@azure/core-paging');
9
+ var coreLro = require('@azure/core-lro');
16
10
  var url = require('url');
17
11
  var coreTracing = require('@azure/core-tracing');
18
- var coreLro = require('@azure/core-lro');
12
+
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var coreHttp__namespace = /*#__PURE__*/_interopNamespace(coreHttp);
32
+ var url__namespace = /*#__PURE__*/_interopNamespace(url);
19
33
 
20
34
  // Copyright (c) Microsoft Corporation.
21
35
  /**
@@ -28,7 +42,11 @@ const logger = logger$1.createClientLogger("keyvault-certificates");
28
42
  /**
29
43
  * The latest supported KeyVault service API version
30
44
  */
31
- const LATEST_API_VERSION = "7.3-preview";
45
+ const LATEST_API_VERSION = "7.3";
46
+ /**
47
+ * Well known issuers for choosing a default
48
+ */
49
+ exports.WellKnownIssuer = void 0;
32
50
  (function (WellKnownIssuerNames) {
33
51
  /**
34
52
  * For self signed certificates
@@ -46,8 +64,10 @@ const LATEST_API_VERSION = "7.3-preview";
46
64
  */
47
65
  const DefaultCertificatePolicy = {
48
66
  issuerName: "Self",
49
- subject: "cn=MyCert"
67
+ subject: "cn=MyCert",
50
68
  };
69
+ /** Known values of {@link CertificateKeyCurveName} that the service accepts. */
70
+ exports.KnownCertificateKeyCurveNames = void 0;
51
71
  (function (KnownCertificateKeyCurveNames) {
52
72
  /**
53
73
  * P-256 Key Curve.
@@ -66,6 +86,8 @@ const DefaultCertificatePolicy = {
66
86
  */
67
87
  KnownCertificateKeyCurveNames["P256K"] = "P-256K";
68
88
  })(exports.KnownCertificateKeyCurveNames || (exports.KnownCertificateKeyCurveNames = {}));
89
+ /** Known values of {@link CertificateKeyType} that the service accepts. */
90
+ exports.KnownCertificateKeyTypes = void 0;
69
91
  (function (KnownCertificateKeyTypes) {
70
92
  /**
71
93
  * EC Key Type.
@@ -92,6 +114,109 @@ const DefaultCertificatePolicy = {
92
114
  */
93
115
  KnownCertificateKeyTypes["OctHSM"] = "oct-HSM";
94
116
  })(exports.KnownCertificateKeyTypes || (exports.KnownCertificateKeyTypes = {}));
117
+ /** Known values of {@link KeyUsageType} that the service accepts. */
118
+ exports.KnownKeyUsageTypes = void 0;
119
+ (function (KnownKeyUsageTypes) {
120
+ /**
121
+ * DigitalSignature Usage Type.
122
+ */
123
+ KnownKeyUsageTypes["DigitalSignature"] = "digitalSignature";
124
+ /**
125
+ * NonRepudiation Usage Type.
126
+ */
127
+ KnownKeyUsageTypes["NonRepudiation"] = "nonRepudiation";
128
+ /**
129
+ * KeyEncipherment Usage Type.
130
+ */
131
+ KnownKeyUsageTypes["KeyEncipherment"] = "keyEncipherment";
132
+ /**
133
+ * DataEncipherment Usage Type.
134
+ */
135
+ KnownKeyUsageTypes["DataEncipherment"] = "dataEncipherment";
136
+ /**
137
+ * KeyAgreement Usage Type.
138
+ */
139
+ KnownKeyUsageTypes["KeyAgreement"] = "keyAgreement";
140
+ /**
141
+ * KeyCertSign Usage Type.
142
+ */
143
+ KnownKeyUsageTypes["KeyCertSign"] = "keyCertSign";
144
+ /**
145
+ * CRLSign Usage Type.
146
+ */
147
+ KnownKeyUsageTypes["CRLSign"] = "cRLSign";
148
+ /**
149
+ * EncipherOnly Usage Type.
150
+ */
151
+ KnownKeyUsageTypes["EncipherOnly"] = "encipherOnly";
152
+ /**
153
+ * DecipherOnly Usage Type.
154
+ */
155
+ KnownKeyUsageTypes["DecipherOnly"] = "decipherOnly";
156
+ })(exports.KnownKeyUsageTypes || (exports.KnownKeyUsageTypes = {}));
157
+
158
+ /*
159
+ * Copyright (c) Microsoft Corporation.
160
+ * Licensed under the MIT License.
161
+ *
162
+ * Code generated by Microsoft (R) AutoRest Code Generator.
163
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
164
+ */
165
+ /** Known values of {@link ApiVersion73} that the service accepts. */
166
+ var KnownApiVersion73;
167
+ (function (KnownApiVersion73) {
168
+ /** Api Version '7.3' */
169
+ KnownApiVersion73["Seven3"] = "7.3";
170
+ })(KnownApiVersion73 || (KnownApiVersion73 = {}));
171
+ /** Known values of {@link DeletionRecoveryLevel} that the service accepts. */
172
+ exports.KnownDeletionRecoveryLevels = void 0;
173
+ (function (KnownDeletionRecoveryLevel) {
174
+ /** Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.) */
175
+ KnownDeletionRecoveryLevel["Purgeable"] = "Purgeable";
176
+ /** Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered */
177
+ KnownDeletionRecoveryLevel["RecoverablePurgeable"] = "Recoverable+Purgeable";
178
+ /** Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered */
179
+ KnownDeletionRecoveryLevel["Recoverable"] = "Recoverable";
180
+ /** Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered */
181
+ KnownDeletionRecoveryLevel["RecoverableProtectedSubscription"] = "Recoverable+ProtectedSubscription";
182
+ /** Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled. */
183
+ KnownDeletionRecoveryLevel["CustomizedRecoverablePurgeable"] = "CustomizedRecoverable+Purgeable";
184
+ /** Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available. */
185
+ KnownDeletionRecoveryLevel["CustomizedRecoverable"] = "CustomizedRecoverable";
186
+ /** Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled. */
187
+ KnownDeletionRecoveryLevel["CustomizedRecoverableProtectedSubscription"] = "CustomizedRecoverable+ProtectedSubscription";
188
+ })(exports.KnownDeletionRecoveryLevels || (exports.KnownDeletionRecoveryLevels = {}));
189
+ /** Known values of {@link JsonWebKeyType} that the service accepts. */
190
+ var KnownJsonWebKeyType;
191
+ (function (KnownJsonWebKeyType) {
192
+ KnownJsonWebKeyType["EC"] = "EC";
193
+ KnownJsonWebKeyType["ECHSM"] = "EC-HSM";
194
+ KnownJsonWebKeyType["RSA"] = "RSA";
195
+ KnownJsonWebKeyType["RSAHSM"] = "RSA-HSM";
196
+ KnownJsonWebKeyType["Oct"] = "oct";
197
+ KnownJsonWebKeyType["OctHSM"] = "oct-HSM";
198
+ })(KnownJsonWebKeyType || (KnownJsonWebKeyType = {}));
199
+ /** Known values of {@link JsonWebKeyCurveName} that the service accepts. */
200
+ var KnownJsonWebKeyCurveName;
201
+ (function (KnownJsonWebKeyCurveName) {
202
+ KnownJsonWebKeyCurveName["P256"] = "P-256";
203
+ KnownJsonWebKeyCurveName["P384"] = "P-384";
204
+ KnownJsonWebKeyCurveName["P521"] = "P-521";
205
+ KnownJsonWebKeyCurveName["P256K"] = "P-256K";
206
+ })(KnownJsonWebKeyCurveName || (KnownJsonWebKeyCurveName = {}));
207
+ /** Known values of {@link KeyUsageType} that the service accepts. */
208
+ var KnownKeyUsageType;
209
+ (function (KnownKeyUsageType) {
210
+ KnownKeyUsageType["DigitalSignature"] = "digitalSignature";
211
+ KnownKeyUsageType["NonRepudiation"] = "nonRepudiation";
212
+ KnownKeyUsageType["KeyEncipherment"] = "keyEncipherment";
213
+ KnownKeyUsageType["DataEncipherment"] = "dataEncipherment";
214
+ KnownKeyUsageType["KeyAgreement"] = "keyAgreement";
215
+ KnownKeyUsageType["KeyCertSign"] = "keyCertSign";
216
+ KnownKeyUsageType["CRLSign"] = "cRLSign";
217
+ KnownKeyUsageType["EncipherOnly"] = "encipherOnly";
218
+ KnownKeyUsageType["DecipherOnly"] = "decipherOnly";
219
+ })(KnownKeyUsageType || (KnownKeyUsageType = {}));
95
220
 
96
221
  /*
97
222
  * Copyright (c) Microsoft Corporation.
@@ -1470,9 +1595,9 @@ const nextLink = {
1470
1595
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1471
1596
  */
1472
1597
  const packageName = "@azure/keyvault-certificates";
1473
- const packageVersion = "4.4.0-beta.2";
1474
- /** @hidden */
1475
- class KeyVaultClientContext extends coreHttp.ServiceClient {
1598
+ const packageVersion = "4.4.0";
1599
+ /** @internal */
1600
+ class KeyVaultClientContext extends coreHttp__namespace.ServiceClient {
1476
1601
  /**
1477
1602
  * Initializes a new instance of the KeyVaultClientContext class.
1478
1603
  * @param apiVersion Api Version
@@ -1486,11 +1611,10 @@ class KeyVaultClientContext extends coreHttp.ServiceClient {
1486
1611
  if (!options) {
1487
1612
  options = {};
1488
1613
  }
1489
- if (!options.userAgent) {
1490
- const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
1491
- options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
1492
- }
1493
- super(undefined, options);
1614
+ const defaultUserAgent = `azsdk-js-${packageName.replace(/@.*\//, "")}/${packageVersion} ${coreHttp__namespace.getDefaultUserAgentValue()}`;
1615
+ super(undefined, Object.assign(Object.assign({}, options), { userAgent: options.userAgent
1616
+ ? `${options.userAgent} ${defaultUserAgent}`
1617
+ : `${defaultUserAgent}` }));
1494
1618
  this.requestContentType = "application/json; charset=utf-8";
1495
1619
  this.baseUri = options.endpoint || "{vaultBaseUrl}";
1496
1620
  // Parameter assignments
@@ -1505,7 +1629,7 @@ class KeyVaultClientContext extends coreHttp.ServiceClient {
1505
1629
  * Code generated by Microsoft (R) AutoRest Code Generator.
1506
1630
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1507
1631
  */
1508
- /** @hidden */
1632
+ /** @internal */
1509
1633
  class KeyVaultClient extends KeyVaultClientContext {
1510
1634
  /**
1511
1635
  * Initializes a new instance of the KeyVaultClient class.
@@ -1524,7 +1648,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1524
1648
  getCertificates(vaultBaseUrl, options) {
1525
1649
  const operationArguments = {
1526
1650
  vaultBaseUrl,
1527
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1651
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1528
1652
  };
1529
1653
  return this.sendOperationRequest(operationArguments, getCertificatesOperationSpec);
1530
1654
  }
@@ -1540,7 +1664,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1540
1664
  const operationArguments = {
1541
1665
  vaultBaseUrl,
1542
1666
  certificateName,
1543
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1667
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1544
1668
  };
1545
1669
  return this.sendOperationRequest(operationArguments, deleteCertificateOperationSpec);
1546
1670
  }
@@ -1555,7 +1679,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1555
1679
  const operationArguments = {
1556
1680
  vaultBaseUrl,
1557
1681
  contacts,
1558
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1682
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1559
1683
  };
1560
1684
  return this.sendOperationRequest(operationArguments, setCertificateContactsOperationSpec);
1561
1685
  }
@@ -1568,7 +1692,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1568
1692
  getCertificateContacts(vaultBaseUrl, options) {
1569
1693
  const operationArguments = {
1570
1694
  vaultBaseUrl,
1571
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1695
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1572
1696
  };
1573
1697
  return this.sendOperationRequest(operationArguments, getCertificateContactsOperationSpec);
1574
1698
  }
@@ -1581,7 +1705,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1581
1705
  deleteCertificateContacts(vaultBaseUrl, options) {
1582
1706
  const operationArguments = {
1583
1707
  vaultBaseUrl,
1584
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1708
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1585
1709
  };
1586
1710
  return this.sendOperationRequest(operationArguments, deleteCertificateContactsOperationSpec);
1587
1711
  }
@@ -1594,7 +1718,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1594
1718
  getCertificateIssuers(vaultBaseUrl, options) {
1595
1719
  const operationArguments = {
1596
1720
  vaultBaseUrl,
1597
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1721
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1598
1722
  };
1599
1723
  return this.sendOperationRequest(operationArguments, getCertificateIssuersOperationSpec);
1600
1724
  }
@@ -1611,7 +1735,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1611
1735
  vaultBaseUrl,
1612
1736
  issuerName,
1613
1737
  provider,
1614
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1738
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1615
1739
  };
1616
1740
  return this.sendOperationRequest(operationArguments, setCertificateIssuerOperationSpec);
1617
1741
  }
@@ -1626,7 +1750,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1626
1750
  const operationArguments = {
1627
1751
  vaultBaseUrl,
1628
1752
  issuerName,
1629
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1753
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1630
1754
  };
1631
1755
  return this.sendOperationRequest(operationArguments, updateCertificateIssuerOperationSpec);
1632
1756
  }
@@ -1641,7 +1765,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1641
1765
  const operationArguments = {
1642
1766
  vaultBaseUrl,
1643
1767
  issuerName,
1644
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1768
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1645
1769
  };
1646
1770
  return this.sendOperationRequest(operationArguments, getCertificateIssuerOperationSpec);
1647
1771
  }
@@ -1656,7 +1780,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1656
1780
  const operationArguments = {
1657
1781
  vaultBaseUrl,
1658
1782
  issuerName,
1659
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1783
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1660
1784
  };
1661
1785
  return this.sendOperationRequest(operationArguments, deleteCertificateIssuerOperationSpec);
1662
1786
  }
@@ -1671,7 +1795,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1671
1795
  const operationArguments = {
1672
1796
  vaultBaseUrl,
1673
1797
  certificateName,
1674
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1798
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1675
1799
  };
1676
1800
  return this.sendOperationRequest(operationArguments, createCertificateOperationSpec);
1677
1801
  }
@@ -1691,7 +1815,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1691
1815
  vaultBaseUrl,
1692
1816
  certificateName,
1693
1817
  base64EncodedCertificate,
1694
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1818
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1695
1819
  };
1696
1820
  return this.sendOperationRequest(operationArguments, importCertificateOperationSpec);
1697
1821
  }
@@ -1706,7 +1830,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1706
1830
  const operationArguments = {
1707
1831
  vaultBaseUrl,
1708
1832
  certificateName,
1709
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1833
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1710
1834
  };
1711
1835
  return this.sendOperationRequest(operationArguments, getCertificateVersionsOperationSpec);
1712
1836
  }
@@ -1721,7 +1845,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1721
1845
  const operationArguments = {
1722
1846
  vaultBaseUrl,
1723
1847
  certificateName,
1724
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1848
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1725
1849
  };
1726
1850
  return this.sendOperationRequest(operationArguments, getCertificatePolicyOperationSpec);
1727
1851
  }
@@ -1738,7 +1862,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1738
1862
  vaultBaseUrl,
1739
1863
  certificateName,
1740
1864
  certificatePolicy,
1741
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1865
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1742
1866
  };
1743
1867
  return this.sendOperationRequest(operationArguments, updateCertificatePolicyOperationSpec);
1744
1868
  }
@@ -1756,7 +1880,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1756
1880
  vaultBaseUrl,
1757
1881
  certificateName,
1758
1882
  certificateVersion,
1759
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1883
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1760
1884
  };
1761
1885
  return this.sendOperationRequest(operationArguments, updateCertificateOperationSpec);
1762
1886
  }
@@ -1774,7 +1898,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1774
1898
  vaultBaseUrl,
1775
1899
  certificateName,
1776
1900
  certificateVersion,
1777
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1901
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1778
1902
  };
1779
1903
  return this.sendOperationRequest(operationArguments, getCertificateOperationSpec);
1780
1904
  }
@@ -1791,7 +1915,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1791
1915
  vaultBaseUrl,
1792
1916
  certificateName,
1793
1917
  cancellationRequested,
1794
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1918
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1795
1919
  };
1796
1920
  return this.sendOperationRequest(operationArguments, updateCertificateOperationOperationSpec);
1797
1921
  }
@@ -1806,7 +1930,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1806
1930
  const operationArguments = {
1807
1931
  vaultBaseUrl,
1808
1932
  certificateName,
1809
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1933
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1810
1934
  };
1811
1935
  return this.sendOperationRequest(operationArguments, getCertificateOperationOperationSpec);
1812
1936
  }
@@ -1821,7 +1945,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1821
1945
  const operationArguments = {
1822
1946
  vaultBaseUrl,
1823
1947
  certificateName,
1824
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1948
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1825
1949
  };
1826
1950
  return this.sendOperationRequest(operationArguments, deleteCertificateOperationOperationSpec);
1827
1951
  }
@@ -1838,7 +1962,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1838
1962
  vaultBaseUrl,
1839
1963
  certificateName,
1840
1964
  x509Certificates,
1841
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1965
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1842
1966
  };
1843
1967
  return this.sendOperationRequest(operationArguments, mergeCertificateOperationSpec);
1844
1968
  }
@@ -1853,7 +1977,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1853
1977
  const operationArguments = {
1854
1978
  vaultBaseUrl,
1855
1979
  certificateName,
1856
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1980
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1857
1981
  };
1858
1982
  return this.sendOperationRequest(operationArguments, backupCertificateOperationSpec);
1859
1983
  }
@@ -1868,7 +1992,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1868
1992
  const operationArguments = {
1869
1993
  vaultBaseUrl,
1870
1994
  certificateBundleBackup,
1871
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1995
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1872
1996
  };
1873
1997
  return this.sendOperationRequest(operationArguments, restoreCertificateOperationSpec);
1874
1998
  }
@@ -1883,7 +2007,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1883
2007
  getDeletedCertificates(vaultBaseUrl, options) {
1884
2008
  const operationArguments = {
1885
2009
  vaultBaseUrl,
1886
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2010
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1887
2011
  };
1888
2012
  return this.sendOperationRequest(operationArguments, getDeletedCertificatesOperationSpec);
1889
2013
  }
@@ -1899,7 +2023,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1899
2023
  const operationArguments = {
1900
2024
  vaultBaseUrl,
1901
2025
  certificateName,
1902
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2026
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1903
2027
  };
1904
2028
  return this.sendOperationRequest(operationArguments, getDeletedCertificateOperationSpec);
1905
2029
  }
@@ -1915,7 +2039,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1915
2039
  const operationArguments = {
1916
2040
  vaultBaseUrl,
1917
2041
  certificateName,
1918
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2042
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1919
2043
  };
1920
2044
  return this.sendOperationRequest(operationArguments, purgeDeletedCertificateOperationSpec);
1921
2045
  }
@@ -1932,7 +2056,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1932
2056
  const operationArguments = {
1933
2057
  vaultBaseUrl,
1934
2058
  certificateName,
1935
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2059
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1936
2060
  };
1937
2061
  return this.sendOperationRequest(operationArguments, recoverDeletedCertificateOperationSpec);
1938
2062
  }
@@ -1946,7 +2070,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1946
2070
  const operationArguments = {
1947
2071
  vaultBaseUrl,
1948
2072
  nextLink,
1949
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2073
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1950
2074
  };
1951
2075
  return this.sendOperationRequest(operationArguments, getCertificatesNextOperationSpec);
1952
2076
  }
@@ -1960,7 +2084,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1960
2084
  const operationArguments = {
1961
2085
  vaultBaseUrl,
1962
2086
  nextLink,
1963
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2087
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1964
2088
  };
1965
2089
  return this.sendOperationRequest(operationArguments, getCertificateIssuersNextOperationSpec);
1966
2090
  }
@@ -1976,7 +2100,7 @@ class KeyVaultClient extends KeyVaultClientContext {
1976
2100
  vaultBaseUrl,
1977
2101
  certificateName,
1978
2102
  nextLink,
1979
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2103
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1980
2104
  };
1981
2105
  return this.sendOperationRequest(operationArguments, getCertificateVersionsNextOperationSpec);
1982
2106
  }
@@ -1990,13 +2114,13 @@ class KeyVaultClient extends KeyVaultClientContext {
1990
2114
  const operationArguments = {
1991
2115
  vaultBaseUrl,
1992
2116
  nextLink,
1993
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
2117
+ options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
1994
2118
  };
1995
2119
  return this.sendOperationRequest(operationArguments, getDeletedCertificatesNextOperationSpec);
1996
2120
  }
1997
2121
  }
1998
2122
  // Operation Specifications
1999
- const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
2123
+ const serializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
2000
2124
  const getCertificatesOperationSpec = {
2001
2125
  path: "/certificates",
2002
2126
  httpMethod: "GET",
@@ -2594,7 +2718,7 @@ const getDeletedCertificatesNextOperationSpec = {
2594
2718
 
2595
2719
  // Copyright (c) Microsoft Corporation.
2596
2720
  // Licensed under the MIT license.
2597
- const SDK_VERSION = "4.4.0-beta.2";
2721
+ const SDK_VERSION = "4.4.0";
2598
2722
 
2599
2723
  // Copyright (c) Microsoft Corporation.
2600
2724
  // Licensed under the MIT license.
@@ -2608,7 +2732,7 @@ const validParsedWWWAuthenticateProperties = [
2608
2732
  "authorization_url",
2609
2733
  "resource",
2610
2734
  "scope",
2611
- "tenantId"
2735
+ "tenantId",
2612
2736
  ];
2613
2737
  /**
2614
2738
  * Parses an WWW-Authenticate response.
@@ -2694,7 +2818,7 @@ function challengeBasedAuthenticationPolicy(credential) {
2694
2818
  return {
2695
2819
  create: (nextPolicy, options) => {
2696
2820
  return new ChallengeBasedAuthenticationPolicy(nextPolicy, options, credential, tokenCache, challengeCache);
2697
- }
2821
+ },
2698
2822
  };
2699
2823
  }
2700
2824
  /**
@@ -2728,7 +2852,7 @@ class ChallengeBasedAuthenticationPolicy extends coreHttp.BaseRequestPolicy {
2728
2852
  // If there's no cached token in the cache, we try to get a new one.
2729
2853
  if (accessToken === undefined) {
2730
2854
  const receivedToken = await this.credential.getToken(this.challengeCache.challenge.scope, {
2731
- tenantId: this.challengeCache.challenge.tenantId
2855
+ tenantId: this.challengeCache.challenge.tenantId,
2732
2856
  });
2733
2857
  accessToken = receivedToken || undefined;
2734
2858
  this.tokenCache.setCachedToken(accessToken);
@@ -2821,7 +2945,7 @@ function parseKeyvaultIdentifier(collection, identifier) {
2821
2945
  }
2822
2946
  let baseUri;
2823
2947
  try {
2824
- baseUri = url.parse(identifier, true, true);
2948
+ baseUri = url__namespace.parse(identifier, true, true);
2825
2949
  }
2826
2950
  catch (e) {
2827
2951
  throw new Error(`Invalid ${collection} identifier: ${identifier}. Not a valid URI`);
@@ -2840,7 +2964,7 @@ function parseKeyvaultIdentifier(collection, identifier) {
2840
2964
  return {
2841
2965
  vaultUrl,
2842
2966
  name,
2843
- version
2967
+ version,
2844
2968
  };
2845
2969
  }
2846
2970
 
@@ -2857,7 +2981,7 @@ function parseKeyvaultIdentifier(collection, identifier) {
2857
2981
  function createTraceFunction(prefix) {
2858
2982
  const createSpan = coreTracing.createSpanFunction({
2859
2983
  namespace: "Microsoft.KeyVault",
2860
- packagePrefix: prefix
2984
+ packagePrefix: prefix,
2861
2985
  });
2862
2986
  return async function (operationName, options, cb) {
2863
2987
  const { updatedOptions, span } = createSpan(operationName, options);
@@ -2867,14 +2991,14 @@ function createTraceFunction(prefix) {
2867
2991
  const result = await cb(updatedOptions, span);
2868
2992
  // otel 0.16+ needs this or else the code ends up being set as UNSET
2869
2993
  span.setStatus({
2870
- code: coreTracing.SpanStatusCode.OK
2994
+ code: coreTracing.SpanStatusCode.OK,
2871
2995
  });
2872
2996
  return result;
2873
2997
  }
2874
2998
  catch (err) {
2875
2999
  span.setStatus({
2876
3000
  code: coreTracing.SpanStatusCode.ERROR,
2877
- message: err.message
3001
+ message: err.message,
2878
3002
  });
2879
3003
  throw err;
2880
3004
  }
@@ -2896,7 +3020,7 @@ function cleanState(state) {
2896
3020
  isCancelled: state.isCancelled,
2897
3021
  isCompleted: state.isCompleted,
2898
3022
  error: state.error,
2899
- result: state.result
3023
+ result: state.result,
2900
3024
  };
2901
3025
  }
2902
3026
  /**
@@ -2951,7 +3075,7 @@ class KeyVaultCertificatePollOperation {
2951
3075
  */
2952
3076
  toString() {
2953
3077
  return JSON.stringify({
2954
- state: cleanState(this.state)
3078
+ state: cleanState(this.state),
2955
3079
  });
2956
3080
  }
2957
3081
  }
@@ -2987,7 +3111,7 @@ function toCoreAttributes(properties) {
2987
3111
  notBefore: properties.notBefore,
2988
3112
  expires: properties.expiresOn,
2989
3113
  created: properties.createdOn,
2990
- updated: properties.updatedOn
3114
+ updated: properties.updatedOn,
2991
3115
  };
2992
3116
  }
2993
3117
  function toCorePolicy(id, policy, attributes = {}) {
@@ -2996,7 +3120,7 @@ function toCorePolicy(id, policy, attributes = {}) {
2996
3120
  subjectAlternativeNames = {
2997
3121
  emails: policy.subjectAlternativeNames.emails,
2998
3122
  dnsNames: policy.subjectAlternativeNames.dnsNames,
2999
- upns: policy.subjectAlternativeNames.userPrincipalNames
3123
+ upns: policy.subjectAlternativeNames.userPrincipalNames,
3000
3124
  };
3001
3125
  }
3002
3126
  return {
@@ -3006,8 +3130,8 @@ function toCorePolicy(id, policy, attributes = {}) {
3006
3130
  action: { actionType: action.action },
3007
3131
  trigger: {
3008
3132
  lifetimePercentage: action.lifetimePercentage,
3009
- daysBeforeExpiry: action.daysBeforeExpiry
3010
- }
3133
+ daysBeforeExpiry: action.daysBeforeExpiry,
3134
+ },
3011
3135
  }))
3012
3136
  : undefined,
3013
3137
  keyProperties: {
@@ -3015,24 +3139,24 @@ function toCorePolicy(id, policy, attributes = {}) {
3015
3139
  keySize: policy.keySize,
3016
3140
  reuseKey: policy.reuseKey,
3017
3141
  curve: policy.keyCurveName,
3018
- exportable: policy.exportable
3142
+ exportable: policy.exportable,
3019
3143
  },
3020
3144
  secretProperties: {
3021
- contentType: policy.contentType
3145
+ contentType: policy.contentType,
3022
3146
  },
3023
3147
  x509CertificateProperties: {
3024
3148
  subject: policy.subject,
3025
3149
  ekus: policy.enhancedKeyUsage,
3026
3150
  subjectAlternativeNames,
3027
3151
  keyUsage: policy.keyUsage,
3028
- validityInMonths: policy.validityInMonths
3152
+ validityInMonths: policy.validityInMonths,
3029
3153
  },
3030
3154
  issuerParameters: {
3031
3155
  name: policy.issuerName,
3032
3156
  certificateType: policy.certificateType,
3033
- certificateTransparency: policy.certificateTransparency
3157
+ certificateTransparency: policy.certificateTransparency,
3034
3158
  },
3035
- attributes
3159
+ attributes,
3036
3160
  };
3037
3161
  }
3038
3162
  function toPublicPolicy(policy = {}) {
@@ -3057,7 +3181,7 @@ function toPublicPolicy(policy = {}) {
3057
3181
  ? policy.lifetimeActions.map((action) => ({
3058
3182
  action: action.action ? action.action.actionType : undefined,
3059
3183
  daysBeforeExpiry: action.trigger ? action.trigger.daysBeforeExpiry : undefined,
3060
- lifetimePercentage: action.trigger ? action.trigger.lifetimePercentage : undefined
3184
+ lifetimePercentage: action.trigger ? action.trigger.lifetimePercentage : undefined,
3061
3185
  }))
3062
3186
  : undefined,
3063
3187
  contentType: policy.secretProperties
@@ -3067,7 +3191,7 @@ function toPublicPolicy(policy = {}) {
3067
3191
  keyUsage: x509Properties.keyUsage,
3068
3192
  validityInMonths: x509Properties.validityInMonths,
3069
3193
  subject: x509Properties.subject,
3070
- subjectAlternativeNames: subjectAlternativeNames
3194
+ subjectAlternativeNames: subjectAlternativeNames,
3071
3195
  };
3072
3196
  if (policy.attributes) {
3073
3197
  certificatePolicy.enabled = policy.attributes.enabled;
@@ -3098,7 +3222,7 @@ function toPublicIssuer(issuer = {}) {
3098
3222
  password: issuer.credentials && issuer.credentials.password,
3099
3223
  enabled: attributes.enabled,
3100
3224
  createdOn: attributes.created,
3101
- updatedOn: attributes.updated
3225
+ updatedOn: attributes.updated,
3102
3226
  };
3103
3227
  if (issuer.organizationDetails) {
3104
3228
  publicIssuer.organizationId = issuer.organizationDetails.id;
@@ -3107,7 +3231,7 @@ function toPublicIssuer(issuer = {}) {
3107
3231
  email: x.emailAddress,
3108
3232
  phone: x.phone,
3109
3233
  firstName: x.firstName,
3110
- lastName: x.lastName
3234
+ lastName: x.lastName,
3111
3235
  }))
3112
3236
  : undefined;
3113
3237
  }
@@ -3129,14 +3253,14 @@ function getCertificateFromCertificateBundle(certificateBundle) {
3129
3253
  version: parsedId.version,
3130
3254
  tags: certificateBundle.tags,
3131
3255
  x509Thumbprint: certificateBundle.x509Thumbprint,
3132
- recoverableDays: attributes.recoverableDays
3256
+ recoverableDays: attributes.recoverableDays,
3133
3257
  };
3134
3258
  return {
3135
3259
  keyId: certificateBundle.kid,
3136
3260
  secretId: certificateBundle.sid,
3137
3261
  name: parsedId.name,
3138
3262
  cer: certificateBundle.cer,
3139
- properties: abstractProperties
3263
+ properties: abstractProperties,
3140
3264
  };
3141
3265
  }
3142
3266
  function getCertificateWithPolicyFromCertificateBundle(certificateBundle) {
@@ -3156,7 +3280,7 @@ function getCertificateWithPolicyFromCertificateBundle(certificateBundle) {
3156
3280
  version: parsedId.version,
3157
3281
  tags: certificateBundle.tags,
3158
3282
  x509Thumbprint: certificateBundle.x509Thumbprint,
3159
- recoverableDays: attributes.recoverableDays
3283
+ recoverableDays: attributes.recoverableDays,
3160
3284
  };
3161
3285
  return {
3162
3286
  keyId: certificateBundle.kid,
@@ -3164,7 +3288,7 @@ function getCertificateWithPolicyFromCertificateBundle(certificateBundle) {
3164
3288
  name: parsedId.name,
3165
3289
  cer: certificateBundle.cer,
3166
3290
  policy,
3167
- properties: abstractProperties
3291
+ properties: abstractProperties,
3168
3292
  };
3169
3293
  }
3170
3294
  function getDeletedCertificateFromDeletedCertificateBundle(certificateBundle) {
@@ -3179,7 +3303,7 @@ function getDeletedCertificateFromDeletedCertificateBundle(certificateBundle) {
3179
3303
  properties: certificate.properties,
3180
3304
  recoveryId: certificateBundle.recoveryId,
3181
3305
  scheduledPurgeDate: certificateBundle.scheduledPurgeDate,
3182
- deletedOn: certificateBundle.deletedDate
3306
+ deletedOn: certificateBundle.deletedDate,
3183
3307
  };
3184
3308
  }
3185
3309
  function getDeletedCertificateFromItem(item) {
@@ -3197,14 +3321,14 @@ function getDeletedCertificateFromItem(item) {
3197
3321
  tags: item.tags,
3198
3322
  x509Thumbprint: item.x509Thumbprint,
3199
3323
  recoverableDays: (_a = item.attributes) === null || _a === void 0 ? void 0 : _a.recoverableDays,
3200
- recoveryLevel: (_b = item.attributes) === null || _b === void 0 ? void 0 : _b.recoveryLevel
3324
+ recoveryLevel: (_b = item.attributes) === null || _b === void 0 ? void 0 : _b.recoveryLevel,
3201
3325
  };
3202
3326
  return {
3203
3327
  deletedOn: item.deletedDate,
3204
3328
  recoveryId: item.recoveryId,
3205
3329
  scheduledPurgeDate: item.scheduledPurgeDate,
3206
3330
  name: parsedId.name,
3207
- properties: abstractProperties
3331
+ properties: abstractProperties,
3208
3332
  };
3209
3333
  }
3210
3334
  function getCertificateOperationErrorFromErrorModel(error) {
@@ -3212,7 +3336,7 @@ function getCertificateOperationErrorFromErrorModel(error) {
3212
3336
  return {
3213
3337
  code: error.code,
3214
3338
  innerError: getCertificateOperationErrorFromErrorModel(error.innerError),
3215
- message: error.message
3339
+ message: error.message,
3216
3340
  };
3217
3341
  }
3218
3342
  return undefined;
@@ -3235,7 +3359,7 @@ function getCertificateOperationFromCoreOperation(certificateName, vaultUrl, ope
3235
3359
  status: operation.status,
3236
3360
  statusDetails: operation.statusDetails,
3237
3361
  target: operation.target,
3238
- vaultUrl: vaultUrl
3362
+ vaultUrl: vaultUrl,
3239
3363
  };
3240
3364
  }
3241
3365
  function coreContactsToCertificateContacts(contacts) {
@@ -3259,7 +3383,7 @@ function getPropertiesFromCertificateBundle(certificateBundle) {
3259
3383
  version: parsedId.version,
3260
3384
  tags: certificateBundle.tags,
3261
3385
  x509Thumbprint: certificateBundle.x509Thumbprint,
3262
- recoverableDays: attributes.recoverableDays
3386
+ recoverableDays: attributes.recoverableDays,
3263
3387
  };
3264
3388
  return abstractProperties;
3265
3389
  }
@@ -3268,7 +3392,7 @@ function getPropertiesFromCertificateBundle(certificateBundle) {
3268
3392
  /**
3269
3393
  * @internal
3270
3394
  */
3271
- const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CreateCertificatePoller");
3395
+ const withTrace$4 = createTraceFunction("Azure.KeyVault.Certificates.CreateCertificatePoller");
3272
3396
  /**
3273
3397
  * An interface representing a create certificate's poll operation
3274
3398
  */
@@ -3284,7 +3408,7 @@ class CreateCertificatePollOperation extends KeyVaultCertificatePollOperation {
3284
3408
  * Creates a new certificate. If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
3285
3409
  */
3286
3410
  createCertificate(certificateName, certificatePolicy, options = {}) {
3287
- return withTrace("createCertificate", options, async (updatedOptions) => {
3411
+ return withTrace$4("createCertificate", options, async (updatedOptions) => {
3288
3412
  const id = options.id;
3289
3413
  const certificateAttributes = toCoreAttributes(options);
3290
3414
  const corePolicy = toCorePolicy(id, certificatePolicy, certificateAttributes);
@@ -3296,7 +3420,7 @@ class CreateCertificatePollOperation extends KeyVaultCertificatePollOperation {
3296
3420
  * Gets the latest information available from a specific certificate, including the certificate's policy. This operation requires the certificates/get permission.
3297
3421
  */
3298
3422
  getCertificate(certificateName, options = {}) {
3299
- return withTrace("getCertificate", options, async (updatedOptions) => {
3423
+ return withTrace$4("getCertificate", options, async (updatedOptions) => {
3300
3424
  const result = await this.client.getCertificate(this.vaultUrl, certificateName, "", updatedOptions);
3301
3425
  return getCertificateWithPolicyFromCertificateBundle(result);
3302
3426
  });
@@ -3305,7 +3429,7 @@ class CreateCertificatePollOperation extends KeyVaultCertificatePollOperation {
3305
3429
  * Gets the certificate operation.
3306
3430
  */
3307
3431
  getPlainCertificateOperation(certificateName, options = {}) {
3308
- return withTrace("getPlainCertificateOperation", options, async (updatedOptions) => {
3432
+ return withTrace$4("getPlainCertificateOperation", options, async (updatedOptions) => {
3309
3433
  const result = await this.client.getCertificateOperation(this.vaultUrl, certificateName, updatedOptions);
3310
3434
  return getCertificateOperationFromCoreOperation(certificateName, this.vaultUrl, result._response.parsedBody);
3311
3435
  });
@@ -3314,7 +3438,7 @@ class CreateCertificatePollOperation extends KeyVaultCertificatePollOperation {
3314
3438
  * Cancels a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
3315
3439
  */
3316
3440
  cancelCertificateOperation(certificateName, options = {}) {
3317
- return withTrace("cancelCertificateOperation", options, async (updatedOptions) => {
3441
+ return withTrace$4("cancelCertificateOperation", options, async (updatedOptions) => {
3318
3442
  const result = await this.client.updateCertificateOperation(this.vaultUrl, certificateName, true, updatedOptions);
3319
3443
  return getCertificateOperationFromCoreOperation(certificateName, this.vaultUrl, result._response.parsedBody);
3320
3444
  });
@@ -3367,7 +3491,7 @@ class CreateCertificatePollOperation extends KeyVaultCertificatePollOperation {
3367
3491
  */
3368
3492
  class CreateCertificatePoller extends KeyVaultCertificatePoller {
3369
3493
  constructor(options) {
3370
- const { vaultUrl, client, certificateName, certificatePolicy, createCertificateOptions, operationOptions, intervalInMs = 2000, resumeFrom } = options;
3494
+ const { vaultUrl, client, certificateName, certificatePolicy, createCertificateOptions, operationOptions, intervalInMs = 2000, resumeFrom, } = options;
3371
3495
  let state;
3372
3496
  if (resumeFrom) {
3373
3497
  state = JSON.parse(resumeFrom).state;
@@ -3384,7 +3508,7 @@ class CreateCertificatePoller extends KeyVaultCertificatePoller {
3384
3508
  /**
3385
3509
  * @internal
3386
3510
  */
3387
- const withTrace$1 = createTraceFunction("Azure.KeyVault.Certificates.CertificateOperationPoller");
3511
+ const withTrace$3 = createTraceFunction("Azure.KeyVault.Certificates.CertificateOperationPoller");
3388
3512
  /**
3389
3513
  * An interface representing the active operation of a certificate's creation,
3390
3514
  * which is represented locally as the "operation" of an active LRO Poller.
@@ -3401,7 +3525,7 @@ class CertificateOperationPollOperation extends KeyVaultCertificatePollOperation
3401
3525
  * Cancels a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
3402
3526
  */
3403
3527
  cancelCertificateOperation(certificateName, options = {}) {
3404
- return withTrace$1("cancelCertificateOperation", options, async (updatedOptions) => {
3528
+ return withTrace$3("cancelCertificateOperation", options, async (updatedOptions) => {
3405
3529
  const result = await this.client.updateCertificateOperation(this.vaultUrl, certificateName, true, updatedOptions);
3406
3530
  return getCertificateOperationFromCoreOperation(certificateName, this.vaultUrl, result._response.parsedBody);
3407
3531
  });
@@ -3410,7 +3534,7 @@ class CertificateOperationPollOperation extends KeyVaultCertificatePollOperation
3410
3534
  * Gets the latest information available from a specific certificate, including the certificate's policy. This operation requires the certificates/get permission.
3411
3535
  */
3412
3536
  getCertificate(certificateName, options = {}) {
3413
- return withTrace$1("getCertificate", options, async (updatedOptions) => {
3537
+ return withTrace$3("getCertificate", options, async (updatedOptions) => {
3414
3538
  const result = await this.client.getCertificate(this.vaultUrl, certificateName, "", updatedOptions);
3415
3539
  return getCertificateWithPolicyFromCertificateBundle(result);
3416
3540
  });
@@ -3419,7 +3543,7 @@ class CertificateOperationPollOperation extends KeyVaultCertificatePollOperation
3419
3543
  * Gets the certificate operation.
3420
3544
  */
3421
3545
  getPlainCertificateOperation(certificateName, options = {}) {
3422
- return withTrace$1("getPlainCertificateOperation", options, async (updatedOptions) => {
3546
+ return withTrace$3("getPlainCertificateOperation", options, async (updatedOptions) => {
3423
3547
  const result = await this.client.getCertificateOperation(this.vaultUrl, certificateName, updatedOptions);
3424
3548
  return getCertificateOperationFromCoreOperation(certificateName, this.vaultUrl, result._response.parsedBody);
3425
3549
  });
@@ -3469,7 +3593,7 @@ class CertificateOperationPollOperation extends KeyVaultCertificatePollOperation
3469
3593
  toString() {
3470
3594
  const state = Object.assign({ certificateOperation: this.state.certificateOperation }, cleanState(this.state));
3471
3595
  return JSON.stringify({
3472
- state
3596
+ state,
3473
3597
  });
3474
3598
  }
3475
3599
  }
@@ -3480,7 +3604,7 @@ class CertificateOperationPollOperation extends KeyVaultCertificatePollOperation
3480
3604
  */
3481
3605
  class CertificateOperationPoller extends KeyVaultCertificatePoller {
3482
3606
  constructor(options) {
3483
- const { vaultUrl, client, certificateName, operationOptions, intervalInMs = 2000, resumeFrom } = options;
3607
+ const { vaultUrl, client, certificateName, operationOptions, intervalInMs = 2000, resumeFrom, } = options;
3484
3608
  let state;
3485
3609
  if (resumeFrom) {
3486
3610
  state = JSON.parse(resumeFrom).state;
@@ -3578,7 +3702,7 @@ class DeleteCertificatePollOperation extends KeyVaultCertificatePollOperation {
3578
3702
  */
3579
3703
  class DeleteCertificatePoller extends KeyVaultCertificatePoller {
3580
3704
  constructor(options) {
3581
- const { vaultUrl, client, certificateName, operationOptions, intervalInMs = 2000, resumeFrom } = options;
3705
+ const { vaultUrl, client, certificateName, operationOptions, intervalInMs = 2000, resumeFrom, } = options;
3582
3706
  let state;
3583
3707
  if (resumeFrom) {
3584
3708
  state = JSON.parse(resumeFrom).state;
@@ -3593,14 +3717,14 @@ class DeleteCertificatePoller extends KeyVaultCertificatePoller {
3593
3717
  /**
3594
3718
  * @internal
3595
3719
  */
3596
- const withTrace$3 = createTraceFunction("Azure.KeyVault.Certificates.RecoverDeletedCertificatePoller");
3720
+ const withTrace$1 = createTraceFunction("Azure.KeyVault.Certificates.RecoverDeletedCertificatePoller");
3597
3721
  /**
3598
3722
  * An interface representing the recovery of a deleted certificate's poll operation
3599
3723
  */
3600
3724
  class RecoverDeletedCertificatePollOperation extends KeyVaultCertificatePollOperation {
3601
3725
  constructor(state, vaultUrl, client, operationOptions = {}) {
3602
3726
  super(state, {
3603
- cancelMessage: "Canceling the recovery of a deleted certificate is not supported."
3727
+ cancelMessage: "Canceling the recovery of a deleted certificate is not supported.",
3604
3728
  });
3605
3729
  this.state = state;
3606
3730
  this.vaultUrl = vaultUrl;
@@ -3611,7 +3735,7 @@ class RecoverDeletedCertificatePollOperation extends KeyVaultCertificatePollOper
3611
3735
  * Gets the latest information available from a specific certificate, including the certificate's policy. This operation requires the certificates/get permission.
3612
3736
  */
3613
3737
  getCertificate(certificateName, options = {}) {
3614
- return withTrace$3("getCertificate", options, async (updatedOptions) => {
3738
+ return withTrace$1("getCertificate", options, async (updatedOptions) => {
3615
3739
  const result = await this.client.getCertificate(this.vaultUrl, certificateName, "", updatedOptions);
3616
3740
  return getCertificateWithPolicyFromCertificateBundle(result);
3617
3741
  });
@@ -3621,7 +3745,7 @@ class RecoverDeletedCertificatePollOperation extends KeyVaultCertificatePollOper
3621
3745
  * requires the certificate/recover permission.
3622
3746
  */
3623
3747
  recoverDeletedCertificate(certificateName, options = {}) {
3624
- return withTrace$3("recoverDeletedCertificate", options, async (updatedOptions) => {
3748
+ return withTrace$1("recoverDeletedCertificate", options, async (updatedOptions) => {
3625
3749
  const result = await this.client.recoverDeletedCertificate(this.vaultUrl, certificateName, updatedOptions);
3626
3750
  return getCertificateWithPolicyFromCertificateBundle(result._response.parsedBody);
3627
3751
  });
@@ -3675,7 +3799,7 @@ class RecoverDeletedCertificatePollOperation extends KeyVaultCertificatePollOper
3675
3799
  */
3676
3800
  class RecoverDeletedCertificatePoller extends KeyVaultCertificatePoller {
3677
3801
  constructor(options) {
3678
- const { vaultUrl, client, certificateName, operationOptions, intervalInMs = 2000, resumeFrom } = options;
3802
+ const { vaultUrl, client, certificateName, operationOptions, intervalInMs = 2000, resumeFrom, } = options;
3679
3803
  let state;
3680
3804
  if (resumeFrom) {
3681
3805
  state = JSON.parse(resumeFrom).state;
@@ -3692,18 +3816,24 @@ class RecoverDeletedCertificatePoller extends KeyVaultCertificatePoller {
3692
3816
  * @internal
3693
3817
  */
3694
3818
  function toBase64(bytes) {
3695
- {
3819
+ if (coreHttp.isNode) {
3696
3820
  return Buffer.from(bytes).toString("base64");
3697
3821
  }
3822
+ else {
3823
+ return btoa(String.fromCharCode.apply(null, bytes));
3824
+ }
3698
3825
  }
3699
3826
  /**
3700
3827
  * Decodes a Uint8Array into an ASCII string.
3701
3828
  * @internal
3702
3829
  */
3703
3830
  function toAscii(bytes) {
3704
- {
3831
+ if (coreHttp.isNode) {
3705
3832
  return Buffer.from(bytes).toString("ascii");
3706
3833
  }
3834
+ else {
3835
+ return new TextDecoder("ascii").decode(bytes);
3836
+ }
3707
3837
  }
3708
3838
  /**
3709
3839
  * Parses the PFX or ASCII PEM formatted value of the certificate containing both the X.509 certificates and the private key
@@ -3724,7 +3854,7 @@ function parseCertificateBytes(certificateBytes, contentType) {
3724
3854
  }
3725
3855
 
3726
3856
  // Copyright (c) Microsoft Corporation.
3727
- const withTrace$4 = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient");
3857
+ const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient");
3728
3858
  /**
3729
3859
  * The client to interact with the KeyVault certificates functionality
3730
3860
  */
@@ -3747,7 +3877,7 @@ class CertificateClient {
3747
3877
  }
3748
3878
  else {
3749
3879
  pipelineOptions.userAgentOptions = {
3750
- userAgentPrefix: libInfo
3880
+ userAgentPrefix: libInfo,
3751
3881
  };
3752
3882
  }
3753
3883
  const authPolicy = coreHttp.isTokenCredential(credential)
@@ -3758,8 +3888,8 @@ class CertificateClient {
3758
3888
  allowedHeaderNames: [
3759
3889
  "x-ms-keyvault-region",
3760
3890
  "x-ms-keyvault-network-info",
3761
- "x-ms-keyvault-service-version"
3762
- ]
3891
+ "x-ms-keyvault-service-version",
3892
+ ],
3763
3893
  } });
3764
3894
  this.client = new KeyVaultClient(pipelineOptions.serviceVersion || LATEST_API_VERSION, coreHttp.createPipelineFromOptions(internalPipelineOptions, authPolicy));
3765
3895
  }
@@ -3767,14 +3897,14 @@ class CertificateClient {
3767
3897
  return tslib.__asyncGenerator(this, arguments, function* listPropertiesOfCertificatesPage_1() {
3768
3898
  if (continuationState.continuationToken == null) {
3769
3899
  const optionsComplete = Object.assign({ maxresults: continuationState.maxPageSize, includePending: options.includePending }, options);
3770
- const currentSetResponse = yield tslib.__await(withTrace$4("listPropertiesOfCertificates", optionsComplete, (updatedOptions) => this.client.getCertificates(this.vaultUrl, updatedOptions)));
3900
+ const currentSetResponse = yield tslib.__await(withTrace("listPropertiesOfCertificates", optionsComplete, (updatedOptions) => this.client.getCertificates(this.vaultUrl, updatedOptions)));
3771
3901
  continuationState.continuationToken = currentSetResponse.nextLink;
3772
3902
  if (currentSetResponse.value) {
3773
3903
  yield yield tslib.__await(currentSetResponse.value.map(getPropertiesFromCertificateBundle, this));
3774
3904
  }
3775
3905
  }
3776
3906
  while (continuationState.continuationToken) {
3777
- const currentSetResponse = yield tslib.__await(withTrace$4("listPropertiesOfCertificates", options, (updatedOptions) => this.client.getCertificates(continuationState.continuationToken, updatedOptions)));
3907
+ const currentSetResponse = yield tslib.__await(withTrace("listPropertiesOfCertificates", options, (updatedOptions) => this.client.getCertificates(continuationState.continuationToken, updatedOptions)));
3778
3908
  continuationState.continuationToken = currentSetResponse.nextLink;
3779
3909
  if (currentSetResponse.value) {
3780
3910
  yield yield tslib.__await(currentSetResponse.value.map(getPropertiesFromCertificateBundle, this));
@@ -3836,7 +3966,7 @@ class CertificateClient {
3836
3966
  [Symbol.asyncIterator]() {
3837
3967
  return this;
3838
3968
  },
3839
- byPage: (settings = {}) => this.listPropertiesOfCertificatesPage(settings, options)
3969
+ byPage: (settings = {}) => this.listPropertiesOfCertificatesPage(settings, options),
3840
3970
  };
3841
3971
  return result;
3842
3972
  }
@@ -3844,14 +3974,14 @@ class CertificateClient {
3844
3974
  return tslib.__asyncGenerator(this, arguments, function* listPropertiesOfCertificateVersionsPage_1() {
3845
3975
  if (continuationState.continuationToken == null) {
3846
3976
  const optionsComplete = Object.assign({ maxresults: continuationState.maxPageSize }, options);
3847
- const currentSetResponse = yield tslib.__await(withTrace$4("listPropertiesOfCertificateVersions", optionsComplete, (updatedOptions) => this.client.getCertificateVersions(this.vaultUrl, certificateName, updatedOptions)));
3977
+ const currentSetResponse = yield tslib.__await(withTrace("listPropertiesOfCertificateVersions", optionsComplete, (updatedOptions) => this.client.getCertificateVersions(this.vaultUrl, certificateName, updatedOptions)));
3848
3978
  continuationState.continuationToken = currentSetResponse.nextLink;
3849
3979
  if (currentSetResponse.value) {
3850
3980
  yield yield tslib.__await(currentSetResponse.value.map(getPropertiesFromCertificateBundle, this));
3851
3981
  }
3852
3982
  }
3853
3983
  while (continuationState.continuationToken) {
3854
- const currentSetResponse = yield tslib.__await(withTrace$4("listPropertiesOfCertificateVersions", options, (updatedOptions) => this.client.getCertificateVersions(continuationState.continuationToken, certificateName, updatedOptions)));
3984
+ const currentSetResponse = yield tslib.__await(withTrace("listPropertiesOfCertificateVersions", options, (updatedOptions) => this.client.getCertificateVersions(continuationState.continuationToken, certificateName, updatedOptions)));
3855
3985
  continuationState.continuationToken = currentSetResponse.nextLink;
3856
3986
  if (currentSetResponse.value) {
3857
3987
  yield yield tslib.__await(currentSetResponse.value.map(getPropertiesFromCertificateBundle, this));
@@ -3907,7 +4037,7 @@ class CertificateClient {
3907
4037
  [Symbol.asyncIterator]() {
3908
4038
  return this;
3909
4039
  },
3910
- byPage: (settings = {}) => this.listPropertiesOfCertificateVersionsPage(certificateName, settings, options)
4040
+ byPage: (settings = {}) => this.listPropertiesOfCertificateVersionsPage(certificateName, settings, options),
3911
4041
  };
3912
4042
  return result;
3913
4043
  }
@@ -3966,7 +4096,7 @@ class CertificateClient {
3966
4096
  * @param options - The optional parameters
3967
4097
  */
3968
4098
  deleteContacts(options = {}) {
3969
- return withTrace$4("deleteContacts", options, async (updatedOptions) => {
4099
+ return withTrace("deleteContacts", options, async (updatedOptions) => {
3970
4100
  const result = await this.client.deleteCertificateContacts(this.vaultUrl, updatedOptions);
3971
4101
  return coreContactsToCertificateContacts(result._response.parsedBody);
3972
4102
  });
@@ -3991,9 +4121,9 @@ class CertificateClient {
3991
4121
  const coreContacts = contacts.map((x) => ({
3992
4122
  emailAddress: x ? x.email : undefined,
3993
4123
  name: x ? x.name : undefined,
3994
- phone: x ? x.phone : undefined
4124
+ phone: x ? x.phone : undefined,
3995
4125
  }));
3996
- return withTrace$4("setContacts", options, async (updatedOptions) => {
4126
+ return withTrace("setContacts", options, async (updatedOptions) => {
3997
4127
  const result = await this.client.setCertificateContacts(this.vaultUrl, { contactList: coreContacts }, updatedOptions);
3998
4128
  return coreContactsToCertificateContacts(result._response.parsedBody);
3999
4129
  });
@@ -4016,7 +4146,7 @@ class CertificateClient {
4016
4146
  * @param options - The optional parameters
4017
4147
  */
4018
4148
  getContacts(options = {}) {
4019
- return withTrace$4("getContacts", options, async (updatedOptions) => {
4149
+ return withTrace("getContacts", options, async (updatedOptions) => {
4020
4150
  const result = await this.client.getCertificateContacts(this.vaultUrl, updatedOptions);
4021
4151
  return coreContactsToCertificateContacts(result);
4022
4152
  });
@@ -4025,14 +4155,14 @@ class CertificateClient {
4025
4155
  return tslib.__asyncGenerator(this, arguments, function* listPropertiesOfIssuersPage_1() {
4026
4156
  if (continuationState.continuationToken == null) {
4027
4157
  const requestOptionsComplete = Object.assign({ maxresults: continuationState.maxPageSize }, options);
4028
- const currentSetResponse = yield tslib.__await(withTrace$4("listPropertiesOfIssuers", requestOptionsComplete, (updatedOptions) => this.client.getCertificateIssuers(this.vaultUrl, updatedOptions)));
4158
+ const currentSetResponse = yield tslib.__await(withTrace("listPropertiesOfIssuers", requestOptionsComplete, (updatedOptions) => this.client.getCertificateIssuers(this.vaultUrl, updatedOptions)));
4029
4159
  continuationState.continuationToken = currentSetResponse.nextLink;
4030
4160
  if (currentSetResponse.value) {
4031
4161
  yield yield tslib.__await(currentSetResponse.value);
4032
4162
  }
4033
4163
  }
4034
4164
  while (continuationState.continuationToken) {
4035
- const currentSetResponse = yield tslib.__await(withTrace$4("listPropertiesOfIssuers", options, (updatedOptions) => this.client.getCertificateIssuers(continuationState.continuationToken, updatedOptions)));
4165
+ const currentSetResponse = yield tslib.__await(withTrace("listPropertiesOfIssuers", options, (updatedOptions) => this.client.getCertificateIssuers(continuationState.continuationToken, updatedOptions)));
4036
4166
  continuationState.continuationToken = currentSetResponse.nextLink;
4037
4167
  if (currentSetResponse.value) {
4038
4168
  yield yield tslib.__await(currentSetResponse.value);
@@ -4094,7 +4224,7 @@ class CertificateClient {
4094
4224
  [Symbol.asyncIterator]() {
4095
4225
  return this;
4096
4226
  },
4097
- byPage: (settings = {}) => this.listPropertiesOfIssuersPage(settings, options)
4227
+ byPage: (settings = {}) => this.listPropertiesOfIssuersPage(settings, options),
4098
4228
  };
4099
4229
  return result;
4100
4230
  }
@@ -4113,11 +4243,11 @@ class CertificateClient {
4113
4243
  * @param options - The optional parameters
4114
4244
  */
4115
4245
  createIssuer(issuerName, provider, options = {}) {
4116
- return withTrace$4("createIssuer", options, async (updatedOptions) => {
4246
+ return withTrace("createIssuer", options, async (updatedOptions) => {
4117
4247
  const { accountId, password } = updatedOptions;
4118
4248
  const generatedOptions = Object.assign(Object.assign({}, updatedOptions), { credentials: {
4119
4249
  accountId,
4120
- password
4250
+ password,
4121
4251
  } });
4122
4252
  if (updatedOptions.organizationId ||
4123
4253
  (updatedOptions.administratorContacts && updatedOptions.administratorContacts.length)) {
@@ -4128,14 +4258,14 @@ class CertificateClient {
4128
4258
  emailAddress: x.email,
4129
4259
  phone: x.phone,
4130
4260
  firstName: x.firstName,
4131
- lastName: x.lastName
4261
+ lastName: x.lastName,
4132
4262
  }))
4133
- : undefined
4263
+ : undefined,
4134
4264
  };
4135
4265
  }
4136
4266
  if (updatedOptions.enabled !== undefined) {
4137
4267
  generatedOptions.attributes = {
4138
- enabled: updatedOptions.enabled
4268
+ enabled: updatedOptions.enabled,
4139
4269
  };
4140
4270
  }
4141
4271
  const result = await this.client.setCertificateIssuer(this.vaultUrl, issuerName, provider, generatedOptions);
@@ -4159,11 +4289,11 @@ class CertificateClient {
4159
4289
  * @param options - The optional parameters
4160
4290
  */
4161
4291
  async updateIssuer(issuerName, options = {}) {
4162
- return withTrace$4("updateIssuer", options, async (updatedOptions) => {
4292
+ return withTrace("updateIssuer", options, async (updatedOptions) => {
4163
4293
  const { accountId, password } = options;
4164
4294
  const generatedOptions = Object.assign(Object.assign({}, updatedOptions), { credentials: {
4165
4295
  accountId,
4166
- password
4296
+ password,
4167
4297
  } });
4168
4298
  if (updatedOptions.organizationId ||
4169
4299
  (updatedOptions.administratorContacts && updatedOptions.administratorContacts.length)) {
@@ -4174,14 +4304,14 @@ class CertificateClient {
4174
4304
  emailAddress: x.email,
4175
4305
  phone: x.phone,
4176
4306
  firstName: x.firstName,
4177
- lastName: x.lastName
4307
+ lastName: x.lastName,
4178
4308
  }))
4179
- : undefined
4309
+ : undefined,
4180
4310
  };
4181
4311
  }
4182
4312
  if (updatedOptions.enabled) {
4183
4313
  generatedOptions.attributes = {
4184
- enabled: updatedOptions.enabled
4314
+ enabled: updatedOptions.enabled,
4185
4315
  };
4186
4316
  }
4187
4317
  const result = await this.client.updateCertificateIssuer(this.vaultUrl, issuerName, generatedOptions);
@@ -4205,7 +4335,7 @@ class CertificateClient {
4205
4335
  * @param options - The optional parameters
4206
4336
  */
4207
4337
  getIssuer(issuerName, options = {}) {
4208
- return withTrace$4("getIssuer", options, async (updatedOptions) => {
4338
+ return withTrace("getIssuer", options, async (updatedOptions) => {
4209
4339
  const result = await this.client.getCertificateIssuer(this.vaultUrl, issuerName, updatedOptions);
4210
4340
  return toPublicIssuer(result._response.parsedBody);
4211
4341
  });
@@ -4225,7 +4355,7 @@ class CertificateClient {
4225
4355
  * @param options - The optional parameters
4226
4356
  */
4227
4357
  deleteIssuer(issuerName, options = {}) {
4228
- return withTrace$4("deleteIssuer", options, async (updatedOptions) => {
4358
+ return withTrace("deleteIssuer", options, async (updatedOptions) => {
4229
4359
  const result = await this.client.deleteCertificateIssuer(this.vaultUrl, issuerName, updatedOptions);
4230
4360
  return toPublicIssuer(result._response.parsedBody);
4231
4361
  });
@@ -4274,7 +4404,7 @@ class CertificateClient {
4274
4404
  createCertificateOptions: options,
4275
4405
  operationOptions: options,
4276
4406
  intervalInMs: options.intervalInMs,
4277
- resumeFrom: options.resumeFrom
4407
+ resumeFrom: options.resumeFrom,
4278
4408
  });
4279
4409
  // This will initialize the poller's operation (the creation of the secret).
4280
4410
  await poller.poll();
@@ -4299,7 +4429,7 @@ class CertificateClient {
4299
4429
  * @param options - The optional parameters
4300
4430
  */
4301
4431
  getCertificate(certificateName, options = {}) {
4302
- return withTrace$4("getCertificate", options, async (updatedOptions) => {
4432
+ return withTrace("getCertificate", options, async (updatedOptions) => {
4303
4433
  const result = await this.client.getCertificate(this.vaultUrl, certificateName, "", updatedOptions);
4304
4434
  return getCertificateWithPolicyFromCertificateBundle(result);
4305
4435
  });
@@ -4325,7 +4455,7 @@ class CertificateClient {
4325
4455
  * @param options - The optional parameters
4326
4456
  */
4327
4457
  getCertificateVersion(certificateName, version, options = {}) {
4328
- return withTrace$4("getCertificateVersion", options, async (updatedOptions) => {
4458
+ return withTrace("getCertificateVersion", options, async (updatedOptions) => {
4329
4459
  if (!version) {
4330
4460
  throw new Error("The 'version' cannot be empty.");
4331
4461
  }
@@ -4345,7 +4475,7 @@ class CertificateClient {
4345
4475
  * const base64EncodedCertificate = certificateSecret.value!;
4346
4476
  * let buffer: Uint8Array;
4347
4477
  *
4348
- * if (true) {
4478
+ * if (isNode) {
4349
4479
  * buffer = Buffer.from(base64EncodedCertificate, "base64");
4350
4480
  * } else {
4351
4481
  * buffer = Uint8Array.from(atob(base64EncodedCertificate), (c) => c.charCodeAt(0));
@@ -4359,7 +4489,7 @@ class CertificateClient {
4359
4489
  * @param options - The optional parameters
4360
4490
  */
4361
4491
  importCertificate(certificateName, certificateBytes, options = {}) {
4362
- return withTrace$4("importCertificate", options, async (updatedOptions) => {
4492
+ return withTrace("importCertificate", options, async (updatedOptions) => {
4363
4493
  var _a;
4364
4494
  const base64EncodedCertificate = parseCertificateBytes(certificateBytes, (_a = updatedOptions.policy) === null || _a === void 0 ? void 0 : _a.contentType);
4365
4495
  const result = await this.client.importCertificate(this.vaultUrl, certificateName, base64EncodedCertificate, updatedOptions);
@@ -4384,7 +4514,7 @@ class CertificateClient {
4384
4514
  * @param options - The optional parameters
4385
4515
  */
4386
4516
  getCertificatePolicy(certificateName, options = {}) {
4387
- return withTrace$4("getCertificatePolicy", options, async (updatedOptions) => {
4517
+ return withTrace("getCertificatePolicy", options, async (updatedOptions) => {
4388
4518
  const result = await this.client.getCertificatePolicy(this.vaultUrl, certificateName, updatedOptions);
4389
4519
  return toPublicPolicy(result._response.parsedBody);
4390
4520
  });
@@ -4397,7 +4527,7 @@ class CertificateClient {
4397
4527
  * @param options - The optional parameters
4398
4528
  */
4399
4529
  updateCertificatePolicy(certificateName, policy, options = {}) {
4400
- return withTrace$4("updateCertificatePolicy", options, async (updatedOptions) => {
4530
+ return withTrace("updateCertificatePolicy", options, async (updatedOptions) => {
4401
4531
  const corePolicy = toCorePolicy(undefined, policy);
4402
4532
  const result = await this.client.updateCertificatePolicy(this.vaultUrl, certificateName, corePolicy, updatedOptions);
4403
4533
  return toPublicPolicy(result._response.parsedBody);
@@ -4414,6 +4544,9 @@ class CertificateClient {
4414
4544
  * issuerName: "Self",
4415
4545
  * subject: "cn=MyCert"
4416
4546
  * });
4547
+ *
4548
+ * // You may pass an empty string for version which will update
4549
+ * // the latest version of the certificate
4417
4550
  * await client.updateCertificateProperties("MyCertificate", "", {
4418
4551
  * tags: {
4419
4552
  * customTag: "value"
@@ -4422,11 +4555,11 @@ class CertificateClient {
4422
4555
  * ```
4423
4556
  * Updates a certificate
4424
4557
  * @param certificateName - The name of the certificate
4425
- * @param version - The version of the certificate to update
4558
+ * @param version - The version of the certificate to update (an empty string will update the latest version)
4426
4559
  * @param options - The options, including what to update
4427
4560
  */
4428
4561
  updateCertificateProperties(certificateName, version, options = {}) {
4429
- return withTrace$4("updateCertificateProperties", options, async (updatedOptions) => {
4562
+ return withTrace("updateCertificateProperties", options, async (updatedOptions) => {
4430
4563
  const result = await this.client.updateCertificate(this.vaultUrl, certificateName, version, Object.assign(Object.assign({}, updatedOptions), { certificateAttributes: toCoreAttributes(options) }));
4431
4564
  return getCertificateFromCertificateBundle(result._response.parsedBody);
4432
4565
  });
@@ -4460,7 +4593,7 @@ class CertificateClient {
4460
4593
  vaultUrl: this.vaultUrl,
4461
4594
  intervalInMs: options.intervalInMs,
4462
4595
  resumeFrom: options.resumeFrom,
4463
- operationOptions: options
4596
+ operationOptions: options,
4464
4597
  });
4465
4598
  // This will initialize the poller's operation, which pre-populates some necessary properties.
4466
4599
  await poller.poll();
@@ -4485,7 +4618,7 @@ class CertificateClient {
4485
4618
  * @param options - The optional parameters
4486
4619
  */
4487
4620
  deleteCertificateOperation(certificateName, options = {}) {
4488
- return withTrace$4("deleteCertificateOperation", options, async (updatedOptions) => {
4621
+ return withTrace("deleteCertificateOperation", options, async (updatedOptions) => {
4489
4622
  const result = await this.client.deleteCertificateOperation(this.vaultUrl, certificateName, updatedOptions);
4490
4623
  return getCertificateOperationFromCoreOperation(certificateName, this.vaultUrl, result._response.parsedBody);
4491
4624
  });
@@ -4525,7 +4658,7 @@ class CertificateClient {
4525
4658
  * @param options - The optional parameters
4526
4659
  */
4527
4660
  mergeCertificate(certificateName, x509Certificates, options = {}) {
4528
- return withTrace$4("mergeCertificate", options, async (updatedOptions) => {
4661
+ return withTrace("mergeCertificate", options, async (updatedOptions) => {
4529
4662
  const result = await this.client.mergeCertificate(this.vaultUrl, certificateName, x509Certificates, updatedOptions);
4530
4663
  return getCertificateWithPolicyFromCertificateBundle(result._response.parsedBody);
4531
4664
  });
@@ -4548,7 +4681,7 @@ class CertificateClient {
4548
4681
  * @param options - The optional parameters
4549
4682
  */
4550
4683
  backupCertificate(certificateName, options = {}) {
4551
- return withTrace$4("backupCertificate", options, async (updatedOptions) => {
4684
+ return withTrace("backupCertificate", options, async (updatedOptions) => {
4552
4685
  const result = await this.client.backupCertificate(this.vaultUrl, certificateName, updatedOptions);
4553
4686
  return result._response.parsedBody.value;
4554
4687
  });
@@ -4574,7 +4707,7 @@ class CertificateClient {
4574
4707
  * @param options - The optional parameters
4575
4708
  */
4576
4709
  restoreCertificateBackup(backup, options = {}) {
4577
- return withTrace$4("restoreCertificateBackup", options, async (updatedOptions) => {
4710
+ return withTrace("restoreCertificateBackup", options, async (updatedOptions) => {
4578
4711
  const result = await this.client.restoreCertificate(this.vaultUrl, backup, updatedOptions);
4579
4712
  return getCertificateWithPolicyFromCertificateBundle(result._response.parsedBody);
4580
4713
  });
@@ -4583,14 +4716,14 @@ class CertificateClient {
4583
4716
  return tslib.__asyncGenerator(this, arguments, function* listDeletedCertificatesPage_1() {
4584
4717
  if (continuationState.continuationToken == null) {
4585
4718
  const requestOptionsComplete = Object.assign({ maxresults: continuationState.maxPageSize, includePending: options.includePending }, options);
4586
- const currentSetResponse = yield tslib.__await(withTrace$4("listDeletedCertificates", requestOptionsComplete, (updatedOptions) => this.client.getDeletedCertificates(this.vaultUrl, updatedOptions)));
4719
+ const currentSetResponse = yield tslib.__await(withTrace("listDeletedCertificates", requestOptionsComplete, (updatedOptions) => this.client.getDeletedCertificates(this.vaultUrl, updatedOptions)));
4587
4720
  continuationState.continuationToken = currentSetResponse.nextLink;
4588
4721
  if (currentSetResponse.value) {
4589
4722
  yield yield tslib.__await(currentSetResponse.value.map(getDeletedCertificateFromItem, this));
4590
4723
  }
4591
4724
  }
4592
4725
  while (continuationState.continuationToken) {
4593
- const currentSetResponse = yield tslib.__await(withTrace$4("listDeletedCertificates", options, (updatedOptions) => this.client.getDeletedCertificates(continuationState.continuationToken, updatedOptions)));
4726
+ const currentSetResponse = yield tslib.__await(withTrace("listDeletedCertificates", options, (updatedOptions) => this.client.getDeletedCertificates(continuationState.continuationToken, updatedOptions)));
4594
4727
  continuationState.continuationToken = currentSetResponse.nextLink;
4595
4728
  if (currentSetResponse.value) {
4596
4729
  yield yield tslib.__await(currentSetResponse.value.map(getDeletedCertificateFromItem, this));
@@ -4650,7 +4783,7 @@ class CertificateClient {
4650
4783
  [Symbol.asyncIterator]() {
4651
4784
  return this;
4652
4785
  },
4653
- byPage: (settings = {}) => this.listDeletedCertificatesPage(settings, options)
4786
+ byPage: (settings = {}) => this.listDeletedCertificatesPage(settings, options),
4654
4787
  };
4655
4788
  return result;
4656
4789
  }
@@ -4669,7 +4802,7 @@ class CertificateClient {
4669
4802
  * @param options - The optional parameters
4670
4803
  */
4671
4804
  getDeletedCertificate(certificateName, options = {}) {
4672
- return withTrace$4("getDeletedCertificate", options, async (updatedOptions) => {
4805
+ return withTrace("getDeletedCertificate", options, async (updatedOptions) => {
4673
4806
  const result = await this.client.getDeletedCertificate(this.vaultUrl, certificateName, updatedOptions);
4674
4807
  return getDeletedCertificateFromDeletedCertificateBundle(result._response.parsedBody);
4675
4808
  });
@@ -4691,7 +4824,7 @@ class CertificateClient {
4691
4824
  * @param options - The optional parameters
4692
4825
  */
4693
4826
  async purgeDeletedCertificate(certificateName, options = {}) {
4694
- return withTrace$4("purgeDeletedCertificate", options, async (updatedOptions) => {
4827
+ return withTrace("purgeDeletedCertificate", options, async (updatedOptions) => {
4695
4828
  await this.client.purgeDeletedCertificate(this.vaultUrl, certificateName, updatedOptions);
4696
4829
  return null;
4697
4830
  });