New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nestjs/bullmq

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/bullmq - npm Package Compare versions

Comparing version 10.1.1 to 10.2.0

dist/bull.registrar.d.ts

1

dist/bull.constants.d.ts

@@ -6,2 +6,3 @@ export declare const PROCESSOR_METADATA = "bullmq:processor_metadata";

export declare const ON_WORKER_EVENT_METADATA = "bullmq:worker_events_metadata";
export declare const BULL_EXTRA_OPTIONS_TOKEN = "BULLMQ_EXTRA_OPTIONS";
//# sourceMappingURL=bull.constants.d.ts.map

3

dist/bull.constants.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ON_WORKER_EVENT_METADATA = exports.ON_QUEUE_EVENT_METADATA = exports.QUEUE_EVENTS_LISTENER_METADATA = exports.WORKER_METADATA = exports.PROCESSOR_METADATA = void 0;
exports.BULL_EXTRA_OPTIONS_TOKEN = exports.ON_WORKER_EVENT_METADATA = exports.ON_QUEUE_EVENT_METADATA = exports.QUEUE_EVENTS_LISTENER_METADATA = exports.WORKER_METADATA = exports.PROCESSOR_METADATA = void 0;
exports.PROCESSOR_METADATA = 'bullmq:processor_metadata';

@@ -9,1 +9,2 @@ exports.WORKER_METADATA = 'bullmq:worker_metadata';

exports.ON_WORKER_EVENT_METADATA = 'bullmq:worker_events_metadata';
exports.BULL_EXTRA_OPTIONS_TOKEN = 'BULLMQ_EXTRA_OPTIONS';

@@ -1,2 +0,2 @@

import { OnModuleInit, Type } from '@nestjs/common';
import { Type } from '@nestjs/common';
import { DiscoveryService, MetadataScanner, ModuleRef } from '@nestjs/core';

@@ -11,3 +11,3 @@ import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';

