@azure/keyvault-secrets 4.11.0 → 4.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/browser/api/keyVaultContext.js +2 -1
  2. package/dist/browser/api/keyVaultContext.js.map +1 -1
  3. package/dist/browser/constants.js +1 -1
  4. package/dist/browser/constants.js.map +1 -1
  5. package/dist/browser/index.js +4 -4
  6. package/dist/browser/index.js.map +1 -1
  7. package/dist/commonjs/api/keyVaultContext.js +2 -1
  8. package/dist/commonjs/api/keyVaultContext.js.map +2 -2
  9. package/dist/commonjs/constants.js +1 -1
  10. package/dist/commonjs/constants.js.map +1 -1
  11. package/dist/commonjs/index.js +18 -4
  12. package/dist/commonjs/index.js.map +2 -2
  13. package/dist/commonjs/tsdoc-metadata.json +1 -1
  14. package/dist/esm/api/keyVaultContext.js +2 -1
  15. package/dist/esm/api/keyVaultContext.js.map +1 -1
  16. package/dist/esm/constants.js +1 -1
  17. package/dist/esm/constants.js.map +1 -1
  18. package/dist/esm/index.js +4 -4
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/react-native/api/keyVaultContext.js +2 -1
  21. package/dist/react-native/api/keyVaultContext.js.map +1 -1
  22. package/dist/react-native/constants.js +1 -1
  23. package/dist/react-native/constants.js.map +1 -1
  24. package/dist/react-native/index.js +4 -4
  25. package/dist/react-native/index.js.map +1 -1
  26. package/package.json +13 -9
  27. package/dist/browser/models/index.d.ts +0 -2
  28. package/dist/browser/models/index.js +0 -4
  29. package/dist/browser/models/index.js.map +0 -1
  30. package/dist/commonjs/models/index.d.ts +0 -2
  31. package/dist/commonjs/models/index.js +0 -30
  32. package/dist/commonjs/models/index.js.map +0 -7
  33. package/dist/esm/models/index.d.ts +0 -2
  34. package/dist/esm/models/index.js +0 -4
  35. package/dist/esm/models/index.js.map +0 -1
  36. package/dist/react-native/models/index.d.ts +0 -2
  37. package/dist/react-native/models/index.js +0 -4
  38. package/dist/react-native/models/index.js.map +0 -1
@@ -2,11 +2,12 @@
2
2
  // Licensed under the MIT License.
3
3
  import { logger } from "../logger.js";
4
4
  import { getClient } from "@azure-rest/core-client";
5
+ import { SDK_VERSION } from "../constants.js";
5
6
  /** Creates a new Azure Key Vault Secrets client context. */
6
7
  export function createKeyVault(endpointParam, credential, options = {}) {
7
8
  const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);
8
9
  const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
9
- const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;
10
+ const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;
10
11
  const userAgentPrefix = prefixFromOptions
11
12
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
12
13
  : `azsdk-js-api ${userAgentInfo}`;
