import type { ClientContext } from './request.js'; import type { IDelegatedZcap, IRootZcap, IZcap } from '../types.js'; /** * The root capability id for an invocation target URL * (`urn:zcap:root:`) -- the id grammar shared by revocation * (which invokes the revocation URL's own root capability in object form) and * grant rooting (which parents an unparented grant on its Space's root * capability id). * * @param target {string} the absolute invocation target URL * @returns {string} */ export declare function rootCapabilityId(target: string): string; /** * Builds the root capability for `target` in **object** form. * * The object form is load-bearing: `@interop/ezcap` accepts a *string* root * capability id only when its invocation target is `https:`, which would break * against an `http://localhost` server. Both forms reduce to the same * `zcap id="..."` invocation header. * * `controller` is client-side only -- the server re-derives the real controller * when it synthesizes the root capability -- so the caller's own DID is fine. * * @param options {object} * @param options.target {string} the absolute invocation target URL * @param options.controller {string} the invoking client's DID * @returns {IRootZcap} */ export declare function rootCapability({ target, controller }: { target: string; controller: string; }): IRootZcap; /** * Derives the id of the Space a capability is rooted in, from its * `invocationTarget`. A Space-rooted capability's target is the Space URL or a * path beneath it (the server enforces this when it verifies the chain), so * every depth `parseSpaceTarget` recognizes -- Space, Collection, Resource, or a * reserved sub-resource such as `/space/s/c/r/meta` -- carries the Space id. * * @param context {ClientContext} * @param zcap {IZcap} the capability to locate * @returns {string} */ export declare function spaceIdOf(context: ClientContext, zcap: IZcap): string; /** * Revokes a Space-rooted delegated capability: `POST`s it to * `/space/:spaceId/zcaps/revocations/:capabilityId`, invoking that URL's own * root capability. Resolves on the server's 204. * * The `action` is deliberately left unset: `send()` defaults it to the HTTP * method, and this route expects `POST` (WAS capabilities are scoped by HTTP * method, unlike the webkms `/kms` revocation route's `write`). * * @param context {ClientContext} * @param options {object} * @param options.spaceId {string} the Space the capability is rooted in * @param options.zcap {IDelegatedZcap} the capability to revoke * @returns {Promise} */ export declare function submitRevocation(context: ClientContext, { spaceId, zcap }: { spaceId: string; zcap: IDelegatedZcap; }): Promise; //# sourceMappingURL=revoke.d.ts.map