adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
100 lines • 2.61 kB
TypeScript
import { DocumentJob, BatchJob } from './DocumentProcessor.js';
import { PaginatedResponse, ProcessingStatus, OutputFormat, DocumentConversionResponse } from '../types/api.js';
/**
* Job Management Service
*
* Handles job storage, retrieval, and lifecycle management
* for document conversion operations.
*/
export declare class JobManager {
private jobs;
private batches;
/**
* Get job by ID
*/
getJob(jobId: string): Promise<DocumentJob | null>;
/**
* Get batch by ID
*/
getBatch(batchId: string): Promise<BatchJob | null>;
/**
* Store job
*/
storeJob(job: DocumentJob): Promise<void>;
/**
* Store batch
*/
storeBatch(batch: BatchJob): Promise<void>;
/**
* Cancel a job
*/
cancelJob(jobId: string): Promise<{
success: boolean;
message: string;
statusCode?: number;
errorCode?: string;
}>;
/**
* List jobs with filtering and pagination
*/
listJobs(params: {
page: number;
limit: number;
sort: string;
order: 'asc' | 'desc';
filters: {
status?: ProcessingStatus;
fromDate?: Date;
toDate?: Date;
outputFormat?: OutputFormat;
search?: string;
};
}): Promise<PaginatedResponse<DocumentConversionResponse>>;
/**
* Get conversion statistics
*/
getStatistics(params: {
fromDate?: Date;
toDate?: Date;
groupBy: 'hour' | 'day' | 'week' | 'month';
}): Promise<{
totalJobs: number;
successfulJobs: number;
failedJobs: number;
successRate: number;
processingTime: {
average: number;
min: number;
max: number;
median: number;
};
inputFormatBreakdown: Record<string, number>;
outputFormatBreakdown: Record<string, number>;
errorBreakdown: Record<string, number>;
generatedAt: Date;
}>;
/**
* Retry a failed job
*/
retryJob(jobId: string, options?: any): Promise<{
success: boolean;
message: string;
statusCode?: number;
errorCode?: string;
job?: DocumentConversionResponse;
}>;
/**
* Get file data for download
*/
getJobFile(jobId: string): Promise<{
content: Buffer;
contentType: string;
filename: string;
size: number;
}>;
/**
* Calculate median from array of numbers
*/
private calculateMedian;
}
//# sourceMappingURL=JobManager.d.ts.map