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

@ctrl/deluge

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ctrl/deluge - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

18

deluge.js

@@ -254,2 +254,20 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

}
verifyTorrent(torrentId) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield this.request('core.force_recheck', [[torrentId]]);
return req.body;
});
}
queueTop(torrentId) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield this.request('core.queue_top', [[torrentId]]);
return req.body;
});
}
queueBottom(torrentId) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield this.request('core.queue_bottom', [[torrentId]]);
return req.body;
});
}
queueUp(torrentId) {

@@ -256,0 +274,0 @@ return __awaiter(this, void 0, void 0, function* () {

20

deluge.m.js

@@ -252,2 +252,20 @@ import { resolve } from 'url';

}
verifyTorrent(torrentId) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield this.request('core.force_recheck', [[torrentId]]);
return req.body;
});
}
queueTop(torrentId) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield this.request('core.queue_top', [[torrentId]]);
return req.body;
});
}
queueBottom(torrentId) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield this.request('core.queue_bottom', [[torrentId]]);
return req.body;
});
}
queueUp(torrentId) {

@@ -344,5 +362,5 @@ return __awaiter(this, void 0, void 0, function* () {

//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLGFBQWE7QUFDekIsUUFBUyxjQUFlO0FBQ3hCLE9BQU8sU0FBUztBQUNoQixRQUFT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xuICAgIC8qKlxyXG4gICAgICogQ29ubmVjdHMgZGVsdWdlXHJcbiAgICAgKiBAcGFyYW0gW2hvc3RdIGluZGV4IG9mIGhvc3QgdG8gdXNlIGluIHJlc3VsdCBvZiBnZXQgaG9zdHNcclxuICAgICAqIEBwYXJhbSBbaG9zdElkeF0gaW5kZXggb2YgaG9zdCB0byB1c2UgaW4gcmVzdWx0IG9mIGdldCBob3N0c1xyXG4gICAgICovXHJcbiAgICBjb25uZWN0KHNlbGVjdGVkSG9zdCwgaG9zdElkeCA9IDApIHtcclxuICAgICAgICByZXR1cm4gdHNsaWJfMS5fX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGxldCBob3N0ID0gc2VsZWN0ZWRIb3N0O1xyXG4gICAgICAgICAgICBpZiAoIWhvc3QpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGhvc3RzID0geWllbGQgdGhpcy5nZXRIb3N0cygpO1xyXG4gICAgICAgICAgICAgICAgaG9zdCA9IGhvc3RzLnJlc3VsdFtob3N0SWR4XVswXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoIWhvc3QpIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTm8gaG9zdHMgZm91bmQnKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCByZXMgPSB5aWVsZCB0aGlzLnJlcXVlc3QoJ3dlYi5jb25uZWN0JywgW2hvc3RdLCB0cnVlLCBmYWxzZSk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXMuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGNvbm5lY3RlZCgpIHtcclxuICAgICAgICByZXR1cm4gdHNsaWJfMS5fX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGNvbnN0I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lY29uZHNcclxuICAgICAgICAgICAgaWYgKHRoaXMuY29va2llKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5jb29raWUuVFRMKCkgPCA1MDAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNldFNlc3Npb24oKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodGhpcy5jb29raWUpIHtcclxuICAgICAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hlY2sgPSB5aWVsZCB0aGlzLnJlcXVlc3QoJ2F1dGguY2hlY2tfc2Vzc2lvbicsIHVuZGVmaW5lZCwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChjaGVjay5ib2R5ICYmIGNoZWNrLmJvZHkucmVzdWx0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhdGNoIChfYSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGRvIG5vdGhpbmdcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnJlc2V0U2Vzc2lvbigpO1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICAvKipcclxuICAgICAqIExvZ2luIGRlbHVnZVxyXG4gICAgICogQHJldHVybnMgdHJ1ZSBpZiBzdWNjZXNzXHJcbiAgICAgKi9cclxuICAgIGxvZ2luKCkge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgdGhpcy5yZXNldFNlc3Npb24oKTtcclxuICAgICAgICAgICAgY29uc3QgcmVzID0geWllbGQgdGhpcy5yZXF1ZXN0KCdhdXRoLmxvZ2luJywgW3RoaXMuY29uZmlnLnBhc3N3b3JkXSwgZmFsc2UpO1xyXG4gICAgICAgICAgICBpZiAoIXJlcy5ib2R5LnJlc3VsdCB8fCAhcmVzLmhlYWRlcnMgfHwgIXJlcy5oZWFkZXJzWydzZXQtY29va2llJ10pIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignQXV0aCBmYWlsZWQsIGluY29ycmVjdCBwYXNzd29yZCcpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuY29va2llID0gQ29va2llLnBhcnNlKHJlcy5oZWFkZXJzWydzZXQtY29va2llJ11bMF0pO1xyXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogTG9nb3V0IGRlbHVnZVxyXG4gICAgICogQHJldHVybnMgdHJ1ZSBpZiBzdWNjZXNzXHJcbiAgICAgKi9cclxuICAgIGxvZ291dCgpIHtcclxuICAgICAgICByZXR1cm4gdHNsaWJfMS5fX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9IHlpZWxkIHRoaXMucmVxdWVzdCgnYXV0aC5kZWxldGVfc2Vzc2lvbicpO1xyXG4gICAgICAgICAgICB0aGlzLnJlc2V0U2Vzc2lvbigpO1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzLmJvZHkucmVzdWx0O1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgLyoqXHJcbiAgICAgKiB1c2VkIHRvIGdldCB0b3JyZW50IGluZm8gYmVmb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J11bMF0pO1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzLmJvZHk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBsaXN0VG9ycmVudHMoYWRkaXRpb25hbEZpZWxkcyA9IFtdKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBjb25zdCBmaWVsZHMgPSBbXHJcbiAgICAgICAgICAgICAgICAnZGlzdHJpYnV0ZWRfY29waWVzJyxcclxuICAgICAgICAgICAgICAgICdkb3dubG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ2V0YScsXHJcbiAgICAgICAgICAgICAgICAnaXNfYXV0b19tYW5hZ2VkJyxcclxuICAgICAgICAgICAgICAgICdtYXhfZG93bmxvYWRfc3BlZWQnLFxyXG4gICAgICAgICAgICAgICAgJ21heF91cGxvYWRfc3BlZWQnLFxyXG4gICAgICAgICAgICAgICAgJ25hbWUnLFxyXG4gICAgICAgICAgICAgICAgJ251bV9wZWVycycsXHJcbiAgICAgICAgICAgICAgICAnbnVtX3NlZWRzJyxcclxuICAgICAgICAgICAgICAgICdwcm9ncmVzcycsXHJcbiAgICAgICAgICAgICAgICAncXVldWUnLFxyXG4gICAgICAgICAgICAgICAgJ3JhdGlvJyxcclxuICAgICAgICAgICAgICAgICdzYXZlX3BhdGgnLFxyXG4gICAgICAgICAgICAgICAgJ3NlZWRzX3BlZXJzX3JhdGlvJyxcclxuICAgICAgICAgICAgICAgICdzdGF0ZScsXHJcbiAgICAgICAgICAgICAgICAndGltZV9hZGRlZCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfZG9uZScsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfcGVlcnMnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3NlZWRzJyxcclxuICAgICAgICAgICAgICAgICd0b3RhbF91cGxvYWRlZCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfd2FudGVkJyxcclxuICAgICAgICAgICAgICAgICd0cmFja2VyX2hvc3QnLFxyXG4gICAgICAgICAgICAgICAgJ3VwbG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgLi4uYWRkaXRpb25hbEZpZWxkcyxcclxuICAgICAgICAgICAgXTtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCd3ZWIudXBkYXRlX3VpJywgW1xyXG4gICAgICAgICAgICAgICAgWy4uLm5ldyBTZXQoZmllbGRzKV0sXHJcbiAgICAgICAgICAgICAgICB7fSxcclxuICAgICAgICAgICAgXSk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogZ2V0IHRvcnJlbnQgc3RhdGUvc3RhdHVzXHJcbiAgICAgKiBAcGFyYW0gYWRkaXRpb25hbEZpZWxkcyBmaWVsZHMgZXggLSBgWydsYWJlbCddYFxyXG4gICAgICovXHJcbiAgICBnZXRUb3JyZW50U3RhdHVzKHRvcnJlbnRJZCwgYWRkaXRpb25hbEZpZWxkcyA9IFtdKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBjb25zdCBmaWVsZHMgPSBbXHJcbiAgICAgICAgICAgICAgICAndG90YWxfZG9uZScsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfcGF5bG9hZF9kb3dubG9hZCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfdXBsb2FkZWQnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3BheWxvYWRfdXBsb2FkJyxcclxuICAgICAgICAgICAgICAgICduZXh0X2Fubm91bmNlJyxcclxuICAgICAgICAgICAgICAgICd0cmFja2VyX3N0YXR1cycsXHJcbiAgICAgICAgICAgICAgICAnbnVtX3BpZWNlcycsXHJcbiAgICAgICAgICAgICAgICAncGllY2VfbGVuZ3RoJyxcclxuICAgICAgICAgICAgICAgICdpc19hdXRvX21hbmFnZWQnLFxyXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZV90aW1lJyxcclxuICAgICAgICAgICAgICAgICdzZWVkaW5nX3RpbWUnLFxyXG4gICAgICAgICAgICAgICAgJ3NlZWRfcmFuaycsXHJcbiAgICAgICAgICAgICAgICAncXVldWUnLFxyXG4gICAgICAgICAgICAgICAgJ25hbWUnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3dhbnRlZCcsXHJcbiAgICAgICAgICAgICAgICAnc3RhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ3Byb2dyZXNzJyxcclxuICAgICAgICAgICAgICAgICdudW1fc2VlZHMnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3NlZWRzJyxcclxuICAgICAgICAgICAgICAgICdudW1fcGVlcnMnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3BlZXJzJyxcclxuICAgICAgICAgICAgICAgICdkb3dubG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ3VwbG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ2V0YScsXHJcbiAgICAgICAgICAgICAgICAncmF0aW8nLFxyXG4gICAgICAgICAgICAgICAgJ2Rpc3RyaWJ1dGVkX2NvcGllcycsXHJcbiAgICAgICAgICAgICAgICAnaXNfYXV0b19tYW5hZ2VkJyxcclxuICAgICAgICAgICAgICAgICd0aW1lX2FkZGVkJyxcclxuICAgICAgICAgICAgICAgICd0cmFja2VyX2hvc3QnLFxyXG4gICAgICAgICAgICAgICAgJ3NhdmVfcGF0aCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfZG9uZScsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfdXBsb2FkZWQnLFxyXG4gICAgICAgICAgICAgICAgJ21heF9kb3dubG9hZF9zcGVlZCcsXHJcbiAgICAgICAgICAgICAgICAnbWF4X3VwbG9hZF9zcGVlZCcsXHJcbiAgICAgICAgICAgICAgICAnc2VlZHNfcGVlcnNfcmF0aW8nLFxyXG4gICAgICAgICAgICAgICAgLi4uYWRkaXRpb25hbEZpZWxkcyxcclxuICAgICAgICAgICAgXTtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCd3ZWIuZ2V0X3RvcnJlbnRfc3RhdHVzJywgW3RvcnJlbnRJZCwgZmllbGRzXSk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogR2V0IGxpc3Qgb2YgZmlsZXMgZm9yIGEgdG9ycmVudFxyXG4gICAgICovXHJcbiAgICBnZXRUb3JyZW50RmlsZXModG9ycmVudElkKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBjb25zdCByZXEgPSB5aWVsZCB0aGlzLnJlcXVlc3QoJ3dlYi5nZXRfdG9ycmVudF9maWxlcycsIFt0b3JyZW50SWRdKTtcclxuICAgICAgICAgICAgcmV0dXJuIHJlcS5ib2R5O1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgcGF1c2VUb3JyZW50KHRvcnJlbnRJZCkge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCdjb3JlLnBhdXNlX3RvcnJlbnQnLCBbW3RvcnJlbnRJZF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VxdWVzdCgnY29yZS5lbmFibGVfcGx1Z2luJywgcGx1Z2lucyk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGRpc2FibGVQbHVnaW4ocGx1Z2lucykge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCdjb3JlLmRpc2FibGVfcGx1Z2luJywgcGx1Z2lucyk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIHJlcXVlc3QobWV0aG9kLCBwYXJhbXMgPSBbXSwgbmVlZHNBdXRoID0gdHJ1ZSwgYXV0b0Nvbm5lY3QgPSB0cnVlKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5tc2dJZCA9PT0gNDA5Nikge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5tc2dJZCA9IDA7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG5lZWRzQXV0aCkge1xyXG4gICAgICAgICAgICAgICAgeWllbGQgdGhpcy52YWxpZGF0ZUF1dGgoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAobmVlZHNBdXRoICYmIGF1dG9Db25uZWN0KSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpc0Nvbm5lY3RlZCA9IHlpZWxkIHRoaXMuY29ubmVjdGVkKCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzQ29ubmVjdGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgeWllbGQgdGhpcy5jb25uZWN0KCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgaGVhZGVycyA9IHtcclxuICAgICAgICAgICAgICAgIENvb2tpZTogdGhpcy5jb29raWUgJiYgdGhpcy5jb29raWUuY29va2llU3RyaW5nKCksXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIGNvbnN0IHVybCA9IHJlc29sdmUodGhpcy5jb25maWcuYmFzZVVSTCwgdGhpcy5jb25maWcucGF0aCk7XHJcbiAgICAgICAgICAgIHJldHVybiBnb3QucG9zdCh1cmwsIHtcclxuICAgICAgICAgICAgICAgIGpzb246IHRydWUsXHJcbiAgICAgICAgICAgICAgICBib2R5OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kLFxyXG4gICAgICAgICAgICAgICAgICAgIHBhcmFtcyxcclxuICAgICAgICAgICAgICAgICAgICBpZDogdGhpcy5tc2dJZCsrLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGhlYWRlcnMsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgdmFsaWRhdGVBdXRoKCkge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgbGV0IHZhbGlkQXV0aCA9IHlpZWxkIHRoaXMuY2hlY2tTZXNzaW9uKCk7XHJcbiAgICAgICAgICAgIGlmICghdmFsaWRBdXRoKSB7XHJcbiAgICAgICAgICAgICAgICB2YWxpZEF1dGggPSB5aWVsZCB0aGlzLmxvZ2luKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCF2YWxpZEF1dGgpIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSW52YWxpZCBBdXRoJyk7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qKlxyXG4gICAgICogQ29ubmVjdHMgZGVsdWdlXHJcbiAgICAgKiBAcGFyYW0gW2hvc3RdIGluZGV4IG9mIGhvc3QgdG8gdXNlIGluIHJlc3VsdCBvZiBnZXQgaG9zdHNcclxuICAgICAqIEBwYXJhbSBbaG9zdElkeF0gaW5kZXggb2YgaG9zdCB0byB1c2UgaW4gcmVzdWx0IG9mIGdldCBob3N0c1xyXG4gICAgICovXHJcbiAgICBjb25uZWN0KHNlbGVjdGVkSG9zdCwgaG9zdElkeCA9IDApIHtcclxuICAgICAgICByZXR1cm4gdHNsaWJfMS5fX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGxldCBob3N0ID0gc2VsZWN0ZWRIb3N0O1xyXG4gICAgICAgICAgICBpZiAoIWhvc3QpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGhvc3RzID0geWllbGQgdGhpcy5nZXRIb3N0cygpO1xyXG4gICAgICAgICAgICAgICAgaG9zdCA9IGhvc3RzLnJlc3VsdFtob3N0SWR4XVswXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoIWhvc3QpIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTm8gaG9zdHMgZm91bmQnKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCByZXMgPSB5aWVsZCB0aGlzLnJlcXVlc3QoJ3dlYi5jb25uZWN0JywgW2hvc3RdLCB0cnVlLCBmYWxzZSk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXMuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGNvbm5lY3RlZCgpIHtcclxuICAgICAgICByZXR1cm4gdHNsaWJfMS5fX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9I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clxuICAgICAgICAgICAgaWYgKHRoaXMuY29va2llKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5jb29raWUuVFRMKCkgPCA1MDAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNldFNlc3Npb24oKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodGhpcy5jb29raWUpIHtcclxuICAgICAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hlY2sgPSB5aWVsZCB0aGlzLnJlcXVlc3QoJ2F1dGguY2hlY2tfc2Vzc2lvbicsIHVuZGVmaW5lZCwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChjaGVjay5ib2R5ICYmIGNoZWNrLmJvZHkucmVzdWx0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhdGNoIChfYSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGRvIG5vdGhpbmdcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnJlc2V0U2Vzc2lvbigpO1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICAvKipcclxuICAgICAqIExvZ2luIGRlbHVnZVxyXG4gICAgICogQHJldHVybnMgdHJ1ZSBpZiBzdWNjZXNzXHJcbiAgICAgKi9cclxuICAgIGxvZ2luKCkge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgdGhpcy5yZXNldFNlc3Npb24oKTtcclxuICAgICAgICAgICAgY29uc3QgcmVzID0geWllbGQgdGhpcy5yZXF1ZXN0KCdhdXRoLmxvZ2luJywgW3RoaXMuY29uZmlnLnBhc3N3b3JkXSwgZmFsc2UpO1xyXG4gICAgICAgICAgICBpZiAoIXJlcy5ib2R5LnJlc3VsdCB8fCAhcmVzLmhlYWRlcnMgfHwgIXJlcy5oZWFkZXJzWydzZXQtY29va2llJ10pIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignQXV0aCBmYWlsZWQsIGluY29ycmVjdCBwYXNzd29yZCcpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuY29va2llID0gQ29va2llLnBhcnNlKHJlcy5oZWFkZXJzWydzZXQtY29va2llJ11bMF0pO1xyXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogTG9nb3V0IGRlbHVnZVxyXG4gICAgICogQHJldHVybnMgdHJ1ZSBpZiBzdWNjZXNzXHJcbiAgICAgKi9cclxuICAgIGxvZ291dCgpIHtcclxuICAgICAgICByZXR1cm4gdHNsaWJfMS5fX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9IHlpZWxkIHRoaXMucmVxdWVzdCgnYXV0aC5kZWxldGVfc2Vzc2lvbicpO1xyXG4gICAgICAgICAgICB0aGlzLnJlc2V0U2Vzc2lvbigpO1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzLmJvZHkucmVzdWx0O1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgLyoqXHJcbiAgICAgKiB1c2VkIHRvIGdldCB0b3JyZW50IGluZm8gYmVmb3JlIGFkZ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O1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzLmJvZHk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBsaXN0VG9ycmVudHMoYWRkaXRpb25hbEZpZWxkcyA9IFtdKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBjb25zdCBmaWVsZHMgPSBbXHJcbiAgICAgICAgICAgICAgICAnZGlzdHJpYnV0ZWRfY29waWVzJyxcclxuICAgICAgICAgICAgICAgICdkb3dubG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ2V0YScsXHJcbiAgICAgICAgICAgICAgICAnaXNfYXV0b19tYW5hZ2VkJyxcclxuICAgICAgICAgICAgICAgICdtYXhfZG93bmxvYWRfc3BlZWQnLFxyXG4gICAgICAgICAgICAgICAgJ21heF91cGxvYWRfc3BlZWQnLFxyXG4gICAgICAgICAgICAgICAgJ25hbWUnLFxyXG4gICAgICAgICAgICAgICAgJ251bV9wZWVycycsXHJcbiAgICAgICAgICAgICAgICAnbnVtX3NlZWRzJyxcclxuICAgICAgICAgICAgICAgICdwcm9ncmVzcycsXHJcbiAgICAgICAgICAgICAgICAncXVldWUnLFxyXG4gICAgICAgICAgICAgICAgJ3JhdGlvJyxcclxuICAgICAgICAgICAgICAgICdzYXZlX3BhdGgnLFxyXG4gICAgICAgICAgICAgICAgJ3NlZWRzX3BlZXJzX3JhdGlvJyxcclxuICAgICAgICAgICAgICAgICdzdGF0ZScsXHJcbiAgICAgICAgICAgICAgICAndGltZV9hZGRlZCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfZG9uZScsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfcGVlcnMnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3NlZWRzJyxcclxuICAgICAgICAgICAgICAgICd0b3RhbF91cGxvYWRlZCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfd2FudGVkJyxcclxuICAgICAgICAgICAgICAgICd0cmFja2VyX2hvc3QnLFxyXG4gICAgICAgICAgICAgICAgJ3VwbG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgLi4uYWRkaXRpb25hbEZpZWxkcyxcclxuICAgICAgICAgICAgXTtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCd3ZWIudXBkYXRlX3VpJywgW1xyXG4gICAgICAgICAgICAgICAgWy4uLm5ldyBTZXQoZmllbGRzKV0sXHJcbiAgICAgICAgICAgICAgICB7fSxcclxuICAgICAgICAgICAgXSk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogZ2V0IHRvcnJlbnQgc3RhdGUvc3RhdHVzXHJcbiAgICAgKiBAcGFyYW0gYWRkaXRpb25hbEZpZWxkcyBmaWVsZHMgZXggLSBgWydsYWJlbCddYFxyXG4gICAgICovXHJcbiAgICBnZXRUb3JyZW50U3RhdHVzKHRvcnJlbnRJZCwgYWRkaXRpb25hbEZpZWxkcyA9IFtdKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBjb25zdCBmaWVsZHMgPSBbXHJcbiAgICAgICAgICAgICAgICAndG90YWxfZG9uZScsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfcGF5bG9hZF9kb3dubG9hZCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfdXBsb2FkZWQnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3BheWxvYWRfdXBsb2FkJyxcclxuICAgICAgICAgICAgICAgICduZXh0X2Fubm91bmNlJyxcclxuICAgICAgICAgICAgICAgICd0cmFja2VyX3N0YXR1cycsXHJcbiAgICAgICAgICAgICAgICAnbnVtX3BpZWNlcycsXHJcbiAgICAgICAgICAgICAgICAncGllY2VfbGVuZ3RoJyxcclxuICAgICAgICAgICAgICAgICdpc19hdXRvX21hbmFnZWQnLFxyXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZV90aW1lJyxcclxuICAgICAgICAgICAgICAgICdzZWVkaW5nX3RpbWUnLFxyXG4gICAgICAgICAgICAgICAgJ3NlZWRfcmFuaycsXHJcbiAgICAgICAgICAgICAgICAncXVldWUnLFxyXG4gICAgICAgICAgICAgICAgJ25hbWUnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3dhbnRlZCcsXHJcbiAgICAgICAgICAgICAgICAnc3RhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ3Byb2dyZXNzJyxcclxuICAgICAgICAgICAgICAgICdudW1fc2VlZHMnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3NlZWRzJyxcclxuICAgICAgICAgICAgICAgICdudW1fcGVlcnMnLFxyXG4gICAgICAgICAgICAgICAgJ3RvdGFsX3BlZXJzJyxcclxuICAgICAgICAgICAgICAgICdkb3dubG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ3VwbG9hZF9wYXlsb2FkX3JhdGUnLFxyXG4gICAgICAgICAgICAgICAgJ2V0YScsXHJcbiAgICAgICAgICAgICAgICAncmF0aW8nLFxyXG4gICAgICAgICAgICAgICAgJ2Rpc3RyaWJ1dGVkX2NvcGllcycsXHJcbiAgICAgICAgICAgICAgICAnaXNfYXV0b19tYW5hZ2VkJyxcclxuICAgICAgICAgICAgICAgICd0aW1lX2FkZGVkJyxcclxuICAgICAgICAgICAgICAgICd0cmFja2VyX2hvc3QnLFxyXG4gICAgICAgICAgICAgICAgJ3NhdmVfcGF0aCcsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfZG9uZScsXHJcbiAgICAgICAgICAgICAgICAndG90YWxfdXBsb2FkZWQnLFxyXG4gICAgICAgICAgICAgICAgJ21heF9kb3dubG9hZF9zcGVlZCcsXHJcbiAgICAgICAgICAgICAgICAnbWF4X3VwbG9hZF9zcGVlZCcsXHJcbiAgICAgICAgICAgICAgICAnc2VlZHNfcGVlcnNfcmF0aW8nLFxyXG4gICAgICAgICAgICAgICAgLi4uYWRkaXRpb25hbEZpZWxkcyxcclxuICAgICAgICAgICAgXTtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCd3ZWIuZ2V0X3RvcnJlbnRfc3RhdHVzJywgW3RvcnJlbnRJZCwgZmllbGRzXSk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogR2V0IGxpc3Qgb2YgZmlsZXMgZm9yIGEgdG9ycmVudFxyXG4gICAgICovXHJcbiAgICBnZXRUb3JyZW50RmlsZXModG9ycmVudElkKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBjb25zdCByZXEgPSB5aWVsZCB0aGlzLnJlcXVlc3QoJ3dlYi5nZXRfdG9ycmVudF9maWxlcycsIFt0b3JyZW50SWRdKTtcclxuICAgICAgICAgICAgcmV0dXJuIHJlcS5ib2R5O1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgcGF1c2VUb3JyZW50KHRvcnJlbnRJZCkge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCdjb3JlLnBhdXNlX3RvcnJlbnQnLCBbW3RvcnJlbnRJZF1dKTtcclx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aW4ocGx1Z2lucykge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgY29uc3QgcmVxID0geWllbGQgdGhpcy5yZXF1ZXN0KCdjb3JlLmRpc2FibGVfcGx1Z2luJywgcGx1Z2lucyk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXEuYm9keTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIHJlcXVlc3QobWV0aG9kLCBwYXJhbXMgPSBbXSwgbmVlZHNBdXRoID0gdHJ1ZSwgYXV0b0Nvbm5lY3QgPSB0cnVlKSB7XHJcbiAgICAgICAgcmV0dXJuIHRzbGliXzEuX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5tc2dJZCA9PT0gNDA5Nikge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5tc2dJZCA9IDA7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG5lZWRzQXV0aCkge1xyXG4gICAgICAgICAgICAgICAgeWllbGQgdGhpcy52YWxpZGF0ZUF1dGgoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAobmVlZHNBdXRoICYmIGF1dG9Db25uZWN0KSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpc0Nvbm5lY3RlZCA9IHlpZWxkIHRoaXMuY29ubmVjdGVkKCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzQ29ubmVjdGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgeWllbGQgdGhpcy5jb25uZWN0KCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgaGVhZGVycyA9IHtcclxuICAgICAgICAgICAgICAgIENvb2tpZTogdGhpcy5jb29raWUgJiYgdGhpcy5jb29raWUuY29va2llU3RyaW5nKCksXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIGNvbnN0IHVybCA9IHJlc29sdmUodGhpcy5jb25maWcuYmFzZVVSTCwgdGhpcy5jb25maWcucGF0aCk7XHJcbiAgICAgICAgICAgIHJldHVybiBnb3QucG9zdCh1cmwsIHtcclxuICAgICAgICAgICAgICAgIGpzb246IHRydWUsXHJcbiAgICAgICAgICAgICAgICBib2R5OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kLFxyXG4gICAgICAgICAgICAgICAgICAgIHBhcmFtcyxcclxuICAgICAgICAgICAgICAgICAgICBpZDogdGhpcy5tc2dJZCsrLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGhlYWRlcnMsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgdmFsaWRhdGVBdXRoKCkge1xyXG4gICAgICAgIHJldHVybiB0c2xpYl8xLl9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgbGV0IHZhbGlkQXV0aCA9IHlpZWxkIHRoaXMuY2hlY2tTZXNzaW9uKCk7XHJcbiAgICAgICAgICAgIGlmICghdmFsaWRBdXRoKSB7XHJcbiAgICAgICAgICAgICAgICB2YWxpZEF1dGggPSB5aWVsZCB0aGlzLmxvZ2luKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCF2YWxpZEF1dGgpIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSW52YWxpZCBBdXRoJyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxufVxyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1pbmRleC5qcy5tYXAiXX0=
export { Deluge };
//# sourceMappingURL=deluge.m.js.map

2

package.json
{
"name": "@ctrl/deluge",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -5,0 +5,0 @@ "author": "Scott Cooper <scttcper@gmail.com>",

@@ -75,2 +75,5 @@ import { Response } from 'got';

setTorrentTrackers(torrentId: string, trackers?: Tracker[]): Promise<DefaultResponse>;
verifyTorrent(torrentId: string): Promise<DefaultResponse>;
queueTop(torrentId: string): Promise<DefaultResponse>;
queueBottom(torrentId: string): Promise<DefaultResponse>;
queueUp(torrentId: string): Promise<DefaultResponse>;

@@ -77,0 +80,0 @@ queueDown(torrentId: string): Promise<DefaultResponse>;

Sorry, the diff of this file is not supported yet

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