import { type ConnectAdvance, type ConnectAttempt, type ConnectController, type ConnectTransport } from "@opengeni/connect"; import { type ConnectView } from "./hooks/use-connect.js"; import { type OpenGeniText } from "./messages/runtime.js"; export declare const connectSetupStatus: (t: OpenGeniText) => Record; /** GitHub returned from a non-owner's install request: an organization owner must approve. */ export declare function isOwnerApprovalPending(attempt: Pick): boolean; /** * A built-in integration (Outlook, Gmail, ...) has one reviewed tool set, so * after the person signs in there is nothing left for them to choose: setup * continues to the preview and installs every reviewed tool by itself. Custom * OpenAPI or GraphQL sources keep the explicit tool review. */ export declare function isCuratedDefinitionAttempt(attempt: Pick): boolean; /** The next step a built-in integration takes by itself, or null when the * person must act (or an error needs their attention). */ export declare function curatedAutoAdvance(attempt: ConnectAttempt): ConnectAdvance | null; /** * Whether setup the person already authorized can carry on without its * dialog: the sign-in was started (or came back) and what remains is waiting * for it or a built-in integration's automatic steps. */ export declare function connectSetupContinuesWithoutDialog(attempt: ConnectAttempt, signInStarted: boolean): boolean; /** * Carry a setup on after its dialog closed or the person moved on: wait for * the sign-in to come back and take a built-in integration's automatic steps. * Closing the dialog never stops setup the person already authorized. The * server normally finishes a built-in integration in its own callback, so this * usually only waits. Resolves with the completed attempt, or null when setup * needs the person again (or could not be read); it then stays resumable. */ export declare function continueConnectSetup(transport: Pick, attempt: ConnectAttempt, options?: { signal?: AbortSignal; settleMs?: number; }): Promise; /** Microsoft said, or may have said, that an administrator must approve the app first. */ export declare function adminApprovalLink(attempt: Pick): { url: string; required: boolean; } | null; /** The provider's device-verification page, when it is a safe HTTPS link. */ export declare function deviceVerificationUrl(action: ConnectAttempt["nextAction"]): string | null; export type ConnectSetupFlowOptions = { /** Called synchronously from the person's tap, so a host can open its sign-in window. */ onAuthorize: (attempt: ConnectAttempt) => void | Promise; /** Called synchronously on Continue; hosts can reserve a window before advancing. */ onSelectAccount?: ((accountId: string) => void | Promise) | undefined; /** * A chat card hides "Check status" outside a finish-elsewhere step and offers * its own "Try again", so its error line points there instead. */ inChat?: boolean | undefined; }; /** What a Connect setup step shows and the steps a person can take from it. */ export type ConnectSetupFlow = { view: ConnectView; attempt: ConnectAttempt | null; action: ConnectAttempt["nextAction"] | null; /** A step is running, or the person is being sent to sign in. */ busy: boolean; navigating: boolean; awaitingOwner: boolean; autoFinishing: boolean; adminApproval: { url: string; required: boolean; } | null; terminal: boolean; /** The manual controls (form, sign-in, status and cancel) are shown. */ interactive: boolean; /** The step's controls submit as one form. */ formStep: boolean; verificationUrl: string | null; offersGitHubRequest: boolean; scopeLabel: string; scopeDescription: string; status: string; /** A plain line when the step could not continue, or null. */ errorText: string | null; /** * The person closed the sign-in window before finishing. Not an error: the * attempt still waits, and the sign-in button offers to try again. */ signInClosed: boolean; /** "Sign-in window closed…" while {@link signInClosed}, else null. */ notice: string | null; submitLabel: string; invoke: (operation: () => unknown | Promise) => void; /** Values go straight to the controller; nothing here keeps them. */ submitCredentials: (values: Record) => void; selectAccount: (accountId: string) => void; selectResources: (resourceIds: string[]) => void; install: (operationIds: string[]) => void; chooseTools: () => void; authorize: () => void; refresh: () => void; cancel: () => void; }; /** * What a Connect setup step shows and the steps a person can take from it. * Values a person types are passed straight to the controller and never kept * here; a built-in integration's automatic steps run once per attempt revision. */ export declare function useConnectSetupFlow(controller: ConnectController, options: ConnectSetupFlowOptions): ConnectSetupFlow;