Skip to content

Commit

Permalink
feat(source-aws): include more metadata when listing
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed May 4, 2023
1 parent 5001dcc commit c4d7803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/source-aws/src/s3.fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ export class FsAwsS3 implements FileSystem<SourceAwsS3> {
if (res.Contents != null) {
for (const obj of res.Contents) {
if (obj.Key == null) continue;
yield { path: `s3://${Bucket}/${obj.Key}`, size: obj.Size };
yield {
path: `s3://${Bucket}/${obj.Key}`,
size: obj.Size,
eTag: obj.ETag,
lastModified: obj.LastModified?.toISOString(),
};
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/source-aws/src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type ListReq = {
Delimiter?: string;
RequestPayer?: string;
};
export type ListResContents = { Key?: string; Size?: number };
export type ListResContents = { Key?: string; Size?: number; ETag?: string; LastModified?: Date };
export type ListRes = {
IsTruncated?: boolean;
NextContinuationToken?: string;
Expand Down

0 comments on commit c4d7803

Please sign in to comment.