/** * Mastra `apiRoutes` that let the Factory SPA connect and reconnect * Platform-managed provider accounts without leaving Factory. * * The browser cannot talk to the integrations service itself — it has no * Platform session — so these routes mint Nango connect/reconnect sessions * server-side with the deploy's machine credentials * (`MASTRA_PLATFORM_ACCESS_TOKEN`/`MASTRA_PLATFORM_SECRET_KEY`) and hand the * short-lived session token back to the SPA, which drives the provider's * OAuth popup headlessly via `@nangohq/frontend`. Gating mirrors the * Platform's own rule for these providers: a signed-in organization member * (org:write parity with Linear), not an organization admin. */ import type { ApiRoute } from '@mastra/core/server'; import type { RouteAuth } from '../../../routes/route.js'; import { PlatformApiClient } from '../api-client.js'; export interface PlatformConnectProvider { /** Platform integration id used to mint connect sessions. */ integrationId: string; /** Connection `integrationId` variants that belong to this provider. */ connectionIntegrationIds: readonly string[]; } /** * Providers the Factory SPA may connect through these routes. Keys are the * SPA-facing provider slugs; `integrationId` is the Platform catalog id used * for new connect sessions. Provider-specific PRs extend this registry when * their Factory integrations are available. */ export declare const PLATFORM_CONNECT_PROVIDERS: Record; export interface BuildPlatformConnectRoutesOptions { auth: RouteAuth; client: PlatformApiClient; } /** * Build the `/web/integrations/platform/*` routes. Callers only mount these * when Platform machine credentials are configured. */ export declare function buildPlatformConnectRoutes(options: BuildPlatformConnectRoutesOptions): ApiRoute[]; //# sourceMappingURL=routes.d.ts.map