@directus/storage-driver-s3 10.0.13 → 10.0.14

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -142,11 +142,14 @@ var DriverS3 = class {
142
142
  await this.client.send(new DeleteObjectCommand({ Key: this.fullPath(filepath), Bucket: this.config.bucket }));
143
143
  }
144
144
  async *list(prefix = "") {
145
+ let Prefix = this.fullPath(prefix);
146
+ if (Prefix === ".")
147
+ Prefix = "";
145
148
  let continuationToken = void 0;
146
149
  do {
147
150
  const listObjectsV2CommandInput = {
148
151
  Bucket: this.config.bucket,
149
- Prefix: this.fullPath(prefix),
152
+ Prefix,
150
153
  MaxKeys: 1e3
151
154
  };
152
155
  if (continuationToken) {
@@ -155,10 +158,13 @@ var DriverS3 = class {
155
158
  const response = await this.client.send(new ListObjectsV2Command(listObjectsV2CommandInput));
156
159
  continuationToken = response.NextContinuationToken;
157
160
  if (response.Contents) {
158
- for (const file of response.Contents) {
159
- if (file.Key) {
160
- yield file.Key.substring(this.root.length);
161
- }
161
+ for (const object of response.Contents) {
162
+ if (!object.Key)
163
+ continue;
164
+ const isDir = object.Key.endsWith("/");
165
+ if (isDir)
166
+ continue;
167
+ yield object.Key.substring(this.root.length);
162
168
  }
163
169
  }
164
170
  } while (continuationToken);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/storage-driver-s3",
3
- "version": "10.0.13",
3
+ "version": "10.0.14",
4
4
  "description": "S3 file storage abstraction for `@directus/storage`",
5
5
  "homepage": "https://directus.io",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "@aws-sdk/lib-storage": "3.332.0",
27
27
  "@aws-sdk/node-http-handler": "3.344.0",
28
28
  "@directus/storage": "10.0.7",
29
- "@directus/utils": "11.0.1"
29
+ "@directus/utils": "11.0.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@ngneat/falso": "6.4.0",