@ctrl/deluge 7.1.1 → 7.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/README.md CHANGED
@@ -26,12 +26,14 @@ async function main() {
26
26
 
27
27
  ### API
28
28
 
29
- Docs: https://deluge.vercel.app
29
+ Docs: https://deluge.vercel.app
30
30
 
31
31
  ### Normalized API
32
+
32
33
  These functions have been normalized between torrent clients. Can easily support multiple torrent clients. See below for alternative supported torrent clients
33
34
 
34
35
  ##### getAllData
36
+
35
37
  Returns all torrent data and an array of label objects. Data has been normalized and does not match the output of native `listTorrents()`.
36
38
 
37
39
  ```ts
@@ -40,6 +42,7 @@ console.log(data.torrents);
40
42
  ```
41
43
 
42
44
  ##### getTorrent
45
+
43
46
  Returns one torrent data
44
47
 
45
48
  ```ts
@@ -48,6 +51,7 @@ console.log(data);
48
51
  ```
49
52
 
50
53
  ##### pauseTorrent and resumeTorrent
54
+
51
55
  Pause or resume a torrent
52
56
 
53
57
  ```ts
@@ -58,6 +62,7 @@ console.log(resumed);
58
62
  ```
59
63
 
60
64
  ##### removeTorrent
65
+
61
66
  Remove a torrent. Does not remove data on disk by default.
62
67
 
63
68
  ```ts
@@ -75,15 +80,16 @@ console.log(res);
75
80
  If you're shutting down the server often (serverless?) you can export the state
76
81
 
77
82
  ```ts
78
- const state = client.exportState()
83
+ const state = client.exportState();
79
84
  const client = Deluge.createFromState(config, state);
80
85
  ```
81
86
 
82
87
  ### See Also
88
+
83
89
  transmission - https://github.com/scttcper/transmission
84
90
  qbittorrent - https://github.com/scttcper/qbittorrent
85
91
  utorrent - https://github.com/scttcper/utorrent
86
- rtorrent - https://github.com/scttcper/rtorrent
92
+ rtorrent - https://github.com/scttcper/rtorrent
87
93
 
88
94
  ### Start a test docker container
89
95
 
@@ -64,7 +64,7 @@ export declare class Deluge implements TorrentClient {
64
64
  * @returns a list of method names
65
65
  */
66
66
  listMethods(auth?: boolean): Promise<ListMethods>;
67
- upload(torrent: string | Uint8Array): Promise<UploadResponse>;
67
+ upload(torrent: string | Uint8Array<ArrayBuffer>): Promise<UploadResponse>;
68
68
  /**
69
69
  * Download a torrent from url, pass the result to {@link Deluge.addTorrent}
70
70
  * @param url
@@ -72,8 +72,8 @@ export declare class Deluge implements TorrentClient {
72
72
  * @returns file path
73
73
  */
74
74
  downloadFromUrl(url: string, cookies?: string): Promise<string>;
75
- addTorrent(torrent: string | Uint8Array, config?: Partial<AddTorrentOptions>): Promise<AddTorrentResponse>;
76
- normalizedAddTorrent(torrent: string | Uint8Array, options?: Partial<NormalizedAddTorrentOptions>): Promise<NormalizedTorrent>;
75
+ addTorrent(torrent: string | Uint8Array<ArrayBuffer>, config?: Partial<AddTorrentOptions>): Promise<AddTorrentResponse>;
76
+ normalizedAddTorrent(torrent: string | Uint8Array<ArrayBuffer>, options?: Partial<NormalizedAddTorrentOptions>): Promise<NormalizedTorrent>;
77
77
  addTorrentMagnet(magnet: string, config?: Partial<AddTorrentOptions>): Promise<BooleanStatus>;
78
78
  /**
79
79
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ctrl/deluge",
3
- "version": "7.1.1",
4
- "description": "TypeScript api wrapper for deluge using got",
3
+ "version": "7.3.0",
4
+ "description": "TypeScript api wrapper for deluge using ofetch",
5
5
  "author": "Scott Cooper <scttcper@gmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": "scttcper/deluge",
@@ -18,12 +18,8 @@
18
18
  ],
19
19
  "sideEffects": false,
20
20
  "scripts": {
21
- "lint": "pnpm run '/^(lint:biome|lint:eslint)$/'",
22
- "lint:biome": "biome check .",
23
- "lint:eslint": "eslint .",
24
- "lint:fix": "pnpm run '/^(lint:biome|lint:eslint):fix$/'",
25
- "lint:eslint:fix": "eslint . --fix",
26
- "lint:biome:fix": "biome check . --write",
21
+ "lint": "oxlint . && prettier --check . --experimental-cli",
22
+ "lint:fix": "oxlint . --fix && prettier --write . --log-level=error --experimental-cli",
27
23
  "prepare": "npm run build",
28
24
  "build": "tsc",
29
25
  "build:docs": "typedoc",
@@ -33,24 +29,25 @@
33
29
  },
34
30
  "dependencies": {
35
31
  "@ctrl/magnet-link": "^4.0.2",
36
- "@ctrl/shared-torrent": "^6.2.1",
37
- "node-fetch-native": "^1.6.6",
32
+ "@ctrl/shared-torrent": "^6.3.0",
33
+ "node-fetch-native": "^1.6.7",
38
34
  "ofetch": "^1.4.1",
39
- "tough-cookie": "^5.1.2",
35
+ "tough-cookie": "^6.0.0",
40
36
  "type-fest": "^4.41.0",
41
37
  "ufo": "^1.6.1",
42
- "uint8array-extras": "^1.4.0"
38
+ "uint8array-extras": "^1.5.0"
43
39
  },
44
40
  "devDependencies": {
45
- "@biomejs/biome": "2.1.2",
46
- "@ctrl/eslint-config-biome": "5.0.1",
47
- "@sindresorhus/tsconfig": "7.0.0",
48
- "@types/node": "24.1.0",
41
+ "@ctrl/oxlint-config": "1.2.3",
42
+ "@sindresorhus/tsconfig": "8.0.1",
43
+ "@trivago/prettier-plugin-sort-imports": "5.2.2",
44
+ "@types/node": "24.3.0",
49
45
  "@vitest/coverage-v8": "3.2.4",
50
- "eslint": "9.31.0",
46
+ "oxlint": "1.14.0",
51
47
  "p-wait-for": "5.0.2",
52
- "typedoc": "0.28.7",
53
- "typescript": "5.8.3",
48
+ "prettier": "3.6.2",
49
+ "typedoc": "0.28.11",
50
+ "typescript": "5.9.2",
54
51
  "vitest": "3.2.4"
55
52
  },
56
53
  "publishConfig": {
@@ -65,5 +62,25 @@
65
62
  "engines": {
66
63
  "node": ">=18"
67
64
  },
68
- "packageManager": "pnpm@10.13.1"
65
+ "packageManager": "pnpm@10.15.0",
66
+ "prettier": {
67
+ "singleQuote": true,
68
+ "trailingComma": "all",
69
+ "arrowParens": "avoid",
70
+ "semi": true,
71
+ "printWidth": 100,
72
+ "plugins": [
73
+ "@trivago/prettier-plugin-sort-imports"
74
+ ],
75
+ "importOrder": [
76
+ "^node:.*$",
77
+ "<THIRD_PARTY_MODULES>",
78
+ "^(@ctrl)(/.*|$)",
79
+ "^\\.\\./(?!.*\\.css$)",
80
+ "^\\./(?!.*\\.css$)(?=.*/)",
81
+ "^\\./(?!.*\\.css$)(?!.*/)"
82
+ ],
83
+ "importOrderSeparation": true,
84
+ "importOrderSortSpecifiers": false
85
+ }
69
86
  }