@adbjs/sdk 2.0.2 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,252 @@
1
- import wretch from 'wretch';
1
+ // ../../node_modules/.bun/wretch@3.0.6/node_modules/wretch/dist/utils.js
2
+ function extractContentType(headers = {}) {
3
+ const normalizedHeaders = headers instanceof Array ? Object.fromEntries(headers) : headers;
4
+ for (const k in normalizedHeaders) {
5
+ if (k.toLowerCase() === "content-type")
6
+ return normalizedHeaders[k];
7
+ }
8
+ }
9
+ function isLikelyJsonMime(value) {
10
+ return /^application\/.*json/.test(value);
11
+ }
12
+ var mix = (one, two, mergeArrays = false) => {
13
+ const acc = { ...one };
14
+ for (const key in two) {
15
+ if (!Object.prototype.hasOwnProperty.call(two, key))
16
+ continue;
17
+ const value = one[key];
18
+ const newValue = two[key];
19
+ acc[key] = Array.isArray(value) && Array.isArray(newValue) ? mergeArrays ? [...value, ...newValue] : newValue : typeof value === "object" && typeof newValue === "object" ? mix(value, newValue, mergeArrays) : newValue;
20
+ }
21
+ return acc;
22
+ };
2
23
 
3
- // src/client.ts
24
+ // ../../node_modules/.bun/wretch@3.0.6/node_modules/wretch/dist/constants.js
25
+ var JSON_MIME = "application/json";
26
+ var FETCH_ERROR = Symbol();
27
+ var CATCHER_FALLBACK = Symbol();
28
+
29
+ // ../../node_modules/.bun/wretch@3.0.6/node_modules/wretch/dist/middleware.js
30
+ var middlewareHelper = (middlewares) => (fetchFunction) => middlewares.reduceRight((acc, curr) => curr(acc), fetchFunction);
31
+
32
+ // ../../node_modules/.bun/wretch@3.0.6/node_modules/wretch/dist/resolver.js
33
+ class WretchError extends Error {
34
+ }
35
+ var resolver = (wretch) => {
36
+ const sharedState = Object.create(null);
37
+ wretch = wretch._addons.reduce((w, addon) => addon.beforeRequest && addon.beforeRequest(w, wretch._options, sharedState) || w, wretch);
38
+ const { _url: url, _options: opts, _fetch: customFetch, _errorTransformer: errorTransformer, _catchers, _resolvers: resolvers, _middlewares: middlewares, _addons: addons } = wretch;
39
+ const catchers = new Map(_catchers);
40
+ const finalOptions = opts;
41
+ let finalUrl = url;
42
+ const _fetchReq = middlewareHelper(middlewares)((url2, options) => {
43
+ finalUrl = url2;
44
+ const fetchImpl = customFetch || fetch;
45
+ return fetchImpl(url2, options);
46
+ })(url, finalOptions);
47
+ const referenceError = new Error;
48
+ const throwingPromise = _fetchReq.then(async (response) => {
49
+ if (!response.ok) {
50
+ const err = new WretchError;
51
+ err["cause"] = referenceError;
52
+ err.stack += `
53
+ CAUSE: ` + referenceError.stack;
54
+ err.response = response;
55
+ err.status = response.status;
56
+ err.url = finalUrl;
57
+ if (response.type === "opaque" || errorTransformer) {
58
+ err.message = response.statusText;
59
+ } else {
60
+ try {
61
+ err.message = await response.clone().text();
62
+ } catch (_a) {
63
+ err.message = response.statusText;
64
+ }
65
+ }
66
+ throw err;
67
+ }
68
+ return response;
69
+ });
70
+ const catchersWrapper = (promise) => promise.catch(async (error) => {
71
+ const catcher = catchers.get(error === null || error === undefined ? undefined : error.status) || catchers.get(error === null || error === undefined ? undefined : error.name) || !(error instanceof WretchError) && catchers.get(FETCH_ERROR) || catchers.get(CATCHER_FALLBACK);
72
+ if (error.response && errorTransformer) {
73
+ error = await errorTransformer(error, error.response, wretch);
74
+ }
75
+ if (catcher)
76
+ return catcher(error, wretch);
77
+ throw error;
78
+ });
79
+ const bodyParser = (funName) => (cb) => {
80
+ const promise = funName ? throwingPromise.then((_) => _ === null || _ === undefined ? undefined : _[funName]()) : throwingPromise;
81
+ return catchersWrapper(cb ? promise.then(cb) : promise);
82
+ };
83
+ const responseChain = {
84
+ _wretchReq: wretch,
85
+ _fetchReq,
86
+ _sharedState: sharedState,
87
+ res: bodyParser(null),
88
+ json: bodyParser("json"),
89
+ blob: bodyParser("blob"),
90
+ formData: bodyParser("formData"),
91
+ arrayBuffer: bodyParser("arrayBuffer"),
92
+ text: bodyParser("text"),
93
+ error(errorId, cb) {
94
+ catchers.set(errorId, cb);
95
+ return this;
96
+ },
97
+ badRequest(cb) {
98
+ return this.error(400, cb);
99
+ },
100
+ unauthorized(cb) {
101
+ return this.error(401, cb);
102
+ },
103
+ forbidden(cb) {
104
+ return this.error(403, cb);
105
+ },
106
+ notFound(cb) {
107
+ return this.error(404, cb);
108
+ },
109
+ timeout(cb) {
110
+ return this.error(408, cb);
111
+ },
112
+ internalError(cb) {
113
+ return this.error(500, cb);
114
+ },
115
+ fetchError(cb) {
116
+ return this.error(FETCH_ERROR, cb);
117
+ }
118
+ };
119
+ const enhancedResponseChain = addons.reduce((chain, addon) => ({
120
+ ...chain,
121
+ ...typeof addon.resolver === "function" ? addon.resolver(chain) : addon.resolver
122
+ }), responseChain);
123
+ return resolvers.reduce((chain, r) => r(chain, wretch), enhancedResponseChain);
124
+ };
125
+
126
+ // ../../node_modules/.bun/wretch@3.0.6/node_modules/wretch/dist/core.js
127
+ var core = {
128
+ _url: "",
129
+ _options: {},
130
+ _catchers: new Map,
131
+ _resolvers: [],
132
+ _deferred: [],
133
+ _middlewares: [],
134
+ _addons: [],
135
+ addon(addon) {
136
+ const addons = Array.isArray(addon) ? addon : [addon];
137
+ const wretchProps = addons.reduce((acc, a) => ({ ...acc, ...a.wretch }), {});
138
+ return { ...this, _addons: [...this._addons, ...addons], ...wretchProps };
139
+ },
140
+ fetchPolyfill(fetchImpl) {
141
+ return { ...this, _fetch: fetchImpl };
142
+ },
143
+ url(_url, replace = false) {
144
+ if (replace)
145
+ return { ...this, _url };
146
+ const idx = this._url.indexOf("?");
147
+ return {
148
+ ...this,
149
+ _url: idx > -1 ? this._url.slice(0, idx) + _url + this._url.slice(idx) : this._url + _url
150
+ };
151
+ },
152
+ options(options, replace = false) {
153
+ return { ...this, _options: replace ? options : mix(this._options, options) };
154
+ },
155
+ headers(headerValues) {
156
+ const headers = !headerValues ? {} : Array.isArray(headerValues) ? Object.fromEntries(headerValues) : ("entries" in headerValues) ? Object.fromEntries(headerValues.entries()) : headerValues;
157
+ return { ...this, _options: mix(this._options, { headers }) };
158
+ },
159
+ accept(headerValue) {
160
+ return this.headers({ Accept: headerValue });
161
+ },
162
+ content(headerValue) {
163
+ return this.headers({ "Content-Type": headerValue });
164
+ },
165
+ auth(headerValue) {
166
+ return this.headers({ Authorization: headerValue });
167
+ },
168
+ catcher(errorId, catcher) {
169
+ const newMap = new Map(this._catchers);
170
+ newMap.set(errorId, catcher);
171
+ return { ...this, _catchers: newMap };
172
+ },
173
+ catcherFallback(catcher) {
174
+ return this.catcher(CATCHER_FALLBACK, catcher);
175
+ },
176
+ customError(transformer) {
177
+ return { ...this, _errorTransformer: transformer };
178
+ },
179
+ resolve(resolver2, clear = false) {
180
+ return { ...this, _resolvers: clear ? [resolver2] : [...this._resolvers, resolver2] };
181
+ },
182
+ defer(callback, clear = false) {
183
+ return {
184
+ ...this,
185
+ _deferred: clear ? [callback] : [...this._deferred, callback]
186
+ };
187
+ },
188
+ middlewares(middlewares, clear = false) {
189
+ return {
190
+ ...this,
191
+ _middlewares: clear ? middlewares : [...this._middlewares, ...middlewares]
192
+ };
193
+ },
194
+ fetch(method = this._options.method, url = "", body = null) {
195
+ let base = this.url(url).options({ method });
196
+ const contentType = extractContentType(base._options.headers);
197
+ const jsonify = typeof body === "object" && !(body instanceof FormData) && (!base._options.headers || !contentType || isLikelyJsonMime(contentType));
198
+ base = !body ? base : jsonify ? base.json(body, contentType) : base.body(body);
199
+ return resolver(base._deferred.reduce((acc, curr) => curr(acc, acc._url, acc._options), base));
200
+ },
201
+ get(url = "") {
202
+ return this.fetch("GET", url);
203
+ },
204
+ delete(url = "") {
205
+ return this.fetch("DELETE", url);
206
+ },
207
+ put(body, url = "") {
208
+ return this.fetch("PUT", url, body);
209
+ },
210
+ post(body, url = "") {
211
+ return this.fetch("POST", url, body);
212
+ },
213
+ patch(body, url = "") {
214
+ return this.fetch("PATCH", url, body);
215
+ },
216
+ head(url = "") {
217
+ return this.fetch("HEAD", url);
218
+ },
219
+ opts(url = "") {
220
+ return this.fetch("OPTIONS", url);
221
+ },
222
+ body(contents) {
223
+ return { ...this, _options: { ...this._options, body: contents } };
224
+ },
225
+ json(jsObject, contentType) {
226
+ const currentContentType = extractContentType(this._options.headers);
227
+ return this.content(contentType || isLikelyJsonMime(currentContentType) && currentContentType || JSON_MIME).body(JSON.stringify(jsObject));
228
+ },
229
+ toFetch() {
230
+ return (fetchUrl, fetchOptions = {}) => {
231
+ return this.url(fetchUrl).options(fetchOptions).catcherFallback((error) => {
232
+ if (error instanceof WretchError) {
233
+ return error.response;
234
+ } else {
235
+ throw error;
236
+ }
237
+ }).fetch().res();
238
+ };
239
+ }
240
+ };
241
+
242
+ // ../../node_modules/.bun/wretch@3.0.6/node_modules/wretch/dist/index.js
243
+ var factory = (_url = "", _options = {}) => ({ ...core, _url, _options });
244
+ factory["default"] = factory;
245
+ factory.WretchError = WretchError;
246
+ var dist_default = factory;
4
247
 
5
248
  // src/errors.ts
6
- var AllDebridError = class _AllDebridError extends Error {
249
+ class AllDebridError extends Error {
7
250
  code;
8
251
  isAllDebridError = true;
9
252
  constructor(code, message) {
@@ -11,41 +254,43 @@ var AllDebridError = class _AllDebridError extends Error {
11
254
  this.name = "AllDebridError";
12
255
  this.code = code;
13
256
  if ("captureStackTrace" in Error && typeof Error.captureStackTrace === "function") {
14
- Error.captureStackTrace(this, _AllDebridError);
257
+ Error.captureStackTrace(this, AllDebridError);
15
258
  }
16
259
  }
17
- /**
18
- * Create an AllDebridError from an API error response
19
- */
20
260
  static fromApiError(error) {
21
- return new _AllDebridError(error.code, error.message);
261
+ return new AllDebridError(error.code, error.message);
22
262
  }
23
- };
24
- var AuthenticationError = class extends AllDebridError {
263
+ }
264
+
265
+ class AuthenticationError extends AllDebridError {
25
266
  constructor(code, message) {
26
267
  super(code, message);
27
268
  this.name = "AuthenticationError";
28
269
  }
29
- };
30
- var LinkError = class extends AllDebridError {
270
+ }
271
+
272
+ class LinkError extends AllDebridError {
31
273
  constructor(code, message) {
32
274
  super(code, message);
33
275
  this.name = "LinkError";
34
276
  }
35
- };
36
- var MagnetError = class extends AllDebridError {
277
+ }
278
+
279
+ class MagnetError extends AllDebridError {
37
280
  constructor(code, message) {
38
281
  super(code, message);
39
282
  this.name = "MagnetError";
40
283
  }
41
- };
42
- var NetworkError = class extends AllDebridError {
284
+ }
285
+
286
+ class NetworkError extends AllDebridError {
287
+ statusCode;
43
288
  constructor(message, statusCode) {
44
289
  super("NETWORK_ERROR", message);
45
290
  this.statusCode = statusCode;
46
291
  this.name = "NetworkError";
47
292
  }
48
- };
293
+ }
49
294
  function createTypedError(code, message) {
50
295
  if (code.startsWith("AUTH_")) {
51
296
  return new AuthenticationError(code, message);
@@ -60,263 +305,82 @@ function createTypedError(code, message) {
60
305
  }
61
306
 
62
307
  // src/base-resource.ts
63
- var BaseResource = class {
308
+ class BaseResource {
309
+ client;
64
310
  constructor(client) {
65
311
  this.client = client;
66
312
  }
67
- /**
68
- * Make a GET request
69
- * @template T - The generated response type (e.g., GetLinkUnlockResponse)
70
- * @param path - API endpoint path
71
- * @param params - Optional query parameters
72
- * @returns The extracted data from the response (without the { status, data } wrapper)
73
- */
74
313
  async get(path, params) {
75
314
  return this.client.get(path, params);
76
315
  }
77
- /**
78
- * Make a POST request
79
- * @template T - The generated response type
80
- * @param path - API endpoint path
81
- * @param body - Request body
82
- * @param params - Optional query parameters
83
- * @returns The extracted data from the response (without the { status, data } wrapper)
84
- */
85
316
  async post(path, body, params) {
86
317
  return this.client.post(path, body, params);
87
318
  }
88
- /**
89
- * Make a POST request with FormData (multipart/form-data)
90
- * @template T - The generated response type
91
- * @param path - API endpoint path
92
- * @param formData - Form data to send
93
- * @param params - Optional query parameters
94
- * @returns The extracted data from the response (without the { status, data } wrapper)
95
- */
96
319
  async postFormData(path, formData, params) {
97
320
  return this.client.postFormData(path, formData, params);
98
321
  }
99
- };
322
+ }
100
323
 
101
324
  // src/resources/host.ts
102
- var HostResource = class extends BaseResource {
103
- /**
104
- * Get list of all supported hosts with their information
105
- *
106
- * @param hostOnly - If true, only return hosts (exclude streams and redirectors)
107
- *
108
- * @example
109
- * ```ts
110
- * const hosts = await client.host.list()
111
- * console.log(hosts.hosts) // All supported file hosts
112
- * console.log(hosts.streams) // Streaming hosts
113
- * console.log(hosts.redirectors) // Link redirectors
114
- * ```
115
- */
325
+ class HostResource extends BaseResource {
116
326
  async list(hostOnly) {
117
- const params = hostOnly ? { hostOnly: "1" } : void 0;
327
+ const params = hostOnly ? { hostOnly: "1" } : undefined;
118
328
  return this.get("/hosts", params);
119
329
  }
120
- /**
121
- * Get array of all supported domain names
122
- *
123
- * @example
124
- * ```ts
125
- * const domains = await client.host.domains()
126
- * console.log(domains) // ['rapidgator.net', 'uploaded.net', ...]
127
- * ```
128
- */
129
330
  async domains() {
130
331
  return this.get("/hosts/domains");
131
332
  }
132
- /**
133
- * Get hosts ordered by restriction level (priority list)
134
- *
135
- * @example
136
- * ```ts
137
- * const priority = await client.host.priority()
138
- * console.log(priority.hosts) // Ordered list with restriction levels
139
- * ```
140
- */
141
333
  async priority() {
142
334
  return this.get("/hosts/priority");
143
335
  }
144
- };
336
+ }
145
337
 
146
338
  // src/resources/link.ts
147
- var LinkResource = class extends BaseResource {
148
- /**
149
- * Get information about one or more links
150
- *
151
- * @param links - Single link or array of links to get info for
152
- * @param password - Optional password for password-protected links
153
- *
154
- * @example
155
- * ```ts
156
- * const data = await client.link.infos('https://example.com/file.zip')
157
- * console.log(data.infos)
158
- *
159
- * // With password
160
- * const protectedData = await client.link.infos(
161
- * 'https://example.com/protected.zip',
162
- * 'mypassword'
163
- * )
164
- * ```
165
- */
339
+ class LinkResource extends BaseResource {
166
340
  async infos(links, password) {
167
341
  const linksArray = Array.isArray(links) ? links : [links];
168
- const params = password ? { password } : void 0;
342
+ const params = password ? { password } : undefined;
169
343
  return this.post("/link/infos", { "link[]": linksArray }, params);
170
344
  }
171
- /**
172
- * Extract links from redirectors/link protectors
173
- *
174
- * @param link - The redirector link to extract from
175
- *
176
- * @example
177
- * ```ts
178
- * const data = await client.link.redirector('https://linkprotector.com/abc123')
179
- * console.log(data.links)
180
- * ```
181
- */
182
345
  async redirector(link) {
183
346
  return this.post("/link/redirector", {
184
347
  link
185
348
  });
186
349
  }
187
- /**
188
- * Unlock a download link
189
- *
190
- * @param link - The link to unlock
191
- * @param password - Optional password for password-protected links
192
- *
193
- * @example
194
- * ```ts
195
- * const result = await client.link.unlock('https://example.com/file.zip')
196
- * if (result.link) {
197
- * console.log('Direct link:', result.link)
198
- * } else if (result.delayed) {
199
- * // Handle delayed generation
200
- * const delayedResult = await client.link.delayed(result.delayed)
201
- * }
202
- *
203
- * // With password
204
- * const protectedResult = await client.link.unlock(
205
- * 'https://example.com/protected.zip',
206
- * 'mypassword'
207
- * )
208
- * ```
209
- */
210
350
  async unlock(link, password) {
211
- const params = password ? { password } : void 0;
351
+ const params = password ? { password } : undefined;
212
352
  return this.post("/link/unlock", { link }, params);
213
353
  }
214
- /**
215
- * Unlock a link and automatically poll if delayed
216
- * Note: The API response format doesn't include a delayed field in the current OpenAPI spec.
217
- * This method will be updated once the delayed mechanism is documented.
218
- *
219
- * @param link - The link to unlock
220
- * @param _options - Polling options (currently unused)
221
- *
222
- * @example
223
- * ```ts
224
- * const result = await client.link.unlockWithPolling('https://example.com/file.zip')
225
- * console.log('Direct link:', result.link)
226
- * ```
227
- */
228
354
  async unlockWithPolling(link, _options = {}) {
229
355
  return this.unlock(link);
230
356
  }
231
- /**
232
- * Get streaming options for a generated link
233
- *
234
- * @param id - The generated link ID or streaming ID
235
- *
236
- * @example
237
- * ```ts
238
- * const streams = await client.link.streaming('abc123')
239
- * ```
240
- */
241
357
  async streaming(id, stream) {
242
358
  return this.post("/link/streaming", {
243
359
  id,
244
360
  stream
245
361
  });
246
362
  }
247
- /**
248
- * Get the status/result of a delayed link generation
249
- *
250
- * @param id - The delayed generation ID
251
- *
252
- * @example
253
- * ```ts
254
- * const result = await client.link.delayed('delayed_id_123')
255
- * ```
256
- */
257
363
  async delayed(id) {
258
364
  return this.post("/link/delayed", {
259
365
  id
260
366
  });
261
367
  }
262
- };
368
+ }
263
369
 
264
370
  // src/resources/magnet.ts
265
- var MagnetResource = class extends BaseResource {
266
- /**
267
- * Upload magnets by URI or hash
268
- *
269
- * @param magnets - Single magnet URI/hash or array of magnets
270
- *
271
- * @example
272
- * ```ts
273
- * const result = await client.magnet.upload('magnet:?xt=urn:btih:...')
274
- * console.log('Magnet ID:', result.magnets[0].id)
275
- * ```
276
- */
371
+ class MagnetResource extends BaseResource {
277
372
  async upload(magnets) {
278
373
  const magnetsArray = Array.isArray(magnets) ? magnets : [magnets];
279
374
  return this.post("/magnet/upload", {
280
375
  magnets: magnetsArray
281
376
  });
282
377
  }
283
- /**
284
- * Upload a torrent file
285
- *
286
- * @param file - The torrent file (Blob or File)
287
- * @param filename - Optional filename (defaults to 'torrent.torrent' for Blob, or file.name for File)
288
- *
289
- * @example
290
- * ```ts
291
- * const file = new File([buffer], 'torrent.torrent')
292
- * const result = await client.magnet.uploadFile(file)
293
- *
294
- * // Or with a Blob and custom filename
295
- * const blob = new Blob([buffer])
296
- * const result = await client.magnet.uploadFile(blob, 'my-torrent.torrent')
297
- * ```
298
- */
299
378
  async uploadFile(file, filename) {
300
- const formData = new FormData();
379
+ const formData = new FormData;
301
380
  const actualFilename = filename || (file instanceof File ? file.name : "torrent.torrent");
302
381
  formData.append("files[]", file, actualFilename);
303
382
  return this.postFormData("/magnet/upload/file", formData);
304
383
  }
305
- /**
306
- * Get the status of a specific magnet by ID
307
- *
308
- * @param id - Magnet ID to get status for
309
- *
310
- * @example
311
- * ```ts
312
- * const status = await client.magnet.status(123)
313
- * console.log(status.magnets[0]?.status) // 'Downloading', 'Ready', etc.
314
- * ```
315
- *
316
- * @remarks
317
- * This endpoint uses AllDebrid API v4.1 (POST method)
318
- * Migrated from v4 GET endpoint which was deprecated on 2024-10-16
319
- */
320
384
  async status(id) {
321
385
  const data = await this.post("/magnet/status", { id });
322
386
  if (data?.magnets && !Array.isArray(data.magnets)) {
@@ -327,123 +391,10 @@ var MagnetResource = class extends BaseResource {
327
391
  }
328
392
  return data;
329
393
  }
330
- /**
331
- * Get list of magnets with optional status filter
332
- *
333
- * @param statusFilter - Optional filter by status: 'active', 'ready', 'expired', or 'error'
334
- *
335
- * @example
336
- * ```ts
337
- * // Get all magnets
338
- * const allMagnets = await client.magnet.statusList()
339
- *
340
- * // Get only active magnets
341
- * const activeMagnets = await client.magnet.statusList('active')
342
- *
343
- * // Get only ready magnets
344
- * const readyMagnets = await client.magnet.statusList('ready')
345
- * ```
346
- *
347
- * @remarks
348
- * This endpoint uses AllDebrid API v4.1 (POST method)
349
- */
350
394
  async statusList(statusFilter) {
351
- const body = statusFilter ? { status: statusFilter } : void 0;
395
+ const body = statusFilter ? { status: statusFilter } : undefined;
352
396
  return this.post("/magnet/status", body);
353
397
  }
354
- /**
355
- * Get magnet status using live mode for bandwidth-optimized delta synchronization
356
- *
357
- * Live mode is designed for monitoring multiple magnets efficiently by only transmitting
358
- * changes between polling intervals, drastically reducing bandwidth usage for dashboards
359
- * and real-time monitoring applications.
360
- *
361
- * ## How it works
362
- *
363
- * 1. **Session initialization**: Generate a random session ID and start with counter = 0
364
- * 2. **First call (fullsync)**: Returns ALL magnets with `fullsync: true`
365
- * 3. **Update counter**: Use the `counter` value returned by the API for the next call
366
- * 4. **Subsequent calls (delta)**: Returns ONLY magnets that changed since last call
367
- * 5. **Repeat**: Keep calling with updated counter to receive only deltas
368
- *
369
- * ## When to use
370
- *
371
- * - ✅ Monitoring multiple active magnets simultaneously
372
- * - ✅ Building real-time dashboards
373
- * - ✅ High-frequency polling scenarios (every few seconds)
374
- * - ❌ Watching a single specific magnet (use `watch()` instead)
375
- *
376
- * ## Important notes
377
- *
378
- * - **Don't use the `id` parameter**: Passing an ID defeats the purpose of live mode
379
- * as it disables delta sync and behaves like a regular `status()` call
380
- * - **Session persistence**: Keep the same session ID for the entire monitoring session
381
- * - **Counter tracking**: Always update the counter with the value returned by the API
382
- * - **Empty deltas**: When no magnets changed, `magnets` will be an empty array
383
- *
384
- * @param options - Live mode session options
385
- * @param options.session - Unique session ID (generate once: `Math.floor(Math.random() * 1000000)`)
386
- * @param options.counter - Sync counter (start at 0, then use value from previous API response)
387
- *
388
- * @example
389
- * ```ts
390
- * // Initialize session
391
- * const session = Math.floor(Math.random() * 1000000)
392
- * let counter = 0
393
- *
394
- * // First call - returns all magnets (fullsync: true)
395
- * const firstCall = await client.magnet.statusLive({ session, counter })
396
- * console.log('Full sync:', firstCall.fullsync) // true
397
- * console.log('All magnets:', firstCall.magnets) // Array of all magnets
398
- * counter = firstCall.counter // Update counter for next call
399
- *
400
- * // Second call - returns only magnets that changed
401
- * await new Promise(resolve => setTimeout(resolve, 3000)) // Wait 3 seconds
402
- * const secondCall = await client.magnet.statusLive({ session, counter })
403
- * console.log('Delta sync:', secondCall.magnets) // Only changed magnets
404
- * counter = secondCall.counter
405
- *
406
- * // Example: Monitor all magnets until none are active
407
- * const activeMagnets = new Map()
408
- *
409
- * while (true) {
410
- * const response = await client.magnet.statusLive({ session, counter })
411
- * counter = response.counter ?? counter
412
- *
413
- * // Update our local state with changes
414
- * if (response.fullsync) {
415
- * activeMagnets.clear()
416
- * response.magnets?.forEach(m => activeMagnets.set(m.id, m))
417
- * } else {
418
- * response.magnets?.forEach(m => {
419
- * if (m.status === 'Ready' || m.status === 'Error' || m.status === 'Expired') {
420
- * activeMagnets.delete(m.id)
421
- * } else {
422
- * activeMagnets.set(m.id, m)
423
- * }
424
- * })
425
- * }
426
- *
427
- * // Display current state
428
- * console.log(`Active downloads: ${activeMagnets.size}`)
429
- * activeMagnets.forEach(m => {
430
- * console.log(` ${m.filename}: ${m.status} - ${m.downloaded}/${m.size} bytes`)
431
- * })
432
- *
433
- * // Stop when no more active magnets
434
- * if (activeMagnets.size === 0) {
435
- * console.log('All downloads completed!')
436
- * break
437
- * }
438
- *
439
- * await new Promise(resolve => setTimeout(resolve, 3000))
440
- * }
441
- * ```
442
- *
443
- * @remarks
444
- * This method is ideal for scenarios where you're monitoring multiple magnets and want
445
- * to minimize bandwidth. For simple single-magnet monitoring, use `watch()` instead.
446
- */
447
398
  async statusLive(options) {
448
399
  const body = {
449
400
  session: options.session,
@@ -451,94 +402,27 @@ var MagnetResource = class extends BaseResource {
451
402
  };
452
403
  return this.post("/magnet/status", body);
453
404
  }
454
- /**
455
- * Delete a magnet
456
- *
457
- * @param id - The magnet ID to delete
458
- *
459
- * @example
460
- * ```ts
461
- * await client.magnet.delete(123)
462
- * ```
463
- */
464
405
  async delete(id) {
465
406
  return this.post("/magnet/delete", {
466
407
  id
467
408
  });
468
409
  }
469
- /**
470
- * Restart one or more failed magnets
471
- *
472
- * @param ids - Single magnet ID or array of magnet IDs to restart (numbers)
473
- *
474
- * @example
475
- * ```ts
476
- * // Restart single magnet
477
- * await client.magnet.restart(123)
478
- *
479
- * // Restart multiple magnets
480
- * await client.magnet.restart([123, 456])
481
- * ```
482
- */
483
410
  async restart(ids) {
484
411
  const idsArray = Array.isArray(ids) ? ids : [ids];
485
412
  return this.post("/magnet/restart", {
486
413
  ids: idsArray
487
414
  });
488
415
  }
489
- /**
490
- * Get files for a completed magnet
491
- *
492
- * @param ids - The magnet ID or IDs to get files for
493
- *
494
- * @example
495
- * ```ts
496
- * const data = await client.magnet.files(123)
497
- * data?.magnets?.forEach(magnet => {
498
- * console.log(magnet.filename, magnet.files)
499
- * })
500
- * ```
501
- *
502
- * @remarks
503
- * Files are now retrieved separately from magnet status (since v4.1)
504
- * Only available for magnets with status 'Ready'
505
- */
506
416
  async files(ids) {
507
- const formData = new FormData();
417
+ const formData = new FormData;
508
418
  const idsArray = Array.isArray(ids) ? ids : [ids];
509
419
  for (const id of idsArray) {
510
420
  formData.append("id[]", String(id));
511
421
  }
512
422
  return this.postFormData("/magnet/files", formData);
513
423
  }
514
- /**
515
- * Watch a magnet's status with automatic polling
516
- *
517
- * This is a simple helper that polls the status of a specific magnet until it reaches
518
- * a target status (default: 'Ready'). For advanced use cases with multiple magnets
519
- * or bandwidth optimization, use `statusLive()` directly instead.
520
- *
521
- * @param id - The magnet ID to watch
522
- * @param options - Watch options
523
- * @param options.interval - Polling interval in milliseconds (default: 3000)
524
- * @param options.maxAttempts - Maximum polling attempts, 0 for infinite (default: 0)
525
- * @param options.onUpdate - Callback called on each status update
526
- * @param options.stopOnStatus - Stop when magnet reaches this status (default: 'Ready')
527
- *
528
- * @example
529
- * ```ts
530
- * await client.magnet.watch(123, {
531
- * onUpdate: (status) => console.log('Status:', status.magnets[0]?.status),
532
- * stopOnStatus: 'Ready'
533
- * })
534
- * ```
535
- *
536
- * @remarks
537
- * For monitoring multiple magnets efficiently, use `statusLive()` directly.
538
- * See the `statusLive()` documentation for details on delta synchronization.
539
- */
540
424
  async watch(id, options = {}) {
541
- const { interval = 3e3, maxAttempts = 0, onUpdate, stopOnStatus = "Ready" } = options;
425
+ const { interval = 3000, maxAttempts = 0, onUpdate, stopOnStatus = "Ready" } = options;
542
426
  let attempt = 0;
543
427
  while (maxAttempts === 0 || attempt < maxAttempts) {
544
428
  attempt++;
@@ -550,105 +434,21 @@ var MagnetResource = class extends BaseResource {
550
434
  }
551
435
  await new Promise((resolve) => setTimeout(resolve, interval));
552
436
  }
553
- throw new Error(
554
- `Watch timeout: magnet did not reach '${stopOnStatus}' status after ${maxAttempts} attempts`
555
- );
437
+ throw new Error(`Watch timeout: magnet did not reach '${stopOnStatus}' status after ${maxAttempts} attempts`);
556
438
  }
557
- };
439
+ }
558
440
 
559
441
  // src/resources/pin.ts
560
- var PinResource = class extends BaseResource {
561
- /**
562
- * Generate a new PIN code for authentication
563
- *
564
- * This initiates the PIN authentication flow. The user should visit the
565
- * returned URL to authorize the application.
566
- *
567
- * @example
568
- * ```ts
569
- * const pinData = await client.pin.generate()
570
- * console.log('Visit:', pinData.user_url)
571
- * console.log('PIN:', pinData.pin)
572
- *
573
- * // Poll the check endpoint until user authorizes
574
- * const auth = await client.pin.check(pinData.check, pinData.pin)
575
- * if (auth.activated) {
576
- * console.log('API Key:', auth.apikey)
577
- * }
578
- * ```
579
- *
580
- * @returns PIN code and authorization URL
581
- */
442
+ class PinResource extends BaseResource {
582
443
  async generate() {
583
444
  return super.get("/pin/get");
584
445
  }
585
- /**
586
- * Check the status of a PIN authentication
587
- *
588
- * Poll this endpoint to check if the user has authorized the application.
589
- * Once authorized, the response will include the API key.
590
- *
591
- * @param check - Check ID from /pin/get
592
- * @param pin - PIN code from /pin/get
593
- *
594
- * @example
595
- * ```ts
596
- * const pinData = await client.pin.generate()
597
- *
598
- * // Poll every few seconds until activated
599
- * const checkStatus = async () => {
600
- * const result = await client.pin.check(pinData.check, pinData.pin)
601
- * if (result?.activated && result?.apikey) {
602
- * console.log('Authorized! API Key:', result.apikey)
603
- * return result.apikey
604
- * }
605
- * // Wait and try again
606
- * await new Promise(resolve => setTimeout(resolve, 3000))
607
- * return checkStatus()
608
- * }
609
- *
610
- * const apikey = await checkStatus()
611
- * ```
612
- *
613
- * @returns Authorization status and API key (if activated)
614
- */
615
446
  async check(check, pin) {
616
447
  return super.get("/pin/check", { check, pin });
617
448
  }
618
- /**
619
- * Helper method to wait for PIN authorization with automatic polling
620
- *
621
- * This method handles the polling logic for you, making it easier to
622
- * implement the PIN authentication flow.
623
- *
624
- * @param check - Check ID from /pin/get
625
- * @param pin - PIN code from /pin/get
626
- * @param options - Polling options
627
- * @param options.timeout - Maximum time to wait in milliseconds (default: 600000 = 10 minutes)
628
- * @param options.interval - Polling interval in milliseconds (default: 3000 = 3 seconds)
629
- *
630
- * @example
631
- * ```ts
632
- * const pinData = await client.pin.generate()
633
- * console.log('Visit:', pinData.user_url)
634
- *
635
- * try {
636
- * const apikey = await client.pin.waitForAuth(pinData.check, pinData.pin, {
637
- * timeout: 600000, // 10 minutes
638
- * interval: 3000, // Check every 3 seconds
639
- * })
640
- * console.log('Authorized! API Key:', apikey)
641
- * } catch (error) {
642
- * console.error('Authorization timed out or failed')
643
- * }
644
- * ```
645
- *
646
- * @returns The API key once authorized
647
- * @throws Error if timeout is reached or authorization fails
648
- */
649
449
  async waitForAuth(check, pin, options = {}) {
650
- const timeout = options.timeout ?? 6e5;
651
- const interval = options.interval ?? 3e3;
450
+ const timeout = options.timeout ?? 600000;
451
+ const interval = options.interval ?? 3000;
652
452
  const startTime = Date.now();
653
453
  while (Date.now() - startTime < timeout) {
654
454
  const result = await this.check(check, pin);
@@ -659,281 +459,83 @@ var PinResource = class extends BaseResource {
659
459
  }
660
460
  throw new Error("PIN authorization timeout - user did not authorize within the time limit");
661
461
  }
662
- };
462
+ }
663
463
 
664
464
  // src/resources/user.ts
665
- var UserResource = class extends BaseResource {
666
- /**
667
- * Get user profile information including premium status and quotas
668
- *
669
- * @example
670
- * ```ts
671
- * const data = await client.user.getInfo()
672
- * console.log(data.user.username, data.user.isPremium)
673
- * ```
674
- */
465
+ class UserResource extends BaseResource {
675
466
  async getInfo() {
676
467
  return this.get("/user");
677
468
  }
678
- /**
679
- * Get available hosts for the current user based on their subscription
680
- *
681
- * @param hostOnly - If true, only return hosts data (exclude streams and redirectors)
682
- *
683
- * @example
684
- * ```ts
685
- * const hosts = await client.user.getHosts()
686
- * console.log(Object.keys(hosts.hosts))
687
- * ```
688
- */
689
469
  async getHosts(hostOnly) {
690
- const params = hostOnly ? { hostOnly: "1" } : void 0;
470
+ const params = hostOnly ? { hostOnly: "1" } : undefined;
691
471
  return this.get("/user/hosts", params);
692
472
  }
693
- /**
694
- * Clear a specific notification by code
695
- *
696
- * @param code - The notification code to clear
697
- *
698
- * @example
699
- * ```ts
700
- * await client.user.clearNotification('SOME_NOTIF_CODE')
701
- * ```
702
- */
703
473
  async clearNotification(code) {
704
474
  await this.post("/user/notification/clear", { code });
705
475
  }
706
- // ============================================
707
- // Saved Links Management
708
- // ============================================
709
- /**
710
- * Get all saved links
711
- *
712
- * @example
713
- * ```ts
714
- * const savedLinks = await client.user.getLinks()
715
- * console.log(savedLinks.links)
716
- * ```
717
- */
718
476
  async getLinks() {
719
477
  return this.get("/user/links");
720
478
  }
721
- /**
722
- * Save one or multiple links for later use
723
- *
724
- * Supports batch operations - you can save multiple links in a single request.
725
- *
726
- * @param links - Single link or array of links to save
727
- *
728
- * @example
729
- * ```ts
730
- * // Save single link
731
- * await client.user.saveLink('https://example.com/file.zip')
732
- *
733
- * // Save multiple links at once
734
- * await client.user.saveLink([
735
- * 'https://example.com/file1.zip',
736
- * 'https://example.com/file2.zip',
737
- * 'https://example.com/file3.zip'
738
- * ])
739
- * ```
740
- */
741
479
  async saveLink(links) {
742
480
  const linksArray = Array.isArray(links) ? links : [links];
743
- const formData = new FormData();
481
+ const formData = new FormData;
744
482
  for (const link of linksArray) {
745
483
  formData.append("links[]", link);
746
484
  }
747
485
  return this.postFormData("/user/links/save", formData);
748
486
  }
749
- /**
750
- * Delete one or multiple saved links
751
- *
752
- * Supports batch operations - you can delete multiple links in a single request.
753
- *
754
- * @param links - Single link or array of links to delete (can be saved link IDs or URLs)
755
- *
756
- * @example
757
- * ```ts
758
- * // Delete single link
759
- * await client.user.deleteLink('saved-link-id')
760
- *
761
- * // Delete multiple links at once
762
- * await client.user.deleteLink([
763
- * 'saved-link-id-1',
764
- * 'saved-link-id-2',
765
- * 'saved-link-id-3'
766
- * ])
767
- * ```
768
- */
769
487
  async deleteLink(links) {
770
488
  const linksArray = Array.isArray(links) ? links : [links];
771
- const formData = new FormData();
489
+ const formData = new FormData;
772
490
  for (const link of linksArray) {
773
491
  formData.append("links[]", link);
774
492
  }
775
493
  return this.postFormData("/user/links/delete", formData);
776
494
  }
777
- // ============================================
778
- // History Management
779
- // ============================================
780
- /**
781
- * Get user history (if enabled in account settings)
782
- *
783
- * @example
784
- * ```ts
785
- * const history = await client.user.getHistory()
786
- * console.log(history.links)
787
- * ```
788
- */
789
495
  async getHistory() {
790
496
  return this.get("/user/history");
791
497
  }
792
- /**
793
- * Clear user history
794
- *
795
- * @example
796
- * ```ts
797
- * await client.user.clearHistory()
798
- * ```
799
- */
800
498
  async clearHistory() {
801
499
  return this.post("/user/history/delete");
802
500
  }
803
- // ============================================
804
- // Email Verification
805
- // ============================================
806
- /**
807
- * Check email verification status
808
- *
809
- * @param token - Verification token
810
- *
811
- * @example
812
- * ```ts
813
- * const status = await client.user.getVerificationStatus('verification-token')
814
- * console.log(status.verif) // 'waiting', 'allowed', or 'denied'
815
- * ```
816
- */
817
501
  async getVerificationStatus(token) {
818
- return this.post("/user/verif", void 0, { token });
502
+ return this.post("/user/verif", undefined, { token });
819
503
  }
820
- /**
821
- * Resend verification email
822
- *
823
- * @param token - Verification token
824
- *
825
- * @example
826
- * ```ts
827
- * await client.user.resendVerification('verification-token')
828
- * ```
829
- */
830
504
  async resendVerification(token) {
831
- return this.post("/user/verif/resend", void 0, { token });
505
+ return this.post("/user/verif/resend", undefined, { token });
832
506
  }
833
- };
507
+ }
834
508
 
835
509
  // src/resources/voucher.ts
836
- var VoucherResource = class extends BaseResource {
837
- /**
838
- * Get voucher balance for reseller accounts
839
- *
840
- * This endpoint allows resellers to check their remaining voucher balance.
841
- * Only available for accounts with reseller privileges.
842
- *
843
- * @example
844
- * ```ts
845
- * const balance = await client.voucher.getBalance()
846
- * console.log('Remaining balance:', balance.balance, '€')
847
- * ```
848
- *
849
- * @returns Voucher balance information
850
- */
510
+ class VoucherResource extends BaseResource {
851
511
  async getBalance() {
852
512
  return this.get("/voucher/balance");
853
513
  }
854
- /**
855
- * Retrieve existing vouchers from reseller inventory
856
- *
857
- * This endpoint retrieves vouchers that were previously generated
858
- * and are available in your inventory.
859
- *
860
- * @param quantity - Optional number of vouchers to retrieve
861
- *
862
- * @example
863
- * ```ts
864
- * // Get all available vouchers
865
- * const allVouchers = await client.voucher.getVouchers()
866
- * console.log('Vouchers:', allVouchers?.codes)
867
- *
868
- * // Get specific quantity
869
- * const fiveVouchers = await client.voucher.getVouchers(5)
870
- * ```
871
- *
872
- * @returns List of voucher codes
873
- */
874
514
  async getVouchers(quantity) {
875
- const params = quantity ? { quantity } : void 0;
515
+ const params = quantity ? { quantity } : undefined;
876
516
  return this.get("/voucher/get", params);
877
517
  }
878
- /**
879
- * Generate new vouchers (deducts from reseller balance)
880
- *
881
- * This endpoint creates new vouchers and deducts the cost from your
882
- * reseller account balance.
883
- *
884
- * @param quantity - Number of vouchers to generate
885
- * @param duration - Voucher duration in days
886
- *
887
- * @example
888
- * ```ts
889
- * // Generate 10 vouchers valid for 30 days
890
- * const vouchers = await client.voucher.generateVouchers(10, 30)
891
- * console.log('Generated vouchers:', vouchers?.codes)
892
- *
893
- * // Generate 5 vouchers valid for 7 days
894
- * const weekVouchers = await client.voucher.generateVouchers(5, 7)
895
- * ```
896
- *
897
- * @returns List of newly generated voucher codes
898
- */
899
518
  async generateVouchers(quantity, duration) {
900
519
  return this.post("/voucher/generate", {
901
520
  quantity,
902
521
  duration
903
522
  });
904
523
  }
905
- };
524
+ }
906
525
 
907
526
  // src/client.ts
908
527
  var DEFAULT_BASE_URL = "https://api.alldebrid.com/v4.1";
909
528
  var DEFAULT_AGENT = "@adbjs/sdk";
910
- var DEFAULT_TIMEOUT = 3e4;
529
+ var DEFAULT_TIMEOUT = 30000;
911
530
  var DEFAULT_MAX_RETRIES = 3;
912
- var AllDebridClient = class {
531
+
532
+ class AllDebridClient {
913
533
  config;
914
- /**
915
- * User resource for managing user account
916
- */
917
534
  user;
918
- /**
919
- * Link resource for unlocking and managing download links
920
- */
921
535
  link;
922
- /**
923
- * Magnet resource for managing torrents
924
- */
925
536
  magnet;
926
- /**
927
- * Host resource for getting information about supported hosts
928
- */
929
537
  host;
930
- /**
931
- * Pin resource for PIN-based authentication
932
- */
933
538
  pin;
934
- /**
935
- * Voucher resource for reseller voucher management
936
- */
937
539
  voucher;
938
540
  constructor(config) {
939
541
  this.config = {
@@ -951,17 +553,14 @@ var AllDebridClient = class {
951
553
  this.pin = new PinResource(this);
952
554
  this.voucher = new VoucherResource(this);
953
555
  }
954
- /**
955
- * Build query string from params
956
- */
957
556
  buildUrl(path, params) {
958
557
  const allParams = {
959
558
  agent: this.config.agent,
960
559
  ...params
961
560
  };
962
- const query = new URLSearchParams();
561
+ const query = new URLSearchParams;
963
562
  for (const [key, value] of Object.entries(allParams)) {
964
- if (value !== void 0 && value !== null) {
563
+ if (value !== undefined && value !== null) {
965
564
  if (Array.isArray(value)) {
966
565
  value.forEach((v) => query.append(`${key}[]`, String(v)));
967
566
  } else {
@@ -972,18 +571,10 @@ var AllDebridClient = class {
972
571
  const queryString = query.toString();
973
572
  return queryString ? `${path}?${queryString}` : path;
974
573
  }
975
- /**
976
- * Make a GET request
977
- * @template T - The generated response type (e.g., GetLinkUnlockResponse)
978
- * @param path - API endpoint path
979
- * @param params - Optional query parameters
980
- * @returns The extracted data from the response (without the { status, data } wrapper)
981
- * @internal
982
- */
983
574
  async get(path, params) {
984
575
  try {
985
576
  const url = this.buildUrl(path, params);
986
- const json = await wretch(this.config.baseUrl).auth(`Bearer ${this.config.apiKey}`).url(url).get().json();
577
+ const json = await dist_default(this.config.baseUrl).auth(`Bearer ${this.config.apiKey}`).url(url).get().json();
987
578
  if (json.status === "error" && json.error) {
988
579
  throw createTypedError(json.error.code, json.error.message);
989
580
  }
@@ -1004,22 +595,13 @@ var AllDebridClient = class {
1004
595
  throw new NetworkError(error.message || "Network error occurred", error.status);
1005
596
  }
1006
597
  }
1007
- /**
1008
- * Make a POST request with application/x-www-form-urlencoded
1009
- * @template T - The generated response type
1010
- * @param path - API endpoint path
1011
- * @param body - Request body (will be converted to URLSearchParams)
1012
- * @param params - Optional query parameters
1013
- * @returns The extracted data from the response (without the { status, data } wrapper)
1014
- * @internal
1015
- */
1016
598
  async post(path, body, params) {
1017
599
  try {
1018
600
  const url = this.buildUrl(path, params);
1019
- const formData = new URLSearchParams();
601
+ const formData = new URLSearchParams;
1020
602
  if (body && typeof body === "object") {
1021
603
  for (const [key, value] of Object.entries(body)) {
1022
- if (value !== void 0 && value !== null) {
604
+ if (value !== undefined && value !== null) {
1023
605
  if (Array.isArray(value)) {
1024
606
  value.forEach((v) => formData.append(key, String(v)));
1025
607
  } else {
@@ -1028,7 +610,7 @@ var AllDebridClient = class {
1028
610
  }
1029
611
  }
1030
612
  }
1031
- const json = await wretch(this.config.baseUrl).auth(`Bearer ${this.config.apiKey}`).url(url).body(formData).post().json();
613
+ const json = await dist_default(this.config.baseUrl).auth(`Bearer ${this.config.apiKey}`).url(url).body(formData).post().json();
1032
614
  if (json.status === "error" && json.error) {
1033
615
  throw createTypedError(json.error.code, json.error.message);
1034
616
  }
@@ -1049,19 +631,10 @@ var AllDebridClient = class {
1049
631
  throw new NetworkError(error.message || "Network error occurred", error.status);
1050
632
  }
1051
633
  }
1052
- /**
1053
- * Make a POST request with FormData (multipart/form-data)
1054
- * @template T - The generated response type
1055
- * @param path - API endpoint path
1056
- * @param formData - Form data to send
1057
- * @param params - Optional query parameters
1058
- * @returns The extracted data from the response (without the { status, data } wrapper)
1059
- * @internal
1060
- */
1061
634
  async postFormData(path, formData, params) {
1062
635
  try {
1063
636
  const url = this.buildUrl(path, params);
1064
- const json = await wretch(this.config.baseUrl).auth(`Bearer ${this.config.apiKey}`).url(url).body(formData).post().json();
637
+ const json = await dist_default(this.config.baseUrl).auth(`Bearer ${this.config.apiKey}`).url(url).body(formData).post().json();
1065
638
  if (json.status === "error" && json.error) {
1066
639
  throw createTypedError(json.error.code, json.error.message);
1067
640
  }
@@ -1082,25 +655,22 @@ var AllDebridClient = class {
1082
655
  throw new NetworkError(error.message || "Network error occurred", error.status);
1083
656
  }
1084
657
  }
1085
- /**
1086
- * Test the API connection
1087
- *
1088
- * This endpoint doesn't require authentication and can be used to verify
1089
- * that the AllDebrid API is reachable.
1090
- *
1091
- * @example
1092
- * ```ts
1093
- * const result = await client.ping()
1094
- * console.log(result.ping) // 'pong'
1095
- * ```
1096
- *
1097
- * @returns Ping response with 'pong' message
1098
- */
1099
658
  async ping() {
1100
659
  return this.get("/ping");
1101
660
  }
661
+ }
662
+ export {
663
+ createTypedError,
664
+ VoucherResource,
665
+ UserResource,
666
+ PinResource,
667
+ NetworkError,
668
+ MagnetResource,
669
+ MagnetError,
670
+ LinkResource,
671
+ LinkError,
672
+ HostResource,
673
+ AuthenticationError,
674
+ AllDebridError,
675
+ AllDebridClient
1102
676
  };
1103
-
1104
- export { AllDebridClient, AllDebridError, AuthenticationError, HostResource, LinkError, LinkResource, MagnetError, MagnetResource, NetworkError, PinResource, UserResource, VoucherResource, createTypedError };
1105
- //# sourceMappingURL=index.js.map
1106
- //# sourceMappingURL=index.js.map