@azure/keyvault-keys 4.10.2-alpha.20251128.1 → 4.10.2-alpha.20251201.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.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAiB,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAGhG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,mCACf,SAAQ,6BAA6B,CAAC,WAAW,CAAC;CAAG;AAEvD,qBAAa,8BAA+B,SAAQ,wBAAwB,CAC1E,mCAAmC,EACnC,WAAW,CACZ;IAEU,KAAK,EAAE,mCAAmC;IACjD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;gBAFjB,KAAK,EAAE,mCAAmC,EACzC,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,gBAAqB;IAKjD;;;OAGG;IACH,OAAO,CAAC,MAAM;IAed;;;OAGG;YACW,iBAAiB;IAc/B;;OAEG;IACU,MAAM,CACjB,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,IAAI,CAAC;KAChE,GACL,OAAO,CAAC,8BAA8B,CAAC;CAwC3C"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OA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,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,sBAAsB;YACxB,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACvB,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACpE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC7B,6EAA6E;oBAC7E,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { KeyVaultClient } from \"../../keyVaultClient.js\";\nimport type { GetKeyOptions, KeyVaultKey, RecoverDeletedKeyOptions } from \"../../keysModels.js\";\nimport { tracingClient } from \"../../tracing.js\";\nimport { getKeyFromKeyBundle } from \"../../transformations.js\";\nimport type { KeyVaultKeyPollOperationState } from \"../keyVaultKeyPoller.js\";\nimport { KeyVaultKeyPollOperation } from \"../keyVaultKeyPoller.js\";\n\n/**\n * An interface representing the state of a delete key's poll operation\n */\nexport interface RecoverDeletedKeyPollOperationState\n extends KeyVaultKeyPollOperationState<KeyVaultKey> {}\n\nexport class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(\n public state: RecoverDeletedKeyPollOperationState,\n private client: KeyVaultClient,\n private operationOptions: OperationOptions = {},\n ) {\n super(state, { cancelMessage: \"Canceling the recovery of a deleted key is not supported.\" });\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n */\n private getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeleteKeyPoller.getKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKey(\n name,\n updatedOptions?.version || \"\",\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Sends a request to recover a deleted Key Vault Key based on the given name.\n * Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.\n */\n private async recoverDeletedKey(\n name: string,\n options: RecoverDeletedKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeletedKeyPoller.recoverDeleteKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.recoverDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Reaches to the service and updates the delete key's poll operation.\n */\n public async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;\n } = {},\n ): Promise<RecoverDeletedKeyPollOperation> {\n const state = this.state;\n const { name } = state;\n\n const operationOptions = this.operationOptions;\n if (options.abortSignal) {\n operationOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch {\n // Nothing to do here.\n }\n if (!state.isCompleted) {\n state.result = await this.recoverDeletedKey(name, operationOptions);\n state.isStarted = true;\n }\n }\n\n if (!state.isCompleted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch (error: any) {\n if (error.statusCode === 403) {\n // At this point, the resource exists but the user doesn't have access to it.\n state.isCompleted = true;\n } else if (error.statusCode !== 404) {\n state.error = error;\n state.isCompleted = true;\n throw error;\n }\n }\n }\n\n return this;\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAOnE,MAAM,OAAO,8BAA+B,SAAQ,wBAGnD;IAEU;IACC;IACA;IAHV,YACS,KAA0C,EACzC,MAAsB,EACtB,mBAAqC,EAAE;QAE/C,KAAK,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,2DAA2D,EAAE,CAAC,CAAC;QAJtF,UAAK,GAAL,KAAK,CAAqC;QACzC,WAAM,GAAN,MAAM,CAAgB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAuB;IAGjD,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,IAAY,EAAE,UAAyB,EAAE;QACtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,+BA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AC;gBACvB,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACpE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC7B,6EAA6E;oBAC7E,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { KeyVaultClient } from \"../../keyVaultClient.js\";\nimport type { GetKeyOptions, KeyVaultKey, RecoverDeletedKeyOptions } from \"../../keysModels.js\";\nimport { tracingClient } from \"../../tracing.js\";\nimport { getKeyFromKeyBundle } from \"../../transformations.js\";\nimport type { KeyVaultKeyPollOperationState } from \"../keyVaultKeyPoller.js\";\nimport { KeyVaultKeyPollOperation } from \"../keyVaultKeyPoller.js\";\n\n/**\n * An interface representing the state of a delete key's poll operation\n */\nexport interface RecoverDeletedKeyPollOperationState extends KeyVaultKeyPollOperationState<KeyVaultKey> {}\n\nexport class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(\n public state: RecoverDeletedKeyPollOperationState,\n private client: KeyVaultClient,\n private operationOptions: OperationOptions = {},\n ) {\n super(state, { cancelMessage: \"Canceling the recovery of a deleted key is not supported.\" });\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n */\n private getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeleteKeyPoller.getKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKey(\n name,\n updatedOptions?.version || \"\",\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Sends a request to recover a deleted Key Vault Key based on the given name.\n * Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.\n */\n private async recoverDeletedKey(\n name: string,\n options: RecoverDeletedKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeletedKeyPoller.recoverDeleteKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.recoverDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Reaches to the service and updates the delete key's poll operation.\n */\n public async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;\n } = {},\n ): Promise<RecoverDeletedKeyPollOperation> {\n const state = this.state;\n const { name } = state;\n\n const operationOptions = this.operationOptions;\n if (options.abortSignal) {\n operationOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch {\n // Nothing to do here.\n }\n if (!state.isCompleted) {\n state.result = await this.recoverDeletedKey(name, operationOptions);\n state.isStarted = true;\n }\n }\n\n if (!state.isCompleted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch (error: any) {\n if (error.statusCode === 403) {\n // At this point, the resource exists but the user doesn't have access to it.\n state.isCompleted = true;\n } else if (error.statusCode !== 404) {\n state.error = error;\n state.isCompleted = true;\n throw error;\n }\n }\n }\n\n return this;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAiB,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAGhG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,mCACf,SAAQ,6BAA6B,CAAC,WAAW,CAAC;CAAG;AAEvD,qBAAa,8BAA+B,SAAQ,wBAAwB,CAC1E,mCAAmC,EACnC,WAAW,CACZ;IAEU,KAAK,EAAE,mCAAmC;IACjD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;gBAFjB,KAAK,EAAE,mCAAmC,EACzC,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,gBAAqB;IAKjD;;;OAGG;IACH,OAAO,CAAC,MAAM;IAed;;;OAGG;YACW,iBAAiB;IAc/B;;OAEG;IACU,MAAM,CACjB,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,IAAI,CAAC;KAChE,GACL,OAAO,CAAC,8BAA8B,CAAC;CAwC3C"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAiB,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAGhG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,mCAAoC,SAAQ,6BAA6B,CAAC,WAAW,CAAC;CAAG;AAE1G,qBAAa,8BAA+B,SAAQ,wBAAwB,CAC1E,mCAAmC,EACnC,WAAW,CACZ;IAEU,KAAK,EAAE,mCAAmC;IACjD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;gBAFjB,KAAK,EAAE,mCAAmC,EACzC,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,gBAAqB;IAKjD;;;OAGG;IACH,OAAO,CAAC,MAAM;IAed;;;OAGG;YACW,iBAAiB;IAc/B;;OAEG;IACU,MAAM,CACjB,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,IAAI,CAAC;KAChE,GACL,OAAO,CAAC,8BAA8B,CAAC;CAwC3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAMlC,iDAAiD;AACjD,iEAA+D;AAE/D,kEAAmE;AAQnE,MAAa,8BAA+B,SAAQ,+CAGnD;IAEU;IACC;IACA;IAHV,YACS,KAA0C,EACzC,M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C,WAAW,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,sBAAsB;YACxB,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACvB,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACpE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC7B,6EAA6E;oBAC7E,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjGD,wEAiGC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { KeyVaultClient } from \"../../keyVaultClient.js\";\nimport type { GetKeyOptions, KeyVaultKey, RecoverDeletedKeyOptions } from \"../../keysModels.js\";\nimport { tracingClient } from \"../../tracing.js\";\nimport { getKeyFromKeyBundle } from \"../../transformations.js\";\nimport type { KeyVaultKeyPollOperationState } from \"../keyVaultKeyPoller.js\";\nimport { KeyVaultKeyPollOperation } from \"../keyVaultKeyPoller.js\";\n\n/**\n * An interface representing the state of a delete key's poll operation\n */\nexport interface RecoverDeletedKeyPollOperationState\n extends KeyVaultKeyPollOperationState<KeyVaultKey> {}\n\nexport class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(\n public state: RecoverDeletedKeyPollOperationState,\n private client: KeyVaultClient,\n private operationOptions: OperationOptions = {},\n ) {\n super(state, { cancelMessage: \"Canceling the recovery of a deleted key is not supported.\" });\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n */\n private getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeleteKeyPoller.getKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKey(\n name,\n updatedOptions?.version || \"\",\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Sends a request to recover a deleted Key Vault Key based on the given name.\n * Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.\n */\n private async recoverDeletedKey(\n name: string,\n options: RecoverDeletedKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeletedKeyPoller.recoverDeleteKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.recoverDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Reaches to the service and updates the delete key's poll operation.\n */\n public async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;\n } = {},\n ): Promise<RecoverDeletedKeyPollOperation> {\n const state = this.state;\n const { name } = state;\n\n const operationOptions = this.operationOptions;\n if (options.abortSignal) {\n operationOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch {\n // Nothing to do here.\n }\n if (!state.isCompleted) {\n state.result = await this.recoverDeletedKey(name, operationOptions);\n state.isStarted = true;\n }\n }\n\n if (!state.isCompleted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch (error: any) {\n if (error.statusCode === 403) {\n // At this point, the resource exists but the user doesn't have access to it.\n state.isCompleted = true;\n } else if (error.statusCode !== 404) {\n state.error = error;\n state.isCompleted = true;\n throw error;\n }\n }\n }\n\n return this;\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAMlC,iDAAiD;AACjD,iEAA+D;AAE/D,kEAAmE;AAOnE,MAAa,8BAA+B,SAAQ,+CAGnD;IAEU;IACC;IACA;IAHV,YACS,KAA0C,EACzC,MAAsB,EACtB,mBAAqC,EAAE;QAE/C,KAAK,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,2DAA2D,EAAE,CAAC,CAAC;QAJtF,UAAK,GAAL,KAAK,CAAqC;QACzC,WAAM,GAAN,MAAM,CAAgB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAuB;IAGjD,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,IAAY,EAAE,UAAyB,EAAE;QACtD,OAAO,0BAAa,CAAC,QAAQ,CAC3B,+BAA+B,EAC/B,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACvC,IA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AK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC7B,6EAA6E;oBAC7E,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjGD,wEAiGC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { KeyVaultClient } from \"../../keyVaultClient.js\";\nimport type { GetKeyOptions, KeyVaultKey, RecoverDeletedKeyOptions } from \"../../keysModels.js\";\nimport { tracingClient } from \"../../tracing.js\";\nimport { getKeyFromKeyBundle } from \"../../transformations.js\";\nimport type { KeyVaultKeyPollOperationState } from \"../keyVaultKeyPoller.js\";\nimport { KeyVaultKeyPollOperation } from \"../keyVaultKeyPoller.js\";\n\n/**\n * An interface representing the state of a delete key's poll operation\n */\nexport interface RecoverDeletedKeyPollOperationState extends KeyVaultKeyPollOperationState<KeyVaultKey> {}\n\nexport class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(\n public state: RecoverDeletedKeyPollOperationState,\n private client: KeyVaultClient,\n private operationOptions: OperationOptions = {},\n ) {\n super(state, { cancelMessage: \"Canceling the recovery of a deleted key is not supported.\" });\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n */\n private getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeleteKeyPoller.getKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKey(\n name,\n updatedOptions?.version || \"\",\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Sends a request to recover a deleted Key Vault Key based on the given name.\n * Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.\n */\n private async recoverDeletedKey(\n name: string,\n options: RecoverDeletedKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeletedKeyPoller.recoverDeleteKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.recoverDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Reaches to the service and updates the delete key's poll operation.\n */\n public async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;\n } = {},\n ): Promise<RecoverDeletedKeyPollOperation> {\n const state = this.state;\n const { name } = state;\n\n const operationOptions = this.operationOptions;\n if (options.abortSignal) {\n operationOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch {\n // Nothing to do here.\n }\n if (!state.isCompleted) {\n state.result = await this.recoverDeletedKey(name, operationOptions);\n state.isStarted = true;\n }\n }\n\n if (!state.isCompleted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch (error: any) {\n if (error.statusCode === 403) {\n // At this point, the resource exists but the user doesn't have access to it.\n state.isCompleted = true;\n } else if (error.statusCode !== 404) {\n state.error = error;\n state.isCompleted = true;\n throw error;\n }\n }\n }\n\n return this;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAiB,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAGhG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,mCACf,SAAQ,6BAA6B,CAAC,WAAW,CAAC;CAAG;AAEvD,qBAAa,8BAA+B,SAAQ,wBAAwB,CAC1E,mCAAmC,EACnC,WAAW,CACZ;IAEU,KAAK,EAAE,mCAAmC;IACjD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;gBAFjB,KAAK,EAAE,mCAAmC,EACzC,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,gBAAqB;IAKjD;;;OAGG;IACH,OAAO,CAAC,MAAM;IAed;;;OAGG;YACW,iBAAiB;IAc/B;;OAEG;IACU,MAAM,CACjB,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,IAAI,CAAC;KAChE,GACL,OAAO,CAAC,8BAA8B,CAAC;CAwC3C"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE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AAO,CAAC,WAAW,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,sBAAsB;YACxB,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACvB,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACpE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC7B,6EAA6E;oBAC7E,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { KeyVaultClient } from \"../../keyVaultClient.js\";\nimport type { GetKeyOptions, KeyVaultKey, RecoverDeletedKeyOptions } from \"../../keysModels.js\";\nimport { tracingClient } from \"../../tracing.js\";\nimport { getKeyFromKeyBundle } from \"../../transformations.js\";\nimport type { KeyVaultKeyPollOperationState } from \"../keyVaultKeyPoller.js\";\nimport { KeyVaultKeyPollOperation } from \"../keyVaultKeyPoller.js\";\n\n/**\n * An interface representing the state of a delete key's poll operation\n */\nexport interface RecoverDeletedKeyPollOperationState\n extends KeyVaultKeyPollOperationState<KeyVaultKey> {}\n\nexport class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(\n public state: RecoverDeletedKeyPollOperationState,\n private client: KeyVaultClient,\n private operationOptions: OperationOptions = {},\n ) {\n super(state, { cancelMessage: \"Canceling the recovery of a deleted key is not supported.\" });\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n */\n private getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeleteKeyPoller.getKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKey(\n name,\n updatedOptions?.version || \"\",\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Sends a request to recover a deleted Key Vault Key based on the given name.\n * Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.\n */\n private async recoverDeletedKey(\n name: string,\n options: RecoverDeletedKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeletedKeyPoller.recoverDeleteKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.recoverDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Reaches to the service and updates the delete key's poll operation.\n */\n public async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;\n } = {},\n ): Promise<RecoverDeletedKeyPollOperation> {\n const state = this.state;\n const { name } = state;\n\n const operationOptions = this.operationOptions;\n if (options.abortSignal) {\n operationOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch {\n // Nothing to do here.\n }\n if (!state.isCompleted) {\n state.result = await this.recoverDeletedKey(name, operationOptions);\n state.isStarted = true;\n }\n }\n\n if (!state.isCompleted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch (error: any) {\n if (error.statusCode === 403) {\n // At this point, the resource exists but the user doesn't have access to it.\n state.isCompleted = true;\n } else if (error.statusCode !== 404) {\n state.error = error;\n state.isCompleted = true;\n throw error;\n }\n }\n }\n\n return this;\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAOnE,MAAM,OAAO,8BAA+B,SAAQ,wBAGnD;IAEU;IACC;IACA;IAHV,YACS,KAA0C,EACzC,MAAsB,EACtB,mBAAqC,EAAE;QAE/C,KAAK,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,2DAA2D,EAAE,CAAC,CAAC;QAJtF,UAAK,GAAL,KAAK,CAAqC;QACzC,WAAM,GAAN,MAAM,CAAgB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAuB;IAGjD,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,IAAY,EAAE,UAAyB,EAAE;QACtD,OAAO,aAAa,CAAC,QAAQ,CAC3B,+BAA+B,EAC/B,OA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K,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACpE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACzD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC7B,6EAA6E;oBAC7E,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { KeyVaultClient } from \"../../keyVaultClient.js\";\nimport type { GetKeyOptions, KeyVaultKey, RecoverDeletedKeyOptions } from \"../../keysModels.js\";\nimport { tracingClient } from \"../../tracing.js\";\nimport { getKeyFromKeyBundle } from \"../../transformations.js\";\nimport type { KeyVaultKeyPollOperationState } from \"../keyVaultKeyPoller.js\";\nimport { KeyVaultKeyPollOperation } from \"../keyVaultKeyPoller.js\";\n\n/**\n * An interface representing the state of a delete key's poll operation\n */\nexport interface RecoverDeletedKeyPollOperationState extends KeyVaultKeyPollOperationState<KeyVaultKey> {}\n\nexport class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(\n public state: RecoverDeletedKeyPollOperationState,\n private client: KeyVaultClient,\n private operationOptions: OperationOptions = {},\n ) {\n super(state, { cancelMessage: \"Canceling the recovery of a deleted key is not supported.\" });\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n */\n private getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeleteKeyPoller.getKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKey(\n name,\n updatedOptions?.version || \"\",\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Sends a request to recover a deleted Key Vault Key based on the given name.\n * Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.\n */\n private async recoverDeletedKey(\n name: string,\n options: RecoverDeletedKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"RecoverDeletedKeyPoller.recoverDeleteKey\",\n options,\n async (updatedOptions) => {\n const response = await this.client.recoverDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Reaches to the service and updates the delete key's poll operation.\n */\n public async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;\n } = {},\n ): Promise<RecoverDeletedKeyPollOperation> {\n const state = this.state;\n const { name } = state;\n\n const operationOptions = this.operationOptions;\n if (options.abortSignal) {\n operationOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch {\n // Nothing to do here.\n }\n if (!state.isCompleted) {\n state.result = await this.recoverDeletedKey(name, operationOptions);\n state.isStarted = true;\n }\n }\n\n if (!state.isCompleted) {\n try {\n state.result = await this.getKey(name, operationOptions);\n state.isCompleted = true;\n } catch (error: any) {\n if (error.statusCode === 403) {\n // At this point, the resource exists but the user doesn't have access to it.\n state.isCompleted = true;\n } else if (error.statusCode !== 404) {\n state.error = error;\n state.isCompleted = true;\n throw error;\n }\n }\n }\n\n return this;\n }\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure/keyvault-keys",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "4.10.2-alpha.20251128.1",
5
+ "version": "4.10.2-alpha.20251201.1",
6
6
  "license": "MIT",
7
7
  "description": "Isomorphic client library for Azure KeyVault's keys.",
8
8
  "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-keys/README.md",
@@ -82,10 +82,10 @@
82
82
  "typescript": "~5.9.3",
83
83
  "vitest": "^4.0.8",
84
84
  "@azure-tools/test-credential": "^2.1.2",
85
- "@azure-tools/test-utils-vitest": "^2.0.1",
86
- "@azure-tools/test-recorder": "^4.1.1",
87
85
  "@azure/dev-tool": "^1.0.0",
88
- "@azure/eslint-plugin-azure-sdk": "^3.0.0"
86
+ "@azure-tools/test-recorder": "^4.1.1",
87
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
88
+ "@azure-tools/test-utils-vitest": "^2.0.1"
89
89
  },
90
90
  "type": "module",
91
91
  "tshy": {