/** * Mastra `apiRoutes` for the Jira intake feature. * * Registered alongside the other `/web/*` routes, behind the host auth gate. * Jira connections are owned by the caller's Mastra Platform organization; * provider requests stay server-side and flow through the integrations v2 * proxy. Every route re-resolves the authenticated user and scopes intake * selections by the caller's org. * * When the feature is disabled (no auth, or no intake storage), * `buildPlatformJiraRoutes` returns only `GET /web/jira/status`, which reports * `enabled:false` so the SPA can cleanly hide all Jira UI. */ import type { ApiRoute } from '@mastra/core/server'; import type { RouteAuth } from '../../../routes/route.js'; import type { IntakeStorage } from '../../../storage/domains/intake/base.js'; import type { JiraRulesIngress } from '../../jira/rules.js'; import type { PlatformJiraIntegration } from './integration.js'; /** * Non-secret diagnostic snapshot of every Jira feature gate, mirroring the * Linear diagnostics shape. Only booleans — never values. */ export interface JiraFeatureDiagnostics { jiraConfigured: boolean; factoryAuthEnabled: boolean; appDbConfigured: boolean; } export interface MountJiraRoutesOptions { /** * The integration instance providing REST access. Required for everything * beyond the disabled `status` route. */ jira?: PlatformJiraIntegration; /** Host auth seam. Intake selections are org-owned, so the feature is inert without it. */ auth: RouteAuth; /** * Cross-integration intake selection domain. Required for the issues route's * project filter; when absent, only the disabled `status` route is served. */ intake?: IntakeStorage; /** Whether the host configured the application database backing intake state. */ appDbConfigured: boolean; /** * Factory rules ingress for observed issues. When present, a board-scoped * issue listing also materializes new cards through the Jira event rules — * the same automatic intake Linear has. */ ingestFactoryIssues?: (input: JiraRulesIngress) => Promise; } /** * Build the Jira routes as Mastra `apiRoutes`. When the feature is disabled, * returns only the `status` route so the SPA can detect the disabled state. */ export declare function buildPlatformJiraRoutes(options: MountJiraRoutesOptions): ApiRoute[]; //# sourceMappingURL=routes.d.ts.map