Interfaces

@system-inc/base-foundation · 515c140 · 15 symbols

Members

  • namespace: string

  • rpcEndPoint?: string

View source ↗

Members

  • cursor?: string | null

  • limit?: number

  • prefix?: string | null

View source ↗

Members

  • expiration?: number

  • expirationTtl?: number

  • metadata?: object | null

View source ↗

Key-Value storage is different from the database in base, database would expect to be a SQL database, while key-value storage is a simple no-SQL storage, expecting to have fast read and write operations.

Members

View source ↗

Members

View source ↗

ObjectStore

interface

Interface to an Object Store, e.g. S3, GCS, R2, etc. Using an S3 compatible interface.

Members

  • bucket: ObjectStoreBucket

    The bucket backing this store.

  • type: ObjectStoreType

    The type of store. Could be S3, GCS, R2, etc.

    Currently only R2 is supported.

  • delete(key: string | string[]): Promise<void>

    Deletes the object with the given key.

  • get(key: string): Promise<StoredObjectData & StoredObjectMetaData | null>

    Retrieves the object with the given key.

  • head(key: string): Promise<StoredObjectMetaData | null>

    Retrieves the metadata for the object with the given key.

  • list(options?: ObjectStoreListOptions): Promise<ObjectStoreListResult>

    Lists objects in the store matching the given options. Supports prefix filtering and delimiter-based folder browsing.

    When a delimiter is provided (typically '/'), the result includes delimitedPrefixes — virtual folder paths at the current level.

  • put(key: string, data: string | ArrayBuffer | ReadableStream<any> | ArrayBufferView<ArrayBufferLike> | Blob, options?: ObjectStorePutOptions): Promise<StoredObjectMetaData | null>

    Adds the given data to the store with the given key.

View source ↗

HTTP metadata to associate with the stored object. These are returned as HTTP headers when the object is fetched.

Members

  • cacheControl?: string

  • cacheExpiry?: Date

  • contentDisposition?: string

  • contentEncoding?: string

  • contentLanguage?: string

  • contentType?: string

View source ↗

Options for listing objects in the store.

Members

  • cursor?: string

    Opaque token for pagination. Use the cursor from a previous truncated result to fetch the next page.

  • delimiter?: string

    Character used to group keys into virtual folders. Typically '/'. When set, results include delimitedPrefixes for keys that share a common prefix up to the delimiter.

  • limit?: number

    Maximum number of objects to return. Default varies by provider (R2: 1000).

  • prefix?: string

    Only return objects whose keys start with this prefix.

  • startAfter?: string

    Only return objects whose keys are lexicographically after this value.

View source ↗

The result of a list operation.

Members

  • cursor?: string

    Opaque cursor for fetching the next page. Only present when truncated is true.

  • delimitedPrefixes: string[]

    Virtual folder prefixes when a delimiter is used. For example, with prefix='photos/' and delimiter='/', this might contain ['photos/2025/', 'photos/2026/'].

  • objects: StoredObjectMetaData[]

    The objects matching the list query.

  • truncated: boolean

    Whether there are more results beyond this page.

View source ↗

Options for the put() method.

Members

  • customMetadata?: Record<string, string>

  • httpMetadata?: ObjectStoreHttpMetadata

  • storageClass?: "Standard" | "InfrequentAccess"

View source ↗

Worker-level settings for object storage (R2 / S3-compatible buckets).

Buckets are declared once here at the worker root and can be consumed directly via InjectObjectStore without opting into the full FileStorage module. Higher-level modules (FileStorage, etc.) read buckets from this settings block by name.

Members

View source ↗

A private bucket (no public URL). Domains are not allowed.

extends ObjectStoreBucketBase

Members

  • binding: string

    The binding name for the bucket. Should match 'binding' in wrangler.toml.

  • domains?: undefined

  • name: string

    The name of the bucket. Should match 'bucket_name' in wrangler.toml.

  • privateBucket: true

View source ↗

A public bucket with a required domain map (environment → hostname).

extends ObjectStoreBucketBase

Members

  • binding: string

    The binding name for the bucket. Should match 'binding' in wrangler.toml.

  • domains: NamedConfiguration<string>

    Domain map for public buckets (environment → hostname).

  • name: string

    The name of the bucket. Should match 'bucket_name' in wrangler.toml.

  • privateBucket?: false

View source ↗

The data of a stored object. It could be stored in a variety of formats, e.g. binary, text, json, etc.

Members

  • body: ReadableStream

  • bodyUsed: boolean

  • arrayBuffer(): Promise<ArrayBuffer>

  • blob(): Promise<Blob>

  • json(): Promise<T>

  • text(): Promise<string>

View source ↗

Metadata about a stored object.

Members

  • etag: string

  • httpEtag: string

  • key: string

  • size: number

  • uploaded: Date

  • version: string

View source ↗