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

@silenteer/natsu-port-server

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silenteer/natsu-port-server - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

8

dist/index.d.ts

@@ -0,3 +1,9 @@

import type { FastifyRequest } from 'fastify';
import 'colors';
declare function start(): void;
export declare type CustomFastifyRequest = FastifyRequest & {
parts: () => any;
};
declare function start(options?: {
onBeforeSendNatsRequest?: (request: CustomFastifyRequest) => Promise<void>;
}): void;
declare const _default: {

@@ -4,0 +10,0 @@ start: typeof start;

10

dist/index.js

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

const fastify_cors_1 = (0, tslib_1.__importDefault)(require("fastify-cors"));
const fastify_multipart_1 = (0, tslib_1.__importDefault)(require("fastify-multipart"));
const fastify_websocket_1 = (0, tslib_1.__importDefault)(require("fastify-websocket"));

@@ -21,3 +22,3 @@ require("colors");

.trim()
.test((value) => value === 'application/json'),
.test((value) => value === 'application/json' || value.includes('multipart/form-data')),
});

@@ -32,3 +33,4 @@ const wsRequestSchema = yup.object({

const responseCodec = (0, nats_1.JSONCodec)();
function start() {
const multipartOptions = {};
function start(options) {
(0, fastify_1.default)()

@@ -40,2 +42,3 @@ .register(fastify_cors_1.default, {

})
.register(fastify_multipart_1.default, multipartOptions)
.register(fastify_websocket_1.default)

@@ -68,2 +71,5 @@ .post(configuration_1.default.httpPath, (request, reply) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {

logger_1.default.log(`----- [${subject}]Begin send nats request -----`);
if (options === null || options === void 0 ? void 0 : options.onBeforeSendNatsRequest) {
yield options.onBeforeSendNatsRequest(request);
}
const { headers, response } = yield sendNatsRequest({

@@ -70,0 +76,0 @@ httpRequest: request,

{
"name": "@silenteer/natsu-port-server",
"version": "0.0.35",
"version": "0.0.36",
"license": "MIT",

@@ -31,2 +31,3 @@ "private": false,

"fastify-cors": "6.0.2",
"fastify-multipart": "5.4.0",
"fastify-websocket": "4.0.0",

@@ -33,0 +34,0 @@ "nats": "2.6.1",

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