/** * Saved Reporting Query Types * * Types for persisted reporting endpoints and saved-query execution. */ import type { QueryResult } from './queries'; /** Access control modes supported by persisted reporting endpoints. */ export type AuthMode = 'creator_only' | 'same_org' | 'all_orgs'; /** Lightweight metadata about an executed saved query. */ export interface SavedQueryInfo { /** Saved query identifier. */ id: string; /** Human-readable endpoint name. */ name: string; } /** Result returned when executing a saved reporting query over REST. */ export interface SavedQueryResult extends QueryResult { /** Metadata about the saved query definition. */ query: SavedQueryInfo; } /** A saved reporting endpoint created through the reporting MCP tools. */ export interface SavedQueryEndpoint { /** Saved endpoint UUID. */ id: string; /** Human-readable endpoint name. */ name: string; /** Relative API path for executing the endpoint. */ path: string; /** Absolute URL for executing the endpoint. */ url: string; /** Optional description of what the endpoint returns. */ description: string | null; /** The saved SQL statement. */ sql: string; /** Reporting objects referenced by the saved SQL. */ queriedObjects: string[]; /** Access control mode for endpoint execution. */ authMode: AuthMode; /** ISO 8601 creation timestamp. */ createdAt: string; /** ISO 8601 timestamp for the most recent access, if any. */ lastAccessedAt: string | null; /** Number of times the endpoint has been executed. */ accessCount: number; } /** Input used to persist a reporting query as a saved endpoint. */ export interface PersistQueryInput { /** Human-readable endpoint name. */ endpointName: string; /** Read-only SQL query to save. */ sql: string; /** Access control mode for endpoint execution. */ authMode: AuthMode; /** Optional description of the endpoint output. */ description?: string; } /** Result returned when persisting a query as a REST endpoint. */ export interface PersistQueryResult { /** Whether persistence succeeded. */ success: true; /** Metadata for the newly created endpoint. */ endpoint: { /** Saved endpoint UUID. */ id: string; /** Human-readable endpoint name. */ name: string; /** Relative API path for executing the endpoint. */ path: string; /** Absolute URL for executing the endpoint. */ url: string; /** ISO 8601 creation timestamp. */ createdAt: string; /** Access control mode applied to the endpoint. */ authMode: AuthMode; }; /** Human-readable success message. */ message: string; /** Example usage information for the new endpoint. */ usage: { /** HTTP method to use when calling the endpoint. */ method: 'GET'; /** Absolute URL for executing the endpoint. */ url: string; /** Required authorization headers. */ headers: { Authorization: string; }; /** Additional note about endpoint authentication. */ note: string; }; } /** Result returned when listing the caller's saved endpoints. */ export interface ListSavedQueryEndpointsResult { /** Saved endpoints owned by the caller. */ endpoints: SavedQueryEndpoint[]; /** Number of endpoints returned. */ count: number; } /** Result returned when removing a saved endpoint. */ export interface RemoveSavedQueryResult { /** Whether the removal succeeded. */ success: true; /** Human-readable success message. */ message: string; } //# sourceMappingURL=saved-queries.d.ts.map