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

smqp

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smqp - npm Package Compare versions

Comparing version 7.1.3 to 7.1.4

4

CHANGELOG.md
Changelog
=========
# 7.1.4
- type declare broker state from `getState()`
# 7.1.3

@@ -5,0 +9,0 @@

8

package.json
{
"name": "smqp",
"version": "7.1.3",
"version": "7.1.4",
"type": "module",

@@ -61,8 +61,8 @@ "description": "Synchronous message queueing package",

"@babel/cli": "^7.21.0",
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"c8": "^7.13.0",
"chai": "^4.3.7",
"chronokinesis": "^4.0.1",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"markdown-toc": "^1.2.0",

@@ -69,0 +69,0 @@ "mocha": "^10.2.0"

@@ -1,5 +0,5 @@

import { Queue, Consumer, queueOptions, onMessage, consumeOptions, deleteQueueOptions } from "./Queue.js";
import { Queue, Consumer, queueOptions, onMessage, consumeOptions, deleteQueueOptions, QueueState } from "./Queue.js";
import { Shovel, ShovelDestination, shovelOptions } from "./Shovel.js";
import { Message, MessageProperties } from "./Message.js";
import { Exchange, exchangeType, Binding, exchangeOptions, bindingOptions } from "./Exchange.js";
import { Exchange, exchangeType, Binding, exchangeOptions, bindingOptions, ExchangeState } from "./Exchange.js";

@@ -50,2 +50,7 @@ type subscribeOptions = {

export interface BrokerState {
exchanges?: ExchangeState[];
queues?: QueueState[];
}
export function Broker(owner?: any): Broker;

@@ -87,4 +92,12 @@ export class Broker {

close(): void;
getState(onlyWithContent?: boolean): any;
recover(state: any): Broker;
/**
* Get broker state with durable entities
*/
getState(): BrokerState;
/**
* Get broker state with durable entities
* @param onlyWithContent [boolean] only return state if any durable exchanges or queues
*/
getState(onlyWithContent: boolean): BrokerState | undefined;
recover(state?: BrokerState): Broker;
publish(exchangeName: string, routingKey: string, content?: any, options?: MessageProperties): number;

@@ -91,0 +104,0 @@ get(queueName: string, { noAck }?: {

import { MessageProperties } from './Message.js';
import { Queue, Consumer } from './Queue.js';
import { Queue, Consumer, QueueState } from './Queue.js';

@@ -17,2 +17,18 @@ type exchangeType = 'topic' | 'direct';

export interface BindingState {
id: string;
options: bindingOptions;
queueName: string;
pattern: string;
}
export interface ExchangeState {
name: string;
type: exchangeType;
options: exchangeOptions;
bindings?: BindingState[];
/** Undelivered message queue */
deliveryQueue?: QueueState;
}
export interface Exchange {

@@ -32,3 +48,12 @@ name: string;

stop(): void;
recover(state: any, getQueue: CallableFunction): Exchange;
/**
* Recover exchange
*/
recover(): Exchange;
/**
* Recover exchange
* @param state
* @param getQueue function to get queue instance from broker
*/
recover(state: ExchangeState, getQueue: CallableFunction): Exchange;
getBinding(queueName: string, pattern: string): Binding;

@@ -35,0 +60,0 @@ emit(eventName: string, content?: any): any;

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

import { Message, MessageFields, MessageProperties } from './Message.js';
import { Message, MessageFields, MessageProperties, MessageMessage } from './Message.js';

@@ -33,2 +33,8 @@ type onMessage = (

export interface QueueState {
name: string;
options: queueOptions;
messages?: MessageMessage[];
}
export interface Queue {

@@ -42,3 +48,3 @@ name: string;

get stopped(): boolean;
queueMessage(fields: MessageFields, content: any, properties: MessageProperties): number;
queueMessage(fields: MessageFields, content?: any, properties?: MessageProperties): number;
evictFirst(compareMessage?: Message): boolean;

@@ -61,4 +67,4 @@ consume(onMessage: onMessage, consumeOptions?: consumeOptions, owner?: any): Consumer;

purge(): number;
getState(): any;
recover(state: any): number | Queue;
getState(): QueueState;
recover(state?: QueueState): Queue;
delete(options?: deleteQueueOptions): {

@@ -65,0 +71,0 @@ messageCount: number;

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