MCPcopy Index your code
hub / github.com/simstudioai/sim / abortMultipartUpload

Function abortMultipartUpload

apps/sim/lib/uploads/providers/blob/client.ts:748–782  ·  view source on GitHub ↗
(key: string, customConfig?: BlobConfig)

Source from the content-addressed store, hash-verified

746 * Abort multipart upload by deleting the blob if it exists
747 */
748export async function abortMultipartUpload(key: string, customConfig?: BlobConfig): Promise<void> {
749 const { BlobServiceClient, StorageSharedKeyCredential } = await import('@azure/storage-blob')
750 let blobServiceClient: BlobServiceClientType
751 let containerName: string
752
753 if (customConfig) {
754 if (customConfig.connectionString) {
755 blobServiceClient = BlobServiceClient.fromConnectionString(customConfig.connectionString)
756 } else if (customConfig.accountName && customConfig.accountKey) {
757 const credential = new StorageSharedKeyCredential(
758 customConfig.accountName,
759 customConfig.accountKey
760 )
761 blobServiceClient = new BlobServiceClient(
762 `https://${customConfig.accountName}.blob.core.windows.net`,
763 credential
764 )
765 } else {
766 throw new Error('Invalid custom blob configuration')
767 }
768 containerName = customConfig.containerName
769 } else {
770 blobServiceClient = await getBlobServiceClient()
771 containerName = BLOB_CONFIG.containerName
772 }
773
774 const containerClient = blobServiceClient.getContainerClient(containerName)
775 const blockBlobClient = containerClient.getBlockBlobClient(key)
776
777 try {
778 await blockBlobClient.deleteIfExists()
779 } catch (error) {
780 logger.warn('Error cleaning up multipart upload:', error)
781 }
782}

Callers 2

createBlobBackendFunction · 0.85
route.tsFile · 0.85

Calls 2

getBlobServiceClientFunction · 0.85
warnMethod · 0.65

Tested by

no test coverage detected