Skip to content

Commit 2d38cbc

Browse files
committed
feat: adds proper errors to all routes, and adds user_ip sending to requestdl routes
1 parent 550cb13 commit 2d38cbc

File tree

58 files changed

+331
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+331
-157
lines changed

documentation/models/AddReferralToAccountOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
| :------ | :------ | :------- | :---------- |
77
| data | any || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |

documentation/models/ControlQueuedTorrentOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
| :------ | :------ | :------- | :---------- |
77
| data | any || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |

documentation/models/ControlTorrentOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
| :------ | :------ | :------- | :---------- |
77
| data | any || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |

documentation/models/CreateTorrentOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :-------------------------- | :------- | :---------- |
77
| data | CreateTorrentOkResponseData || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# CreateTorrentOkResponseData

documentation/models/CreateUsenetDownloadOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :--------------------------------- | :------- | :---------- |
77
| data | CreateUsenetDownloadOkResponseData || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# CreateUsenetDownloadOkResponseData

documentation/models/CreateWebDownloadOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :------------------------------ | :------- | :---------- |
77
| data | CreateWebDownloadOkResponseData || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# CreateWebDownloadOkResponseData

documentation/models/ExportTorrentDataOkResponse.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
**Properties**
44

5-
| Name | Type | Required | Description |
6-
| :----- | :----- | :------- | :---------- |
7-
| data | string || |
8-
| detail | string || |
5+
| Name | Type | Required | Description |
6+
| :------ | :------ | :------- | :---------- |
7+
| data | string || |
8+
| detail | string || |
9+
| error | any || |
10+
| success | boolean || |

documentation/models/GetAllJobsByHashOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :------------------------------- | :------- | :---------- |
77
| data | GetAllJobsByHashOkResponseData[] || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# GetAllJobsByHashOkResponseData

documentation/models/GetAllJobsOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :------------------------- | :------- | :---------- |
77
| data | GetAllJobsOkResponseData[] || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# GetAllJobsOkResponseData

documentation/models/GetNotificationFeedOkResponse.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
**Properties**
44

5-
| Name | Type | Required | Description |
6-
| :----- | :---------------------------------- | :------- | :---------- |
7-
| data | GetNotificationFeedOkResponseData[] || |
8-
| detail | string || |
5+
| Name | Type | Required | Description |
6+
| :------ | :---------------------------------- | :------- | :---------- |
7+
| data | GetNotificationFeedOkResponseData[] || |
8+
| detail | string || |
9+
| error | any || |
10+
| success | boolean || |
911

1012
# GetNotificationFeedOkResponseData
1113

documentation/models/GetStatsOkResponse.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
**Properties**
44

5-
| Name | Type | Required | Description |
6-
| :----- | :--------------------- | :------- | :---------- |
7-
| data | GetStatsOkResponseData || |
8-
| detail | string || |
5+
| Name | Type | Required | Description |
6+
| :------ | :--------------------- | :------- | :---------- |
7+
| data | GetStatsOkResponseData || |
8+
| detail | string || |
9+
| error | boolean || |
10+
| success | boolean || |
911

1012
# GetStatsOkResponseData
1113

documentation/models/GetTorrentCachedAvailabilityOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :----------------------------------------- | :------- | :---------- |
77
| data | GetTorrentCachedAvailabilityOkResponseData || |
88
| detail | string || |
9+
| error | string || |
910
| success | boolean || |
1011

1112
# GetTorrentCachedAvailabilityOkResponseData

documentation/models/GetTorrentListOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :----------------------------- | :------- | :---------- |
77
| data | GetTorrentListOkResponseData[] || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# GetTorrentListOkResponseData

documentation/models/GetUpStatusOkResponse.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
**Properties**
44

5-
| Name | Type | Required | Description |
6-
| :----- | :----- | :------- | :---------- |
7-
| detail | string || |
5+
| Name | Type | Required | Description |
6+
| :------ | :------ | :------- | :---------- |
7+
| data | boolean || |
8+
| detail | string || |
9+
| error | any || |
10+
| success | boolean || |

documentation/models/GetUsenetListOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :---------------------------- | :------- | :---------- |
77
| data | GetUsenetListOkResponseData[] || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# GetUsenetListOkResponseData

