/** * EDV HTTP client. The data plane lives here — DIDComm messages never * carry encrypted blob bytes per spec § EDV Usage. * * * `Authorization: ZcapLD ,,...` * (child-to-root capability chain) * * `Content-Type: application/json` request bodies * * Response codes: 200/201/204 success; 401 cap-unauthorized; * 404 doc-not-found / vault-not-found; 409 concurrency-conflict * * Uses the global `fetch` so no extra HTTP dep is needed. */ import type { Capability } from '../zcap'; import { type EncryptedDocument, type QueryRequest, type QueryResponse } from './types'; export interface EdvClientOptions { /** * Optional `fetch` override. Defaults to `globalThis.fetch`. Useful * for injecting a tracing wrapper or a test stub. */ fetch?: typeof globalThis.fetch; } export declare class EdvClient { private fetchFn; constructor(opts?: EdvClientOptions); /** * `POST /edvs/{vault_id}/documents`. Server enforces `sequence === 0` * on create and that `Authorization: ZcapLD` includes write. */ createDocument(args: { baseUrl: string; document: EncryptedDocument; chain: Capability[]; }): Promise; /** * `GET /edvs/{vault_id}/documents/{doc_id}`. Returns the * `EncryptedDocument` whose `jwe` field the caller then decrypts * locally via the JWE module. */ getDocument(args: { baseUrl: string; docId: string; chain: Capability[]; }): Promise; /** * `PUT /edvs/{vault_id}/documents/{doc_id}`. Server enforces * `sequence == stored.sequence + 1` (RFC 7517 OCC). */ updateDocument(args: { baseUrl: string; document: EncryptedDocument; chain: Capability[]; }): Promise; /** * `DELETE /edvs/{vault_id}/documents/{doc_id}`. Server returns 204. */ deleteDocument(args: { baseUrl: string; docId: string; chain: Capability[]; }): Promise; /** * `POST /edvs/{vault_id}/query`. Equality-only HMAC indexes per * spec § EDV Usage § Indexes. */ query(args: { baseUrl: string; request: QueryRequest; chain: Capability[]; }): Promise; private headers; private parseJson; private raiseFromResponse; } /** Encode a capability chain into the `Authorization: ZcapLD ...` value. */ export declare function encodeChainHeader(chain: Capability[]): string;