smee-client
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -1,2 +0,2 @@ | ||
import EventSource = require('eventsource'); | ||
import EventSource from 'eventsource'; | ||
declare type Severity = 'info' | 'error'; | ||
@@ -3,0 +3,0 @@ interface Options { |
25
index.js
"use strict"; | ||
const validator = require("validator"); | ||
const EventSource = require("eventsource"); | ||
const superagent = require("superagent"); | ||
const url = require("url"); | ||
const querystring = require("querystring"); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
const validator_1 = __importDefault(require("validator")); | ||
const eventsource_1 = __importDefault(require("eventsource")); | ||
const superagent_1 = __importDefault(require("superagent")); | ||
const url_1 = __importDefault(require("url")); | ||
const querystring_1 = __importDefault(require("querystring")); | ||
class Client { | ||
@@ -12,3 +15,3 @@ constructor({ source, target, logger = console }) { | ||
this.logger = logger; | ||
if (!validator.isURL(this.source)) { | ||
if (!validator_1.default.isURL(this.source)) { | ||
throw new Error('The provided URL is invalid.'); | ||
@@ -18,3 +21,3 @@ } | ||
static async createChannel() { | ||
return superagent.head('https://smee.io/new').redirects(0).catch((err) => { | ||
return superagent_1.default.head('https://smee.io/new').redirects(0).catch((err) => { | ||
return err.response.headers.location; | ||
@@ -25,7 +28,7 @@ }); | ||
const data = JSON.parse(msg.data); | ||
const target = url.parse(this.target, true); | ||
const target = url_1.default.parse(this.target, true); | ||
const mergedQuery = Object.assign(target.query, data.query); | ||
target.search = querystring.stringify(mergedQuery); | ||
target.search = querystring_1.default.stringify(mergedQuery); | ||
delete data.query; | ||
const req = superagent.post(url.format(target)).send(data.body); | ||
const req = superagent_1.default.post(url_1.default.format(target)).send(data.body); | ||
delete data.body; | ||
@@ -51,3 +54,3 @@ Object.keys(data).forEach(key => { | ||
start() { | ||
const events = new EventSource(this.source); | ||
const events = new eventsource_1.default(this.source); | ||
// Reconnect immediately | ||
@@ -54,0 +57,0 @@ events.reconnectInterval = 0; // This isn't a valid property of EventSource |
{ | ||
"name": "smee-client", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Client to proxy webhooks to local host", | ||
@@ -19,3 +19,3 @@ "main": "index.js", | ||
}, | ||
"repository": "https://github.com/probot/smee", | ||
"repository": "github:probot/smee-client", | ||
"author": "", | ||
@@ -25,13 +25,13 @@ "license": "ISC", | ||
"commander": "^2.19.0", | ||
"eventsource": "^1.0.7", | ||
"eventsource": "^1.1.0", | ||
"morgan": "^1.9.1", | ||
"superagent": "^5.0.2", | ||
"validator": "^10.11.0" | ||
"superagent": "^7.1.3", | ||
"validator": "^13.7.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.4.0", | ||
"@types/eventsource": "^1.1.0", | ||
"@types/eventsource": "^1.1.8", | ||
"@types/jest": "^24.0.11", | ||
"@types/nock": "^9.3.1", | ||
"@types/superagent": "^4.1.1", | ||
"@types/superagent": "^4.1.15", | ||
"@types/validator": "^10.11.0", | ||
@@ -38,0 +38,0 @@ "babel-core": "^7.0.0-bridge.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
7036
109
1
+ Addedasap@2.0.6(transitive)
+ Addeddezalgo@1.0.4(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedformidable@2.1.2(transitive)
+ Addedhexoid@1.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedsuperagent@7.1.6(transitive)
+ Addedvalidator@13.12.0(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedform-data@3.0.2(transitive)
- Removedformidable@1.2.6(transitive)
- Removedsuperagent@5.3.1(transitive)
- Removedvalidator@10.11.0(transitive)
Updatedeventsource@^1.1.0
Updatedsuperagent@^7.1.3
Updatedvalidator@^13.7.0