@qrvey/object-storage 1.0.3-beta → 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,310 +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 upload(key, body) {
1506
- return this.withClient(async () => {
1507
- const remotePath = `${this.bucketName}/${key}`;
1508
- if (body instanceof Readable) {
1509
- await this.client.put(body, remotePath);
1510
- } else if (body instanceof Buffer) {
1511
- await this.client.put(Buffer.from(body), remotePath);
1512
- } else {
1513
- await this.client.put(Buffer.from(String(body)), remotePath);
1514
- }
1515
- return { key };
1516
- });
1517
- }
1518
- async delete(key) {
1519
- return this.withClient(async () => {
1520
- await this.client.delete(`${this.bucketName}/${key}`);
1521
- return true;
1522
- });
1523
- }
1524
- async getObject(key) {
1525
- await this.initializeClient();
1526
- const remotePath = `${this.bucketName}/${key}`;
1527
- const stats = await this.client.stat(remotePath);
1528
- const data = await this.client.get(remotePath);
1529
- let stream3;
1530
- if (Buffer.isBuffer(data) || typeof data === "string") {
1531
- stream3 = Readable.from(data);
1532
- } else if (data instanceof Readable) {
1533
- stream3 = data;
1534
- } else {
1535
- throw new Error("Unsupported stream type returned by SFTP client");
1536
- }
1537
- const cleanup = async () => {
1538
- try {
1539
- await this.client.end();
1540
- } catch (e) {
1541
- }
1542
- };
1543
- stream3.on("end", cleanup);
1544
- stream3.on("error", cleanup);
1545
- return {
1546
- body: stream3,
1547
- contentLength: stats.size,
1548
- lastModified: stats.modifyTime ? new Date(stats.modifyTime) : /* @__PURE__ */ new Date(),
1549
- metadata: {}
1550
- };
1551
- }
1552
- listAll(options) {
1553
- throw new Error("Method not implemented.");
1554
- }
1555
- getHeadObject(key) {
1556
- throw new Error("Method not implemented.");
1557
- }
1558
- getDownloadUrl(key, expiresInMinutes) {
1559
- throw new Error("Method not implemented.");
1560
- }
1561
- getUploadUrl(key, expiresInMinutes) {
1562
- throw new Error("Method not implemented.");
1563
- }
1564
- createUploadWriteStream(key) {
1565
- throw new Error("Method not implemented.");
1566
- }
1567
- getHeadBucket() {
1568
- throw new Error("Method not implemented.");
1569
- }
1570
- generateUploadIdMultipart(key) {
1571
- throw new Error("Method not implemented.");
1572
- }
1573
- listMultipartUploadsForBucket() {
1574
- throw new Error("Method not implemented.");
1575
- }
1576
- listMultipartUploadsForKey(key, uploadId) {
1577
- throw new Error("Method not implemented.");
1578
- }
1579
- uploadMultipart(key, file, partNumber, uploadId) {
1580
- throw new Error("Method not implemented.");
1581
- }
1582
- completeMultipartUpload(key, uploadId) {
1583
- throw new Error("Method not implemented.");
1584
- }
1585
- abortMultipartUpload(key, uploadId) {
1586
- throw new Error("Method not implemented.");
1587
- }
1588
- getMultipartUploadPresignedUrl(key, uploadId, partNumber, expiresInMinutes) {
1589
- throw new Error("Method not implemented.");
1590
- }
1591
- };
1592
- var FtpStorageService = class {
1593
- constructor(bucketName, options) {
1594
- this.bucketName = bucketName;
1595
- this.options = options || {};
1596
- this.client = new Client();
1597
- }
1598
- listAll(options) {
1599
- throw new Error("Method not implemented.");
1600
- }
1601
- async initializeClient() {
1602
- var _a, _b, _c, _d, _e;
1603
- const host = ((_a = this == null ? void 0 : this.options) == null ? void 0 : _a.host) || process.env.FTP_HOST;
1604
- const port = parseInt(
1605
- String(((_b = this == null ? void 0 : this.options) == null ? void 0 : _b.port) || process.env.FTP_PORT),
1606
- 10
1607
- );
1608
- const user = ((_c = this == null ? void 0 : this.options) == null ? void 0 : _c.user) || process.env.FTP_USER;
1609
- const password = ((_d = this == null ? void 0 : this.options) == null ? void 0 : _d.password) || process.env.FTP_PASSWORD;
1610
- await this.client.access({
1611
- host,
1612
- port,
1613
- user,
1614
- password,
1615
- secure: ((_e = this == null ? void 0 : this.options) == null ? void 0 : _e.secure) || false
1616
- });
1617
- }
1618
- async withClient(fn) {
1619
- try {
1620
- await this.initializeClient();
1621
- return await fn();
1622
- } finally {
1623
- this.client.close();
1624
- }
1625
- }
1626
- async list(options) {
1627
- return this.withClient(async () => {
1628
- const prefix = options.prefix || "";
1629
- const path = `${this.bucketName}/${prefix}`;
1630
- try {
1631
- const list = await this.client.list(path);
1632
- const items = list.map(
1633
- (item) => ({
1634
- key: prefix + item.name,
1635
- lastModified: item.modifiedAt || /* @__PURE__ */ new Date(),
1636
- size: item.size,
1637
- eTag: ""
1638
- })
1639
- );
1640
- return {
1641
- items,
1642
- pagination: null,
1643
- count: items.length
1644
- };
1645
- } catch (e) {
1646
- return { items: [], pagination: null, count: 0 };
1647
- }
1648
- });
1649
- }
1650
- async getObject(key) {
1651
- await this.initializeClient();
1652
- const passThrough = new PassThrough();
1653
- const path = `${this.bucketName}/${key}`;
1654
- const stats = await this.client.size(path);
1655
- this.client.downloadTo(passThrough, path).then(() => passThrough.end()).catch((err) => passThrough.emit("error", err));
1656
- const cleanup = () => {
1657
- this.client.close();
1658
- };
1659
- passThrough.on("end", cleanup);
1660
- passThrough.on("error", cleanup);
1661
- return {
1662
- body: passThrough,
1663
- contentLength: stats,
1664
- lastModified: /* @__PURE__ */ new Date(),
1665
- metadata: {}
1666
- };
1667
- }
1668
- async upload(key, body) {
1669
- return this.withClient(async () => {
1670
- await this.client.cd("/");
1671
- try {
1672
- await this.client.cd(this.bucketName);
1673
- } catch (e) {
1674
- await this.client.send(`MKD ${this.bucketName}`);
1675
- await this.client.cd(this.bucketName);
1676
- }
1677
- const parts = key.split("/");
1678
- parts.pop();
1679
- for (const part of parts) {
1680
- if (!part)
1681
- continue;
1682
- try {
1683
- await this.client.cd(part);
1684
- } catch (e) {
1685
- await this.client.send(`MKD ${part}`);
1686
- await this.client.cd(part);
1687
- }
1688
- }
1689
- await this.client.cd("/");
1690
- const fullPath = `${this.bucketName}/${key}`;
1691
- const stream3 = body instanceof Readable ? body : Readable.from([body]);
1692
- await this.client.uploadFrom(stream3, fullPath);
1693
- return { key };
1694
- });
1695
- }
1696
- async delete(key) {
1697
- return this.withClient(async () => {
1698
- await this.client.remove(`${this.bucketName}/${key}`);
1699
- return true;
1700
- });
1701
- }
1702
- async close() {
1703
- this.client.close();
1704
- }
1705
- // Unsupported Operations
1706
- async getDownloadUrl(_key, _expiresInMinutes) {
1707
- throw new Error("FTP does not support pre-signed URLs");
1708
- }
1709
- async getUploadUrl(_key, _expiresInMinutes) {
1710
- throw new Error("FTP does not support pre-signed URLs");
1711
- }
1712
- async getHeadObject(_key) {
1713
- throw new Error("Operation not supported");
1714
- }
1715
- createUploadWriteStream(_key) {
1716
- throw new Error("Operation not supported");
1717
- }
1718
- async getHeadBucket() {
1719
- throw new Error("Operation not supported");
1720
- }
1721
- async generateUploadIdMultipart(_key) {
1722
- throw new Error("Multipart upload is not supported");
1723
- }
1724
- async listMultipartUploadsForBucket() {
1725
- throw new Error("Multipart upload is not supported");
1726
- }
1727
- async listMultipartUploadsForKey(_key, _uploadId) {
1728
- throw new Error("Multipart upload is not supported");
1729
- }
1730
- async uploadMultipart(_key, _file, _partNumber, _uploadId) {
1731
- throw new Error("Multipart upload is not supported");
1732
- }
1733
- async completeMultipartUpload(_key, _uploadId) {
1734
- throw new Error("Multipart upload is not supported");
1735
- }
1736
- async abortMultipartUpload(_key, _uploadId) {
1737
- throw new Error("Method not implemented.");
1738
- }
1739
- async getMultipartUploadPresignedUrl(_key, _uploadId, _partNumber, _expiresInMinutes) {
1740
- throw new Error("Multipart upload is not supported");
1741
- }
1742
- };
1743
1438
 
