@azure/keyvault-admin 4.6.0 → 4.6.1-alpha.20241112.1

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 (101) hide show
  1. package/dist/commonjs/accessControlClient.d.ts +3 -3
  2. package/dist/commonjs/accessControlClient.d.ts.map +1 -1
  3. package/dist/commonjs/accessControlClient.js.map +1 -1
  4. package/dist/commonjs/accessControlModels.d.ts +2 -2
  5. package/dist/commonjs/accessControlModels.d.ts.map +1 -1
  6. package/dist/commonjs/accessControlModels.js.map +1 -1
  7. package/dist/commonjs/backupClient.d.ts +3 -3
  8. package/dist/commonjs/backupClient.d.ts.map +1 -1
  9. package/dist/commonjs/backupClient.js.map +1 -1
  10. package/dist/commonjs/backupClientModels.d.ts +2 -2
  11. package/dist/commonjs/backupClientModels.d.ts.map +1 -1
  12. package/dist/commonjs/backupClientModels.js.map +1 -1
  13. package/dist/commonjs/constants.js +1 -1
  14. package/dist/commonjs/constants.js.map +1 -1
  15. package/dist/commonjs/generated/keyVaultClientContext.js +1 -1
  16. package/dist/commonjs/generated/keyVaultClientContext.js.map +1 -1
  17. package/dist/commonjs/lro/backup/operation.d.ts +5 -4
  18. package/dist/commonjs/lro/backup/operation.d.ts.map +1 -1
  19. package/dist/commonjs/lro/backup/operation.js.map +1 -1
  20. package/dist/commonjs/lro/backup/poller.d.ts +4 -3
  21. package/dist/commonjs/lro/backup/poller.d.ts.map +1 -1
  22. package/dist/commonjs/lro/backup/poller.js.map +1 -1
  23. package/dist/commonjs/lro/keyVaultAdminPoller.d.ts +4 -3
  24. package/dist/commonjs/lro/keyVaultAdminPoller.d.ts.map +1 -1
  25. package/dist/commonjs/lro/keyVaultAdminPoller.js.map +1 -1
  26. package/dist/commonjs/lro/restore/operation.d.ts +5 -4
  27. package/dist/commonjs/lro/restore/operation.d.ts.map +1 -1
  28. package/dist/commonjs/lro/restore/operation.js.map +1 -1
  29. package/dist/commonjs/lro/restore/poller.d.ts +4 -3
  30. package/dist/commonjs/lro/restore/poller.d.ts.map +1 -1
  31. package/dist/commonjs/lro/restore/poller.js.map +1 -1
  32. package/dist/commonjs/lro/selectiveKeyRestore/operation.d.ts +5 -4
  33. package/dist/commonjs/lro/selectiveKeyRestore/operation.d.ts.map +1 -1
  34. package/dist/commonjs/lro/selectiveKeyRestore/operation.js.map +1 -1
  35. package/dist/commonjs/lro/selectiveKeyRestore/poller.d.ts +4 -3
  36. package/dist/commonjs/lro/selectiveKeyRestore/poller.d.ts.map +1 -1
  37. package/dist/commonjs/lro/selectiveKeyRestore/poller.js.map +1 -1
  38. package/dist/commonjs/mappings.d.ts +2 -2
  39. package/dist/commonjs/mappings.d.ts.map +1 -1
  40. package/dist/commonjs/mappings.js.map +1 -1
  41. package/dist/commonjs/settingsClient.d.ts +2 -2
  42. package/dist/commonjs/settingsClient.d.ts.map +1 -1
  43. package/dist/commonjs/settingsClient.js.map +1 -1
  44. package/dist/commonjs/settingsClientModels.d.ts +1 -1
  45. package/dist/commonjs/settingsClientModels.d.ts.map +1 -1
  46. package/dist/commonjs/settingsClientModels.js.map +1 -1
  47. package/dist/commonjs/tsdoc-metadata.json +1 -1
  48. package/dist/esm/accessControlClient.d.ts +3 -3
  49. package/dist/esm/accessControlClient.d.ts.map +1 -1
  50. package/dist/esm/accessControlClient.js.map +1 -1
  51. package/dist/esm/accessControlModels.d.ts +2 -2
  52. package/dist/esm/accessControlModels.d.ts.map +1 -1
  53. package/dist/esm/accessControlModels.js.map +1 -1
  54. package/dist/esm/backupClient.d.ts +3 -3
  55. package/dist/esm/backupClient.d.ts.map +1 -1
  56. package/dist/esm/backupClient.js.map +1 -1
  57. package/dist/esm/backupClientModels.d.ts +2 -2
  58. package/dist/esm/backupClientModels.d.ts.map +1 -1
  59. package/dist/esm/backupClientModels.js.map +1 -1
  60. package/dist/esm/constants.js +1 -1
  61. package/dist/esm/constants.js.map +1 -1
  62. package/dist/esm/generated/keyVaultClientContext.js +1 -1
  63. package/dist/esm/generated/keyVaultClientContext.js.map +1 -1
  64. package/dist/esm/lro/backup/operation.d.ts +5 -4
  65. package/dist/esm/lro/backup/operation.d.ts.map +1 -1
  66. package/dist/esm/lro/backup/operation.js +1 -1
  67. package/dist/esm/lro/backup/operation.js.map +1 -1
  68. package/dist/esm/lro/backup/poller.d.ts +4 -3
  69. package/dist/esm/lro/backup/poller.d.ts.map +1 -1
  70. package/dist/esm/lro/backup/poller.js +1 -1
  71. package/dist/esm/lro/backup/poller.js.map +1 -1
  72. package/dist/esm/lro/keyVaultAdminPoller.d.ts +4 -3
  73. package/dist/esm/lro/keyVaultAdminPoller.d.ts.map +1 -1
  74. package/dist/esm/lro/keyVaultAdminPoller.js.map +1 -1
  75. package/dist/esm/lro/restore/operation.d.ts +5 -4
  76. package/dist/esm/lro/restore/operation.d.ts.map +1 -1
  77. package/dist/esm/lro/restore/operation.js +1 -1
  78. package/dist/esm/lro/restore/operation.js.map +1 -1
  79. package/dist/esm/lro/restore/poller.d.ts +4 -3
  80. package/dist/esm/lro/restore/poller.d.ts.map +1 -1
  81. package/dist/esm/lro/restore/poller.js +1 -1
  82. package/dist/esm/lro/restore/poller.js.map +1 -1
  83. package/dist/esm/lro/selectiveKeyRestore/operation.d.ts +5 -4
  84. package/dist/esm/lro/selectiveKeyRestore/operation.d.ts.map +1 -1
  85. package/dist/esm/lro/selectiveKeyRestore/operation.js +1 -1
  86. package/dist/esm/lro/selectiveKeyRestore/operation.js.map +1 -1
  87. package/dist/esm/lro/selectiveKeyRestore/poller.d.ts +4 -3
  88. package/dist/esm/lro/selectiveKeyRestore/poller.d.ts.map +1 -1
  89. package/dist/esm/lro/selectiveKeyRestore/poller.js +1 -1
  90. package/dist/esm/lro/selectiveKeyRestore/poller.js.map +1 -1
  91. package/dist/esm/mappings.d.ts +2 -2
  92. package/dist/esm/mappings.d.ts.map +1 -1
  93. package/dist/esm/mappings.js.map +1 -1
  94. package/dist/esm/settingsClient.d.ts +2 -2
  95. package/dist/esm/settingsClient.d.ts.map +1 -1
  96. package/dist/esm/settingsClient.js.map +1 -1
  97. package/dist/esm/settingsClientModels.d.ts +1 -1
  98. package/dist/esm/settingsClientModels.d.ts.map +1 -1
  99. package/dist/esm/settingsClientModels.js.map +1 -1
  100. package/dist/keyvault-admin.d.ts +6 -6
  101. package/package.json +7 -11
