UNPKG

enterprise-basics

Version:

A utility library for enterprise applications. It streamlines common business tasks by providing functions to process delimited and Excel files, generate professional PDFs, and handle email communications with attachments.

43 lines (42 loc) 1.46 kB
import { z } from 'zod'; declare const validationSchema: z.ZodObject<{ storageConnectionString: z.ZodString; containerName: z.ZodString; path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; storageConnectionString: string; containerName: string; }, { path: string; storageConnectionString: string; containerName: string; }>; type GetParams = z.infer<typeof validationSchema>; /** * Downloads a blob from Azure Blob Storage. * **Note:** This function is intended for server-side use only due to the required connection string. * * @param {string} storageConnectionString - Azure Storage connection string * @param {string} containerName - Name of the blob container * @param {string} path - Path of the blob to download * * @returns {Promise<Buffer>} The blob content as a Buffer * * @throws {Error} * - If executed in a client-side browser environment * - If input validation fails * - If container is not found * - If blob download fails * * @example * // Server-side example * try { * const buffer = await getBlob(connectionString, 'my-container', 'path/to/file.txt'); * console.log('Download successful'); * } catch (error) { * console.error('Download failed:', error.message); * } */ export declare function getBlob(storageConnectionString: GetParams['storageConnectionString'], containerName: GetParams['containerName'], path: GetParams['path']): Promise<Buffer>; export {};