UNPKG

@azure/keyvault-secrets

Version:
76 lines (75 loc) 2.58 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var keyVaultSecretPoller_exports = {}; __export(keyVaultSecretPoller_exports, { KeyVaultSecretPollOperation: () => KeyVaultSecretPollOperation, KeyVaultSecretPoller: () => KeyVaultSecretPoller }); module.exports = __toCommonJS(keyVaultSecretPoller_exports); var import_core_lro = require("@azure/core-lro"); var import_core_util = require("@azure/core-util"); class KeyVaultSecretPoller extends import_core_lro.Poller { /** * Defines how much time the poller is going to wait before making a new request to the service. */ intervalInMs = 2e3; /** * The method used by the poller to wait before attempting to update its operation. */ async delay() { return (0, import_core_util.delay)(this.intervalInMs); } } class KeyVaultSecretPollOperation { constructor(state, options = {}) { this.state = state; if (options.cancelMessage) { this.cancelMessage = options.cancelMessage; } } state; cancelMessage = ""; /** * Meant to reach to the service and update the Poller operation. * @param options - The optional parameters, which is only an abortSignal from \@azure/abort-controller */ async update() { throw new Error("Operation not supported."); } /** * Meant to reach to the service and cancel the Poller operation. * @param options - The optional parameters, which is only an abortSignal from \@azure/abort-controller */ async cancel() { throw new Error(this.cancelMessage); } /** * Serializes the Poller operation. */ toString() { return JSON.stringify({ state: this.state }); } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { KeyVaultSecretPollOperation, KeyVaultSecretPoller }); //# sourceMappingURL=keyVaultSecretPoller.js.map