UNPKG

@azure/storage-queue

Version:
81 lines (80 loc) 2.85 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 StorageClient_exports = {}; __export(StorageClient_exports, { StorageClient: () => StorageClient, getStorageClientContext: () => getStorageClientContext }); module.exports = __toCommonJS(StorageClient_exports); var import_StorageContextClient = require("./StorageContextClient.js"); var import_Pipeline = require("./Pipeline.js"); var import_utils_common = require("./utils/utils.common.js"); class StorageClient { /** * URL string value. */ url; accountName; /** * Request policy pipeline. * * @internal */ pipeline; /** * Credential factory in the pipeline to authenticate requests to the service, such as AnonymousCredential, StorageSharedKeyCredential. * Initialized to an AnonymousCredential if not able to retrieve it from the pipeline. * * @internal */ credential; /** * StorageClientContext is a reference to protocol layer operations entry, which is * generated by AutoRest generator. */ storageClientContext; /** * Creates an instance of StorageClient. * @param url - * @param pipeline - */ constructor(url, pipeline) { this.url = url; this.accountName = (0, import_utils_common.getAccountNameFromUrl)(url); this.pipeline = pipeline; this.storageClientContext = getStorageClientContext(this.url, this.pipeline); this.credential = (0, import_Pipeline.getCredentialFromPipeline)(pipeline); } } function getStorageClientContext(url, pipeline) { const pipelineOptions = pipeline.options; if (pipelineOptions.retryOptions === void 0) { pipelineOptions.retryOptions = { tryTimeoutInMs: 30 * 1e3 }; } else if (pipelineOptions.retryOptions.tryTimeoutInMs === void 0) { pipelineOptions.retryOptions.tryTimeoutInMs = 30 * 1e3; } return new import_StorageContextClient.StorageContextClient(url, (0, import_Pipeline.getCoreClientOptions)(pipeline)); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { StorageClient, getStorageClientContext }); //# sourceMappingURL=StorageClient.js.map