@adbjs/sdk 0.1.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -65,19 +65,27 @@ declare abstract class BaseResource {
65
65
  constructor(client: AllDebridClient);
66
66
  /**
67
67
  * Make a GET request
68
- * @param T - The generated response type (e.g., GetLinkUnlockResponse)
68
+ * @template T - The generated response type (e.g., GetLinkUnlockResponse)
69
+ * @param path - API endpoint path
70
+ * @param params - Optional query parameters
69
71
  * @returns The extracted data from the response (without the { status, data } wrapper)
70
72
  */
71
73
  protected get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
72
74
  /**
73
75
  * Make a POST request
74
- * @param T - The generated response type
76
+ * @template T - The generated response type
77
+ * @param path - API endpoint path
78
+ * @param body - Request body
79
+ * @param params - Optional query parameters
75
80
  * @returns The extracted data from the response (without the { status, data } wrapper)
76
81
  */
77
82
  protected post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
78
83
  /**
79
84
  * Make a POST request with FormData (multipart/form-data)
80
- * @param T - The generated response type
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
81
89
  * @returns The extracted data from the response (without the { status, data } wrapper)
82
90
  */
83
91
  protected postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
@@ -100,38 +108,7 @@ declare class HostResource extends BaseResource {
100
108
  * console.log(hosts.redirectors) // Link redirectors
101
109
  * ```
102
110
  */
103
- list(hostOnly?: boolean): Promise<{
104
- hosts?: {
105
- [key: string]: {
106
- name?: string;
107
- type?: string;
108
- domains?: Array<(string)>;
109
- regexp?: string;
110
- regexps?: Array<(string)>;
111
- status?: boolean;
112
- };
113
- };
114
- streams?: {
115
- [key: string]: {
116
- name?: string;
117
- type?: string;
118
- domains?: Array<(string)>;
119
- regexp?: string;
120
- regexps?: Array<(string)>;
121
- status?: boolean;
122
- };
123
- };
124
- redirectors?: {
125
- [key: string]: {
126
- name?: string;
127
- type?: string;
128
- domains?: Array<(string)>;
129
- regexp?: string;
130
- regexps?: Array<(string)>;
131
- status?: boolean;
132
- };
133
- };
134
- } | undefined>;
111
+ list(hostOnly?: boolean): Promise<HostsResponseData | undefined>;
135
112
  /**
136
113
  * Get array of all supported domain names
137
114
  *
@@ -141,11 +118,7 @@ declare class HostResource extends BaseResource {
141
118
  * console.log(domains) // ['rapidgator.net', 'uploaded.net', ...]
142
119
  * ```
143
120
  */
144
- domains(): Promise<{
145
- hosts?: Array<(string)>;
146
- streams?: Array<(string)>;
147
- redirectors?: Array<(string)>;
148
- } | undefined>;
121
+ domains(): Promise<HostsDomainsResponseData | undefined>;
149
122
  /**
150
123
  * Get hosts ordered by restriction level (priority list)
151
124
  *
@@ -155,11 +128,7 @@ declare class HostResource extends BaseResource {
155
128
  * console.log(priority.hosts) // Ordered list with restriction levels
156
129
  * ```
157
130
  */
158
- priority(): Promise<{
159
- hosts?: {
160
- [key: string]: (number);
161
- };
162
- } | undefined>;
131
+ priority(): Promise<HostsPriorityResponseData | undefined>;
163
132
  }
164
133
 
165
134
  /**
@@ -189,20 +158,21 @@ declare class LinkResource extends BaseResource {
189
158
  * Get information about one or more links
190
159
  *
191
160
  * @param links - Single link or array of links to get info for
161
+ * @param password - Optional password for password-protected links
192
162
  *
193
163
  * @example
194
164
  * ```ts
195
- * const info = await client.link.infos('https://example.com/file.zip')
196
- * console.log(info)
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
+ * )
197
173
  * ```
198
174
  */
199
- infos(links: string | string[]): Promise<{
200
- link?: string;
201
- filename?: string;
202
- size?: number;
203
- host?: string;
204
- hostDomain?: string;
205
- }[] | undefined>;
175
+ infos(links: string | string[], password?: string): Promise<LinkInfosResponseData | undefined>;
206
176
  /**
207
177
  * Extract links from redirectors/link protectors
208
178
  *
@@ -210,14 +180,16 @@ declare class LinkResource extends BaseResource {
210
180
  *
211
181
  * @example
212
182
  * ```ts
213
- * const links = await client.link.redirector('https://linkprotector.com/abc123')
183
+ * const data = await client.link.redirector('https://linkprotector.com/abc123')
184
+ * console.log(data.links)
214
185
  * ```
215
186
  */
216
- redirector(link: string): Promise<string[] | undefined>;
187
+ redirector(link: string): Promise<RedirectorResponseData | undefined>;
217
188
  /**
218
189
  * Unlock a download link
219
190
  *
220
191
  * @param link - The link to unlock
192
+ * @param password - Optional password for password-protected links
221
193
  *
222
194
  * @example
223
195
  * ```ts
@@ -228,28 +200,15 @@ declare class LinkResource extends BaseResource {
228
200
  * // Handle delayed generation
229
201
  * const delayedResult = await client.link.delayed(result.delayed)
230
202
  * }
203
+ *
204
+ * // With password
205
+ * const protectedResult = await client.link.unlock(
206
+ * 'https://example.com/protected.zip',
207
+ * 'mypassword'
208
+ * )
231
209
  * ```
232
210
  */
233
- unlock(link: string): Promise<{
234
- filename?: string;
235
- filesize?: number;
236
- host?: string;
237
- hostDomain?: string;
238
- id?: string;
239
- link?: string;
240
- paws?: boolean;
241
- streams?: Array<{
242
- id?: string;
243
- ext?: string;
244
- quality?: string;
245
- filesize?: number;
246
- proto?: string;
247
- name?: string;
248
- link?: string;
249
- tb?: number;
250
- abr?: number;
251
- }>;
252
- } | undefined>;
211
+ unlock(link: string, password?: string): Promise<UnlockLinkResponseData | undefined>;
253
212
  /**
254
213
  * Unlock a link and automatically poll if delayed
255
214
  * Note: The API response format doesn't include a delayed field in the current OpenAPI spec.
@@ -264,26 +223,7 @@ declare class LinkResource extends BaseResource {
264
223
  * console.log('Direct link:', result.link)
265
224
  * ```
266
225
  */
267
- unlockWithPolling(link: string, _options?: PollOptions): Promise<{
268
- filename?: string;
269
- filesize?: number;
270
- host?: string;
271
- hostDomain?: string;
272
- id?: string;
273
- link?: string;
274
- paws?: boolean;
275
- streams?: Array<{
276
- id?: string;
277
- ext?: string;
278
- quality?: string;
279
- filesize?: number;
280
- proto?: string;
281
- name?: string;
282
- link?: string;
283
- tb?: number;
284
- abr?: number;
285
- }>;
286
- } | undefined>;
226
+ unlockWithPolling(link: string, _options?: PollOptions): Promise<UnlockLinkResponseData | undefined>;
287
227
  /**
288
228
  * Get streaming options for a generated link
289
229
  *
@@ -294,26 +234,7 @@ declare class LinkResource extends BaseResource {
294
234
  * const streams = await client.link.streaming('abc123')
295
235
  * ```
296
236
  */
297
- streaming(id: string): Promise<{
298
- filename?: string;
299
- filesize?: number;
300
- host?: string;
301
- hostDomain?: string;
302
- id?: string;
303
- link?: string;
304
- paws?: boolean;
305
- streams?: Array<{
306
- id?: string;
307
- ext?: string;
308
- quality?: string;
309
- filesize?: number;
310
- proto?: string;
311
- name?: string;
312
- link?: string;
313
- tb?: number;
314
- abr?: number;
315
- }>;
316
- } | undefined>;
237
+ streaming(id: string, stream: string): Promise<StreamingResponseData | undefined>;
317
238
  /**
318
239
  * Get the status/result of a delayed link generation
319
240
  *
@@ -324,13 +245,24 @@ declare class LinkResource extends BaseResource {
324
245
  * const result = await client.link.delayed('delayed_id_123')
325
246
  * ```
326
247
  */
327
- delayed(id: string): Promise<{
328
- status?: number;
329
- time_left?: number;
330
- link?: string;
331
- } | undefined>;
248
+ delayed(id: number): Promise<DelayedStatusResponseData | undefined>;
332
249
  }
