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

rpcapi

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rpcapi - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

index.js

2

package.json
{
"name": "rpcapi",
"version": "1.0.1",
"version": "1.0.2",
"description": "Provides a struture for hosting RPC style APIs, supports both http and websocket access out of the box",

@@ -5,0 +5,0 @@ "repository": {

@@ -118,2 +118,2 @@ "use strict";

exports.WebAPIAccessMethod = WebAPIAccessMethod;
//# sourceMappingURL=WebAPIAccessMethod.js.map
//# sourceMappingURL=index.js.map

@@ -51,3 +51,3 @@ "use strict";

var API_1 = require("../../API");
var WebAPIAccessMethod_1 = require("./WebAPIAccessMethod");
var index_1 = require("./index");
var APIEndpoint_1 = require("../../APIEndpoint");

@@ -73,3 +73,3 @@ ava_1.default('Calls endpoint', function (t) { return __awaiter(_this, void 0, void 0, function () {

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebAPIAccessMethod_1.WebAPIAccessMethod(testApi);
accessMethod = new index_1.WebAPIAccessMethod(testApi);
return [4 /*yield*/, accessMethod.processRequest('test', 'testFunc', {})];

@@ -111,3 +111,3 @@ case 1:

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebAPIAccessMethod_1.WebAPIAccessMethod(testApi);
accessMethod = new index_1.WebAPIAccessMethod(testApi);
return [4 /*yield*/, accessMethod.processRequest('test', 'testFunc', {

@@ -149,3 +149,3 @@ num: '123',

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebAPIAccessMethod_1.WebAPIAccessMethod(testApi);
accessMethod = new index_1.WebAPIAccessMethod(testApi);
return [4 /*yield*/, accessMethod.processRequest('test', 'testFunc', {

@@ -152,0 +152,0 @@ validParam: 'Hello world!',

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

exports.WebSocketAccessMethod = WebSocketAccessMethod;
//# sourceMappingURL=WebSocketAccessMethod.js.map
//# sourceMappingURL=index.js.map

@@ -51,3 +51,3 @@ "use strict";

var API_1 = require("../../API");
var WebSocketAccessMethod_1 = require("./WebSocketAccessMethod");
var index_1 = require("./index");
var APIEndpoint_1 = require("../../APIEndpoint");

@@ -70,3 +70,3 @@ ava_1.default('Calls connect() when new endpoint is created', function (t) { return __awaiter(_this, void 0, void 0, function () {

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -105,3 +105,3 @@ t.is(hasCalled, true);

testApi.registerEndpoint('test2', TestEndpoint2);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
accessMethod.createNewSocketEndpoint('mySocketID', 'test1');

@@ -132,3 +132,3 @@ accessMethod.createNewSocketEndpoint('mySocketID', 'test2');

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -185,3 +185,3 @@ //Make sure we can call before disconnect without throwing

testApi.registerEndpoint('test2', TestEndpoint2);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
t.is(accessMethod.numberOfActiveConnections(), 0);

@@ -226,3 +226,3 @@ accessMethod.createNewSocketEndpoint('mySocketID1', 'test1');

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -259,3 +259,3 @@ //Make sure we can call before disconnect without throwing

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
t.is(accessMethod.numberOfActiveConnections(), 0);

@@ -295,3 +295,3 @@ endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
t.is(accessMethod.numberOfActiveConnections(), 0);

@@ -335,3 +335,3 @@ endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -364,3 +364,3 @@ return [4 /*yield*/, accessMethod.callEndpointAction('mySocketID', endpointConnection.endpointConnectionId, 'testFunc', {})];

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -405,3 +405,3 @@ _a.label = 1;

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -439,3 +439,3 @@ return [4 /*yield*/, accessMethod.callEndpointAction('mySocketID', endpointConnection.endpointConnectionId, 'testFunc', { a: 'asdf' })];

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -469,3 +469,3 @@ return [4 /*yield*/, accessMethod.callEndpointAction('mySocketID', endpointConnection.endpointConnectionId, 'testFunc', { valid: 'asdf', invalid: 'asdf' })];

testApi.registerEndpoint('test', TestEndpoint);
accessMethod = new WebSocketAccessMethod_1.WebSocketAccessMethod(testApi);
accessMethod = new index_1.WebSocketAccessMethod(testApi);
endpointConnection = accessMethod.createNewSocketEndpoint('mySocketID', 'test');

@@ -472,0 +472,0 @@ _a.label = 1;

@@ -139,3 +139,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_b) {
return __generator(this, function (_a) {
t.is(a, 123);

@@ -142,0 +142,0 @@ return [2 /*return*/, new Promise(function (resolve) {

@@ -44,3 +44,3 @@ "use strict";

var http = require("http");
var WebAPIAccessMethod_1 = require("../accessMethods/WebAPIAccessMethod/WebAPIAccessMethod");
var index_1 = require("../accessMethods/WebAPIAccessMethod/index");
var API_1 = require("../API");

@@ -57,3 +57,3 @@ var CalculatorEndpoint_1 = require("../testEndpoints/CalculatorEndpoint");

api.registerEndpoint('calculator', CalculatorEndpoint_1.CalculatorEndpoint);
webApi = new WebAPIAccessMethod_1.WebAPIAccessMethod(api, { prefix: '/api' });
webApi = new index_1.WebAPIAccessMethod(api, { prefix: '/api' });
webApi.outputActionErrors = false;

@@ -60,0 +60,0 @@ webApi.bind(app);

@@ -102,7 +102,7 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_b) {
switch (_b.label) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, delay(1000)];
case 1:
_b.sent();
_a.sent();
return [2 /*return*/, {

@@ -109,0 +109,0 @@ value: a + b

@@ -15,3 +15,4 @@ {

"include": [
"src/**/*.ts"
"src/**/*.ts",
"index.ts"
],

@@ -18,0 +19,0 @@ "exclude": [

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