/** * Mastra `apiRoutes` for the Jira intake feature. * * Registered alongside the other `/web/*` routes, behind the host auth gate. * Mirrors the Linear module minus everything OAuth: there is no * connect/callback flow, no state signer, and no per-org connection storage — * Jira credentials are deployment-global constructor config on the * integration instance. Every route still re-resolves the authenticated user * from the request and scopes intake selections by the caller's org. * * When the feature is disabled (no auth, or no intake storage), * `buildJiraRoutes` 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 { JiraIntegration } from './integration.js'; import type { JiraRulesIngress } from './rules.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?: JiraIntegration; /** 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; /** * 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 buildJiraRoutes(options: MountJiraRoutesOptions): ApiRoute[]; //# sourceMappingURL=routes.d.ts.map