@ctrl/qbittorrent 5.1.0 → 6.0.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/README.md CHANGED
@@ -105,3 +105,19 @@ All of the following npm modules provide the same normalized functions along wit
105
105
  deluge - https://github.com/scttcper/deluge
106
106
  transmission - https://github.com/scttcper/transmission
107
107
  utorrent - https://github.com/scttcper/utorrent
108
+
109
+ ### Start a test docker container
110
+
111
+ ```
112
+ docker run -d \
113
+ --name=qbittorrent \
114
+ -e PUID=1000 \
115
+ -e PGID=1000 \
116
+ -e TZ=Etc/UTC \
117
+ -e WEBUI_PORT=8080 \
118
+ -p 8080:8080 \
119
+ -p 6881:6881 \
120
+ -p 6881:6881/udp \
121
+ --restart unless-stopped \
122
+ lscr.io/linuxserver/qbittorrent:latest
123
+ ```
@@ -110,10 +110,10 @@ export class QBittorrent {
110
110
  if (filter) {
111
111
  params.filter = filter;
112
112
  }
113
- if (category) {
113
+ if (category !== undefined) {
114
114
  params.category = category;
115
115
  }
116
- if (tag) {
116
+ if (tag !== undefined) {
117
117
  params.tag = tag;
118
118
  }
119
119
  if (offset !== undefined) {
@@ -330,7 +330,7 @@ export class QBittorrent {
330
330
  const params = {
331
331
  hashes: this._normalizeHashes(hashes),
332
332
  };
333
- await this.request('/torrents/pause', 'GET', params);
333
+ await this.request('/torrents/pause', 'POST', undefined, undefined, params);
334
334
  return true;
335
335
  }
336
336
  /**
@@ -340,7 +340,7 @@ export class QBittorrent {
340
340
  const params = {
341
341
  hashes: this._normalizeHashes(hashes),
342
342
  };
343
- await this.request('/torrents/resume', 'GET', params);
343
+ await this.request('/torrents/resume', 'POST', undefined, undefined, params);
344
344
  return true;
345
345
  }
346
346
  /**
@@ -351,7 +351,7 @@ export class QBittorrent {
351
351
  hashes: this._normalizeHashes(hashes),
352
352
  deleteFiles,
353
353
  };
354
- await this.request('/torrents/delete', 'GET', params);
354
+ await this.request('/torrents/delete', 'POST', undefined, undefined, params);
355
355
  return true;
356
356
  }
357
357
  /**
@@ -361,7 +361,7 @@ export class QBittorrent {
361
361
  const params = {
362
362
  hashes: this._normalizeHashes(hashes),
363
363
  };
364
- await this.request('/torrents/recheck', 'GET', params);
364
+ await this.request('/torrents/recheck', 'POST', undefined, undefined, params);
365
365
  return true;
366
366
  }
367
367
  /**
@@ -371,7 +371,7 @@ export class QBittorrent {
371
371
  const params = {
372
372
  hashes: this._normalizeHashes(hashes),
373
373
  };
374
- await this.request('/torrents/reannounce', 'GET', params);
374
+ await this.request('/torrents/reannounce', 'POST', undefined, undefined, params);
375
375
  return true;
376
376
  }
377
377
  async addTorrent(torrent, options = {}) {
@@ -491,7 +491,7 @@ export class QBittorrent {
491
491
  */
492
492
  async addTrackers(hash, urls) {
493
493
  const params = { hash, urls };
494
- await this.request('/torrents/addTrackers', 'GET', params);
494
+ await this.request('/torrents/addTrackers', 'POST', undefined, undefined, params);
495
495
  return true;
496
496
  }
497
497
  /**
@@ -499,7 +499,7 @@ export class QBittorrent {
499
499
  */
500
500
  async editTrackers(hash, origUrl, newUrl) {
501
501
  const params = { hash, origUrl, newUrl };
502
- await this.request('/torrents/editTrackers', 'GET', params);
502
+ await this.request('/torrents/editTrackers', 'POST', undefined, undefined, params);
503
503
  return true;
504
504
  }
505
505
  /**
@@ -507,7 +507,7 @@ export class QBittorrent {
507
507
  */
508
508
  async removeTrackers(hash, urls) {
509
509
  const params = { hash, urls };
510
- await this.request('/torrents/editTrackers', 'GET', params);
510
+ await this.request('/torrents/removeTrackers', 'POST', undefined, undefined, params);
511
511
  return true;
512
512
  }
513
513
  /**
@@ -517,7 +517,7 @@ export class QBittorrent {
517
517
  const params = {
518
518
  hashes: this._normalizeHashes(hashes),
519
519
  };
520
- await this.request('/torrents/increasePrio', 'GET', params);
520
+ await this.request('/torrents/increasePrio', 'POST', undefined, undefined, params);
521
521
  return true;
522
522
  }
523
523
  /**
@@ -527,7 +527,7 @@ export class QBittorrent {
527
527
  const params = {
528
528
  hashes: this._normalizeHashes(hashes),
529
529
  };
530
- await this.request('/torrents/decreasePrio', 'GET', params);
530
+ await this.request('/torrents/decreasePrio', 'POST', undefined, undefined, params);
531
531
  return true;
532
532
  }
533
533
  /**
@@ -537,7 +537,7 @@ export class QBittorrent {
537
537
  const params = {
538
538
  hashes: this._normalizeHashes(hashes),
539
539
  };
540
- await this.request('/torrents/topPrio', 'GET', params);
540
+ await this.request('/torrents/topPrio', 'POST', undefined, undefined, params);
541
541
  return true;
542
542
  }
543
543
  /**
@@ -547,7 +547,7 @@ export class QBittorrent {
547
547
  const params = {
548
548
  hashes: this._normalizeHashes(hashes),
549
549
  };
550
- await this.request('/torrents/bottomPrio', 'GET', params);
550
+ await this.request('/torrents/bottomPrio', 'POST', undefined, undefined, params);
551
551
  return true;
552
552
  }
553
553
  /**
@@ -568,6 +568,7 @@ export class QBittorrent {
568
568
  // allow proxy agent
569
569
  ...(this.config.agent ? { agent: this.config.agent } : {}),
570
570
  });
571
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
571
572
  if (!res.headers['set-cookie'] || !res.headers['set-cookie'].length) {
572
573
  throw new Error('Cookie not found. Auth Failed.');
573
574
  }
@@ -20,7 +20,7 @@ export interface BuildInfo {
20
20
  */
21
21
  bitness: string;
22
22
  }
23
- export declare type TorrentFilters = 'all' | 'downloading' | 'completed' | 'paused' | 'active' | 'inactive' | 'resumed' | 'stalled' | 'stalled_uploading' | 'stalled_downloading';
23
+ export type TorrentFilters = 'all' | 'downloading' | 'completed' | 'paused' | 'active' | 'inactive' | 'resumed' | 'stalled' | 'stalled_uploading' | 'stalled_downloading';
24
24
  export interface Torrent {
25
25
  /**
26
26
  * Torrent name
@@ -175,7 +175,7 @@ export interface Torrent {
175
175
  */
176
176
  tags: string;
177
177
  }
178
- export declare type TorrentCategories = Record<string, Category>;
178
+ export type TorrentCategories = Record<string, Category>;
179
179
  interface Category {
180
180
  name: string;
181
181
  savePath: string;
@@ -521,7 +521,7 @@ export declare enum TorrentPieceState {
521
521
  */
522
522
  Downloaded = 2
523
523
  }
524
- declare type TrueFalseStr = 'true' | 'false';
524
+ type TrueFalseStr = 'true' | 'false';
525
525
  export interface AddTorrentOptions {
526
526
  /**
527
527
  * not totally sure what its for but its required
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctrl/qbittorrent",
3
- "version": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "description": "TypeScript api wrapper for qbittorrent using got",
5
5
  "author": "Scott Cooper <scttcper@gmail.com>",
6
6
  "license": "MIT",
@@ -32,24 +32,24 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ctrl/magnet-link": "^3.1.1",
35
- "@ctrl/shared-torrent": "^4.3.1",
35
+ "@ctrl/shared-torrent": "^4.3.2",
36
36
  "@ctrl/torrent-file": "^2.0.2",
37
37
  "@ctrl/url-join": "^2.0.2",
38
38
  "formdata-node": "^5.0.0",
39
- "got": "^12.5.0",
39
+ "got": "^12.6.0",
40
40
  "tough-cookie": "^4.1.2"
41
41
  },
42
42
  "devDependencies": {
43
- "@ctrl/eslint-config": "3.5.0",
43
+ "@ctrl/eslint-config": "3.7.0",
44
44
  "@sindresorhus/tsconfig": "3.0.1",
45
- "@types/node": "18.7.18",
45
+ "@types/node": "18.16.3",
46
46
  "@types/tough-cookie": "4.0.2",
47
- "@vitest/coverage-c8": "0.23.4",
48
- "c8": "7.12.0",
49
- "p-wait-for": "5.0.0",
50
- "typedoc": "0.23.15",
51
- "typescript": "4.8.3",
52
- "vitest": "0.23.4"
47
+ "@vitest/coverage-c8": "0.31.0",
48
+ "c8": "7.13.0",
49
+ "p-wait-for": "5.0.2",
50
+ "typedoc": "0.24.6",
51
+ "typescript": "5.0.4",
52
+ "vitest": "0.31.0"
53
53
  },
54
54
  "release": {
55
55
  "branches": [