Commit iniziale
This commit is contained in:
35
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.d.ts
generated
vendored
Normal file
35
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { AbortSignalLike } from "@azure/abort-controller";
|
||||
import { OperationOptions } from "@azure/core-client";
|
||||
import { KeyVaultClient } from "../../generated/keyVaultClient.js";
|
||||
import { DeletedKey } from "../../keysModels.js";
|
||||
import { KeyVaultKeyPollOperation, KeyVaultKeyPollOperationState } from "../keyVaultKeyPoller.js";
|
||||
/**
|
||||
* An interface representing the state of a delete key's poll operation
|
||||
*/
|
||||
export interface DeleteKeyPollOperationState extends KeyVaultKeyPollOperationState<DeletedKey> {
|
||||
}
|
||||
export declare class DeleteKeyPollOperation extends KeyVaultKeyPollOperation<DeleteKeyPollOperationState, DeletedKey> {
|
||||
state: DeleteKeyPollOperationState;
|
||||
private vaultUrl;
|
||||
private client;
|
||||
private operationOptions;
|
||||
constructor(state: DeleteKeyPollOperationState, vaultUrl: string, client: KeyVaultClient, operationOptions?: OperationOptions);
|
||||
/**
|
||||
* Sends a delete request for the given Key Vault Key's name to the Key Vault service.
|
||||
* Since the Key Vault Key won't be immediately deleted, we have {@link beginDeleteKey}.
|
||||
*/
|
||||
private deleteKey;
|
||||
/**
|
||||
* The getDeletedKey method returns the specified deleted key along with its properties.
|
||||
* This operation requires the keys/get permission.
|
||||
*/
|
||||
private getDeletedKey;
|
||||
/**
|
||||
* Reaches to the service and updates the delete key's poll operation.
|
||||
*/
|
||||
update(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
fireProgress?: (state: DeleteKeyPollOperationState) => void;
|
||||
}): Promise<DeleteKeyPollOperation>;
|
||||
}
|
||||
//# sourceMappingURL=operation.d.ts.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/delete/operation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAoB,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AAGzF,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAElG;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,6BAA6B,CAAC,UAAU,CAAC;CAAG;AAEjG,qBAAa,sBAAuB,SAAQ,wBAAwB,CAClE,2BAA2B,EAC3B,UAAU,CACX;IAEU,KAAK,EAAE,2BAA2B;IACzC,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;gBAHjB,KAAK,EAAE,2BAA2B,EACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,gBAAqB;IAKjD;;;OAGG;IACH,OAAO,CAAC,SAAS;IAOjB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACU,MAAM,CACjB,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;KACxD,GACL,OAAO,CAAC,sBAAsB,CAAC;CAmCnC"}
|
||||
71
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.js
generated
vendored
Normal file
71
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { tracingClient } from "../../tracing.js";
|
||||
import { getKeyFromKeyBundle } from "../../transformations.js";
|
||||
import { KeyVaultKeyPollOperation } from "../keyVaultKeyPoller.js";
|
||||
export class DeleteKeyPollOperation extends KeyVaultKeyPollOperation {
|
||||
constructor(state, vaultUrl, client, operationOptions = {}) {
|
||||
super(state, { cancelMessage: "Canceling the deletion of a key is not supported." });
|
||||
this.state = state;
|
||||
this.vaultUrl = vaultUrl;
|
||||
this.client = client;
|
||||
this.operationOptions = operationOptions;
|
||||
}
|
||||
/**
|
||||
* Sends a delete request for the given Key Vault Key's name to the Key Vault service.
|
||||
* Since the Key Vault Key won't be immediately deleted, we have {@link beginDeleteKey}.
|
||||
*/
|
||||
deleteKey(name, options = {}) {
|
||||
return tracingClient.withSpan("DeleteKeyPoller.deleteKey", options, async (updatedOptions) => {
|
||||
const response = await this.client.deleteKey(this.vaultUrl, name, updatedOptions);
|
||||
return getKeyFromKeyBundle(response);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* The getDeletedKey method returns the specified deleted key along with its properties.
|
||||
* This operation requires the keys/get permission.
|
||||
*/
|
||||
getDeletedKey(name, options = {}) {
|
||||
return tracingClient.withSpan("DeleteKeyPoller.getDeletedKey", options, async (updatedOptions) => {
|
||||
const response = await this.client.getDeletedKey(this.vaultUrl, name, updatedOptions);
|
||||
return getKeyFromKeyBundle(response);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Reaches to the service and updates the delete key's poll operation.
|
||||
*/
|
||||
async update(options = {}) {
|
||||
const state = this.state;
|
||||
const { name } = state;
|
||||
if (options.abortSignal) {
|
||||
this.operationOptions.abortSignal = options.abortSignal;
|
||||
}
|
||||
if (!state.isStarted) {
|
||||
const deletedKey = await this.deleteKey(name, this.operationOptions);
|
||||
state.isStarted = true;
|
||||
state.result = deletedKey;
|
||||
if (!deletedKey.properties.recoveryId) {
|
||||
state.isCompleted = true;
|
||||
}
|
||||
}
|
||||
if (!state.isCompleted) {
|
||||
try {
|
||||
state.result = await this.getDeletedKey(name, this.operationOptions);
|
||||
state.isCompleted = true;
|
||||
}
|
||||
catch (error) {
|
||||
if (error.statusCode === 403) {
|
||||
// At this point, the resource exists but the user doesn't have access to it.
|
||||
state.isCompleted = true;
|
||||
}
|
||||
else if (error.statusCode !== 404) {
|
||||
state.error = error;
|
||||
state.isCompleted = true;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=operation.js.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.js.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/operation.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.d.ts
generated
vendored
Normal file
10
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { DeleteKeyPollOperationState } from "./operation.js";
|
||||
import { DeletedKey } from "../../keysModels.js";
|
||||
import { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from "../keyVaultKeyPoller.js";
|
||||
/**
|
||||
* Class that creates a poller that waits until a key finishes being deleted.
|
||||
*/
|
||||
export declare class DeleteKeyPoller extends KeyVaultKeyPoller<DeleteKeyPollOperationState, DeletedKey> {
|
||||
constructor(options: KeyVaultKeyPollerOptions);
|
||||
}
|
||||
//# sourceMappingURL=poller.d.ts.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/delete/poller.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEtF;;GAEG;AACH,qBAAa,eAAgB,SAAQ,iBAAiB,CAAC,2BAA2B,EAAE,UAAU,CAAC;gBACjF,OAAO,EAAE,wBAAwB;CAuB9C"}
|
||||
20
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.js
generated
vendored
Normal file
20
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DeleteKeyPollOperation } from "./operation.js";
|
||||
import { KeyVaultKeyPoller } from "../keyVaultKeyPoller.js";
|
||||
/**
|
||||
* Class that creates a poller that waits until a key finishes being deleted.
|
||||
*/
|
||||
export class DeleteKeyPoller extends KeyVaultKeyPoller {
|
||||
constructor(options) {
|
||||
const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;
|
||||
let state;
|
||||
if (resumeFrom) {
|
||||
state = JSON.parse(resumeFrom).state;
|
||||
}
|
||||
const operation = new DeleteKeyPollOperation(Object.assign(Object.assign({}, state), { name }), vaultUrl, client, operationOptions);
|
||||
super(operation);
|
||||
this.intervalInMs = intervalInMs;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=poller.js.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.js.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/delete/poller.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../src/lro/delete/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,gBAAgB,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAA4B,MAAM,yBAAyB,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAA0D;IAC7F,YAAY,OAAiC;QAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE9F,IAAI,KAA8C,CAAC;QAEnD,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACvC,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,sBAAsB,iCAErC,KAAK,KACR,IAAI,KAEN,QAAQ,EACR,MAAM,EACN,gBAAgB,CACjB,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 { DeleteKeyPollOperation, DeleteKeyPollOperationState } from \"./operation.js\";\nimport { DeletedKey } from \"../../keysModels.js\";\nimport { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from \"../keyVaultKeyPoller.js\";\n\n/**\n * Class that creates a poller that waits until a key finishes being deleted.\n */\nexport class DeleteKeyPoller extends KeyVaultKeyPoller<DeleteKeyPollOperationState, DeletedKey> {\n constructor(options: KeyVaultKeyPollerOptions) {\n const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;\n\n let state: DeleteKeyPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new DeleteKeyPollOperation(\n {\n ...state,\n name,\n },\n vaultUrl,\n client,\n operationOptions,\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
|
||||
63
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.d.ts
generated
vendored
Normal file
63
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import { OperationOptions } from "@azure/core-client";
|
||||
import { Poller, PollOperation, PollOperationState } from "@azure/core-lro";
|
||||
import { KeyVaultClient } from "../generated/keyVaultClient.js";
|
||||
/**
|
||||
* Common parameters to a Key Vault Key Poller.
|
||||
*/
|
||||
export interface KeyVaultKeyPollerOptions {
|
||||
vaultUrl: string;
|
||||
client: KeyVaultClient;
|
||||
name: string;
|
||||
operationOptions?: OperationOptions;
|
||||
intervalInMs?: number;
|
||||
resumeFrom?: string;
|
||||
}
|
||||
/**
|
||||
* An interface representing the state of a Key Vault Key Poller's operation.
|
||||
*/
|
||||
export interface KeyVaultKeyPollOperationState<TResult> extends PollOperationState<TResult> {
|
||||
/**
|
||||
* The name of the key.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
/**
|
||||
* Common properties and methods of the Key Vault Key Pollers.
|
||||
*/
|
||||
export declare abstract class KeyVaultKeyPoller<TState extends KeyVaultKeyPollOperationState<TResult>, TResult> extends Poller<TState, TResult> {
|
||||
/**
|
||||
* Defines how much time the poller is going to wait before making a new request to the service.
|
||||
*/
|
||||
intervalInMs: number;
|
||||
/**
|
||||
* The method used by the poller to wait before attempting to update its operation.
|
||||
*/
|
||||
delay(): Promise<void>;
|
||||
}
|
||||
/**
|
||||
* Optional parameters to the KeyVaultKeyPollOperation
|
||||
*/
|
||||
export interface KeyVaultKeyPollOperationOptions {
|
||||
cancelMessage?: string;
|
||||
}
|
||||
/**
|
||||
* Common properties and methods of the Key Vault Key Poller operations.
|
||||
*/
|
||||
export declare class KeyVaultKeyPollOperation<TState, TResult> implements PollOperation<TState, TResult> {
|
||||
state: TState;
|
||||
private cancelMessage;
|
||||
constructor(state: TState, options?: KeyVaultKeyPollOperationOptions);
|
||||
/**
|
||||
* Meant to reach to the service and update the Poller operation.
|
||||
*/
|
||||
update(): Promise<PollOperation<TState, TResult>>;
|
||||
/**
|
||||
* Meant to reach to the service and cancel the Poller operation.
|
||||
*/
|
||||
cancel(): Promise<PollOperation<TState, TResult>>;
|
||||
/**
|
||||
* Serializes the Poller operation.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
//# sourceMappingURL=keyVaultKeyPoller.d.ts.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"keyVaultKeyPoller.d.ts","sourceRoot":"","sources":["../../../src/lro/keyVaultKeyPoller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B,CAAC,OAAO,CAAE,SAAQ,kBAAkB,CAAC,OAAO,CAAC;IACzF;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,8BAAsB,iBAAiB,CACrC,MAAM,SAAS,6BAA6B,CAAC,OAAO,CAAC,EACrD,OAAO,CACP,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACI,YAAY,EAAE,MAAM,CAAQ;IAEnC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,wBAAwB,CAAC,MAAM,EAAE,OAAO,CAAE,YAAW,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC;IAIrF,KAAK,EAAE,MAAM;IAHtB,OAAO,CAAC,aAAa,CAAc;gBAG1B,KAAK,EAAE,MAAM,EACpB,OAAO,GAAE,+BAAoC;IAO/C;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI9D;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI9D;;OAEG;IACI,QAAQ,IAAI,MAAM;CAK1B"}
|
||||
55
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.js
generated
vendored
Normal file
55
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { delay } from "@azure/core-util";
|
||||
import { Poller } from "@azure/core-lro";
|
||||
/**
|
||||
* Common properties and methods of the Key Vault Key Pollers.
|
||||
*/
|
||||
export class KeyVaultKeyPoller extends Poller {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
/**
|
||||
* Defines how much time the poller is going to wait before making a new request to the service.
|
||||
*/
|
||||
this.intervalInMs = 2000;
|
||||
}
|
||||
/**
|
||||
* The method used by the poller to wait before attempting to update its operation.
|
||||
*/
|
||||
async delay() {
|
||||
return delay(this.intervalInMs);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Common properties and methods of the Key Vault Key Poller operations.
|
||||
*/
|
||||
export class KeyVaultKeyPollOperation {
|
||||
constructor(state, options = {}) {
|
||||
this.state = state;
|
||||
this.cancelMessage = "";
|
||||
if (options.cancelMessage) {
|
||||
this.cancelMessage = options.cancelMessage;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Meant to reach to the service and update the Poller operation.
|
||||
*/
|
||||
async update() {
|
||||
throw new Error("Operation not supported.");
|
||||
}
|
||||
/**
|
||||
* Meant to reach to the service and cancel the Poller operation.
|
||||
*/
|
||||
async cancel() {
|
||||
throw new Error(this.cancelMessage);
|
||||
}
|
||||
/**
|
||||
* Serializes the Poller operation.
|
||||
*/
|
||||
toString() {
|
||||
return JSON.stringify({
|
||||
state: this.state,
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=keyVaultKeyPoller.js.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.js.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/keyVaultKeyPoller.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"keyVaultKeyPoller.js","sourceRoot":"","sources":["../../../src/lro/keyVaultKeyPoller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAqC,MAAM,iBAAiB,CAAC;AAyB5E;;GAEG;AACH,MAAM,OAAgB,iBAGpB,SAAQ,MAAuB;IAHjC;;QAIE;;WAEG;QACI,iBAAY,GAAW,IAAI,CAAC;IAQrC,CAAC;IANC;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;CACF;AASD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAGnC,YACS,KAAa,EACpB,UAA2C,EAAE;QADtC,UAAK,GAAL,KAAK,CAAQ;QAHd,kBAAa,GAAW,EAAE,CAAC;QAMjC,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC7C,CAAC;IACH,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,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure/core-client\";\nimport { delay } from \"@azure/core-util\";\nimport { Poller, PollOperation, PollOperationState } from \"@azure/core-lro\";\nimport { KeyVaultClient } from \"../generated/keyVaultClient.js\";\n\n/**\n * Common parameters to a Key Vault Key Poller.\n */\nexport interface KeyVaultKeyPollerOptions {\n vaultUrl: string;\n client: KeyVaultClient;\n name: string;\n operationOptions?: OperationOptions;\n intervalInMs?: number;\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the state of a Key Vault Key Poller's operation.\n */\nexport interface KeyVaultKeyPollOperationState<TResult> extends PollOperationState<TResult> {\n /**\n * The name of the key.\n */\n name: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Key Pollers.\n */\nexport abstract class KeyVaultKeyPoller<\n TState extends KeyVaultKeyPollOperationState<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 delay(this.intervalInMs);\n }\n}\n\n/**\n * Optional parameters to the KeyVaultKeyPollOperation\n */\nexport interface KeyVaultKeyPollOperationOptions {\n cancelMessage?: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Key Poller operations.\n */\nexport class KeyVaultKeyPollOperation<TState, TResult> implements PollOperation<TState, TResult> {\n private cancelMessage: string = \"\";\n\n constructor(\n public state: TState,\n options: KeyVaultKeyPollOperationOptions = {},\n ) {\n if (options.cancelMessage) {\n this.cancelMessage = options.cancelMessage;\n }\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: this.state,\n });\n }\n}\n"]}
|
||||
35
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.d.ts
generated
vendored
Normal file
35
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { AbortSignalLike } from "@azure/abort-controller";
|
||||
import { OperationOptions } from "@azure/core-client";
|
||||
import { KeyVaultClient } from "../../generated/keyVaultClient.js";
|
||||
import { KeyVaultKey } from "../../keysModels.js";
|
||||
import { KeyVaultKeyPollOperation, KeyVaultKeyPollOperationState } from "../keyVaultKeyPoller.js";
|
||||
/**
|
||||
* An interface representing the state of a delete key's poll operation
|
||||
*/
|
||||
export interface RecoverDeletedKeyPollOperationState extends KeyVaultKeyPollOperationState<KeyVaultKey> {
|
||||
}
|
||||
export declare class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation<RecoverDeletedKeyPollOperationState, KeyVaultKey> {
|
||||
state: RecoverDeletedKeyPollOperationState;
|
||||
private vaultUrl;
|
||||
private client;
|
||||
private operationOptions;
|
||||
constructor(state: RecoverDeletedKeyPollOperationState, vaultUrl: string, client: KeyVaultClient, operationOptions?: OperationOptions);
|
||||
/**
|
||||
* The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.
|
||||
* This operation requires the keys/get permission.
|
||||
*/
|
||||
private getKey;
|
||||
/**
|
||||
* Sends a request to recover a deleted Key Vault Key based on the given name.
|
||||
* Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.
|
||||
*/
|
||||
private recoverDeletedKey;
|
||||
/**
|
||||
* Reaches to the service and updates the delete key's poll operation.
|
||||
*/
|
||||
update(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
fireProgress?: (state: RecoverDeletedKeyPollOperationState) => void;
|
||||
}): Promise<RecoverDeletedKeyPollOperation>;
|
||||
}
|
||||
//# sourceMappingURL=operation.d.ts.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/operation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAiB,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAG3F,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAElG;;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,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;gBAHjB,KAAK,EAAE,mCAAmC,EACzC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,gBAAqB;IAKjD;;;OAGG;IACH,OAAO,CAAC,MAAM;IAgBd;;;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"}
|
||||
77
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.js
generated
vendored
Normal file
77
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { tracingClient } from "../../tracing.js";
|
||||
import { getKeyFromKeyBundle } from "../../transformations.js";
|
||||
import { KeyVaultKeyPollOperation } from "../keyVaultKeyPoller.js";
|
||||
export class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation {
|
||||
constructor(state, vaultUrl, client, operationOptions = {}) {
|
||||
super(state, { cancelMessage: "Canceling the recovery of a deleted key is not supported." });
|
||||
this.state = state;
|
||||
this.vaultUrl = vaultUrl;
|
||||
this.client = client;
|
||||
this.operationOptions = operationOptions;
|
||||
}
|
||||
/**
|
||||
* The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.
|
||||
* This operation requires the keys/get permission.
|
||||
*/
|
||||
getKey(name, options = {}) {
|
||||
return tracingClient.withSpan("RecoverDeleteKeyPoller.getKey", options, async (updatedOptions) => {
|
||||
const response = await this.client.getKey(this.vaultUrl, name, (updatedOptions === null || updatedOptions === void 0 ? void 0 : updatedOptions.version) || "", updatedOptions);
|
||||
return getKeyFromKeyBundle(response);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Sends a request to recover a deleted Key Vault Key based on the given name.
|
||||
* Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.
|
||||
*/
|
||||
async recoverDeletedKey(name, options = {}) {
|
||||
return tracingClient.withSpan("RecoverDeletedKeyPoller.recoverDeleteKey", options, async (updatedOptions) => {
|
||||
const response = await this.client.recoverDeletedKey(this.vaultUrl, name, updatedOptions);
|
||||
return getKeyFromKeyBundle(response);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Reaches to the service and updates the delete key's poll operation.
|
||||
*/
|
||||
async update(options = {}) {
|
||||
const state = this.state;
|
||||
const { name } = state;
|
||||
const operationOptions = this.operationOptions;
|
||||
if (options.abortSignal) {
|
||||
operationOptions.abortSignal = options.abortSignal;
|
||||
}
|
||||
if (!state.isStarted) {
|
||||
try {
|
||||
state.result = await this.getKey(name, operationOptions);
|
||||
state.isCompleted = true;
|
||||
}
|
||||
catch (_a) {
|
||||
// Nothing to do here.
|
||||
}
|
||||
if (!state.isCompleted) {
|
||||
state.result = await this.recoverDeletedKey(name, operationOptions);
|
||||
state.isStarted = true;
|
||||
}
|
||||
}
|
||||
if (!state.isCompleted) {
|
||||
try {
|
||||
state.result = await this.getKey(name, operationOptions);
|
||||
state.isCompleted = true;
|
||||
}
|
||||
catch (error) {
|
||||
if (error.statusCode === 403) {
|
||||
// At this point, the resource exists but the user doesn't have access to it.
|
||||
state.isCompleted = true;
|
||||
}
|
||||
else if (error.statusCode !== 404) {
|
||||
state.error = error;
|
||||
state.isCompleted = true;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=operation.js.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.js.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/operation.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.d.ts
generated
vendored
Normal file
10
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { RecoverDeletedKeyPollOperationState } from "./operation.js";
|
||||
import { KeyVaultKey } from "../../keysModels.js";
|
||||
import { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from "../keyVaultKeyPoller.js";
|
||||
/**
|
||||
* Class that deletes a poller that waits until a key finishes being deleted
|
||||
*/
|
||||
export declare class RecoverDeletedKeyPoller extends KeyVaultKeyPoller<RecoverDeletedKeyPollOperationState, KeyVaultKey> {
|
||||
constructor(options: KeyVaultKeyPollerOptions);
|
||||
}
|
||||
//# sourceMappingURL=poller.d.ts.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"poller.d.ts","sourceRoot":"","sources":["../../../../src/lro/recover/poller.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,mCAAmC,EACpC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEtF;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB,CAC5D,mCAAmC,EACnC,WAAW,CACZ;gBACa,OAAO,EAAE,wBAAwB;CAuB9C"}
|
||||
20
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.js
generated
vendored
Normal file
20
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { RecoverDeletedKeyPollOperation, } from "./operation.js";
|
||||
import { KeyVaultKeyPoller } from "../keyVaultKeyPoller.js";
|
||||
/**
|
||||
* Class that deletes a poller that waits until a key finishes being deleted
|
||||
*/
|
||||
export class RecoverDeletedKeyPoller extends KeyVaultKeyPoller {
|
||||
constructor(options) {
|
||||
const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;
|
||||
let state;
|
||||
if (resumeFrom) {
|
||||
state = JSON.parse(resumeFrom).state;
|
||||
}
|
||||
const operation = new RecoverDeletedKeyPollOperation(Object.assign(Object.assign({}, state), { name }), vaultUrl, client, operationOptions);
|
||||
super(operation);
|
||||
this.intervalInMs = intervalInMs;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=poller.js.map
|
||||
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.js.map
generated
vendored
Normal file
1
node_modules/@azure/keyvault-keys/dist/browser/lro/recover/poller.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../src/lro/recover/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,GAE/B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAA4B,MAAM,yBAAyB,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAG5C;IACC,YAAY,OAAiC;QAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE9F,IAAI,KAAsD,CAAC;QAE3D,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACvC,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,8BAA8B,iCAE7C,KAAK,KACR,IAAI,KAEN,QAAQ,EACR,MAAM,EACN,gBAAgB,CACjB,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 {\n RecoverDeletedKeyPollOperation,\n RecoverDeletedKeyPollOperationState,\n} from \"./operation.js\";\nimport { KeyVaultKey } from \"../../keysModels.js\";\nimport { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from \"../keyVaultKeyPoller.js\";\n\n/**\n * Class that deletes a poller that waits until a key finishes being deleted\n */\nexport class RecoverDeletedKeyPoller extends KeyVaultKeyPoller<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(options: KeyVaultKeyPollerOptions) {\n const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;\n\n let state: RecoverDeletedKeyPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new RecoverDeletedKeyPollOperation(\n {\n ...state,\n name,\n },\n vaultUrl,\n client,\n operationOptions,\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
|
||||
Reference in New Issue
Block a user