@@ -44,32 +44,32 @@ export class AzureBlobService {
4444 return AzureBlobService . instance ;
4545 }
4646
47- // Sube un objeto (JSON) al contenedor
47+ // Uploads an object (JSON) to the container
4848 async uploadObject ( key , body ) {
4949 const blockBlobClient = this . containerClient . getBlockBlobClient ( key ) ;
5050 const data = JSON . stringify ( body ) ;
5151 await blockBlobClient . upload ( data , Buffer . byteLength ( data ) ) ;
5252 }
5353
54- // Comprueba si existe un blob
54+ // Checks if a blob exists
5555 async exists ( key ) {
5656 const blobClient = this . containerClient . getBlobClient ( key ) ;
5757 return await blobClient . exists ( ) ;
5858 }
5959
60- // Obtiene las propiedades del blob (equivalente a headObject)
60+ // Gets the blob properties (equivalent to headObject)
6161 async headObject ( key ) {
6262 const blobClient = this . containerClient . getBlobClient ( key ) ;
6363 return await blobClient . getProperties ( ) ;
6464 }
6565
66- // Devuelve el tamaño del blob en bytes
66+ // Returns the blob size in bytes
6767 async getObjectSize ( key ) {
6868 const props = await this . headObject ( key ) ;
6969 return props . contentLength || 0 ;
7070 }
7171
72- // Descarga el blob completo o un rango, devolviendo el stream
72+ // Downloads the complete blob or a range, returning the stream
7373 async getObject ( key , range ) {
7474 const blobClient = this . containerClient . getBlobClient ( key ) ;
7575 let downloadResponse ;
@@ -86,7 +86,7 @@ export class AzureBlobService {
8686 return downloadResponse . readableStreamBody ;
8787 }
8888
89- // Genera un URL SAS válido 24 horas
89+ // Generates a valid SAS URL for 24 hours
9090 async getObjectUrl ( key ) {
9191 if ( ! AZURE_ACCOUNT_NAME || ! AZURE_ACCOUNT_KEY ) {
9292 throw new Error ( "Credenciales de cuenta de Azure no están definidas para generar SAS" ) ;
@@ -108,7 +108,7 @@ export class AzureBlobService {
108108 return `${ blobClient . url } ?${ sasToken } ` ;
109109 }
110110
111- // Obtiene el contenido JSON del blob
111+ // Gets the JSON content of the blob
112112 async getObjectAsJson ( key ) {
113113 const exists = await this . exists ( key ) ;
114114 if ( ! exists ) {
@@ -128,7 +128,7 @@ export class AzureBlobService {
128128 } ) ;
129129 }
130130
131- // Lista blobs bajo un prefijo y filtra por expresión regular
131+ // Lists blobs under a prefix and filters by regular expression
132132 async listObjects ( prefix , regex ) {
133133 const results = [ ] ;
134134 for await ( const blob of this . containerClient . listBlobsFlat ( { prefix } ) ) {
@@ -139,7 +139,7 @@ export class AzureBlobService {
139139 return results ;
140140 }
141141
142- // Elimina un blob
142+ // Deletes a blob
143143 async deleteObject ( key ) {
144144 const blobClient = this . containerClient . getBlobClient ( key ) ;
145145 await blobClient . delete ( ) ;
0 commit comments