333
250
 
251
+ /**
252
+ * Options for live mode status polling
253
+ */
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;
265
+ }
334
266
  /**
335
267
  * Options for watching magnet status
336
268
  */
@@ -370,20 +302,7 @@ declare class MagnetResource extends BaseResource {
370
302
  * console.log('Magnet ID:', result.magnets[0].id)
371
303
  * ```
372
304
  */
373
- upload(magnets: string | string[]): Promise<{
374
- magnets?: Array<{
375
- magnet?: string;
376
- hash?: string;
377
- name?: string;
378
- size?: number;
379
- ready?: boolean;
380
- id?: number;
381
- error?: {
382
- code?: string;
383
- message?: string;
384
- };
385
- }>;
386
- } | undefined>;
305
+ upload(magnets: string | string[]): Promise<MagnetUploadResponseData | undefined>;
387
306
  /**
388
307
  * Upload a torrent file
389
308
  *
@@ -400,150 +319,309 @@ declare class MagnetResource extends BaseResource {
400
319
  * const result = await client.magnet.uploadFile(blob, 'my-torrent.torrent')
401
320
  * ```
402
321
  */
403
- uploadFile(file: Blob | File, filename?: string): Promise<{
404
- files?: Array<{
405
- file?: string;
406
- hash?: string;
407
- name?: string;
408
- size?: number;
409
- ready?: boolean;
410
- id?: number;
411
- error?: {
412
- code?: string;
413
- message?: string;
414
- };
415
- }>;
416
- } | undefined>;
417
- /**
418
- * Get the status of one or more magnets
419
- *
420
- * @param id - Optional magnet ID to get status for a specific magnet
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
421
327
  *
422
328
  * @example
423
329
  * ```ts
424
- * // Get all magnets status
425
- * const allStatus = await client.magnet.status()
426
- *
427
- * // Get specific magnet status
428
- * const status = await client.magnet.status('123')
330
+ * const status = await client.magnet.status(123)
429
331
  * console.log(status.magnets[0]?.status) // 'Downloading', 'Ready', etc.
430
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)
431
358
  */
432
- status(id?: string): Promise<{
433
- magnets?: Array<{
434
- id?: number;
435
- filename?: string;
436
- size?: number;
437
- status?: string;
438
- statusCode?: number;
439
- downloaded?: number;
440
- uploaded?: number;
441
- seeders?: number;
442
- downloadSpeed?: number;
443
- uploadSpeed?: number;
444
- uploadDate?: number;
445
- completionDate?: number;
446
- links?: Array<{
447
- link?: string;
448
- filename?: string;
449
- size?: number;
450
- }>;
451
- }>;
452
- } | undefined>;
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>;
453
454
  /**
454
455
  * Delete a magnet
455
456
  *
456
- * @param id - The magnet ID to delete (string)
457
+ * @param id - The magnet ID to delete
457
458
  *
458
459
  * @example
459
460
  * ```ts
460
- * await client.magnet.delete('123')
461
+ * await client.magnet.delete(123)
461
462
  * ```
462
463
  */
463
- delete(id: string): Promise<{
464
- message?: string;
465
- } | undefined>;
464
+ delete(id: number): Promise<MessageResponseData | undefined>;
466
465
  /**
467
466
  * Restart one or more failed magnets
468
467
  *
469
- * @param ids - Single magnet ID or array of magnet IDs to restart (strings)
468
+ * @param ids - Single magnet ID or array of magnet IDs to restart (numbers)
470
469
  *
471
470
  * @example
472
471
  * ```ts
473
472
  * // Restart single magnet
474
- * await client.magnet.restart('123')
473
+ * await client.magnet.restart(123)
475
474
  *
476
475
  * // Restart multiple magnets
477
- * await client.magnet.restart(['123', '456'])
476
+ * await client.magnet.restart([123, 456])
478
477
  * ```
479
478
  */
480
- restart(ids: string | string[]): Promise<{
481
- magnets?: Array<{
482
- magnet?: string;
483
- message?: string;
484
- error?: {
485
- code?: string;
486
- message?: string;
487
- };
488
- }>;
489
- } | undefined>;
479
+ restart(ids: number | number[]): Promise<MessageResponseData | undefined>;
490
480
  /**
491
- * Check instant availability of magnets
481
+ * Get files for a completed magnet
492
482
  *
493
- * @param magnets - Single magnet hash or array of hashes
483
+ * @param ids - The magnet ID or IDs to get files for
494
484
  *
495
485
  * @example
496
486
  * ```ts
497
- * const available = await client.magnet.instant(['hash1', 'hash2'])
498
- * console.log(available.magnets)
487
+ * const data = await client.magnet.files(123)
488
+ * data?.magnets?.forEach(magnet => {
489
+ * console.log(magnet.filename, magnet.files)
490
+ * })
499
491
  * ```
492
+ *
493
+ * @remarks
494
+ * Files are now retrieved separately from magnet status (since v4.1)
495
+ * Only available for magnets with status 'Ready'
500
496
  */
501
- instant(magnets: string | string[]): Promise<{
502
- magnets?: Array<{
503
- magnet?: string;
504
- hash?: string;
505
- instant?: boolean;
506
- error?: {
507
- code?: string;
508
- message?: string;
509
- };
510
- }>;
511
- } | undefined>;
497
+ files(ids: number | number[]): Promise<MagnetFilesResponseData | undefined>;
512
498
  /**
513
499
  * Watch a magnet's status with automatic polling
514
500
  *
515
- * @param id - The magnet ID to watch (string)
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
516
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')
517
511
  *
518
512
  * @example
519
513
  * ```ts
520
- * await client.magnet.watch('123', {
514
+ * await client.magnet.watch(123, {
521
515
  * onUpdate: (status) => console.log('Status:', status.magnets[0]?.status),
522
516
  * stopOnStatus: 'Ready'
523
517
  * })
524
518
  * ```
519
+ *
520
+ * @remarks
521
+ * For monitoring multiple magnets efficiently, use `statusLive()` directly.
522
+ * See the `statusLive()` documentation for details on delta synchronization.
525
523
  */
526
- watch(id: string, options?: WatchOptions): Promise<{
527
- magnets?: Array<{
528
- id?: number;
529
- filename?: string;
530
- size?: number;
531
- status?: string;
532
- statusCode?: number;
533
- downloaded?: number;
534
- uploaded?: number;
535
- seeders?: number;
536
- downloadSpeed?: number;
537
- uploadSpeed?: number;
538
- uploadDate?: number;
539
- completionDate?: number;
540
- links?: Array<{
541
- link?: string;
542
- filename?: string;
543
- size?: number;
544
- }>;
545
- }>;
546
- } | undefined>;
524
+ watch(id: number, options?: WatchOptions): Promise<MagnetStatusResponseData | undefined>;
525
+ }
526
+
527
+ /**
528
+ * Pin resource for PIN-based authentication flow
529
+ *
530
+ * The PIN flow allows users to authenticate without directly providing their API key.
531
+ * This is useful for applications where you want users to authorize access through
532
+ * the AllDebrid website.
533
+ */
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>;
547
625
  }
