/*! * Copyright (c) 2026 Interop Alliance. All rights reserved. */ /** * The WAS-backed adapter for the did:webvh module's narrow store seam: the * account's identity collections as a {@link WebvhIdStore}, so every wallet * app drives the log ceremonies through one implementation instead of its own * copy. The log-resource half is parameterized over the collection holding * `did.jsonl` ({@link wasWebvhLogStore}), so a client-annex generation's log -- * a `gen-` collection in the auxiliary annex Space -- is served by the * same implementation without touching the account-log paths. * * Collections here are addressed through {@link plaintextCollection}: `id` * holds published documents (world-readable by policy), an annex generation's * collection holds only its `did.jsonl` (capability-gated, but never * encrypted -- the server resolves it out of its own storage), and `key-map` * holds plain JSON, so none of them goes through the encryption codec. * * Bodies are written as raw bytes under the content type the caller states -- * load-bearing, since the log is JSON Lines (`text/jsonl`), not JSON, and the * DID document is served as `application/did+json`. * * Reads carry the resource's ETag and writes forward the ceremonies' * conditional-write preconditions, so a did:webvh ceremony's `did.jsonl` * publish and the pair of `keys.json` writes are compare-and-swaps. A read * that carries no ETag leaves them unconditional. Conditional writes are a * baseline server requirement, so the missing validator is a CORS * configuration that does not expose `ETag` to script, not a backend without * the affordance. * * Every store carries the chain-head pin for the log it serves: the caller's * keyed pin store plus the slot derived here from the collection * (`logResourcePinId`, the one derivation every log store shares), so no caller pairs a * store with the wrong slot and no read or publish through it runs unpinned. */ import type { IZcap } from '@interop/data-integrity-core'; import type { ResourceLogPinStore } from '@interop/vh-resource-log'; import type { WasClient } from '@interop/was-client'; import type { WebvhIdStore } from './didWebvh.js'; /** * The log-resource subset of the seam: what a ceremony that only reads and * publishes a `did.jsonl` (and its sibling resources in the same collection) * needs. The account store and the annex store both serve it. */ export type WebvhLogResourceStore = Pick; /** * Builds the parameterized log-resource store over one collection of one * Space: the shared implementation behind {@link wasWebvhIdStore} (the * account's `id` collection) and an annex generation's log store (its * `gen-` collection in the auxiliary Space). Signing is whatever the wrapped * client signs as -- controller-tier for the account paths, an enrolled * client's key for the annex. * * @param options {object} * @param options.was {WasClient} the storage client to sign with * @param options.spaceId {string} the Space holding the collection * @param options.collectionId {string} the collection holding the log * @param options.pinStore {ResourceLogPinStore} this client's chain-head * pins; the log's slot is derived here from the collection * @param [options.capability] {IZcap} an invocation capability every request * rides (a delegated writer -- e.g. the transient-recovery continuation over * the credential's sibling delegation); absent, requests invoke the root * capability as before * @returns {WebvhLogResourceStore} */ export declare function wasWebvhLogStore({ was, spaceId, collectionId, pinStore, capability }: { was: WasClient; spaceId: string; collectionId: string; pinStore: ResourceLogPinStore; capability?: IZcap; }): WebvhLogResourceStore; /** * Builds the `id`-collection store the account's did:webvh ceremonies read * and write through. * * @param options {object} * @param options.was {WasClient} the account's storage client, signing as an * enrolled client * @param options.spaceId {string} the data Space id * @param options.pinStore {ResourceLogPinStore} this client's chain-head * pins; the account log's slot (`accountLogPinId({ spaceId })`) is derived * here * @returns {WebvhIdStore} */ export declare function wasWebvhIdStore({ was, spaceId, pinStore }: { was: WasClient; spaceId: string; pinStore: ResourceLogPinStore; }): WebvhIdStore; //# sourceMappingURL=wasIdStore.d.ts.map