import type { IZcap } from '@interop/data-integrity-core'; /** * The topology parsed out of a delegated grant set: the WAS server origin (the * exact string a `WasClient` / `SERVER_URL` must match), the single space id, * and the per-collection capability keyed by WAS collection id. */ export interface ParsedGrants { serverUrl: string; spaceId: string; /** * Keyed by WAS collection id (e.g. `action-items`). */ byCollectionId: Record; } /** * Parses a single `invocationTarget` URL into its WAS components: the server * origin, the space id, and the collection (every routed grant is * collection-scoped, so `collectionId` is always present). `serverUrl` is * the bare origin (`protocol//host`) with no trailing slash, matching the shape * the reference server validates `SERVER_URL` into; the path grammar itself is * owned by `@interop/was-client`'s `parseSpaceTarget`. A collection- or * resource-depth target contributes its collection; a space-scoped or reserved * sub-endpoint target (e.g. bare `/space/:id` or `/space/:id/policy`) carries no * collection and is rejected -- login only ever requests collection-scoped * capabilities. * * @param target {string} an absolute WAS URL * @returns {{ serverUrl: string, spaceId: string, collectionId: string }} */ export declare function parseInvocationTarget(target: string): { serverUrl: string; spaceId: string; collectionId: string; }; /** * Parses a delegated grant set into the sync topology. Asserts a single server * origin and a single space across every grant, and routes each collection-scoped * grant to its WAS collection id. Every grant must be collection-scoped; a * space-scoped grant (no collection segment) is rejected. * * @param zcaps {IZcap[]} the delegated capabilities * @returns {ParsedGrants} */ export declare function parseGrants(zcaps: IZcap[]): ParsedGrants; //# sourceMappingURL=grants.d.ts.map