New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

geartrack

Package Overview
Dependencies
Maintainers
2
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geartrack - npm Package Compare versions

Comparing version

to
2.8.2

2

package.json
{
"name": "geartrack",
"version": "2.8.1",
"version": "2.8.2",
"description": "Tracking providers for Gearbest and AliExpress Orders.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,4 +10,6 @@ 'use strict';

const URL = 'http://www.17track.net/en/track?nums='
const POST_URL = 'http://www.17track.net/restapi/handlertrack.ashx'
const URL_BASE = 'http://www.17track.net'
const URL_PATH = '/restapi/handlertrack.ashx'
const tracker = {}

@@ -22,3 +24,3 @@

tracker.getInfo = function (id, cb) {
fetchInfo(id)
fetchInfo(id, URL_BASE + URL_PATH)
.then(info => cb(null, info))

@@ -28,6 +30,12 @@ .catch(cb)

async function fetchInfo(id) {
tracker.getInfoProxy = function (id, proxyUrl, cb) {
fetchInfo(id, proxyUrl + URL_PATH)
.then(info => cb(null, info))
.catch(cb)
}
async function fetchInfo(id, trackerUrl) {
const options = {
method: 'POST',
uri: POST_URL,
uri: trackerUrl,
body: '{"guid":"","data":[{"num":"' + id + '"}]}',

@@ -52,4 +60,7 @@ headers: {

if(info.ret == -8 && info.msg == 'abN')
throw utils.errorUnavailable() // we are blocked?
if (info.msg != "Ok" || info.dat[0].delay == -1) {
await utils.sleep(2000)
await utils.sleep(3000)
continue

@@ -56,0 +67,0 @@ }