548
626
 
549
627
  /**
@@ -555,25 +633,11 @@ declare class UserResource extends BaseResource {
555
633
  *
556
634
  * @example
557
635
  * ```ts
558
- * const user = await client.user.getInfo()
559
- * console.log(user.username, user.isPremium)
636
+ * const data = await client.user.getInfo()
637
+ * console.log(data.user.username, data.user.isPremium)
560
638
  * ```
561
639
  */
562
- getInfo(): Promise<{
563
- username?: string;
564
- email?: string;
565
- isPremium?: boolean;
566
- isSubscribed?: boolean;
567
- isTrial?: boolean;
568
- premiumUntil?: number;
569
- lang?: string;
570
- preferedDomain?: string;
571
- fidelityPoints?: number;
572
- limitedHostersQuotas?: {
573
- [key: string]: (number);
574
- };
575
- notifications?: Array<(string)>;
576
- } | undefined>;
640
+ getInfo(): Promise<UserResponseData | undefined>;
577
641
  /**
578
642
  * Get available hosts for the current user based on their subscription
579
643
  *
@@ -585,38 +649,7 @@ declare class UserResource extends BaseResource {
585
649
  * console.log(Object.keys(hosts.hosts))
586
650
  * ```
587
651
  */
588
- getHosts(hostOnly?: boolean): Promise<{
589
- hosts?: {
590
- [key: string]: {
591
- name?: string;
592
- type?: string;
593
- domains?: Array<(string)>;
594
- regexp?: string;
595
- regexps?: Array<(string)>;
596
- status?: boolean;
597
- };
598
- };
599
- streams?: {
600
- [key: string]: {
601
- name?: string;
602
- type?: string;
603
- domains?: Array<(string)>;
604
- regexp?: string;
605
- regexps?: Array<(string)>;
606
- status?: boolean;
607
- };
608
- };
609
- redirectors?: {
610
- [key: string]: {
611
- name?: string;
612
- type?: string;
613
- domains?: Array<(string)>;
614
- regexp?: string;
615
- regexps?: Array<(string)>;
616
- status?: boolean;
617
- };
618
- };
619
- } | undefined>;
652
+ getHosts(hostOnly?: boolean): Promise<UserHostsResponseData | undefined>;
620
653
  /**
621
654
  * Clear a specific notification by code
622
655
  *
@@ -637,41 +670,49 @@ declare class UserResource extends BaseResource {
637
670
  * console.log(savedLinks.links)
638
671
  * ```
639
672
  */
640
- getLinks(): Promise<{
641
- links?: Array<{
642
- link?: string;
643
- filename?: string;
644
- size?: number;
645
- date?: number;
646
- host?: string;
647
- }>;
648
- } | undefined>;
673
+ getLinks(): Promise<SavedLinksResponseData | undefined>;
649
674
  /**
650
- * Save a link for later use
675
+ * Save one or multiple links for later use
676
+ *
677
+ * Supports batch operations - you can save multiple links in a single request.
651
678
  *
652
- * @param link - The link to save
679
+ * @param links - Single link or array of links to save
653
680
  *
654
681
  * @example
655
682
  * ```ts
683
+ * // Save single link
656
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
+ * ])
657
692
  * ```
658
693
  */
659
- saveLink(link: string): Promise<{
660
- message?: string;
661
- } | undefined>;
694
+ saveLink(links: string | string[]): Promise<MessageResponseData | undefined>;
662
695
  /**
663
- * Delete a saved link
696
+ * Delete one or multiple saved links
697
+ *
698
+ * Supports batch operations - you can delete multiple links in a single request.
664
699
  *
665
- * @param link - The link to delete (can be the saved link ID or URL)
700
+ * @param links - Single link or array of links to delete (can be saved link IDs or URLs)
666
701
  *
667
702
  * @example
668
703
  * ```ts
704
+ * // Delete single link
669
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
+ * ])
670
713
  * ```
671
714
  */
672
- deleteLink(link: string): Promise<{
673
- message?: string;
674
- } | undefined>;
715
+ deleteLink(links: string | string[]): Promise<MessageResponseData | undefined>;
675
716
  /**
676
717
  * Get user history (if enabled in account settings)
677
718
  *
@@ -681,15 +722,7 @@ declare class UserResource extends BaseResource {
681
722
  * console.log(history.links)
682
723
  * ```
683
724
  */
684
- getHistory(): Promise<{
685
- links?: Array<{
686
- link?: string;
687
- filename?: string;
688
- size?: number;
689
- date?: number;
690
- host?: string;
691
- }>;
692
- } | undefined>;
725
+ getHistory(): Promise<SavedLinksResponseData | undefined>;
693
726
  /**
694
727
  * Clear user history
695
728
  *
@@ -698,9 +731,96 @@ declare class UserResource extends BaseResource {
698
731
  * await client.user.clearHistory()
699
732
  * ```
700
733
  */
701
- clearHistory(): Promise<{
702
- message?: string;
703
- } | undefined>;
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>;
758
+ }
759
+
760
+ /**
761
+ * Voucher resource for reseller voucher management
762
+ *
763
+ * Note: These endpoints are only available for reseller accounts.
764
+ */
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>;
704
824
  }
705
825
 
706
826
  /**
@@ -724,6 +844,14 @@ declare class AllDebridClient {
724
844
  * Host resource for getting information about supported hosts
725
845
  */
726
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;
727
855
  constructor(config: AllDebridConfig);
728
856
  /**
729
857
  * Build query string from params
@@ -731,26 +859,48 @@ declare class AllDebridClient {
731
859
  private buildUrl;
732
860
  /**
733
861
  * Make a GET request
734
- * @param T - The generated response type (e.g., GetLinkUnlockResponse)
862
+ * @template T - The generated response type (e.g., GetLinkUnlockResponse)
863
+ * @param path - API endpoint path
864
+ * @param params - Optional query parameters
735
865
  * @returns The extracted data from the response (without the { status, data } wrapper)
866
+ * @internal
736
867
  */
737
- protected get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
868
+ get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
738
869
  /**
739
- * Make a POST request
740
- * @param T - The generated response type
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
741
875
  * @returns The extracted data from the response (without the { status, data } wrapper)
876
+ * @internal
742
877
  */
743
- protected post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
878
+ post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
744
879
  /**
745
880
  * Make a POST request with FormData (multipart/form-data)
746
- * @param T - The generated response type
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
747
885
  * @returns The extracted data from the response (without the { status, data } wrapper)
886
+ * @internal
748
887
  */
749
- protected postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
888
+ postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
750
889
  /**
751
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
752
902
  */
753
- ping(): Promise<boolean>;
903
+ ping(): Promise<PingResponseData | undefined>;
754
904
  }
755
905
 
756
906
  /**
@@ -796,799 +946,509 @@ declare class NetworkError extends AllDebridError {
796
946
  declare function createTypedError(code: string, message: string): AllDebridError;
797
947
 
798
948
  /**
799
- * You can find all possible errors here, available in PHP array and JSON format if needed.<br /> Some errors will return an HTTP code 401 or 429, depending of the error.<br />
949
+ * Liste exhaustive des codes d'erreur AllDebrid (janvier 2026)
800
950
  */