documentation/models/GetUserDataOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| :------ | :------------------------ | :------- | :---------- |
77
| data | GetUserDataOkResponseData || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |
1011

1112
# GetUserDataOkResponseData

documentation/models/GetWebDownloadListOkResponse.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
**Properties**
44

5-
| Name | Type | Required | Description |
6-
| :----- | :--------------------------------- | :------- | :---------- |
7-
| data | GetWebDownloadListOkResponseData[] || |
8-
| detail | string || |
5+
| Name | Type | Required | Description |
6+
| :------ | :--------------------------------- | :------- | :---------- |
7+
| data | GetWebDownloadListOkResponseData[] || |
8+
| detail | string || |
9+
| error | any || |
10+
| success | boolean || |
911

1012
# GetWebDownloadListOkResponseData
1113

documentation/models/RequestDownloadLinkOkResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
| :------ | :------ | :------- | :---------- |
77
| data | string || |
88
| detail | string || |
9+
| error | any || |
910
| success | boolean || |

documentation/models/SearchAllTorrentsFromScraperOkResponse.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
**Properties**
44

5-
| Name | Type | Required | Description |
6-
| :----- | :------------------------------------------- | :------- | :---------- |
7-
| data | SearchAllTorrentsFromScraperOkResponseData[] || |
8-
| detail | string || |
5+
| Name | Type | Required | Description |
6+
| :------ | :------------------------------------------- | :------- | :---------- |
7+
| data | SearchAllTorrentsFromScraperOkResponseData[] || |
8+
| detail | string || |
9+
| error | any || |
10+
| success | boolean || |
911

1012
# SearchAllTorrentsFromScraperOkResponseData
1113

documentation/services/GeneralService.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A list of all methods in the `GeneralService` service. Click on the method name
2121
**Example Usage Code Snippet**
2222

2323
```typescript
24-
import { TorboxApi } from 'torbox-api';
24+
import { TorboxApi } from '@torbox/torbox-api';
2525

2626
(async () => {
2727
const torboxApi = new TorboxApi({
@@ -54,7 +54,7 @@ import { TorboxApi } from 'torbox-api';
5454
**Example Usage Code Snippet**
5555

5656
```typescript
57-
import { TorboxApi } from 'torbox-api';
57+
import { TorboxApi } from '@torbox/torbox-api';
5858

