Skip to content

Commit 6cee1be

Browse files
committed
fix(storage): update wrong types
1 parent f747aa5 commit 6cee1be

File tree

1 file changed

+19
-14
lines changed
  • packages/core/storage-js/src/lib

1 file changed

+19
-14
lines changed

packages/core/storage-js/src/lib/types.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ export interface FileObject {
107107
/**
108108
* File object returned by the Info endpoint (info() method)
109109
* Contains detailed metadata for a specific file
110+
*
111+
* Note: The info endpoint returns user_metadata as the metadata field,
112+
* while system metadata (size, mimetype, etc.) is flattened into top-level fields.
110113
*/
111114
export interface FileObjectV2 {
112115
/** Unique identifier for the file */
@@ -117,22 +120,22 @@ export interface FileObjectV2 {
117120
name: string
118121
/** Bucket identifier */
119122
bucket_id: string
123+
/** Last modification timestamp */
124+
last_modified: string
120125
/** Creation timestamp */
121126
created_at: string
122-
/** @deprecated Use last_modified instead */
123-
last_accessed_at: string
124-
/** File size in bytes */
125-
size?: number
126-
/** Cache control header value */
127-
cache_control?: string
128-
/** MIME content type */
129-
content_type?: string
130-
/** Entity tag for caching */
131-
etag?: string
132-
/** Last modification timestamp (replaces updated_at) */
133-
last_modified?: string
134-
/** Custom file metadata */
135-
metadata?: FileMetadata
127+
/** @deprecated Use last_modified instead. Not returned by info endpoint. */
128+
last_accessed_at?: string
129+
/** File size in bytes (null if not available) */
130+
size: number | null
131+
/** Cache control header value (null if not set) */
132+
cache_control: string | null
133+
/** MIME content type (null if not available) */
134+
content_type: string | null
135+
/** Entity tag for caching (null if not available) */
136+
etag: string | null
137+
/** User-provided custom metadata (arbitrary key-value pairs) */
138+
metadata: Record<string, any> | null
136139
/**
137140
* @deprecated The API returns last_modified instead.
138141
* This field may not be present in responses.
@@ -269,6 +272,8 @@ export interface SearchV2Result {
269272
folders: SearchV2Folder[]
270273
objects: SearchV2Object[]
271274
nextCursor?: string
275+
/** The key/name used for cursor-based pagination (returned by storage server) */
276+
nextCursorKey?: string
272277
}
273278

274279
export interface FetchParameters {

0 commit comments

Comments
 (0)