@ctrl/deluge 7.3.0 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/deluge.js +2 -3
- package/dist/src/types.d.ts +5 -5
- package/package.json +14 -14
package/dist/src/deluge.js
CHANGED
|
@@ -98,7 +98,6 @@ export class Deluge {
|
|
|
98
98
|
async checkSession() {
|
|
99
99
|
// cookie is missing or expires in x seconds
|
|
100
100
|
if (this.state.auth.cookie) {
|
|
101
|
-
// eslint-disable-next-line new-cap
|
|
102
101
|
if (this.state.auth.cookie.TTL() < 5000) {
|
|
103
102
|
this.resetSession();
|
|
104
103
|
return false;
|
|
@@ -212,7 +211,7 @@ export class Deluge {
|
|
|
212
211
|
const isUploaded = typeof torrent === 'string' && torrent.includes('delugeweb-');
|
|
213
212
|
if (isUint8Array(torrent) || !isUploaded) {
|
|
214
213
|
const upload = await this.upload(torrent);
|
|
215
|
-
if (!upload.success ||
|
|
214
|
+
if (!upload.success || upload.files.length === 0) {
|
|
216
215
|
throw new Error('Failed to upload');
|
|
217
216
|
}
|
|
218
217
|
path = upload.files[0];
|
|
@@ -435,7 +434,7 @@ export class Deluge {
|
|
|
435
434
|
];
|
|
436
435
|
const req = await this.request('web.get_torrent_status', [torrentId, fields]);
|
|
437
436
|
const body = req._data;
|
|
438
|
-
if (!body.result ||
|
|
437
|
+
if (!body.result || Object.keys(body.result).length === 0) {
|
|
439
438
|
throw new Error('Torrent not found');
|
|
440
439
|
}
|
|
441
440
|
return body;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface ListMethods extends DefaultResponse {
|
|
|
16
16
|
result: string[];
|
|
17
17
|
}
|
|
18
18
|
export interface AddTorrentResponse extends DefaultResponse {
|
|
19
|
-
result: [boolean, string]
|
|
19
|
+
result: Array<[boolean, string]>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* ex -
|
|
@@ -35,7 +35,7 @@ export interface GetHostsResponse extends DefaultResponse {
|
|
|
35
35
|
* port - 58846
|
|
36
36
|
* status - "Online"
|
|
37
37
|
*/
|
|
38
|
-
result: [string, string, number, string]
|
|
38
|
+
result: Array<[string, string, number, string]>;
|
|
39
39
|
}
|
|
40
40
|
export type HostStatus = 'Online' | 'Offline' | 'Connected';
|
|
41
41
|
export interface GetHostStatusResponse extends DefaultResponse {
|
|
@@ -101,9 +101,9 @@ export interface TorrentList {
|
|
|
101
101
|
* ['label', 'id']
|
|
102
102
|
*/
|
|
103
103
|
export interface TorrentFilters {
|
|
104
|
-
state: [string, number]
|
|
105
|
-
tracker_host: [string, number]
|
|
106
|
-
label?: [string, number]
|
|
104
|
+
state: Array<[string, number]>;
|
|
105
|
+
tracker_host: Array<[string, number]>;
|
|
106
|
+
label?: Array<[string, number]>;
|
|
107
107
|
}
|
|
108
108
|
export interface Stats {
|
|
109
109
|
upload_protocol_rate: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctrl/deluge",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "TypeScript api wrapper for deluge using ofetch",
|
|
5
5
|
"author": "Scott Cooper <scttcper@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"test:ci": "vitest run --coverage --reporter=default --reporter=junit --outputFile=./junit.xml"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ctrl/magnet-link": "^4.0
|
|
32
|
-
"@ctrl/shared-torrent": "^6.
|
|
31
|
+
"@ctrl/magnet-link": "^4.2.0",
|
|
32
|
+
"@ctrl/shared-torrent": "^6.5.0",
|
|
33
33
|
"node-fetch-native": "^1.6.7",
|
|
34
|
-
"ofetch": "^1.
|
|
34
|
+
"ofetch": "^1.5.0",
|
|
35
35
|
"tough-cookie": "^6.0.0",
|
|
36
|
-
"type-fest": "^
|
|
36
|
+
"type-fest": "^5.1.0",
|
|
37
37
|
"ufo": "^1.6.1",
|
|
38
38
|
"uint8array-extras": "^1.5.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ctrl/oxlint-config": "1.2
|
|
41
|
+
"@ctrl/oxlint-config": "1.3.2",
|
|
42
42
|
"@sindresorhus/tsconfig": "8.0.1",
|
|
43
43
|
"@trivago/prettier-plugin-sort-imports": "5.2.2",
|
|
44
|
-
"@types/node": "24.
|
|
45
|
-
"@vitest/coverage-v8": "
|
|
46
|
-
"oxlint": "1.
|
|
47
|
-
"p-wait-for": "
|
|
44
|
+
"@types/node": "24.9.2",
|
|
45
|
+
"@vitest/coverage-v8": "4.0.5",
|
|
46
|
+
"oxlint": "1.24.0",
|
|
47
|
+
"p-wait-for": "6.0.0",
|
|
48
48
|
"prettier": "3.6.2",
|
|
49
|
-
"typedoc": "0.28.
|
|
50
|
-
"typescript": "5.9.
|
|
51
|
-
"vitest": "
|
|
49
|
+
"typedoc": "0.28.14",
|
|
50
|
+
"typescript": "5.9.3",
|
|
51
|
+
"vitest": "4.0.5"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=18"
|
|
64
64
|
},
|
|
65
|
-
"packageManager": "pnpm@10.
|
|
65
|
+
"packageManager": "pnpm@10.20.0",
|
|
66
66
|
"prettier": {
|
|
67
67
|
"singleQuote": true,
|
|
68
68
|
"trailingComma": "all",
|