@qrvey/object-storage 1.0.3 → 1.0.4-539

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import stream, { Readable, PassThrough } from 'stream';
1
+ import stream, { Readable } from 'stream';
2
2
  import { BlobServiceClient, BlobSASPermissions } from '@azure/storage-blob';
3
3
  import { S3Client, S3, ListObjectsV2Command, HeadObjectCommand, GetObjectCommand, PutObjectCommand, DeleteObjectCommand, HeadBucketCommand, UploadPartCommand } from '@aws-sdk/client-s3';
4
4
  import { defaultProvider } from '@aws-sdk/credential-provider-node';
@@ -6,7 +6,6 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
6
6
  import { Upload } from '@aws-sdk/lib-storage';
7
7
  import { Agent, request as request$1 } from 'http';
8
8
  import { Agent as Agent$1, request } from 'https';
9
- import { Client } from 'basic-ftp';
10
9
 
11
10
  var __defProp = Object.defineProperty;
12
11
  var __defProps = Object.defineProperties;
@@ -32,13 +31,6 @@ var __spreadValues = (a, b) => {
32
31
  return a;
33
32
  };
34
33
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
35
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
36
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
37
- }) : x)(function(x) {
38
- if (typeof require !== "undefined")
39
- return require.apply(this, arguments);
40
- throw Error('Dynamic require of "' + x + '" is not supported');
41
- });
42
34
  var __objRest = (source, exclude) => {
43
35
  var target = {};
44
36
  for (var prop in source)
@@ -140,13 +132,12 @@ var BlobStorageService = class {
140
132
  * Retrieves the properties of a blob from the container by its name.
141
133
  *
142
134
  * @param {string} blobName - The name of the blob.
143
- * @param {ObjectStorageOptions} options - The options for the object storage service.
144
135
  * @return {Promise<GetObjectResponse>} A promise that resolves to the blob properties.
145
136
  */
146
- constructor(containerName, options) {
137
+ constructor(containerName) {
147
138
  this.containerName = containerName;
148
139
  this.blobServiceClient = BlobServiceClient.fromConnectionString(
149
- (options == null ? void 0 : options.connectionString) || process.env.AZURE_STORAGE_CONNECTION_STRING
140
+ process.env.AZURE_STORAGE_CONNECTION_STRING
150
141
  );
151
142
  }
152
143
  /**
@@ -566,10 +557,11 @@ var BlobStorageService = class {
566
557
  * Completes a multipart upload by committing the blocks to create the blob.
567
558
  *
568
559
  * @param {string} blobName - The name of the blob for which the multipart upload is being completed.
560
+ * @param {string} uploadId - The ID of the multipart upload to be completed.
569
561
  * @return {Promise<void>} A Promise that resolves when the multipart upload is successfully completed.
570
562
  * @throws {Error} If no block IDs are found in the metadata.
571
563
  */
572
- async completeMultipartUpload(blobName) {
564
+ async completeMultipartUpload(blobName, uploadId) {
573
565
  var _a;
574
566
  const containerClient = this.blobServiceClient.getContainerClient(
575
567
  this.containerName
@@ -1443,341 +1435,11 @@ var S3StorageService = class {
1443
1435
  return presignedUrl;
1444
1436
  }
1445
1437
  };
1446
- var SftpClient = __require("ssh2-sftp-client");
1447
- var SftpStorageService = class {
1448
- constructor(bucketName, options) {
1449
- this.bucketName = bucketName;
1450
- this.options = options || {};
1451
- this.client = new SftpClient();
1452
- }
1453
- async initializeClient() {
1454
- const host = this.options.host || process.env.SFTP_HOST;
1455
- const port = parseInt(
1456
- String(this.options.port || process.env.SFTP_PORT)
1457
- );
1458
- const user = this.options.user || process.env.SFTP_USER;
1459
- const password = this.options.password || process.env.SFTP_PASSWORD;
1460
- const privateKey = this.options.privateKey || process.env.SFTP_PRIVATE_KEY;
1461
- if (!password && !privateKey) {
1462
- throw new Error(
1463
- "Either password or private key must be provided for SFTP connection"
1464
- );
1465
- }
1466
- await this.client.connect({
1467
- host,
1468
- port,
1469
- username: user,
1470
- password,
1471
- privateKey,
1472
- readyTimeout: 4e3,
1473
- retries: 1,
1474
- retry_factor: 2,
1475
- retry_minTimeout: 2e3
1476
- });
1477
- }
1478
- async withClient(fn) {
1479
- try {
1480
- await this.initializeClient();
1481
- return await fn();
1482
- } finally {
1483
- await this.client.end().catch(() => {
1484
- });
1485
- }
1486
- }
1487
- async list(options) {
1488
- return this.withClient(async () => {
1489
- const prefix = options.prefix || "";
1490
- const path = this.bucketName + (prefix ? "/" + prefix : "");
1491
- const list = await this.client.list(path);
1492
- const items = list.map((item) => ({
1493
- key: item.name,
1494
- lastModified: item.modifyTime ? new Date(item.modifyTime) : /* @__PURE__ */ new Date(),
1495
- size: item.size,
1496
- eTag: ""
1497
- }));
1498
- return {
1499
- items,
1500
- pagination: null,
1501
- count: items.length
1502
- };
1503
- });
1504
- }
1505
- async ensureDirectoriesExist(remotePath) {
1506
- var _a, _b;
1507
- const parts = remotePath.split("/");
1508
- parts.pop();
1509
- let current = "";
1510
- for (const part of parts) {
1511
- if (!part)
1512
- continue;
1513
- current += `/${part}`;
1514
- try {
1515
- await this.client.stat(current);
1516
- } catch (err) {
1517
- const isNoEntry = err.code === "ENOENT" || ((_a = err.message) == null ? void 0 : _a.includes("No such file")) || ((_b = err.message) == null ? void 0 : _b.includes("does not exist"));
1518
- if (isNoEntry) {
1519
- try {
1520
- await this.client.mkdir(current);
1521
- } catch (mkdirErr) {
1522
- throw new Error(
1523
- `Failed to create directory ${current}: ${mkdirErr.message}`
1524
- );
1525
- }
1526
- } else {
1527
- throw new Error(
1528
- `Failed to check directory ${current}: ${err.message}`
1529
- );
1530
- }
1531
- }
1532
- }
1533
- }
1534
- async upload(key, body) {
1535
- return this.withClient(async () => {
1536
- let remotePath = `${this.bucketName}/${key}`;
1537
- remotePath = remotePath + "";
1538
- await this.ensureDirectoriesExist(remotePath);
1539
- if (body instanceof Readable) {
1540
- await this.client.put(body, remotePath);
1541
- } else if (body instanceof Buffer) {
1542
- await this.client.put(Buffer.from(body), remotePath);
1543
- } else {
1544
- await this.client.put(Buffer.from(String(body)), remotePath);
1545
- }
1546
- return { key };
1547
- });
1548
- }
1549
- async delete(key) {
1550
- return this.withClient(async () => {
1551
- await this.client.delete(`${this.bucketName}/${key}`);
1552
- return true;
1553
- });
1554
- }
1555
- async getObject(key) {
1556
- await this.initializeClient();
1557
- const remotePath = `${this.bucketName}/${key}`;
1558
- const stats = await this.client.stat(remotePath);
1559
- const data = await this.client.get(remotePath);
1560
- let stream3;
1561
- if (Buffer.isBuffer(data) || typeof data === "string") {
1562
- stream3 = Readable.from(data);
1563
- } else if (data instanceof Readable) {
1564
- stream3 = data;
1565
- } else {
1566
- throw new Error("Unsupported stream type returned by SFTP client");
1567
- }
1568
- const cleanup = async () => {
1569
- try {
1570
- await this.client.end();
1571
- } catch (e) {
1572
- }
1573
- };
1574
- stream3.on("end", cleanup);
1575
- stream3.on("error", cleanup);
1576
- return {
1577
- body: stream3,
1578
- contentLength: stats.size,
1579
- lastModified: stats.modifyTime ? new Date(stats.modifyTime) : /* @__PURE__ */ new Date(),
1580
- metadata: {}
1581
- };
1582
- }
1583
- listAll(options) {
1584
- throw new Error("Method not implemented.");
1585
- }
1586
- getHeadObject(key) {
1587
- throw new Error("Method not implemented.");
1588
- }
1589
- getDownloadUrl(key, expiresInMinutes) {
1590
- throw new Error("Method not implemented.");
1591
- }
1592
- getUploadUrl(key, expiresInMinutes) {
1593
- throw new Error("Method not implemented.");
1594
- }
1595
- createUploadWriteStream(key) {
1596
- throw new Error("Method not implemented.");
1597
- }
1598
- getHeadBucket() {
1599
- throw new Error("Method not implemented.");
1600
- }
1601
- generateUploadIdMultipart(key) {
1602
- throw new Error("Method not implemented.");
1603
- }
1604
- listMultipartUploadsForBucket() {
1605
- throw new Error("Method not implemented.");
1606
- }
1607
- listMultipartUploadsForKey(key, uploadId) {
1608
- throw new Error("Method not implemented.");
1609
- }
1610
- uploadMultipart(key, file, partNumber, uploadId) {
1611
- throw new Error("Method not implemented.");
1612
- }
1613
- completeMultipartUpload(key, uploadId) {
1614
- throw new Error("Method not implemented.");
1615
- }
1616
- abortMultipartUpload(key, uploadId) {
1617
- throw new Error("Method not implemented.");
1618
- }
1619
- getMultipartUploadPresignedUrl(key, uploadId, partNumber, expiresInMinutes) {
1620
- throw new Error("Method not implemented.");
1621
- }
1622
- };
1623
- var FtpStorageService = class {
1624
- constructor(bucketName, options) {
1625
- this.bucketName = bucketName;
1626
- this.options = options || {};
1627
- this.client = new Client();
1628
- }
1629
- listAll(options) {
1630
- throw new Error("Method not implemented.");
1631
- }
1632
- async initializeClient() {
1633
- var _a, _b, _c, _d, _e;
1634
- const host = ((_a = this == null ? void 0 : this.options) == null ? void 0 : _a.host) || process.env.FTP_HOST;
1635
- const port = parseInt(
1636
- String(((_b = this == null ? void 0 : this.options) == null ? void 0 : _b.port) || process.env.FTP_PORT),
1637
- 10
1638
- );
1639
- const user = ((_c = this == null ? void 0 : this.options) == null ? void 0 : _c.user) || process.env.FTP_USER;
1640
- const password = ((_d = this == null ? void 0 : this.options) == null ? void 0 : _d.password) || process.env.FTP_PASSWORD;
1641
- await this.client.access({
1642
- host,
1643
- port,
1644
- user,
1645
- password,
1646
- secure: ((_e = this == null ? void 0 : this.options) == null ? void 0 : _e.secure) || false
1647
- });
1648
- }
1649
- async withClient(fn) {
1650
- try {
1651
- await this.initializeClient();
1652
- return await fn();
1653
- } finally {
1654
- this.client.close();
1655
- }
1656
- }
1657
- async list(options) {
1658
- return this.withClient(async () => {
1659
- const prefix = options.prefix || "";
1660
- const path = `${this.bucketName}/${prefix}`;
1661
- try {
1662
- const list = await this.client.list(path);
1663
- const items = list.map(
1664
- (item) => ({
1665
- key: prefix + item.name,
1666
- lastModified: item.modifiedAt || /* @__PURE__ */ new Date(),
1667
- size: item.size,
1668
- eTag: ""
1669
- })
1670
- );
1671
- return {
1672
- items,
1673
- pagination: null,
1674
- count: items.length
1675
- };
1676
- } catch (e) {
1677
- return { items: [], pagination: null, count: 0 };
1678
- }
1679
- });
1680
- }
1681
- async getObject(key) {
1682
- await this.initializeClient();
1683
- const passThrough = new PassThrough();
1684
- const path = `${this.bucketName}/${key}`;
1685
- const stats = await this.client.size(path);
1686
- this.client.downloadTo(passThrough, path).then(() => passThrough.end()).catch((err) => passThrough.emit("error", err));
1687
- const cleanup = () => {
1688
- this.client.close();
1689
- };
1690
- passThrough.on("end", cleanup);
1691
- passThrough.on("error", cleanup);
1692
- return {
1693
- body: passThrough,
1694
- contentLength: stats,
1695
- lastModified: /* @__PURE__ */ new Date(),
1696
- metadata: {}
1697
- };
1698
- }
1699
- async upload(key, body) {
1700
- return this.withClient(async () => {
1701
- await this.client.cd("/");
1702
- try {
1703
- await this.client.cd(this.bucketName);
1704
- } catch (e) {
1705
- await this.client.send(`MKD ${this.bucketName}`);
1706
- await this.client.cd(this.bucketName);
1707
- }
1708
- const parts = key.split("/");
1709
- parts.pop();
1710
- for (const part of parts) {
1711
- if (!part)
1712
- continue;
1713
- try {
1714
- await this.client.cd(part);
1715
- } catch (e) {
1716
- await this.client.send(`MKD ${part}`);
1717
- await this.client.cd(part);
1718
- }
1719
- }
1720
- await this.client.cd("/");
1721
- const fullPath = `${this.bucketName}/${key}`;
1722
- const stream3 = body instanceof Readable ? body : Readable.from([body]);
1723
- await this.client.uploadFrom(stream3, fullPath);
1724
- return { key };
1725
- });
1726
- }
1727
- async delete(key) {
1728
- return this.withClient(async () => {
1729
- await this.client.remove(`${this.bucketName}/${key}`);
1730
- return true;
1731
- });
1732
- }
1733
- async close() {
1734
- this.client.close();
1735
- }
1736
- // Unsupported Operations
1737
- async getDownloadUrl(_key, _expiresInMinutes) {
1738
- throw new Error("FTP does not support pre-signed URLs");
1739
- }
1740
- async getUploadUrl(_key, _expiresInMinutes) {
1741
- throw new Error("FTP does not support pre-signed URLs");
1742
- }
1743
- async getHeadObject(_key) {
1744
- throw new Error("Operation not supported");
1745
- }
1746
- createUploadWriteStream(_key) {
1747
- throw new Error("Operation not supported");
1748
- }
1749
- async getHeadBucket() {
1750
- throw new Error("Operation not supported");
1751
- }
1752
- async generateUploadIdMultipart(_key) {
1753
- throw new Error("Multipart upload is not supported");
1754
- }
1755
- async listMultipartUploadsForBucket() {
1756
- throw new Error("Multipart upload is not supported");
1757
- }
1758
- async listMultipartUploadsForKey(_key, _uploadId) {
1759
- throw new Error("Multipart upload is not supported");
1760
- }
1761
- async uploadMultipart(_key, _file, _partNumber, _uploadId) {
1762
- throw new Error("Multipart upload is not supported");
1763
- }
1764
- async completeMultipartUpload(_key, _uploadId) {
1765
- throw new Error("Multipart upload is not supported");
1766
- }
1767
- async abortMultipartUpload(_key, _uploadId) {
1768
- throw new Error("Method not implemented.");
1769
- }
1770
- async getMultipartUploadPresignedUrl(_key, _uploadId, _partNumber, _expiresInMinutes) {
1771
- throw new Error("Multipart upload is not supported");
1772
- }
1773
- };
1774
1438
 
1775
1439
  // src/shared/utils/constants.ts
1776
1440
  var OBJECT_STORAGE_SERVICE_TYPES = {
1777
1441
  AWS_S3: "aws_s3",
1778
- AZURE_BLOB_STORAGE: "azure_blob_storage",
1779
- FTP: "ftp",
1780
- SFTP: "sftp"
1442
+ AZURE_BLOB_STORAGE: "azure_blob_storage"
1781
1443
  };
1782
1444
 
1783
1445
  // src/services/objectStorageFactory.service.ts
@@ -1789,11 +1451,7 @@ var ObjectStorageFactory = class {
1789
1451
  case OBJECT_STORAGE_SERVICE_TYPES.AWS_S3:
1790
1452
  return new S3StorageService(bucketName, options);
1791
1453
  case OBJECT_STORAGE_SERVICE_TYPES.AZURE_BLOB_STORAGE:
1792
- return new BlobStorageService(bucketName, options);
1793
- case OBJECT_STORAGE_SERVICE_TYPES.FTP:
1794
- return new FtpStorageService(bucketName, options);
1795
- case OBJECT_STORAGE_SERVICE_TYPES.SFTP:
1796
- return new SftpStorageService(bucketName, options);
1454
+ return new BlobStorageService(bucketName);
1797
1455
  default:
1798
1456
  throw new Error(
1799
1457
  `Unsupported object storage provider: ${provider}`
@@ -1819,13 +1477,11 @@ var ObjectStorageService = class _ObjectStorageService {
1819
1477
  *
1820
1478
  * @param {ListRequestOptions} options - The options to apply to the list operation.
1821
1479
  * @param {string} [bucketName] - The name of the bucket to list objects from. If not provided, the default bucket name will be used.
1822
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1823
1480
  * @return {Promise<ListResponse>} A promise that resolves to the list of objects.
1824
1481
  */
1825
- static async list(options, bucketName, objectStorageOptions) {
1482
+ static async list(options, bucketName) {
1826
1483
  return _ObjectStorageService.getObjectStorageServiceInstance(
1827
- bucketName,
1828
- objectStorageOptions
1484
+ bucketName
1829
1485
  ).then((instance) => instance.list(options));
1830
1486
  }
1831
1487
  /**
@@ -1833,13 +1489,11 @@ var ObjectStorageService = class _ObjectStorageService {
1833
1489
  *
1834
1490
  * @param {ListRequestOptions} options - The options to apply to the list operation.
1835
1491
  * @param {string} [bucketName] - The name of the bucket to list objects from. If not provided, the default bucket name will be used.
1836
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1837
1492
  * @return {Promise<ListResponse>} A promise that resolves to the list of all objects.
1838
1493
  */
1839
- static async listAll(options, bucketName, objectStorageOptions) {
1494
+ static async listAll(options, bucketName) {
1840
1495
  return _ObjectStorageService.getObjectStorageServiceInstance(
1841
- bucketName,
1842
- objectStorageOptions
1496
+ bucketName
1843
1497
  ).then((instance) => instance.listAll(options));
1844
1498
  }
1845
1499
  /**
@@ -1847,27 +1501,21 @@ var ObjectStorageService = class _ObjectStorageService {
1847
1501
  *
1848
1502
  * @param {string} key - The key of the object to retrieve.
1849
1503
  * @param {string} [bucketName] - The name of the bucket where the object is stored. If not provided, the default bucket name will be used.
1850
- * @param {IGetObjectOptions} [options] - The options to apply to the get operation.
1851
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1852
1504
  * @return {Promise<GetObjectResponse>} A promise that resolves to the retrieved object.
1853
1505
  */
1854
- static async getObject(key, bucketName, options, objectStorageOptions) {
1506
+ static async getObject(key, bucketName, options) {
1855
1507
  return _ObjectStorageService.getObjectStorageServiceInstance(
1856
- bucketName,
1857
- objectStorageOptions
1508
+ bucketName
1858
1509
  ).then((instance) => instance.getObject(key, options));
1859
1510
  }
1860
1511
  /**
1861
1512
  * Retrieves an object info (without file content) from the object storage service.
1862
1513
  * @param key - The key of the object to retrieve.
1863
- * @param bucketName - The name of the bucket where the object is stored. If not provided, the default bucket name will be used.
1864
- * @param objectStorageOptions - The options for the object storage service.
1865
1514
  * @returns A promise that resolves to the info of the file.
1866
1515
  */
1867
- static async getHeadObject(key, bucketName, objectStorageOptions) {
1516
+ static async getHeadObject(key, bucketName) {
1868
1517
  return _ObjectStorageService.getObjectStorageServiceInstance(
1869
- bucketName,
1870
- objectStorageOptions
1518
+ bucketName
1871
1519
  ).then((instance) => instance.getHeadObject(key));
1872
1520
  }
1873
1521
  /**
@@ -1876,13 +1524,11 @@ var ObjectStorageService = class _ObjectStorageService {
1876
1524
  * @param {string} key - The key of the object for which to generate the signed URL.
1877
1525
  * @param {number} expiresInMinutes - The number of minutes until the signed URL expires.
1878
1526
  * @param {string} [bucketName] - The name of the bucket where the object is stored. If not provided, the default bucket name will be used.
1879
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1880
1527
  * @return {Promise<string>} A promise that resolves to the generated signed URL.
1881
1528
  */
1882
- static async getDownloadUrl(key, expiresInMinutes, bucketName, objectStorageOptions) {
1529
+ static async getDownloadUrl(key, expiresInMinutes, bucketName) {
1883
1530
  return _ObjectStorageService.getObjectStorageServiceInstance(
1884
- bucketName,
1885
- objectStorageOptions
1531
+ bucketName
1886
1532
  ).then((instance) => instance.getDownloadUrl(key, expiresInMinutes));
1887
1533
  }
1888
1534
  /**
@@ -1891,13 +1537,11 @@ var ObjectStorageService = class _ObjectStorageService {
1891
1537
  * @param {string} key - The key of the object for which to generate the upload URL.
1892
1538
  * @param {number} expiresInMinutes - The number of minutes until the upload URL expires.
1893
1539
  * @param {string} [bucketName] - The name of the bucket where the object will be stored. If not provided, the default bucket name will be used.
1894
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1895
1540
  * @return {Promise<string>} A promise that resolves to the generated upload URL.
1896
1541
  */
1897
- static async getUploadUrl(key, expiresInMinutes, bucketName, objectStorageOptions) {
1542
+ static async getUploadUrl(key, expiresInMinutes, bucketName) {
1898
1543
  return _ObjectStorageService.getObjectStorageServiceInstance(
1899
- bucketName,
1900
- objectStorageOptions
1544
+ bucketName
1901
1545
  ).then((instance) => instance.getUploadUrl(key, expiresInMinutes));
1902
1546
  }
1903
1547
  /**
@@ -1907,13 +1551,11 @@ var ObjectStorageService = class _ObjectStorageService {
1907
1551
  * @param {FileContent} body - The content of the file to upload.
1908
1552
  * @param {Object} [metadata] - Optional metadata to associate with the object.
1909
1553
  * @param {string} [bucketName] - The name of the bucket where the object will be stored. If not provided, the default bucket name will be used.
1910
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1911
1554
  * @return {Promise<UploadResponse>} A promise that resolves to the response of the upload operation.
1912
1555
  */
1913
- static async upload(key, body, metadata, bucketName, objectStorageOptions) {
1556
+ static async upload(key, body, metadata, bucketName) {
1914
1557
  return _ObjectStorageService.getObjectStorageServiceInstance(
1915
- bucketName,
1916
- objectStorageOptions
1558
+ bucketName
1917
1559
  ).then((instance) => instance.upload(key, body, metadata));
1918
1560
  }
1919
1561
  /**
@@ -1921,13 +1563,11 @@ var ObjectStorageService = class _ObjectStorageService {
1921
1563
  *
1922
1564
  * @param {string} key - The key of the object to create the upload write stream for.
1923
1565
  * @param {string} [bucketName] - The name of the bucket where the object will be stored. If not provided, the default bucket name will be used.
1924
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1925
1566
  * @return {Promise<CreateUploadWriteStreamResponse>} A promise that resolves to the response of the upload operation.
1926
1567
  */
1927
- static async createUploadWriteStream(key, bucketName, objectStorageOptions) {
1568
+ static async createUploadWriteStream(key, bucketName) {
1928
1569
  return _ObjectStorageService.getObjectStorageServiceInstance(
1929
- bucketName,
1930
- objectStorageOptions
1570
+ bucketName
1931
1571
  ).then((instance) => instance.createUploadWriteStream(key));
1932
1572
  }
1933
1573
  /**
@@ -1935,13 +1575,11 @@ var ObjectStorageService = class _ObjectStorageService {
1935
1575
  *
1936
1576
  * @param {string | string[]} key - The key or array of keys of the objects to delete.
1937
1577
  * @param {string} [bucketName] - The name of the bucket where the objects are stored. If not provided, the default bucket name will be used.
1938
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1939
1578
  * @return {Promise<{ key: string; deleted: boolean; error?: string }[] | boolean>} A promise that resolves to an array of objects containing the key, deleted status, and an optional error message for each object deleted, or a boolean value indicating the success of the deletion.
1940
1579
  */
1941
- static async delete(key, bucketName, objectStorageOptions) {
1580
+ static async delete(key, bucketName) {
1942
1581
  return _ObjectStorageService.getObjectStorageServiceInstance(
1943
- bucketName,
1944
- objectStorageOptions
1582
+ bucketName
1945
1583
  ).then(async (instance) => {
1946
1584
  if (Array.isArray(key)) {
1947
1585
  const deleteBlobPromises = key.map(async (blobName) => {
@@ -1967,13 +1605,11 @@ var ObjectStorageService = class _ObjectStorageService {
1967
1605
  * Retrieves the head bucket from the object storage service.
1968
1606
  *
1969
1607
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1970
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1971
1608
  * @return {Promise<HeadBucketResponse>} A promise that resolves to the head bucket response.
1972
1609
  */
1973
- static async getHeadBucket(bucketName, objectStorageOptions) {
1610
+ static async getHeadBucket(bucketName) {
1974
1611
  return _ObjectStorageService.getObjectStorageServiceInstance(
1975
- bucketName,
1976
- objectStorageOptions
1612
+ bucketName
1977
1613
  ).then((instance) => instance.getHeadBucket());
1978
1614
  }
1979
1615
  /**
@@ -1981,13 +1617,11 @@ var ObjectStorageService = class _ObjectStorageService {
1981
1617
  *
1982
1618
  * @param {string} key - The key of the object to upload.
1983
1619
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1984
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1985
1620
  * @return {Promise<string>} A promise that resolves to the generated upload ID.
1986
1621
  */
1987
- static async generateUploadIdMultipart(key, bucketName, objectStorageOptions) {
1622
+ static async generateUploadIdMultipart(key, bucketName) {
1988
1623
  return _ObjectStorageService.getObjectStorageServiceInstance(
1989
- bucketName,
1990
- objectStorageOptions
1624
+ bucketName
1991
1625
  ).then((instance) => instance.generateUploadIdMultipart(key));
1992
1626
  }
1993
1627
  /**
@@ -1996,13 +1630,11 @@ var ObjectStorageService = class _ObjectStorageService {
1996
1630
  * @param {string} key - The key of the object to retrieve uploads for.
1997
1631
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1998
1632
  * @param {string} [uploadId] - The upload ID to filter the results by.
1999
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2000
1633
  * @return {Promise<ListPartsMultipartUploadResponse>} A promise that resolves to the list of multipart uploads for the specified key.
2001
1634
  */
2002
- static async listMultipartUploadsForKey(key, bucketName, uploadId, objectStorageOptions) {
1635
+ static async listMultipartUploadsForKey(key, bucketName, uploadId) {
2003
1636
  return _ObjectStorageService.getObjectStorageServiceInstance(
2004
- bucketName,
2005
- objectStorageOptions
1637
+ bucketName
2006
1638
  ).then(
2007
1639
  (instance) => instance.listMultipartUploadsForKey(key, uploadId)
2008
1640
  );
@@ -2011,13 +1643,11 @@ var ObjectStorageService = class _ObjectStorageService {
2011
1643
  * Retrieves a list of all multipart uploads for a specified bucket in the object storage service.
2012
1644
  *
2013
1645
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
2014
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2015
1646
  * @return {Promise<ListMultipartUploadsResponse>} A promise that resolves to the list of multipart uploads for the specified bucket.
2016
1647
  */
2017
- static async listMultipartUploadsForBucket(bucketName, objectStorageOptions) {
1648
+ static async listMultipartUploadsForBucket(bucketName) {
2018
1649
  return _ObjectStorageService.getObjectStorageServiceInstance(
2019
- bucketName,
2020
- objectStorageOptions
1650
+ bucketName
2021
1651
  ).then((instance) => instance.listMultipartUploadsForBucket());
2022
1652
  }
2023
1653
  /**
@@ -2028,13 +1658,11 @@ var ObjectStorageService = class _ObjectStorageService {
2028
1658
  * @param {number} partNumber - The number of the part being uploaded.
2029
1659
  * @param {string} [uploadId] - The ID of the multipart upload.
2030
1660
  * @param {string} [bucketName] - The name of the bucket to upload the file to. If not provided, the default bucket name will be used.
2031
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2032
1661
  * @return {Promise<string>} A Promise that resolves to the base64 encoded block ID of the uploaded part.
2033
1662
  */
2034
- static async uploadMultipart(key, file, partNumber, uploadId, bucketName, objectStorageOptions) {
1663
+ static async uploadMultipart(key, file, partNumber, uploadId, bucketName) {
2035
1664
  return _ObjectStorageService.getObjectStorageServiceInstance(
2036
- bucketName,
2037
- objectStorageOptions
1665
+ bucketName
2038
1666
  ).then(
2039
1667
  (instance) => instance.uploadMultipart(key, file, partNumber, uploadId)
2040
1668
  );
@@ -2045,13 +1673,11 @@ var ObjectStorageService = class _ObjectStorageService {
2045
1673
  * @param {string} key - The key of the object to complete the multipart upload for.
2046
1674
  * @param {string} uploadId - The ID of the multipart upload to complete.
2047
1675
  * @param {string} [bucketName] - The name of the bucket to complete the multipart upload in. If not provided, the default bucket name will be used.
2048
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2049
1676
  * @return {Promise<void>} A Promise that resolves when the multipart upload is completed.
2050
1677
  */
2051
- static async completeMultipartUpload(key, uploadId, bucketName, objectStorageOptions) {
1678
+ static async completeMultipartUpload(key, uploadId, bucketName) {
2052
1679
  return _ObjectStorageService.getObjectStorageServiceInstance(
2053
- bucketName,
2054
- objectStorageOptions
1680
+ bucketName
2055
1681
  ).then((instance) => instance.completeMultipartUpload(key, uploadId));
2056
1682
  }
2057
1683
  /**
@@ -2060,13 +1686,11 @@ var ObjectStorageService = class _ObjectStorageService {
2060
1686
  * @param {string} key - The key of the object to abort the multipart upload for.
2061
1687
  * @param {string} uploadId - The ID of the multipart upload to abort.
2062
1688
  * @param {string} [bucketName] - The name of the bucket to abort the multipart upload in. If not provided, the default bucket name will be used.
2063
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2064
1689
  * @return {Promise<void>} A Promise that resolves when the multipart upload is aborted.
2065
1690
  */
2066
- static async abortMultipartUpload(key, uploadId, bucketName, objectStorageOptions) {
1691
+ static async abortMultipartUpload(key, uploadId, bucketName) {
2067
1692
  return _ObjectStorageService.getObjectStorageServiceInstance(
2068
- bucketName,
2069
- objectStorageOptions
1693
+ bucketName
2070
1694
  ).then((instance) => instance.abortMultipartUpload(key, uploadId));
2071
1695
  }
2072
1696
  /**