801
- type ErrorCodes = 'GENERIC' | 404 | 'AUTH_MISSING_AGENT' | 'AUTH_BAD_AGENT' | 'AUTH_MISSING_APIKEY' | 'AUTH_BAD_APIKEY' | 'AUTH_BLOCKED' | 'AUTH_USER_BANNED' | 'LINK_IS_MISSING' | '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' | '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_MUST_BE_PREMIUM' | 'MAGNET_NO_SERVER' | 'MAGNET_TOO_LARGE' | 'PIN_ALREADY_AUTHED' | 'PIN_EXPIRED' | 'PIN_INVALID' | 'USER_LINK_MISSING' | 'USER_LINK_INVALID' | 'NO_SERVER' | 'MISSING_NOTIF_ENDPOINT';
802
- type GetHostsData = {
803
- query: {
804
- /**
805
- * Your software user-agent.
806
- */
807
- agent: string;
808
- /**
809
- * Endpoint will only return "hosts" data
810
- */
811
- hostOnly?: string;
812
- };
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;
813
955
  };
814
- type GetHostsResponse = ({
815
- status?: string;
816
- data?: {
817
- hosts?: {
818
- [key: string]: {
819
- name?: string;
820
- type?: string;
821
- domains?: Array<(string)>;
822
- regexp?: string;
823
- regexps?: Array<(string)>;
824
- status?: boolean;
825
- };
826
- };
827
- streams?: {
828
- [key: string]: {
829
- name?: string;
830
- type?: string;
831
- domains?: Array<(string)>;
832
- regexp?: string;
833
- regexps?: Array<(string)>;
834
- status?: boolean;
835
- };
836
- };
837
- redirectors?: {
838
- [key: string]: {
839
- name?: string;
840
- type?: string;
841
- domains?: Array<(string)>;
842
- regexp?: string;
843
- regexps?: Array<(string)>;
844
- status?: boolean;
845
- };
846
- };
847
- };
848
- error?: {
849
- code?: string;
850
- message?: string;
851
- };
852
- });
853
- type GetHostsError = unknown;
854
- type GetHostsDomainsData = {
855
- query: {
856
- /**
857
- * Your software user-agent.
858
- */
859
- agent: string;
956
+ type status = 'error';
957
+ type ApiSuccessResponseBase = {
958
+ status: 'success';
959
+ demo?: boolean;
960
+ deprecated?: boolean;
961
+ };
962
+ type status2 = 'success';
963
+ type ClearNotificationResponseData = {
964
+ message?: string;
965
+ };
966
+ type DelayedStatusResponseData = {
967
+ /**
968
+ * 1 = processing, 2 = ready, 3 = error
969
+ */
970
+ status?: number;
971
+ time_left?: number;
972
+ link?: string;
973
+ };
974
+ type ErrorDetail = {
975
+ code: AllDebridErrorCode;
976
+ message: string;
977
+ };
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;
989
+ };
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)>;
996
+ };
997
+ type HostsPriorityResponseData = {
998
+ hosts?: {
999
+ [key: string]: (number);
860
1000
  };
861
1001
  };
862
- type GetHostsDomainsResponse = ({
863
- status?: string;
864
- data?: {
865
- hosts?: Array<(string)>;
866
- streams?: Array<(string)>;
867
- redirectors?: Array<(string)>;
1002
+ type HostsResponseData = {
1003
+ hosts?: {
1004
+ [key: string]: HostDetail;
868
1005
  };
869
- error?: {
870
- code?: string;
871
- message?: string;
1006
+ streams?: {
1007
+ [key: string]: HostDetail;
872
1008
  };
873
- });
874
- type GetHostsDomainsError = unknown;
875
- type GetHostsPriorityData = {
876
- query: {
877
- /**
878
- * Your software user-agent.
879
- */
880
- agent: string;
1009
+ redirectors?: {
1010
+ [key: string]: HostDetail;
881
1011
  };
882
1012
  };
883
- type GetHostsPriorityResponse = ({
1013
+ type LinkInfoItem = {
1014
+ link?: string;
1015
+ filename?: string;
1016
+ size?: number;
1017
+ host?: string;
1018
+ hostDomain?: string;
1019
+ error?: ErrorDetail;
1020
+ };
1021
+ type LinkInfosResponseData = {
1022
+ infos?: Array<LinkInfoItem>;
1023
+ };
1024
+ type MagnetFile = {
1025
+ n?: string;
1026
+ s?: number;
1027
+ l?: Array<(string)>;
1028
+ e?: Array<MagnetFile>;
1029
+ };
1030
+ type MagnetFilesItem = {
1031
+ id?: number;
1032
+ files?: Array<MagnetFile>;
1033
+ error?: ErrorDetail;
1034
+ };
1035
+ type MagnetFilesResponseData = {
1036
+ magnets?: Array<MagnetFilesItem>;
1037
+ };
1038
+ type MagnetStatusItem = {
1039
+ id?: number;
1040
+ filename?: string;
1041
+ size?: number;
884
1042
  status?: string;
885
- data?: {
886
- hosts?: {
887
- [key: string]: (number);
888
- };
889
- };
890
- error?: {
891
- code?: string;
892
- message?: string;
1043
+ statusCode?: number;
1044
+ downloaded?: number;
1045
+ uploaded?: number;
1046
+ downloadSpeed?: number;
1047
+ uploadSpeed?: number;
1048
+ seeders?: number;
1049
+ files?: Array<MagnetFile>;
1050
+ };
1051
+ type MagnetStatusResponseData = {
1052
+ magnets?: Array<MagnetStatusItem>;
1053
+ counter?: number;
1054
+ fullsync?: boolean;
1055
+ };
1056
+ type MagnetUploadItem = {
1057
+ magnet?: string;
1058
+ hash?: string;
1059
+ name?: string;
1060
+ size?: number;
1061
+ ready?: boolean;
1062
+ id?: number;
1063
+ error?: ErrorDetail;
1064
+ };
1065
+ type MagnetUploadResponseData = {
1066
+ magnets?: Array<MagnetUploadItem>;
1067
+ };
1068
+ type MessageResponseData = {
1069
+ message?: string;
1070
+ };
1071
+ type PinCheckResponseData = {
1072
+ activated: boolean;
1073
+ expires_in: number;
1074
+ apikey?: string;
1075
+ };
1076
+ type PinGetResponseData = {
1077
+ pin: string;
1078
+ check: string;
1079
+ expires_in: number;
1080
+ user_url?: string;
1081
+ base_url?: string;
1082
+ };
1083
+ type PingResponseData = {
1084
+ ping?: string;
1085
+ };
1086
+ type RedirectorResponseData = {
1087
+ links?: Array<(string)>;
1088
+ };
1089
+ type ResendVerifResponseData = {
1090
+ sent?: boolean;
1091
+ };
1092
+ type SavedLink = {
1093
+ link?: string;
1094
+ filename?: string;
1095
+ size?: number;
1096
+ date?: number;
1097
+ host?: string;
1098
+ };
1099
+ type SavedLinksResponseData = {
1100
+ links?: Array<SavedLink>;
1101
+ };
1102
+ type StreamingResponseData = {
1103
+ link?: string;
1104
+ filename?: string;
1105
+ filesize?: number;
1106
+ delayed?: number;
1107
+ };
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;
1122
+ };
1123
+ type TorrentFileUploadResponseData = {
1124
+ files?: Array<TorrentFileUploadItem>;
1125
+ };
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;
1138
+ };
1139
+ type UserHostsResponseData = {
1140
+ hosts?: {
1141
+ [key: string]: HostDetail;
893
1142
  };
894
- });
895
- type GetHostsPriorityError = unknown;
896
- type GetUserData = {
1143
+ };
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)>;
1159
+ };
1160
+ type UserResponseData = {
1161
+ user?: UserInfo;
1162
+ };
1163
+ type VerifStatusResponseData = {
1164
+ verif?: 'waiting' | 'allowed' | 'denied';
1165
+ resendable?: boolean;
1166
+ apikey?: string;
1167
+ };
1168
+ type verif = 'waiting' | 'allowed' | 'denied';
1169
+ type VoucherBalanceResponseData = {
1170
+ balance?: number;
1171
+ };
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;
1189
+ };
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;
1199
+ };
1200
+ type PingResponse = ((ApiSuccessResponseBase & {
1201
+ data?: PingResponseData;
1202
+ }));
1203
+ type PingError = unknown;
1204
+ type GetPinResponse = ((ApiSuccessResponseBase & {
1205
+ data?: PinGetResponseData;
1206
+ }));
1207
+ type GetPinError = unknown;
1208
+ type CheckPinData = {
897
1209
  query: {
898
- /**
899
- * Your software user-agent.
900
- */
901
- agent: string;
902
- /**
903
- * Deprecated User apikey (Use Bearer Auth in header).
904
- */
905
- apikey?: string;
1210
+ check: string;
1211
+ pin: string;
906
1212
  };
907
1213
  };
