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

@signalapp/mock-server

Package Overview
Dependencies
Maintainers
5
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signalapp/mock-server - npm Package Compare versions

Comparing version 2.17.0 to 2.18.0

2

package.json
{
"name": "@signalapp/mock-server",
"version": "2.17.0",
"version": "2.18.0",
"description": "Mock Signal Server for writing tests",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -96,2 +96,9 @@ /// <reference types="node" />

}>;
export type ReceiptQueueEntry = Readonly<{
source: Device;
uuidKind: UUIDKind;
envelopeType: EnvelopeType;
receiptMessage: Proto.IReceiptMessage;
content: Proto.IContent;
}>;
export type StoryQueueEntry = Readonly<{

@@ -140,2 +147,3 @@ source: Device;

private readonly messageQueue;
private readonly receiptQueue;
private readonly storyQueue;

@@ -195,2 +203,3 @@ private readonly syncMessageQueue;

waitForMessage(): Promise<MessageQueueEntry>;
waitForReceipt(): Promise<ReceiptQueueEntry>;
waitForStory(): Promise<StoryQueueEntry>;

@@ -205,2 +214,3 @@ waitForSyncMessage(predicate?: ((entry: SyncMessageQueueEntry) => boolean)): Promise<SyncMessageQueueEntry>;

private handleDataMessage;
private handleReceiptMessage;
private handleStoryMessage;

@@ -207,0 +217,0 @@ private encrypt;

@@ -176,2 +176,3 @@ "use strict";

messageQueue = new util_1.PromiseQueue();
receiptQueue = new util_1.PromiseQueue();
storyQueue = new util_1.PromiseQueue();

@@ -492,2 +493,5 @@ syncMessageQueue = new util_1.PromiseQueue();

}
else if (content.receiptMessage) {
this.handleReceiptMessage(unsealedSource, uuidKind, unsealedType, content);
}
else {

@@ -717,2 +721,5 @@ handled = false;

}
async waitForReceipt() {
return this.receiptQueue.shift();
}
async waitForStory() {

@@ -869,2 +876,13 @@ return this.storyQueue.shift();

}
handleReceiptMessage(source, uuidKind, envelopeType, content) {
const { receiptMessage } = content;
assert_1.default.ok(receiptMessage, 'receiptMessage must be present');
this.receiptQueue.push({
source,
uuidKind,
envelopeType,
receiptMessage,
content,
});
}
handleStoryMessage(source, uuidKind, envelopeType, content) {

@@ -871,0 +889,0 @@ const { storyMessage } = content;

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