5959
(async () => {
6060
const torboxApi = new TorboxApi({

documentation/services/IntegrationsService.md

+8-41
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ A list of all methods in the `IntegrationsService` service. Click on the method
66
| :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
| [authenticateOauth](#authenticateoauth) | ### Overview Allows you to get an authorization token for using the user's account. Callback is located at `/oauth/{provider}/callback` which will verify the token recieved from the OAuth, then redirect you finally to `https://torbox.app/{provider}/success?token={token}&expires_in={expires_in}&expires_at={expires_at}` #### Providers: - "google" -\> Google Drive - "dropbox" -\> Dropbox - "discord" -\> Discord - "onedrive" -\> Azure AD/Microsoft/Onedrive ### Authorization No authorization needed. This is a whitelabel OAuth solution. |
88
| [queueGoogleDrive](#queuegoogledrive) | ### Overview Queues a job to upload the specified file or zip to the Google Drive account sent with the `google_token` key. To get this key, either get an OAuth2 token using `/oauth/google` or your own solution. Make sure when creating the OAuth link, you add the scope `https://www.googleapis.com/auth/drive.file` so TorBox has access to the user's Drive. ### Authorization Requires an API key using the Authorization Bearer Header. |
9-
| [queueDropbox](#queuedropbox) | ### Overview Queues a job to upload the specified file or zip to the Dropbox account sent with the `dropbox_token` key. To get this key, either get an OAuth2 token using `/oauth/dropbox` or your own solution. Make sure when creating the OAuth link you use the scopes `files.content.write` _(used for uploading to the user's account)_ and `sharing.write` _(used for creating the link)._ ### Authorization Requires an API key using the Authorization Bearer Header. |
109
| [queueOnedrive](#queueonedrive) | ### Overview Queues a job to upload the specified file or zip to the OneDrive sent with the `onedrive_token` key. To get this key, either get an OAuth2 token using `/oauth/onedrive` or your own solution. Make sure when creating the OAuth link you use the scope `files.readwrite.all`. This is compatible with all different types of Microsoft accounts. ### Authorization Requires an API key using the Authorization Bearer Header. |
1110
| [queueGofile](#queuegofile) | ### Overview Queues a job to upload the specified file or zip to the GoFile account sent with the `gofile_token` _(optional)_. To get this key, login to your GoFile account and go [here](https://gofile.io/myProfile). Copy the **Account API Token**. This is what you will use as the `gofile_token`, if you choose to use it. If you don't use an Account API Token, GoFile will simply create an anonymous file. This file will expire after inactivity. ### Authorization Requires an API key using the Authorization Bearer Header. |
1211
| [queue1fichier](#queue1fichier) | ### Overview Queues a job to upload the specified file or zip to the 1Fichier account sent with the `onefichier_token` key (optional). To get this key you must be a Premium or Premium Gold member at 1Fichier. If you are upgraded, [go to the parameters page](https://1fichier.com/console/params.pl), and get an **API Key**. This is what you will use as the `onefichier_token`, if you choose to use it. If you don't use an API Key, 1Fichier will simply create an anonymous file. ### Authorization Requires an API key using the Authorization Bearer Header. |
@@ -31,7 +30,7 @@ A list of all methods in the `IntegrationsService` service. Click on the method
3130
**Example Usage Code Snippet**
3231

3332
```typescript
34-
import { TorboxApi } from 'torbox-api';
33+
import { TorboxApi } from '@torbox/torbox-api';
3534

3635
(async () => {
3736
const torboxApi = new TorboxApi({
@@ -61,7 +60,7 @@ import { TorboxApi } from 'torbox-api';
6160
**Example Usage Code Snippet**
6261

6362
```typescript
64-
import { TorboxApi } from 'torbox-api';
63+
import { TorboxApi } from '@torbox/torbox-api';
6564

6665
(async () => {
6766
const torboxApi = new TorboxApi({
@@ -76,38 +75,6 @@ import { TorboxApi } from 'torbox-api';
7675
})();
7776
```
7877

79-
## queueDropbox
80-
81-
### Overview Queues a job to upload the specified file or zip to the Dropbox account sent with the `dropbox_token` key. To get this key, either get an OAuth2 token using `/oauth/dropbox` or your own solution. Make sure when creating the OAuth link you use the scopes `files.content.write` _(used for uploading to the user's account)_ and `sharing.write` _(used for creating the link)._ ### Authorization Requires an API key using the Authorization Bearer Header.
82-
83-
- HTTP Method: `POST`
84-
- Endpoint: `/{api_version}/api/integration/dropbox`
85-
86-
**Parameters**
87-
88-
| Name | Type | Required | Description |
89-
| :--------- | :----- | :------- | :---------------- |
90-
| body | any || The request body. |
91-
| apiVersion | string || |
92-
93-
**Example Usage Code Snippet**
94-
95-
```typescript
96-
import { TorboxApi } from 'torbox-api';
97-
98-
(async () => {
99-
const torboxApi = new TorboxApi({
100-
token: 'YOUR_TOKEN',
101-
});
102-
103-
const input = {};
104-
105-
const { data } = await torboxApi.integrations.queueDropbox('api_version');
106-
107-
console.log(data);
108-
})();
109-
```
110-
11178
## queueOnedrive
11279

11380
### Overview Queues a job to upload the specified file or zip to the OneDrive sent with the `onedrive_token` key. To get this key, either get an OAuth2 token using `/oauth/onedrive` or your own solution. Make sure when creating the OAuth link you use the scope `files.readwrite.all`. This is compatible with all different types of Microsoft accounts. ### Authorization Requires an API key using the Authorization Bearer Header.
@@ -125,7 +92,7 @@ import { TorboxApi } from 'torbox-api';
12592
**Example Usage Code Snippet**
12693

12794
```typescript
128-
import { TorboxApi } from 'torbox-api';
95+
import { TorboxApi } from '@torbox/torbox-api';
12996

13097
(async () => {
13198
const torboxApi = new TorboxApi({
@@ -157,7 +124,7 @@ import { TorboxApi } from 'torbox-api';
157124
**Example Usage Code Snippet**
158125

159126
```typescript
160-
import { TorboxApi } from 'torbox-api';
127+
import { TorboxApi } from '@torbox/torbox-api';
161128

162129
(async () => {
163130
const torboxApi = new TorboxApi({
@@ -189,7 +156,7 @@ import { TorboxApi } from 'torbox-api';
189156
**Example Usage Code Snippet**
190157

191158
```typescript
192-
import { TorboxApi } from 'torbox-api';
159+
import { TorboxApi } from '@torbox/torbox-api';
193160

194161
(async () => {
195162
const torboxApi = new TorboxApi({
@@ -224,7 +191,7 @@ import { TorboxApi } from 'torbox-api';
224191
**Example Usage Code Snippet**
225192

226193
```typescript
227-
import { TorboxApi } from 'torbox-api';
194+
import { TorboxApi } from '@torbox/torbox-api';
228195

229196
(async () => {
230197
const torboxApi = new TorboxApi({
@@ -258,7 +225,7 @@ import { TorboxApi } from 'torbox-api';
258225
**Example Usage Code Snippet**
259226

260227
```typescript
261-
import { TorboxApi } from 'torbox-api';
228+
import { TorboxApi } from '@torbox/torbox-api';
262229

263230
(async () => {
264231
const torboxApi = new TorboxApi({
@@ -292,7 +259,7 @@ import { TorboxApi } from 'torbox-api';
292259
**Example Usage Code Snippet**
293260

294261
```typescript
295-
import { TorboxApi } from 'torbox-api';
262+
import { TorboxApi } from '@torbox/torbox-api';
296263

297264
(async () => {
298265
const torboxApi = new TorboxApi({

documentation/services/NotificationsService.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A list of all methods in the `NotificationsService` service. Click on the method
3131
**Example Usage Code Snippet**
3232

3333
```typescript
34-
import { TorboxApi } from 'torbox-api';
34+
import { TorboxApi } from '@torbox/torbox-api';
3535

3636
(async () => {
3737
const torboxApi = new TorboxApi({
@@ -66,7 +66,7 @@ import { TorboxApi } from 'torbox-api';
6666
**Example Usage Code Snippet**
6767

6868
```typescript
69-
import { TorboxApi } from 'torbox-api';
69+
import { TorboxApi } from '@torbox/torbox-api';
7070

7171
(async () => {
7272
const torboxApi = new TorboxApi({
@@ -95,7 +95,7 @@ import { TorboxApi } from 'torbox-api';
9595
**Example Usage Code Snippet**
9696

9797
```typescript
98-
import { TorboxApi } from 'torbox-api';
98+
import { TorboxApi } from '@torbox/torbox-api';
9999

100100
(async () => {
101101
const torboxApi = new TorboxApi({
@@ -125,7 +125,7 @@ import { TorboxApi } from 'torbox-api';
125125
**Example Usage Code Snippet**
126126

127127
```typescript
128-
import { TorboxApi } from 'torbox-api';
128+
import { TorboxApi } from '@torbox/torbox-api';
129129

130130
(async () => {
131131
const torboxApi = new TorboxApi({
@@ -154,7 +154,7 @@ import { TorboxApi } from 'torbox-api';
154154
**Example Usage Code Snippet**
155155

156156
```typescript
157-
import { TorboxApi } from 'torbox-api';
157+
import { TorboxApi } from '@torbox/torbox-api';
158158

159159
(async () => {
160160
const torboxApi = new TorboxApi({

documentation/services/RssFeedsService.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A list of all methods in the `RssFeedsService` service. Click on the method name
2525
**Example Usage Code Snippet**
2626

2727
```typescript
28-
import { TorboxApi } from 'torbox-api';
28+
import { TorboxApi } from '@torbox/torbox-api';
2929

3030
(async () => {
3131
const torboxApi = new TorboxApi({
@@ -57,7 +57,7 @@ import { TorboxApi } from 'torbox-api';
5757
**Example Usage Code Snippet**
5858

5959
```typescript
60-
import { TorboxApi } from 'torbox-api';
60+
import { TorboxApi } from '@torbox/torbox-api';
6161

6262
(async () => {
6363
const torboxApi = new TorboxApi({
@@ -89,7 +89,7 @@ import { TorboxApi } from 'torbox-api';
8989
**Example Usage Code Snippet**
9090

9191
```typescript
92-
import { TorboxApi } from 'torbox-api';
92+
import { TorboxApi } from '@torbox/torbox-api';
9393

9494
(async () => {
9595
const torboxApi = new TorboxApi({

0 commit comments

Comments
 (0)