908
- type GetUserResponse = ({
909
- status?: string;
910
- data?: {
911
- user?: {
912
- username?: string;
913
- email?: string;
914
- isPremium?: boolean;
915
- isSubscribed?: boolean;
916
- isTrial?: boolean;
917
- premiumUntil?: number;
918
- lang?: string;
919
- preferedDomain?: string;
920
- fidelityPoints?: number;
921
- limitedHostersQuotas?: {
922
- [key: string]: (number);
923
- };
924
- notifications?: Array<(string)>;
925
- };
926
- };
927
- error?: {
928
- code?: string;
929
- message?: string;
1214
+ type CheckPinResponse = ((ApiSuccessResponseBase & {
1215
+ data?: PinCheckResponseData;
1216
+ }));
1217
+ type CheckPinError = unknown;
1218
+ type GetHostsData = {
1219
+ query?: {
1220
+ hostsOnly?: boolean;
930
1221
  };
931
- });
1222
+ };
1223
+ type GetHostsResponse = ((ApiSuccessResponseBase & {
1224
+ data?: HostsResponseData;
1225
+ }));
1226
+ type GetHostsError = unknown;
1227
+ type GetHostDomainsResponse = ((ApiSuccessResponseBase & {
1228
+ data?: HostsDomainsResponseData;
1229
+ }));
1230
+ type GetHostDomainsError = unknown;
1231
+ type GetHostPriorityResponse = ((ApiSuccessResponseBase & {
1232
+ data?: HostsPriorityResponseData;
1233
+ }));
1234
+ type GetHostPriorityError = unknown;
1235
+ type GetUserResponse = ((ApiSuccessResponseBase & {
1236
+ data?: UserResponseData;
1237
+ }));
932
1238
  type GetUserError = unknown;
933
- type GetUserHostsData = {
1239
+ type GetUserHostsResponse = ((ApiSuccessResponseBase & {
1240
+ data?: UserHostsResponseData;
1241
+ }));
1242
+ type GetUserHostsError = unknown;
1243
+ type GetVerifStatusData = {
934
1244
  query: {
935
- /**
936
- * Your software user-agent.
937
- */
938
- agent: string;
939
- /**
940
- * Deprecated User apikey (Use Bearer Auth in header).
941
- */
942
- apikey?: string;
943
- /**
944
- * Endpoint will only return "hosts" data
945
- */
946
- hostOnly?: string;
1245
+ token: string;
947
1246
  };
948
1247
  };
949
- type GetUserHostsResponse = ({
950
- status?: string;
951
- data?: {
952
- hosts?: {
953
- [key: string]: {
954
- name?: string;
955
- type?: string;
956
- domains?: Array<(string)>;
957
- regexp?: string;
958
- regexps?: Array<(string)>;
959
- status?: boolean;
960
- };
961
- };
962
- streams?: {
963
- [key: string]: {
964
- name?: string;
965
- type?: string;
966
- domains?: Array<(string)>;
967
- regexp?: string;
968
- regexps?: Array<(string)>;
969
- status?: boolean;
970
- };
971
- };
972
- redirectors?: {
973
- [key: string]: {
974
- name?: string;
975
- type?: string;
976
- domains?: Array<(string)>;
977
- regexp?: string;
978
- regexps?: Array<(string)>;
979
- status?: boolean;
980
- };
981
- };
982
- };
983
- error?: {
984
- code?: string;
985
- message?: string;
1248
+ type GetVerifStatusResponse = ((ApiSuccessResponseBase & {
1249
+ data?: VerifStatusResponseData;
1250
+ }));
1251
+ type GetVerifStatusError = unknown;
1252
+ type ResendVerifData = {
1253
+ query: {
1254
+ token: string;
986
1255
  };
987
- });
988
- type GetUserHostsError = unknown;
989
- type GetUserNotificationClearData = {
1256
+ };
1257
+ type ResendVerifResponse = ((ApiSuccessResponseBase & {
1258
+ data?: ResendVerifResponseData;
1259
+ }));
1260
+ type ResendVerifError = unknown;
1261
+ type ClearNotificationData = {
990
1262
  query: {
991
- /**
992
- * Your software user-agent.
993
- */
994
- agent: string;
995
- /**
996
- * Deprecated User apikey (Use Bearer Auth in header).
997
- */
998
- apikey?: string;
999
- /**
1000
- * Notification code to clear
1001
- */
1002
1263
  code: string;
1003
1264
  };
1004
1265
  };
1005
- type GetUserNotificationClearResponse = ({
1006
- status?: string;
1007
- data?: {
1008
- message?: string;
1009
- };
1010
- error?: {
1011
- code?: string;
1012
- message?: string;
1013
- };
1014
- });
1015
- type GetUserNotificationClearError = unknown;
1266
+ type ClearNotificationResponse = ((ApiSuccessResponseBase & {
1267
+ data?: ClearNotificationResponseData;
1268
+ }));
1269
+ type ClearNotificationError = unknown;
1016
1270
  type GetLinkInfosData = {
1017
1271
  query: {
1018
- /**
1019
- * Your software user-agent.
1020
- */
1021
- agent: string;
1022
- /**
1023
- * Deprecated User apikey (Use Bearer Auth in header).
1024
- */
1025
- apikey?: string;
1026
- /**
1027
- * The link or array of links you request informations about.
1028
- */
1029
1272
  'link[]': Array<(string)>;
1030
- /**
1031
- * Link password (supported on uptobox / 1fichier).
1032
- */
1033
1273
  password?: string;
1034
1274
  };
1035
1275
  };
1036
- type GetLinkInfosResponse = ({
1037
- status?: string;
1038
- data?: {
1039
- /**
1040
- * Array of info objects
1041
- */
1042
- infos?: Array<{
1043
- /**
1044
- * Requested link
1045
- */
1046
- link?: string;
1047
- /**
1048
- * Link's file filename.
1049
- */
1050
- filename?: string;
1051
- /**
1052
- * Link's file size in bytes.
1053
- */
1054
- size?: number;
1055
- /**
1056
- * Link host.
1057
- */
1058
- host?: string;
1059
- /**
1060
- * Host main domain
1061
- */
1062
- hostDomain?: string;
1063
- }>;
1064
- };
1065
- error?: {
1066
- code?: string;
1067
- message?: string;
1068
- };
1069
- });
1276
+ type GetLinkInfosResponse = ((ApiSuccessResponseBase & {
1277
+ data?: LinkInfosResponseData;
1278
+ }));
1070
1279
  type GetLinkInfosError = unknown;
1071
- type GetLinkRedirectorData = {
1280
+ type GetRedirectorLinksData = {
1072
1281
  query: {
1073
- /**
1074
- * Your software user-agent.
1075
- */
1076
- agent: string;
1077
- /**
1078
- * Deprecated User apikey (Use Bearer Auth in header).
1079
- */
1080
- apikey?: string;
1081
- /**
1082
- * The redirector or protector link to extract links.
1083
- */
1084
1282
  link: string;
1085
1283
  };
1086
1284
  };
1087
- type GetLinkRedirectorResponse = ({
1088
- status?: string;
1089
- data?: {
1090
- /**
1091
- * Link(s) extracted.
1092
- */
1093
- links?: Array<(string)>;
1094
- };
1095
- error?: {
1096
- code?: string;
1097
- message?: string;
1098
- };
1099
- });
1100
- type GetLinkRedirectorError = unknown;
1101
- type GetLinkUnlockData = {
1285
+ type GetRedirectorLinksResponse = ((ApiSuccessResponseBase & {
1286
+ data?: RedirectorResponseData;
1287
+ }));
1288
+ type GetRedirectorLinksError = unknown;
1289
+ type UnlockLinkData = {
1102
1290
  query: {
1103
- /**
1104
- * Your software user-agent.
1105
- */
1106
- agent: string;
1107
- /**
1108
- * Deprecated User apikey (Use Bearer Auth in header).
1109
- */
1110
- apikey?: string;
1111
- /**
1112
- * The redirector or protector link to extract links.
1113
- */
1114
1291
  link: string;
1115
- /**
1116
- * Link password (supported on uptobox / 1fichier).
1117
- */
1118
1292
  password?: string;
1119
1293
  };
1120
1294
  };
1121
- type GetLinkUnlockResponse = ({
1122
- status?: string;
1123
- data?: {
1124
- filename?: string;
1125
- filesize?: number;
1126
- host?: string;
1127
- hostDomain?: string;
1128
- id?: string;
1129
- link?: string;
1130
- paws?: boolean;
1131
- streams?: Array<{
1132
- id?: string;
1133
- ext?: string;
1134
- quality?: string;
1135
- filesize?: number;
1136
- proto?: string;
1137
- name?: string;
1138
- link?: string;
1139
- tb?: number;
1140
- abr?: number;
1141
- }>;
1142
- };
1143
- error?: {
1144
- code?: string;
1145
- message?: string;
1146
- };
1147
- });
1148
- type GetLinkUnlockError = unknown;
1149
- type GetLinkStreamingData = {
1295
+ type UnlockLinkResponse = ((ApiSuccessResponseBase & {
1296
+ data?: UnlockLinkResponseData;
1297
+ }));
1298
+ type UnlockLinkError = unknown;
1299
+ type GetStreamingLinkData = {
1150
1300
  query: {
1151
- /**
1152
- * Your software user-agent.
1153
- */
1154
- agent: string;
1155
- /**
1156
- * Deprecated User apikey (Use Bearer Auth in header).
1157
- */
1158
- apikey?: string;
1159
- /**
1160
- * The link ID you received from the /link/unlock call.
1161
- */
1162
1301
  id: string;
1163
- /**
1164
- * The stream ID you choosed from the stream qualities list returned by /link/unlock.
1165
- */
1166
1302
  stream: string;
1167
1303
  };
1168
1304
  };
1169
- type GetLinkStreamingResponse = ({
1170
- status?: string;
1171
- data?: {
1172
- filename?: string;
1173
- filesize?: number;
1174
- host?: string;
1175
- hostDomain?: string;
1176
- id?: string;
1177
- link?: string;
1178
- paws?: boolean;
1179
- streams?: Array<{
1180
- id?: string;
1181
- ext?: string;
1182
- quality?: string;
1183
- filesize?: number;
1184
- proto?: string;
1185
- name?: string;
1186
- link?: string;
1187
- tb?: number;
1188
- abr?: number;
1189
- }>;
1190
- };
1191
- error?: {
1192
- code?: string;
1193
- message?: string;
1194
- };
1195
- });
1196
- type GetLinkStreamingError = unknown;
1197
- type GetLinkDelayedData = {
1305
+ type GetStreamingLinkResponse = ((ApiSuccessResponseBase & {
1306
+ data?: StreamingResponseData;
1307
+ }));
1308
+ type GetStreamingLinkError = unknown;
1309
+ type GetDelayedStatusData = {
1198
1310
  query: {
1199
- /**
1200
- * Your software user-agent.
1201
- */
1202
- agent: string;
1203
- /**
1204
- * Deprecated User apikey (Use Bearer Auth in header).
1205
- */
1206
- apikey?: string;
1207
- /**
1208
- * Delayed ID received in /link/unlock.
1209
- */
1210
- id: string;
1311
+ id: number;
1211
1312
  };
1212
1313
  };
1213
- type GetLinkDelayedResponse = ({
1214
- status?: string;
1215
- data?: {
1216
- status?: number;
1217
- time_left?: number;
1218
- link?: string;
1219
- };
1220
- error?: {
1221
- code?: string;
1222
- message?: string;
1223
- };
1224
- });
1225
- type GetLinkDelayedError = unknown;
1226
- type GetMagnetUploadData = {
1314
+ type GetDelayedStatusResponse = ((ApiSuccessResponseBase & {
1315
+ data?: DelayedStatusResponseData;
1316
+ }));
1317
+ type GetDelayedStatusError = unknown;
1318
+ type UploadMagnetsData = {
1227
1319
  query: {
1228
- /**
1229
- * Your software user-agent.
1230
- */
1231
- agent: string;
1232
- /**
1233
- * Deprecated User apikey (Use Bearer Auth in header).
1234
- */
1235
- apikey?: string;
1236
- /**
1237
- * Magnet(s) URI or hash. Must send magnet either in GET param or in POST data.
1238
- */
1239
1320
  'magnets[]': Array<(string)>;
1240
1321
  };
1241
1322
  };
1242
- type GetMagnetUploadResponse = ({
1243
- status?: string;
1244
- data?: {
1245
- magnets?: Array<{
1246
- magnet?: string;
1247
- hash?: string;
1248
- name?: string;
1249
- size?: number;
1250
- ready?: boolean;
1251
- id?: number;
1252
- error?: {
1253
- code?: string;
1254
- message?: string;
1255
- };
1256
- }>;
1257
- };
1258
- error?: {
1259
- code?: string;
1260
- message?: string;
1261
- };
1262
- });
1263
- type GetMagnetUploadError = unknown;
1264
- type PostMagnetUploadFileData = {
1323
+ type UploadMagnetsResponse = ((ApiSuccessResponseBase & {
1324
+ data?: MagnetUploadResponseData;
1325
+ }));
1326
+ type UploadMagnetsError = unknown;
1327
+ type UploadTorrentFileData = {
1265
1328
  body?: {
1266
- '[]file'?: (Blob | File);
1267
- };
1268
- query: {
1269
- /**
1270
- * Your software user-agent.
1271
- */
1272
- agent: string;
1273
- /**
1274
- * Deprecated User apikey (Use Bearer Auth in header).
1275
- */
1276
- apikey?: string;
1329
+ files?: Array<((Blob | File))>;
1277
1330
  };
1278
1331
  };
1279
- type PostMagnetUploadFileResponse = ({
1280
- status?: string;
1281
- data?: {
1282
- files?: Array<{
1283
- file?: string;
1284
- hash?: string;
1285
- name?: string;
1286
- size?: number;
1287
- ready?: boolean;
1288
- id?: number;
1289
- error?: {
1290
- code?: string;
1291
- message?: string;
1292
- };
1293
- }>;
1294
- };
1295
- error?: {
1296
- code?: string;
1297
- message?: string;
1298
- };
1299
- });
1300
- type PostMagnetUploadFileError = unknown;
1332
+ type UploadTorrentFileResponse = ((ApiSuccessResponseBase & {
1333
+ data?: TorrentFileUploadResponseData;
1334
+ }));
1335
+ type UploadTorrentFileError = unknown;
1301
1336
  type GetMagnetStatusData = {
1302
- query: {
1337
+ query?: {
1303
1338
  /**
1304
- * Your software user-agent.
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.
1305
1340
  */
1306
- agent: string;
1341
+ counter?: number;
1307
1342
  /**
1308
- * Deprecated User apikey (Use Bearer Auth in header).
1343
+ * **Standard Mode**: Get status of a specific magnet by its ID. Incompatible with Live Mode parameters.
1309
1344
  */
1310
- apikey?: string;
1345
+ id?: number;
1311
1346
  /**
1312
- * Counter for Live mode (see Live Mode).
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.
1313
1348
  */
1314
- counter?: string;
1349
+ session?: number;
1315
1350
  /**
1316
- * Magnet ID.
1351
+ * **Standard Mode**: Filter magnets by status. Possible values: 'active', 'ready', 'expired', 'error'. Incompatible with Live Mode parameters.
1317
1352
  */
1318
- id?: string;
1319
- /**
1320
- * Session ID for Live mode (see Live Mode).
1321
- */
1322
- session?: string;
1323
- /**
1324
- * Magnets status filter. Either active, ready, expired or error
1325
- */
1326
- status?: string;
1353
+ status?: 'active' | 'ready' | 'expired' | 'error';
1327
1354
  };
1328
1355
  };
1329
- type GetMagnetStatusResponse = ({
1330
- status?: string;
1331
- data?: {
1332
- magnets?: Array<{
1333
- id?: number;
1334
- filename?: string;
1335
- size?: number;
1336
- status?: string;
1337
- statusCode?: number;
1338
- downloaded?: number;
1339
- uploaded?: number;
1340
- seeders?: number;
1341
- downloadSpeed?: number;
1342
- uploadSpeed?: number;
1343
- uploadDate?: number;
1344
- completionDate?: number;
1345
- links?: Array<{
1346
- link?: string;
1347
- filename?: string;
1348
- size?: number;
1349
- }>;
1350
- }>;
1351
- };
1352
- error?: {
1353
- code?: string;
1354
- message?: string;
1355
- };
1356
- });
1356
+ type GetMagnetStatusResponse = ((ApiSuccessResponseBase & {
1357
+ data?: MagnetStatusResponseData;
1358
+ }));
1357
1359
  type GetMagnetStatusError = unknown;
1358
- type GetMagnetDeleteData = {
1360
+ type GetMagnetFilesData = {
1359
1361
  query: {
1360
- /**
1361
- * Your software user-agent.
1362
- */
1363
- agent: string;
1364
- /**
1365
- * Deprecated User apikey (Use Bearer Auth in header).
1366
- */
1367
- apikey?: string;
1368
- /**
1369
- * Magnet ID.
1370
- */
1371
- id: string;
1362
+ 'id[]': Array<(number)>;
1372
1363
  };
1373
1364
  };
1374
- type GetMagnetDeleteResponse = ({
1375
- status?: string;
1376
- data?: {
1377
- message?: string;
1378
- };
1379
- error?: {
1380
- code?: string;
1381
- message?: string;
1382
- };
1383
- });
1384
- type GetMagnetDeleteError = unknown;
1385
- type GetMagnetRestartData = {
1365
+ type GetMagnetFilesResponse = ((ApiSuccessResponseBase & {
1366
+ data?: MagnetFilesResponseData;
1367
+ }));
1368
+ type GetMagnetFilesError = unknown;
1369
+ type DeleteMagnetData = {
1386
1370
  query: {
1387
- /**
1388
- * Your software user-agent.
1389
- */
1390
- agent: string;
1391
- /**
1392
- * Deprecated User apikey (Use Bearer Auth in header).
1393
- */
1394
- apikey?: string;
1395
- /**
1396
- * Array of Magnet ID.
1397
- */
1398
- ids: Array<(string)>;
1371
+ id: number;
1399
1372
  };
1400
1373
  };
1401
- type GetMagnetRestartResponse = ({
1402
- status?: string;
1403
- data?: {
1404
- magnets?: Array<{
1405
- magnet?: string;
1406
- message?: string;
1407
- error?: {
1408
- code?: string;
1409
- message?: string;
1410
- };
1411
- }>;
1412
- };
1413
- error?: {
1414
- code?: string;
1415
- message?: string;
1416
- };
1417
- });
1418
- type GetMagnetRestartError = unknown;
1419
- type GetMagnetInstantData = {
1420
- query: {
1421
- /**
1422
- * Your software user-agent.
1423
- */
1424
- agent: string;
1425
- /**
1426
- * Deprecated User apikey (Use Bearer Auth in header).
1427
- */
1428
- apikey?: string;
1429
- /**
1430
- * Magnets URI or hash you wish to check instant availability, can be one or many links
1431
- */
1432
- 'magnets[]': Array<(string)>;
1374
+ type DeleteMagnetResponse = ((ApiSuccessResponseBase & {
1375
+ data?: MessageResponseData;
1376
+ }));
1377
+ type DeleteMagnetError = unknown;
1378
+ type RestartMagnetData = {
1379
+ query?: {
1380
+ 'ids[]'?: Array<(number)>;
1433
1381
  };
1434
1382
  };
1435
- type GetMagnetInstantResponse = ({
1436
- status?: string;
1437
- data?: {
1438
- magnets?: Array<{
1439
- magnet?: string;
1440
- hash?: string;
1441
- instant?: boolean;
1442
- error?: {
1443
- code?: string;
1444
- message?: string;
1445
- };
1446
- }>;
1447
- };
1448
- error?: {
1449
- code?: string;
1450
- message?: string;
1451
- };
1452
- });
1453
- type GetMagnetInstantError = unknown;
1454
- type GetUserLinksData = {
1383
+ type RestartMagnetResponse = ((ApiSuccessResponseBase & {
1384
+ data?: MessageResponseData;
1385
+ }));
1386
+ type RestartMagnetError = unknown;
1387
+ type GetSavedLinksResponse = ((ApiSuccessResponseBase & {
1388
+ data?: SavedLinksResponseData;
1389
+ }));
1390
+ type GetSavedLinksError = unknown;
1391
+ type SaveLinksData = {
1455
1392
  query: {
1456
- /**
1457
- * Your software user-agent.
1458
- */
1459
- agent: string;
1460
- /**
1461
- * Deprecated User apikey (Use Bearer Auth in header).
1462
- */
1463
- apikey?: string;
1464
- };
1465
- };
1466
- type GetUserLinksResponse = ({
1467
- status?: string;
1468
- data?: {
1469
- links?: Array<{
1470
- link?: string;
1471
- filename?: string;
1472
- size?: number;
1473
- date?: number;
1474
- host?: string;
1475
- }>;
1476
- };
1477
- error?: {
1478
- code?: string;
1479
- message?: string;
1480
- };
1481
- });
1482
- type GetUserLinksError = unknown;
1483
- type GetUserLinksSaveData = {
1484
- query: {
1485
- /**
1486
- * Your software user-agent.
1487
- */
1488
- agent: string;
1489
- /**
1490
- * Deprecated User apikey (Use Bearer Auth in header).
1491
- */
1492
- apikey?: string;
1493
- /**
1494
- * Links to save.
1495
- */
1496
- 'link[]': Array<(string)>;
1393
+ 'links[]': Array<(string)>;
1497
1394
  };
1498
1395
  };
1499
- type GetUserLinksSaveResponse = ({
1500
- status?: string;
1501
- data?: {
1502
- message?: string;
1503
- };
1504
- error?: {
1505
- code?: string;
1506
- message?: string;
1507
- };
1508
- });
1509
- type GetUserLinksSaveError = unknown;
1510
- type GetUserLinksDeleteData = {
1511
- query: {
1512
- /**
1513
- * Your software user-agent.
1514
- */
1515
- agent: string;
1516
- /**
1517
- * Deprecated User apikey (Use Bearer Auth in header).
1518
- */
1519
- apikey?: string;
1520
- /**
1521
- * Link to delete.
1522
- */
1523
- link?: string;
1524
- /**
1525
- * Links to delete.
1526
- */
1527
- 'link[]'?: Array<(string)>;
1396
+ type SaveLinksResponse = ((ApiSuccessResponseBase & {
1397
+ data?: MessageResponseData;
1398
+ }));
1399
+ type SaveLinksError = unknown;
1400
+ type DeleteSavedLinksData = {
1401
+ query?: {
1402
+ 'links[]'?: Array<(string)>;
1528
1403
  };
1529
1404
  };
1530
- type GetUserLinksDeleteResponse = ({
1531
- status?: string;
1532
- data?: {
1533
- message?: string;
1534
- };
1535
- error?: {
1536
- code?: string;
1537
- message?: string;
1538
- };
1539
- });
1540
- type GetUserLinksDeleteError = unknown;
1541
- type GetUserHistoryData = {
1405
+ type DeleteSavedLinksResponse = ((ApiSuccessResponseBase & {
1406
+ data?: MessageResponseData;
1407
+ }));
1408
+ type DeleteSavedLinksError = unknown;
1409
+ type GetHistoryResponse = ((ApiSuccessResponseBase & {
1410
+ data?: SavedLinksResponseData;
1411
+ }));
1412
+ type GetHistoryError = unknown;
1413
+ type DeleteHistoryResponse = ((ApiSuccessResponseBase & {
1414
+ data?: MessageResponseData;
1415
+ }));
1416
+ type DeleteHistoryError = unknown;
1417
+ type GetVoucherBalanceResponse = ((ApiSuccessResponseBase & {
1418
+ data?: VoucherBalanceResponseData;
1419
+ }));
1420
+ type GetVoucherBalanceError = unknown;
1421
+ type GenerateVouchersData = {
1542
1422
  query: {
1543
1423
  /**
1544
- * Your software user-agent.
1424
+ * Durée du voucher en jours
1545
1425
  */
1546
- agent: string;
1426
+ duration: 15 | 30 | 90 | 180 | 365;
1547
1427
  /**
1548
- * Deprecated User apikey (Use Bearer Auth in header).
1428
+ * Nombre de vouchers à générer (1-10)
1549
1429
  */
1550
- apikey?: string;
1430
+ nb: number;
1551
1431
  };
1552
1432
  };
1553
- type GetUserHistoryResponse = ({
1554
- status?: string;
1555
- data?: {
1556
- links?: Array<{
1557
- link?: string;
1558
- filename?: string;
1559
- size?: number;
1560
- date?: number;
1561
- host?: string;
1562
- }>;
1563
- };
1564
- error?: {
1565
- code?: string;
1566
- message?: string;
1567
- };
1568
- });
1569
- type GetUserHistoryError = unknown;
1570
- type GetUserHistoryDeleteData = {
1433
+ type GenerateVouchersResponse = ((ApiSuccessResponseBase & {
1434
+ data?: VoucherGenerateResponseData;
1435
+ }));
1436
+ type GenerateVouchersError = unknown;
1437
+ type GetAvailableVouchersData = {
1571
1438
  query: {
1572
1439
  /**
1573
- * Your software user-agent.
1440
+ * Durée du voucher en jours
1574
1441
  */
1575
- agent: string;
1442
+ duration: 15 | 30 | 90 | 180 | 365;
1576
1443
  /**
1577
- * Deprecated User apikey (Use Bearer Auth in header).
1444
+ * Nombre de vouchers demandés (1-10)
1578
1445
  */
1579
- apikey?: string;
1446
+ nb: number;
1580
1447
  };
1581
1448
  };
1582
- type GetUserHistoryDeleteResponse = ({
1583
- status?: string;
1584
- data?: {
1585
- message?: string;
1586
- };
1587
- error?: {
1588
- code?: string;
1589
- message?: string;
1590
- };
1591
- });
1592
- type GetUserHistoryDeleteError = unknown;
1449
+ type GetAvailableVouchersResponse = ((ApiSuccessResponseBase & {
1450
+ data?: VoucherGetResponseData;
1451
+ }));
1452
+ type GetAvailableVouchersError = unknown;
1593
1453
 
1594
- export { AllDebridClient, type AllDebridConfig, AllDebridError, type ApiError, type ApiResponse, AuthenticationError, type ErrorCodes, type GetHostsData, type GetHostsDomainsData, type GetHostsDomainsError, type GetHostsDomainsResponse, type GetHostsError, type GetHostsPriorityData, type GetHostsPriorityError, type GetHostsPriorityResponse, type GetHostsResponse, type GetLinkDelayedData, type GetLinkDelayedError, type GetLinkDelayedResponse, type GetLinkInfosData, type GetLinkInfosError, type GetLinkInfosResponse, type GetLinkRedirectorData, type GetLinkRedirectorError, type GetLinkRedirectorResponse, type GetLinkStreamingData, type GetLinkStreamingError, type GetLinkStreamingResponse, type GetLinkUnlockData, type GetLinkUnlockError, type GetLinkUnlockResponse, type GetMagnetDeleteData, type GetMagnetDeleteError, type GetMagnetDeleteResponse, type GetMagnetInstantData, type GetMagnetInstantError, type GetMagnetInstantResponse, type GetMagnetRestartData, type GetMagnetRestartError, type GetMagnetRestartResponse, type GetMagnetStatusData, type GetMagnetStatusError, type GetMagnetStatusResponse, type GetMagnetUploadData, type GetMagnetUploadError, type GetMagnetUploadResponse, type GetUserData, type GetUserError, type GetUserHistoryData, type GetUserHistoryDeleteData, type GetUserHistoryDeleteError, type GetUserHistoryDeleteResponse, type GetUserHistoryError, type GetUserHistoryResponse, type GetUserHostsData, type GetUserHostsError, type GetUserHostsResponse, type GetUserLinksData, type GetUserLinksDeleteData, type GetUserLinksDeleteError, type GetUserLinksDeleteResponse, type GetUserLinksError, type GetUserLinksResponse, type GetUserLinksSaveData, type GetUserLinksSaveError, type GetUserLinksSaveResponse, type GetUserNotificationClearData, type GetUserNotificationClearError, type GetUserNotificationClearResponse, type GetUserResponse, HostResource, LinkError, LinkResource, MagnetError, MagnetResource, NetworkError, type PollOptions, type PostMagnetUploadFileData, type PostMagnetUploadFileError, type PostMagnetUploadFileResponse, UserResource, type WatchOptions, createTypedError };
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 };