Optionaloptions: GcsProviderOptions
GCS connection/injection options
Wall-clock source (epoch ms) for signed-URL expiry. Injected by
createProvider as runtime.now() (the only sanctioned clock outside
packages/runtime). Defaults to () => 0 for direct construction.
OptionalisM70c: delegates to the injected client's optional isHealthy?() (the real
adapter calls bucket.exists()). Assigned in connect() only when the
client provides the member; a client that omits it is unknown, and the
indicator reads absence (not false) as that.
Establishes the GCS client — injects the SDK lazily or uses injected client.
Deletes an object from GCS.
Object key
true if deleted
Disconnect is a no-op for GCS (connectionless HTTP client).
Reports whether an object exists in GCS.
Object key
true if present
Retrieves an object from GCS; null when absent.
Object key
The object bytes, or null
Creates a signed GET URL for a GCS object.
Object key
Expiry in seconds
The signed URL
Native stream download — adapts GCS createReadStream() into a web
ReadableStream (no node: import needed).
The adapter is chosen by probing the stream, because IGcsClient types it
as unknown: a real SDK body is a node Readable and is async-iterated, an
injected client emitting only 'data'/'end'/'error' takes the event
path, and a value carrying neither is refused by name. The refusal is a
REJECTION, never a synchronous throw — this method is typed Promise<…>,
so a caller using .catch() must be able to see it.
Cancellation-safe on both paths: the cancel hook releases the source and
destroys the underlying request, so a consumer cancelling mid-download
neither leaks the connection nor crashes the process (previously the eager
drain kept flowing after a cancel and the next chunk enqueued into the
closed controller as an uncaught TypeError). Still an EAGER drain by
documented contract — see provider-stream.ts and the README's
per-provider table.
Object key
A ReadableStream, null if absent, or a rejection naming the
unusable stream shape
Reports readiness.
Stores an object in GCS, recording any content type and user metadata on the object itself so a signed URL serves it under the right type.
Object key
Object bytes
Optionaloptions: PutObjectOptions
Object attributes to record with the bytes
Google Cloud Storage provider.
Supports native streaming via
createReadStream()drained into a webReadableStream— by async iteration when the stream supports it (every real SDK body does), by'data'/'end'/'error'events otherwise.Since
0.1.0