import type { ApplicationService } from '@adonisjs/core/types'; import type { QueueInspectorContract } from './queue_inspector_contract.js'; export type { QueueOverview, QueueJobSummary, QueueJobDetail, QueueJobListResult, JobStatus, } from './queue_inspector_contract.js'; export { ALL_STATUSES } from './queue_inspector_contract.js'; import type { QueueOverview, QueueJobDetail, QueueJobListResult, JobStatus } from './queue_inspector_contract.js'; /** Minimal interface for a BullMQ Job as accessed by the inspector. */ interface BullMQJob { id: string | number; name: string; data: Record | null; opts: Record; timestamp: number; processedOn: number | null; finishedOn: number | null; failedReason: string | null; stacktrace: string[]; returnvalue: unknown; attemptsMade: number; progress: number | object; delay?: number; getState(): Promise; retry(): Promise; } /** Minimal interface for a BullMQ Queue as accessed by the inspector. */ interface BullMQQueue { getJobCounts(...statuses: string[]): Promise>; getJobs(statuses: string[], start: number, end: number): Promise<(BullMQJob | null)[]>; getJob(id: string): Promise; } /** Minimal interface for the @rlanz/bull-queue manager. */ interface QueueManager { get?(name: string): BullMQQueue | null; getOrSet?(name: string): BullMQQueue; getJobCounts?(...statuses: string[]): Promise>; } /** * Inspects Bull Queue jobs, counts, and allows retrying failed jobs. * * Designed for the full-page dashboard's Jobs section. * Only functional when `@rlanz/bull-queue` is installed. * All methods catch errors and return safe defaults. */ export declare class QueueInspector implements QueueInspectorContract { private queueManager; constructor(queueManager: QueueManager); /** * Detect whether `@rlanz/bull-queue` is available in the application container. */ static isAvailable(app: ApplicationService): Promise; /** * Get an overview of job counts by status across all queues. */ getOverview(): Promise; /** * List jobs filtered by status with pagination. * * @param status Job status to filter by, or `'all'` for every status. * @param page Page number (1-based). * @param perPage Jobs per page. */ listJobs(status?: JobStatus | 'all', page?: number, perPage?: number): Promise; /** * Get full detail for a single job by ID. */ getJob(id: string): Promise; /** * Retry a failed job. * * @returns `true` if the job was successfully requeued. */ retryJob(id: string): Promise; /** * Get the underlying BullMQ Queue instance from the queue manager. * * `@rlanz/bull-queue` exposes queues via `.get(name)` or `.getOrSet(name)`. */ private getQueue; /** * Infer a job's status from its internal fields (avoids async getState() call). */ private inferStatus; /** * Extract a human-readable job name from a raw Bull job name. * * `@rlanz/bull-queue` often stores the full file URL as the job name * (e.g. `file:///Users/…/app/jobs/send_email.ts`). We extract just * the class-style name from the filename. */ private static cleanJobName; /** Extract timing fields from a BullMQ job. */ private static extractTimings; /** Format a Bull job into our summary shape. */ private formatJobSummary; }