import { type HttpContext } from "./http.js"; export type AcceptHolderType = "guest" | "federated" | "*"; export interface ScopeTargetInstance { readonly kind: "instance"; } export interface ScopeTargetThread { readonly kind: "thread"; readonly thread_id: string; } export interface ScopeTargetNamespace { readonly kind: "namespace"; readonly namespace: string; } export type ScopeTarget = ScopeTargetInstance | ScopeTargetThread | ScopeTargetNamespace; export interface MembershipEnvelope { readonly preset?: string; readonly ttlSeconds?: number; readonly caveats?: { readonly max_depth?: number; readonly max_fanout?: number; readonly budget?: number; }; readonly label?: string; } export interface IssueInviteOptions { readonly issuerDid?: string; readonly scopeTarget?: ScopeTarget; readonly scopes?: ReadonlyArray; readonly ttlSeconds: number; readonly maxUses: number; readonly acceptHolderTypes?: ReadonlyArray; readonly deviceLabel?: string; readonly notes?: string; readonly studioUrl?: string; readonly membership?: MembershipEnvelope; } export interface IssueInviteResult { readonly invite_id: string; readonly record_id: string; readonly issuer_did: string; readonly issuer_key_fp: string; readonly issued_at: string; readonly expires_at: string; readonly max_uses: number; readonly uses_remaining: number; readonly redirect_url: string; readonly qr_payload: string; } export interface InvitePreview { readonly invite_id: string; readonly issuer_did: string | null; readonly issuer_actor: string | null; readonly issuer_key_fp: string | null; readonly scope_target: ScopeTarget | null; readonly scopes: ReadonlyArray; readonly device_label: string | null; readonly issued_at: string | null; readonly expires_at: string | null; readonly max_uses: number | null; readonly uses_remaining: number; readonly revoked: boolean; readonly expired: boolean; readonly accept_holder_types: ReadonlyArray; readonly signature: { readonly alg: string; readonly key_fp: string; readonly value: string; } | null; } export type InviteStatus = "active" | "redeemed" | "revoked" | "expired" | "exhausted"; export interface InviteListItem { readonly invite_id: string; readonly issuer_did: string | null; readonly issuer_actor: string | null; readonly device_label: string | null; readonly scopes: ReadonlyArray; readonly accept_holder_types: ReadonlyArray; readonly issued_at: string | null; readonly expires_at: string | null; readonly max_uses: number | null; readonly uses_remaining: number; readonly revoked: boolean; readonly revoked_at: string | null; readonly expired: boolean; readonly status: InviteStatus; readonly notes?: string | null; readonly last_used_at?: string | null; } export type InviteAuditEventKind = "redeemed" | "revoked" | "exhausted" | "refused"; export interface InviteAuditEvent { readonly event_kind: InviteAuditEventKind | null; readonly invite_id: string | null; readonly occurred_at: string | null; readonly holder_type: string | null; readonly holder_did: string | null; readonly holder_pubkey: string | null; readonly bearer_token_id: string | null; readonly bearer_sa_id: string | null; readonly uses_remaining_after: number | null; readonly revoker_actor: string | null; readonly revoker_reason: string | null; readonly refusal_reason: string | null; readonly actor: string; readonly clock: number; } export interface RevokeResult { readonly invite_id: string; readonly record_id?: string; readonly revoked: boolean; readonly already_revoked: boolean; } export interface BulkRevokeResult { readonly revoked_count: number; readonly invite_ids: ReadonlyArray; readonly filter: "expired" | "exhausted"; } export interface ScopePreset { readonly id: string; readonly label: string; readonly description: string; readonly scopes: ReadonlyArray; } export interface InviteTemplate { readonly template_id: string; readonly label: string; readonly ttl_seconds: number; readonly max_uses: number; readonly scopes: ReadonlyArray; readonly accept_holder_types: ReadonlyArray; readonly notes?: string | null; readonly created_at?: string | null; } export interface RedeemOptionsGuest { readonly holderType: "guest"; readonly holderPubkey: string; readonly holderLabel?: string; readonly memberLabel?: string; readonly custody?: "custodial" | "device"; } export interface RedeemOptionsFederated { readonly holderType: "federated"; readonly holderDid: string; readonly holderProof: string; readonly holderProofIssuedAtMs: number; readonly signerInstanceDid: string; } export type RedeemOptions = RedeemOptionsGuest | RedeemOptionsFederated; export interface RedeemResult { readonly bearer: string; readonly actor_did: string; readonly scopes: ReadonlyArray; readonly expires_at: string; readonly bearer_expires_at?: string; readonly instance_url: string; readonly membership?: { readonly member_did: string; readonly master_did: string; readonly grant_id: string; } | null; } export interface SignAttestationResult { readonly invite_id: string; readonly holder_did: string; readonly holder_proof_issued_at_ms: number; readonly holder_proof: string; readonly signer_instance_did: string; } export declare class ClientInvites { private readonly ctx; constructor(ctx: HttpContext); issue(opts: IssueInviteOptions): Promise; list(filter?: { status?: InviteStatus; }): Promise; preview(inviteId: string): Promise; redeem(inviteId: string, opts: RedeemOptions): Promise; revoke(inviteId: string, reason?: string): Promise; audit(): Promise; bulkRevoke(filter: "expired" | "exhausted", reason?: string): Promise; signAttestation(opts: { readonly inviteId: string; readonly issuerBase: string; readonly holderDid: string; }): Promise; scopePresets(): Promise; templates(): Promise; saveTemplate(t: { readonly label: string; readonly ttlSeconds: number; readonly maxUses: number; readonly scopes: ReadonlyArray; readonly acceptHolderTypes?: ReadonlyArray; readonly notes?: string; }): Promise; }