/** * @module api/ibgib-api-bridge * * Base REST API bridge class for interacting with serve-gib endpoints from browser clients. */ import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs"; import { FlatIbGibGraph } from "@ibgib/core-gib/dist/common/other/graph-types.mjs"; export declare class IbGibApiBridge { protected lc: string; protected parseResponseJson(response: Response, url: string): Promise; /** * Posts a single genesis keystone ibgib to the server to create a new domain. * Optionally accepts siteUsername and developer exception key. */ postGenesisKeystone(keystoneIbGib: IbGib_V1, options?: { siteUsername?: string; siteUsernameExceptionKey?: string; }): Promise<{ success: boolean; pending?: boolean; statusCode?: number; message?: string; addr?: string; siteUsername?: string; }>; /** * PUTs an evolved domain keystone and any related keystones to the server. */ putEvolveKeystone({ domainAddr, keystoneIbGib, relatedKeystoneIbGibs, revokeTokens }: { domainAddr: string; keystoneIbGib: IbGib_V1; relatedKeystoneIbGibs?: IbGib_V1[]; revokeTokens?: Record; }): Promise<{ success: boolean; message?: string; }>; /** * Looks up a primary identity keystone on the server by username or email. */ lookupPrimaryKeystone({ identifier }: { identifier: string; }): Promise<{ success: boolean; message?: string; tjpAddr?: string; siteUsername?: string; primaryKeystoneIbGib?: IbGib_V1; }>; /** * Checks if an email address is available on the server before local genesis. */ checkEmailAvailability({ email }: { email: string; }): Promise<{ available: boolean; message?: string; }>; /** * Checks if a site username is available on the server before local genesis. */ checkSiteUsernameAvailability({ siteUsername }: { siteUsername: string; }): Promise<{ available: boolean; requiresExceptionKey?: boolean; reason?: string; message?: string; retryAfterMs?: number; }>; /** * Submits an application for a developer program short handle / brand exception key. */ requestSiteUsernameException({ siteUsername, email, applicantName, projectTitle, reason, profileUrl }: { siteUsername: string; email: string; applicantName?: string; projectTitle?: string; reason: string; profileUrl?: string; }): Promise<{ success: boolean; requestId?: string; message?: string; }>; getKeystoneGraph(domainAddr: string): Promise<{ success: boolean; message?: string; graph?: Record; }>; /** * GETs a single ibGib frame from the server's domain space. */ getIbGib(domainAddr: string, ibGibAddr: string, getLatest?: boolean): Promise<{ success: boolean; message?: string; ibGib?: IbGib_V1; }>; /** * GETs the full dependency graph of an ibGib from the server's domain space. */ getIbGibGraph(domainAddr: string, ibGibAddr: string, getLatest?: boolean): Promise<{ success: boolean; message?: string; graph?: Record; addr?: string; }>; /** * Posts a request to generate a 6-digit verification code, save it to pending staging, and dispatch an email. */ postVerificationCode({ email, primaryTjpAddr }: { email: string; primaryTjpAddr?: string; }): Promise<{ success: boolean; message?: string; }>; /** * Alias for postVerificationCode (deprecated name). * * @deprecated Use postVerificationCode instead. */ postMagicLink(opts: { email: string; primaryTjpAddr: string; }): Promise<{ success: boolean; message?: string; }>; /** * Posts a 6-digit verification code to activate an identity and verify email. */ postVerifyCode({ email, primaryTjpAddr, code }: { email: string; primaryTjpAddr: string; code: string; }): Promise<{ success: boolean; message?: string; }>; /** * Posts a custodian genesis request (`POST /api/identity/custodian/genesis`) * to obtain the primary identity keystone (or primaryTjpAddr) and a fresh, single-turn * `CustodianRequirements` payload for delegate registration. */ postCustodianGenesis({ email, code, username, siteUsername, siteUsernameExceptionKey, }: { email: string; code?: string; username?: string; siteUsername?: string; siteUsernameExceptionKey?: string; }): Promise<{ success: boolean; isNewIdentity?: boolean; primaryTjpAddr?: string; primaryKeystone?: IbGib_V1; primaryGraph?: FlatIbGibGraph; custodianReqs?: any; message?: string; }>; /** * Posts a client delegate keystone containing single-turn `custodianReqs` * to register it with the server custodian node (`POST /api/identity/custodian/register-delegate`). */ postCustodianRegisterDelegate({ delegateKeystone }: { delegateKeystone: IbGib_V1; }): Promise<{ success: boolean; primaryTjpAddr?: string; evolvedPrimaryKeystone?: IbGib_V1; primaryGraph?: FlatIbGibGraph; message?: string; }>; /** * Retrieves safe public SSO client configuration (`GET /api/identity/sso/config`). */ getSsoConfig(): Promise<{ success: boolean; providers?: Record; message?: string; }>; /** * Posts an OAuth authorization code (`POST /api/identity/sso/login`) * to complete SSO token exchange and obtain custodian requirements. */ postSsoLogin({ code, providerId, redirectUri, username, siteUsername, siteUsernameExceptionKey, }: { code: string; providerId: string; redirectUri: string; username?: string; siteUsername?: string; siteUsernameExceptionKey?: string; }): Promise<{ success: boolean; isNewIdentity?: boolean; primaryTjpAddr?: string; primaryKeystone?: IbGib_V1; primaryGraph?: FlatIbGibGraph; custodianReqs?: any; userInfo?: any; message?: string; }>; } /** * Returns the global API bridge instance, creating a default IbGibApiBridge if not set. */ export declare function getApiBridge(): IbGibApiBridge; /** * Registers a custom API bridge instance (e.g. SpaceGibApiBridge or app-specific subclass). */ export declare function setApiBridge(bridge: IbGibApiBridge): void; //# sourceMappingURL=ibgib-api-bridge.d.mts.map