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