/** * `/spaces/` -- the SpacesRepository (create / list spaces). */ export declare function spacesRoot(): string; /** * `/space/:spaceId` -- get / update / delete a space (no trailing slash). */ export declare function spacePath(spaceId: string): string; /** * `/space/:spaceId/` -- create a collection within a space (trailing slash). */ export declare function spaceItems(spaceId: string): string; /** * `/space/:spaceId/collections/` -- list collections (trailing slash). */ export declare function spaceCollections(spaceId: string): string; /** * `/space/:spaceId/export` -- export a space as a tar archive. */ export declare function spaceExport(spaceId: string): string; /** * `/space/:spaceId/import` -- import a tar archive into a space. */ export declare function spaceImport(spaceId: string): string; /** * `/space/:spaceId/backends` -- the backends available within a space (list, and * register a new `external` backend). */ export declare function spaceBackends(spaceId: string): string; /** * `/space/:spaceId/backends/:backendId` -- a single registered `external` * backend (replace / deregister by id). */ export declare function registeredBackend(spaceId: string, backendId: string): string; /** * `/space/:spaceId/quotas` -- the space-level storage quota report. */ export declare function spaceQuotas(spaceId: string): string; /** * `/space/:spaceId/policy` -- the space-level access-control policy resource. */ export declare function spacePolicy(spaceId: string): string; /** * `/space/:spaceId/linkset` -- the space-level linkset (policy discovery). */ export declare function spaceLinkset(spaceId: string): string; /** * `/space/:spaceId/zcaps/revocations/:capabilityId` -- submit a revocation of a * Space-rooted capability. The capability's `id` (typically a `urn:uuid:`) is * percent-encoded into the single final segment. * * `zcaps` is not a reserved path segment: the route sits four segments deep, * deeper than any Collection or Resource route, so it shadows nothing. */ export declare function spaceRevocation(spaceId: string, capabilityId: string): string; /** * `/space/:spaceId/:collectionId` -- get / update / delete a collection * (no trailing slash). */ export declare function collectionPath(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/` -- list items / add a resource * (trailing slash). */ export declare function collectionItems(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/policy` -- the collection-level access-control * policy resource. */ export declare function collectionPolicy(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/linkset` -- the collection-level linkset * (policy discovery). */ export declare function collectionLinkset(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/backend` -- the "Collection Backend Selected" * descriptor (the backend this collection is stored on). */ export declare function collectionBackend(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/quota` -- the per-collection storage quota * report (spec "Quotas"). */ export declare function collectionQuota(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/meta` -- the Collection metadata object * (server-managed timestamps / `createdBy` / `epoch` plus the user-writable * `custom` object). Versioned independently of the Collection Description. */ export declare function collectionMeta(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/query` -- the collection-level query endpoint, * whose body's `profile` selects the query (e.g. `changes`, `blinded-index`). */ export declare function collectionQuery(spaceId: string, collectionId: string): string; /** * `/space/:spaceId/:collectionId/:resourceId` -- get / put / delete a resource * (no trailing slash). */ export declare function resourcePath(spaceId: string, collectionId: string, resourceId: string): string; /** * `/space/:spaceId/:collectionId/:resourceId/meta` -- the resource metadata * object (server-managed properties plus the user-writable `custom` object). */ export declare function resourceMeta(spaceId: string, collectionId: string, resourceId: string): string; /** * `/space/:spaceId/:collectionId/:resourceId/policy` -- the resource-level * access-control policy resource. */ export declare function resourcePolicy(spaceId: string, collectionId: string, resourceId: string): string; /** * `/space/:spaceId/:collectionId/:resourceId/chunks/:chunkIndex` -- a single * stored chunk of a chunked Resource (the `chunked-streams` feature). Member * form, no trailing slash: get / put / delete one chunk by its ordinal index. * The `chunkIndex` is a non-negative integer, emitted verbatim (it is never a * reserved or dot segment, so it needs no percent-encoding). * * @param spaceId {string} * @param collectionId {string} * @param resourceId {string} * @param chunkIndex {number} * @returns {string} */ export declare function resourceChunkPath(spaceId: string, collectionId: string, resourceId: string, chunkIndex: number): string; /** * Resolves a path against the server base URL, producing an absolute URL * string suitable for zcap `invocationTarget`s. * * The path is joined onto `serverUrl`'s base path rather than its origin, so a * WAS deployment mounted under a sub-path (e.g. `https://host/was/`) keeps that * prefix. A bare-origin `serverUrl` behaves as before. * * @param options {object} * @param options.serverUrl {string} the server base URL * @param options.path {string} a leading-slash path (e.g. `/space/x`) * @returns {string} */ export declare function toUrl({ serverUrl, path }: { serverUrl: string; path: string; }): string; /** * Canonicalizes an absolute collection URL to its items/listing endpoint -- * the trailing-slash form (`/space/:id/:collectionId/`). This module owns the * trailing-slash rules, so callers that receive a collection URL from outside * (e.g. a public link) normalize it here rather than re-encoding the rule. * * @param collectionUrl {string} an absolute collection URL * @returns {string} */ export declare function collectionItemsUrl(collectionUrl: string): string; /** * The classification of a WAS pathname by the depth it addresses. The three * containment kinds map onto navigational handles; `sub-resource` covers every * reserved sub-endpoint the builders above produce (`/space/:id/policy`, * `/space/:id/:c/backend`, `/space/:id/:c/:r/meta`, ...), which has no handle of * its own. */ export type ParsedSpacePath = { kind: 'space'; spaceId: string; } | { kind: 'collection'; spaceId: string; collectionId: string; } | { kind: 'resource'; spaceId: string; collectionId: string; resourceId: string; } | { kind: 'sub-resource'; spaceId: string; segments: string[]; }; /** * Classifies an absolute `target` URL that is expected to live on this server, * relative to `serverUrl`'s base path -- so a WAS mounted under a sub-path (e.g. * `https://host/was/`) resolves just as a bare-origin deployment does, which * `parseSpacePath` alone cannot do (it would see a leading `was` segment). * * Returns `null` when `target` is not beneath `serverUrl` (another origin, or * another base path) or addresses something outside the `/space` tree (e.g. * `/kms`). The caller chooses whether that is an error. * * @param options {object} * @param options.serverUrl {string} the client's server base URL * @param options.target {string} an absolute URL on that server * @returns {ParsedSpacePath | null} */ export declare function parseSpaceTarget({ serverUrl, target }: { serverUrl: string; target: string; }): ParsedSpacePath | null; /** * Parses a server pathname back into the containment depth it addresses -- the * inverse of the builders above, kept next to them so the grammar is owned in * one place. Segments are percent-decoded (the builders re-encode them). * Returns `null` for a pathname outside the `/space/...` tree; the caller * chooses the error. A path that addresses a reserved sub-endpoint rather than * a space/collection/resource -- e.g. `/space/s/policy`, `/space/s/c/backend`, * or any 5-segment target like `/space/s/c/r/meta` -- is classified * `sub-resource`, never silently truncated to the nearest handle. * * @param pathname {string} a URL pathname (e.g. from `new URL(...).pathname`) * @returns {ParsedSpacePath | null} */ export declare function parseSpacePath(pathname: string): ParsedSpacePath | null; //# sourceMappingURL=paths.d.ts.map