Socket
Socket
Sign inDemoInstall

mqtts

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mqtts - npm Package Compare versions

Comparing version 1.4.4 to 1.5.0

1

dist/flow/incoming.flows.d.ts

@@ -5,2 +5,3 @@ import { MqttMessage } from '../mqtt.message';

import { DefaultPacketWriteOptions } from '../packets/packet-writer';
export declare function incomingPingFlow(): PacketFlowFunc<DefaultPacketReadResultMap, DefaultPacketWriteOptions, void>;
export declare function incomingPublishFlow(message: MqttMessage, identifier: number): PacketFlowFunc<DefaultPacketReadResultMap, DefaultPacketWriteOptions, MqttMessage>;

21

dist/flow/incoming.flows.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.incomingPublishFlow = void 0;
exports.incomingPublishFlow = exports.incomingPingFlow = void 0;
const mqtt_utilities_1 = require("../mqtt.utilities");
const packet_writer_1 = require("../packets/packet-writer");
const mqtt_constants_1 = require("../mqtt.constants");
// PINGREQ is from client to server
//
// export function incomingPingFlow(): PacketFlowFunc<DefaultPacketReadResultMap, void> {
// return success => ({
// start: () => {
// success();
// return new PingResponsePacket();
// },
// });
// }
function incomingPingFlow() {
return success => ({
start: () => {
success();
return packet_writer_1.defaultWrite(mqtt_constants_1.PacketType.PingResp);
},
});
}
exports.incomingPingFlow = incomingPingFlow;
function incomingPublishFlow(message, identifier) {

@@ -18,0 +17,0 @@ return success => ({

@@ -67,2 +67,3 @@ /// <reference types="node" />

protected onPublish(publish: PublishRequestPacket): void;
protected onPingReq(): void;
protected logReceivedPacket(packet: {

@@ -69,0 +70,0 @@ type: PacketType;

@@ -296,2 +296,6 @@ "use strict";

}
case mqtt_constants_1.PacketType.PingReq: {
this.onPingReq();
break;
}
case mqtt_constants_1.PacketType.Disconnect: {

@@ -339,2 +343,10 @@ this.setDisconnected('disconnect packet received').catch(e => this.emitWarning(e));

}
onPingReq() {
this.startFlow(flow_1.incomingPingFlow())
.then(() => this.pingDebug(`Server-PingPong @ ${Date.now()}`))
.catch(e => {
this.emitWarning(e);
this.pingDebug(`Server-PingPong failed. (${e.message})`);
});
}
logReceivedPacket(packet) {

@@ -341,0 +353,0 @@ if (packet.type !== mqtt_constants_1.PacketType.PingReq && packet.type !== mqtt_constants_1.PacketType.PingResp)

@@ -12,2 +12,3 @@ import { PacketType } from '../mqtt.constants';

import { PingResponsePacket } from './ping.response.packet';
import { PingRequestPacket } from './ping.request.packet';
export declare type PacketReadResultMap = {

@@ -29,3 +30,4 @@ [x in PacketType]: unknown;

[PacketType.PingResp]: PingResponsePacket;
[PacketType.PingReq]: PingRequestPacket;
}
export declare const DefaultPacketReadMap: PacketReadMap<DefaultPacketReadResultMap>;

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

const ping_response_packet_1 = require("./ping.response.packet");
const ping_request_packet_1 = require("./ping.request.packet");
exports.DefaultPacketReadMap = {

@@ -24,4 +25,5 @@ [mqtt_constants_1.PacketType.ConnAck]: connect_response_packet_1.readConnectResponsePacket,

[mqtt_constants_1.PacketType.UnsubAck]: unsubscribe_response_packet_1.readUnsubscribePacket,
[mqtt_constants_1.PacketType.PingReq]: ping_request_packet_1.readPingRequestPacket,
[mqtt_constants_1.PacketType.PingResp]: ping_response_packet_1.readPingResponsePacket,
};
//# sourceMappingURL=packet-reader.js.map

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

const ping_request_packet_1 = require("./ping.request.packet");
const ping_response_packet_1 = require("./ping.response.packet");
class PacketWriter {

@@ -57,3 +58,4 @@ constructor(logger, writeMap = exports.DefaultPacketWriteMap) {

[mqtt_constants_1.PacketType.PingReq]: ping_request_packet_1.writePingRequestPacket,
[mqtt_constants_1.PacketType.PingResp]: ping_response_packet_1.writePingResponsePacket,
};
//# sourceMappingURL=packet-writer.js.map
import { PacketWriteResult } from '../mqtt.packet';
export declare class PingRequestPacket {
}
export declare function writePingRequestPacket(): PacketWriteResult;
export declare function readPingRequestPacket(_: unknown, remaining: number): PingRequestPacket;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.writePingRequestPacket = void 0;
exports.readPingRequestPacket = exports.writePingRequestPacket = exports.PingRequestPacket = void 0;
const mqtt_utilities_1 = require("../mqtt.utilities");
class PingRequestPacket {
}
exports.PingRequestPacket = PingRequestPacket;
function writePingRequestPacket() {

@@ -8,2 +12,7 @@ return {};

exports.writePingRequestPacket = writePingRequestPacket;
function readPingRequestPacket(_, remaining) {
mqtt_utilities_1.expectRemainingLength(remaining, 0);
return new PingRequestPacket();
}
exports.readPingRequestPacket = readPingRequestPacket;
//# sourceMappingURL=ping.request.packet.js.map

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

import { PacketWriteResult } from '../mqtt.packet';
export declare class PingResponsePacket {
}
export declare function readPingResponsePacket(_: unknown, remaining: number): PingResponsePacket;
export declare function writePingResponsePacket(): PacketWriteResult;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readPingResponsePacket = exports.PingResponsePacket = void 0;
exports.writePingResponsePacket = exports.readPingResponsePacket = exports.PingResponsePacket = void 0;
const mqtt_utilities_1 = require("../mqtt.utilities");

@@ -13,2 +13,6 @@ class PingResponsePacket {

exports.readPingResponsePacket = readPingResponsePacket;
function writePingResponsePacket() {
return {};
}
exports.writePingResponsePacket = writePingResponsePacket;
//# sourceMappingURL=ping.response.packet.js.map
{
"name": "mqtts",
"version": "1.4.4",
"version": "1.5.0",
"description": "MQTT client in Typescript",

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

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