Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinajs/queue

Package Overview
Dependencies
Maintainers
0
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/queue - npm Package Compare versions

Comparing version 2.0.199 to 2.0.200

2

lib/cjs/interfaces.d.ts

@@ -50,3 +50,3 @@ import { AsyncService, Constructor, IInstanceCheck, IMappableService } from '@spinajs/di';

CreatedAt: DateTime;
Name: string;
get Name(): string;
Type: QueueMessageType;

@@ -53,0 +53,0 @@ Persistent: boolean;

@@ -57,2 +57,8 @@ "use strict";

class QueueMessage {
// event name
// defaults to class name
get Name() {
// default name is class name
return this.constructor.name;
}
constructor(data) {

@@ -106,3 +112,2 @@ if (data) {

this.Type = QueueMessageType.Job;
this.Name = this.constructor.name;
}

@@ -145,6 +150,7 @@ static async emit(val, options) {

const options = Reflect.getMetadata('queue:options', event);
const eName = event.Name ?? event.name;
const eName = event.Name ?? event.name ?? event.constructor.name;
const isJob = event.Type ? event.Type === QueueMessageType.Job : options ? options.type === 'job' : false;
const rOption = this.Routing[eName];
if (!rOption) {
this.Log.warn(`No routing for event ${eName} found, using default channel`);
return [isJob ? this.Options.defaultQueueChannel : this.Options.defaultTopicChannel];

@@ -151,0 +157,0 @@ }

@@ -50,3 +50,3 @@ import { AsyncService, Constructor, IInstanceCheck, IMappableService } from '@spinajs/di';

CreatedAt: DateTime;
Name: string;
get Name(): string;
Type: QueueMessageType;

@@ -53,0 +53,0 @@ Persistent: boolean;

@@ -49,2 +49,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

export class QueueMessage {
// event name
// defaults to class name
get Name() {
// default name is class name
return this.constructor.name;
}
constructor(data) {

@@ -96,3 +102,2 @@ if (data) {

this.Type = QueueMessageType.Job;
this.Name = this.constructor.name;
}

@@ -134,6 +139,7 @@ static async emit(val, options) {

const options = Reflect.getMetadata('queue:options', event);
const eName = event.Name ?? event.name;
const eName = event.Name ?? event.name ?? event.constructor.name;
const isJob = event.Type ? event.Type === QueueMessageType.Job : options ? options.type === 'job' : false;
const rOption = this.Routing[eName];
if (!rOption) {
this.Log.warn(`No routing for event ${eName} found, using default channel`);
return [isJob ? this.Options.defaultQueueChannel : this.Options.defaultTopicChannel];

@@ -140,0 +146,0 @@ }

{
"name": "@spinajs/queue",
"version": "2.0.199",
"version": "2.0.200",
"description": "queue sending & pulling made easy",

@@ -57,7 +57,7 @@

"dependencies": {
"@spinajs/configuration": "^2.0.199",
"@spinajs/di": "^2.0.199",
"@spinajs/exceptions": "^2.0.199",
"@spinajs/log": "^2.0.199",
"@spinajs/orm": "^2.0.199",
"@spinajs/configuration": "^2.0.200",
"@spinajs/di": "^2.0.200",
"@spinajs/exceptions": "^2.0.200",
"@spinajs/log": "^2.0.200",
"@spinajs/orm": "^2.0.200",
"luxon": "^3.2.1"

@@ -64,0 +64,0 @@ },

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