import type { IntegrationServiceDefinition } from "@automate.ax/catalog"; import z from "zod"; import { apiClient } from "../lib/api-client.js"; type IntegrationService = IntegrationServiceDefinition; interface AccountConnectionDependencies { accountApi: Pick; registerInterrupt: (handler: () => void) => () => void; } declare const ACCOUNT_SELECTOR_SCHEMA: z.ZodObject<{ org: z.ZodOptional; account: z.ZodString; }, z.core.$strip>; declare const ACCOUNT_MUTATION_SCHEMA: z.ZodObject<{ org: z.ZodOptional; account: z.ZodString; yes: z.ZodDefault; }, z.core.$strip>; declare const CONNECT_ACCOUNT_OPTS_SCHEMA: z.ZodObject<{ org: z.ZodOptional; connectionMethod: z.ZodOptional; noOpen: z.ZodDefault; noWait: z.ZodDefault; service: z.ZodOptional; }, z.core.$strip>; declare const CONNECTION_STATUS_OPTS_SCHEMA: z.ZodObject<{ org: z.ZodOptional; flow: z.ZodString; }, z.core.$strip>; declare const ACCOUNT_LIST_OPTS_SCHEMA: z.ZodObject<{ org: z.ZodOptional; cursor: z.ZodOptional; limit: z.ZodDefault>; }, z.core.$strip>; /** Validates account manager organization and confirmation options. */ declare const accountsOptsSchema: z.ZodObject<{ org: z.ZodOptional; yes: z.ZodDefault; }, z.core.$strip>; export declare const accountsCommand: import("../lib/command").Command; /** * Lists the connected accounts available to one organization. * * @param opts - Organization selector. */ export declare function listAccounts(opts: z.infer): Promise; /** Lists enabled services using the server-owned connection catalog. */ export declare function listServices(): Promise; /** * Shows one organization-linked integration account. * * @param opts - Organization and account selectors. */ export declare function showAccount(opts: z.infer): Promise; /** * Starts a form or browser-based integration account connection. * * @param opts - Connection service, method, and browser behavior. */ export declare function connectAccountCommand(opts: z.infer): Promise; /** * Returns the durable state of one browser authorization flow. * * @param opts - Organization and connection-flow selectors. */ export declare function connectionStatus(opts: z.infer): Promise; /** * Disconnects one account only from the selected organization. * * @param opts - Account selector and confirmation behavior. */ export declare function disconnectAccountCommand(opts: z.infer): Promise; /** * Revokes a shared account after showing its platform-wide impact. * * @param opts - Account selector and confirmation behavior. */ export declare function revokeAccountCommand(opts: z.infer): Promise; /** * Opens the interactive connected-account manager for one organization. * * @param opts - Organization selector and confirmation behavior. */ export declare function manageAccounts(opts: z.infer): Promise; /** * Connects one service through its selected connection method. * * @param organizationId - Organization receiving the account link. * @param services - Server-enabled integration service manifests. * @param opts - Explicit selectors and browser handoff behavior. * @param dependencies - Account API and interrupt registration used by the * connection flow. */ export declare function connectAccount(organizationId: string, services: readonly IntegrationService[], opts: Partial>, dependencies?: AccountConnectionDependencies): Promise<{ account: { checkedAt: Date | null; connectionMethodId: string; error: { code: string; message: string; } | null; id: string; label: string; scopes: string[]; serviceId: string; serviceSub: string; revokedAt: Date | null; revocation: { completedAt: Date | null; error: string | null; id: string; requestedAt: Date; status: "failed" | "succeeded" | "pending" | "unsupported"; } | null; status: "active" | "revocation_pending" | "revocation_failed" | "revoked"; }; connectionMethodId: string; serviceId: string; status: string; flowId?: undefined; resumeCommand?: undefined; url?: undefined; interrupted?: undefined; } | { connectionMethodId: string; flowId: string; resumeCommand: string; serviceId: string; status: string; url: string; account?: undefined; interrupted?: undefined; } | { account: { checkedAt: Date | null; connectionMethodId: string; error: { code: string; message: string; } | null; id: string; label: string; scopes: string[]; serviceId: string; serviceSub: string; revokedAt: Date | null; revocation: { completedAt: Date | null; error: string | null; id: string; requestedAt: Date; status: "failed" | "succeeded" | "pending" | "unsupported"; } | null; status: "active" | "revocation_pending" | "revocation_failed" | "revoked"; } | null; connectionMethodId: string; flowId: string; serviceId: string; status: string; url: string; resumeCommand?: undefined; interrupted?: undefined; } | { connectionMethodId: string; flowId: string; interrupted: boolean; resumeCommand: string; serviceId: string; status: string; url: string; account?: undefined; }>; export {}; //# sourceMappingURL=accounts.d.ts.map