/** * Local index of access requests this machine created. * * A request is written the moment it is created, not on approval: a * `--no-input` run prints a URL and exits, and the agent that comes back * later must be able to find the request without having kept the id. * * Entries are namespaced by app address, network and gateway host, so two * apps, two networks or a dev deployment never see each other's requests. * * The DCR status carries no owner address, so an approved entry records the * grant id and the CLI resolves the owner from the gateway when it needs * one (a read does). */ export type StoredRequestStatus = "pending" | "approved" | "ready_for_read" | "completed" | "denied" | "expired"; export interface StoredRequest { requestId: string; /** App address that created it. */ appAddress: string; network: string; gatewayUrl: string; /** * Scopes asked for, verbatim (may carry `write:` prefixes), after the * app's live grant was merged in. */ scopes: string[]; /** Live grant entries the request gave up (`--remove-scopes`). */ removeScopes?: string[]; approvalUrl: string; createdAt: string; status: StoredRequestStatus; updatedAt: string; expiresAt?: string; /** Present once approved. */ grantId?: string; /** Approved scopes as reported by the status route. */ approvedScopes?: string[]; /** `enclave` or `personal_server`, once the status route reports it. */ delivery?: string; personalServerUrl?: string; /** Derivative questions carried on the request, when any. */ questions?: { derivedScope: string; sourceScopes: string[]; }[]; } export interface RequestsStore { save(request: StoredRequest): void; /** Merge fields into an existing entry; no-op when it is unknown. */ update(requestId: string, patch: Partial): void; get(requestId: string): StoredRequest | null; /** Newest first, optionally filtered to one app/network pair. */ list(filter?: { appAddress?: string; network?: string; }): StoredRequest[]; } export declare function createRequestsStore(filePath?: string): RequestsStore; //# sourceMappingURL=requests-store.d.ts.map