/** * `ObjectProjection` — the capability an `as-*` projection store implements to * hold blob bytes as native, directly-consumable objects (e.g. servable S3 * objects) rather than the encrypted-envelope chunks a `NoydbStore` holds. * * This is the shared seam behind **direct-serve blobs** and the * **debug raw-object path**: "write these bytes as one real object and * give me a URL to it." See the as-aws-s3 design spec. * * Unlike `NoydbStore` (ciphertext in / ciphertext out), an `ObjectProjection` * sees **raw bytes** — it is `as-*`, not `to-*`, and lives **outside** the * zero-knowledge guarantee. Wiring it up is a deliberate, per-field opt-in. */ /** Metadata about a stored object, without its body. */ export interface ObjectMeta { readonly size: number; readonly contentType?: string; readonly etag?: string; readonly lastModified?: string; /** S3-style user metadata (`x-amz-meta-*`). Small; see the design's * plain / encrypted / opaque-token modes. */ readonly userMeta?: Record; } export interface PutObjectOptions { readonly contentType: string; /** World-readable object (CDN origin) vs private (presigned-only). Default false. */ readonly public?: boolean; /** User metadata mirrored onto the object (the "secondary store"). */ readonly userMeta?: Record; } export interface ObjectUrlOptions { /** TTL for a presigned URL (ignored for a public object). */ readonly expiresInSeconds?: number; } export interface PutUrlOptions { readonly contentType: string; readonly expiresInSeconds?: number; } /** One entry returned by {@link ObjectProjection.listPrefix}. */ export interface ObjectListEntry { readonly key: string; readonly meta: ObjectMeta; } export interface ObjectProjection { /** Diagnostic name (e.g. `'aws-s3'`, `'memory'`). */ readonly name?: string; /** Write raw bytes as a single native object with a real content type. */ putObject(key: string, bytes: Uint8Array, opts: PutObjectOptions): Promise; /** Read the raw bytes back; `null` if absent. */ getObject(key: string): Promise; /** Delete the object. Idempotent — absent is not an error. */ deleteObject(key: string): Promise; /** Object metadata without the body; `null` if absent. */ headObject(key: string): Promise; /** A URL to GET the object — presigned (time-limited) or stable public. */ objectUrl(key: string, opts?: ObjectUrlOptions): Promise; /** A presigned URL the client PUTs bytes to directly (large-file upload, * bytes bypass the hub). */ putUrl(key: string, opts: PutUrlOptions): Promise; /** List objects under a key prefix — for import / reconcile. */ listPrefix(prefix: string): Promise; } /** * In-memory {@link ObjectProjection} — a reference implementation for tests, * local development, and the hub's blob-wiring conformance. Holds bytes in a * `Map`; URLs are synthetic (`memory://…`). Not for production. */ export declare function memoryObjectProjection(opts?: { baseUrl?: string; }): ObjectProjection;