@@ -1 +1 @@
1
- {"version":3,"file":"keyVaultContext.js","sourceRoot":"","sources":["../../../src/api/keyVaultContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAiBpD,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAC5B,aAAqB,EACrB,UAA2B,EAC3B,UAAwC,EAAE;IAE1C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IACjF,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG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"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"]}
1
+ {"version":3,"file":"keyVaultContext.js","sourceRoot":"","sources":["../../../src/api/keyVaultContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgB9C,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAC5B,aAAqB,EACrB,UAA2B,EAC3B,UAAwC,EAAE;IAE1C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IACjF,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,6BAA6B,WAAW,EAAE,CAAC;IACjE,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,kCAAkC,CAAC;SAC5E;KACF,CAAC;IACF,MAAM,aAAa,GAAG,SAAS,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAqB,CAAC;AAC7D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { SDK_VERSION } from \"../constants.js\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- export const SDK_VERSION = "4.10.2";
3
+ export const SDK_VERSION = "4.11.2";
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.10.2\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.11.2\";\n"]}
@@ -113,9 +113,9 @@ export class SecretClient {
113
113
  * @param options - The optional parameters.
114
114
  */
115
115
  setSecret(secretName, value, options = {}) {
116
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
116
+ const { contentType, enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
117
117
  return tracingClient.withSpan("SecretClient.setSecret", remainingOptions, async (updatedOptions) => {
118
- const response = await this.client.setSecret(secretName, { value, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
118
+ const response = await this.client.setSecret(secretName, { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
119
119
  return getSecretFromSecretBundle(response);
120
120
  });
121
121
  }
@@ -184,9 +184,9 @@ export class SecretClient {
184
184
  * @param options - The optional parameters.
185
185
  */
186
186
  async updateSecretProperties(secretName, secretVersion, options = {}) {
187
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
187
+ const { contentType, enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
188
188
  return tracingClient.withSpan("SecretClient.updateSecretProperties", remainingOptions, async (updatedOptions) => {
189
- const response = await this.client.updateSecret(secretName, secretVersion, { secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
189
+ const response = await this.client.updateSecret(secretName, secretVersion, { contentType, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
190
190
  return getSecretFromSecretBundle(response).properties;
191
191
  });
192
192
  }
@@ -1 +1 @@
1
- {"version":3,"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CAAC,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,EAC7E,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,uBAAuB,CAC5B,UAA0C,EAAE;QAE5C,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EACxC,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,kBAAkB,CACvB,UAAqC,EAAE;QAEvC,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/C,OAAO,EACP,yBAAyB,CAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAqBtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,mCAAmC,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAIL,0BAA0B,EAE1B,gBAAg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\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"]}
@@ -22,10 +22,11 @@ __export(keyVaultContext_exports, {
22
22
  module.exports = __toCommonJS(keyVaultContext_exports);
23
23
  var import_logger = require("../logger.js");
24
24
  var import_core_client = require("@azure-rest/core-client");
25
+ var import_constants = require("../constants.js");
25
26
  function createKeyVault(endpointParam, credential, options = {}) {
26
27
  const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);
27
28
  const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
28
- const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;
29
+ const userAgentInfo = `azsdk-js-keyvault-secrets/${import_constants.SDK_VERSION}`;
29
30
  const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` : `azsdk-js-api ${userAgentInfo}`;
30
31
  const { apiVersion: _, ...updatedOptions } = {
31
32
  ...options,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/keyVaultContext.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAuB;AAGvB,yBAA0B;AAkBnB,SAAS,eACd,eACA,YACA,UAAwC,CAAC,GACxB;AACjB,QAAM,cAAc,QAAQ,YAAY,QAAQ,WAAW,OAAO,aAAa;AAC/E,QAAM,oBAAoB,SAAS,kBAAkB;AACrD,QAAM,gBAAgB;AACtB,QAAM,kBAAkB,oBACpB,GAAG,iBAAiB,iBAAiB,aAAa,KAClD,gBAAgB,aAAa;AACjC,QAAM,EAAE,YAAY,GAAG,GAAG,eAAe,IAAI;AAAA,IAC3C,GAAG;AAAA,IACH,kBAAkB,EAAE,gBAAgB;AAAA,IACpC,gBAAgB,EAAE,QAAQ,QAAQ,gBAAgB,UAAU,qBAAO,KAAK;AAAA,IACxE,aAAa;AAAA,MACX,QAAQ,QAAQ,aAAa,UAAU,CAAC,kCAAkC;AAAA,IAC5E;AAAA,EACF;AACA,QAAM,oBAAgB,8BAAU,aAAa,YAAY,cAAc;AACvE,gBAAc,SAAS,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChE,QAAM,aAAa,QAAQ,cAAc;AACzC,gBAAc,SAAS,UAAU;AAAA,IAC/B,MAAM;AAAA,IACN,aAAa,CAAC,KAAK,SAAS;AAG1B,YAAM,MAAM,IAAI,IAAI,IAAI,GAAG;AAC3B,UAAI,CAAC,IAAI,aAAa,IAAI,aAAa,GAAG;AACxC,YAAI,MAAM,GAAG,IAAI,GAAG,GAClB,MAAM,KAAK,IAAI,aAAa,KAAK,CAAC,EAAE,SAAS,IAAI,MAAM,GACzD,eAAe,UAAU;AAAA,MAC3B;AAEA,aAAO,KAAK,GAAG;AAAA,IACjB;AAAA,EACF,CAAC;AACD,SAAO,EAAE,GAAG,eAAe,WAAW;AACxC;",
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { SDK_VERSION } from \"../constants.js\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAuB;AAGvB,yBAA0B;AAE1B,uBAA4B;AAiBrB,SAAS,eACd,eACA,YACA,UAAwC,CAAC,GACxB;AACjB,QAAM,cAAc,QAAQ,YAAY,QAAQ,WAAW,OAAO,aAAa;AAC/E,QAAM,oBAAoB,SAAS,kBAAkB;AACrD,QAAM,gBAAgB,6BAA6B,4BAAW;AAC9D,QAAM,kBAAkB,oBACpB,GAAG,iBAAiB,iBAAiB,aAAa,KAClD,gBAAgB,aAAa;AACjC,QAAM,EAAE,YAAY,GAAG,GAAG,eAAe,IAAI;AAAA,IAC3C,GAAG;AAAA,IACH,kBAAkB,EAAE,gBAAgB;AAAA,IACpC,gBAAgB,EAAE,QAAQ,QAAQ,gBAAgB,UAAU,qBAAO,KAAK;AAAA,IACxE,aAAa;AAAA,MACX,QAAQ,QAAQ,aAAa,UAAU,CAAC,kCAAkC;AAAA,IAC5E;AAAA,EACF;AACA,QAAM,oBAAgB,8BAAU,aAAa,YAAY,cAAc;AACvE,gBAAc,SAAS,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChE,QAAM,aAAa,QAAQ,cAAc;AACzC,gBAAc,SAAS,UAAU;AAAA,IAC/B,MAAM;AAAA,IACN,aAAa,CAAC,KAAK,SAAS;AAG1B,YAAM,MAAM,IAAI,IAAI,IAAI,GAAG;AAC3B,UAAI,CAAC,IAAI,aAAa,IAAI,aAAa,GAAG;AACxC,YAAI,MAAM,GAAG,IAAI,GAAG,GAClB,MAAM,KAAK,IAAI,aAAa,KAAK,CAAC,EAAE,SAAS,IAAI,MAAM,GACzD,eAAe,UAAU;AAAA,MAC3B;AAEA,aAAO,KAAK,GAAG;AAAA,IACjB;AAAA,EACF,CAAC;AACD,SAAO,EAAE,GAAG,eAAe,WAAW;AACxC;",
6
6
  "names": []
7
7
  }
@@ -20,7 +20,7 @@ __export(constants_exports, {
20
20
  SDK_VERSION: () => SDK_VERSION
21
21
  });
22
22
  module.exports = __toCommonJS(constants_exports);
23
- const SDK_VERSION = "4.10.2";
23
+ const SDK_VERSION = "4.11.2";
24
24
  // Annotate the CommonJS export names for ESM import in node:
25
25
  0 && (module.exports = {
26
26
  SDK_VERSION
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.10.2\";\n"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.11.2\";\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,cAAsB;",
6
6
  "names": []
7
7
  }
@@ -126,14 +126,21 @@ class SecretClient {
126
126
  * @param options - The optional parameters.
127
127
  */
128
128
  setSecret(secretName, value, options = {}) {
129
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
129
+ const {
130
+ contentType,
131
+ enabled,
132
+ notBefore,
133
+ expiresOn: expires,
134
+ tags,
135
+ ...remainingOptions
136
+ } = options;
130
137
  return import_tracing.tracingClient.withSpan(
131
138
  "SecretClient.setSecret",
132
139
  remainingOptions,
133
140
  async (updatedOptions) => {
134
141
  const response = await this.client.setSecret(
135
142
  secretName,
136
- { value, secretAttributes: { enabled, notBefore, expires }, tags },
143
+ { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags },
137
144
  updatedOptions
138
145
  );
139
146
  return (0, import_transformations.getSecretFromSecretBundle)(response);
@@ -204,7 +211,14 @@ class SecretClient {
204
211
  * @param options - The optional parameters.
205
212
  */
206
213
  async updateSecretProperties(secretName, secretVersion, options = {}) {
207
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
214
+ const {
215
+ contentType,
216
+ enabled,
217
+ notBefore,
218
+ expiresOn: expires,
219
+ tags,
220
+ ...remainingOptions
221
+ } = options;
208
222
  return import_tracing.tracingClient.withSpan(
209
223
  "SecretClient.updateSecretProperties",
210
224
  remainingOptions,
@@ -212,7 +226,7 @@ class SecretClient {
212
226
  const response = await this.client.updateSecret(
213
227
  secretName,
214
228
  secretVersion,
215
- { secretAttributes: { enabled, notBefore, expires }, tags },
229
+ { contentType, secretAttributes: { enabled, notBefore, expires }, tags },
216
230
  updatedOptions
217
231
  );
218
232
  return (0, import_transformations.getSecretFromSecretBundle)(response).properties;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAuB;AAMvB,4BAA+B;AAC/B,6BAA6C;AAqB7C,2BAAmC;AAEnC,oBAA6D;AAG7D,wBAA8C;AAC9C,6BAAiE;AACjE,qBAA8B;AAC9B,gCAAoD;AACpD,uBAA4B;AAC5B,oBAAmC;AACnC,IAAAA,iBAA2C;AAwCpC,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA,EAIR;AAAA;AAAA;AAAA;AAAA,EAKC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBjB,YACE,UACA,YACA,kBAAuC,CAAC,GACxC;AACA,SAAK,WAAW;AAEhB,UAAM,0BAAwD;AAAA,MAC5D,GAAG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E;AAAA,MACA,CAAC,aAAS,kDAA0B,IAAI,EAAE;AAAA,IAC5C;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCO,wBACL,UAA0C,CAAC,GACG;AAC9C,eAAO;AAAA,MACL,KAAK,OAAO,WAAW,KAAK,KAAK,MAAM;AAAA,MACvC;AAAA,MACA,CAAC,aAAS,kDAA0B,IAAI,EAAE;AAAA,IAC5C;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCO,mBACL,UAAqC,CAAC,GACK;AAC3C,eAAO;AAAA,MACL,KAAK,OAAO,kBAAkB,KAAK,KAAK,MAAM;AAAA,MAC9C;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAuB;AAMvB,4BAA+B;AAC/B,6BAA6C;AAqB7C,2BAAmC;AAEnC,oBAA6D;AAG7D,wBAA8C;AAC9C,6BAAiE;AACjE,qBAA8B;AAC9B,gCAAoD;AACpD,uBAA4B;AAC5B,oBAAmC;AACnC,IAAAA,iBAA2C;AAwCpC,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA,EAIR;AAAA;AAAA;AAAA;AAAA,EAKC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBjB,YACE,UACA,YACA,kBAAuC,CAAC,GACxC;AACA,SAAK,WAAW;AAEhB,UAAM,0BAAwD;AAAA,MAC5D,GAAG;AAAA,MACH,kBAAkB;AAAA,QAChB,iBAAiB,GAAG,gBAAgB,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O,kBAAkB,YAAY,cAAc;AAAA,MAC5E;AAAA,MACA,CAAC,aAAS,kDAA0B,IAAI,EAAE;AAAA,IAC5C;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCO,wBACL,UAA0C,CAAC,GACG;AAC9C,eAAO;AAAA,MACL,KAAK,OAAO,WAAW,KAAK,KAAK,MAAM;AAAA,MACvC;AAAA,MACA,CAAC,aAAS,kDAA0B,IAAI,EAAE;AAAA,IAC5C;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCO,mBACL,UAAqC,CAAC,GACK;AAC3C,eAAO;AAAA,MACL,KAAK,OAAO,kBAAkB,KAAK,KAAK,MAAM;AAAA,MAC9C;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["import_poller"]
7
7
  }
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.58.1"
8
+ "packageVersion": "7.58.7"
9
9
  }
10
10
  ]
11
11
  }
@@ -2,11 +2,12 @@
2
2
  // Licensed under the MIT License.
3
3
  import { logger } from "../logger.js";
4
4
  import { getClient } from "@azure-rest/core-client";
5
+ import { SDK_VERSION } from "../constants.js";
5
6
  /** Creates a new Azure Key Vault Secrets client context. */
6
7
  export function createKeyVault(endpointParam, credential, options = {}) {
7
8
  const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);
8
9
  const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
9
- const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;
10
+ const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;
10
11
  const userAgentPrefix = prefixFromOptions
11
12
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
12
13
  : `azsdk-js-api ${userAgentInfo}`;
@@ -1 +1 @@
1
- {"version":3,"file":"keyVaultContext.js","sourceRoot":"","sources":["../../../src/api/keyVaultContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAiBpD,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAC5B,aAAqB,EACrB,UAA2B,EAC3B,UAAwC,EAAE;IAE1C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IACjF,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,kCAAkC,CAAC;SAC5E;KACF,CAAC;IACF,MAAM,aAAa,GAAG,SAAS,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAqB,CAAC;AAC7D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"]}
1
+ {"version":3,"file":"keyVaultContext.js","sourceRoot":"","sources":["../../../src/api/keyVaultContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS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E,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAqB,CAAC;AAC7D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { SDK_VERSION } from \"../constants.js\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- export const SDK_VERSION = "4.10.2";
3
+ export const SDK_VERSION = "4.11.2";
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.10.2\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.11.2\";\n"]}
package/dist/esm/index.js CHANGED
@@ -113,9 +113,9 @@ export class SecretClient {
113
113
  * @param options - The optional parameters.
114
114
  */
115
115
  setSecret(secretName, value, options = {}) {
116
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
116
+ const { contentType, enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
117
117
  return tracingClient.withSpan("SecretClient.setSecret", remainingOptions, async (updatedOptions) => {
118
- const response = await this.client.setSecret(secretName, { value, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
118
+ const response = await this.client.setSecret(secretName, { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
119
119
  return getSecretFromSecretBundle(response);
120
120
  });
121
121
  }
@@ -184,9 +184,9 @@ export class SecretClient {
184
184
  * @param options - The optional parameters.
185
185
  */
186
186
  async updateSecretProperties(secretName, secretVersion, options = {}) {
187
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
187
+ const { contentType, enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
188
188
  return tracingClient.withSpan("SecretClient.updateSecretProperties", remainingOptions, async (updatedOptions) => {
189
- const response = await this.client.updateSecret(secretName, secretVersion, { secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
189
+ const response = await this.client.updateSecret(secretName, secretVersion, { contentType, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
190
190
  return getSecretFromSecretBundle(response).properties;
191
191
  });
192
192
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE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AuB,CAC5B,UAA0C,EAAE;QAE5C,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EACxC,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,kBAAkB,CACvB,UAAqC,EAAE;QAEvC,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/C,OAAO,EACP,yBAAyB,CAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAqBtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,mCAAmC,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAIL,0BAA0B,EAE1B,gBAAgB,EAYhB,6BAA6B,EAU7B,MAAM,GACP,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACa,QAAQ,CAAS;IAEjC;;OAEG;IACc,MAAM,CAAiB;IAExC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,kBA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AC;YACzF,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC;QACxD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,8BAA8B,CACnC,UAAkB,EAClB,UAAiD,EAAE;QAEnD,OAAO,qBAAqB,CAC1B,CAAC,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,EAC7E,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,uBAAuB,CAC5B,UAA0C,EAAE;QAE5C,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EACxC,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,kBAAkB,CACvB,UAAqC,EAAE;QAEvC,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/C,OAAO,EACP,yBAAyB,CAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"]}
@@ -2,11 +2,12 @@
2
2
  // Licensed under the MIT License.
3
3
  import { logger } from "../logger.js";
4
4
  import { getClient } from "@azure-rest/core-client";
5
+ import { SDK_VERSION } from "../constants.js";
5
6
  /** Creates a new Azure Key Vault Secrets client context. */
6
7
  export function createKeyVault(endpointParam, credential, options = {}) {
7
8
  const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);
8
9
  const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
9
- const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;
10
+ const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;
10
11
  const userAgentPrefix = prefixFromOptions
11
12
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
12
13
  : `azsdk-js-api ${userAgentInfo}`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,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAqB,CAAC;AAC7D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/1.0.0-beta.1`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"]}
1
+ {"version":3,"file":"keyVaultContext.js","sourceRoot":"","sources":["../../../src/api/keyVaultContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgB9C,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAC5B,aAAqB,EACrB,UAA2B,EAC3B,UAAwC,EAAE;IAE1C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC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E,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAqB,CAAC;AAC7D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { SDK_VERSION } from \"../constants.js\";\n\n/** The Azure Key Vault Secrets client manages secrets in the Key Vault service. */\nexport interface KeyVaultContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface KeyVaultClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Creates a new Azure Key Vault Secrets client context. */\nexport function createKeyVault(\n endpointParam: string,\n credential: TokenCredential,\n options: KeyVaultClientOptionalParams = {},\n): KeyVaultContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-keyvault-secrets/${SDK_VERSION}`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://vault.azure.net/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-07-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as KeyVaultContext;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- export const SDK_VERSION = "4.10.2";
3
+ export const SDK_VERSION = "4.11.2";
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.10.2\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"4.11.2\";\n"]}
@@ -113,9 +113,9 @@ export class SecretClient {
113
113
  * @param options - The optional parameters.
114
114
  */
115
115
  setSecret(secretName, value, options = {}) {
116
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
116
+ const { contentType, enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
117
117
  return tracingClient.withSpan("SecretClient.setSecret", remainingOptions, async (updatedOptions) => {
118
- const response = await this.client.setSecret(secretName, { value, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
118
+ const response = await this.client.setSecret(secretName, { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
119
119
  return getSecretFromSecretBundle(response);
120
120
  });
121
121
  }
@@ -184,9 +184,9 @@ export class SecretClient {
184
184
  * @param options - The optional parameters.
185
185
  */
186
186
  async updateSecretProperties(secretName, secretVersion, options = {}) {
187
- const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
187
+ const { contentType, enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;
188
188
  return tracingClient.withSpan("SecretClient.updateSecretProperties", remainingOptions, async (updatedOptions) => {
189
- const response = await this.client.updateSecret(secretName, secretVersion, { secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
189
+ const response = await this.client.updateSecret(secretName, secretVersion, { contentType, secretAttributes: { enabled, notBefore, expires }, tags }, updatedOptions);
190
190
  return getSecretFromSecretBundle(response).properties;
191
191
  });
192
192
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAqBtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,aAA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I,kBAAkB,CACvB,UAAqC,EAAE;QAEvC,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/C,OAAO,EACP,yBAAyB,CAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const { enabled, notBefore, expiresOn: expires, tags, ...remainingOptions } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kC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,UAAU,EAAE,cAAc,CAAC,EAC7E,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,uBAAuB,CAC5B,UAA0C,EAAE;QAE5C,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EACxC,OAAO,EACP,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,UAAU,CACrD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,kBAAkB,CACvB,UAAqC,EAAE;QAEvC,OAAO,qBAAqB,CAC1B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/C,OAAO,EACP,yBAAyB,CAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./logger.js\";\n\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState } from \"@azure/core-lro\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\n\nimport type {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels.js\";\nimport { LATEST_API_VERSION } from \"./secretsModels.js\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel, KnownContentType } from \"./models/models.js\";\nimport type { ContentType } from \"./models/models.js\";\nimport type { KeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultSecretIdentifier } from \"./identifier.js\";\nimport { getSecretFromSecretBundle, mapPagedAsyncIterable } from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { DeleteSecretPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller.js\";\n\nexport {\n type SecretClientOptions,\n type DeletedSecret,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ContentType,\n KnownContentType,\n type GetSecretOptions,\n type GetDeletedSecretOptions,\n type PurgeDeletedSecretOptions,\n type BackupSecretOptions,\n type RestoreSecretBackupOptions,\n type ListPropertiesOfSecretVersionsOptions,\n type ListPropertiesOfSecretsOptions,\n type ListDeletedSecretsOptions,\n type PagedAsyncIterableIterator,\n type PageSettings,\n type KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n type PollerLike,\n type PollOperationState,\n type KeyVaultSecret,\n type SecretProperties,\n type SecretPollerOptions,\n type BeginDeleteSecretOptions,\n type BeginRecoverDeletedSecretOptions,\n type SetSecretOptions,\n type UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * // Lastly, create our secrets client and connect to the service\n * const client = new SecretClient(url, credential);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault 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 pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n userAgentOptions: {\n userAgentPrefix: `${pipelineOptions.userAgentOptions?.userAgentPrefix ?? \"\"} azsdk-js-keyvault-secrets/${SDK_VERSION}`,\n },\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(this.vaultUrl, credential, internalPipelineOptions);\n\n // Key vault has its own authentication policy that needs to be added to the pipeline, replacing the default bearerTokenAuthenticationPolicy.\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions), {});\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.setSecret(secretName, \"MySecretValue\");\n * console.log(\"result: \", result);\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {},\n ): Promise<KeyVaultSecret> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n secretName,\n { value, contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * await client.beginDeleteSecret(secretName);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateSecretAttributes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, result.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {},\n ): Promise<SecretProperties> {\n const {\n contentType,\n enabled,\n notBefore,\n expiresOn: expires,\n tags,\n ...remainingOptions\n } = options;\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n remainingOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n secretName,\n secretVersion,\n { contentType, secretAttributes: { enabled, notBefore, expires }, tags },\n updatedOptions,\n );\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const latestSecret = await client.getSecret(secretName);\n * console.log(`Latest version of the secret ${secretName}: `, latestSecret);\n *\n * const specificSecret = await client.getSecret(secretName, {\n * version: latestSecret.properties.version!,\n * });\n * console.log(\n * `The secret ${secretName} at the version ${latestSecret.properties.version!}: `,\n * specificSecret,\n * );\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions,\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const result = await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {},\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(secretName, updatedOptions);\n return getSecretFromSecretBundle(response);\n },\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedSecret(secretName);\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(secretName, updatedOptions);\n },\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const deletePoller = await client.beginDeleteSecret(secretName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(secretName);\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {},\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {},\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreSecret\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * const backupResult = await client.backupSecret(secretName);\n *\n * await client.restoreSecretBackup(backupResult);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {},\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret({ secretBundleBackup }, updatedOptions);\n return getSecretFromSecretBundle(response).properties;\n },\n );\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n (updatedOptions) => this.client.getSecretVersions(secretName, updatedOptions),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {},\n ): PagedAsyncIterableIterator<SecretProperties> {\n return mapPagedAsyncIterable(\n this.client.getSecrets.bind(this.client),\n options,\n (item) => getSecretFromSecretBundle(item).properties,\n );\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListSecrets\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new SecretClient(url, credential);\n *\n * const secretName = \"MySecretName\";\n *\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * console.log(\"Secret properties: \", secretProperties);\n * }\n *\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"Deleted secret: \", deletedSecret);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfSecretVersions(secretName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {},\n ): PagedAsyncIterableIterator<DeletedSecret> {\n return mapPagedAsyncIterable(\n this.client.getDeletedSecrets.bind(this.client),\n options,\n getSecretFromSecretBundle,\n );\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/keyvault-secrets",
3
- "version": "4.11.0",
3
+ "version": "4.11.2",
4
4
  "description": "Azure Key Vault Secrets",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -51,7 +51,11 @@
51
51
  "LICENSE"
52
52
  ],
53
53
  "sdk-type": "client",
54
- "repository": "github:Azure/azure-sdk-for-js",
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/Azure/azure-sdk-for-js",
57
+ "directory": "sdk/keyvault/keyvault-secrets"
58
+ },
55
59
  "bugs": {
56
60
  "url": "https://github.com/Azure/azure-sdk-for-js/issues"
57
61
  },
@@ -90,7 +94,7 @@
90
94
  "@azure/core-rest-pipeline": "^1.19.0",
91
95
  "@azure/core-tracing": "^1.2.0",
92
96
  "@azure/core-util": "^1.11.0",
93
- "@azure/keyvault-common": "^2.0.0",
97
+ "@azure/keyvault-common": "^2.1.0",
94
98
  "@azure/logger": "^1.1.4",
95
99
  "tslib": "^2.8.1"
96
100
  },
@@ -104,14 +108,15 @@
104
108
  "eslint": "^9.39.1",
105
109
  "playwright": "^1.58.2",
106
110
  "prettier": "^3.6.2",
111
+ "react-native": "^0.84.1",
107
112
  "rimraf": "^6.1.0",
108
113
  "typescript": "~6.0.2",
109
114
  "vitest": "^4.1.2",
110
115
  "@azure-tools/test-credential": "^2.1.2",
111
- "@azure-tools/test-utils-vitest": "^2.0.1",
116
+ "@azure-tools/test-recorder": "^4.1.1",
112
117
  "@azure/dev-tool": "^1.0.0",
113
- "@azure/eslint-plugin-azure-sdk": "^3.0.0",
114
- "@azure-tools/test-recorder": "^4.1.1"
118
+ "@azure-tools/test-utils-vitest": "^2.0.1",
119
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0"
115
120
  },
116
121
  "scripts": {
117
122
  "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
@@ -126,9 +131,8 @@
126
131
  "generate:client": "echo skipped",
127
132
  "test:browser": "echo skipped",
128
133
  "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
129
- "test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest",
130
- "test:node:esm": "dev-tool run test:vitest --esm",
131
- "test": "npm run test:node && npm run test:browser",
134
+ "test:node": "dev-tool run test:vitest",
135
+ "test": "tsc -b --noEmit && npm run test:node && npm run test:browser",
132
136
  "update-snippets": "dev-tool run update-snippets"
133
137
  }
134
138
  }
@@ -1,2 +0,0 @@
1
- export { type SecretSetParameters, type SecretAttributes, KnownDeletionRecoveryLevel, type DeletionRecoveryLevel, type SecretBundle, type KeyVaultError, type ErrorModel, type DeletedSecretBundle, type SecretUpdateParameters, type SecretItem, type DeletedSecretItem, type BackupSecretResult, type SecretRestoreParameters, KnownVersions, } from "./models.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export { KnownDeletionRecoveryLevel, KnownVersions, } from "./models.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAGL,0BAA0B,EAW1B,aAAa,GACd,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n type SecretSetParameters,\n type SecretAttributes,\n KnownDeletionRecoveryLevel,\n type DeletionRecoveryLevel,\n type SecretBundle,\n type KeyVaultError,\n type ErrorModel,\n type DeletedSecretBundle,\n type SecretUpdateParameters,\n type SecretItem,\n type DeletedSecretItem,\n type BackupSecretResult,\n type SecretRestoreParameters,\n KnownVersions,\n} from \"./models.js\";\n"]}
@@ -1,2 +0,0 @@
1
- export { type SecretSetParameters, type SecretAttributes, KnownDeletionRecoveryLevel, type DeletionRecoveryLevel, type SecretBundle, type KeyVaultError, type ErrorModel, type DeletedSecretBundle, type SecretUpdateParameters, type SecretItem, type DeletedSecretItem, type BackupSecretResult, type SecretRestoreParameters, KnownVersions, } from "./models.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,30 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var models_exports = {};
19
- __export(models_exports, {
20
- KnownDeletionRecoveryLevel: () => import_models.KnownDeletionRecoveryLevel,
21
- KnownVersions: () => import_models.KnownVersions
22
- });
23
- module.exports = __toCommonJS(models_exports);
24
- var import_models = require("./models.js");
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- KnownDeletionRecoveryLevel,
28
- KnownVersions
29
- });
30
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/models/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n type SecretSetParameters,\n type SecretAttributes,\n KnownDeletionRecoveryLevel,\n type DeletionRecoveryLevel,\n type SecretBundle,\n type KeyVaultError,\n type ErrorModel,\n type DeletedSecretBundle,\n type SecretUpdateParameters,\n type SecretItem,\n type DeletedSecretItem,\n type BackupSecretResult,\n type SecretRestoreParameters,\n KnownVersions,\n} from \"./models.js\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAeO;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- export { type SecretSetParameters, type SecretAttributes, KnownDeletionRecoveryLevel, type DeletionRecoveryLevel, type SecretBundle, type KeyVaultError, type ErrorModel, type DeletedSecretBundle, type SecretUpdateParameters, type SecretItem, type DeletedSecretItem, type BackupSecretResult, type SecretRestoreParameters, KnownVersions, } from "./models.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export { KnownDeletionRecoveryLevel, KnownVersions, } from "./models.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAGL,0BAA0B,EAW1B,aAAa,GACd,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n type SecretSetParameters,\n type SecretAttributes,\n KnownDeletionRecoveryLevel,\n type DeletionRecoveryLevel,\n type SecretBundle,\n type KeyVaultError,\n type ErrorModel,\n type DeletedSecretBundle,\n type SecretUpdateParameters,\n type SecretItem,\n type DeletedSecretItem,\n type BackupSecretResult,\n type SecretRestoreParameters,\n KnownVersions,\n} from \"./models.js\";\n"]}
@@ -1,2 +0,0 @@
1
- export { type SecretSetParameters, type SecretAttributes, KnownDeletionRecoveryLevel, type DeletionRecoveryLevel, type SecretBundle, type KeyVaultError, type ErrorModel, type DeletedSecretBundle, type SecretUpdateParameters, type SecretItem, type DeletedSecretItem, type BackupSecretResult, type SecretRestoreParameters, KnownVersions, } from "./models.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export { KnownDeletionRecoveryLevel, KnownVersions, } from "./models.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAGL,0BAA0B,EAW1B,aAAa,GACd,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n type SecretSetParameters,\n type SecretAttributes,\n KnownDeletionRecoveryLevel,\n type DeletionRecoveryLevel,\n type SecretBundle,\n type KeyVaultError,\n type ErrorModel,\n type DeletedSecretBundle,\n type SecretUpdateParameters,\n type SecretItem,\n type DeletedSecretItem,\n type BackupSecretResult,\n type SecretRestoreParameters,\n KnownVersions,\n} from \"./models.js\";\n"]}