🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@script-bridge/server

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@script-bridge/server - npm Package Compare versions

Comparing version
0.1.9
to
0.2.2
+1
-1
dist/server.d.ts

@@ -20,3 +20,3 @@ import { EventEmitter } from 'node:events';

export declare class ScriptBridgeServer extends EventEmitter<ServerEvents> {
static readonly PROTOCOL_VERSION = 1;
static readonly PROTOCOL_VERSION = 2;
readonly sessions: Map<string, Session>;

@@ -23,0 +23,0 @@ readonly port: number;

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

const session = this.sessions.get(body.sessionId);
if (!session)
return void res.sendStatus(400);
if (!session) {
res.json({
type: protocol_1.PayloadType.Response,
error: true,
errorReason: protocol_1.ResponseErrorReason.InvalidSession,
message: 'Invalid session',
});
return;
}
if (body.type === protocol_1.PayloadType.Request) {

@@ -115,3 +122,8 @@ this.emit('requestReceive', body, session);

else {
res.sendStatus(400);
res.json({
type: protocol_1.PayloadType.Response,
error: true,
errorReason: protocol_1.ResponseErrorReason.InvalidPayload,
message: 'Invalid payload type',
});
}

@@ -118,0 +130,0 @@ });

{
"name": "@script-bridge/server",
"version": "0.1.9",
"version": "0.2.2",
"description": "two-way communication system between ScriptAPI and backend server using http request",

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