@ctrl/deluge 7.4.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 -2
- package/dist/src/types.d.ts +5 -5
- package/package.json +10 -10
package/dist/src/deluge.js
CHANGED
|
@@ -211,7 +211,7 @@ export class Deluge {
|
|
|
211
211
|
const isUploaded = typeof torrent === 'string' && torrent.includes('delugeweb-');
|
|
212
212
|
if (isUint8Array(torrent) || !isUploaded) {
|
|
213
213
|
const upload = await this.upload(torrent);
|
|
214
|
-
if (!upload.success ||
|
|
214
|
+
if (!upload.success || upload.files.length === 0) {
|
|
215
215
|
throw new Error('Failed to upload');
|
|
216
216
|
}
|
|
217
217
|
path = upload.files[0];
|
|
@@ -434,7 +434,7 @@ export class Deluge {
|
|
|
434
434
|
];
|
|
435
435
|
const req = await this.request('web.get_torrent_status', [torrentId, fields]);
|
|
436
436
|
const body = req._data;
|
|
437
|
-
if (!body.result ||
|
|
437
|
+
if (!body.result || Object.keys(body.result).length === 0) {
|
|
438
438
|
throw new Error('Torrent not found');
|
|
439
439
|
}
|
|
440
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",
|
|
@@ -31,24 +31,24 @@
|
|
|
31
31
|
"@ctrl/magnet-link": "^4.2.0",
|
|
32
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": "^5.0
|
|
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.
|
|
44
|
+
"@types/node": "24.9.2",
|
|
45
|
+
"@vitest/coverage-v8": "4.0.5",
|
|
46
|
+
"oxlint": "1.24.0",
|
|
47
47
|
"p-wait-for": "6.0.0",
|
|
48
48
|
"prettier": "3.6.2",
|
|
49
|
-
"typedoc": "0.28.
|
|
49
|
+
"typedoc": "0.28.14",
|
|
50
50
|
"typescript": "5.9.3",
|
|
51
|
-
"vitest": "
|
|
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",
|