1744
1439
  // src/shared/utils/constants.ts
1745
1440
  var OBJECT_STORAGE_SERVICE_TYPES = {
1746
1441
  AWS_S3: "aws_s3",
1747
- AZURE_BLOB_STORAGE: "azure_blob_storage",
1748
- FTP: "ftp",
1749
- SFTP: "sftp"
1442
+ AZURE_BLOB_STORAGE: "azure_blob_storage"
1750
1443
  };
1751
1444
 
1752
1445
  // src/services/objectStorageFactory.service.ts
@@ -1758,11 +1451,7 @@ var ObjectStorageFactory = class {
1758
1451
  case OBJECT_STORAGE_SERVICE_TYPES.AWS_S3:
1759
1452
  return new S3StorageService(bucketName, options);
1760
1453
  case OBJECT_STORAGE_SERVICE_TYPES.AZURE_BLOB_STORAGE:
1761
- return new BlobStorageService(bucketName, options);
1762
- case OBJECT_STORAGE_SERVICE_TYPES.FTP:
1763
- return new FtpStorageService(bucketName, options);
1764
- case OBJECT_STORAGE_SERVICE_TYPES.SFTP:
1765
- return new SftpStorageService(bucketName, options);
1454
+ return new BlobStorageService(bucketName);
1766
1455
  default:
1767
1456
  throw new Error(
1768
1457
  `Unsupported object storage provider: ${provider}`
@@ -1788,13 +1477,11 @@ var ObjectStorageService = class _ObjectStorageService {
1788
1477
  *
1789
1478
  * @param {ListRequestOptions} options - The options to apply to the list operation.
1790
1479
  * @param {string} [bucketName] - The name of the bucket to list objects from. If not provided, the default bucket name will be used.
1791
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1792
1480
  * @return {Promise<ListResponse>} A promise that resolves to the list of objects.
1793
1481
  */
1794
- static async list(options, bucketName, objectStorageOptions) {
1482
+ static async list(options, bucketName) {
1795
1483
  return _ObjectStorageService.getObjectStorageServiceInstance(
1796
- bucketName,
1797
- objectStorageOptions
1484
+ bucketName
1798
1485
  ).then((instance) => instance.list(options));
1799
1486
  }
1800
1487
  /**
@@ -1802,13 +1489,11 @@ var ObjectStorageService = class _ObjectStorageService {
1802
1489
  *
1803
1490
  * @param {ListRequestOptions} options - The options to apply to the list operation.
1804
1491
  * @param {string} [bucketName] - The name of the bucket to list objects from. If not provided, the default bucket name will be used.
1805
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1806
1492
  * @return {Promise<ListResponse>} A promise that resolves to the list of all objects.
1807
1493
  */
1808
- static async listAll(options, bucketName, objectStorageOptions) {
1494
+ static async listAll(options, bucketName) {
1809
1495
  return _ObjectStorageService.getObjectStorageServiceInstance(
1810
- bucketName,
1811
- objectStorageOptions
1496
+ bucketName
1812
1497
  ).then((instance) => instance.listAll(options));
1813
1498
  }
1814
1499
  /**
@@ -1816,27 +1501,21 @@ var ObjectStorageService = class _ObjectStorageService {
1816
1501
  *
1817
1502
  * @param {string} key - The key of the object to retrieve.
1818
1503
  * @param {string} [bucketName] - The name of the bucket where the object is stored. If not provided, the default bucket name will be used.
1819
- * @param {IGetObjectOptions} [options] - The options to apply to the get operation.
1820
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1821
1504
  * @return {Promise<GetObjectResponse>} A promise that resolves to the retrieved object.
1822
1505
  */
1823
- static async getObject(key, bucketName, options, objectStorageOptions) {
1506
+ static async getObject(key, bucketName, options) {
1824
1507
  return _ObjectStorageService.getObjectStorageServiceInstance(
1825
- bucketName,
1826
- objectStorageOptions
1508
+ bucketName
1827
1509
  ).then((instance) => instance.getObject(key, options));
1828
1510
  }
1829
1511
  /**
1830
1512
  * Retrieves an object info (without file content) from the object storage service.
1831
1513
  * @param key - The key of the object to retrieve.
1832
- * @param bucketName - The name of the bucket where the object is stored. If not provided, the default bucket name will be used.
1833
- * @param objectStorageOptions - The options for the object storage service.
1834
1514
  * @returns A promise that resolves to the info of the file.
1835
1515
  */
1836
- static async getHeadObject(key, bucketName, objectStorageOptions) {
1516
+ static async getHeadObject(key, bucketName) {
1837
1517
  return _ObjectStorageService.getObjectStorageServiceInstance(
1838
- bucketName,
1839
- objectStorageOptions
1518
+ bucketName
1840
1519
  ).then((instance) => instance.getHeadObject(key));
1841
1520
  }
1842
1521
  /**
@@ -1845,13 +1524,11 @@ var ObjectStorageService = class _ObjectStorageService {
1845
1524
  * @param {string} key - The key of the object for which to generate the signed URL.
1846
1525
  * @param {number} expiresInMinutes - The number of minutes until the signed URL expires.
1847
1526
  * @param {string} [bucketName] - The name of the bucket where the object is stored. If not provided, the default bucket name will be used.
1848
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1849
1527
  * @return {Promise<string>} A promise that resolves to the generated signed URL.
1850
1528
  */
1851
- static async getDownloadUrl(key, expiresInMinutes, bucketName, objectStorageOptions) {
1529
+ static async getDownloadUrl(key, expiresInMinutes, bucketName) {
1852
1530
  return _ObjectStorageService.getObjectStorageServiceInstance(
1853
- bucketName,
1854
- objectStorageOptions
1531
+ bucketName
1855
1532
  ).then((instance) => instance.getDownloadUrl(key, expiresInMinutes));
1856
1533
  }
1857
1534
  /**
@@ -1860,13 +1537,11 @@ var ObjectStorageService = class _ObjectStorageService {
1860
1537
  * @param {string} key - The key of the object for which to generate the upload URL.
1861
1538
  * @param {number} expiresInMinutes - The number of minutes until the upload URL expires.
1862
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.
1863
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1864
1540
  * @return {Promise<string>} A promise that resolves to the generated upload URL.
1865
1541
  */
1866
- static async getUploadUrl(key, expiresInMinutes, bucketName, objectStorageOptions) {
1542
+ static async getUploadUrl(key, expiresInMinutes, bucketName) {
1867
1543
  return _ObjectStorageService.getObjectStorageServiceInstance(
1868
- bucketName,
1869
- objectStorageOptions
1544
+ bucketName
1870
1545
  ).then((instance) => instance.getUploadUrl(key, expiresInMinutes));
1871
1546
  }
1872
1547
  /**
@@ -1876,13 +1551,11 @@ var ObjectStorageService = class _ObjectStorageService {
1876
1551
  * @param {FileContent} body - The content of the file to upload.
1877
1552
  * @param {Object} [metadata] - Optional metadata to associate with the object.
1878
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.
1879
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1880
1554
  * @return {Promise<UploadResponse>} A promise that resolves to the response of the upload operation.
1881
1555
  */
1882
- static async upload(key, body, metadata, bucketName, objectStorageOptions) {
1556
+ static async upload(key, body, metadata, bucketName) {
1883
1557
  return _ObjectStorageService.getObjectStorageServiceInstance(
1884
- bucketName,
1885
- objectStorageOptions
1558
+ bucketName
1886
1559
  ).then((instance) => instance.upload(key, body, metadata));
1887
1560
  }
1888
1561
  /**
@@ -1890,13 +1563,11 @@ var ObjectStorageService = class _ObjectStorageService {
1890
1563
  *
1891
1564
  * @param {string} key - The key of the object to create the upload write stream for.
1892
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.
1893
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1894
1566
  * @return {Promise<CreateUploadWriteStreamResponse>} A promise that resolves to the response of the upload operation.
1895
1567
  */
1896
- static async createUploadWriteStream(key, bucketName, objectStorageOptions) {
1568
+ static async createUploadWriteStream(key, bucketName) {
1897
1569
  return _ObjectStorageService.getObjectStorageServiceInstance(
1898
- bucketName,
1899
- objectStorageOptions
1570
+ bucketName
1900
1571
  ).then((instance) => instance.createUploadWriteStream(key));
1901
1572
  }
1902
1573
  /**
@@ -1904,13 +1575,11 @@ var ObjectStorageService = class _ObjectStorageService {
1904
1575
  *
1905
1576
  * @param {string | string[]} key - The key or array of keys of the objects to delete.
1906
1577
  * @param {string} [bucketName] - The name of the bucket where the objects are stored. If not provided, the default bucket name will be used.
1907
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1908
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.
1909
1579
  */
1910
- static async delete(key, bucketName, objectStorageOptions) {
1580
+ static async delete(key, bucketName) {
1911
1581
  return _ObjectStorageService.getObjectStorageServiceInstance(
1912
- bucketName,
1913
- objectStorageOptions
1582
+ bucketName
1914
1583
  ).then(async (instance) => {
1915
1584
  if (Array.isArray(key)) {
1916
1585
  const deleteBlobPromises = key.map(async (blobName) => {
@@ -1936,13 +1605,11 @@ var ObjectStorageService = class _ObjectStorageService {
1936
1605
  * Retrieves the head bucket from the object storage service.
1937
1606
  *
1938
1607
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1939
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1940
1608
  * @return {Promise<HeadBucketResponse>} A promise that resolves to the head bucket response.
1941
1609
  */
1942
- static async getHeadBucket(bucketName, objectStorageOptions) {
1610
+ static async getHeadBucket(bucketName) {
1943
1611
  return _ObjectStorageService.getObjectStorageServiceInstance(
1944
- bucketName,
1945
- objectStorageOptions
1612
+ bucketName
1946
1613
  ).then((instance) => instance.getHeadBucket());
1947
1614
  }
1948
1615
  /**
@@ -1950,13 +1617,11 @@ var ObjectStorageService = class _ObjectStorageService {
1950
1617
  *
1951
1618
  * @param {string} key - The key of the object to upload.
1952
1619
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1953
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1954
1620
  * @return {Promise<string>} A promise that resolves to the generated upload ID.
1955
1621
  */
1956
- static async generateUploadIdMultipart(key, bucketName, objectStorageOptions) {
1622
+ static async generateUploadIdMultipart(key, bucketName) {
1957
1623
  return _ObjectStorageService.getObjectStorageServiceInstance(
1958
- bucketName,
1959
- objectStorageOptions
1624
+ bucketName
1960
1625
  ).then((instance) => instance.generateUploadIdMultipart(key));
1961
1626
  }
1962
1627
  /**
@@ -1965,13 +1630,11 @@ var ObjectStorageService = class _ObjectStorageService {
1965
1630
  * @param {string} key - The key of the object to retrieve uploads for.
1966
1631
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1967
1632
  * @param {string} [uploadId] - The upload ID to filter the results by.
1968
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1969
1633
  * @return {Promise<ListPartsMultipartUploadResponse>} A promise that resolves to the list of multipart uploads for the specified key.
1970
1634
  */
1971
- static async listMultipartUploadsForKey(key, bucketName, uploadId, objectStorageOptions) {
1635
+ static async listMultipartUploadsForKey(key, bucketName, uploadId) {
1972
1636
  return _ObjectStorageService.getObjectStorageServiceInstance(
1973
- bucketName,
1974
- objectStorageOptions
1637
+ bucketName
1975
1638
  ).then(
1976
1639
  (instance) => instance.listMultipartUploadsForKey(key, uploadId)
1977
1640
  );
@@ -1980,13 +1643,11 @@ var ObjectStorageService = class _ObjectStorageService {
1980
1643
  * Retrieves a list of all multipart uploads for a specified bucket in the object storage service.
1981
1644
  *
1982
1645
  * @param {string} [bucketName] - The name of the bucket. If not provided, the default bucket name will be used.
1983
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
1984
1646
  * @return {Promise<ListMultipartUploadsResponse>} A promise that resolves to the list of multipart uploads for the specified bucket.
1985
1647
  */
1986
- static async listMultipartUploadsForBucket(bucketName, objectStorageOptions) {
1648
+ static async listMultipartUploadsForBucket(bucketName) {
1987
1649
  return _ObjectStorageService.getObjectStorageServiceInstance(
1988
- bucketName,
1989
- objectStorageOptions
1650
+ bucketName
1990
1651
  ).then((instance) => instance.listMultipartUploadsForBucket());
1991
1652
  }
1992
1653
  /**
@@ -1997,13 +1658,11 @@ var ObjectStorageService = class _ObjectStorageService {
1997
1658
  * @param {number} partNumber - The number of the part being uploaded.
1998
1659
  * @param {string} [uploadId] - The ID of the multipart upload.
1999
1660
  * @param {string} [bucketName] - The name of the bucket to upload the file to. If not provided, the default bucket name will be used.
2000
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2001
1661
  * @return {Promise<string>} A Promise that resolves to the base64 encoded block ID of the uploaded part.
2002
1662
  */
2003
- static async uploadMultipart(key, file, partNumber, uploadId, bucketName, objectStorageOptions) {
1663
+ static async uploadMultipart(key, file, partNumber, uploadId, bucketName) {
2004
1664
  return _ObjectStorageService.getObjectStorageServiceInstance(
2005
- bucketName,
2006
- objectStorageOptions
1665
+ bucketName
2007
1666
  ).then(
2008
1667
  (instance) => instance.uploadMultipart(key, file, partNumber, uploadId)
2009
1668
  );
@@ -2014,13 +1673,11 @@ var ObjectStorageService = class _ObjectStorageService {
2014
1673
  * @param {string} key - The key of the object to complete the multipart upload for.
2015
1674
  * @param {string} uploadId - The ID of the multipart upload to complete.
2016
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.
2017
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2018
1676
  * @return {Promise<void>} A Promise that resolves when the multipart upload is completed.
2019
1677
  */
2020
- static async completeMultipartUpload(key, uploadId, bucketName, objectStorageOptions) {
1678
+ static async completeMultipartUpload(key, uploadId, bucketName) {
2021
1679
  return _ObjectStorageService.getObjectStorageServiceInstance(
2022
- bucketName,
2023
- objectStorageOptions
1680
+ bucketName
2024
1681
  ).then((instance) => instance.completeMultipartUpload(key, uploadId));
2025
1682
  }
2026
1683
  /**
@@ -2029,13 +1686,11 @@ var ObjectStorageService = class _ObjectStorageService {
2029
1686
  * @param {string} key - The key of the object to abort the multipart upload for.
2030
1687
  * @param {string} uploadId - The ID of the multipart upload to abort.
2031
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.
2032
- * @param {ObjectStorageOptions} [objectStorageOptions] - The options for the object storage service.
2033
1689
  * @return {Promise<void>} A Promise that resolves when the multipart upload is aborted.
2034
1690
  */
2035
- static async abortMultipartUpload(key, uploadId, bucketName, objectStorageOptions) {
1691
+ static async abortMultipartUpload(key, uploadId, bucketName) {
2036
1692
  return _ObjectStorageService.getObjectStorageServiceInstance(
2037
- bucketName,
2038
- objectStorageOptions
1693
+ bucketName
2039
1694
  ).then((instance) => instance.abortMultipartUpload(key, uploadId));
2040
1695
  }
2041
1696
  /**