@@ -1 +1 @@
1
- {"version":3,"file":"backupClient.js","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAalC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AASzC;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAW/B;;;;;;;;;;;;;;;;OAgBG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,IAAI,kBAAkB,CAAC;QAEhE,MAAM,aAAa,mCACd,OAAO,KACV,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,4BAA4B,EAAE;oBAC5B,sBAAsB;oBACtB,4BAA4B;oBAC5B,+BAA+B;iBAChC;aACF,GACF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAC5D,wGAA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QAAQ,EACR,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,OAAO,CAAC,YAAY,EAClC,UAAU,EAAE,OAAO,CAAC,UAAU,EAC9B,cAAc,EAAE,OAAO,IACvB,CAAC;QAEH,8EAA8E;QAC9E,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAEpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAqFM,KAAK,CAAC,wBAAwB,CACnC,OAAe,EACf,SAAiB,EACjB,oBAAsE,EAAE,EACxE,+BAAwE,EAAE;QAI1E,MAAM,QAAQ,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;QACvF,MAAM,OAAO,GACX,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAE3F,MAAM,MAAM,GAAG,IAAI,iCAAiC,iCAC/C,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,KACrC,OAAO;YACP,QAAQ,EACR,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,OAAO,CAAC,YAAY,EAClC,UAAU,EAAE,OAAO,CAAC,UAAU,EAC9B,cAAc,EAAE,OAAO,IACvB,CAAC;QAEH,8EAA8E;QAC9E,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAEpB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n KeyVaultBackupClientOptions,\n KeyVaultBackupResult,\n KeyVaultBeginBackupOptions,\n KeyVaultBeginRestoreOptions,\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultRestoreResult,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"./backupClientModels.js\";\nimport { KeyVaultAdminPollOperationState } from \"./lro/keyVaultAdminPoller.js\";\nimport { KeyVaultBackupOperationState } from \"./lro/backup/operation.js\";\nimport { KeyVaultBackupPoller } from \"./lro/backup/poller.js\";\nimport { KeyVaultClient } from \"./generated/keyVaultClient.js\";\nimport { KeyVaultRestoreOperationState } from \"./lro/restore/operation.js\";\nimport { KeyVaultRestorePoller } from \"./lro/restore/poller.js\";\nimport { KeyVaultSelectiveKeyRestoreOperationState } from \"./lro/selectiveKeyRestore/operation.js\";\nimport { KeyVaultSelectiveKeyRestorePoller } from \"./lro/selectiveKeyRestore/poller.js\";\nimport { LATEST_API_VERSION } from \"./constants.js\";\nimport { PollerLike } from \"@azure/core-lro\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\nimport { logger } from \"./log.js\";\nimport { mappings } from \"./mappings.js\";\n\nexport {\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n KeyVaultAdminPollOperationState,\n};\n\n/**\n * The KeyVaultBackupClient provides methods to generate backups\n * and restore backups of any given Azure Key Vault instance.\n * This client supports generating full backups, selective restores of specific keys\n * and full restores of Key Vault instances.\n */\nexport class KeyVaultBackupClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultBackupClient.\n *\n * Example usage:\n * ```ts\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * let credentials = new DefaultAzureCredential();\n *\n * let client = new KeyVaultBackupClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n options: KeyVaultBackupClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const apiVersion = options.serviceVersion || LATEST_API_VERSION;\n\n const clientOptions = {\n ...options,\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(apiVersion, clientOptions);\n // The authentication policy must come after the deserialization policy since the deserialization policy\n // converts 401 responses to an Error, and we don't want to deal with that.\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, clientOptions), {\n afterPolicies: [\"deserializationPolicy\"],\n });\n }\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account, using a user-assigned Managed Identity\n * to access the Storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginBackup(blobStorageUri, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n public async beginBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const poller = new KeyVaultBackupPoller({\n blobStorageUri,\n sasToken,\n client: this.client,\n vaultUrl: this.vaultUrl,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n requestOptions: options,\n });\n\n // This will initialize the poller's operation (the generation of the backup).\n await poller.poll();\n\n return poller;\n }\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder, using a user-assigned Managed Identity to access the storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri);\n *\n * // The poller can be serialized with:\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginRestore(blobStorageUri, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n public async beginRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const poller = new KeyVaultRestorePoller({\n ...mappings.folderUriParts(folderUri),\n sasToken,\n client: this.client,\n vaultUrl: this.vaultUrl,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n requestOptions: options,\n });\n\n // This will initialize the poller's operation (the generation of the backup).\n await poller.poll();\n\n return poller;\n }\n\n /**\n * Starts restoring all key versions of a given key using user supplied SAS token pointing to a previously\n * stored Azure Blob storage backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n /**\n * Starts restoring all key versions of a given key using to a previously\n * stored Azure Blob storage backup folder. The Blob storage backup folder will be accessed using user-assigned Managed Identity.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginSelectiveKeyRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n > {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const poller = new KeyVaultSelectiveKeyRestorePoller({\n ...mappings.folderUriParts(folderUri),\n keyName,\n sasToken,\n client: this.client,\n vaultUrl: this.vaultUrl,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n requestOptions: options,\n });\n\n // This will initialize the poller's operation (the generation of the backup).\n await poller.poll();\n\n return poller;\n }\n}\n"]}
1
+ {"version":3,"file":"backupClient.js","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAalC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AASzC;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAW/B;;;;;;;;;;;;;;;;OAgBG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,IAAI,kBAAkB,CAAC;QAEhE,MAAM,aAAa,mCACd,OAAO,KACV,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,4BAA4B,EAAE;oBAC5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aultBackupResult,\n KeyVaultBeginBackupOptions,\n KeyVaultBeginRestoreOptions,\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultRestoreResult,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"./backupClientModels.js\";\nimport { KeyVaultAdminPollOperationState } from \"./lro/keyVaultAdminPoller.js\";\nimport { KeyVaultBackupOperationState } from \"./lro/backup/operation.js\";\nimport { KeyVaultBackupPoller } from \"./lro/backup/poller.js\";\nimport { KeyVaultClient } from \"./generated/keyVaultClient.js\";\nimport { KeyVaultRestoreOperationState } from \"./lro/restore/operation.js\";\nimport { KeyVaultRestorePoller } from \"./lro/restore/poller.js\";\nimport { KeyVaultSelectiveKeyRestoreOperationState } from \"./lro/selectiveKeyRestore/operation.js\";\nimport { KeyVaultSelectiveKeyRestorePoller } from \"./lro/selectiveKeyRestore/poller.js\";\nimport { LATEST_API_VERSION } from \"./constants.js\";\nimport type { PollerLike } from \"@azure/core-lro\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\nimport { logger } from \"./log.js\";\nimport { mappings } from \"./mappings.js\";\n\nexport {\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n KeyVaultAdminPollOperationState,\n};\n\n/**\n * The KeyVaultBackupClient provides methods to generate backups\n * and restore backups of any given Azure Key Vault instance.\n * This client supports generating full backups, selective restores of specific keys\n * and full restores of Key Vault instances.\n */\nexport class KeyVaultBackupClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultBackupClient.\n *\n * Example usage:\n * ```ts\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * let credentials = new DefaultAzureCredential();\n *\n * let client = new KeyVaultBackupClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n options: KeyVaultBackupClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const apiVersion = options.serviceVersion || LATEST_API_VERSION;\n\n const clientOptions = {\n ...options,\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(apiVersion, clientOptions);\n // The authentication policy must come after the deserialization policy since the deserialization policy\n // converts 401 responses to an Error, and we don't want to deal with that.\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, clientOptions), {\n afterPolicies: [\"deserializationPolicy\"],\n });\n }\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account, using a user-assigned Managed Identity\n * to access the Storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginBackup(blobStorageUri, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n public async beginBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const poller = new KeyVaultBackupPoller({\n blobStorageUri,\n sasToken,\n client: this.client,\n vaultUrl: this.vaultUrl,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n requestOptions: options,\n });\n\n // This will initialize the poller's operation (the generation of the backup).\n await poller.poll();\n\n return poller;\n }\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder, using a user-assigned Managed Identity to access the storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri);\n *\n * // The poller can be serialized with:\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginRestore(blobStorageUri, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n public async beginRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const poller = new KeyVaultRestorePoller({\n ...mappings.folderUriParts(folderUri),\n sasToken,\n client: this.client,\n vaultUrl: this.vaultUrl,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n requestOptions: options,\n });\n\n // This will initialize the poller's operation (the generation of the backup).\n await poller.poll();\n\n return poller;\n }\n\n /**\n * Starts restoring all key versions of a given key using user supplied SAS token pointing to a previously\n * stored Azure Blob storage backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n /**\n * Starts restoring all key versions of a given key using to a previously\n * stored Azure Blob storage backup folder. The Blob storage backup folder will be accessed using user-assigned Managed Identity.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts\n * const client = new KeyVaultBackupClient(url, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * //\n * // const serialized = poller.toString();\n * //\n * // A new poller can be created with:\n * //\n * // await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });\n * //\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginSelectiveKeyRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n > {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const poller = new KeyVaultSelectiveKeyRestorePoller({\n ...mappings.folderUriParts(folderUri),\n keyName,\n sasToken,\n client: this.client,\n vaultUrl: this.vaultUrl,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n requestOptions: options,\n });\n\n // This will initialize the poller's operation (the generation of the backup).\n await poller.poll();\n\n return poller;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { CommonClientOptions, OperationOptions } from "@azure/core-client";
2
- import { SUPPORTED_API_VERSIONS } from "./constants.js";
1
+ import type { CommonClientOptions, OperationOptions } from "@azure/core-client";
2
+ import type { SUPPORTED_API_VERSIONS } from "./constants.js";
3
3
  /**
4
4
  * The optional parameters accepted by the KeyVaultBackupClient
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"backupClientModels.d.ts","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE;;OAEG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAExC;;;OAGG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,2BAA2B;CAAG;AAElF;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B;CAAG;AAEnF;;;GAGG;AACH,MAAM,WAAW,uCAAwC,SAAQ,2BAA2B;CAAG;AAE/F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB"}
1
+ {"version":3,"file":"backupClientModels.d.ts","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE;;OAEG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAExC;;;OAGG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,2BAA2B;CAAG;AAElF;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B;CAAG;AAEnF;;;GAGG;AACH,MAAM,WAAW,uCAAwC,SAAQ,2BAA2B;CAAG;AAE/F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"backupClientModels.js","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport { SUPPORTED_API_VERSIONS } from \"./constants.js\";\n\n/**\n * The optional parameters accepted by the KeyVaultBackupClient\n */\nexport interface KeyVaultBackupClientOptions extends CommonClientOptions {\n /**\n * The accepted versions of the Key Vault's service API.\n */\n serviceVersion?: SUPPORTED_API_VERSIONS;\n\n /**\n * Whether to disable verification that the authentication challenge resource matches the Key Vault or Managed HSM domain.\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBackupPollerOptions extends OperationOptions {\n /**\n * Time between each polling\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBeginBackupOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRestore}\n */\nexport interface KeyVaultBeginRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginSelectiveKeyRestore}\n */\nexport interface KeyVaultBeginSelectiveKeyRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the result of a backup operation.\n */\nexport interface KeyVaultBackupResult {\n /**\n * The location of the full backup.\n */\n folderUri?: string;\n\n /**\n * The start time of the backup operation.\n */\n startTime: Date;\n\n /**\n * The end time of the backup operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a restore operation.\n */\nexport interface KeyVaultRestoreResult {\n /**\n * The start time of the restore operation.\n */\n startTime: Date;\n\n /**\n * The end time of the restore operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a selective key restore operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreResult {\n /**\n * The start time of the selective key restore operation.\n */\n startTime: Date;\n\n /**\n * The end time of the selective key restore operation.\n */\n endTime?: Date;\n}\n"]}
1
+ {"version":3,"file":"backupClientModels.js","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport type { SUPPORTED_API_VERSIONS } from \"./constants.js\";\n\n/**\n * The optional parameters accepted by the KeyVaultBackupClient\n */\nexport interface KeyVaultBackupClientOptions extends CommonClientOptions {\n /**\n * The accepted versions of the Key Vault's service API.\n */\n serviceVersion?: SUPPORTED_API_VERSIONS;\n\n /**\n * Whether to disable verification that the authentication challenge resource matches the Key Vault or Managed HSM domain.\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBackupPollerOptions extends OperationOptions {\n /**\n * Time between each polling\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBeginBackupOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRestore}\n */\nexport interface KeyVaultBeginRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginSelectiveKeyRestore}\n */\nexport interface KeyVaultBeginSelectiveKeyRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the result of a backup operation.\n */\nexport interface KeyVaultBackupResult {\n /**\n * The location of the full backup.\n */\n folderUri?: string;\n\n /**\n * The start time of the backup operation.\n */\n startTime: Date;\n\n /**\n * The end time of the backup operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a restore operation.\n */\nexport interface KeyVaultRestoreResult {\n /**\n * The start time of the restore operation.\n */\n startTime: Date;\n\n /**\n * The end time of the restore operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a selective key restore operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreResult {\n /**\n * The start time of the selective key restore operation.\n */\n startTime: Date;\n\n /**\n * The end time of the selective key restore operation.\n */\n endTime?: Date;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Current version of the Key Vault Admin SDK.
5
5
  */
6
- export const SDK_VERSION = "4.6.0";
6
+ export const SDK_VERSION = "4.6.1";
7
7
  /**
8
8
  * The latest supported Key Vault service API version.
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the Key Vault Admin SDK.\n */\nexport const SDK_VERSION: string = \"4.6.0\";\n\n/**\n * The latest supported Key Vault service API version.\n */\nexport const LATEST_API_VERSION = \"7.5\";\n\n/**\n * Supported API versions\n */\nexport type SUPPORTED_API_VERSIONS = \"7.2\" | \"7.3\" | \"7.4\" | \"7.5\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the Key Vault Admin SDK.\n */\nexport const SDK_VERSION: string = \"4.6.1\";\n\n/**\n * The latest supported Key Vault service API version.\n */\nexport const LATEST_API_VERSION = \"7.5\";\n\n/**\n * Supported API versions\n */\nexport type SUPPORTED_API_VERSIONS = \"7.2\" | \"7.3\" | \"7.4\" | \"7.5\";\n"]}
@@ -23,7 +23,7 @@ export class KeyVaultClientContext extends coreClient.ServiceClient {
23
23
  const defaults = {
24
24
  requestContentType: "application/json; charset=utf-8"
25
25
  };
26
- const packageDetails = `azsdk-js-keyvault-admin/4.6.0`;
26
+ const packageDetails = `azsdk-js-keyvault-admin/4.6.1`;
27
27
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
28
28
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
29
29
  : `${packageDetails}`;
@@ -1 +1 @@
1
- {"version":3,"file":"keyVaultClientContext.js","sourceRoot":"","sources":["../../../src/generated/keyVaultClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,MAAM,OAAO,qBAAsB,SAAQ,UAAU,CAAC,aAAa;IAGjE;;;;OAIG;IACH,YACE,UAAwB,EACxB,OAAsC;QAEtC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAiC;YAC7C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,+BAA+B,CAAC;QACvD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,gBAAgB,GAC9C,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { ApiVersion75, KeyVaultClientOptionalParams } from \"./models/index.js\";\n\nexport class KeyVaultClientContext extends coreClient.ServiceClient {\n apiVersion: ApiVersion75;\n\n /**\n * Initializes a new instance of the KeyVaultClientContext class.\n * @param apiVersion Api Version\n * @param options The parameter options\n */\n constructor(\n apiVersion: ApiVersion75,\n options?: KeyVaultClientOptionalParams\n ) {\n if (apiVersion === undefined) {\n throw new Error(\"'apiVersion' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: KeyVaultClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-keyvault-admin/4.6.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{vaultBaseUrl}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.apiVersion = apiVersion;\n }\n}\n"]}
1
+ {"version":3,"file":"keyVaultClientContext.js","sourceRoot":"","sources":["../../../src/generated/keyVaultClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,MAAM,OAAO,qBAAsB,SAAQ,UAAU,CAAC,aAAa;IAGjE;;;;OAIG;IACH,YACE,UAAwB,EACxB,OAAsC;QAEtC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAiC;YAC7C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,+BAA+B,CAAC;QACvD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,gBAAgB,GAC9C,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { ApiVersion75, KeyVaultClientOptionalParams } from \"./models/index.js\";\n\nexport class KeyVaultClientContext extends coreClient.ServiceClient {\n apiVersion: ApiVersion75;\n\n /**\n * Initializes a new instance of the KeyVaultClientContext class.\n * @param apiVersion Api Version\n * @param options The parameter options\n */\n constructor(\n apiVersion: ApiVersion75,\n options?: KeyVaultClientOptionalParams\n ) {\n if (apiVersion === undefined) {\n throw new Error(\"'apiVersion' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: KeyVaultClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-keyvault-admin/4.6.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{vaultBaseUrl}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.apiVersion = apiVersion;\n }\n}\n"]}
@@ -1,7 +1,8 @@
1
- import { KeyVaultAdminPollOperation, KeyVaultAdminPollOperationState } from "../keyVaultAdminPoller.js";
2
- import { KeyVaultBackupResult, KeyVaultBeginBackupOptions } from "../../backupClientModels.js";
3
- import { AbortSignalLike } from "@azure/abort-controller";
4
- import { KeyVaultClient } from "../../generated/keyVaultClient.js";
1
+ import type { KeyVaultAdminPollOperationState } from "../keyVaultAdminPoller.js";
2
+ import { KeyVaultAdminPollOperation } from "../keyVaultAdminPoller.js";
3
+ import type { KeyVaultBackupResult, KeyVaultBeginBackupOptions } from "../../backupClientModels.js";
4
+ import type { AbortSignalLike } from "@azure/abort-controller";
5
+ import type { KeyVaultClient } from "../../generated/keyVaultClient.js";
5
6
  /**
6
7
  * An interface representing the publicly available properties of the state of a backup Key Vault's poll operation.
7
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/backup/operation.ts"],"names":[],"mappings":"AASA,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,+BAA+B,CAAC,oBAAoB,CAAC,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,gCACf,SAAQ,+BAA+B,CAAC,oBAAoB,CAAC;IAC7D;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,0BAA0B,CACzE,gCAAgC,EAChC,MAAM,CACP;IAEU,KAAK,EAAE,gCAAg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C,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,cAAc;gBAHf,KAAK,EAAE,gCAAgC,EACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,cAAc,GAAE,0BAA+B;IAKzD;;OAEG;IACH,OAAO,CAAC,UAAU;IAMlB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;OAEG;IACG,MAAM,CACV,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;KAC7D,GACL,OAAO,CAAC,2BAA2B,CAAC;IA8BvC,OAAO,CAAC,QAAQ;CAqCjB"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { KeyVaultAdminPollOperation, } from "../keyVaultAdminPoller.js";
3
+ import { KeyVaultAdminPollOperation } from "../keyVaultAdminPoller.js";
4
4
  import { tracingClient } from "../../tracing.js";
5
5
  /**
6
6
  * The backup Key Vault's poll operation.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/backup/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EACL,0BAA0B,GAE3B,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAsBjD;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,0BAGhD;IACC,YACS,KAAuC,EACtC,QAAgB,EAChB,MAAsB,EACtB,iBAA6C,EAAE;QAEvD,KAAK,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,sDAAsD,EAAE,CAAC,CAAC;QALjF,UAAK,GAAL,KAAK,CAAkC;QACtC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAgB;QACtB,mBAAc,GAAd,cAAc,CAAi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right (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n FullBackupOperation,\n FullBackupOptionalParams,\n FullBackupResponse,\n FullBackupStatusResponse,\n} from \"../../generated/models/index.js\";\nimport {\n KeyVaultAdminPollOperation,\n KeyVaultAdminPollOperationState,\n} from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultBackupResult, KeyVaultBeginBackupOptions } from \"../../backupClientModels.js\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { KeyVaultClient } from \"../../generated/keyVaultClient.js\";\nimport { tracingClient } from \"../../tracing.js\";\n\n/**\n * An interface representing the publicly available properties of the state of a backup Key Vault's poll operation.\n */\nexport type KeyVaultBackupOperationState = KeyVaultAdminPollOperationState<KeyVaultBackupResult>;\n\n/**\n * An internal interface representing the state of a backup Key Vault's poll operation.\n */\nexport interface KeyVaultBackupPollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultBackupResult> {\n /**\n * The URI of the blob storage account.\n */\n blobStorageUri: string;\n /**\n * The SAS token.\n */\n sasToken?: string;\n}\n\n/**\n * The backup Key Vault's poll operation.\n */\nexport class KeyVaultBackupPollOperation extends KeyVaultAdminPollOperation<\n KeyVaultBackupPollOperationState,\n string\n> {\n constructor(\n public state: KeyVaultBackupPollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginBackupOptions = {},\n ) {\n super(state, { cancelMessage: \"Cancelling a full Key Vault backup is not supported.\" });\n }\n\n /**\n * Tracing the fullBackup operation\n */\n private fullBackup(options: FullBackupOptionalParams): Promise<FullBackupResponse> {\n return tracingClient.withSpan(\"KeyVaultBackupPoller.fullBackup\", options, (updatedOptions) =>\n this.client.fullBackup(this.vaultUrl, updatedOptions),\n );\n }\n\n /**\n * Tracing the fullBackupStatus operation\n */\n private fullBackupStatus(\n jobId: string,\n options: KeyVaultBeginBackupOptions,\n ): Promise<FullBackupStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultBackupPoller.fullBackupStatus\",\n options,\n (updatedOptions) => this.client.fullBackupStatus(this.vaultUrl, jobId, updatedOptions),\n );\n }\n\n /**\n * Reaches to the service and updates the backup's poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultBackupPollOperationState) => void;\n } = {},\n ): Promise<KeyVaultBackupPollOperation> {\n const state = this.state;\n const { blobStorageUri, sasToken } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const serviceOperation = await this.fullBackup({\n ...this.requestOptions,\n azureStorageBlobContainerUri: {\n storageResourceUri: blobStorageUri!,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n });\n\n this.mapState(serviceOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full backup operation.`);\n }\n const serviceOperation = await this.fullBackupStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: FullBackupOperation): void {\n const state = this.state;\n const {\n startTime,\n jobId,\n azureStorageBlobContainerUri,\n endTime,\n error,\n status,\n statusDetails,\n } = serviceOperation;\n if (!startTime) {\n throw new Error(\n `Missing \"startTime\" from the full backup operation. Full backup did not start successfully.`,\n );\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n folderUri: azureStorageBlobContainerUri,\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/backup/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAIvE,OAAO,EAAE,aAAa,EAAE,MA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KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,aAAa,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS,EAAE,4BAA4B;gBACvC,SAAS;gBACT,OAAO;aACR,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullBackupOperation,\n FullBackupOptionalParams,\n FullBackupResponse,\n FullBackupStatusResponse,\n} from \"../../generated/models/index.js\";\nimport type { KeyVaultAdminPollOperationState } from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultAdminPollOperation } from \"../keyVaultAdminPoller.js\";\nimport type { KeyVaultBackupResult, KeyVaultBeginBackupOptions } from \"../../backupClientModels.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { KeyVaultClient } from \"../../generated/keyVaultClient.js\";\nimport { tracingClient } from \"../../tracing.js\";\n\n/**\n * An interface representing the publicly available properties of the state of a backup Key Vault's poll operation.\n */\nexport type KeyVaultBackupOperationState = KeyVaultAdminPollOperationState<KeyVaultBackupResult>;\n\n/**\n * An internal interface representing the state of a backup Key Vault's poll operation.\n */\nexport interface KeyVaultBackupPollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultBackupResult> {\n /**\n * The URI of the blob storage account.\n */\n blobStorageUri: string;\n /**\n * The SAS token.\n */\n sasToken?: string;\n}\n\n/**\n * The backup Key Vault's poll operation.\n */\nexport class KeyVaultBackupPollOperation extends KeyVaultAdminPollOperation<\n KeyVaultBackupPollOperationState,\n string\n> {\n constructor(\n public state: KeyVaultBackupPollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginBackupOptions = {},\n ) {\n super(state, { cancelMessage: \"Cancelling a full Key Vault backup is not supported.\" });\n }\n\n /**\n * Tracing the fullBackup operation\n */\n private fullBackup(options: FullBackupOptionalParams): Promise<FullBackupResponse> {\n return tracingClient.withSpan(\"KeyVaultBackupPoller.fullBackup\", options, (updatedOptions) =>\n this.client.fullBackup(this.vaultUrl, updatedOptions),\n );\n }\n\n /**\n * Tracing the fullBackupStatus operation\n */\n private fullBackupStatus(\n jobId: string,\n options: KeyVaultBeginBackupOptions,\n ): Promise<FullBackupStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultBackupPoller.fullBackupStatus\",\n options,\n (updatedOptions) => this.client.fullBackupStatus(this.vaultUrl, jobId, updatedOptions),\n );\n }\n\n /**\n * Reaches to the service and updates the backup's poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultBackupPollOperationState) => void;\n } = {},\n ): Promise<KeyVaultBackupPollOperation> {\n const state = this.state;\n const { blobStorageUri, sasToken } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const serviceOperation = await this.fullBackup({\n ...this.requestOptions,\n azureStorageBlobContainerUri: {\n storageResourceUri: blobStorageUri!,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n });\n\n this.mapState(serviceOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full backup operation.`);\n }\n const serviceOperation = await this.fullBackupStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: FullBackupOperation): void {\n const state = this.state;\n const {\n startTime,\n jobId,\n azureStorageBlobContainerUri,\n endTime,\n error,\n status,\n statusDetails,\n } = serviceOperation;\n if (!startTime) {\n throw new Error(\n `Missing \"startTime\" from the full backup operation. Full backup did not start successfully.`,\n );\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n folderUri: azureStorageBlobContainerUri,\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { KeyVaultAdminPoller, KeyVaultAdminPollerOptions } from "../keyVaultAdminPoller.js";
2
- import { KeyVaultBackupOperationState } from "./operation.js";
3
- import { KeyVaultBackupResult } from "../../backupClientModels.js";
1
+ import type { KeyVaultAdminPollerOptions } from "../keyVaultAdminPoller.js";
2
+ import { KeyVaultAdminPoller } from "../keyVaultAdminPoller.js";
3
+ import type { KeyVaultBackupOperationState } from "./operation.js";
4
+ import type { KeyVaultBackupResult } from "../../backupClientModels.js";
4
5
  export interface KeyVaultBackupPollerOptions extends KeyVaultAdminPollerOptions {
5
6
  blobStorageUri: string;
6
7
  sasToken?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/backup/poller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EACL,4BAA4B,EAG7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC7E,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB,CAC3D,4BAA4B,EAC5B,oBAAoB,CACrB;gBACa,OAAO,EAAE,2BAA2B;CAgCjD"}
1
+ {"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/backup/poller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC7E,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB,CAC3D,4BAA4B,EAC5B,oBAAoB,CACrB;gBACa,OAAO,EAAE,2BAA2B;CAgCjD"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { KeyVaultAdminPoller } from "../keyVaultAdminPoller.js";
4
- import { KeyVaultBackupPollOperation, } from "./operation.js";
4
+ import { KeyVaultBackupPollOperation } from "./operation.js";
5
5
  /**
6
6
  * Class that creates a poller that waits until the backup of a Key Vault ends up being generated.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../src/lro/backup/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAA8B,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAEL,2BAA2B,GAE5B,MAAM,gBAAgB,CAAC;AAQxB;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,mBAGzC;IACC,YAAY,OAAoC;QAC9C,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,YAAY,GAAG,IAAI,EACnB,UAAU,GACX,GAAG,OAAO,CAAC;QAEZ,IAAI,KAAmD,CAAC;QAExD,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACvC,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,2BAA2B,iCAE1C,KAAK,KACR,cAAc;YACd,QAAQ,KAEV,QAAQ,EACR,MAAM,EACN,cAAc,CACf,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { KeyVaultAdminPoller, KeyVaultAdminPollerOptions } from \"../keyVaultAdminPoller.js\";\nimport {\n KeyVaultBackupOperationState,\n KeyVaultBackupPollOperation,\n KeyVaultBackupPollOperationState,\n} from \"./operation.js\";\nimport { KeyVaultBackupResult } from \"../../backupClientModels.js\";\n\nexport interface KeyVaultBackupPollerOptions extends KeyVaultAdminPollerOptions {\n blobStorageUri: string;\n sasToken?: string;\n}\n\n/**\n * Class that creates a poller that waits until the backup of a Key Vault ends up being generated.\n */\nexport class KeyVaultBackupPoller extends KeyVaultAdminPoller<\n KeyVaultBackupOperationState,\n KeyVaultBackupResult\n> {\n constructor(options: KeyVaultBackupPollerOptions) {\n const {\n client,\n vaultUrl,\n blobStorageUri,\n sasToken,\n requestOptions,\n intervalInMs = 2000,\n resumeFrom,\n } = options;\n\n let state: KeyVaultBackupPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new KeyVaultBackupPollOperation(\n {\n ...state,\n blobStorageUri,\n sasToken,\n },\n vaultUrl,\n client,\n requestOptions,\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
1
+ {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../src/lro/backup/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAQ7D;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,mBAGzC;IACC,YAAY,OAAoC;QAC9C,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,YAAY,GAAG,IAAI,EACnB,UAAU,GACX,GAAG,OAAO,CAAC;QAEZ,IAAI,KAAmD,CAAC;QAExD,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACvC,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,2BAA2B,iCAE1C,KAAK,KACR,cAAc;YACd,QAAQ,KAEV,QAAQ,EACR,MAAM,EACN,cAAc,CACf,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { KeyVaultAdminPollerOptions } from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultAdminPoller } from \"../keyVaultAdminPoller.js\";\nimport type {\n KeyVaultBackupOperationState,\n KeyVaultBackupPollOperationState,\n} from \"./operation.js\";\nimport { KeyVaultBackupPollOperation } from \"./operation.js\";\nimport type { KeyVaultBackupResult } from \"../../backupClientModels.js\";\n\nexport interface KeyVaultBackupPollerOptions extends KeyVaultAdminPollerOptions {\n blobStorageUri: string;\n sasToken?: string;\n}\n\n/**\n * Class that creates a poller that waits until the backup of a Key Vault ends up being generated.\n */\nexport class KeyVaultBackupPoller extends KeyVaultAdminPoller<\n KeyVaultBackupOperationState,\n KeyVaultBackupResult\n> {\n constructor(options: KeyVaultBackupPollerOptions) {\n const {\n client,\n vaultUrl,\n blobStorageUri,\n sasToken,\n requestOptions,\n intervalInMs = 2000,\n resumeFrom,\n } = options;\n\n let state: KeyVaultBackupPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new KeyVaultBackupPollOperation(\n {\n ...state,\n blobStorageUri,\n sasToken,\n },\n vaultUrl,\n client,\n requestOptions,\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { PollOperation, PollOperationState, Poller } from "@azure/core-lro";
2
- import { KeyVaultClient } from "../generated/keyVaultClient.js";
3
- import { OperationOptions } from "@azure/core-client";
1
+ import type { PollOperation, PollOperationState } from "@azure/core-lro";
2
+ import { Poller } from "@azure/core-lro";
3
+ import type { KeyVaultClient } from "../generated/keyVaultClient.js";
4
+ import type { OperationOptions } from "@azure/core-client";
4
5
  /**
5
6
  * Common parameters to a Key Vault Admin Poller.
6
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"keyVaultAdminPoller.d.ts","sourceRoot":"","sources":["../../../src/lro/keyVaultAdminPoller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B,CAAC,OAAO,CAAE,SAAQ,kBAAkB,CAAC,OAAO,CAAC;IAC3F;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB;;OAEG;IAC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,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAW,CAAC;IACpD,CAAC;CACF;AASD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAOrC,YACS,KAAa,EACpB,OAA0C;QADnC,UAAK,GAAL,KAAK,CAAQ;QAGpB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PollOperation, PollOperationState, Poller } from \"@azure/core-lro\";\nimport { KeyVaultClient } from \"../generated/keyVaultClient.js\";\nimport { OperationOptions } from \"@azure/core-client\";\n\n/**\n * Common parameters to a Key Vault Admin Poller.\n */\nexport interface KeyVaultAdminPollerOptions {\n vaultUrl: string;\n client: KeyVaultClient;\n requestOptions?: OperationOptions;\n intervalInMs?: number;\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the state of a Key Vault Admin Poller's operation.\n */\nexport interface KeyVaultAdminPollOperationState<TResult> extends PollOperationState<TResult> {\n /**\n * Identifier for the full restore operation.\n */\n jobId?: string;\n /**\n * Status of the restore operation.\n */\n status?: string;\n /**\n * The status details of restore operation.\n */\n statusDetails?: string;\n /**\n * The start time of the restore operation in UTC\n */\n startTime?: Date;\n /**\n * The end time of the restore operation in UTC\n */\n endTime?: Date;\n}\n\n/**\n * Generates a version of the state with only public properties. At least those common for all of the Key Vault Admin pollers.\n */\nexport function cleanState<TState extends KeyVaultAdminPollOperationState<TResult>, TResult>(\n state: TState,\n): KeyVaultAdminPollOperationState<TResult> {\n return {\n jobId: state.jobId,\n status: state.status,\n statusDetails: state.statusDetails,\n startTime: state.startTime,\n endTime: state.endTime,\n isStarted: state.isStarted,\n isCancelled: state.isCancelled,\n isCompleted: state.isCompleted,\n error: state.error,\n result: state.result,\n };\n}\n\n/**\n * Common properties and methods of the Key Vault Admin Pollers.\n */\nexport abstract class KeyVaultAdminPoller<\n TState extends KeyVaultAdminPollOperationState<TResult>,\n TResult,\n> extends Poller<TState, TResult> {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n public intervalInMs: number = 2000;\n\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n async delay(): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, this.intervalInMs));\n }\n\n /**\n * Gets the public state of the polling operation\n */\n public getOperationState(): TState {\n return cleanState(this.operation.state) as TState;\n }\n}\n\n/**\n * Optional parameters to the KeyVaultAdminPollOperation\n */\nexport interface KeyVaultAdminPollOperationOptions {\n cancelMessage: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Admin Poller operations.\n */\nexport class KeyVaultAdminPollOperation<\n TState extends KeyVaultAdminPollOperationState<unknown>,\n TResult,\n> implements PollOperation<TState, TResult>\n{\n private cancelMessage: string;\n\n constructor(\n public state: TState,\n options: KeyVaultAdminPollOperationOptions,\n ) {\n this.cancelMessage = options.cancelMessage;\n }\n\n /**\n * Meant to reach to the service and update the Poller operation.\n */\n public async update(): Promise<PollOperation<TState, TResult>> {\n throw new Error(\"Operation not supported.\");\n }\n\n /**\n * Meant to reach to the service and cancel the Poller operation.\n */\n public async cancel(): Promise<PollOperation<TState, TResult>> {\n throw new Error(this.cancelMessage);\n }\n\n /**\n * Serializes the Poller operation.\n */\n public toString(): string {\n return JSON.stringify({\n state: cleanState(this.state),\n });\n }\n}\n"]}
1
+ {"version":3,"file":"keyVaultAdminPoller.js","sourceRoot":"","sources":["../../../src/lro/keyVaultAdminPoller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAyCzC;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,KAAa;IAEb,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,OAAgB,mBAGpB,SAAQ,MAAuB;IAHjC;;QAIE;;WAEG;QACI,iBAAY,GAAW,IAAI,CAAC;IAerC,CAAC;IAbC;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAW,CAAC;IACpD,CAAC;CACF;AASD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAOrC,YACS,KAAa,EACpB,OAA0C;QADnC,UAAK,GAAL,KAAK,CAAQ;QAGpB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PollOperation, PollOperationState } from \"@azure/core-lro\";\nimport { Poller } from \"@azure/core-lro\";\nimport type { KeyVaultClient } from \"../generated/keyVaultClient.js\";\nimport type { OperationOptions } from \"@azure/core-client\";\n\n/**\n * Common parameters to a Key Vault Admin Poller.\n */\nexport interface KeyVaultAdminPollerOptions {\n vaultUrl: string;\n client: KeyVaultClient;\n requestOptions?: OperationOptions;\n intervalInMs?: number;\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the state of a Key Vault Admin Poller's operation.\n */\nexport interface KeyVaultAdminPollOperationState<TResult> extends PollOperationState<TResult> {\n /**\n * Identifier for the full restore operation.\n */\n jobId?: string;\n /**\n * Status of the restore operation.\n */\n status?: string;\n /**\n * The status details of restore operation.\n */\n statusDetails?: string;\n /**\n * The start time of the restore operation in UTC\n */\n startTime?: Date;\n /**\n * The end time of the restore operation in UTC\n */\n endTime?: Date;\n}\n\n/**\n * Generates a version of the state with only public properties. At least those common for all of the Key Vault Admin pollers.\n */\nexport function cleanState<TState extends KeyVaultAdminPollOperationState<TResult>, TResult>(\n state: TState,\n): KeyVaultAdminPollOperationState<TResult> {\n return {\n jobId: state.jobId,\n status: state.status,\n statusDetails: state.statusDetails,\n startTime: state.startTime,\n endTime: state.endTime,\n isStarted: state.isStarted,\n isCancelled: state.isCancelled,\n isCompleted: state.isCompleted,\n error: state.error,\n result: state.result,\n };\n}\n\n/**\n * Common properties and methods of the Key Vault Admin Pollers.\n */\nexport abstract class KeyVaultAdminPoller<\n TState extends KeyVaultAdminPollOperationState<TResult>,\n TResult,\n> extends Poller<TState, TResult> {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n public intervalInMs: number = 2000;\n\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n async delay(): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, this.intervalInMs));\n }\n\n /**\n * Gets the public state of the polling operation\n */\n public getOperationState(): TState {\n return cleanState(this.operation.state) as TState;\n }\n}\n\n/**\n * Optional parameters to the KeyVaultAdminPollOperation\n */\nexport interface KeyVaultAdminPollOperationOptions {\n cancelMessage: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Admin Poller operations.\n */\nexport class KeyVaultAdminPollOperation<\n TState extends KeyVaultAdminPollOperationState<unknown>,\n TResult,\n> implements PollOperation<TState, TResult>\n{\n private cancelMessage: string;\n\n constructor(\n public state: TState,\n options: KeyVaultAdminPollOperationOptions,\n ) {\n this.cancelMessage = options.cancelMessage;\n }\n\n /**\n * Meant to reach to the service and update the Poller operation.\n */\n public async update(): Promise<PollOperation<TState, TResult>> {\n throw new Error(\"Operation not supported.\");\n }\n\n /**\n * Meant to reach to the service and cancel the Poller operation.\n */\n public async cancel(): Promise<PollOperation<TState, TResult>> {\n throw new Error(this.cancelMessage);\n }\n\n /**\n * Serializes the Poller operation.\n */\n public toString(): string {\n return JSON.stringify({\n state: cleanState(this.state),\n });\n }\n}\n"]}
@@ -1,7 +1,8 @@
1
- import { KeyVaultAdminPollOperation, KeyVaultAdminPollOperationState } from "../keyVaultAdminPoller.js";
2
- import { KeyVaultBeginRestoreOptions, KeyVaultRestoreResult } from "../../backupClientModels.js";
3
- import { AbortSignalLike } from "@azure/abort-controller";
4
- import { KeyVaultClient } from "../../generated/keyVaultClient.js";
1
+ import type { KeyVaultAdminPollOperationState } from "../keyVaultAdminPoller.js";
2
+ import { KeyVaultAdminPollOperation } from "../keyVaultAdminPoller.js";
3
+ import type { KeyVaultBeginRestoreOptions, KeyVaultRestoreResult } from "../../backupClientModels.js";
4
+ import type { AbortSignalLike } from "@azure/abort-controller";
5
+ import type { KeyVaultClient } from "../../generated/keyVaultClient.js";
5
6
  /**
6
7
  * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.
7
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/restore/operation.ts"],"names":[],"mappings":"AASA,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEjG,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,6BACf,SAAQ,+BAA+B,CAAC,qBAAqB,CAAC;CAAG;AAEnE;;;GAGG;AACH,MAAM,WAAW,iCACf,SAAQ,+BAA+B,CAAC,qBAAqB,CAAC;IAC9D;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,0BAA0B,CAC1E,iCAAiC,EACjC,qBAAqB,CACtB;IAEU,KAAK,EAAE,iCAAiC;IAC/C,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,cAAc;gBAHf,KAAK,EAAE,iCAAiC,EACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,cAAc,GAAE,2BAAgC;IAO1D;;OAEG;IACH,OAAO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EG;IACH,OAAO,CAAC,WAAW;IAQnB;;OAEG;YACW,aAAa;IAW3B;;OAEG;IACG,MAAM,CACV,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,IAAI,CAAC;KAC9D,GACL,OAAO,CAAC,4BAA4B,CAAC;IAiCxC,OAAO,CAAC,QAAQ;CA8BjB"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { KeyVaultAdminPollOperation, } from "../keyVaultAdminPoller.js";
3
+ import { KeyVaultAdminPollOperation } from "../keyVaultAdminPoller.js";
4
4
  import { tracingClient } from "../../tracing.js";
5
5
  /**
6
6
  * An interface representing a restore Key Vault's poll operation.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/restore/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EACL,0BAA0B,GAE3B,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA4BjD;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,0BAGjD;IACC,YACS,KAAwC,EACvC,QAAgB,EAChB,MAAsB,EACtB,iBAA8C,EAAE;QAExD,KAAK,CAAC,KAAK,EAAE;YACX,aAAa,EAAE,oEAAoE;SACpF,CAAC,CAAC;QAPI,UAAK,GAAL,KAAK,CAAmC;QACvC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAgB;QACtB,mBAAc,GAAd,cAAc,CAAkC;IAK1D,CAAC;IAED;;OAEG;IACK,WAAW,CACjB,OAA2C;QAE3C,OAAO,aAAa,CAAC,QAAQ,CAAC,mCAAmC,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,EAAE,CAC7F,IAAI,CAAC,MAAM,CAAC,oBAAoB,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AK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YACpF,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,QAAQ,CAAC,gBAAkC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC;QAErF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;QACvB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;QAEpC,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,OAAO,CAAC;QAE9B,IAAI,KAAK,CAAC,WAAW,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,aAAa,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS;gBACT,OAAO;aACR,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n FullRestoreOperationOptionalParams,\n FullRestoreOperationResponse,\n RestoreOperation,\n RestoreStatusResponse,\n} from \"../../generated/models/index.js\";\nimport {\n KeyVaultAdminPollOperation,\n KeyVaultAdminPollOperationState,\n} from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultBeginRestoreOptions, KeyVaultRestoreResult } from \"../../backupClientModels.js\";\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { KeyVaultClient } from \"../../generated/keyVaultClient.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../../tracing.js\";\n\n/**\n * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultRestoreOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultRestoreResult> {}\n\n/**\n * An internal interface representing the state of a restore Key Vault's poll operation.\n * @internal\n */\nexport interface KeyVaultRestorePollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultRestoreResult> {\n /**\n * The URI of the blob storage account.\n */\n folderUri: string;\n /**\n * The SAS token.\n */\n sasToken?: string;\n /**\n * The Folder name of the blob where the previous successful full backup was stored\n */\n folderName: string;\n}\n\n/**\n * An interface representing a restore Key Vault's poll operation.\n */\nexport class KeyVaultRestorePollOperation extends KeyVaultAdminPollOperation<\n KeyVaultRestorePollOperationState,\n KeyVaultRestoreResult\n> {\n constructor(\n public state: KeyVaultRestorePollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginRestoreOptions = {},\n ) {\n super(state, {\n cancelMessage: \"Cancelling the restoration full Key Vault backup is not supported.\",\n });\n }\n\n /**\n * Tracing the fullRestore operation\n */\n private fullRestore(\n options: FullRestoreOperationOptionalParams,\n ): Promise<FullRestoreOperationResponse> {\n return tracingClient.withSpan(\"KeyVaultRestorePoller.fullRestore\", options, (updatedOptions) =>\n this.client.fullRestoreOperation(this.vaultUrl, updatedOptions),\n );\n }\n\n /**\n * Tracing the restoreStatus operation.\n */\n private async restoreStatus(\n jobId: string,\n options: OperationOptions,\n ): Promise<RestoreStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultRestorePoller.restoreStatus\",\n options,\n (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions),\n );\n }\n\n /**\n * Reaches to the service and updates the restore poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultRestorePollOperationState) => void;\n } = {},\n ): Promise<KeyVaultRestorePollOperation> {\n const state = this.state;\n const { folderUri, sasToken, folderName } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const serviceOperation = await this.fullRestore({\n ...this.requestOptions,\n restoreBlobDetails: {\n folderToRestore: folderName,\n sasTokenParameters: {\n storageResourceUri: folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n });\n\n this.mapState(serviceOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full restore operation.`);\n }\n const serviceOperation = await this.restoreStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: RestoreOperation): void {\n const state = this.state;\n const { startTime, jobId, endTime, error, status, statusDetails } = serviceOperation;\n\n if (!startTime) {\n throw new Error(\n `Missing \"startTime\" from the full restore operation. Restore did not start successfully.`,\n );\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/restore/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AASvE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA4BjD;;GAEG;AACH,MAAM,OAA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AAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,aAAa,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS;gBACT,OAAO;aACR,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullRestoreOperationOptionalParams,\n FullRestoreOperationResponse,\n RestoreOperation,\n RestoreStatusResponse,\n} from \"../../generated/models/index.js\";\nimport type { KeyVaultAdminPollOperationState } from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultAdminPollOperation } from \"../keyVaultAdminPoller.js\";\nimport type {\n KeyVaultBeginRestoreOptions,\n KeyVaultRestoreResult,\n} from \"../../backupClientModels.js\";\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { KeyVaultClient } from \"../../generated/keyVaultClient.js\";\nimport type { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../../tracing.js\";\n\n/**\n * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultRestoreOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultRestoreResult> {}\n\n/**\n * An internal interface representing the state of a restore Key Vault's poll operation.\n * @internal\n */\nexport interface KeyVaultRestorePollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultRestoreResult> {\n /**\n * The URI of the blob storage account.\n */\n folderUri: string;\n /**\n * The SAS token.\n */\n sasToken?: string;\n /**\n * The Folder name of the blob where the previous successful full backup was stored\n */\n folderName: string;\n}\n\n/**\n * An interface representing a restore Key Vault's poll operation.\n */\nexport class KeyVaultRestorePollOperation extends KeyVaultAdminPollOperation<\n KeyVaultRestorePollOperationState,\n KeyVaultRestoreResult\n> {\n constructor(\n public state: KeyVaultRestorePollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginRestoreOptions = {},\n ) {\n super(state, {\n cancelMessage: \"Cancelling the restoration full Key Vault backup is not supported.\",\n });\n }\n\n /**\n * Tracing the fullRestore operation\n */\n private fullRestore(\n options: FullRestoreOperationOptionalParams,\n ): Promise<FullRestoreOperationResponse> {\n return tracingClient.withSpan(\"KeyVaultRestorePoller.fullRestore\", options, (updatedOptions) =>\n this.client.fullRestoreOperation(this.vaultUrl, updatedOptions),\n );\n }\n\n /**\n * Tracing the restoreStatus operation.\n */\n private async restoreStatus(\n jobId: string,\n options: OperationOptions,\n ): Promise<RestoreStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultRestorePoller.restoreStatus\",\n options,\n (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions),\n );\n }\n\n /**\n * Reaches to the service and updates the restore poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultRestorePollOperationState) => void;\n } = {},\n ): Promise<KeyVaultRestorePollOperation> {\n const state = this.state;\n const { folderUri, sasToken, folderName } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const serviceOperation = await this.fullRestore({\n ...this.requestOptions,\n restoreBlobDetails: {\n folderToRestore: folderName,\n sasTokenParameters: {\n storageResourceUri: folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n });\n\n this.mapState(serviceOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full restore operation.`);\n }\n const serviceOperation = await this.restoreStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: RestoreOperation): void {\n const state = this.state;\n const { startTime, jobId, endTime, error, status, statusDetails } = serviceOperation;\n\n if (!startTime) {\n throw new Error(\n `Missing \"startTime\" from the full restore operation. Restore did not start successfully.`,\n );\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { KeyVaultAdminPoller, KeyVaultAdminPollerOptions } from "../keyVaultAdminPoller.js";
2
- import { KeyVaultRestoreOperationState } from "./operation.js";
3
- import { KeyVaultRestoreResult } from "../../backupClientModels.js";
1
+ import type { KeyVaultAdminPollerOptions } from "../keyVaultAdminPoller.js";
2
+ import { KeyVaultAdminPoller } from "../keyVaultAdminPoller.js";
3
+ import type { KeyVaultRestoreOperationState } from "./operation.js";
4
+ import type { KeyVaultRestoreResult } from "../../backupClientModels.js";
4
5
  export interface KeyVaultRestorePollerOptions extends KeyVaultAdminPollerOptions {
5
6
  folderUri: string;
6
7
  sasToken?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/restore/poller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EACL,6BAA6B,EAG9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,WAAW,4BAA6B,SAAQ,0BAA0B;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,mBAAmB,CAC5D,6BAA6B,EAC7B,qBAAqB,CACtB;gBACa,OAAO,EAAE,4BAA4B;CAkClD"}
1
+ {"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/restore/poller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,MAAM,WAAW,4BAA6B,SAAQ,0BAA0B;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,mBAAmB,CAC5D,6BAA6B,EAC7B,qBAAqB,CACtB;gBACa,OAAO,EAAE,4BAA4B;CAkClD"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { KeyVaultAdminPoller } from "../keyVaultAdminPoller.js";
4
- import { KeyVaultRestorePollOperation, } from "./operation.js";
4
+ import { KeyVaultRestorePollOperation } from "./operation.js";
5
5
  /**
6
6
  * Class that creates a poller that waits until a Key Vault ends up being restored.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../src/lro/restore/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAA8B,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAEL,4BAA4B,GAE7B,MAAM,gBAAgB,CAAC;AASxB;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,mBAG1C;IACC,YAAY,OAAqC;QAC/C,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,cAAc,EACd,YAAY,GAAG,IAAI,EACnB,UAAU,GACX,GAAG,OAAO,CAAC;QAEZ,IAAI,KAAoD,CAAC;QAEzD,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACvC,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,4BAA4B,iCAE3C,KAAK,KACR,SAAS;YACT,QAAQ;YACR,UAAU,KAEZ,QAAQ,EACR,MAAM,EACN,cAAc,CACf,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { KeyVaultAdminPoller, KeyVaultAdminPollerOptions } from \"../keyVaultAdminPoller.js\";\nimport {\n KeyVaultRestoreOperationState,\n KeyVaultRestorePollOperation,\n KeyVaultRestorePollOperationState,\n} from \"./operation.js\";\nimport { KeyVaultRestoreResult } from \"../../backupClientModels.js\";\n\nexport interface KeyVaultRestorePollerOptions extends KeyVaultAdminPollerOptions {\n folderUri: string;\n sasToken?: string;\n folderName: string;\n}\n\n/**\n * Class that creates a poller that waits until a Key Vault ends up being restored.\n */\nexport class KeyVaultRestorePoller extends KeyVaultAdminPoller<\n KeyVaultRestoreOperationState,\n KeyVaultRestoreResult\n> {\n constructor(options: KeyVaultRestorePollerOptions) {\n const {\n client,\n vaultUrl,\n folderUri,\n sasToken,\n folderName,\n requestOptions,\n intervalInMs = 2000,\n resumeFrom,\n } = options;\n\n let state: KeyVaultRestorePollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new KeyVaultRestorePollOperation(\n {\n ...state,\n folderUri,\n sasToken,\n folderName,\n },\n vaultUrl,\n client,\n requestOptions,\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
1
+ {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../src/lro/restore/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAS9D;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,mBAG1C;IACC,YAAY,OAAqC;QAC/C,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,cAAc,EACd,YAAY,GAAG,IAAI,EACnB,UAAU,GACX,GAAG,OAAO,CAAC;QAEZ,IAAI,KAAoD,CAAC;QAEzD,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACvC,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,4BAA4B,iCAE3C,KAAK,KACR,SAAS;YACT,QAAQ;YACR,UAAU,KAEZ,QAAQ,EACR,MAAM,EACN,cAAc,CACf,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { KeyVaultAdminPollerOptions } from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultAdminPoller } from \"../keyVaultAdminPoller.js\";\nimport type {\n KeyVaultRestoreOperationState,\n KeyVaultRestorePollOperationState,\n} from \"./operation.js\";\nimport { KeyVaultRestorePollOperation } from \"./operation.js\";\nimport type { KeyVaultRestoreResult } from \"../../backupClientModels.js\";\n\nexport interface KeyVaultRestorePollerOptions extends KeyVaultAdminPollerOptions {\n folderUri: string;\n sasToken?: string;\n folderName: string;\n}\n\n/**\n * Class that creates a poller that waits until a Key Vault ends up being restored.\n */\nexport class KeyVaultRestorePoller extends KeyVaultAdminPoller<\n KeyVaultRestoreOperationState,\n KeyVaultRestoreResult\n> {\n constructor(options: KeyVaultRestorePollerOptions) {\n const {\n client,\n vaultUrl,\n folderUri,\n sasToken,\n folderName,\n requestOptions,\n intervalInMs = 2000,\n resumeFrom,\n } = options;\n\n let state: KeyVaultRestorePollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new KeyVaultRestorePollOperation(\n {\n ...state,\n folderUri,\n sasToken,\n folderName,\n },\n vaultUrl,\n client,\n requestOptions,\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
@@ -1,7 +1,8 @@
1
- import { KeyVaultAdminPollOperation, KeyVaultAdminPollOperationState } from "../keyVaultAdminPoller.js";
2
- import { KeyVaultBeginSelectiveKeyRestoreOptions, KeyVaultSelectiveKeyRestoreResult } from "../../backupClientModels.js";
3
- import { AbortSignalLike } from "@azure/abort-controller";
4
- import { KeyVaultClient } from "../../generated/keyVaultClient.js";
1
+ import type { KeyVaultAdminPollOperationState } from "../keyVaultAdminPoller.js";
2
+ import { KeyVaultAdminPollOperation } from "../keyVaultAdminPoller.js";
3
+ import type { KeyVaultBeginSelectiveKeyRestoreOptions, KeyVaultSelectiveKeyRestoreResult } from "../../backupClientModels.js";
4
+ import type { AbortSignalLike } from "@azure/abort-controller";
5
+ import type { KeyVaultClient } from "../../generated/keyVaultClient.js";
5
6
  /**
6
7
  * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.
7
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/selectiveKeyRestore/operation.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uCAAuC,EACvC,iCAAiC,EAClC,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAInE;;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yB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAIxE;;GAEG;AACH,MAAM,WAAW,yCACf,SAAQ,+BAA+B,CAAC,iCAAiC,CAAC;CAAG;AAE/E;;GAEG;AACH,MAAM,WAAW,6CACf,SAAQ,+BAA+B,CAAC,iCAAiC,CAAC;IAC1E;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,wCAAyC,SAAQ,0BAA0B,CACtF,6CAA6C,EAC7C,MAAM,CACP;IAEU,KAAK,EAAE,6CAA6C;IAC3D,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,cAAc;gBAHf,KAAK,EAAE,6CAA6C,EACnD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,cAAc,GAAE,uCAA4C;IAKtE;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACG,MAAM,CACV,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,6CAA6C,KAAK,IAAI,CAAC;KAC1E,GACL,OAAO,CAAC,wCAAwC,CAAC;IAgCpD,OAAO,CAAC,QAAQ;CA2BjB"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { KeyVaultAdminPollOperation, } from "../keyVaultAdminPoller.js";
3
+ import { KeyVaultAdminPollOperation } from "../keyVaultAdminPoller.js";
4
4
  import { tracingClient } from "../../tracing.js";
5
5
  /**
6
6
  * The selective restore Key Vault's poll operation.
@@ -1 +1 @@
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,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;QACpC,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,OAAO,CAAC;QAE9B,IAAI,KAAK,CAAC,WAAW,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,aAAa,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS;gBACT,OAAO;aACR,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n KeyVaultAdminPollOperation,\n KeyVaultAdminPollOperationState,\n} from \"../keyVaultAdminPoller.js\";\nimport {\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"../../backupClientModels.js\";\nimport {\n RestoreOperation,\n RestoreStatusResponse,\n SelectiveKeyRestoreOperationOptionalParams,\n SelectiveKeyRestoreOperationResponse,\n} from \"../../generated/models/index.js\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { KeyVaultClient } from \"../../generated/keyVaultClient.js\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../../tracing.js\";\n\n/**\n * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {}\n\n/**\n * An internal interface representing the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestorePollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {\n /**\n * The name of a Key Vault Key.\n */\n keyName: string;\n /**\n * The Folder name of the blob where the previous successful full backup was stored\n */\n folderName: string;\n /**\n * The URI of the blob storage account where the previous successful full backup was stored.\n */\n folderUri: string;\n /**\n * The SAS token.\n */\n sasToken?: string;\n}\n\n/**\n * The selective restore Key Vault's poll operation.\n */\nexport class KeyVaultSelectiveKeyRestorePollOperation extends KeyVaultAdminPollOperation<\n KeyVaultSelectiveKeyRestorePollOperationState,\n string\n> {\n constructor(\n public state: KeyVaultSelectiveKeyRestorePollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ) {\n super(state, { cancelMessage: \"Cancelling a selective Key Vault restore is not supported.\" });\n }\n\n /**\n * Tracing the selectiveRestore operation\n */\n private selectiveRestore(\n keyName: string,\n options: SelectiveKeyRestoreOperationOptionalParams,\n ): Promise<SelectiveKeyRestoreOperationResponse> {\n return tracingClient.withSpan(\n \"KeyVaultSelectiveKeyRestorePoller.selectiveRestore\",\n options,\n (updatedOptions) =>\n this.client.selectiveKeyRestoreOperation(this.vaultUrl, keyName, updatedOptions),\n );\n }\n\n /**\n * Tracing the restoreStatus operation.\n */\n private restoreStatus(jobId: string, options: OperationOptions): Promise<RestoreStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultSelectiveKeyRestorePoller.restoreStatus\",\n options,\n (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions),\n );\n }\n\n /**\n * Reaches to the service and updates the selective restore poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultSelectiveKeyRestorePollOperationState) => void;\n } = {},\n ): Promise<KeyVaultSelectiveKeyRestorePollOperation> {\n const state = this.state;\n const { keyName, folderUri, sasToken, folderName } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const selectiveRestoreOperation = await this.selectiveRestore(keyName, {\n ...this.requestOptions,\n restoreBlobDetails: {\n folder: folderName,\n sasTokenParameters: {\n storageResourceUri: folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n });\n this.mapState(selectiveRestoreOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full restore operation.`);\n }\n const serviceOperation = await this.restoreStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: RestoreOperation): void {\n const state = this.state;\n const { startTime, jobId, endTime, error, status, statusDetails } = serviceOperation;\n\n if (!startTime) {\n throw new Error(`Missing \"startTime\" from the selective restore operation.`);\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/selectiveKeyRestore/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAcvE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA+BjD;;GAEG;AACH,MAAM,OAAO,wCAAyC,SAAQ,0BAG7D;IACC,YACS,KAAoD,EACnD,QAAgB,EAChB,MAAsB,EACtB,iBAA0D,EAAE;QAEpE,KAAK,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,4DAA4D,EAAE,CAAC,CAAC;QALvF,UAAK,GAAL,KAAK,CAA+C;QACnD,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN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AW,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS;gBACT,OAAO;aACR,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { KeyVaultAdminPollOperationState } from \"../keyVaultAdminPoller.js\";\nimport { KeyVaultAdminPollOperation } from \"../keyVaultAdminPoller.js\";\nimport type {\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"../../backupClientModels.js\";\nimport type {\n RestoreOperation,\n RestoreStatusResponse,\n SelectiveKeyRestoreOperationOptionalParams,\n SelectiveKeyRestoreOperationResponse,\n} from \"../../generated/models/index.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { KeyVaultClient } from \"../../generated/keyVaultClient.js\";\nimport type { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../../tracing.js\";\n\n/**\n * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {}\n\n/**\n * An internal interface representing the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestorePollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {\n /**\n * The name of a Key Vault Key.\n */\n keyName: string;\n /**\n * The Folder name of the blob where the previous successful full backup was stored\n */\n folderName: string;\n /**\n * The URI of the blob storage account where the previous successful full backup was stored.\n */\n folderUri: string;\n /**\n * The SAS token.\n */\n sasToken?: string;\n}\n\n/**\n * The selective restore Key Vault's poll operation.\n */\nexport class KeyVaultSelectiveKeyRestorePollOperation extends KeyVaultAdminPollOperation<\n KeyVaultSelectiveKeyRestorePollOperationState,\n string\n> {\n constructor(\n public state: KeyVaultSelectiveKeyRestorePollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ) {\n super(state, { cancelMessage: \"Cancelling a selective Key Vault restore is not supported.\" });\n }\n\n /**\n * Tracing the selectiveRestore operation\n */\n private selectiveRestore(\n keyName: string,\n options: SelectiveKeyRestoreOperationOptionalParams,\n ): Promise<SelectiveKeyRestoreOperationResponse> {\n return tracingClient.withSpan(\n \"KeyVaultSelectiveKeyRestorePoller.selectiveRestore\",\n options,\n (updatedOptions) =>\n this.client.selectiveKeyRestoreOperation(this.vaultUrl, keyName, updatedOptions),\n );\n }\n\n /**\n * Tracing the restoreStatus operation.\n */\n private restoreStatus(jobId: string, options: OperationOptions): Promise<RestoreStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultSelectiveKeyRestorePoller.restoreStatus\",\n options,\n (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions),\n );\n }\n\n /**\n * Reaches to the service and updates the selective restore poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultSelectiveKeyRestorePollOperationState) => void;\n } = {},\n ): Promise<KeyVaultSelectiveKeyRestorePollOperation> {\n const state = this.state;\n const { keyName, folderUri, sasToken, folderName } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const selectiveRestoreOperation = await this.selectiveRestore(keyName, {\n ...this.requestOptions,\n restoreBlobDetails: {\n folder: folderName,\n sasTokenParameters: {\n storageResourceUri: folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n });\n this.mapState(selectiveRestoreOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full restore operation.`);\n }\n const serviceOperation = await this.restoreStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: RestoreOperation): void {\n const state = this.state;\n const { startTime, jobId, endTime, error, status, statusDetails } = serviceOperation;\n\n if (!startTime) {\n throw new Error(`Missing \"startTime\" from the selective restore operation.`);\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { KeyVaultAdminPoller, KeyVaultAdminPollerOptions } from "../keyVaultAdminPoller.js";
2
- import { KeyVaultSelectiveKeyRestoreOperationState } from "./operation.js";
3
- import { KeyVaultSelectiveKeyRestoreResult } from "../../backupClientModels.js";
1
+ import type { KeyVaultAdminPollerOptions } from "../keyVaultAdminPoller.js";
2
+ import { KeyVaultAdminPoller } from "../keyVaultAdminPoller.js";
3
+ import type { KeyVaultSelectiveKeyRestoreOperationState } from "./operation.js";
4
+ import type { KeyVaultSelectiveKeyRestoreResult } from "../../backupClientModels.js";
4
5
  export interface KeyVaultSelectiveKeyRestorePollerOptions extends KeyVaultAdminPollerOptions {
5
6
  keyName: string;
6
7
  folderUri: string;
@@ -1 +1 @@
1
- {"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/selectiveKeyRestore/poller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EACL,yCAAyC,EAG1C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAEhF,MAAM,WAAW,wCAAyC,SAAQ,0BAA0B;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,mBAAmB,CACxE,yCAAyC,EACzC,iCAAiC,CAClC;gBACa,OAAO,EAAE,wCAAwC;CAoC9D"}
1
+ {"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/selectiveKeyRestore/poller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EACV,yCAAyC,EAE1C,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAErF,MAAM,WAAW,wCAAyC,SAAQ,0BAA0B;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,mBAAmB,CACxE,yCAAyC,EACzC,iCAAiC,CAClC;gBACa,OAAO,EAAE,wCAAwC;CAoC9D"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { KeyVaultAdminPoller } from "../keyVaultAdminPoller.js";
4
- import { KeyVaultSelectiveKeyRestorePollOperation, } from "./operation.js";
4
+ import { KeyVaultSelectiveKeyRestorePollOperation } from "./operation.js";
5
5
  /**
6
6
  * Class that creates a poller that waits until a key of a Key Vault backup ends up being restored.
7
7
  */