import type { Connection, ConnectionCreateParams, ConnectionTokenParams, ConnectionTokenResult, Connector, ConnectorApp, ConnectorAppListParams, ConnectorAuthorizeParams, ConnectorAuthorizeResponse, ConnectorCreateParams, ConnectorListParams, ConnectorUpdateParams, CursorParams, Uuid } from "@introspection-sdk/types"; import type { HttpClient } from "../http.js"; import { Paginator } from "../pagination.js"; /** * Connections nested under a connector * (`/v1/connectors/{connector_id}/connections`) — one authorized subject * each (a Slack workspace, a person, an app credential). Every method * takes the connector id as its first argument; there is no PATCH on * connections, and the platform never serializes access/refresh tokens. */ export declare class ConnectionsApi { private readonly http; constructor(http: HttpClient); /** * List a connector's connections. `await` the result for the first * page, or `for await` it to stream every connection across pages * (fetched lazily; stop early to stop fetching). */ list(connectorId: Uuid, params?: CursorParams): Paginator; /** * Register a connection from a token the caller already holds * (registered mode). For the consent flow use * {@link ConnectorsApi.authorize} instead — the callback creates the * connection server-side. */ create(connectorId: Uuid, params: ConnectionCreateParams): Promise; get(connectorId: Uuid, connectionId: Uuid): Promise; /** * Revoke a connection. Named `revoke` rather than `delete` because it * destroys the provider token behind it — the subject must re-consent * to connect again. */ revoke(connectorId: Uuid, connectionId: Uuid): Promise; /** * Resolve a connector credential for the authenticated subject. For a * `person_authorized` connector this may return `authorization_pending` * with the mission and approval URL instead of a token. */ getToken(connectorId: Uuid, params?: ConnectionTokenParams): Promise; } /** * CRUD on `/v1/connectors` plus the consent-URL mint * (`POST /v1/oauth/connections/authorize`), with connections nested as * {@link ConnectionsApi} under `.connections`. * * Connector CRUD uses the project carried by the authenticated credential. * `client_secret` / `signing_secret` are write-only — accepted on create * and update, absent from every read. * */ export declare class ConnectorsApi { private readonly http; readonly connections: ConnectionsApi; constructor(http: HttpClient); /** * List connectors matching `params`. `await` the result for the first * page, or `for await` it to stream every connector across pages * (fetched lazily — `limit` sets the page size, `next` the starting * cursor; stop early to stop fetching). */ list(params?: ConnectorListParams): Paginator; /** Create a connector. Idempotent on `slug` — a repeat POST returns the live row. */ create(params: ConnectorCreateParams): Promise; get(connectorId: Uuid): Promise; update(connectorId: Uuid, params: ConnectorUpdateParams): Promise; /** Soft-delete a connector; the server revokes its connections. */ delete(connectorId: Uuid): Promise; /** * Search the provider's application catalogue. Pipedream connectors use * the returned slug when minting an application-specific Connect Link. */ listApps(connectorId: Uuid, params?: ConnectorAppListParams): Promise; /** * Mint a consent URL for a connector — the link a Business hands its * customer to connect (e.g. install the Slack app into a workspace). * * The URL embeds a single-use `state`, so it must not be cached: two * calls give two different URLs, and each is spent on first use. Raise * `expires_in` when handing the link to someone else to open later. A * chat-provider connector (`connector.requires_runtime === true`) 422s * unless `runtime` names the agent that replies. * * Pipedream connectors additionally require `app`, selected from * {@link listApps}. `allow_progressive_scopes` is optional and defaults to * false, matching Pipedream's Connect API. * * Passing `params.identity` mints a `customer` member for the asserted * end user, so it can raise a {@link ConflictError} (409) when the org has * reached its member limit — a plan conflict, not back-pressure. */ authorize(connectorId: Uuid, params?: ConnectorAuthorizeParams): Promise; } export declare function attachConnectors(http: HttpClient): ConnectorsApi; //# sourceMappingURL=connectors.d.ts.map