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

node-ninjacat

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ninjacat - npm Package Compare versions

Comparing version 0.1.14 to 0.1.15

4

global.d.ts

@@ -77,2 +77,6 @@ declare namespace Ninjacat {

interface ErrorResponse {
error_message: string;
}
type ReportResponse = ReportPending | ReportRunning | ReportReady;

@@ -79,0 +83,0 @@

@@ -11,2 +11,5 @@ "use strict";

const JSONStream_1 = __importDefault(require("JSONStream"));
function isError(response) {
return (response && response.error_message != undefined);
}
class NinjacatClient {

@@ -45,3 +48,3 @@ constructor(opts) {

return new Promise((resolve, reject) => {
request_1.default.get(`https://app.ninjacat.io/${path}`, config, function processReportGet(err, _res, body) {
request_1.default.get(`https://app.ninjacat.io/${path}`, config, function processReportGet(err, res, body) {
if (err) {

@@ -51,3 +54,15 @@ reject(err);

}
resolve(body);
const { statusCode } = res;
if (statusCode < 200 || statusCode > 301) {
if (!body) {
reject(`Recieved status code ${statusCode}`);
}
return;
}
if (isError(body)) {
reject(body.error_message);
}
else {
resolve(body);
}
});

@@ -80,3 +95,3 @@ });

return new Promise((resolve, reject) => {
request_1.default.post(`https://app.ninjacat.io/${path}`, config, function processReportPost(err, _res, body) {
request_1.default.post(`https://app.ninjacat.io/${path}`, config, function processReportPost(err, res, body) {
if (err) {

@@ -86,3 +101,15 @@ reject(err);

}
resolve(body);
const { statusCode } = res;
if (statusCode < 200 || statusCode > 301) {
if (!body) {
reject(`Recieved status code ${statusCode}`);
}
return;
}
if (isError(body)) {
reject(body.error_message);
}
else {
resolve(body);
}
});

@@ -89,0 +116,0 @@ });

2

package.json
{
"name": "node-ninjacat",
"description": "Reporting & Management API Client for https://www.ninjacat.io/",
"version": "0.1.14",
"version": "0.1.15",
"main": "./lib/Client.js",

@@ -6,0 +6,0 @@ "types": "./lib/Client.d.ts",

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