@adbjs/sdk 2.0.2 → 2.1.1
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 +7 -5
- package/dist/index.cjs +315 -763
- package/dist/index.d.cts +1266 -1275
- package/dist/index.d.ts +1266 -1275
- package/dist/index.js +318 -748
- package/package.json +10 -8
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,529 +1,521 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Configuration options for the AllDebrid client
|
|
3
5
|
*/
|
|
4
|
-
interface AllDebridConfig {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
6
|
+
export interface AllDebridConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Your AllDebrid API key (Bearer token)
|
|
9
|
+
*/
|
|
10
|
+
apiKey: string;
|
|
11
|
+
/**
|
|
12
|
+
* User agent string to identify your application
|
|
13
|
+
* @default '@alldebrid/sdk'
|
|
14
|
+
*/
|
|
15
|
+
agent?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Base URL for the AllDebrid API
|
|
18
|
+
* @default 'https://api.alldebrid.com/v4'
|
|
19
|
+
*/
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Request timeout in milliseconds
|
|
23
|
+
* @default 30000
|
|
24
|
+
*/
|
|
25
|
+
timeout?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Enable automatic retries on failed requests
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
retry?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum number of retry attempts
|
|
33
|
+
* @default 3
|
|
34
|
+
*/
|
|
35
|
+
maxRetries?: number;
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Standard API response wrapper
|
|
37
39
|
*/
|
|
38
|
-
interface ApiResponse<T> {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
export interface ApiResponse<T> {
|
|
41
|
+
status: "success" | "error";
|
|
42
|
+
data?: T;
|
|
43
|
+
error?: ApiError;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* API error structure
|
|
45
47
|
*/
|
|
46
|
-
interface ApiError {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
export interface ApiError {
|
|
49
|
+
code: string;
|
|
50
|
+
message: string;
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
53
|
* Extract the data type from a generated response type.
|
|
52
54
|
* Generated types incorrectly wrap the data as { status, data }, so we extract just the data.
|
|
53
55
|
*/
|
|
54
|
-
type ExtractData<T> = T extends {
|
|
55
|
-
|
|
56
|
+
export type ExtractData<T> = T extends {
|
|
57
|
+
data?: infer D;
|
|
56
58
|
} ? NonNullable<D> | undefined : T;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Base class for all resources
|
|
60
|
-
* Provides access to HTTP methods
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
59
|
declare abstract class BaseResource {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
60
|
+
protected readonly client: AllDebridClient;
|
|
61
|
+
constructor(client: AllDebridClient);
|
|
62
|
+
/**
|
|
63
|
+
* Make a GET request
|
|
64
|
+
* @template T - The generated response type (e.g., GetLinkUnlockResponse)
|
|
65
|
+
* @param path - API endpoint path
|
|
66
|
+
* @param params - Optional query parameters
|
|
67
|
+
* @returns The extracted data from the response (without the { status, data } wrapper)
|
|
68
|
+
*/
|
|
69
|
+
protected get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
|
|
70
|
+
/**
|
|
71
|
+
* Make a POST request
|
|
72
|
+
* @template T - The generated response type
|
|
73
|
+
* @param path - API endpoint path
|
|
74
|
+
* @param body - Request body
|
|
75
|
+
* @param params - Optional query parameters
|
|
76
|
+
* @returns The extracted data from the response (without the { status, data } wrapper)
|
|
77
|
+
*/
|
|
78
|
+
protected post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
|
|
79
|
+
/**
|
|
80
|
+
* Make a POST request with FormData (multipart/form-data)
|
|
81
|
+
* @template T - The generated response type
|
|
82
|
+
* @param path - API endpoint path
|
|
83
|
+
* @param formData - Form data to send
|
|
84
|
+
* @param params - Optional query parameters
|
|
85
|
+
* @returns The extracted data from the response (without the { status, data } wrapper)
|
|
86
|
+
*/
|
|
87
|
+
protected postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
|
|
92
88
|
}
|
|
93
|
-
|
|
94
89
|
/**
|
|
95
90
|
* Host resource for getting information about supported hosts
|
|
96
91
|
*/
|
|
97
|
-
declare class HostResource extends BaseResource {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
92
|
+
export declare class HostResource extends BaseResource {
|
|
93
|
+
/**
|
|
94
|
+
* Get list of all supported hosts with their information
|
|
95
|
+
*
|
|
96
|
+
* @param hostOnly - If true, only return hosts (exclude streams and redirectors)
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const hosts = await client.host.list()
|
|
101
|
+
* console.log(hosts.hosts) // All supported file hosts
|
|
102
|
+
* console.log(hosts.streams) // Streaming hosts
|
|
103
|
+
* console.log(hosts.redirectors) // Link redirectors
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
list(hostOnly?: boolean): Promise<HostsResponseData | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* Get array of all supported domain names
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const domains = await client.host.domains()
|
|
113
|
+
* console.log(domains) // ['rapidgator.net', 'uploaded.net', ...]
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
domains(): Promise<HostsDomainsResponseData | undefined>;
|
|
117
|
+
/**
|
|
118
|
+
* Get hosts ordered by restriction level (priority list)
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* const priority = await client.host.priority()
|
|
123
|
+
* console.log(priority.hosts) // Ordered list with restriction levels
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
priority(): Promise<HostsPriorityResponseData | undefined>;
|
|
132
127
|
}
|
|
133
|
-
|
|
134
128
|
/**
|
|
135
129
|
* Options for polling delayed link generation
|
|
136
130
|
*/
|
|
137
|
-
interface PollOptions {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
131
|
+
export interface PollOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Polling interval in milliseconds
|
|
134
|
+
* @default 2000
|
|
135
|
+
*/
|
|
136
|
+
interval?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Maximum number of polling attempts
|
|
139
|
+
* @default 30
|
|
140
|
+
*/
|
|
141
|
+
maxAttempts?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Callback called on each polling attempt
|
|
144
|
+
*/
|
|
145
|
+
onPoll?: (attempt: number) => void;
|
|
152
146
|
}
|
|
153
147
|
/**
|
|
154
148
|
* Link resource for unlocking and managing download links
|
|
155
149
|
*/
|
|
156
|
-
declare class LinkResource extends BaseResource {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
150
|
+
export declare class LinkResource extends BaseResource {
|
|
151
|
+
/**
|
|
152
|
+
* Get information about one or more links
|
|
153
|
+
*
|
|
154
|
+
* @param links - Single link or array of links to get info for
|
|
155
|
+
* @param password - Optional password for password-protected links
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const data = await client.link.infos('https://example.com/file.zip')
|
|
160
|
+
* console.log(data.infos)
|
|
161
|
+
*
|
|
162
|
+
* // With password
|
|
163
|
+
* const protectedData = await client.link.infos(
|
|
164
|
+
* 'https://example.com/protected.zip',
|
|
165
|
+
* 'mypassword'
|
|
166
|
+
* )
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
infos(links: string | string[], password?: string): Promise<LinkInfosResponseData | undefined>;
|
|
170
|
+
/**
|
|
171
|
+
* Extract links from redirectors/link protectors
|
|
172
|
+
*
|
|
173
|
+
* @param link - The redirector link to extract from
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* const data = await client.link.redirector('https://linkprotector.com/abc123')
|
|
178
|
+
* console.log(data.links)
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
redirector(link: string): Promise<RedirectorResponseData | undefined>;
|
|
182
|
+
/**
|
|
183
|
+
* Unlock a download link
|
|
184
|
+
*
|
|
185
|
+
* @param link - The link to unlock
|
|
186
|
+
* @param password - Optional password for password-protected links
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* const result = await client.link.unlock('https://example.com/file.zip')
|
|
191
|
+
* if (result.link) {
|
|
192
|
+
* console.log('Direct link:', result.link)
|
|
193
|
+
* } else if (result.delayed) {
|
|
194
|
+
* // Handle delayed generation
|
|
195
|
+
* const delayedResult = await client.link.delayed(result.delayed)
|
|
196
|
+
* }
|
|
197
|
+
*
|
|
198
|
+
* // With password
|
|
199
|
+
* const protectedResult = await client.link.unlock(
|
|
200
|
+
* 'https://example.com/protected.zip',
|
|
201
|
+
* 'mypassword'
|
|
202
|
+
* )
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
unlock(link: string, password?: string): Promise<UnlockLinkResponseData | undefined>;
|
|
206
|
+
/**
|
|
207
|
+
* Unlock a link and automatically poll if delayed
|
|
208
|
+
* Note: The API response format doesn't include a delayed field in the current OpenAPI spec.
|
|
209
|
+
* This method will be updated once the delayed mechanism is documented.
|
|
210
|
+
*
|
|
211
|
+
* @param link - The link to unlock
|
|
212
|
+
* @param _options - Polling options (currently unused)
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```ts
|
|
216
|
+
* const result = await client.link.unlockWithPolling('https://example.com/file.zip')
|
|
217
|
+
* console.log('Direct link:', result.link)
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
unlockWithPolling(link: string, _options?: PollOptions): Promise<UnlockLinkResponseData | undefined>;
|
|
221
|
+
/**
|
|
222
|
+
* Get streaming options for a generated link
|
|
223
|
+
*
|
|
224
|
+
* @param id - The generated link ID or streaming ID
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* const streams = await client.link.streaming('abc123')
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
streaming(id: string, stream: string): Promise<StreamingResponseData | undefined>;
|
|
232
|
+
/**
|
|
233
|
+
* Get the status/result of a delayed link generation
|
|
234
|
+
*
|
|
235
|
+
* @param id - The delayed generation ID
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```ts
|
|
239
|
+
* const result = await client.link.delayed('delayed_id_123')
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
delayed(id: number): Promise<DelayedStatusResponseData | undefined>;
|
|
249
243
|
}
|
|
250
|
-
|
|
251
244
|
/**
|
|
252
245
|
* Options for live mode status polling
|
|
253
246
|
*/
|
|
254
|
-
interface LiveStatusOptions {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
247
|
+
export interface LiveStatusOptions {
|
|
248
|
+
/**
|
|
249
|
+
* Session ID - Generate a random number and keep it consistent for the entire session
|
|
250
|
+
* @example Math.floor(Math.random() * 1000000)
|
|
251
|
+
*/
|
|
252
|
+
session: number;
|
|
253
|
+
/**
|
|
254
|
+
* Counter for synchronization - Start at 0 and increment with each call
|
|
255
|
+
* The API will return the next counter value to use
|
|
256
|
+
*/
|
|
257
|
+
counter: number;
|
|
265
258
|
}
|
|
266
259
|
/**
|
|
267
260
|
* Options for watching magnet status
|
|
268
261
|
*/
|
|
269
|
-
interface WatchOptions {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
262
|
+
export interface WatchOptions {
|
|
263
|
+
/**
|
|
264
|
+
* Polling interval in milliseconds
|
|
265
|
+
* @default 3000
|
|
266
|
+
*/
|
|
267
|
+
interval?: number;
|
|
268
|
+
/**
|
|
269
|
+
* Maximum number of polling attempts (0 = infinite)
|
|
270
|
+
* @default 0
|
|
271
|
+
*/
|
|
272
|
+
maxAttempts?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Callback called on each status update
|
|
275
|
+
*/
|
|
276
|
+
onUpdate?: (status: any) => void;
|
|
277
|
+
/**
|
|
278
|
+
* Stop watching when magnet reaches this status
|
|
279
|
+
* @default 'Ready'
|
|
280
|
+
*/
|
|
281
|
+
stopOnStatus?: string;
|
|
289
282
|
}
|
|
290
283
|
/**
|
|
291
284
|
* Magnet/Torrent resource for managing torrent downloads
|
|
292
285
|
*/
|
|
293
|
-
declare class MagnetResource extends BaseResource {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
286
|
+
export declare class MagnetResource extends BaseResource {
|
|
287
|
+
/**
|
|
288
|
+
* Upload magnets by URI or hash
|
|
289
|
+
*
|
|
290
|
+
* @param magnets - Single magnet URI/hash or array of magnets
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```ts
|
|
294
|
+
* const result = await client.magnet.upload('magnet:?xt=urn:btih:...')
|
|
295
|
+
* console.log('Magnet ID:', result.magnets[0].id)
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
upload(magnets: string | string[]): Promise<MagnetUploadResponseData | undefined>;
|
|
299
|
+
/**
|
|
300
|
+
* Upload a torrent file
|
|
301
|
+
*
|
|
302
|
+
* @param file - The torrent file (Blob or File)
|
|
303
|
+
* @param filename - Optional filename (defaults to 'torrent.torrent' for Blob, or file.name for File)
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```ts
|
|
307
|
+
* const file = new File([buffer], 'torrent.torrent')
|
|
308
|
+
* const result = await client.magnet.uploadFile(file)
|
|
309
|
+
*
|
|
310
|
+
* // Or with a Blob and custom filename
|
|
311
|
+
* const blob = new Blob([buffer])
|
|
312
|
+
* const result = await client.magnet.uploadFile(blob, 'my-torrent.torrent')
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
uploadFile(file: Blob | File, filename?: string): Promise<TorrentFileUploadResponseData | undefined>;
|
|
316
|
+
/**
|
|
317
|
+
* Get the status of a specific magnet by ID
|
|
318
|
+
*
|
|
319
|
+
* @param id - Magnet ID to get status for
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```ts
|
|
323
|
+
* const status = await client.magnet.status(123)
|
|
324
|
+
* console.log(status.magnets[0]?.status) // 'Downloading', 'Ready', etc.
|
|
325
|
+
* ```
|
|
326
|
+
*
|
|
327
|
+
* @remarks
|
|
328
|
+
* This endpoint uses AllDebrid API v4.1 (POST method)
|
|
329
|
+
* Migrated from v4 GET endpoint which was deprecated on 2024-10-16
|
|
330
|
+
*/
|
|
331
|
+
status(id: number): Promise<MagnetStatusResponseData | undefined>;
|
|
332
|
+
/**
|
|
333
|
+
* Get list of magnets with optional status filter
|
|
334
|
+
*
|
|
335
|
+
* @param statusFilter - Optional filter by status: 'active', 'ready', 'expired', or 'error'
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```ts
|
|
339
|
+
* // Get all magnets
|
|
340
|
+
* const allMagnets = await client.magnet.statusList()
|
|
341
|
+
*
|
|
342
|
+
* // Get only active magnets
|
|
343
|
+
* const activeMagnets = await client.magnet.statusList('active')
|
|
344
|
+
*
|
|
345
|
+
* // Get only ready magnets
|
|
346
|
+
* const readyMagnets = await client.magnet.statusList('ready')
|
|
347
|
+
* ```
|
|
348
|
+
*
|
|
349
|
+
* @remarks
|
|
350
|
+
* This endpoint uses AllDebrid API v4.1 (POST method)
|
|
351
|
+
*/
|
|
352
|
+
statusList(statusFilter?: "active" | "ready" | "expired" | "error"): Promise<MagnetStatusResponseData | undefined>;
|
|
353
|
+
/**
|
|
354
|
+
* Get magnet status using live mode for bandwidth-optimized delta synchronization
|
|
355
|
+
*
|
|
356
|
+
* Live mode is designed for monitoring multiple magnets efficiently by only transmitting
|
|
357
|
+
* changes between polling intervals, drastically reducing bandwidth usage for dashboards
|
|
358
|
+
* and real-time monitoring applications.
|
|
359
|
+
*
|
|
360
|
+
* ## How it works
|
|
361
|
+
*
|
|
362
|
+
* 1. **Session initialization**: Generate a random session ID and start with counter = 0
|
|
363
|
+
* 2. **First call (fullsync)**: Returns ALL magnets with `fullsync: true`
|
|
364
|
+
* 3. **Update counter**: Use the `counter` value returned by the API for the next call
|
|
365
|
+
* 4. **Subsequent calls (delta)**: Returns ONLY magnets that changed since last call
|
|
366
|
+
* 5. **Repeat**: Keep calling with updated counter to receive only deltas
|
|
367
|
+
*
|
|
368
|
+
* ## When to use
|
|
369
|
+
*
|
|
370
|
+
* - ✅ Monitoring multiple active magnets simultaneously
|
|
371
|
+
* - ✅ Building real-time dashboards
|
|
372
|
+
* - ✅ High-frequency polling scenarios (every few seconds)
|
|
373
|
+
* - ❌ Watching a single specific magnet (use `watch()` instead)
|
|
374
|
+
*
|
|
375
|
+
* ## Important notes
|
|
376
|
+
*
|
|
377
|
+
* - **Don't use the `id` parameter**: Passing an ID defeats the purpose of live mode
|
|
378
|
+
* as it disables delta sync and behaves like a regular `status()` call
|
|
379
|
+
* - **Session persistence**: Keep the same session ID for the entire monitoring session
|
|
380
|
+
* - **Counter tracking**: Always update the counter with the value returned by the API
|
|
381
|
+
* - **Empty deltas**: When no magnets changed, `magnets` will be an empty array
|
|
382
|
+
*
|
|
383
|
+
* @param options - Live mode session options
|
|
384
|
+
* @param options.session - Unique session ID (generate once: `Math.floor(Math.random() * 1000000)`)
|
|
385
|
+
* @param options.counter - Sync counter (start at 0, then use value from previous API response)
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```ts
|
|
389
|
+
* // Initialize session
|
|
390
|
+
* const session = Math.floor(Math.random() * 1000000)
|
|
391
|
+
* let counter = 0
|
|
392
|
+
*
|
|
393
|
+
* // First call - returns all magnets (fullsync: true)
|
|
394
|
+
* const firstCall = await client.magnet.statusLive({ session, counter })
|
|
395
|
+
* console.log('Full sync:', firstCall.fullsync) // true
|
|
396
|
+
* console.log('All magnets:', firstCall.magnets) // Array of all magnets
|
|
397
|
+
* counter = firstCall.counter // Update counter for next call
|
|
398
|
+
*
|
|
399
|
+
* // Second call - returns only magnets that changed
|
|
400
|
+
* await new Promise(resolve => setTimeout(resolve, 3000)) // Wait 3 seconds
|
|
401
|
+
* const secondCall = await client.magnet.statusLive({ session, counter })
|
|
402
|
+
* console.log('Delta sync:', secondCall.magnets) // Only changed magnets
|
|
403
|
+
* counter = secondCall.counter
|
|
404
|
+
*
|
|
405
|
+
* // Example: Monitor all magnets until none are active
|
|
406
|
+
* const activeMagnets = new Map()
|
|
407
|
+
*
|
|
408
|
+
* while (true) {
|
|
409
|
+
* const response = await client.magnet.statusLive({ session, counter })
|
|
410
|
+
* counter = response.counter ?? counter
|
|
411
|
+
*
|
|
412
|
+
* // Update our local state with changes
|
|
413
|
+
* if (response.fullsync) {
|
|
414
|
+
* activeMagnets.clear()
|
|
415
|
+
* response.magnets?.forEach(m => activeMagnets.set(m.id, m))
|
|
416
|
+
* } else {
|
|
417
|
+
* response.magnets?.forEach(m => {
|
|
418
|
+
* if (m.status === 'Ready' || m.status === 'Error' || m.status === 'Expired') {
|
|
419
|
+
* activeMagnets.delete(m.id)
|
|
420
|
+
* } else {
|
|
421
|
+
* activeMagnets.set(m.id, m)
|
|
422
|
+
* }
|
|
423
|
+
* })
|
|
424
|
+
* }
|
|
425
|
+
*
|
|
426
|
+
* // Display current state
|
|
427
|
+
* console.log(`Active downloads: ${activeMagnets.size}`)
|
|
428
|
+
* activeMagnets.forEach(m => {
|
|
429
|
+
* console.log(` ${m.filename}: ${m.status} - ${m.downloaded}/${m.size} bytes`)
|
|
430
|
+
* })
|
|
431
|
+
*
|
|
432
|
+
* // Stop when no more active magnets
|
|
433
|
+
* if (activeMagnets.size === 0) {
|
|
434
|
+
* console.log('All downloads completed!')
|
|
435
|
+
* break
|
|
436
|
+
* }
|
|
437
|
+
*
|
|
438
|
+
* await new Promise(resolve => setTimeout(resolve, 3000))
|
|
439
|
+
* }
|
|
440
|
+
* ```
|
|
441
|
+
*
|
|
442
|
+
* @remarks
|
|
443
|
+
* This method is ideal for scenarios where you're monitoring multiple magnets and want
|
|
444
|
+
* to minimize bandwidth. For simple single-magnet monitoring, use `watch()` instead.
|
|
445
|
+
*/
|
|
446
|
+
statusLive(options: LiveStatusOptions): Promise<MagnetStatusResponseData | undefined>;
|
|
447
|
+
/**
|
|
448
|
+
* Delete a magnet
|
|
449
|
+
*
|
|
450
|
+
* @param id - The magnet ID to delete
|
|
451
|
+
*
|
|
452
|
+
* @example
|
|
453
|
+
* ```ts
|
|
454
|
+
* await client.magnet.delete(123)
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
delete(id: number): Promise<MessageResponseData | undefined>;
|
|
458
|
+
/**
|
|
459
|
+
* Restart one or more failed magnets
|
|
460
|
+
*
|
|
461
|
+
* @param ids - Single magnet ID or array of magnet IDs to restart (numbers)
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```ts
|
|
465
|
+
* // Restart single magnet
|
|
466
|
+
* await client.magnet.restart(123)
|
|
467
|
+
*
|
|
468
|
+
* // Restart multiple magnets
|
|
469
|
+
* await client.magnet.restart([123, 456])
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
restart(ids: number | number[]): Promise<MessageResponseData | undefined>;
|
|
473
|
+
/**
|
|
474
|
+
* Get files for a completed magnet
|
|
475
|
+
*
|
|
476
|
+
* @param ids - The magnet ID or IDs to get files for
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```ts
|
|
480
|
+
* const data = await client.magnet.files(123)
|
|
481
|
+
* data?.magnets?.forEach(magnet => {
|
|
482
|
+
* console.log(magnet.filename, magnet.files)
|
|
483
|
+
* })
|
|
484
|
+
* ```
|
|
485
|
+
*
|
|
486
|
+
* @remarks
|
|
487
|
+
* Files are now retrieved separately from magnet status (since v4.1)
|
|
488
|
+
* Only available for magnets with status 'Ready'
|
|
489
|
+
*/
|
|
490
|
+
files(ids: number | number[]): Promise<MagnetFilesResponseData | undefined>;
|
|
491
|
+
/**
|
|
492
|
+
* Watch a magnet's status with automatic polling
|
|
493
|
+
*
|
|
494
|
+
* This is a simple helper that polls the status of a specific magnet until it reaches
|
|
495
|
+
* a target status (default: 'Ready'). For advanced use cases with multiple magnets
|
|
496
|
+
* or bandwidth optimization, use `statusLive()` directly instead.
|
|
497
|
+
*
|
|
498
|
+
* @param id - The magnet ID to watch
|
|
499
|
+
* @param options - Watch options
|
|
500
|
+
* @param options.interval - Polling interval in milliseconds (default: 3000)
|
|
501
|
+
* @param options.maxAttempts - Maximum polling attempts, 0 for infinite (default: 0)
|
|
502
|
+
* @param options.onUpdate - Callback called on each status update
|
|
503
|
+
* @param options.stopOnStatus - Stop when magnet reaches this status (default: 'Ready')
|
|
504
|
+
*
|
|
505
|
+
* @example
|
|
506
|
+
* ```ts
|
|
507
|
+
* await client.magnet.watch(123, {
|
|
508
|
+
* onUpdate: (status) => console.log('Status:', status.magnets[0]?.status),
|
|
509
|
+
* stopOnStatus: 'Ready'
|
|
510
|
+
* })
|
|
511
|
+
* ```
|
|
512
|
+
*
|
|
513
|
+
* @remarks
|
|
514
|
+
* For monitoring multiple magnets efficiently, use `statusLive()` directly.
|
|
515
|
+
* See the `statusLive()` documentation for details on delta synchronization.
|
|
516
|
+
*/
|
|
517
|
+
watch(id: number, options?: WatchOptions): Promise<MagnetStatusResponseData | undefined>;
|
|
525
518
|
}
|
|
526
|
-
|
|
527
519
|
/**
|
|
528
520
|
* Pin resource for PIN-based authentication flow
|
|
529
521
|
*
|
|
@@ -531,924 +523,923 @@ declare class MagnetResource extends BaseResource {
|
|
|
531
523
|
* This is useful for applications where you want users to authorize access through
|
|
532
524
|
* the AllDebrid website.
|
|
533
525
|
*/
|
|
534
|
-
declare class PinResource extends BaseResource {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
526
|
+
export declare class PinResource extends BaseResource {
|
|
527
|
+
/**
|
|
528
|
+
* Generate a new PIN code for authentication
|
|
529
|
+
*
|
|
530
|
+
* This initiates the PIN authentication flow. The user should visit the
|
|
531
|
+
* returned URL to authorize the application.
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* ```ts
|
|
535
|
+
* const pinData = await client.pin.generate()
|
|
536
|
+
* console.log('Visit:', pinData.user_url)
|
|
537
|
+
* console.log('PIN:', pinData.pin)
|
|
538
|
+
*
|
|
539
|
+
* // Poll the check endpoint until user authorizes
|
|
540
|
+
* const auth = await client.pin.check(pinData.check, pinData.pin)
|
|
541
|
+
* if (auth.activated) {
|
|
542
|
+
* console.log('API Key:', auth.apikey)
|
|
543
|
+
* }
|
|
544
|
+
* ```
|
|
545
|
+
*
|
|
546
|
+
* @returns PIN code and authorization URL
|
|
547
|
+
*/
|
|
548
|
+
generate(): Promise<PinGetResponseData | undefined>;
|
|
549
|
+
/**
|
|
550
|
+
* Check the status of a PIN authentication
|
|
551
|
+
*
|
|
552
|
+
* Poll this endpoint to check if the user has authorized the application.
|
|
553
|
+
* Once authorized, the response will include the API key.
|
|
554
|
+
*
|
|
555
|
+
* @param check - Check ID from /pin/get
|
|
556
|
+
* @param pin - PIN code from /pin/get
|
|
557
|
+
*
|
|
558
|
+
* @example
|
|
559
|
+
* ```ts
|
|
560
|
+
* const pinData = await client.pin.generate()
|
|
561
|
+
*
|
|
562
|
+
* // Poll every few seconds until activated
|
|
563
|
+
* const checkStatus = async () => {
|
|
564
|
+
* const result = await client.pin.check(pinData.check, pinData.pin)
|
|
565
|
+
* if (result?.activated && result?.apikey) {
|
|
566
|
+
* console.log('Authorized! API Key:', result.apikey)
|
|
567
|
+
* return result.apikey
|
|
568
|
+
* }
|
|
569
|
+
* // Wait and try again
|
|
570
|
+
* await new Promise(resolve => setTimeout(resolve, 3000))
|
|
571
|
+
* return checkStatus()
|
|
572
|
+
* }
|
|
573
|
+
*
|
|
574
|
+
* const apikey = await checkStatus()
|
|
575
|
+
* ```
|
|
576
|
+
*
|
|
577
|
+
* @returns Authorization status and API key (if activated)
|
|
578
|
+
*/
|
|
579
|
+
check(check: string, pin: string): Promise<PinCheckResponseData | undefined>;
|
|
580
|
+
/**
|
|
581
|
+
* Helper method to wait for PIN authorization with automatic polling
|
|
582
|
+
*
|
|
583
|
+
* This method handles the polling logic for you, making it easier to
|
|
584
|
+
* implement the PIN authentication flow.
|
|
585
|
+
*
|
|
586
|
+
* @param check - Check ID from /pin/get
|
|
587
|
+
* @param pin - PIN code from /pin/get
|
|
588
|
+
* @param options - Polling options
|
|
589
|
+
* @param options.timeout - Maximum time to wait in milliseconds (default: 600000 = 10 minutes)
|
|
590
|
+
* @param options.interval - Polling interval in milliseconds (default: 3000 = 3 seconds)
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
* ```ts
|
|
594
|
+
* const pinData = await client.pin.generate()
|
|
595
|
+
* console.log('Visit:', pinData.user_url)
|
|
596
|
+
*
|
|
597
|
+
* try {
|
|
598
|
+
* const apikey = await client.pin.waitForAuth(pinData.check, pinData.pin, {
|
|
599
|
+
* timeout: 600000, // 10 minutes
|
|
600
|
+
* interval: 3000, // Check every 3 seconds
|
|
601
|
+
* })
|
|
602
|
+
* console.log('Authorized! API Key:', apikey)
|
|
603
|
+
* } catch (error) {
|
|
604
|
+
* console.error('Authorization timed out or failed')
|
|
605
|
+
* }
|
|
606
|
+
* ```
|
|
607
|
+
*
|
|
608
|
+
* @returns The API key once authorized
|
|
609
|
+
* @throws Error if timeout is reached or authorization fails
|
|
610
|
+
*/
|
|
611
|
+
waitForAuth(check: string, pin: string, options?: {
|
|
612
|
+
/** Maximum time to wait in milliseconds (default: 600000 = 10 minutes) */
|
|
613
|
+
timeout?: number;
|
|
614
|
+
/** Polling interval in milliseconds (default: 3000 = 3 seconds) */
|
|
615
|
+
interval?: number;
|
|
616
|
+
}): Promise<string>;
|
|
625
617
|
}
|
|
626
|
-
|
|
627
618
|
/**
|
|
628
619
|
* User resource for managing user account information
|
|
629
620
|
*/
|
|
630
|
-
declare class UserResource extends BaseResource {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
621
|
+
export declare class UserResource extends BaseResource {
|
|
622
|
+
/**
|
|
623
|
+
* Get user profile information including premium status and quotas
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* ```ts
|
|
627
|
+
* const data = await client.user.getInfo()
|
|
628
|
+
* console.log(data.user.username, data.user.isPremium)
|
|
629
|
+
* ```
|
|
630
|
+
*/
|
|
631
|
+
getInfo(): Promise<UserResponseData | undefined>;
|
|
632
|
+
/**
|
|
633
|
+
* Get available hosts for the current user based on their subscription
|
|
634
|
+
*
|
|
635
|
+
* @param hostOnly - If true, only return hosts data (exclude streams and redirectors)
|
|
636
|
+
*
|
|
637
|
+
* @example
|
|
638
|
+
* ```ts
|
|
639
|
+
* const hosts = await client.user.getHosts()
|
|
640
|
+
* console.log(Object.keys(hosts.hosts))
|
|
641
|
+
* ```
|
|
642
|
+
*/
|
|
643
|
+
getHosts(hostOnly?: boolean): Promise<UserHostsResponseData | undefined>;
|
|
644
|
+
/**
|
|
645
|
+
* Clear a specific notification by code
|
|
646
|
+
*
|
|
647
|
+
* @param code - The notification code to clear
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* ```ts
|
|
651
|
+
* await client.user.clearNotification('SOME_NOTIF_CODE')
|
|
652
|
+
* ```
|
|
653
|
+
*/
|
|
654
|
+
clearNotification(code: string): Promise<void>;
|
|
655
|
+
/**
|
|
656
|
+
* Get all saved links
|
|
657
|
+
*
|
|
658
|
+
* @example
|
|
659
|
+
* ```ts
|
|
660
|
+
* const savedLinks = await client.user.getLinks()
|
|
661
|
+
* console.log(savedLinks.links)
|
|
662
|
+
* ```
|
|
663
|
+
*/
|
|
664
|
+
getLinks(): Promise<SavedLinksResponseData | undefined>;
|
|
665
|
+
/**
|
|
666
|
+
* Save one or multiple links for later use
|
|
667
|
+
*
|
|
668
|
+
* Supports batch operations - you can save multiple links in a single request.
|
|
669
|
+
*
|
|
670
|
+
* @param links - Single link or array of links to save
|
|
671
|
+
*
|
|
672
|
+
* @example
|
|
673
|
+
* ```ts
|
|
674
|
+
* // Save single link
|
|
675
|
+
* await client.user.saveLink('https://example.com/file.zip')
|
|
676
|
+
*
|
|
677
|
+
* // Save multiple links at once
|
|
678
|
+
* await client.user.saveLink([
|
|
679
|
+
* 'https://example.com/file1.zip',
|
|
680
|
+
* 'https://example.com/file2.zip',
|
|
681
|
+
* 'https://example.com/file3.zip'
|
|
682
|
+
* ])
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
saveLink(links: string | string[]): Promise<MessageResponseData | undefined>;
|
|
686
|
+
/**
|
|
687
|
+
* Delete one or multiple saved links
|
|
688
|
+
*
|
|
689
|
+
* Supports batch operations - you can delete multiple links in a single request.
|
|
690
|
+
*
|
|
691
|
+
* @param links - Single link or array of links to delete (can be saved link IDs or URLs)
|
|
692
|
+
*
|
|
693
|
+
* @example
|
|
694
|
+
* ```ts
|
|
695
|
+
* // Delete single link
|
|
696
|
+
* await client.user.deleteLink('saved-link-id')
|
|
697
|
+
*
|
|
698
|
+
* // Delete multiple links at once
|
|
699
|
+
* await client.user.deleteLink([
|
|
700
|
+
* 'saved-link-id-1',
|
|
701
|
+
* 'saved-link-id-2',
|
|
702
|
+
* 'saved-link-id-3'
|
|
703
|
+
* ])
|
|
704
|
+
* ```
|
|
705
|
+
*/
|
|
706
|
+
deleteLink(links: string | string[]): Promise<MessageResponseData | undefined>;
|
|
707
|
+
/**
|
|
708
|
+
* Get user history (if enabled in account settings)
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* ```ts
|
|
712
|
+
* const history = await client.user.getHistory()
|
|
713
|
+
* console.log(history.links)
|
|
714
|
+
* ```
|
|
715
|
+
*/
|
|
716
|
+
getHistory(): Promise<SavedLinksResponseData | undefined>;
|
|
717
|
+
/**
|
|
718
|
+
* Clear user history
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
721
|
+
* ```ts
|
|
722
|
+
* await client.user.clearHistory()
|
|
723
|
+
* ```
|
|
724
|
+
*/
|
|
725
|
+
clearHistory(): Promise<MessageResponseData | undefined>;
|
|
726
|
+
/**
|
|
727
|
+
* Check email verification status
|
|
728
|
+
*
|
|
729
|
+
* @param token - Verification token
|
|
730
|
+
*
|
|
731
|
+
* @example
|
|
732
|
+
* ```ts
|
|
733
|
+
* const status = await client.user.getVerificationStatus('verification-token')
|
|
734
|
+
* console.log(status.verif) // 'waiting', 'allowed', or 'denied'
|
|
735
|
+
* ```
|
|
736
|
+
*/
|
|
737
|
+
getVerificationStatus(token: string): Promise<VerifStatusResponseData | undefined>;
|
|
738
|
+
/**
|
|
739
|
+
* Resend verification email
|
|
740
|
+
*
|
|
741
|
+
* @param token - Verification token
|
|
742
|
+
*
|
|
743
|
+
* @example
|
|
744
|
+
* ```ts
|
|
745
|
+
* await client.user.resendVerification('verification-token')
|
|
746
|
+
* ```
|
|
747
|
+
*/
|
|
748
|
+
resendVerification(token: string): Promise<ResendVerifResponseData | undefined>;
|
|
758
749
|
}
|
|
759
|
-
|
|
760
750
|
/**
|
|
761
751
|
* Voucher resource for reseller voucher management
|
|
762
752
|
*
|
|
763
753
|
* Note: These endpoints are only available for reseller accounts.
|
|
764
754
|
*/
|
|
765
|
-
declare class VoucherResource extends BaseResource {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
755
|
+
export declare class VoucherResource extends BaseResource {
|
|
756
|
+
/**
|
|
757
|
+
* Get voucher balance for reseller accounts
|
|
758
|
+
*
|
|
759
|
+
* This endpoint allows resellers to check their remaining voucher balance.
|
|
760
|
+
* Only available for accounts with reseller privileges.
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* ```ts
|
|
764
|
+
* const balance = await client.voucher.getBalance()
|
|
765
|
+
* console.log('Remaining balance:', balance.balance, '€')
|
|
766
|
+
* ```
|
|
767
|
+
*
|
|
768
|
+
* @returns Voucher balance information
|
|
769
|
+
*/
|
|
770
|
+
getBalance(): Promise<VoucherBalanceResponseData | undefined>;
|
|
771
|
+
/**
|
|
772
|
+
* Retrieve existing vouchers from reseller inventory
|
|
773
|
+
*
|
|
774
|
+
* This endpoint retrieves vouchers that were previously generated
|
|
775
|
+
* and are available in your inventory.
|
|
776
|
+
*
|
|
777
|
+
* @param quantity - Optional number of vouchers to retrieve
|
|
778
|
+
*
|
|
779
|
+
* @example
|
|
780
|
+
* ```ts
|
|
781
|
+
* // Get all available vouchers
|
|
782
|
+
* const allVouchers = await client.voucher.getVouchers()
|
|
783
|
+
* console.log('Vouchers:', allVouchers?.codes)
|
|
784
|
+
*
|
|
785
|
+
* // Get specific quantity
|
|
786
|
+
* const fiveVouchers = await client.voucher.getVouchers(5)
|
|
787
|
+
* ```
|
|
788
|
+
*
|
|
789
|
+
* @returns List of voucher codes
|
|
790
|
+
*/
|
|
791
|
+
getVouchers(quantity?: number): Promise<VoucherGetResponseData | undefined>;
|
|
792
|
+
/**
|
|
793
|
+
* Generate new vouchers (deducts from reseller balance)
|
|
794
|
+
*
|
|
795
|
+
* This endpoint creates new vouchers and deducts the cost from your
|
|
796
|
+
* reseller account balance.
|
|
797
|
+
*
|
|
798
|
+
* @param quantity - Number of vouchers to generate
|
|
799
|
+
* @param duration - Voucher duration in days
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```ts
|
|
803
|
+
* // Generate 10 vouchers valid for 30 days
|
|
804
|
+
* const vouchers = await client.voucher.generateVouchers(10, 30)
|
|
805
|
+
* console.log('Generated vouchers:', vouchers?.codes)
|
|
806
|
+
*
|
|
807
|
+
* // Generate 5 vouchers valid for 7 days
|
|
808
|
+
* const weekVouchers = await client.voucher.generateVouchers(5, 7)
|
|
809
|
+
* ```
|
|
810
|
+
*
|
|
811
|
+
* @returns List of newly generated voucher codes
|
|
812
|
+
*/
|
|
813
|
+
generateVouchers(quantity: number, duration: number): Promise<VoucherGenerateResponseData | undefined>;
|
|
824
814
|
}
|
|
825
|
-
|
|
826
815
|
/**
|
|
827
816
|
* Main AllDebrid client class
|
|
828
817
|
*/
|
|
829
|
-
declare class AllDebridClient {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
818
|
+
export declare class AllDebridClient {
|
|
819
|
+
private readonly config;
|
|
820
|
+
/**
|
|
821
|
+
* User resource for managing user account
|
|
822
|
+
*/
|
|
823
|
+
readonly user: UserResource;
|
|
824
|
+
/**
|
|
825
|
+
* Link resource for unlocking and managing download links
|
|
826
|
+
*/
|
|
827
|
+
readonly link: LinkResource;
|
|
828
|
+
/**
|
|
829
|
+
* Magnet resource for managing torrents
|
|
830
|
+
*/
|
|
831
|
+
readonly magnet: MagnetResource;
|
|
832
|
+
/**
|
|
833
|
+
* Host resource for getting information about supported hosts
|
|
834
|
+
*/
|
|
835
|
+
readonly host: HostResource;
|
|
836
|
+
/**
|
|
837
|
+
* Pin resource for PIN-based authentication
|
|
838
|
+
*/
|
|
839
|
+
readonly pin: PinResource;
|
|
840
|
+
/**
|
|
841
|
+
* Voucher resource for reseller voucher management
|
|
842
|
+
*/
|
|
843
|
+
readonly voucher: VoucherResource;
|
|
844
|
+
constructor(config: AllDebridConfig);
|
|
845
|
+
/**
|
|
846
|
+
* Build query string from params
|
|
847
|
+
*/
|
|
848
|
+
private buildUrl;
|
|
849
|
+
/**
|
|
850
|
+
* Make a GET request
|
|
851
|
+
* @template T - The generated response type (e.g., GetLinkUnlockResponse)
|
|
852
|
+
* @param path - API endpoint path
|
|
853
|
+
* @param params - Optional query parameters
|
|
854
|
+
* @returns The extracted data from the response (without the { status, data } wrapper)
|
|
855
|
+
* @internal
|
|
856
|
+
*/
|
|
857
|
+
get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
|
|
858
|
+
/**
|
|
859
|
+
* Make a POST request with application/x-www-form-urlencoded
|
|
860
|
+
* @template T - The generated response type
|
|
861
|
+
* @param path - API endpoint path
|
|
862
|
+
* @param body - Request body (will be converted to URLSearchParams)
|
|
863
|
+
* @param params - Optional query parameters
|
|
864
|
+
* @returns The extracted data from the response (without the { status, data } wrapper)
|
|
865
|
+
* @internal
|
|
866
|
+
*/
|
|
867
|
+
post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
|
|
868
|
+
/**
|
|
869
|
+
* Make a POST request with FormData (multipart/form-data)
|
|
870
|
+
* @template T - The generated response type
|
|
871
|
+
* @param path - API endpoint path
|
|
872
|
+
* @param formData - Form data to send
|
|
873
|
+
* @param params - Optional query parameters
|
|
874
|
+
* @returns The extracted data from the response (without the { status, data } wrapper)
|
|
875
|
+
* @internal
|
|
876
|
+
*/
|
|
877
|
+
postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
|
|
878
|
+
/**
|
|
879
|
+
* Test the API connection
|
|
880
|
+
*
|
|
881
|
+
* This endpoint doesn't require authentication and can be used to verify
|
|
882
|
+
* that the AllDebrid API is reachable.
|
|
883
|
+
*
|
|
884
|
+
* @example
|
|
885
|
+
* ```ts
|
|
886
|
+
* const result = await client.ping()
|
|
887
|
+
* console.log(result.ping) // 'pong'
|
|
888
|
+
* ```
|
|
889
|
+
*
|
|
890
|
+
* @returns Ping response with 'pong' message
|
|
891
|
+
*/
|
|
892
|
+
ping(): Promise<PingResponseData | undefined>;
|
|
904
893
|
}
|
|
905
|
-
|
|
906
894
|
/**
|
|
907
895
|
* Base error class for AllDebrid SDK errors
|
|
908
896
|
*/
|
|
909
|
-
declare class AllDebridError extends Error {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
897
|
+
export declare class AllDebridError extends Error {
|
|
898
|
+
readonly code: string;
|
|
899
|
+
readonly isAllDebridError = true;
|
|
900
|
+
constructor(code: string, message: string);
|
|
901
|
+
/**
|
|
902
|
+
* Create an AllDebridError from an API error response
|
|
903
|
+
*/
|
|
904
|
+
static fromApiError(error: ApiError): AllDebridError;
|
|
917
905
|
}
|
|
918
906
|
/**
|
|
919
907
|
* Authentication related errors
|
|
920
908
|
*/
|
|
921
|
-
declare class AuthenticationError extends AllDebridError {
|
|
922
|
-
|
|
909
|
+
export declare class AuthenticationError extends AllDebridError {
|
|
910
|
+
constructor(code: string, message: string);
|
|
923
911
|
}
|
|
924
912
|
/**
|
|
925
913
|
* Link processing errors
|
|
926
914
|
*/
|
|
927
|
-
declare class LinkError extends AllDebridError {
|
|
928
|
-
|
|
915
|
+
export declare class LinkError extends AllDebridError {
|
|
916
|
+
constructor(code: string, message: string);
|
|
929
917
|
}
|
|
930
918
|
/**
|
|
931
919
|
* Magnet/Torrent related errors
|
|
932
920
|
*/
|
|
933
|
-
declare class MagnetError extends AllDebridError {
|
|
934
|
-
|
|
921
|
+
export declare class MagnetError extends AllDebridError {
|
|
922
|
+
constructor(code: string, message: string);
|
|
935
923
|
}
|
|
936
924
|
/**
|
|
937
925
|
* Network/HTTP errors
|
|
938
926
|
*/
|
|
939
|
-
declare class NetworkError extends AllDebridError {
|
|
940
|
-
|
|
941
|
-
|
|
927
|
+
export declare class NetworkError extends AllDebridError {
|
|
928
|
+
readonly statusCode?: number | undefined;
|
|
929
|
+
constructor(message: string, statusCode?: number | undefined);
|
|
942
930
|
}
|
|
943
931
|
/**
|
|
944
932
|
* Helper to determine error type from error code
|
|
945
933
|
*/
|
|
946
|
-
declare function createTypedError(code: string, message: string): AllDebridError;
|
|
947
|
-
|
|
934
|
+
export declare function createTypedError(code: string, message: string): AllDebridError;
|
|
948
935
|
/**
|
|
949
936
|
* Liste exhaustive des codes d'erreur AllDebrid (janvier 2026)
|
|
950
937
|
*/
|
|
951
|
-
type AllDebridErrorCode =
|
|
952
|
-
type ApiErrorResponse = {
|
|
953
|
-
|
|
954
|
-
|
|
938
|
+
export type AllDebridErrorCode = "GENERIC" | "MAINTENANCE" | "AUTH_MISSING_APIKEY" | "AUTH_BAD_APIKEY" | "AUTH_BLOCKED" | "AUTH_USER_BANNED" | "ALREADY_SENT" | "NO_SERVER" | "LINK_IS_MISSING" | "BAD_LINK" | "LINK_HOST_NOT_SUPPORTED" | "LINK_DOWN" | "LINK_PASS_PROTECTED" | "LINK_HOST_UNAVAILABLE" | "LINK_TOO_MANY_DOWNLOADS" | "LINK_HOST_FULL" | "LINK_HOST_LIMIT_REACHED" | "LINK_ERROR" | "LINK_TEMPORARY_UNAVAILABLE" | "LINK_NOT_SUPPORTED" | "REDIRECTOR_NOT_SUPPORTED" | "REDIRECTOR_ERROR" | "STREAM_INVALID_GEN_ID" | "STREAM_INVALID_STREAM_ID" | "DELAYED_INVALID_ID" | "FREE_TRIAL_LIMIT_REACHED" | "MUST_BE_PREMIUM" | "MAGNET_INVALID_ID" | "MAGNET_INVALID_URI" | "MAGNET_INVALID_FILE" | "MAGNET_FILE_UPLOAD_FAILED" | "MAGNET_NO_URI" | "MAGNET_PROCESSING" | "MAGNET_TOO_MANY_ACTIVE" | "MAGNET_TOO_MANY" | "MAGNET_MUST_BE_PREMIUM" | "MAGNET_TOO_LARGE" | "MAGNET_UPLOAD_FAILED" | "MAGNET_INTERNAL_ERROR" | "MAGNET_CANT_BOOTSTRAP" | "MAGNET_MAGNET_TOO_BIG" | "MAGNET_TOOK_TOO_LONG" | "MAGNET_LINKS_REMOVED" | "MAGNET_PROCESSING_FAILED" | "PIN_ALREADY_AUTHED" | "PIN_EXPIRED" | "PIN_INVALID" | "USER_LINK_MISSING" | "USER_LINK_INVALID" | "MISSING_NOTIF_ENDPOINT" | "VOUCHER_DURATION_INVALID" | "VOUCHER_NB_INVALID" | "NO_MORE_VOUCHER" | "INSUFFICIENT_BALANCE" | "DOWNLOAD_FAILED" | "ACCOUNT_INVALID" | "NO_JSON_PARAM" | "JSON_INVALID" | "FREEDAYS_INVALID_COUNTRY" | "FREEDAYS_INVALID_PHONE" | "FREEDAYS_INVALID_PROVIDER" | "FREEDAYS_USED_PHONE" | "FREEDAYS_ALREADY_REQUESTED" | "FREEDAYS_INVALID_STATUS" | "FREEDAYS_TOO_MUCH_RETRIES" | "FREEDAYS_INVALID_CODE" | "FREEDAYS_DENIED" | "FREEDAYS_ERROR_SENDING";
|
|
939
|
+
export type ApiErrorResponse = {
|
|
940
|
+
status: "error";
|
|
941
|
+
error: ErrorDetail;
|
|
955
942
|
};
|
|
956
|
-
type status =
|
|
957
|
-
type ApiSuccessResponseBase = {
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
943
|
+
type status$1 = "error";
|
|
944
|
+
export type ApiSuccessResponseBase = {
|
|
945
|
+
status: "success";
|
|
946
|
+
demo?: boolean;
|
|
947
|
+
deprecated?: boolean;
|
|
961
948
|
};
|
|
962
|
-
type status2 =
|
|
963
|
-
type ClearNotificationResponseData = {
|
|
964
|
-
|
|
949
|
+
export type status2 = "success";
|
|
950
|
+
export type ClearNotificationResponseData = {
|
|
951
|
+
message?: string;
|
|
965
952
|
};
|
|
966
|
-
type DelayedStatusResponseData = {
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
953
|
+
export type DelayedStatusResponseData = {
|
|
954
|
+
/**
|
|
955
|
+
* 1 = processing, 2 = ready, 3 = error
|
|
956
|
+
*/
|
|
957
|
+
status?: number;
|
|
958
|
+
time_left?: number;
|
|
959
|
+
link?: string;
|
|
973
960
|
};
|
|
974
|
-
type ErrorDetail = {
|
|
975
|
-
|
|
976
|
-
|
|
961
|
+
export type ErrorDetail = {
|
|
962
|
+
code: AllDebridErrorCode;
|
|
963
|
+
message: string;
|
|
977
964
|
};
|
|
978
|
-
type HostDetail = {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
965
|
+
export type HostDetail = {
|
|
966
|
+
name?: string;
|
|
967
|
+
type?: "premium" | "free";
|
|
968
|
+
domains?: Array<(string)>;
|
|
969
|
+
regexp?: string;
|
|
970
|
+
regexps?: Array<(string)>;
|
|
971
|
+
status?: boolean;
|
|
972
|
+
quota?: number;
|
|
973
|
+
quotaMax?: number;
|
|
974
|
+
quotaType?: "traffic" | "nb_download";
|
|
975
|
+
limitSimuDl?: number;
|
|
989
976
|
};
|
|
990
|
-
type type =
|
|
991
|
-
type quotaType =
|
|
992
|
-
type HostsDomainsResponseData = {
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
977
|
+
export type type = "premium" | "free";
|
|
978
|
+
export type quotaType = "traffic" | "nb_download";
|
|
979
|
+
export type HostsDomainsResponseData = {
|
|
980
|
+
hosts?: Array<(string)>;
|
|
981
|
+
streams?: Array<(string)>;
|
|
982
|
+
redirectors?: Array<(string)>;
|
|
996
983
|
};
|
|
997
|
-
type HostsPriorityResponseData = {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
984
|
+
export type HostsPriorityResponseData = {
|
|
985
|
+
hosts?: {
|
|
986
|
+
[key: string]: (number);
|
|
987
|
+
};
|
|
1001
988
|
};
|
|
1002
|
-
type HostsResponseData = {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
989
|
+
export type HostsResponseData = {
|
|
990
|
+
hosts?: {
|
|
991
|
+
[key: string]: HostDetail;
|
|
992
|
+
};
|
|
993
|
+
streams?: {
|
|
994
|
+
[key: string]: HostDetail;
|
|
995
|
+
};
|
|
996
|
+
redirectors?: {
|
|
997
|
+
[key: string]: HostDetail;
|
|
998
|
+
};
|
|
1012
999
|
};
|
|
1013
|
-
type LinkInfoItem = {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1000
|
+
export type LinkInfoItem = {
|
|
1001
|
+
link?: string;
|
|
1002
|
+
filename?: string;
|
|
1003
|
+
size?: number;
|
|
1004
|
+
host?: string;
|
|
1005
|
+
hostDomain?: string;
|
|
1006
|
+
error?: ErrorDetail;
|
|
1020
1007
|
};
|
|
1021
|
-
type LinkInfosResponseData = {
|
|
1022
|
-
|
|
1008
|
+
export type LinkInfosResponseData = {
|
|
1009
|
+
infos?: Array<LinkInfoItem>;
|
|
1023
1010
|
};
|
|
1024
|
-
type MagnetFile = {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1011
|
+
export type MagnetFile = {
|
|
1012
|
+
n?: string;
|
|
1013
|
+
s?: number;
|
|
1014
|
+
l?: string;
|
|
1015
|
+
e?: Array<MagnetFile>;
|
|
1029
1016
|
};
|
|
1030
|
-
type MagnetFilesItem = {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1017
|
+
export type MagnetFilesItem = {
|
|
1018
|
+
id?: number;
|
|
1019
|
+
files?: Array<MagnetFile>;
|
|
1020
|
+
error?: ErrorDetail;
|
|
1034
1021
|
};
|
|
1035
|
-
type MagnetFilesResponseData = {
|
|
1036
|
-
|
|
1022
|
+
export type MagnetFilesResponseData = {
|
|
1023
|
+
magnets?: Array<MagnetFilesItem>;
|
|
1037
1024
|
};
|
|
1038
|
-
type MagnetStatusItem = {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1025
|
+
export type MagnetStatusItem = {
|
|
1026
|
+
id?: number;
|
|
1027
|
+
filename?: string;
|
|
1028
|
+
size?: number;
|
|
1029
|
+
status?: string;
|
|
1030
|
+
statusCode?: number;
|
|
1031
|
+
downloaded?: number;
|
|
1032
|
+
uploaded?: number;
|
|
1033
|
+
downloadSpeed?: number;
|
|
1034
|
+
uploadSpeed?: number;
|
|
1035
|
+
seeders?: number;
|
|
1036
|
+
files?: Array<MagnetFile>;
|
|
1050
1037
|
};
|
|
1051
|
-
type MagnetStatusResponseData = {
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1038
|
+
export type MagnetStatusResponseData = {
|
|
1039
|
+
magnets?: Array<MagnetStatusItem>;
|
|
1040
|
+
counter?: number;
|
|
1041
|
+
fullsync?: boolean;
|
|
1055
1042
|
};
|
|
1056
|
-
type MagnetUploadItem = {
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1043
|
+
export type MagnetUploadItem = {
|
|
1044
|
+
magnet?: string;
|
|
1045
|
+
hash?: string;
|
|
1046
|
+
name?: string;
|
|
1047
|
+
size?: number;
|
|
1048
|
+
ready?: boolean;
|
|
1049
|
+
id?: number;
|
|
1050
|
+
error?: ErrorDetail;
|
|
1064
1051
|
};
|
|
1065
|
-
type MagnetUploadResponseData = {
|
|
1066
|
-
|
|
1052
|
+
export type MagnetUploadResponseData = {
|
|
1053
|
+
magnets?: Array<MagnetUploadItem>;
|
|
1067
1054
|
};
|
|
1068
|
-
type MessageResponseData = {
|
|
1069
|
-
|
|
1055
|
+
export type MessageResponseData = {
|
|
1056
|
+
message?: string;
|
|
1070
1057
|
};
|
|
1071
|
-
type PinCheckResponseData = {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1058
|
+
export type PinCheckResponseData = {
|
|
1059
|
+
activated: boolean;
|
|
1060
|
+
expires_in: number;
|
|
1061
|
+
apikey?: string;
|
|
1075
1062
|
};
|
|
1076
|
-
type PinGetResponseData = {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1063
|
+
export type PinGetResponseData = {
|
|
1064
|
+
pin: string;
|
|
1065
|
+
check: string;
|
|
1066
|
+
expires_in: number;
|
|
1067
|
+
user_url?: string;
|
|
1068
|
+
base_url?: string;
|
|
1082
1069
|
};
|
|
1083
|
-
type PingResponseData = {
|
|
1084
|
-
|
|
1070
|
+
export type PingResponseData = {
|
|
1071
|
+
ping?: string;
|
|
1085
1072
|
};
|
|
1086
|
-
type RedirectorResponseData = {
|
|
1087
|
-
|
|
1073
|
+
export type RedirectorResponseData = {
|
|
1074
|
+
links?: Array<(string)>;
|
|
1088
1075
|
};
|
|
1089
|
-
type ResendVerifResponseData = {
|
|
1090
|
-
|
|
1076
|
+
export type ResendVerifResponseData = {
|
|
1077
|
+
sent?: boolean;
|
|
1091
1078
|
};
|
|
1092
|
-
type SavedLink = {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1079
|
+
export type SavedLink = {
|
|
1080
|
+
link?: string;
|
|
1081
|
+
filename?: string;
|
|
1082
|
+
size?: number;
|
|
1083
|
+
date?: number;
|
|
1084
|
+
host?: string;
|
|
1098
1085
|
};
|
|
1099
|
-
type SavedLinksResponseData = {
|
|
1100
|
-
|
|
1086
|
+
export type SavedLinksResponseData = {
|
|
1087
|
+
links?: Array<SavedLink>;
|
|
1101
1088
|
};
|
|
1102
|
-
type StreamingResponseData = {
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1089
|
+
export type StreamingResponseData = {
|
|
1090
|
+
link?: string;
|
|
1091
|
+
filename?: string;
|
|
1092
|
+
filesize?: number;
|
|
1093
|
+
delayed?: number;
|
|
1107
1094
|
};
|
|
1108
|
-
type TorrentFileUploadItem = {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1095
|
+
export type TorrentFileUploadItem = {
|
|
1096
|
+
/**
|
|
1097
|
+
* Nom du fichier uploadé
|
|
1098
|
+
*/
|
|
1099
|
+
file?: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* Nom du torrent détecté
|
|
1102
|
+
*/
|
|
1103
|
+
name?: string;
|
|
1104
|
+
size?: number;
|
|
1105
|
+
hash?: string;
|
|
1106
|
+
ready?: boolean;
|
|
1107
|
+
id?: number;
|
|
1108
|
+
error?: ErrorDetail;
|
|
1122
1109
|
};
|
|
1123
|
-
type TorrentFileUploadResponseData = {
|
|
1124
|
-
|
|
1110
|
+
export type TorrentFileUploadResponseData = {
|
|
1111
|
+
files?: Array<TorrentFileUploadItem>;
|
|
1125
1112
|
};
|
|
1126
|
-
type UnlockLinkResponseData = {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1113
|
+
export type UnlockLinkResponseData = {
|
|
1114
|
+
link?: string;
|
|
1115
|
+
filename?: string;
|
|
1116
|
+
filesize?: number;
|
|
1117
|
+
host?: string;
|
|
1118
|
+
hostDomain?: string;
|
|
1119
|
+
paws?: boolean;
|
|
1120
|
+
streams?: Array<{
|
|
1121
|
+
[key: string]: unknown;
|
|
1122
|
+
}>;
|
|
1123
|
+
id?: string;
|
|
1124
|
+
delayed?: number;
|
|
1138
1125
|
};
|
|
1139
|
-
type UserHostsResponseData = {
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1126
|
+
export type UserHostsResponseData = {
|
|
1127
|
+
hosts?: {
|
|
1128
|
+
[key: string]: HostDetail;
|
|
1129
|
+
};
|
|
1143
1130
|
};
|
|
1144
|
-
type UserInfo = {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1131
|
+
export type UserInfo = {
|
|
1132
|
+
username?: string;
|
|
1133
|
+
email?: string;
|
|
1134
|
+
isPremium?: boolean;
|
|
1135
|
+
isSubscribed?: boolean;
|
|
1136
|
+
isTrial?: boolean;
|
|
1137
|
+
premiumUntil?: number;
|
|
1138
|
+
lang?: string;
|
|
1139
|
+
preferedDomain?: string;
|
|
1140
|
+
fidelityPoints?: number;
|
|
1141
|
+
limitedHostersQuotas?: {
|
|
1142
|
+
[key: string]: (number);
|
|
1143
|
+
};
|
|
1144
|
+
remainingTrialQuota?: number;
|
|
1145
|
+
notifications?: Array<(string)>;
|
|
1159
1146
|
};
|
|
1160
|
-
type UserResponseData = {
|
|
1161
|
-
|
|
1147
|
+
export type UserResponseData = {
|
|
1148
|
+
user?: UserInfo;
|
|
1162
1149
|
};
|
|
1163
|
-
type VerifStatusResponseData = {
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1150
|
+
export type VerifStatusResponseData = {
|
|
1151
|
+
verif?: "waiting" | "allowed" | "denied";
|
|
1152
|
+
resendable?: boolean;
|
|
1153
|
+
apikey?: string;
|
|
1167
1154
|
};
|
|
1168
|
-
type verif =
|
|
1169
|
-
type VoucherBalanceResponseData = {
|
|
1170
|
-
|
|
1155
|
+
export type verif = "waiting" | "allowed" | "denied";
|
|
1156
|
+
export type VoucherBalanceResponseData = {
|
|
1157
|
+
balance?: number;
|
|
1171
1158
|
};
|
|
1172
|
-
type VoucherGenerateResponseData = {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1159
|
+
export type VoucherGenerateResponseData = {
|
|
1160
|
+
/**
|
|
1161
|
+
* Liste des codes vouchers générés
|
|
1162
|
+
*/
|
|
1163
|
+
codes?: Array<(string)>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Prix unitaire du voucher
|
|
1166
|
+
*/
|
|
1167
|
+
pricePerVoucher?: number;
|
|
1168
|
+
/**
|
|
1169
|
+
* Montant total débité
|
|
1170
|
+
*/
|
|
1171
|
+
total?: number;
|
|
1172
|
+
/**
|
|
1173
|
+
* Nouveau solde après génération
|
|
1174
|
+
*/
|
|
1175
|
+
balance?: number;
|
|
1189
1176
|
};
|
|
1190
|
-
type VoucherGetResponseData = {
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1177
|
+
export type VoucherGetResponseData = {
|
|
1178
|
+
/**
|
|
1179
|
+
* Liste des codes vouchers disponibles
|
|
1180
|
+
*/
|
|
1181
|
+
codes?: Array<(string)>;
|
|
1182
|
+
/**
|
|
1183
|
+
* True si la liste est partielle (pas assez de vouchers pré-générés disponibles)
|
|
1184
|
+
*/
|
|
1185
|
+
partialList?: boolean;
|
|
1199
1186
|
};
|
|
1200
|
-
type PingResponse = ((ApiSuccessResponseBase & {
|
|
1201
|
-
|
|
1187
|
+
export type PingResponse = ((ApiSuccessResponseBase & {
|
|
1188
|
+
data?: PingResponseData;
|
|
1202
1189
|
}));
|
|
1203
|
-
type PingError = unknown;
|
|
1204
|
-
type GetPinResponse = ((ApiSuccessResponseBase & {
|
|
1205
|
-
|
|
1190
|
+
export type PingError = unknown;
|
|
1191
|
+
export type GetPinResponse = ((ApiSuccessResponseBase & {
|
|
1192
|
+
data?: PinGetResponseData;
|
|
1206
1193
|
}));
|
|
1207
|
-
type GetPinError = unknown;
|
|
1208
|
-
type CheckPinData = {
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1194
|
+
export type GetPinError = unknown;
|
|
1195
|
+
export type CheckPinData = {
|
|
1196
|
+
query: {
|
|
1197
|
+
check: string;
|
|
1198
|
+
pin: string;
|
|
1199
|
+
};
|
|
1213
1200
|
};
|
|
1214
|
-
type CheckPinResponse = ((ApiSuccessResponseBase & {
|
|
1215
|
-
|
|
1201
|
+
export type CheckPinResponse = ((ApiSuccessResponseBase & {
|
|
1202
|
+
data?: PinCheckResponseData;
|
|
1216
1203
|
}));
|
|
1217
|
-
type CheckPinError = unknown;
|
|
1218
|
-
type GetHostsData = {
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1204
|
+
export type CheckPinError = unknown;
|
|
1205
|
+
export type GetHostsData = {
|
|
1206
|
+
query?: {
|
|
1207
|
+
hostsOnly?: boolean;
|
|
1208
|
+
};
|
|
1222
1209
|
};
|
|
1223
|
-
type GetHostsResponse = ((ApiSuccessResponseBase & {
|
|
1224
|
-
|
|
1210
|
+
export type GetHostsResponse = ((ApiSuccessResponseBase & {
|
|
1211
|
+
data?: HostsResponseData;
|
|
1225
1212
|
}));
|
|
1226
|
-
type GetHostsError = unknown;
|
|
1227
|
-
type GetHostDomainsResponse = ((ApiSuccessResponseBase & {
|
|
1228
|
-
|
|
1213
|
+
export type GetHostsError = unknown;
|
|
1214
|
+
export type GetHostDomainsResponse = ((ApiSuccessResponseBase & {
|
|
1215
|
+
data?: HostsDomainsResponseData;
|
|
1229
1216
|
}));
|
|
1230
|
-
type GetHostDomainsError = unknown;
|
|
1231
|
-
type GetHostPriorityResponse = ((ApiSuccessResponseBase & {
|
|
1232
|
-
|
|
1217
|
+
export type GetHostDomainsError = unknown;
|
|
1218
|
+
export type GetHostPriorityResponse = ((ApiSuccessResponseBase & {
|
|
1219
|
+
data?: HostsPriorityResponseData;
|
|
1233
1220
|
}));
|
|
1234
|
-
type GetHostPriorityError = unknown;
|
|
1235
|
-
type GetUserResponse = ((ApiSuccessResponseBase & {
|
|
1236
|
-
|
|
1221
|
+
export type GetHostPriorityError = unknown;
|
|
1222
|
+
export type GetUserResponse = ((ApiSuccessResponseBase & {
|
|
1223
|
+
data?: UserResponseData;
|
|
1237
1224
|
}));
|
|
1238
|
-
type GetUserError = unknown;
|
|
1239
|
-
type GetUserHostsResponse = ((ApiSuccessResponseBase & {
|
|
1240
|
-
|
|
1225
|
+
export type GetUserError = unknown;
|
|
1226
|
+
export type GetUserHostsResponse = ((ApiSuccessResponseBase & {
|
|
1227
|
+
data?: UserHostsResponseData;
|
|
1241
1228
|
}));
|
|
1242
|
-
type GetUserHostsError = unknown;
|
|
1243
|
-
type GetVerifStatusData = {
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1229
|
+
export type GetUserHostsError = unknown;
|
|
1230
|
+
export type GetVerifStatusData = {
|
|
1231
|
+
query: {
|
|
1232
|
+
token: string;
|
|
1233
|
+
};
|
|
1247
1234
|
};
|
|
1248
|
-
type GetVerifStatusResponse = ((ApiSuccessResponseBase & {
|
|
1249
|
-
|
|
1235
|
+
export type GetVerifStatusResponse = ((ApiSuccessResponseBase & {
|
|
1236
|
+
data?: VerifStatusResponseData;
|
|
1250
1237
|
}));
|
|
1251
|
-
type GetVerifStatusError = unknown;
|
|
1252
|
-
type ResendVerifData = {
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1238
|
+
export type GetVerifStatusError = unknown;
|
|
1239
|
+
export type ResendVerifData = {
|
|
1240
|
+
query: {
|
|
1241
|
+
token: string;
|
|
1242
|
+
};
|
|
1256
1243
|
};
|
|
1257
|
-
type ResendVerifResponse = ((ApiSuccessResponseBase & {
|
|
1258
|
-
|
|
1244
|
+
export type ResendVerifResponse = ((ApiSuccessResponseBase & {
|
|
1245
|
+
data?: ResendVerifResponseData;
|
|
1259
1246
|
}));
|
|
1260
|
-
type ResendVerifError = unknown;
|
|
1261
|
-
type ClearNotificationData = {
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1247
|
+
export type ResendVerifError = unknown;
|
|
1248
|
+
export type ClearNotificationData = {
|
|
1249
|
+
query: {
|
|
1250
|
+
code: string;
|
|
1251
|
+
};
|
|
1265
1252
|
};
|
|
1266
|
-
type ClearNotificationResponse = ((ApiSuccessResponseBase & {
|
|
1267
|
-
|
|
1253
|
+
export type ClearNotificationResponse = ((ApiSuccessResponseBase & {
|
|
1254
|
+
data?: ClearNotificationResponseData;
|
|
1268
1255
|
}));
|
|
1269
|
-
type ClearNotificationError = unknown;
|
|
1270
|
-
type GetLinkInfosData = {
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1256
|
+
export type ClearNotificationError = unknown;
|
|
1257
|
+
export type GetLinkInfosData = {
|
|
1258
|
+
query: {
|
|
1259
|
+
"link[]": Array<(string)>;
|
|
1260
|
+
password?: string;
|
|
1261
|
+
};
|
|
1275
1262
|
};
|
|
1276
|
-
type GetLinkInfosResponse = ((ApiSuccessResponseBase & {
|
|
1277
|
-
|
|
1263
|
+
export type GetLinkInfosResponse = ((ApiSuccessResponseBase & {
|
|
1264
|
+
data?: LinkInfosResponseData;
|
|
1278
1265
|
}));
|
|
1279
|
-
type GetLinkInfosError = unknown;
|
|
1280
|
-
type GetRedirectorLinksData = {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1266
|
+
export type GetLinkInfosError = unknown;
|
|
1267
|
+
export type GetRedirectorLinksData = {
|
|
1268
|
+
query: {
|
|
1269
|
+
link: string;
|
|
1270
|
+
};
|
|
1284
1271
|
};
|
|
1285
|
-
type GetRedirectorLinksResponse = ((ApiSuccessResponseBase & {
|
|
1286
|
-
|
|
1272
|
+
export type GetRedirectorLinksResponse = ((ApiSuccessResponseBase & {
|
|
1273
|
+
data?: RedirectorResponseData;
|
|
1287
1274
|
}));
|
|
1288
|
-
type GetRedirectorLinksError = unknown;
|
|
1289
|
-
type UnlockLinkData = {
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1275
|
+
export type GetRedirectorLinksError = unknown;
|
|
1276
|
+
export type UnlockLinkData = {
|
|
1277
|
+
query: {
|
|
1278
|
+
link: string;
|
|
1279
|
+
password?: string;
|
|
1280
|
+
};
|
|
1294
1281
|
};
|
|
1295
|
-
type UnlockLinkResponse = ((ApiSuccessResponseBase & {
|
|
1296
|
-
|
|
1282
|
+
export type UnlockLinkResponse = ((ApiSuccessResponseBase & {
|
|
1283
|
+
data?: UnlockLinkResponseData;
|
|
1297
1284
|
}));
|
|
1298
|
-
type UnlockLinkError = unknown;
|
|
1299
|
-
type GetStreamingLinkData = {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1285
|
+
export type UnlockLinkError = unknown;
|
|
1286
|
+
export type GetStreamingLinkData = {
|
|
1287
|
+
query: {
|
|
1288
|
+
id: string;
|
|
1289
|
+
stream: string;
|
|
1290
|
+
};
|
|
1304
1291
|
};
|
|
1305
|
-
type GetStreamingLinkResponse = ((ApiSuccessResponseBase & {
|
|
1306
|
-
|
|
1292
|
+
export type GetStreamingLinkResponse = ((ApiSuccessResponseBase & {
|
|
1293
|
+
data?: StreamingResponseData;
|
|
1307
1294
|
}));
|
|
1308
|
-
type GetStreamingLinkError = unknown;
|
|
1309
|
-
type GetDelayedStatusData = {
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1295
|
+
export type GetStreamingLinkError = unknown;
|
|
1296
|
+
export type GetDelayedStatusData = {
|
|
1297
|
+
query: {
|
|
1298
|
+
id: number;
|
|
1299
|
+
};
|
|
1313
1300
|
};
|
|
1314
|
-
type GetDelayedStatusResponse = ((ApiSuccessResponseBase & {
|
|
1315
|
-
|
|
1301
|
+
export type GetDelayedStatusResponse = ((ApiSuccessResponseBase & {
|
|
1302
|
+
data?: DelayedStatusResponseData;
|
|
1316
1303
|
}));
|
|
1317
|
-
type GetDelayedStatusError = unknown;
|
|
1318
|
-
type UploadMagnetsData = {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1304
|
+
export type GetDelayedStatusError = unknown;
|
|
1305
|
+
export type UploadMagnetsData = {
|
|
1306
|
+
query: {
|
|
1307
|
+
"magnets[]": Array<(string)>;
|
|
1308
|
+
};
|
|
1322
1309
|
};
|
|
1323
|
-
type UploadMagnetsResponse = ((ApiSuccessResponseBase & {
|
|
1324
|
-
|
|
1310
|
+
export type UploadMagnetsResponse = ((ApiSuccessResponseBase & {
|
|
1311
|
+
data?: MagnetUploadResponseData;
|
|
1325
1312
|
}));
|
|
1326
|
-
type UploadMagnetsError = unknown;
|
|
1327
|
-
type UploadTorrentFileData = {
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1313
|
+
export type UploadMagnetsError = unknown;
|
|
1314
|
+
export type UploadTorrentFileData = {
|
|
1315
|
+
body?: {
|
|
1316
|
+
files?: Array<((Blob | File))>;
|
|
1317
|
+
};
|
|
1331
1318
|
};
|
|
1332
|
-
type UploadTorrentFileResponse = ((ApiSuccessResponseBase & {
|
|
1333
|
-
|
|
1319
|
+
export type UploadTorrentFileResponse = ((ApiSuccessResponseBase & {
|
|
1320
|
+
data?: TorrentFileUploadResponseData;
|
|
1334
1321
|
}));
|
|
1335
|
-
type UploadTorrentFileError = unknown;
|
|
1336
|
-
type GetMagnetStatusData = {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1322
|
+
export type UploadTorrentFileError = unknown;
|
|
1323
|
+
export type GetMagnetStatusData = {
|
|
1324
|
+
query?: {
|
|
1325
|
+
/**
|
|
1326
|
+
* **Live Mode**: Counter starting at 0 for the first request, then use the 'counter' value returned in the response for subsequent requests. Required for Live Mode, must be used with 'session' parameter.
|
|
1327
|
+
*/
|
|
1328
|
+
counter?: number;
|
|
1329
|
+
/**
|
|
1330
|
+
* **Standard Mode**: Get status of a specific magnet by its ID. Incompatible with Live Mode parameters.
|
|
1331
|
+
*/
|
|
1332
|
+
id?: number;
|
|
1333
|
+
/**
|
|
1334
|
+
* **Live Mode**: Random session identifier (e.g., random number between 1-1000000) to track delta updates across requests. Required for Live Mode, must be used with 'counter' parameter.
|
|
1335
|
+
*/
|
|
1336
|
+
session?: number;
|
|
1337
|
+
/**
|
|
1338
|
+
* **Standard Mode**: Filter magnets by status. Possible values: 'active', 'ready', 'expired', 'error'. Incompatible with Live Mode parameters.
|
|
1339
|
+
*/
|
|
1340
|
+
status?: "active" | "ready" | "expired" | "error";
|
|
1341
|
+
};
|
|
1355
1342
|
};
|
|
1356
|
-
type GetMagnetStatusResponse = ((ApiSuccessResponseBase & {
|
|
1357
|
-
|
|
1343
|
+
export type GetMagnetStatusResponse = ((ApiSuccessResponseBase & {
|
|
1344
|
+
data?: MagnetStatusResponseData;
|
|
1358
1345
|
}));
|
|
1359
|
-
type GetMagnetStatusError = unknown;
|
|
1360
|
-
type GetMagnetFilesData = {
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1346
|
+
export type GetMagnetStatusError = unknown;
|
|
1347
|
+
export type GetMagnetFilesData = {
|
|
1348
|
+
query: {
|
|
1349
|
+
"id[]": Array<(number)>;
|
|
1350
|
+
};
|
|
1364
1351
|
};
|
|
1365
|
-
type GetMagnetFilesResponse = ((ApiSuccessResponseBase & {
|
|
1366
|
-
|
|
1352
|
+
export type GetMagnetFilesResponse = ((ApiSuccessResponseBase & {
|
|
1353
|
+
data?: MagnetFilesResponseData;
|
|
1367
1354
|
}));
|
|
1368
|
-
type GetMagnetFilesError = unknown;
|
|
1369
|
-
type DeleteMagnetData = {
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1355
|
+
export type GetMagnetFilesError = unknown;
|
|
1356
|
+
export type DeleteMagnetData = {
|
|
1357
|
+
query: {
|
|
1358
|
+
id: number;
|
|
1359
|
+
};
|
|
1373
1360
|
};
|
|
1374
|
-
type DeleteMagnetResponse = ((ApiSuccessResponseBase & {
|
|
1375
|
-
|
|
1361
|
+
export type DeleteMagnetResponse = ((ApiSuccessResponseBase & {
|
|
1362
|
+
data?: MessageResponseData;
|
|
1376
1363
|
}));
|
|
1377
|
-
type DeleteMagnetError = unknown;
|
|
1378
|
-
type RestartMagnetData = {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1364
|
+
export type DeleteMagnetError = unknown;
|
|
1365
|
+
export type RestartMagnetData = {
|
|
1366
|
+
query?: {
|
|
1367
|
+
"ids[]"?: Array<(number)>;
|
|
1368
|
+
};
|
|
1382
1369
|
};
|
|
1383
|
-
type RestartMagnetResponse = ((ApiSuccessResponseBase & {
|
|
1384
|
-
|
|
1370
|
+
export type RestartMagnetResponse = ((ApiSuccessResponseBase & {
|
|
1371
|
+
data?: MessageResponseData;
|
|
1385
1372
|
}));
|
|
1386
|
-
type RestartMagnetError = unknown;
|
|
1387
|
-
type GetSavedLinksResponse = ((ApiSuccessResponseBase & {
|
|
1388
|
-
|
|
1373
|
+
export type RestartMagnetError = unknown;
|
|
1374
|
+
export type GetSavedLinksResponse = ((ApiSuccessResponseBase & {
|
|
1375
|
+
data?: SavedLinksResponseData;
|
|
1389
1376
|
}));
|
|
1390
|
-
type GetSavedLinksError = unknown;
|
|
1391
|
-
type SaveLinksData = {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1377
|
+
export type GetSavedLinksError = unknown;
|
|
1378
|
+
export type SaveLinksData = {
|
|
1379
|
+
query: {
|
|
1380
|
+
"links[]": Array<(string)>;
|
|
1381
|
+
};
|
|
1395
1382
|
};
|
|
1396
|
-
type SaveLinksResponse = ((ApiSuccessResponseBase & {
|
|
1397
|
-
|
|
1383
|
+
export type SaveLinksResponse = ((ApiSuccessResponseBase & {
|
|
1384
|
+
data?: MessageResponseData;
|
|
1398
1385
|
}));
|
|
1399
|
-
type SaveLinksError = unknown;
|
|
1400
|
-
type DeleteSavedLinksData = {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1386
|
+
export type SaveLinksError = unknown;
|
|
1387
|
+
export type DeleteSavedLinksData = {
|
|
1388
|
+
query?: {
|
|
1389
|
+
"links[]"?: Array<(string)>;
|
|
1390
|
+
};
|
|
1404
1391
|
};
|
|
1405
|
-
type DeleteSavedLinksResponse = ((ApiSuccessResponseBase & {
|
|
1406
|
-
|
|
1392
|
+
export type DeleteSavedLinksResponse = ((ApiSuccessResponseBase & {
|
|
1393
|
+
data?: MessageResponseData;
|
|
1407
1394
|
}));
|
|
1408
|
-
type DeleteSavedLinksError = unknown;
|
|
1409
|
-
type GetHistoryResponse = ((ApiSuccessResponseBase & {
|
|
1410
|
-
|
|
1395
|
+
export type DeleteSavedLinksError = unknown;
|
|
1396
|
+
export type GetHistoryResponse = ((ApiSuccessResponseBase & {
|
|
1397
|
+
data?: SavedLinksResponseData;
|
|
1411
1398
|
}));
|
|
1412
|
-
type GetHistoryError = unknown;
|
|
1413
|
-
type DeleteHistoryResponse = ((ApiSuccessResponseBase & {
|
|
1414
|
-
|
|
1399
|
+
export type GetHistoryError = unknown;
|
|
1400
|
+
export type DeleteHistoryResponse = ((ApiSuccessResponseBase & {
|
|
1401
|
+
data?: MessageResponseData;
|
|
1415
1402
|
}));
|
|
1416
|
-
type DeleteHistoryError = unknown;
|
|
1417
|
-
type GetVoucherBalanceResponse = ((ApiSuccessResponseBase & {
|
|
1418
|
-
|
|
1403
|
+
export type DeleteHistoryError = unknown;
|
|
1404
|
+
export type GetVoucherBalanceResponse = ((ApiSuccessResponseBase & {
|
|
1405
|
+
data?: VoucherBalanceResponseData;
|
|
1419
1406
|
}));
|
|
1420
|
-
type GetVoucherBalanceError = unknown;
|
|
1421
|
-
type GenerateVouchersData = {
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1407
|
+
export type GetVoucherBalanceError = unknown;
|
|
1408
|
+
export type GenerateVouchersData = {
|
|
1409
|
+
query: {
|
|
1410
|
+
/**
|
|
1411
|
+
* Durée du voucher en jours
|
|
1412
|
+
*/
|
|
1413
|
+
duration: 15 | 30 | 90 | 180 | 365;
|
|
1414
|
+
/**
|
|
1415
|
+
* Nombre de vouchers à générer (1-10)
|
|
1416
|
+
*/
|
|
1417
|
+
nb: number;
|
|
1418
|
+
};
|
|
1432
1419
|
};
|
|
1433
|
-
type GenerateVouchersResponse = ((ApiSuccessResponseBase & {
|
|
1434
|
-
|
|
1420
|
+
export type GenerateVouchersResponse = ((ApiSuccessResponseBase & {
|
|
1421
|
+
data?: VoucherGenerateResponseData;
|
|
1435
1422
|
}));
|
|
1436
|
-
type GenerateVouchersError = unknown;
|
|
1437
|
-
type GetAvailableVouchersData = {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1423
|
+
export type GenerateVouchersError = unknown;
|
|
1424
|
+
export type GetAvailableVouchersData = {
|
|
1425
|
+
query: {
|
|
1426
|
+
/**
|
|
1427
|
+
* Durée du voucher en jours
|
|
1428
|
+
*/
|
|
1429
|
+
duration: 15 | 30 | 90 | 180 | 365;
|
|
1430
|
+
/**
|
|
1431
|
+
* Nombre de vouchers demandés (1-10)
|
|
1432
|
+
*/
|
|
1433
|
+
nb: number;
|
|
1434
|
+
};
|
|
1448
1435
|
};
|
|
1449
|
-
type GetAvailableVouchersResponse = ((ApiSuccessResponseBase & {
|
|
1450
|
-
|
|
1436
|
+
export type GetAvailableVouchersResponse = ((ApiSuccessResponseBase & {
|
|
1437
|
+
data?: VoucherGetResponseData;
|
|
1451
1438
|
}));
|
|
1452
|
-
type GetAvailableVouchersError = unknown;
|
|
1439
|
+
export type GetAvailableVouchersError = unknown;
|
|
1440
|
+
|
|
1441
|
+
export {
|
|
1442
|
+
status$1 as status,
|
|
1443
|
+
};
|
|
1453
1444
|
|
|
1454
|
-
export {
|
|
1445
|
+
export {};
|