import { NestWorkerOptions } from './interfaces/worker-options.interface';
export declare class BullExplorer implements OnModuleInit {
export declare class BullExplorer {
private readonly moduleRef;

@@ -22,3 +22,3 @@ private readonly discoveryService;

constructor(moduleRef: ModuleRef, discoveryService: DiscoveryService, metadataAccessor: BullMetadataAccessor, metadataScanner: MetadataScanner);
onModuleInit(): void;
register(): void;
registerWorkers(): void;

@@ -25,0 +25,0 @@ getQueueOptions(queueToken: string, queueName: string, configKey?: string): NestQueueOptions;

@@ -28,3 +28,3 @@ "use strict";

}
onModuleInit() {
register() {
this.registerWorkers();

@@ -31,0 +31,0 @@ this.registerQueueEventListeners();

import { DynamicModule, Type } from '@nestjs/common';
import { QueueOptions } from 'bullmq';
import { RegisterFlowProducerAsyncOptions, RegisterFlowProducerOptions, SharedBullAsyncConfiguration } from './interfaces';
import { BullRootModuleOptions, RegisterFlowProducerAsyncOptions, RegisterFlowProducerOptions, SharedBullAsyncConfiguration } from './interfaces';
import { RegisterQueueAsyncOptions, RegisterQueueOptions } from './interfaces/register-queue-options.interface';

@@ -35,3 +34,3 @@ export declare class BullModule {

*/
static forRoot(bullConfig: QueueOptions): DynamicModule;
static forRoot(bullConfig: BullRootModuleOptions): DynamicModule;
/**

@@ -43,3 +42,3 @@ * Registers a globally available configuration under a specified "configKey".

*/
static forRoot(configKey: string, bullConfig: QueueOptions): DynamicModule;
static forRoot(configKey: string, bullConfig: BullRootModuleOptions): DynamicModule;
/**

@@ -46,0 +45,0 @@ * Registers a globally available configuration for all queues.

@@ -11,4 +11,6 @@ "use strict";

const bull_metadata_accessor_1 = require("./bull-metadata.accessor");
const bull_constants_1 = require("./bull.constants");
const bull_explorer_1 = require("./bull.explorer");
const bull_providers_1 = require("./bull.providers");
const bull_registrar_1 = require("./bull.registrar");
const utils_1 = require("./utils");

@@ -55,11 +57,16 @@ let BullModule = BullModule_1 = class BullModule {

: [undefined, keyOrConfig];
const { extraOptions, ...config } = sharedBullConfig;
const sharedBullConfigProvider = {
provide: (0, utils_1.getSharedConfigToken)(configKey),
useValue: sharedBullConfig,
useValue: config,
};
const extraOptionsProvider = {
provide: bull_constants_1.BULL_EXTRA_OPTIONS_TOKEN,
useValue: { ...extraOptions },
};
return {
global: true,
module: BullModule_1,
providers: [sharedBullConfigProvider],
exports: [sharedBullConfigProvider],
providers: [sharedBullConfigProvider, extraOptionsProvider],
exports: [sharedBullConfigProvider, extraOptionsProvider],
};

@@ -185,3 +192,6 @@ }

module: BullModule_1,
providers: [...asyncFlowProducerOptionsProviders, ...flowProducerProviders],
providers: [
...asyncFlowProducerOptionsProviders,
...flowProducerProviders,
],
exports: flowProducerProviders,

@@ -242,8 +252,17 @@ };

static createAsyncSharedConfigurationProviders(configKey, options) {
const { extraOptions, ...config } = options;
const extraOptionsProvider = {
provide: bull_constants_1.BULL_EXTRA_OPTIONS_TOKEN,
useValue: { ...extraOptions },
};
if (options.useExisting || options.useFactory) {
return [this.createAsyncSharedConfigurationProvider(configKey, options)];
return [
this.createAsyncSharedConfigurationProvider(configKey, config),
extraOptionsProvider,
];
}
const useClass = options.useClass;
const useClass = config.useClass;
return [
this.createAsyncSharedConfigurationProvider(configKey, options),
this.createAsyncSharedConfigurationProvider(configKey, config),
extraOptionsProvider,
{

@@ -279,3 +298,4 @@ provide: useClass,

imports: [core_1.DiscoveryModule],
providers: [bull_explorer_1.BullExplorer, bull_metadata_accessor_1.BullMetadataAccessor],
providers: [bull_explorer_1.BullExplorer, bull_metadata_accessor_1.BullMetadataAccessor, bull_registrar_1.BullRegistrar],
exports: [bull_registrar_1.BullRegistrar],
};

@@ -282,0 +302,0 @@ }

@@ -0,6 +1,8 @@

/// <reference types="node" />
import { Job } from 'bullmq';
import { URL } from 'url';
import { BullQueueAdvancedProcessor, BullQueueAdvancedSeparateProcessor } from './interfaces/bull-processor.interfaces';
export type BullQueueProcessor = BullQueueProcessorCallback | BullQueueAdvancedProcessor | BullQueueSeparateProcessor | BullQueueAdvancedSeparateProcessor;
export type BullQueueProcessorCallback = (job: Job) => Promise<unknown>;
export type BullQueueSeparateProcessor = string;
export type BullQueueSeparateProcessor = string | URL;
//# sourceMappingURL=bull.types.d.ts.map

@@ -7,3 +7,3 @@ "use strict";

if (!this._queueEvents) {
throw new Error('"QueueEvents" class has not yet been initialized. Make sure to interact with queue events instances after the "onModuleInit" lifecycle hook is triggered, for example, in the "onApplicationBootstrap" hook.');
throw new Error('"QueueEvents" class has not yet been initialized. Make sure to interact with queue events instances after the "onModuleInit" lifecycle hook is triggered, for example, in the "onApplicationBootstrap" hook, or if "manualRegistration" is set to true make sure to call "BullRegistrar.register()"');
}

@@ -10,0 +10,0 @@ return this._queueEvents;

@@ -7,3 +7,3 @@ "use strict";

if (!this._worker) {
throw new Error('"Worker" has not yet been initialized. Make sure to interact with worker instances after the "onModuleInit" lifecycle hook is triggered, for example, in the "onApplicationBootstrap" hook.');
throw new Error('"Worker" has not yet been initialized. Make sure to interact with worker instances after the "onModuleInit" lifecycle hook is triggered for example, in the "onApplicationBootstrap" hook, or if "manualRegistration" is set to true make sure to call "BullRegistrar.register()"');
}

@@ -10,0 +10,0 @@ return this._worker;

@@ -1,3 +0,4 @@

export { getQueueToken, JOB_REF } from '@nestjs/bull-shared';
export { JOB_REF, getQueueToken } from '@nestjs/bull-shared';
export * from './bull.module';
export * from './bull.registrar';
export * from './bull.types';

@@ -4,0 +5,0 @@ export * from './decorators';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JOB_REF = exports.getQueueToken = void 0;
exports.getQueueToken = exports.JOB_REF = void 0;
const tslib_1 = require("tslib");
var bull_shared_1 = require("@nestjs/bull-shared");
Object.defineProperty(exports, "JOB_REF", { enumerable: true, get: function () { return bull_shared_1.JOB_REF; } });
Object.defineProperty(exports, "getQueueToken", { enumerable: true, get: function () { return bull_shared_1.getQueueToken; } });
Object.defineProperty(exports, "JOB_REF", { enumerable: true, get: function () { return bull_shared_1.JOB_REF; } });
tslib_1.__exportStar(require("./bull.module"), exports);
tslib_1.__exportStar(require("./bull.registrar"), exports);
tslib_1.__exportStar(require("./bull.types"), exports);

@@ -10,0 +11,0 @@ tslib_1.__exportStar(require("./decorators"), exports);

@@ -0,7 +1,8 @@

import { WorkerOptions } from 'bullmq';
import { BullQueueProcessorCallback, BullQueueSeparateProcessor } from '../bull.types';
export interface BullQueueAdvancedProcessor {
export interface BullQueueAdvancedProcessor extends WorkerOptions {
concurrency?: number;
callback: BullQueueProcessorCallback;
}
export interface BullQueueAdvancedSeparateProcessor {
export interface BullQueueAdvancedSeparateProcessor extends WorkerOptions {
concurrency?: number;

@@ -8,0 +9,0 @@ path: BullQueueSeparateProcessor;

import { FactoryProvider, ModuleMetadata, Type } from '@nestjs/common';
import * as Bull from 'bullmq';
export interface BullModuleExtraOptions {
/**
* If set to true, the module will not register the Bull queues automatically.
* This is useful when you want to manually register the queues.
*/
manualRegistration?: boolean;
}
export interface BullRootModuleOptions extends Bull.QueueOptions {
extraOptions?: BullModuleExtraOptions;
}
export interface SharedBullConfigurationFactory {
createSharedConfiguration(): Promise<Bull.QueueOptions> | Bull.QueueOptions;
createSharedConfiguration(): Promise<BullRootModuleOptions> | BullRootModuleOptions;
}

@@ -23,3 +33,7 @@ export interface SharedBullAsyncConfiguration extends Pick<ModuleMetadata, 'imports'> {

inject?: FactoryProvider['inject'];
/**
* Extra options for the Bull module.
*/
extraOptions?: BullModuleExtraOptions;
}
//# sourceMappingURL=shared-bull-config.interface.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAdvancedSeparateProcessor = exports.isSeparateProcessor = exports.isAdvancedProcessor = exports.isProcessorCallback = void 0;
const url_1 = require("url");
function isProcessorCallback(processor) {

@@ -15,3 +16,3 @@ return 'function' === typeof processor;

function isSeparateProcessor(processor) {
return 'string' === typeof processor;
return 'string' === typeof processor || processor instanceof url_1.URL;
}

@@ -18,0 +19,0 @@ exports.isSeparateProcessor = isSeparateProcessor;

{
"name": "@nestjs/bullmq",
"version": "10.1.1",
"version": "10.2.0",
"description": "Nest - modern, fast, powerful node.js web framework (@bullmq)",

@@ -19,18 +19,18 @@ "homepage": "https://github.com/nestjs/bull",

"test": "jest --detectOpenHandles",
"test:e2e": "jest --config=e2e/jest-e2e.config.ts --detectOpenHandles --runInBand"
"test:e2e": "jest --config=e2e/jest-e2e.config.ts --detectOpenHandles --runInBand --forceExit"
},
"dependencies": {
"@nestjs/bull-shared": "^10.1.1",
"tslib": "2.6.2"
"@nestjs/bull-shared": "^10.2.0",
"tslib": "2.6.3"
},
"devDependencies": {
"@nestjs/common": "10.3.5",
"@nestjs/core": "10.3.5",
"@nestjs/platform-express": "10.3.5",
"@nestjs/testing": "10.3.5",
"@nestjs/common": "10.3.10",
"@nestjs/core": "10.3.10",
"@nestjs/platform-express": "10.3.10",
"@nestjs/testing": "10.3.10",
"@types/jest": "29.5.12",
"@types/node": "20.11.30",
"@types/node": "20.14.13",
"@types/reflect-metadata": "0.1.0",
"bullmq": "5.1.11",
"reflect-metadata": "0.2.1",
"bullmq": "5.10.4",
"reflect-metadata": "0.2.2",
"rxjs": "7.8.1"

@@ -46,3 +46,3 @@ },

},
"gitHead": "75e399fc410f0b2e093b9cdde22662ad34fcb065"
"gitHead": "c598ef33fac40ba3f40ce8fc971e89bef2f0666d"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc