@adbjs/sdk 0.1.1 → 1.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
165
  * const info = await client.link.infos('https://example.com/file.zip')
196
166
  * console.log(info)
167
+ *
168
+ * // With password
169
+ * const protectedInfo = 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<LinkInfoItem[] | undefined>;
206
176
  /**
207
177
  * Extract links from redirectors/link protectors
208
178
  *
@@ -218,6 +188,7 @@ declare class LinkResource extends BaseResource {
218
188
  * Unlock a download link
219
189
  *
220
190
  * @param link - The link to unlock
191
+ * @param password - Optional password for password-protected links
221
192
  *
222
193
  * @example
223
194
  * ```ts
@@ -228,28 +199,15 @@ declare class LinkResource extends BaseResource {
228
199
  * // Handle delayed generation
229
200
  * const delayedResult = await client.link.delayed(result.delayed)
230
201
  * }
202
+ *
203
+ * // With password
204
+ * const protectedResult = await client.link.unlock(
205
+ * 'https://example.com/protected.zip',
206
+ * 'mypassword'
207
+ * )
231
208
  * ```
232
209
  */
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>;
210
+ unlock(link: string, password?: string): Promise<UnlockLinkResponseData | undefined>;
253
211
  /**
254
212
  * Unlock a link and automatically poll if delayed
255
213
  * Note: The API response format doesn't include a delayed field in the current OpenAPI spec.
@@ -264,26 +222,7 @@ declare class LinkResource extends BaseResource {
264
222
  * console.log('Direct link:', result.link)
265
223
  * ```
266
224
  */
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>;
225
+ unlockWithPolling(link: string, _options?: PollOptions): Promise<UnlockLinkResponseData | undefined>;
287
226
  /**
288
227
  * Get streaming options for a generated link
289
228
  *
@@ -294,26 +233,7 @@ declare class LinkResource extends BaseResource {
294
233
  * const streams = await client.link.streaming('abc123')
295
234
  * ```
296
235
  */
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>;
236
+ streaming(id: string, stream: string): Promise<StreamingResponseData | undefined>;
317
237
  /**
318
238
  * Get the status/result of a delayed link generation
319
239
  *
@@ -324,13 +244,24 @@ declare class LinkResource extends BaseResource {
324
244
  * const result = await client.link.delayed('delayed_id_123')
325
245
  * ```
326
246
  */
327
- delayed(id: string): Promise<{
328
- status?: number;
329
- time_left?: number;
330
- link?: string;
331
- } | undefined>;
247
+ delayed(id: number): Promise<DelayedStatusResponseData | undefined>;
332
248
  }
333
249
 
250
+ /**
251
+ * Options for live mode status polling
252
+ */
253
+ interface LiveStatusOptions {
254
+ /**
255
+ * Session ID - Generate a random number and keep it consistent for the entire session
256
+ * @example Math.floor(Math.random() * 1000000)
257
+ */
258
+ session: number;
259
+ /**
260
+ * Counter for synchronization - Start at 0 and increment with each call
261
+ * The API will return the next counter value to use
262
+ */
263
+ counter: number;
264
+ }
334
265
  /**
335
266
  * Options for watching magnet status
336
267
  */
@@ -354,6 +285,12 @@ interface WatchOptions {
354
285
  * @default 'Ready'
355
286
  */
356
287
  stopOnStatus?: string;
288
+ /**
289
+ * Use live mode for reduced bandwidth (delta sync)
290
+ * When enabled, only changes are transmitted instead of full status
291
+ * @default false
292
+ */
293
+ useLiveMode?: boolean;
357
294
  }
358
295
  /**
359
296
  * Magnet/Torrent resource for managing torrent downloads
@@ -370,20 +307,7 @@ declare class MagnetResource extends BaseResource {
370
307
  * console.log('Magnet ID:', result.magnets[0].id)
371
308
  * ```
372
309
  */
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>;
310
+ upload(magnets: string | string[]): Promise<MagnetUploadResponseData | undefined>;
387
311
  /**
388
312
  * Upload a torrent file
389
313
  *
@@ -400,150 +324,255 @@ declare class MagnetResource extends BaseResource {
400
324
  * const result = await client.magnet.uploadFile(blob, 'my-torrent.torrent')
401
325
  * ```
402
326
  */
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
327
+ uploadFile(file: Blob | File, filename?: string): Promise<TorrentFileUploadResponseData | undefined>;
328
+ /**
329
+ * Get the status of a specific magnet by ID
330
+ *
331
+ * @param id - Magnet ID to get status for
421
332
  *
422
333
  * @example
423
334
  * ```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')
335
+ * const status = await client.magnet.status(123)
429
336
  * console.log(status.magnets[0]?.status) // 'Downloading', 'Ready', etc.
430
337
  * ```
338
+ *
339
+ * @remarks
340
+ * This endpoint uses AllDebrid API v4.1 (POST method)
341
+ * Migrated from v4 GET endpoint which was deprecated on 2024-10-16
342
+ */
343
+ status(id: number): Promise<MagnetStatusResponseData | undefined>;
344
+ /**
345
+ * Get list of magnets with optional status filter
346
+ *
347
+ * @param statusFilter - Optional filter by status: 'active', 'ready', 'expired', or 'error'
348
+ *
349
+ * @example
350
+ * ```ts
351
+ * // Get all magnets
352
+ * const allMagnets = await client.magnet.statusList()
353
+ *
354
+ * // Get only active magnets
355
+ * const activeMagnets = await client.magnet.statusList('active')
356
+ *
357
+ * // Get only ready magnets
358
+ * const readyMagnets = await client.magnet.statusList('ready')
359
+ * ```
360
+ *
361
+ * @remarks
362
+ * This endpoint uses AllDebrid API v4.1 (POST method)
363
+ */
364
+ statusList(statusFilter?: 'active' | 'ready' | 'expired' | 'error'): Promise<MagnetStatusResponseData | undefined>;
365
+ /**
366
+ * Get magnet status using live mode for reduced bandwidth consumption
367
+ *
368
+ * Live mode uses delta synchronization - only changes since the last call are transmitted.
369
+ * On the first call (counter=0), all data is returned with `fullsync: true`.
370
+ * Subsequent calls return only modifications.
371
+ *
372
+ * @param options - Live mode options
373
+ * @param options.session - Session ID (generate once per session and reuse)
374
+ * @param options.counter - Synchronization counter (start at 0, use returned counter for next call)
375
+ * @param id - Optional magnet ID to filter a specific magnet
376
+ *
377
+ * @example
378
+ * ```ts
379
+ * // Initialize session
380
+ * const session = Math.floor(Math.random() * 1000000)
381
+ * let counter = 0
382
+ *
383
+ * // First call - full sync
384
+ * const firstCall = await client.magnet.statusLive({ session, counter })
385
+ * console.log('Full sync:', firstCall.fullsync) // true
386
+ * console.log('All magnets:', firstCall.magnets)
387
+ *
388
+ * // Update counter with value returned by API
389
+ * counter = firstCall.counter
390
+ *
391
+ * // Second call - only changes
392
+ * const secondCall = await client.magnet.statusLive({ session, counter })
393
+ * console.log('Delta sync:', secondCall.magnets) // Only modified magnets
394
+ *
395
+ * // Filter specific magnet in live mode
396
+ * const magnetLive = await client.magnet.statusLive({ session, counter }, 123)
397
+ * ```
398
+ *
399
+ * @remarks
400
+ * This is ideal for real-time dashboards or frequent polling scenarios
401
+ * as it significantly reduces bandwidth usage by transmitting only changes.
431
402
  */
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>;
403
+ statusLive(options: LiveStatusOptions, id?: number): Promise<MagnetStatusResponseData | undefined>;
453
404
  /**
454
405
  * Delete a magnet
455
406
  *
456
- * @param id - The magnet ID to delete (string)
407
+ * @param id - The magnet ID to delete
457
408
  *
458
409
  * @example
459
410
  * ```ts
460
- * await client.magnet.delete('123')
411
+ * await client.magnet.delete(123)
461
412
  * ```
462
413
  */
463
- delete(id: string): Promise<{
464
- message?: string;
465
- } | undefined>;
414
+ delete(id: number): Promise<MessageResponseData | undefined>;
466
415
  /**
467
416
  * Restart one or more failed magnets
468
417
  *
469
- * @param ids - Single magnet ID or array of magnet IDs to restart (strings)
418
+ * @param ids - Single magnet ID or array of magnet IDs to restart (numbers)
470
419
  *
471
420
  * @example
472
421
  * ```ts
473
422
  * // Restart single magnet
474
- * await client.magnet.restart('123')
423
+ * await client.magnet.restart(123)
475
424
  *
476
425
  * // Restart multiple magnets
477
- * await client.magnet.restart(['123', '456'])
426
+ * await client.magnet.restart([123, 456])
478
427
  * ```
479
428
  */
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>;
429
+ restart(ids: number | number[]): Promise<MessageResponseData | undefined>;
490
430
  /**
491
- * Check instant availability of magnets
431
+ * Get files for a completed magnet
492
432
  *
493
- * @param magnets - Single magnet hash or array of hashes
433
+ * @param ids - The magnet ID or IDs to get files for
494
434
  *
495
435
  * @example
496
436
  * ```ts
497
- * const available = await client.magnet.instant(['hash1', 'hash2'])
498
- * console.log(available.magnets)
437
+ * const files = await client.magnet.files(123)
438
+ * files?.forEach(file => {
439
+ * console.log(file.filename, file.link)
440
+ * })
499
441
  * ```
442
+ *
443
+ * @remarks
444
+ * Files are now retrieved separately from magnet status (since v4.1)
445
+ * Only available for magnets with status 'Ready'
500
446
  */
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>;
447
+ files(ids: number | number[]): Promise<MagnetFilesItem[] | undefined>;
512
448
  /**
513
449
  * Watch a magnet's status with automatic polling
514
450
  *
515
- * @param id - The magnet ID to watch (string)
451
+ * @param id - The magnet ID to watch
516
452
  * @param options - Watch options
453
+ * @param options.interval - Polling interval in milliseconds (default: 3000)
454
+ * @param options.maxAttempts - Maximum polling attempts, 0 for infinite (default: 0)
455
+ * @param options.onUpdate - Callback called on each status update
456
+ * @param options.stopOnStatus - Stop when magnet reaches this status (default: 'Ready')
457
+ * @param options.useLiveMode - Use live mode for reduced bandwidth (default: false)
517
458
  *
518
459
  * @example
519
460
  * ```ts
520
- * await client.magnet.watch('123', {
461
+ * // Standard mode
462
+ * await client.magnet.watch(123, {
521
463
  * onUpdate: (status) => console.log('Status:', status.magnets[0]?.status),
522
464
  * stopOnStatus: 'Ready'
523
465
  * })
466
+ *
467
+ * // Live mode for reduced bandwidth
468
+ * await client.magnet.watch(123, {
469
+ * useLiveMode: true,
470
+ * interval: 2000,
471
+ * onUpdate: (status) => console.log('Update:', status)
472
+ * })
524
473
  * ```
525
474
  */
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>;
475
+ watch(id: number, options?: WatchOptions): Promise<MagnetStatusResponseData | undefined>;
476
+ }
477
+
478
+ /**
479
+ * Pin resource for PIN-based authentication flow
480
+ *
481
+ * The PIN flow allows users to authenticate without directly providing their API key.
482
+ * This is useful for applications where you want users to authorize access through
483
+ * the AllDebrid website.
484
+ */
485
+ declare class PinResource extends BaseResource {
486
+ /**
487
+ * Generate a new PIN code for authentication
488
+ *
489
+ * This initiates the PIN authentication flow. The user should visit the
490
+ * returned URL to authorize the application.
491
+ *
492
+ * @example
493
+ * ```ts
494
+ * const pinData = await client.pin.generate()
495
+ * console.log('Visit:', pinData.user_url)
496
+ * console.log('PIN:', pinData.pin)
497
+ *
498
+ * // Poll the check endpoint until user authorizes
499
+ * const auth = await client.pin.check(pinData.check, pinData.pin)
500
+ * if (auth.activated) {
501
+ * console.log('API Key:', auth.apikey)
502
+ * }
503
+ * ```
504
+ *
505
+ * @returns PIN code and authorization URL
506
+ */
507
+ generate(): Promise<PinGetResponseData | undefined>;
508
+ /**
509
+ * Check the status of a PIN authentication
510
+ *
511
+ * Poll this endpoint to check if the user has authorized the application.
512
+ * Once authorized, the response will include the API key.
513
+ *
514
+ * @param check - Check ID from /pin/get
515
+ * @param pin - PIN code from /pin/get
516
+ *
517
+ * @example
518
+ * ```ts
519
+ * const pinData = await client.pin.generate()
520
+ *
521
+ * // Poll every few seconds until activated
522
+ * const checkStatus = async () => {
523
+ * const result = await client.pin.check(pinData.check, pinData.pin)
524
+ * if (result?.activated && result?.apikey) {
525
+ * console.log('Authorized! API Key:', result.apikey)
526
+ * return result.apikey
527
+ * }
528
+ * // Wait and try again
529
+ * await new Promise(resolve => setTimeout(resolve, 3000))
530
+ * return checkStatus()
531
+ * }
532
+ *
533
+ * const apikey = await checkStatus()
534
+ * ```
535
+ *
536
+ * @returns Authorization status and API key (if activated)
537
+ */
538
+ check(check: string, pin: string): Promise<PinCheckResponseData | undefined>;
539
+ /**
540
+ * Helper method to wait for PIN authorization with automatic polling
541
+ *
542
+ * This method handles the polling logic for you, making it easier to
543
+ * implement the PIN authentication flow.
544
+ *
545
+ * @param check - Check ID from /pin/get
546
+ * @param pin - PIN code from /pin/get
547
+ * @param options - Polling options
548
+ * @param options.timeout - Maximum time to wait in milliseconds (default: 600000 = 10 minutes)
549
+ * @param options.interval - Polling interval in milliseconds (default: 3000 = 3 seconds)
550
+ *
551
+ * @example
552
+ * ```ts
553
+ * const pinData = await client.pin.generate()
554
+ * console.log('Visit:', pinData.user_url)
555
+ *
556
+ * try {
557
+ * const apikey = await client.pin.waitForAuth(pinData.check, pinData.pin, {
558
+ * timeout: 600000, // 10 minutes
559
+ * interval: 3000, // Check every 3 seconds
560
+ * })
561
+ * console.log('Authorized! API Key:', apikey)
562
+ * } catch (error) {
563
+ * console.error('Authorization timed out or failed')
564
+ * }
565
+ * ```
566
+ *
567
+ * @returns The API key once authorized
568
+ * @throws Error if timeout is reached or authorization fails
569
+ */
570
+ waitForAuth(check: string, pin: string, options?: {
571
+ /** Maximum time to wait in milliseconds (default: 600000 = 10 minutes) */
572
+ timeout?: number;
573
+ /** Polling interval in milliseconds (default: 3000 = 3 seconds) */
574
+ interval?: number;
575
+ }): Promise<string>;
547
576
  }
548
577
 
549
578
  /**
@@ -559,21 +588,7 @@ declare class UserResource extends BaseResource {
559
588
  * console.log(user.username, user.isPremium)
560
589
  * ```
561
590
  */
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>;
591
+ getInfo(): Promise<UserInfo | undefined>;
577
592
  /**
578
593
  * Get available hosts for the current user based on their subscription
579
594
  *
@@ -585,38 +600,7 @@ declare class UserResource extends BaseResource {
585
600
  * console.log(Object.keys(hosts.hosts))
586
601
  * ```
587
602
  */
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>;
603
+ getHosts(hostOnly?: boolean): Promise<UserHostsResponseData | undefined>;
620
604
  /**
621
605
  * Clear a specific notification by code
622
606
  *
@@ -637,41 +621,49 @@ declare class UserResource extends BaseResource {
637
621
  * console.log(savedLinks.links)
638
622
  * ```
639
623
  */
640
- getLinks(): Promise<{
641
- links?: Array<{
642
- link?: string;
643
- filename?: string;
644
- size?: number;
645
- date?: number;
646
- host?: string;
647
- }>;
648
- } | undefined>;
624
+ getLinks(): Promise<SavedLinksResponseData | undefined>;
649
625
  /**
650
- * Save a link for later use
626
+ * Save one or multiple links for later use
627
+ *
628
+ * Supports batch operations - you can save multiple links in a single request.
651
629
  *
652
- * @param link - The link to save
630
+ * @param links - Single link or array of links to save
653
631
  *
654
632
  * @example
655
633
  * ```ts
634
+ * // Save single link
656
635
  * await client.user.saveLink('https://example.com/file.zip')
636
+ *
637
+ * // Save multiple links at once
638
+ * await client.user.saveLink([
639
+ * 'https://example.com/file1.zip',
640
+ * 'https://example.com/file2.zip',
641
+ * 'https://example.com/file3.zip'
642
+ * ])
657
643
  * ```
658
644
  */
659
- saveLink(link: string): Promise<{
660
- message?: string;
661
- } | undefined>;
645
+ saveLink(links: string | string[]): Promise<MessageResponseData | undefined>;
662
646
  /**
663
- * Delete a saved link
647
+ * Delete one or multiple saved links
664
648
  *
665
- * @param link - The link to delete (can be the saved link ID or URL)
649
+ * Supports batch operations - you can delete multiple links in a single request.
650
+ *
651
+ * @param links - Single link or array of links to delete (can be saved link IDs or URLs)
666
652
  *
667
653
  * @example
668
654
  * ```ts
655
+ * // Delete single link
669
656
  * await client.user.deleteLink('saved-link-id')
657
+ *
658
+ * // Delete multiple links at once
659
+ * await client.user.deleteLink([
660
+ * 'saved-link-id-1',
661
+ * 'saved-link-id-2',
662
+ * 'saved-link-id-3'
663
+ * ])
670
664
  * ```
671
665
  */
672
- deleteLink(link: string): Promise<{
673
- message?: string;
674
- } | undefined>;
666
+ deleteLink(links: string | string[]): Promise<MessageResponseData | undefined>;
675
667
  /**
676
668
  * Get user history (if enabled in account settings)
677
669
  *
@@ -681,15 +673,7 @@ declare class UserResource extends BaseResource {
681
673
  * console.log(history.links)
682
674
  * ```
683
675
  */
684
- getHistory(): Promise<{
685
- links?: Array<{
686
- link?: string;
687
- filename?: string;
688
- size?: number;
689
- date?: number;
690
- host?: string;
691
- }>;
692
- } | undefined>;
676
+ getHistory(): Promise<SavedLinksResponseData | undefined>;
693
677
  /**
694
678
  * Clear user history
695
679
  *
@@ -698,9 +682,96 @@ declare class UserResource extends BaseResource {
698
682
  * await client.user.clearHistory()
699
683
  * ```
700
684
  */
701
- clearHistory(): Promise<{
702
- message?: string;
703
- } | undefined>;
685
+ clearHistory(): Promise<MessageResponseData | undefined>;
686
+ /**
687
+ * Check email verification status
688
+ *
689
+ * @param token - Verification token
690
+ *
691
+ * @example
692
+ * ```ts
693
+ * const status = await client.user.getVerificationStatus('verification-token')
694
+ * console.log(status.verif) // 'waiting', 'allowed', or 'denied'
695
+ * ```
696
+ */
697
+ getVerificationStatus(token: string): Promise<VerifStatusResponseData | undefined>;
698
+ /**
699
+ * Resend verification email
700
+ *
701
+ * @param token - Verification token
702
+ *
703
+ * @example
704
+ * ```ts
705
+ * await client.user.resendVerification('verification-token')
706
+ * ```
707
+ */
708
+ resendVerification(token: string): Promise<ResendVerifResponseData | undefined>;
709
+ }
710
+
711
+ /**
712
+ * Voucher resource for reseller voucher management
713
+ *
714
+ * Note: These endpoints are only available for reseller accounts.
715
+ */
716
+ declare class VoucherResource extends BaseResource {
717
+ /**
718
+ * Get voucher balance for reseller accounts
719
+ *
720
+ * This endpoint allows resellers to check their remaining voucher balance.
721
+ * Only available for accounts with reseller privileges.
722
+ *
723
+ * @example
724
+ * ```ts
725
+ * const balance = await client.voucher.getBalance()
726
+ * console.log('Remaining balance:', balance.balance, '€')
727
+ * ```
728
+ *
729
+ * @returns Voucher balance information
730
+ */
731
+ getBalance(): Promise<VoucherBalanceResponseData | undefined>;
732
+ /**
733
+ * Retrieve existing vouchers from reseller inventory
734
+ *
735
+ * This endpoint retrieves vouchers that were previously generated
736
+ * and are available in your inventory.
737
+ *
738
+ * @param quantity - Optional number of vouchers to retrieve
739
+ *
740
+ * @example
741
+ * ```ts
742
+ * // Get all available vouchers
743
+ * const allVouchers = await client.voucher.getVouchers()
744
+ * console.log('Vouchers:', allVouchers?.codes)
745
+ *
746
+ * // Get specific quantity
747
+ * const fiveVouchers = await client.voucher.getVouchers(5)
748
+ * ```
749
+ *
750
+ * @returns List of voucher codes
751
+ */
752
+ getVouchers(quantity?: number): Promise<VoucherGetResponseData | undefined>;
753
+ /**
754
+ * Generate new vouchers (deducts from reseller balance)
755
+ *
756
+ * This endpoint creates new vouchers and deducts the cost from your
757
+ * reseller account balance.
758
+ *
759
+ * @param quantity - Number of vouchers to generate
760
+ * @param duration - Voucher duration in days
761
+ *
762
+ * @example
763
+ * ```ts
764
+ * // Generate 10 vouchers valid for 30 days
765
+ * const vouchers = await client.voucher.generateVouchers(10, 30)
766
+ * console.log('Generated vouchers:', vouchers?.codes)
767
+ *
768
+ * // Generate 5 vouchers valid for 7 days
769
+ * const weekVouchers = await client.voucher.generateVouchers(5, 7)
770
+ * ```
771
+ *
772
+ * @returns List of newly generated voucher codes
773
+ */
774
+ generateVouchers(quantity: number, duration: number): Promise<VoucherGenerateResponseData | undefined>;
704
775
  }
705
776
 
706
777
  /**
@@ -724,6 +795,14 @@ declare class AllDebridClient {
724
795
  * Host resource for getting information about supported hosts
725
796
  */
726
797
  readonly host: HostResource;
798
+ /**
799
+ * Pin resource for PIN-based authentication
800
+ */
801
+ readonly pin: PinResource;
802
+ /**
803
+ * Voucher resource for reseller voucher management
804
+ */
805
+ readonly voucher: VoucherResource;
727
806
  constructor(config: AllDebridConfig);
728
807
  /**
729
808
  * Build query string from params
@@ -731,26 +810,48 @@ declare class AllDebridClient {
731
810
  private buildUrl;
732
811
  /**
733
812
  * Make a GET request
734
- * @param T - The generated response type (e.g., GetLinkUnlockResponse)
813
+ * @template T - The generated response type (e.g., GetLinkUnlockResponse)
814
+ * @param path - API endpoint path
815
+ * @param params - Optional query parameters
735
816
  * @returns The extracted data from the response (without the { status, data } wrapper)
817
+ * @internal
736
818
  */
737
- protected get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
819
+ get<T>(path: string, params?: Record<string, unknown>): Promise<ExtractData<T>>;
738
820
  /**
739
- * Make a POST request
740
- * @param T - The generated response type
821
+ * Make a POST request with application/x-www-form-urlencoded
822
+ * @template T - The generated response type
823
+ * @param path - API endpoint path
824
+ * @param body - Request body (will be converted to URLSearchParams)
825
+ * @param params - Optional query parameters
741
826
  * @returns The extracted data from the response (without the { status, data } wrapper)
827
+ * @internal
742
828
  */
743
- protected post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
829
+ post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<ExtractData<T>>;
744
830
  /**
745
831
  * Make a POST request with FormData (multipart/form-data)
746
- * @param T - The generated response type
832
+ * @template T - The generated response type
833
+ * @param path - API endpoint path
834
+ * @param formData - Form data to send
835
+ * @param params - Optional query parameters
747
836
  * @returns The extracted data from the response (without the { status, data } wrapper)
837
+ * @internal
748
838
  */
749
- protected postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
839
+ postFormData<T>(path: string, formData: FormData, params?: Record<string, unknown>): Promise<ExtractData<T>>;
750
840
  /**
751
841
  * Test the API connection
842
+ *
843
+ * This endpoint doesn't require authentication and can be used to verify
844
+ * that the AllDebrid API is reachable.
845
+ *
846
+ * @example
847
+ * ```ts
848
+ * const result = await client.ping()
849
+ * console.log(result.ping) // 'pong'
850
+ * ```
851
+ *
852
+ * @returns Ping response with 'pong' message
752
853
  */
753
- ping(): Promise<boolean>;
854
+ ping(): Promise<PingResponseData | undefined>;
754
855
  }
755
856
 
756
857
  /**
@@ -796,799 +897,509 @@ declare class NetworkError extends AllDebridError {
796
897
  declare function createTypedError(code: string, message: string): AllDebridError;
797
898
 
798
899
  /**
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 />
900
+ * Liste exhaustive des codes d'erreur AllDebrid (janvier 2026)
800
901
  */
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
- };
902
+ 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';
903
+ type ApiErrorResponse = {
904
+ status: 'error';
905
+ error: ErrorDetail;
813
906
  };
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;
907
+ type status = 'error';
908
+ type ApiSuccessResponseBase = {
909
+ status: 'success';
910
+ demo?: boolean;
911
+ deprecated?: boolean;
912
+ };
913
+ type status2 = 'success';
914
+ type ClearNotificationResponseData = {
915
+ message?: string;
916
+ };
917
+ type DelayedStatusResponseData = {
918
+ /**
919
+ * 1 = processing, 2 = ready, 3 = error
920
+ */
921
+ status?: number;
922
+ time_left?: number;
923
+ link?: string;
924
+ };
925
+ type ErrorDetail = {
926
+ code: AllDebridErrorCode;
927
+ message: string;
928
+ };
929
+ type HostDetail = {
930
+ name?: string;
931
+ type?: 'premium' | 'free';
932
+ domains?: Array<(string)>;
933
+ regexp?: string;
934
+ regexps?: Array<(string)>;
935
+ status?: boolean;
936
+ quota?: number;
937
+ quotaMax?: number;
938
+ quotaType?: 'traffic' | 'nb_download';
939
+ limitSimuDl?: number;
940
+ };
941
+ type type = 'premium' | 'free';
942
+ type quotaType = 'traffic' | 'nb_download';
943
+ type HostsDomainsResponseData = {
944
+ hosts?: Array<(string)>;
945
+ streams?: Array<(string)>;
946
+ redirectors?: Array<(string)>;
947
+ };
948
+ type HostsPriorityResponseData = {
949
+ hosts?: {
950
+ [key: string]: (number);
860
951
  };
861
952
  };
862
- type GetHostsDomainsResponse = ({
863
- status?: string;
864
- data?: {
865
- hosts?: Array<(string)>;
866
- streams?: Array<(string)>;
867
- redirectors?: Array<(string)>;
953
+ type HostsResponseData = {
954
+ hosts?: {
955
+ [key: string]: HostDetail;
868
956
  };
869
- error?: {
870
- code?: string;
871
- message?: string;
957
+ streams?: {
958
+ [key: string]: HostDetail;
872
959
  };
873
- });
874
- type GetHostsDomainsError = unknown;
875
- type GetHostsPriorityData = {
876
- query: {
877
- /**
878
- * Your software user-agent.
879
- */
880
- agent: string;
960
+ redirectors?: {
961
+ [key: string]: HostDetail;
881
962
  };
882
963
  };
883
- type GetHostsPriorityResponse = ({
964
+ type LinkInfoItem = {
965
+ link?: string;
966
+ filename?: string;
967
+ size?: number;
968
+ host?: string;
969
+ hostDomain?: string;
970
+ error?: ErrorDetail;
971
+ };
972
+ type LinkInfosResponseData = {
973
+ infos?: Array<LinkInfoItem>;
974
+ };
975
+ type MagnetFile = {
976
+ n?: string;
977
+ s?: number;
978
+ l?: Array<(string)>;
979
+ e?: Array<MagnetFile>;
980
+ };
981
+ type MagnetFilesItem = {
982
+ id?: number;
983
+ files?: Array<MagnetFile>;
984
+ error?: ErrorDetail;
985
+ };
986
+ type MagnetFilesResponseData = {
987
+ magnets?: Array<MagnetFilesItem>;
988
+ };
989
+ type MagnetStatusItem = {
990
+ id?: number;
991
+ filename?: string;
992
+ size?: number;
884
993
  status?: string;
885
- data?: {
886
- hosts?: {
887
- [key: string]: (number);
888
- };
889
- };
890
- error?: {
891
- code?: string;
892
- message?: string;
994
+ statusCode?: number;
995
+ downloaded?: number;
996
+ uploaded?: number;
997
+ downloadSpeed?: number;
998
+ uploadSpeed?: number;
999
+ seeders?: number;
1000
+ files?: Array<MagnetFile>;
1001
+ };
1002
+ type MagnetStatusResponseData = {
1003
+ magnets?: Array<MagnetStatusItem>;
1004
+ counter?: number;
1005
+ fullsync?: boolean;
1006
+ };
1007
+ type MagnetUploadItem = {
1008
+ magnet?: string;
1009
+ hash?: string;
1010
+ name?: string;
1011
+ size?: number;
1012
+ ready?: boolean;
1013
+ id?: number;
1014
+ error?: ErrorDetail;
1015
+ };
1016
+ type MagnetUploadResponseData = {
1017
+ magnets?: Array<MagnetUploadItem>;
1018
+ };
1019
+ type MessageResponseData = {
1020
+ message?: string;
1021
+ };
1022
+ type PinCheckResponseData = {
1023
+ activated: boolean;
1024
+ expires_in: number;
1025
+ apikey?: string;
1026
+ };
1027
+ type PinGetResponseData = {
1028
+ pin: string;
1029
+ check: string;
1030
+ expires_in: number;
1031
+ user_url?: string;
1032
+ base_url?: string;
1033
+ };
1034
+ type PingResponseData = {
1035
+ ping?: string;
1036
+ };
1037
+ type RedirectorResponseData = {
1038
+ links?: Array<(string)>;
1039
+ };
1040
+ type ResendVerifResponseData = {
1041
+ sent?: boolean;
1042
+ };
1043
+ type SavedLink = {
1044
+ link?: string;
1045
+ filename?: string;
1046
+ size?: number;
1047
+ date?: number;
1048
+ host?: string;
1049
+ };
1050
+ type SavedLinksResponseData = {
1051
+ links?: Array<SavedLink>;
1052
+ };
1053
+ type StreamingResponseData = {
1054
+ link?: string;
1055
+ filename?: string;
1056
+ filesize?: number;
1057
+ delayed?: number;
1058
+ };
1059
+ type TorrentFileUploadItem = {
1060
+ /**
1061
+ * Nom du fichier uploadé
1062
+ */
1063
+ file?: string;
1064
+ /**
1065
+ * Nom du torrent détecté
1066
+ */
1067
+ name?: string;
1068
+ size?: number;
1069
+ hash?: string;
1070
+ ready?: boolean;
1071
+ id?: number;
1072
+ error?: ErrorDetail;
1073
+ };
1074
+ type TorrentFileUploadResponseData = {
1075
+ files?: Array<TorrentFileUploadItem>;
1076
+ };
1077
+ type UnlockLinkResponseData = {
1078
+ link?: string;
1079
+ filename?: string;
1080
+ filesize?: number;
1081
+ host?: string;
1082
+ hostDomain?: string;
1083
+ paws?: boolean;
1084
+ streams?: Array<{
1085
+ [key: string]: unknown;
1086
+ }>;
1087
+ id?: string;
1088
+ delayed?: number;
1089
+ };
1090
+ type UserHostsResponseData = {
1091
+ hosts?: {
1092
+ [key: string]: HostDetail;
893
1093
  };
894
- });
895
- type GetHostsPriorityError = unknown;
896
- type GetUserData = {
1094
+ };
1095
+ type UserInfo = {
1096
+ username?: string;
1097
+ email?: string;
1098
+ isPremium?: boolean;
1099
+ isSubscribed?: boolean;
1100
+ isTrial?: boolean;
1101
+ premiumUntil?: number;
1102
+ lang?: string;
1103
+ preferedDomain?: string;
1104
+ fidelityPoints?: number;
1105
+ limitedHostersQuotas?: {
1106
+ [key: string]: (number);
1107
+ };
1108
+ remainingTrialQuota?: number;
1109
+ notifications?: Array<(string)>;
1110
+ };
1111
+ type UserResponseData = {
1112
+ user?: UserInfo;
1113
+ };
1114
+ type VerifStatusResponseData = {
1115
+ verif?: 'waiting' | 'allowed' | 'denied';
1116
+ resendable?: boolean;
1117
+ apikey?: string;
1118
+ };
1119
+ type verif = 'waiting' | 'allowed' | 'denied';
1120
+ type VoucherBalanceResponseData = {
1121
+ balance?: number;
1122
+ };
1123
+ type VoucherGenerateResponseData = {
1124
+ /**
1125
+ * Liste des codes vouchers générés
1126
+ */
1127
+ codes?: Array<(string)>;
1128
+ /**
1129
+ * Prix unitaire du voucher
1130
+ */
1131
+ pricePerVoucher?: number;
1132
+ /**
1133
+ * Montant total débité
1134
+ */
1135
+ total?: number;
1136
+ /**
1137
+ * Nouveau solde après génération
1138
+ */
1139
+ balance?: number;
1140
+ };
1141
+ type VoucherGetResponseData = {
1142
+ /**
1143
+ * Liste des codes vouchers disponibles
1144
+ */
1145
+ codes?: Array<(string)>;
1146
+ /**
1147
+ * True si la liste est partielle (pas assez de vouchers pré-générés disponibles)
1148
+ */
1149
+ partialList?: boolean;
1150
+ };
1151
+ type PingResponse = ((ApiSuccessResponseBase & {
1152
+ data?: PingResponseData;
1153
+ }));
1154
+ type PingError = unknown;
1155
+ type GetPinResponse = ((ApiSuccessResponseBase & {
1156
+ data?: PinGetResponseData;
1157
+ }));
1158
+ type GetPinError = unknown;
1159
+ type CheckPinData = {
897
1160
  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;
1161
+ check: string;
1162
+ pin: string;
906
1163
  };
907
1164
  };
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;
1165
+ type CheckPinResponse = ((ApiSuccessResponseBase & {
1166
+ data?: PinCheckResponseData;
1167
+ }));
1168
+ type CheckPinError = unknown;
1169
+ type GetHostsData = {
1170
+ query?: {
1171
+ hostsOnly?: boolean;
930
1172
  };
931
- });
1173
+ };
1174
+ type GetHostsResponse = ((ApiSuccessResponseBase & {
1175
+ data?: HostsResponseData;
1176
+ }));
1177
+ type GetHostsError = unknown;
1178
+ type GetHostDomainsResponse = ((ApiSuccessResponseBase & {
1179
+ data?: HostsDomainsResponseData;
1180
+ }));
1181
+ type GetHostDomainsError = unknown;
1182
+ type GetHostPriorityResponse = ((ApiSuccessResponseBase & {
1183
+ data?: HostsPriorityResponseData;
1184
+ }));
1185
+ type GetHostPriorityError = unknown;
1186
+ type GetUserResponse = ((ApiSuccessResponseBase & {
1187
+ data?: UserResponseData;
1188
+ }));
932
1189
  type GetUserError = unknown;
933
- type GetUserHostsData = {
1190
+ type GetUserHostsResponse = ((ApiSuccessResponseBase & {
1191
+ data?: UserHostsResponseData;
1192
+ }));
1193
+ type GetUserHostsError = unknown;
1194
+ type GetVerifStatusData = {
934
1195
  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;
1196
+ token: string;
947
1197
  };
948
1198
  };
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;
1199
+ type GetVerifStatusResponse = ((ApiSuccessResponseBase & {
1200
+ data?: VerifStatusResponseData;
1201
+ }));
1202
+ type GetVerifStatusError = unknown;
1203
+ type ResendVerifData = {
1204
+ query: {
1205
+ token: string;
986
1206
  };
987
- });
988
- type GetUserHostsError = unknown;
989
- type GetUserNotificationClearData = {
1207
+ };
1208
+ type ResendVerifResponse = ((ApiSuccessResponseBase & {
1209
+ data?: ResendVerifResponseData;
1210
+ }));
1211
+ type ResendVerifError = unknown;
1212
+ type ClearNotificationData = {
990
1213
  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
1214
  code: string;
1003
1215
  };
1004
1216
  };
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;
1217
+ type ClearNotificationResponse = ((ApiSuccessResponseBase & {
1218
+ data?: ClearNotificationResponseData;
1219
+ }));
1220
+ type ClearNotificationError = unknown;
1016
1221
  type GetLinkInfosData = {
1017
1222
  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
1223
  'link[]': Array<(string)>;
1030
- /**
1031
- * Link password (supported on uptobox / 1fichier).
1032
- */
1033
1224
  password?: string;
1034
1225
  };
1035
1226
  };
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
- });
1227
+ type GetLinkInfosResponse = ((ApiSuccessResponseBase & {
1228
+ data?: LinkInfosResponseData;
1229
+ }));
1070
1230
  type GetLinkInfosError = unknown;
1071
- type GetLinkRedirectorData = {
1231
+ type GetRedirectorLinksData = {
1072
1232
  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
1233
  link: string;
1085
1234
  };
1086
1235
  };
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 = {
1236
+ type GetRedirectorLinksResponse = ((ApiSuccessResponseBase & {
1237
+ data?: RedirectorResponseData;
1238
+ }));
1239
+ type GetRedirectorLinksError = unknown;
1240
+ type UnlockLinkData = {
1102
1241
  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
1242
  link: string;
1115
- /**
1116
- * Link password (supported on uptobox / 1fichier).
1117
- */
1118
1243
  password?: string;
1119
1244
  };
1120
1245
  };
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 = {
1246
+ type UnlockLinkResponse = ((ApiSuccessResponseBase & {
1247
+ data?: UnlockLinkResponseData;
1248
+ }));
1249
+ type UnlockLinkError = unknown;
1250
+ type GetStreamingLinkData = {
1150
1251
  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
1252
  id: string;
1163
- /**
1164
- * The stream ID you choosed from the stream qualities list returned by /link/unlock.
1165
- */
1166
1253
  stream: string;
1167
1254
  };
1168
1255
  };
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 = {
1256
+ type GetStreamingLinkResponse = ((ApiSuccessResponseBase & {
1257
+ data?: StreamingResponseData;
1258
+ }));
1259
+ type GetStreamingLinkError = unknown;
1260
+ type GetDelayedStatusData = {
1198
1261
  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;
1262
+ id: number;
1211
1263
  };
1212
1264
  };
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 = {
1265
+ type GetDelayedStatusResponse = ((ApiSuccessResponseBase & {
1266
+ data?: DelayedStatusResponseData;
1267
+ }));
1268
+ type GetDelayedStatusError = unknown;
1269
+ type UploadMagnetsData = {
1227
1270
  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
1271
  'magnets[]': Array<(string)>;
1240
1272
  };
1241
1273
  };
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 = {
1274
+ type UploadMagnetsResponse = ((ApiSuccessResponseBase & {
1275
+ data?: MagnetUploadResponseData;
1276
+ }));
1277
+ type UploadMagnetsError = unknown;
1278
+ type UploadTorrentFileData = {
1265
1279
  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;
1280
+ files?: Array<((Blob | File))>;
1277
1281
  };
1278
1282
  };
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;
1283
+ type UploadTorrentFileResponse = ((ApiSuccessResponseBase & {
1284
+ data?: TorrentFileUploadResponseData;
1285
+ }));
1286
+ type UploadTorrentFileError = unknown;
1301
1287
  type GetMagnetStatusData = {
1302
- query: {
1303
- /**
1304
- * Your software user-agent.
1305
- */
1306
- agent: string;
1288
+ query?: {
1307
1289
  /**
1308
- * Deprecated User apikey (Use Bearer Auth in header).
1290
+ * **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.
1309
1291
  */
1310
- apikey?: string;
1292
+ counter?: number;
1311
1293
  /**
1312
- * Counter for Live mode (see Live Mode).
1294
+ * **Standard Mode**: Get status of a specific magnet by its ID. Incompatible with Live Mode parameters.
1313
1295
  */
1314
- counter?: string;
1296
+ id?: number;
1315
1297
  /**
1316
- * Magnet ID.
1298
+ * **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.
1317
1299
  */
1318
- id?: string;
1300
+ session?: number;
1319
1301
  /**
1320
- * Session ID for Live mode (see Live Mode).
1302
+ * **Standard Mode**: Filter magnets by status. Possible values: 'active', 'ready', 'expired', 'error'. Incompatible with Live Mode parameters.
1321
1303
  */
1322
- session?: string;
1323
- /**
1324
- * Magnets status filter. Either active, ready, expired or error
1325
- */
1326
- status?: string;
1304
+ status?: 'active' | 'ready' | 'expired' | 'error';
1327
1305
  };
1328
1306
  };
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
- });
1307
+ type GetMagnetStatusResponse = ((ApiSuccessResponseBase & {
1308
+ data?: MagnetStatusResponseData;
1309
+ }));
1357
1310
  type GetMagnetStatusError = unknown;
1358
- type GetMagnetDeleteData = {
1359
- 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;
1372
- };
1373
- };
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 = {
1311
+ type GetMagnetFilesData = {
1386
1312
  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)>;
1313
+ 'id[]': Array<(number)>;
1399
1314
  };
1400
1315
  };
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 = {
1316
+ type GetMagnetFilesResponse = ((ApiSuccessResponseBase & {
1317
+ data?: MagnetFilesResponseData;
1318
+ }));
1319
+ type GetMagnetFilesError = unknown;
1320
+ type DeleteMagnetData = {
1420
1321
  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)>;
1322
+ id: number;
1433
1323
  };
1434
1324
  };
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 = {
1455
- 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;
1325
+ type DeleteMagnetResponse = ((ApiSuccessResponseBase & {
1326
+ data?: MessageResponseData;
1327
+ }));
1328
+ type DeleteMagnetError = unknown;
1329
+ type RestartMagnetData = {
1330
+ query?: {
1331
+ 'ids[]'?: Array<(number)>;
1464
1332
  };
1465
1333
  };
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 = {
1334
+ type RestartMagnetResponse = ((ApiSuccessResponseBase & {
1335
+ data?: MessageResponseData;
1336
+ }));
1337
+ type RestartMagnetError = unknown;
1338
+ type GetSavedLinksResponse = ((ApiSuccessResponseBase & {
1339
+ data?: SavedLinksResponseData;
1340
+ }));
1341
+ type GetSavedLinksError = unknown;
1342
+ type SaveLinksData = {
1484
1343
  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)>;
1344
+ 'links[]': Array<(string)>;
1497
1345
  };
1498
1346
  };
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)>;
1347
+ type SaveLinksResponse = ((ApiSuccessResponseBase & {
1348
+ data?: MessageResponseData;
1349
+ }));
1350
+ type SaveLinksError = unknown;
1351
+ type DeleteSavedLinksData = {
1352
+ query?: {
1353
+ 'links[]'?: Array<(string)>;
1528
1354
  };
1529
1355
  };
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 = {
1356
+ type DeleteSavedLinksResponse = ((ApiSuccessResponseBase & {
1357
+ data?: MessageResponseData;
1358
+ }));
1359
+ type DeleteSavedLinksError = unknown;
1360
+ type GetHistoryResponse = ((ApiSuccessResponseBase & {
1361
+ data?: SavedLinksResponseData;
1362
+ }));
1363
+ type GetHistoryError = unknown;
1364
+ type DeleteHistoryResponse = ((ApiSuccessResponseBase & {
1365
+ data?: MessageResponseData;
1366
+ }));
1367
+ type DeleteHistoryError = unknown;
1368
+ type GetVoucherBalanceResponse = ((ApiSuccessResponseBase & {
1369
+ data?: VoucherBalanceResponseData;
1370
+ }));
1371
+ type GetVoucherBalanceError = unknown;
1372
+ type GenerateVouchersData = {
1542
1373
  query: {
1543
1374
  /**
1544
- * Your software user-agent.
1375
+ * Durée du voucher en jours
1545
1376
  */
1546
- agent: string;
1377
+ duration: 15 | 30 | 90 | 180 | 365;
1547
1378
  /**
1548
- * Deprecated User apikey (Use Bearer Auth in header).
1379
+ * Nombre de vouchers à générer (1-10)
1549
1380
  */
1550
- apikey?: string;
1381
+ nb: number;
1551
1382
  };
1552
1383
  };
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 = {
1384
+ type GenerateVouchersResponse = ((ApiSuccessResponseBase & {
1385
+ data?: VoucherGenerateResponseData;
1386
+ }));
1387
+ type GenerateVouchersError = unknown;
1388
+ type GetAvailableVouchersData = {
1571
1389
  query: {
1572
1390
  /**
1573
- * Your software user-agent.
1391
+ * Durée du voucher en jours
1574
1392
  */
1575
- agent: string;
1393
+ duration: 15 | 30 | 90 | 180 | 365;
1576
1394
  /**
1577
- * Deprecated User apikey (Use Bearer Auth in header).
1395
+ * Nombre de vouchers demandés (1-10)
1578
1396
  */
1579
- apikey?: string;
1397
+ nb: number;
1580
1398
  };
1581
1399
  };
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;
1400
+ type GetAvailableVouchersResponse = ((ApiSuccessResponseBase & {
1401
+ data?: VoucherGetResponseData;
1402
+ }));
1403
+ type GetAvailableVouchersError = unknown;
1593
1404
 
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 };
1405
+ 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 };