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

smee-client

Package Overview
Dependencies
Maintainers
5
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smee-client - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

2

index.d.ts

@@ -1,2 +0,2 @@

import EventSource = require('eventsource');
import EventSource from 'eventsource';
declare type Severity = 'info' | 'error';

@@ -3,0 +3,0 @@ interface Options {

"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",

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