@ctrl/qbittorrent 9.2.0 → 9.3.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/qbittorrent.d.ts +17 -1
- package/dist/src/qbittorrent.js +40 -0
- package/dist/src/types.d.ts +2 -0
- package/package.json +11 -10
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Jsonify } from 'type-fest';
|
2
2
|
import type { AddTorrentOptions as NormalizedAddTorrentOptions, AllClientData, NormalizedTorrent, TorrentClient, TorrentClientConfig, TorrentClientState } from '@ctrl/shared-torrent';
|
3
|
-
import type { AddMagnetOptions, AddTorrentOptions, BuildInfo, Preferences, Torrent, TorrentCategories, TorrentFile, TorrentFilePriority, TorrentFilters, TorrentPeersResponse, TorrentPieceState, TorrentProperties, TorrentTrackers, WebSeed } from './types.js';
|
3
|
+
import type { AddMagnetOptions, AddTorrentOptions, BuildInfo, DownloadSpeed, Preferences, Torrent, TorrentCategories, TorrentFile, TorrentFilePriority, TorrentFilters, TorrentPeersResponse, TorrentPieceState, TorrentProperties, TorrentTrackers, UploadSpeed, WebSeed } from './types.js';
|
4
4
|
interface QBittorrentState extends TorrentClientState {
|
5
5
|
auth?: {
|
6
6
|
/**
|
@@ -48,6 +48,22 @@ export declare class QBittorrent implements TorrentClient {
|
|
48
48
|
*/
|
49
49
|
getBuildInfo(): Promise<BuildInfo>;
|
50
50
|
getTorrent(hash: string): Promise<NormalizedTorrent>;
|
51
|
+
/**
|
52
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-download-limit}
|
53
|
+
*/
|
54
|
+
getTorrentDownloadLimit(hash: string | string[]): Promise<DownloadSpeed>;
|
55
|
+
/**
|
56
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#set-torrent-download-limit}
|
57
|
+
*/
|
58
|
+
setTorrentDownloadLimit(hash: string | string[], limitBytesPerSecond: number): Promise<boolean>;
|
59
|
+
/**
|
60
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-upload-limit}
|
61
|
+
*/
|
62
|
+
getTorrentUploadLimit(hash: string | string[]): Promise<UploadSpeed>;
|
63
|
+
/**
|
64
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#set-torrent-upload-limit}
|
65
|
+
*/
|
66
|
+
setTorrentUploadLimit(hash: string | string[], limitBytesPerSecond: number): Promise<boolean>;
|
51
67
|
/**
|
52
68
|
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-application-preferences}
|
53
69
|
*/
|
package/dist/src/qbittorrent.js
CHANGED
@@ -76,6 +76,46 @@ export class QBittorrent {
|
|
76
76
|
}
|
77
77
|
return normalizeTorrentData(torrentData);
|
78
78
|
}
|
79
|
+
/**
|
80
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-download-limit}
|
81
|
+
*/
|
82
|
+
async getTorrentDownloadLimit(hash) {
|
83
|
+
const downloadLimit = await this.request('/torrents/downloadLimit', 'POST', undefined, objToUrlSearchParams({
|
84
|
+
hashes: normalizeHashes(hash),
|
85
|
+
}), undefined);
|
86
|
+
return downloadLimit;
|
87
|
+
}
|
88
|
+
/**
|
89
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#set-torrent-download-limit}
|
90
|
+
*/
|
91
|
+
async setTorrentDownloadLimit(hash, limitBytesPerSecond) {
|
92
|
+
const data = {
|
93
|
+
limit: limitBytesPerSecond.toString(),
|
94
|
+
hashes: normalizeHashes(hash),
|
95
|
+
};
|
96
|
+
await this.request('/torrents/setDownloadLimit', 'POST', undefined, objToUrlSearchParams(data));
|
97
|
+
return true;
|
98
|
+
}
|
99
|
+
/**
|
100
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-upload-limit}
|
101
|
+
*/
|
102
|
+
async getTorrentUploadLimit(hash) {
|
103
|
+
const UploadLimit = await this.request('/torrents/uploadLimit', 'POST', undefined, objToUrlSearchParams({
|
104
|
+
hashes: normalizeHashes(hash),
|
105
|
+
}), undefined);
|
106
|
+
return UploadLimit;
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#set-torrent-upload-limit}
|
110
|
+
*/
|
111
|
+
async setTorrentUploadLimit(hash, limitBytesPerSecond) {
|
112
|
+
const data = {
|
113
|
+
limit: limitBytesPerSecond.toString(),
|
114
|
+
hashes: normalizeHashes(hash),
|
115
|
+
};
|
116
|
+
await this.request('/torrents/setUploadLimit', 'POST', undefined, objToUrlSearchParams(data));
|
117
|
+
return true;
|
118
|
+
}
|
79
119
|
/**
|
80
120
|
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-application-preferences}
|
81
121
|
*/
|
package/dist/src/types.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ctrl/qbittorrent",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.3.0",
|
4
4
|
"description": "TypeScript api wrapper for qbittorrent using got",
|
5
5
|
"author": "Scott Cooper <scttcper@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -40,24 +40,25 @@
|
|
40
40
|
"@ctrl/shared-torrent": "^6.2.1",
|
41
41
|
"@ctrl/torrent-file": "^4.1.0",
|
42
42
|
"cookie": "^1.0.2",
|
43
|
-
"node-fetch-native": "^1.6.
|
43
|
+
"node-fetch-native": "^1.6.6",
|
44
44
|
"ofetch": "^1.4.1",
|
45
|
-
"type-fest": "^4.
|
45
|
+
"type-fest": "^4.34.1",
|
46
46
|
"ufo": "^1.5.4",
|
47
47
|
"uint8array-extras": "^1.4.0"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"@biomejs/biome": "1.9.4",
|
51
|
-
"@ctrl/eslint-config-biome": "4.3.
|
52
|
-
"@eslint/compat": "^1.2.
|
51
|
+
"@ctrl/eslint-config-biome": "4.3.2",
|
52
|
+
"@eslint/compat": "^1.2.6",
|
53
53
|
"@sindresorhus/tsconfig": "7.0.0",
|
54
54
|
"@types/cookie": "1.0.0",
|
55
|
-
"@types/node": "22.
|
56
|
-
"@vitest/coverage-v8": "
|
55
|
+
"@types/node": "22.13.1",
|
56
|
+
"@vitest/coverage-v8": "3.0.5",
|
57
|
+
"eslint": "^9.20.1",
|
57
58
|
"p-wait-for": "5.0.2",
|
58
|
-
"typedoc": "0.27.
|
59
|
-
"typescript": "5.7.
|
60
|
-
"vitest": "
|
59
|
+
"typedoc": "0.27.7",
|
60
|
+
"typescript": "5.7.3",
|
61
|
+
"vitest": "3.0.5"
|
61
62
|
},
|
62
63
|
"release": {
|
63
64
|
"branches": [
|