@directus/storage-driver-s3 9.22.0 → 9.22.1

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.js CHANGED
@@ -26,6 +26,9 @@ export class DriverS3 {
26
26
  };
27
27
  s3ClientConfig.forcePathStyle = true;
28
28
  }
29
+ if (config.region) {
30
+ s3ClientConfig.region = config.region;
31
+ }
29
32
  this.client = new S3Client(s3ClientConfig);
30
33
  this.bucket = config.bucket;
31
34
  this.acl = config.acl;
@@ -24,6 +24,7 @@ beforeEach(() => {
24
24
  serverSideEncryption: randWord(),
25
25
  root: randDirectoryPath(),
26
26
  endpoint: randDomainName(),
27
+ region: randWord(),
27
28
  },
28
29
  path: {
29
30
  input: randUnique() + randFilePath(),
@@ -141,6 +142,21 @@ describe('#constructor', () => {
141
142
  },
142
143
  });
143
144
  });
145
+ test('Sets region', () => {
146
+ new DriverS3({
147
+ key: sample.config.key,
148
+ secret: sample.config.secret,
149
+ bucket: sample.config.bucket,
150
+ region: sample.config.region,
151
+ });
152
+ expect(S3Client).toHaveBeenCalledWith({
153
+ region: sample.config.region,
154
+ credentials: {
155
+ accessKeyId: sample.config.key,
156
+ secretAccessKey: sample.config.secret,
157
+ },
158
+ });
159
+ });
144
160
  test('Normalizes config path when root is given', () => {
145
161
  const mockRoot = randDirectoryPath();
146
162
  vi.mocked(normalizePath).mockReturnValue(mockRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/storage-driver-s3",
3
- "version": "9.22.0",
3
+ "version": "9.22.1",
4
4
  "type": "module",
5
5
  "description": "S3 file storage abstraction for `@directus/storage`",
6
6
  "repository": {
@@ -27,8 +27,8 @@
27
27
  "@aws-sdk/abort-controller": "3.226.0",
28
28
  "@aws-sdk/client-s3": "3.224.0",
29
29
  "@aws-sdk/lib-storage": "3.234.0",
30
- "@directus/storage": "9.22.0",
31
- "@directus/utils": "9.22.0"
30
+ "@directus/storage": "9.22.1",
31
+ "@directus/utils": "9.22.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@directus/tsconfig": "0.0.6",