@lokalise/background-jobs-common
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,1 +5,3 @@ export * from './types'; | ||
export * from './processors/spy/types'; | ||
export * from './processors/factories/CommonBullmqFactory'; | ||
export * from './processors/factories/AbstractBullmqFactory'; |
@@ -5,1 +5,3 @@ export * from './types'; | ||
export * from './processors/spy/types'; | ||
export * from './processors/factories/CommonBullmqFactory'; | ||
export * from './processors/factories/AbstractBullmqFactory'; |
@@ -1,6 +0,6 @@ | ||
import type { Job, Queue, QueueOptions, Worker, WorkerOptions } from 'bullmq'; | ||
import type { BullmqProcessor } from '../../types'; | ||
export declare abstract class AbstractBullmqFactory<QueueType extends Queue<JobPayload, JobReturn>, QueueOptionsType extends QueueOptions, WorkerType extends Worker<JobPayload, JobReturn>, WorkerOptionsType extends WorkerOptions, ProcessorType extends BullmqProcessor<JobType, JobPayload, JobReturn>, JobType extends Job, JobPayload extends object, JobReturn> { | ||
import type { Queue, QueueOptions, Worker, WorkerOptions } from 'bullmq'; | ||
import type { BullmqProcessor, SafeJob } from '../../types'; | ||
export declare abstract class AbstractBullmqFactory<QueueType extends Queue<JobPayload, JobReturn>, QueueOptionsType extends QueueOptions, WorkerType extends Worker<JobPayload, JobReturn>, WorkerOptionsType extends WorkerOptions, ProcessorType extends BullmqProcessor<JobType, JobPayload, JobReturn>, JobType extends SafeJob<JobPayload, JobReturn>, JobPayload extends object, JobReturn> { | ||
abstract buildQueue(queueId: string, options?: QueueOptionsType): QueueType; | ||
abstract buildWorker(queueId: string, processor?: ProcessorType, options?: WorkerOptionsType): WorkerType; | ||
} |
@@ -5,5 +5,5 @@ import type { Processor, QueueOptions, WorkerOptions, Job } from 'bullmq'; | ||
import type { AbstractBullmqFactory } from './AbstractBullmqFactory'; | ||
export declare class CommonBullmqFactory<JobPayload extends object, JobReturn = void> implements AbstractBullmqFactory<Queue<JobPayload, JobReturn>, QueueOptions, Worker<JobPayload, JobReturn>, WorkerOptions, BullmqProcessor<Job, JobPayload, JobReturn>, Job, JobPayload, JobReturn> { | ||
export declare class CommonBullmqFactory<JobPayload extends object, JobReturn = void> implements AbstractBullmqFactory<Queue<JobPayload, JobReturn>, QueueOptions, Worker<JobPayload, JobReturn>, WorkerOptions, BullmqProcessor<Job, JobPayload, JobReturn>, Job<JobPayload, JobReturn>, JobPayload, JobReturn> { | ||
buildQueue(queueId: string, options: QueueOptions): Queue; | ||
buildWorker(queueId: string, processor?: string | URL | null | Processor, options?: WorkerOptions): Worker; | ||
} |
@@ -17,4 +17,5 @@ import type { ErrorReporter } from '@lokalise/node-core'; | ||
}; | ||
export type BullmqProcessor<J extends Job<T, R, N>, T = any, R = any, N extends string = string> = (job: J, token?: string) => Promise<R>; | ||
export type BackgroundJobProcessorDependencies<JobPayload extends object, JobReturn = void, JobType extends Job<JobPayload, JobReturn> = Job, QueueType extends Queue<JobPayload, JobReturn> = Queue<JobPayload, JobReturn>, QueueOptionsType extends QueueOptions = QueueOptions, WorkerType extends Worker<JobPayload, JobReturn> = Worker<JobPayload, JobReturn>, WorkerOptionsType extends WorkerOptions = WorkerOptions, ProcessorType extends BullmqProcessor<JobType, JobPayload, JobReturn> = BullmqProcessor<JobType, JobPayload, JobReturn>> = { | ||
export type SafeJob<T = any, R = any, N extends string = string> = Omit<Job<T, R, N>, 'scripts'>; | ||
export type BullmqProcessor<J extends SafeJob<T, R, N>, T = any, R = any, N extends string = string> = (job: J, token?: string) => Promise<R>; | ||
export type BackgroundJobProcessorDependencies<JobPayload extends object, JobReturn = void, JobType extends SafeJob<JobPayload, JobReturn> = Job, QueueType extends Queue<JobPayload, JobReturn> = Queue<JobPayload, JobReturn>, QueueOptionsType extends QueueOptions = QueueOptions, WorkerType extends Worker<JobPayload, JobReturn> = Worker<JobPayload, JobReturn>, WorkerOptionsType extends WorkerOptions = WorkerOptions, ProcessorType extends BullmqProcessor<JobType, JobPayload, JobReturn> = BullmqProcessor<JobType, JobPayload, JobReturn>> = { | ||
redis: Redis; | ||
@@ -21,0 +22,0 @@ transactionObservabilityManager: TransactionObservabilityManager; |
{ | ||
"name": "@lokalise/background-jobs-common", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40122
577