@directus/storage-driver-s3 11.0.3 → 11.0.5

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.
package/dist/index.d.ts CHANGED
@@ -15,6 +15,10 @@ type DriverS3Config = {
15
15
  tus?: {
16
16
  chunkSize?: number;
17
17
  };
18
+ connectionTimeout?: number;
19
+ socketTimeout?: number;
20
+ maxSockets?: number;
21
+ keepAlive?: boolean;
18
22
  };
19
23
  declare class DriverS3 implements TusDriver {
20
24
  private config;
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ import { isReadableStream } from "@directus/utils/node";
19
19
  import { Semaphore } from "@shopify/semaphore";
20
20
  import { NodeHttpHandler } from "@smithy/node-http-handler";
21
21
  import { ERRORS, StreamSplitter, TUS_RESUMABLE } from "@tus/utils";
22
+ import ms from "ms";
22
23
  import fs, { promises as fsProm } from "node:fs";
23
24
  import { Agent as HttpAgent } from "node:http";
24
25
  import { Agent as HttpsAgent } from "node:https";
@@ -45,10 +46,10 @@ var DriverS3 = class {
45
46
  this.partUploadSemaphore = new Semaphore(60);
46
47
  }
47
48
  getClient() {
48
- const connectionTimeout = 5e3;
49
- const socketTimeout = 12e4;
50
- const maxSockets = 500;
51
- const keepAlive = true;
49
+ const connectionTimeout = ms(String(this.config.connectionTimeout ?? 5e3));
50
+ const socketTimeout = ms(String(this.config.socketTimeout ?? 12e4));
51
+ const maxSockets = this.config.maxSockets ?? 500;
52
+ const keepAlive = this.config.keepAlive ?? true;
52
53
  const s3ClientConfig = {
53
54
  requestHandler: new NodeHttpHandler({
54
55
  connectionTimeout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/storage-driver-s3",
3
- "version": "11.0.3",
3
+ "version": "11.0.5",
4
4
  "description": "S3 file storage abstraction for `@directus/storage`",
5
5
  "homepage": "https://directus.io",
6
6
  "repository": {
@@ -26,11 +26,13 @@
26
26
  "@shopify/semaphore": "3.1.0",
27
27
  "@smithy/node-http-handler": "3.2.4",
28
28
  "@tus/utils": "0.4.0",
29
- "@directus/storage": "11.0.1",
30
- "@directus/utils": "12.0.3"
29
+ "ms": "2.1.3",
30
+ "@directus/utils": "12.0.5",
31
+ "@directus/storage": "11.0.1"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@ngneat/falso": "7.2.0",
35
+ "@types/ms": "0.7.34",
34
36
  "@vitest/coverage-v8": "2.1.2",
35
37
  "tsup": "8.3.0",
36
38
  "typescript": "5.6.3",