smee-client
Advanced tools
+1
-1
@@ -1,2 +0,2 @@ | ||
| import EventSource = require('eventsource'); | ||
| import EventSource from 'eventsource'; | ||
| declare type Severity = 'info' | 'error'; | ||
@@ -3,0 +3,0 @@ interface Options { |
+14
-11
| "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 |
+7
-7
| { | ||
| "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", |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
4.35%109
2.83%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated