Skip to content

Commit

Permalink
Introduce S3ListObject and use it (minio#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent FAYOLLE authored and fflorent committed Jul 18, 2023
1 parent 73d8027 commit 54a1ca2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/internal/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ export type BucketItemWithMetadata = BucketItem & {
metadata?: ItemBucketMetadata | ItemBucketMetadataList
}

export type S3ListObject =
| { prefix: string; size: number }
| { name: string; size: number } // sometime api return this, not sure if it's valid
| {
name: string
lastModified: Date
etag: string
size: number
isDeleteMarker?: boolean
isLatest?: boolean
}

export type StatObjectOpts = {
versionId?: string
}
Expand Down
11 changes: 9 additions & 2 deletions src/minio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import type {
RETENTION_MODES,
RETENTION_VALIDITY_UNITS,
RetentionOptions,
S3ListObject,
SelectOptions,
SourceObjectStats,
StatObjectOpts,
Expand Down Expand Up @@ -100,6 +101,7 @@ export type {
RETENTION_MODES,
RETENTION_VALIDITY_UNITS,
RetentionOptions,
S3ListObject,
SelectOptions,
SourceObjectStats,
StatObjectOpts,
Expand Down Expand Up @@ -162,9 +164,14 @@ export class Client extends TypedClient {
bucketExists(bucketName: string, callback: ResultCallback<boolean>): void
bucketExists(bucketName: string): Promise<boolean>

listObjects(bucketName: string, prefix?: string, recursive?: boolean): BucketStream<BucketItem>
listObjects(bucketName: string, prefix?: string, recursive?: boolean): BucketStream<S3ListObject>

listObjectsV2(bucketName: string, prefix?: string, recursive?: boolean, startAfter?: string): BucketStream<BucketItem>
listObjectsV2(
bucketName: string,
prefix?: string,
recursive?: boolean,
startAfter?: string,
): BucketStream<S3ListObject>

listIncompleteUploads(
bucketName: string,
Expand Down

0 comments on commit 54a1ca2

Please sign in to comment.