@azure/keyvault-admin 4.6.1-alpha.20250206.1 → 4.6.1-alpha.20250211.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.
- package/README.md +12 -14
- package/dist/commonjs/accessControlClient.d.ts +121 -30
- package/dist/commonjs/accessControlClient.d.ts.map +1 -1
- package/dist/commonjs/accessControlClient.js +121 -30
- package/dist/commonjs/accessControlClient.js.map +1 -1
- package/dist/commonjs/backupClient.d.ts +68 -58
- package/dist/commonjs/backupClient.d.ts.map +1 -1
- package/dist/commonjs/backupClient.js +5 -6
- package/dist/commonjs/backupClient.js.map +1 -1
- package/dist/commonjs/settingsClient.d.ts +5 -6
- package/dist/commonjs/settingsClient.d.ts.map +1 -1
- package/dist/commonjs/settingsClient.js +5 -6
- package/dist/commonjs/settingsClient.js.map +1 -1
- package/dist/esm/accessControlClient.d.ts +121 -30
- package/dist/esm/accessControlClient.d.ts.map +1 -1
- package/dist/esm/accessControlClient.js +121 -30
- package/dist/esm/accessControlClient.js.map +1 -1
- package/dist/esm/backupClient.d.ts +68 -58
- package/dist/esm/backupClient.d.ts.map +1 -1
- package/dist/esm/backupClient.js +5 -6
- package/dist/esm/backupClient.js.map +1 -1
- package/dist/esm/settingsClient.d.ts +5 -6
- package/dist/esm/settingsClient.d.ts.map +1 -1
- package/dist/esm/settingsClient.js +5 -6
- package/dist/esm/settingsClient.js.map +1 -1
- package/package.json +16 -16
|
@@ -22,14 +22,13 @@ export declare class KeyVaultBackupClient {
|
|
|
22
22
|
* Creates an instance of the KeyVaultBackupClient.
|
|
23
23
|
*
|
|
24
24
|
* Example usage:
|
|
25
|
-
* ```ts
|
|
26
|
-
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
25
|
+
* ```ts snippet:ReadmeSampleCreateBackupClient
|
|
27
26
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
27
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
28
28
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* let client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
29
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
30
|
+
* const credentials = new DefaultAzureCredential();
|
|
31
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
33
32
|
* ```
|
|
34
33
|
* @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.
|
|
35
34
|
* @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
|
|
@@ -42,21 +41,23 @@ export declare class KeyVaultBackupClient {
|
|
|
42
41
|
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.
|
|
43
42
|
*
|
|
44
43
|
* Example usage:
|
|
45
|
-
* ```ts
|
|
46
|
-
*
|
|
44
|
+
* ```ts snippet:ReadmeSampleBeginBackup_SAS
|
|
45
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
46
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
47
|
+
*
|
|
48
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
49
|
+
* const credentials = new DefaultAzureCredential();
|
|
50
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
47
51
|
*
|
|
48
52
|
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
49
53
|
* const sasToken = "<sas-token>";
|
|
50
54
|
* const poller = await client.beginBackup(blobStorageUri, sasToken);
|
|
51
55
|
*
|
|
52
56
|
* // Serializing the poller
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* //
|
|
57
|
+
* const serialized = poller.toString();
|
|
58
|
+
*
|
|
56
59
|
* // A new poller can be created with:
|
|
57
|
-
*
|
|
58
|
-
* // await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
59
|
-
* //
|
|
60
|
+
* await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
60
61
|
*
|
|
61
62
|
* // Waiting until it's done
|
|
62
63
|
* const backupUri = await poller.pollUntilDone();
|
|
@@ -75,21 +76,22 @@ export declare class KeyVaultBackupClient {
|
|
|
75
76
|
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.
|
|
76
77
|
*
|
|
77
78
|
* Example usage:
|
|
78
|
-
* ```ts
|
|
79
|
-
*
|
|
79
|
+
* ```ts snippet:ReadmeSampleBeginBackup_NonSAS
|
|
80
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
81
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
82
|
+
*
|
|
83
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
84
|
+
* const credentials = new DefaultAzureCredential();
|
|
85
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
80
86
|
*
|
|
81
87
|
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
82
|
-
* const sasToken = "<sas-token>";
|
|
83
88
|
* const poller = await client.beginBackup(blobStorageUri);
|
|
84
89
|
*
|
|
85
90
|
* // Serializing the poller
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* //
|
|
91
|
+
* const serialized = poller.toString();
|
|
92
|
+
*
|
|
89
93
|
* // A new poller can be created with:
|
|
90
|
-
*
|
|
91
|
-
* // await client.beginBackup(blobStorageUri, { resumeFrom: serialized });
|
|
92
|
-
* //
|
|
94
|
+
* await client.beginBackup(blobStorageUri, { resumeFrom: serialized });
|
|
93
95
|
*
|
|
94
96
|
* // Waiting until it's done
|
|
95
97
|
* const backupUri = await poller.pollUntilDone();
|
|
@@ -107,21 +109,23 @@ export declare class KeyVaultBackupClient {
|
|
|
107
109
|
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.
|
|
108
110
|
*
|
|
109
111
|
* Example usage:
|
|
110
|
-
* ```ts
|
|
111
|
-
*
|
|
112
|
+
* ```ts snippet:ReadmeSampleBeginRestore_SAS
|
|
113
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
114
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
115
|
+
*
|
|
116
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
117
|
+
* const credentials = new DefaultAzureCredential();
|
|
118
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
112
119
|
*
|
|
113
120
|
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
114
121
|
* const sasToken = "<sas-token>";
|
|
115
122
|
* const poller = await client.beginRestore(blobStorageUri, sasToken);
|
|
116
123
|
*
|
|
117
124
|
* // The poller can be serialized with:
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* //
|
|
125
|
+
* const serialized = poller.toString();
|
|
126
|
+
*
|
|
121
127
|
* // A new poller can be created with:
|
|
122
|
-
*
|
|
123
|
-
* // await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
124
|
-
* //
|
|
128
|
+
* await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
125
129
|
*
|
|
126
130
|
* // Waiting until it's done
|
|
127
131
|
* const backupUri = await poller.pollUntilDone();
|
|
@@ -140,21 +144,22 @@ export declare class KeyVaultBackupClient {
|
|
|
140
144
|
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.
|
|
141
145
|
*
|
|
142
146
|
* Example usage:
|
|
143
|
-
* ```ts
|
|
144
|
-
*
|
|
147
|
+
* ```ts snippet:ReadmeSampleBeginRestore_NonSAS
|
|
148
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
149
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
150
|
+
*
|
|
151
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
152
|
+
* const credentials = new DefaultAzureCredential();
|
|
153
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
145
154
|
*
|
|
146
155
|
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
147
|
-
* const sasToken = "<sas-token>";
|
|
148
156
|
* const poller = await client.beginRestore(blobStorageUri);
|
|
149
157
|
*
|
|
150
158
|
* // The poller can be serialized with:
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* //
|
|
159
|
+
* const serialized = poller.toString();
|
|
160
|
+
*
|
|
154
161
|
* // A new poller can be created with:
|
|
155
|
-
*
|
|
156
|
-
* // await client.beginRestore(blobStorageUri, { resumeFrom: serialized });
|
|
157
|
-
* //
|
|
162
|
+
* await client.beginRestore(blobStorageUri, { resumeFrom: serialized });
|
|
158
163
|
*
|
|
159
164
|
* // Waiting until it's done
|
|
160
165
|
* const backupUri = await poller.pollUntilDone();
|
|
@@ -173,8 +178,13 @@ export declare class KeyVaultBackupClient {
|
|
|
173
178
|
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.
|
|
174
179
|
*
|
|
175
180
|
* Example usage:
|
|
176
|
-
* ```ts
|
|
177
|
-
*
|
|
181
|
+
* ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_SAS
|
|
182
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
183
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
184
|
+
*
|
|
185
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
186
|
+
* const credentials = new DefaultAzureCredential();
|
|
187
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
178
188
|
*
|
|
179
189
|
* const blobStorageUri = "<blob-storage-uri>";
|
|
180
190
|
* const sasToken = "<sas-token>";
|
|
@@ -182,13 +192,12 @@ export declare class KeyVaultBackupClient {
|
|
|
182
192
|
* const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);
|
|
183
193
|
*
|
|
184
194
|
* // Serializing the poller
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* //
|
|
195
|
+
* const serialized = poller.toString();
|
|
196
|
+
*
|
|
188
197
|
* // A new poller can be created with:
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
198
|
+
* await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, {
|
|
199
|
+
* resumeFrom: serialized,
|
|
200
|
+
* });
|
|
192
201
|
*
|
|
193
202
|
* // Waiting until it's done
|
|
194
203
|
* await poller.pollUntilDone();
|
|
@@ -207,22 +216,23 @@ export declare class KeyVaultBackupClient {
|
|
|
207
216
|
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.
|
|
208
217
|
*
|
|
209
218
|
* Example usage:
|
|
210
|
-
* ```ts
|
|
211
|
-
*
|
|
219
|
+
* ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_NonSAS
|
|
220
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
221
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
222
|
+
*
|
|
223
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
224
|
+
* const credentials = new DefaultAzureCredential();
|
|
225
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
212
226
|
*
|
|
213
227
|
* const blobStorageUri = "<blob-storage-uri>";
|
|
214
|
-
* const sasToken = "<sas-token>";
|
|
215
228
|
* const keyName = "<key-name>";
|
|
216
|
-
* const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri
|
|
229
|
+
* const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri);
|
|
217
230
|
*
|
|
218
231
|
* // Serializing the poller
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* //
|
|
232
|
+
* const serialized = poller.toString();
|
|
233
|
+
*
|
|
222
234
|
* // A new poller can be created with:
|
|
223
|
-
*
|
|
224
|
-
* // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
225
|
-
* //
|
|
235
|
+
* await client.beginSelectiveKeyRestore(keyName, blobStorageUri, { resumeFrom: serialized });
|
|
226
236
|
*
|
|
227
237
|
* // Waiting until it's done
|
|
228
238
|
* await poller.pollUntilDone();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupClient.d.ts","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,uCAAuC,EACvC,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,yCAAyC,EAC1C,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAC7B,yCAAyC,EACzC,+BAA+B,GAChC,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IAExC
|
|
1
|
+
{"version":3,"file":"backupClient.d.ts","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,uCAAuC,EACvC,qBA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;;;;;;;;;;;OAgCG;IACU,YAAY,CACvB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,qBAAqB,CAAC,CAAC;IAsC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACU,wBAAwB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,uCAAuC,GAChD,OAAO,CACR,UAAU,CAAC,yCAAyC,EAAE,iCAAiC,CAAC,CACzF;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACU,wBAAwB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,uCAAuC,GAChD,OAAO,CACR,UAAU,CAAC,yCAAyC,EAAE,iCAAiC,CAAC,CACzF;CA6CF"}
|
package/dist/esm/backupClient.js
CHANGED
|
@@ -15,14 +15,13 @@ export class KeyVaultBackupClient {
|
|
|
15
15
|
* Creates an instance of the KeyVaultBackupClient.
|
|
16
16
|
*
|
|
17
17
|
* Example usage:
|
|
18
|
-
* ```ts
|
|
19
|
-
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
18
|
+
* ```ts snippet:ReadmeSampleCreateBackupClient
|
|
20
19
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
20
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* let client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
22
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
23
|
+
* const credentials = new DefaultAzureCredential();
|
|
24
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
26
25
|
* ```
|
|
27
26
|
* @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.
|
|
28
27
|
* @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupClient.js","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAalC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AASpE;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAW/B;;;;;;;;;;;;;;;;OAgBG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IA2EM,KAAK,CAAC,WAAW,CACtB,cAAsB,EACtB,oBAAyD,EAAE,EAC3D,+BAA2D,EAAE;QAE7D,MAAM,QAAQ,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;QACvF,MAAM,OAAO,GACX,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAE3F,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,UAAU,CACf,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,IAA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iBAC3C;aACF;YACD,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,kBAAkB,EAAE,OAAO,CAAC,YAAY;SACzC,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeyVaultBackupClientOptions,\n KeyVaultBackupResult,\n KeyVaultBeginBackupOptions,\n KeyVaultBeginRestoreOptions,\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultRestoreResult,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"./backupClientModels.js\";\nimport type { KeyVaultClient } from \"./generated/keyVaultClient.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { mappings } from \"./mappings.js\";\nimport { createKeyVaultClient } from \"./createKeyVaultClient.js\";\nimport type { PollerLike } from \"./lro/shim.js\";\nimport { wrapPoller } from \"./lro/shim.js\";\nimport {\n KeyVaultAdminPollOperationState,\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n} from \"./lro/models.js\";\nimport { restorePoller } from \"./generated/restorePollerHelpers.js\";\n\nexport {\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n KeyVaultAdminPollOperationState,\n};\n\n/**\n * The KeyVaultBackupClient provides methods to generate backups\n * and restore backups of any given Azure Key Vault instance.\n * This client supports generating full backups, selective restores of specific keys\n * and full restores of Key Vault instances.\n */\nexport class KeyVaultBackupClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultBackupClient.\n *\n * Example usage:\n * ```ts\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * let credentials = new DefaultAzureCredential();\n *\n * let client = new KeyVaultBackupClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n options: KeyVaultBackupClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n this.client = createKeyVaultClient(vaultUrl, credential, options);\n }\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account, using a user-assigned Managed Identity\n * to access the Storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginBackup(blobStorageUri, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n public async beginBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(this.client, options.resumeFrom, this.client.fullBackup, options),\n );\n }\n\n return wrapPoller(\n this.client.fullBackup({\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n azureStorageBlobContainerUri: {\n storageResourceUri: blobStorageUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder, using a user-assigned Managed Identity to access the storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri);\n *\n * // The poller can be serialized with:\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginRestore(blobStorageUri, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n public async beginRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(this.client, options.resumeFrom, this.client.fullRestoreOperation, options),\n );\n }\n\n return wrapPoller(\n this.client.fullRestoreOperation({\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n restoreBlobDetails: {\n folderToRestore: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n\n /**\n * Starts restoring all key versions of a given key using user supplied SAS token pointing to a previously\n * stored Azure Blob storage backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n /**\n * Starts restoring all key versions of a given key using to a previously\n * stored Azure Blob storage backup folder. The Blob storage backup folder will be accessed using user-assigned Managed Identity.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginSelectiveKeyRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n > {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(\n this.client,\n options.resumeFrom,\n this.client.selectiveKeyRestoreOperation,\n options,\n ),\n );\n }\n\n return wrapPoller(\n this.client.selectiveKeyRestoreOperation(keyName, {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n restoreBlobDetails: {\n folder: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"backupClient.js","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAalC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AASpE;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAW/B;;;;;;;;;;;;;;;OAeG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAA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AAO,CAAC,UAAU,EAClB,IAAI,CAAC,MAAM,CAAC,4BAA4B,EACxC,OAAO,CACR,CACF,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CACf,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE;YAChD,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,kBAAkB,EAAE;gBAClB,MAAM,EAAE,cAAc,CAAC,UAAU;gBACjC,kBAAkB,EAAE;oBAClB,kBAAkB,EAAE,cAAc,CAAC,SAAS;oBAC5C,KAAK,EAAE,QAAQ;oBACf,kBAAkB,EAAE,QAAQ,KAAK,SAAS;iBAC3C;aACF;YACD,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,kBAAkB,EAAE,OAAO,CAAC,YAAY;SACzC,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeyVaultBackupClientOptions,\n KeyVaultBackupResult,\n KeyVaultBeginBackupOptions,\n KeyVaultBeginRestoreOptions,\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultRestoreResult,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"./backupClientModels.js\";\nimport type { KeyVaultClient } from \"./generated/keyVaultClient.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { mappings } from \"./mappings.js\";\nimport { createKeyVaultClient } from \"./createKeyVaultClient.js\";\nimport type { PollerLike } from \"./lro/shim.js\";\nimport { wrapPoller } from \"./lro/shim.js\";\nimport {\n KeyVaultAdminPollOperationState,\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n} from \"./lro/models.js\";\nimport { restorePoller } from \"./generated/restorePollerHelpers.js\";\n\nexport {\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n KeyVaultAdminPollOperationState,\n};\n\n/**\n * The KeyVaultBackupClient provides methods to generate backups\n * and restore backups of any given Azure Key Vault instance.\n * This client supports generating full backups, selective restores of specific keys\n * and full restores of Key Vault instances.\n */\nexport class KeyVaultBackupClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultBackupClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateBackupClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n options: KeyVaultBackupClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n this.client = createKeyVaultClient(vaultUrl, credential, options);\n }\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginBackup_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account, using a user-assigned Managed Identity\n * to access the Storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginBackup_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginBackup(blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginBackup(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n public async beginBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(this.client, options.resumeFrom, this.client.fullBackup, options),\n );\n }\n\n return wrapPoller(\n this.client.fullBackup({\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n azureStorageBlobContainerUri: {\n storageResourceUri: blobStorageUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder, using a user-assigned Managed Identity to access the storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginRestore_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginRestore(blobStorageUri);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginRestore(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n public async beginRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(this.client, options.resumeFrom, this.client.fullRestoreOperation, options),\n );\n }\n\n return wrapPoller(\n this.client.fullRestoreOperation({\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n restoreBlobDetails: {\n folderToRestore: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n\n /**\n * Starts restoring all key versions of a given key using user supplied SAS token pointing to a previously\n * stored Azure Blob storage backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, {\n * resumeFrom: serialized,\n * });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n /**\n * Starts restoring all key versions of a given key using to a previously\n * stored Azure Blob storage backup folder. The Blob storage backup folder will be accessed using user-assigned Managed Identity.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginSelectiveKeyRestore(keyName, blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginSelectiveKeyRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n > {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(\n this.client,\n options.resumeFrom,\n this.client.selectiveKeyRestoreOperation,\n options,\n ),\n );\n }\n\n return wrapPoller(\n this.client.selectiveKeyRestoreOperation(keyName, {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n restoreBlobDetails: {\n folder: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n}\n"]}
|
|
@@ -21,14 +21,13 @@ export declare class KeyVaultSettingsClient {
|
|
|
21
21
|
* Creates an instance of the KeyVaultSettingsClient.
|
|
22
22
|
*
|
|
23
23
|
* Example usage:
|
|
24
|
-
* ```ts
|
|
25
|
-
* import { KeyVaultSettingsClient } from "@azure/keyvault-admin";
|
|
24
|
+
* ```ts snippet:ReadmeSampleCreateSettingsClient
|
|
26
25
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
26
|
+
* import { KeyVaultSettingsClient } from "@azure/keyvault-admin";
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* let client = new KeyVaultSettingsClient(vaultUrl, credentials);
|
|
28
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
29
|
+
* const credentials = new DefaultAzureCredential();
|
|
30
|
+
* const client = new KeyVaultSettingsClient(vaultUrl, credentials);
|
|
32
31
|
* ```
|
|
33
32
|
* @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.
|
|
34
33
|
* @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsClient.d.ts","sourceRoot":"","sources":["../../src/settingsClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AAmBnC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,IAAI,sBAAsB,CAE5F;AAED;;;GAGG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IAExC
|
|
1
|
+
{"version":3,"file":"settingsClient.d.ts","sourceRoot":"","sources":["../../src/settingsClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AAmBnC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,IAAI,sBAAsB,CAE5F;AAED;;;GAGG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IAExC;;;;;;;;;;;;;;;OAeG;gBAES,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,GAAE,qBAA0B;IAM9F;;;;;OAKG;IACG,aAAa,CACjB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,eAAe,CAAC;IAM3B;;;;;OAKG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhG;;;;OAIG;IAEG,WAAW,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAIpF"}
|
|
@@ -32,14 +32,13 @@ export class KeyVaultSettingsClient {
|
|
|
32
32
|
* Creates an instance of the KeyVaultSettingsClient.
|
|
33
33
|
*
|
|
34
34
|
* Example usage:
|
|
35
|
-
* ```ts
|
|
36
|
-
* import { KeyVaultSettingsClient } from "@azure/keyvault-admin";
|
|
35
|
+
* ```ts snippet:ReadmeSampleCreateSettingsClient
|
|
37
36
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
37
|
+
* import { KeyVaultSettingsClient } from "@azure/keyvault-admin";
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* let client = new KeyVaultSettingsClient(vaultUrl, credentials);
|
|
39
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
40
|
+
* const credentials = new DefaultAzureCredential();
|
|
41
|
+
* const client = new KeyVaultSettingsClient(vaultUrl, credentials);
|
|
43
42
|
* ```
|
|
44
43
|
* @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.
|
|
45
44
|
* @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsClient.js","sourceRoot":"","sources":["../../src/settingsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAclC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,SAAS,WAAW,CAAC,gBAAkC;IACrD,IAAI,gBAAgB,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO;YACL,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,KAAK,EAAE,gBAAgB,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;SACxD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO;YACL,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,KAAK,EAAE,gBAAgB,CAAC,KAAK;SAC9B,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAwB;IACvD,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAWjC
|
|
1
|
+
{"version":3,"file":"settingsClient.js","sourceRoot":"","sources":["../../src/settingsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAclC,OAAO,EAAE,oBAAoB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,WAAmB,EAAE,UAA6B,EAAE;QACnE,OAAO,WAAW,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACH,8DAA8D;IAC9D,KAAK,CAAC,WAAW,CAAC,UAA+B,EAAE;;QACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC5D,OAAO,EAAE,QAAQ,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,GAAG,CAAC,WAAW,CAAC,mCAAI,EAAE,EAAE,CAAC;IACxD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Setting as GeneratedSetting } from \"./generated/index.js\";\nimport type { KeyVaultClient } from \"./generated/index.js\";\nimport type {\n UpdateSettingOptions,\n GetSettingOptions,\n ListSettingsOptions,\n ListSettingsResponse,\n KeyVaultSetting,\n SettingsClientOptions,\n BooleanKeyVaultSetting,\n} from \"./settingsClientModels.js\";\nimport { createKeyVaultClient } from \"./createKeyVaultClient.js\";\n\nfunction makeSetting(generatedSetting: GeneratedSetting): KeyVaultSetting {\n if (generatedSetting.type === \"boolean\") {\n return {\n kind: \"boolean\",\n name: generatedSetting.name,\n value: generatedSetting.value === \"true\" ? true : false,\n };\n } else {\n return {\n kind: generatedSetting.type,\n name: generatedSetting.name,\n value: generatedSetting.value,\n };\n }\n}\n\n/**\n * Determines whether a given {@link KeyVaultSetting} is a {@link BooleanKeyVaultSetting}, i.e. has a boolean value.\n */\nexport function isBooleanSetting(setting: KeyVaultSetting): setting is BooleanKeyVaultSetting {\n return setting.kind === \"boolean\" && typeof setting.value === \"boolean\";\n}\n\n/**\n * The KeyVaultSettingsClient provides asynchronous methods to create, update, get and list\n * settings for the Azure Key Vault.\n */\nexport class KeyVaultSettingsClient {\n /**\n * The base URL to the vault.\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultSettingsClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSettingsClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultSettingsClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultSettingsClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n constructor(vaultUrl: string, credential: TokenCredential, options: SettingsClientOptions = {}) {\n this.vaultUrl = vaultUrl;\n\n this.client = createKeyVaultClient(vaultUrl, credential, options);\n }\n\n /**\n * Updates the named account setting.\n *\n * @param setting - the setting to update. The name of the setting must be a valid settings option.\n * @param options - the optional parameters.\n */\n async updateSetting(\n setting: KeyVaultSetting,\n options: UpdateSettingOptions = {},\n ): Promise<KeyVaultSetting> {\n return makeSetting(\n await this.client.updateSetting(setting.name, { value: String(setting.value) }, options),\n );\n }\n\n /**\n * Get the value of a specific account setting.\n *\n * @param settingName - the name of the setting.\n * @param options - the optional parameters.\n */\n async getSetting(settingName: string, options: GetSettingOptions = {}): Promise<KeyVaultSetting> {\n return makeSetting(await this.client.getSetting(settingName, options));\n }\n\n /**\n * List the account's settings.\n *\n * @param options - the optional parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n async getSettings(options: ListSettingsOptions = {}): Promise<ListSettingsResponse> {\n const { settings } = await this.client.getSettings(options);\n return { settings: settings?.map(makeSetting) ?? [] };\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure/keyvault-admin",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "4.6.1-alpha.
|
|
5
|
+
"version": "4.6.1-alpha.20250211.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Isomorphic client library for Azure KeyVault's administrative functions.",
|
|
8
8
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-admin/README.md",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
57
57
|
"unit-test:browser": "echo Skipped",
|
|
58
58
|
"unit-test:node": "dev-tool run test:vitest -- --test-timeout 100000 --hook-timeout 100000",
|
|
59
|
-
"update-snippets": "
|
|
59
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
60
60
|
},
|
|
61
61
|
"//metadata": {
|
|
62
62
|
"constantPaths": [
|
|
@@ -91,16 +91,16 @@
|
|
|
91
91
|
"sideEffects": false,
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@azure-rest/core-client": "^2.3.2",
|
|
94
|
-
"@azure/abort-controller": "^2.
|
|
95
|
-
"@azure/core-auth": "^1.
|
|
94
|
+
"@azure/abort-controller": "^2.1.2",
|
|
95
|
+
"@azure/core-auth": "^1.9.0",
|
|
96
96
|
"@azure/core-lro": "^3.1.0",
|
|
97
|
-
"@azure/core-paging": "^1.
|
|
98
|
-
"@azure/core-rest-pipeline": "^1.
|
|
99
|
-
"@azure/core-tracing": "^1.
|
|
100
|
-
"@azure/core-util": "^1.
|
|
97
|
+
"@azure/core-paging": "^1.6.2",
|
|
98
|
+
"@azure/core-rest-pipeline": "^1.19.0",
|
|
99
|
+
"@azure/core-tracing": "^1.2.0",
|
|
100
|
+
"@azure/core-util": "^1.11.0",
|
|
101
101
|
"@azure/keyvault-common": "^2.0.0",
|
|
102
|
-
"@azure/logger": "^1.
|
|
103
|
-
"tslib": "^2.
|
|
102
|
+
"@azure/logger": "^1.1.4",
|
|
103
|
+
"tslib": "^2.8.1"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@azure-tools/test-credential": "^2.0.0",
|
|
@@ -108,16 +108,16 @@
|
|
|
108
108
|
"@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
|
|
109
109
|
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
|
|
110
110
|
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
111
|
-
"@azure/identity": "^4.0
|
|
112
|
-
"@azure/keyvault-keys": "^4.
|
|
111
|
+
"@azure/identity": "^4.6.0",
|
|
112
|
+
"@azure/keyvault-keys": "^4.9.0",
|
|
113
113
|
"@types/node": "^18.0.0",
|
|
114
|
-
"@vitest/browser": "^3.0.
|
|
115
|
-
"@vitest/coverage-istanbul": "^3.0.
|
|
114
|
+
"@vitest/browser": "^3.0.5",
|
|
115
|
+
"@vitest/coverage-istanbul": "^3.0.5",
|
|
116
116
|
"dotenv": "^16.0.0",
|
|
117
117
|
"eslint": "^9.9.0",
|
|
118
|
-
"playwright": "^1.
|
|
118
|
+
"playwright": "^1.50.1",
|
|
119
119
|
"typescript": "~5.7.2",
|
|
120
|
-
"vitest": "^3.0.
|
|
120
|
+
"vitest": "^3.0.5"
|
|
121
121
|
},
|
|
122
122
|
"type": "module",
|
|
123
123
|
"tshy": {
|