@tidal-music/api 0.28.0 → 0.30.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.js +125 -5
- package/dist/src/allAPI.generated.d.ts +164 -5
- package/dist/src/api.d.ts +4 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/retry.d.ts +37 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -333,16 +333,136 @@ function f(e) {
|
|
|
333
333
|
return e.endsWith("/") ? e.substring(0, e.length - 1) : e;
|
|
334
334
|
}
|
|
335
335
|
//#endregion
|
|
336
|
+
//#region src/retry.ts
|
|
337
|
+
var p = {
|
|
338
|
+
network: {
|
|
339
|
+
baseDelayMs: 1e3,
|
|
340
|
+
maxDelayMs: 16e3,
|
|
341
|
+
maxRetries: 10
|
|
342
|
+
},
|
|
343
|
+
status: {
|
|
344
|
+
baseDelayMs: 500,
|
|
345
|
+
maxDelayMs: 16e3,
|
|
346
|
+
maxRetries: 3
|
|
347
|
+
},
|
|
348
|
+
timeout: {
|
|
349
|
+
baseDelayMs: 8e3,
|
|
350
|
+
maxDelayMs: 32e3,
|
|
351
|
+
maxRetries: 3
|
|
352
|
+
}
|
|
353
|
+
}, m = 1e4, h = new Set([
|
|
354
|
+
"GET",
|
|
355
|
+
"HEAD",
|
|
356
|
+
"OPTIONS"
|
|
357
|
+
]), g = (e) => globalThis.fetch(e);
|
|
358
|
+
function _(e = {}, t = g) {
|
|
359
|
+
if (e.enabled === !1) return t;
|
|
360
|
+
let n = y(e);
|
|
361
|
+
return async (e) => {
|
|
362
|
+
if (!h.has(e.method.toUpperCase())) return t(e);
|
|
363
|
+
let r = {
|
|
364
|
+
network: 0,
|
|
365
|
+
status: 0,
|
|
366
|
+
timeout: 0
|
|
367
|
+
};
|
|
368
|
+
for (;;) {
|
|
369
|
+
if (e.signal.aborted) throw S(e.signal.reason);
|
|
370
|
+
let i = await w(t, e);
|
|
371
|
+
if (i.kind === "response") {
|
|
372
|
+
if (!b(i.response.status) || r.status >= n.status.maxRetries) return i.response;
|
|
373
|
+
await C(x(n.status, r.status), e.signal), r.status += 1;
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
let a = i.kind;
|
|
377
|
+
if (r[a] >= n[a].maxRetries) throw i.error;
|
|
378
|
+
await C(x(n[a], r[a]), e.signal), r[a] += 1;
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function v(e, t) {
|
|
383
|
+
return {
|
|
384
|
+
baseDelayMs: t?.baseDelayMs ?? e.baseDelayMs,
|
|
385
|
+
maxDelayMs: t?.maxDelayMs ?? e.maxDelayMs,
|
|
386
|
+
maxRetries: t?.maxRetries ?? e.maxRetries
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function y(e) {
|
|
390
|
+
return {
|
|
391
|
+
network: v(p.network, e.network),
|
|
392
|
+
status: v(p.status, e.status),
|
|
393
|
+
timeout: v(p.timeout, e.timeout)
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function b(e) {
|
|
397
|
+
return e === 429 || e >= 500 && e < 600;
|
|
398
|
+
}
|
|
399
|
+
function x(e, t) {
|
|
400
|
+
let n = .8 + Math.random() * .2;
|
|
401
|
+
return Math.min(e.baseDelayMs * 2 ** t * n, e.maxDelayMs);
|
|
402
|
+
}
|
|
403
|
+
function S(e) {
|
|
404
|
+
return e instanceof Error ? e : Error(String(e));
|
|
405
|
+
}
|
|
406
|
+
function C(e, t) {
|
|
407
|
+
return new Promise((n, r) => {
|
|
408
|
+
if (t.aborted) {
|
|
409
|
+
r(S(t.reason));
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
let i, a = () => {
|
|
413
|
+
clearTimeout(i), r(S(t.reason));
|
|
414
|
+
};
|
|
415
|
+
i = setTimeout(() => {
|
|
416
|
+
t.removeEventListener("abort", a), n();
|
|
417
|
+
}, e), t.addEventListener("abort", a, { once: !0 });
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
async function w(e, t) {
|
|
421
|
+
let n = new AbortController(), r = !1, i = setTimeout(() => {
|
|
422
|
+
r = !0, n.abort();
|
|
423
|
+
}, m), a = t.signal, o = () => {
|
|
424
|
+
n.abort();
|
|
425
|
+
};
|
|
426
|
+
a.aborted ? n.abort() : a.addEventListener("abort", o, { once: !0 });
|
|
427
|
+
try {
|
|
428
|
+
return {
|
|
429
|
+
kind: "response",
|
|
430
|
+
response: await T(await e(new Request(t, { signal: n.signal })))
|
|
431
|
+
};
|
|
432
|
+
} catch (e) {
|
|
433
|
+
if (a.aborted) throw e;
|
|
434
|
+
return r ? {
|
|
435
|
+
error: e,
|
|
436
|
+
kind: "timeout"
|
|
437
|
+
} : {
|
|
438
|
+
error: e,
|
|
439
|
+
kind: "network"
|
|
440
|
+
};
|
|
441
|
+
} finally {
|
|
442
|
+
clearTimeout(i), a.removeEventListener("abort", o);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
async function T(e) {
|
|
446
|
+
if (!e.body) return e;
|
|
447
|
+
let t = await e.arrayBuffer();
|
|
448
|
+
return new Response(t, {
|
|
449
|
+
headers: e.headers,
|
|
450
|
+
status: e.status,
|
|
451
|
+
statusText: e.statusText
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
336
455
|
//#region src/api.ts
|
|
337
|
-
function
|
|
338
|
-
let
|
|
456
|
+
function E(e, t = "https://openapi.tidal.com/v2/", n) {
|
|
457
|
+
let i = { async onRequest({ request: t }) {
|
|
339
458
|
let n = await e.getCredentials();
|
|
340
459
|
return t.headers.set("Authorization", `Bearer ${n.token}`), (t.method === "POST" || t.method === "PATCH" || t.method === "DELETE") && t.headers.set("Content-Type", "application/vnd.api+json"), t;
|
|
341
|
-
} },
|
|
460
|
+
} }, a = r({
|
|
342
461
|
baseUrl: t,
|
|
462
|
+
fetch: _(n),
|
|
343
463
|
querySerializer: { allowReserved: !0 }
|
|
344
464
|
});
|
|
345
|
-
return
|
|
465
|
+
return a.use(i), a;
|
|
346
466
|
}
|
|
347
467
|
//#endregion
|
|
348
|
-
export {
|
|
468
|
+
export { E as createAPIClient };
|
|
@@ -1736,6 +1736,56 @@ export interface paths {
|
|
|
1736
1736
|
patch?: never;
|
|
1737
1737
|
trace?: never;
|
|
1738
1738
|
};
|
|
1739
|
+
"/artistClaimStatuses": {
|
|
1740
|
+
parameters: {
|
|
1741
|
+
query?: never;
|
|
1742
|
+
header?: never;
|
|
1743
|
+
path?: never;
|
|
1744
|
+
cookie?: never;
|
|
1745
|
+
};
|
|
1746
|
+
/**
|
|
1747
|
+
* Get multiple artistClaimStatuses.
|
|
1748
|
+
* @description Retrieves multiple artistClaimStatuses by available filters, or without if applicable.
|
|
1749
|
+
*/
|
|
1750
|
+
get: {
|
|
1751
|
+
parameters: {
|
|
1752
|
+
query: {
|
|
1753
|
+
/** @description List of artist claim status IDs (e.g. `QVJUSVNUUzoxNTY2`) */
|
|
1754
|
+
"filter[id]": string[];
|
|
1755
|
+
};
|
|
1756
|
+
header?: never;
|
|
1757
|
+
path?: never;
|
|
1758
|
+
cookie?: never;
|
|
1759
|
+
};
|
|
1760
|
+
requestBody?: never;
|
|
1761
|
+
responses: {
|
|
1762
|
+
/** @description Successful response */
|
|
1763
|
+
200: {
|
|
1764
|
+
headers: {
|
|
1765
|
+
[name: string]: unknown;
|
|
1766
|
+
};
|
|
1767
|
+
content: {
|
|
1768
|
+
"application/vnd.api+json": components["schemas"]["ArtistClaimStatuses_Multi_Resource_Data_Document"];
|
|
1769
|
+
};
|
|
1770
|
+
};
|
|
1771
|
+
400: components["responses"]["Default400Response"];
|
|
1772
|
+
404: components["responses"]["Default404Response"];
|
|
1773
|
+
405: components["responses"]["Default405Response"];
|
|
1774
|
+
406: components["responses"]["Default406Response"];
|
|
1775
|
+
415: components["responses"]["Default415Response"];
|
|
1776
|
+
429: components["responses"]["Default429Response"];
|
|
1777
|
+
500: components["responses"]["Default500Response"];
|
|
1778
|
+
503: components["responses"]["Default503Response"];
|
|
1779
|
+
};
|
|
1780
|
+
};
|
|
1781
|
+
put?: never;
|
|
1782
|
+
post?: never;
|
|
1783
|
+
delete?: never;
|
|
1784
|
+
options?: never;
|
|
1785
|
+
head?: never;
|
|
1786
|
+
patch?: never;
|
|
1787
|
+
trace?: never;
|
|
1788
|
+
};
|
|
1739
1789
|
"/artistClaims": {
|
|
1740
1790
|
parameters: {
|
|
1741
1791
|
query?: never;
|
|
@@ -2271,7 +2321,7 @@ export interface paths {
|
|
|
2271
2321
|
*/
|
|
2272
2322
|
countryCode?: string;
|
|
2273
2323
|
/**
|
|
2274
|
-
* @description Allows the client to customize which related resources should be returned. Available options: albums, biography, followers, following, owners, profileArt, radio, roles, similarArtists, trackProviders, tracks, videos
|
|
2324
|
+
* @description Allows the client to customize which related resources should be returned. Available options: albums, biography, claimStatus, followers, following, owners, profileArt, radio, roles, similarArtists, trackProviders, tracks, videos
|
|
2275
2325
|
* @example albums
|
|
2276
2326
|
*/
|
|
2277
2327
|
include?: string[];
|
|
@@ -2375,7 +2425,7 @@ export interface paths {
|
|
|
2375
2425
|
*/
|
|
2376
2426
|
countryCode?: string;
|
|
2377
2427
|
/**
|
|
2378
|
-
* @description Allows the client to customize which related resources should be returned. Available options: albums, biography, followers, following, owners, profileArt, radio, roles, similarArtists, trackProviders, tracks, videos
|
|
2428
|
+
* @description Allows the client to customize which related resources should be returned. Available options: albums, biography, claimStatus, followers, following, owners, profileArt, radio, roles, similarArtists, trackProviders, tracks, videos
|
|
2379
2429
|
* @example albums
|
|
2380
2430
|
*/
|
|
2381
2431
|
include?: string[];
|
|
@@ -2586,6 +2636,65 @@ export interface paths {
|
|
|
2586
2636
|
patch?: never;
|
|
2587
2637
|
trace?: never;
|
|
2588
2638
|
};
|
|
2639
|
+
"/artists/{id}/relationships/claimStatus": {
|
|
2640
|
+
parameters: {
|
|
2641
|
+
query?: never;
|
|
2642
|
+
header?: never;
|
|
2643
|
+
path?: never;
|
|
2644
|
+
cookie?: never;
|
|
2645
|
+
};
|
|
2646
|
+
/**
|
|
2647
|
+
* Get claimStatus relationship ("to-one").
|
|
2648
|
+
* @description Retrieves claimStatus relationship.
|
|
2649
|
+
*/
|
|
2650
|
+
get: {
|
|
2651
|
+
parameters: {
|
|
2652
|
+
query?: {
|
|
2653
|
+
/**
|
|
2654
|
+
* @description Allows the client to customize which related resources should be returned. Available options: claimStatus
|
|
2655
|
+
* @example claimStatus
|
|
2656
|
+
*/
|
|
2657
|
+
include?: string[];
|
|
2658
|
+
};
|
|
2659
|
+
header?: never;
|
|
2660
|
+
path: {
|
|
2661
|
+
/**
|
|
2662
|
+
* @description Artist id
|
|
2663
|
+
* @example 1566
|
|
2664
|
+
*/
|
|
2665
|
+
id: string;
|
|
2666
|
+
};
|
|
2667
|
+
cookie?: never;
|
|
2668
|
+
};
|
|
2669
|
+
requestBody?: never;
|
|
2670
|
+
responses: {
|
|
2671
|
+
/** @description Successful response */
|
|
2672
|
+
200: {
|
|
2673
|
+
headers: {
|
|
2674
|
+
[name: string]: unknown;
|
|
2675
|
+
};
|
|
2676
|
+
content: {
|
|
2677
|
+
"application/vnd.api+json": components["schemas"]["Artists_Single_Relationship_Data_Document"];
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2680
|
+
400: components["responses"]["Default400Response"];
|
|
2681
|
+
404: components["responses"]["Default404Response"];
|
|
2682
|
+
405: components["responses"]["Default405Response"];
|
|
2683
|
+
406: components["responses"]["Default406Response"];
|
|
2684
|
+
415: components["responses"]["Default415Response"];
|
|
2685
|
+
429: components["responses"]["Default429Response"];
|
|
2686
|
+
500: components["responses"]["Default500Response"];
|
|
2687
|
+
503: components["responses"]["Default503Response"];
|
|
2688
|
+
};
|
|
2689
|
+
};
|
|
2690
|
+
put?: never;
|
|
2691
|
+
post?: never;
|
|
2692
|
+
delete?: never;
|
|
2693
|
+
options?: never;
|
|
2694
|
+
head?: never;
|
|
2695
|
+
patch?: never;
|
|
2696
|
+
trace?: never;
|
|
2697
|
+
};
|
|
2589
2698
|
"/artists/{id}/relationships/followers": {
|
|
2590
2699
|
parameters: {
|
|
2591
2700
|
query?: never;
|
|
@@ -3780,6 +3889,15 @@ export interface paths {
|
|
|
3780
3889
|
};
|
|
3781
3890
|
};
|
|
3782
3891
|
responses: {
|
|
3892
|
+
/** @description Successful response */
|
|
3893
|
+
200: {
|
|
3894
|
+
headers: {
|
|
3895
|
+
[name: string]: unknown;
|
|
3896
|
+
};
|
|
3897
|
+
content: {
|
|
3898
|
+
"application/vnd.api+json": components["schemas"]["Clients_Single_Resource_Data_Document"];
|
|
3899
|
+
};
|
|
3900
|
+
};
|
|
3783
3901
|
400: components["responses"]["Default400Response"];
|
|
3784
3902
|
404: components["responses"]["Default404Response"];
|
|
3785
3903
|
405: components["responses"]["Default405Response"];
|
|
@@ -8120,6 +8238,8 @@ export interface paths {
|
|
|
8120
8238
|
query?: {
|
|
8121
8239
|
/** @description Server-generated cursor value pointing a certain page of items. Optional, targets first page if not specified */
|
|
8122
8240
|
"page[cursor]"?: string;
|
|
8241
|
+
/** @description Values prefixed with "-" are sorted descending; values without it are sorted ascending. */
|
|
8242
|
+
sort?: ("addedAt" | "-addedAt" | "albums.title" | "-albums.title" | "artists.name" | "-artists.name" | "duration" | "-duration" | "itemIndex" | "-itemIndex" | "title" | "-title")[];
|
|
8123
8243
|
/**
|
|
8124
8244
|
* @description ISO 3166-1 alpha-2 country code
|
|
8125
8245
|
* @example US
|
|
@@ -19120,6 +19240,38 @@ export interface components {
|
|
|
19120
19240
|
included?: components["schemas"]["Included"];
|
|
19121
19241
|
links: components["schemas"]["Links"];
|
|
19122
19242
|
};
|
|
19243
|
+
ArtistClaimStatuses_Attributes: {
|
|
19244
|
+
/** @description Claim sources contributing to the current status. Empty when there is no active claim. */
|
|
19245
|
+
claimSources: ("ARTIST_CLAIMS" | "MANUAL_ARTIST_CLAIMS")[];
|
|
19246
|
+
/**
|
|
19247
|
+
* @description Whether the artist profile currently has an active claim
|
|
19248
|
+
* @enum {string}
|
|
19249
|
+
*/
|
|
19250
|
+
status: "CLAIM_IN_PROGRESS" | "NO_ACTIVE_CLAIM";
|
|
19251
|
+
};
|
|
19252
|
+
ArtistClaimStatuses_Multi_Resource_Data_Document: {
|
|
19253
|
+
data: components["schemas"]["ArtistClaimStatuses_Resource_Object"][];
|
|
19254
|
+
included?: components["schemas"]["Included"];
|
|
19255
|
+
links: components["schemas"]["Links"];
|
|
19256
|
+
};
|
|
19257
|
+
ArtistClaimStatuses_Resource_Object: {
|
|
19258
|
+
attributes?: components["schemas"]["ArtistClaimStatuses_Attributes"];
|
|
19259
|
+
/**
|
|
19260
|
+
* @description Resource id
|
|
19261
|
+
* @example 12345
|
|
19262
|
+
*/
|
|
19263
|
+
id: string;
|
|
19264
|
+
/**
|
|
19265
|
+
* @description Resource type (enum property replaced by openapi-typescript)
|
|
19266
|
+
* @enum {string}
|
|
19267
|
+
*/
|
|
19268
|
+
type: "artistClaimStatuses";
|
|
19269
|
+
};
|
|
19270
|
+
ArtistClaimStatuses_Single_Resource_Data_Document: {
|
|
19271
|
+
data: components["schemas"]["ArtistClaimStatuses_Resource_Object"];
|
|
19272
|
+
included?: components["schemas"]["Included"];
|
|
19273
|
+
links: components["schemas"]["Links"];
|
|
19274
|
+
};
|
|
19123
19275
|
ArtistClaimsAcceptedArtistsRelationshipUpdateOperation_Payload: {
|
|
19124
19276
|
data: components["schemas"]["ArtistClaimsAcceptedArtistsRelationshipUpdateOperation_Payload_Data"][];
|
|
19125
19277
|
};
|
|
@@ -19413,6 +19565,7 @@ export interface components {
|
|
|
19413
19565
|
Artists_Relationships: {
|
|
19414
19566
|
albums?: components["schemas"]["Multi_Relationship_Data_Document"];
|
|
19415
19567
|
biography?: components["schemas"]["Single_Relationship_Data_Document"];
|
|
19568
|
+
claimStatus?: components["schemas"]["Single_Relationship_Data_Document"];
|
|
19416
19569
|
followers?: components["schemas"]["Artists_Followers_Multi_Relationship_Data_Document"];
|
|
19417
19570
|
following?: components["schemas"]["Artists_Following_Multi_Relationship_Data_Document"];
|
|
19418
19571
|
owners?: components["schemas"]["Multi_Relationship_Data_Document"];
|
|
@@ -20240,7 +20393,7 @@ export interface components {
|
|
|
20240
20393
|
* @example SHORTCUTS
|
|
20241
20394
|
* @enum {string}
|
|
20242
20395
|
*/
|
|
20243
|
-
sourceType: "ALBUM_RECOMMENDATIONS" | "BECAUSE_YOU_LISTENED_TO_ALBUM" | "BECAUSE_YOU_ADDED_ALBUM" | "BECAUSE_YOU_ADDED_ARTIST" | "CONTINUE_LISTEN_TO" | "DAILY_MIXES" | "FORGOTTEN_FAVORITES" | "GENRE_MIXES" | "HISTORY_MIXES" | "LOCAL_PLAYLISTS" | "MY_PLAYLISTS" | "NEW_ALBUM_SUGGESTIONS" | "NEW_TRACK_SUGGESTIONS" | "NEW_ALBUMS" | "NEW_TRACKS" | "POPULAR_PLAYLISTS" | "RECENTLY_UPDATED_FAVORITED_PLAYLIST" | "RECOMMENDED_USERS_PLAYLISTS" | "SUGGESTED_ESSENTIAL_PLAYLISTS" | "SUGGESTED_RADIOS_MIXES" | "WELCOME_MIX" | "YOUR_FAVORITE_ARTISTS" | "UPLOADS_FOR_YOU" | "LATEST_SPOTLIGHTED_TRACKS" | "SHORTCUTS" | "ARTIST_TOP_TRACKS" | "ARTIST_SPOTLIGHTED_TRACKS" | "ARTIST_ALBUMS" | "ARTIST_TOP_SINGLES" | "ARTIST_COMPILATIONS" | "ARTIST_LIVE_ALBUMS" | "ARTIST_APPEARS_ON" | "ARTIST_PLAYLIST" | "ARTIST_PUBLIC_PLAYLIST" | "ARTIST_SIMILAR_ARTISTS" | "ARTIST_TRACK_UPLOADS" | "ARTIST_LINKS" | "ARTIST_VIDEOS" | "ARTIST_CREDITS" | "ALBUM_ITEMS" | "ALBUM_MORE_BY_ARTIST" | "ALBUM_OTHER_VERSIONS" | "ALBUM_RELATED_ALBUMS" | "ALBUM_RELATED_ARTISTS" | "COLLECTION_ITEMS" | "ALBUM_ANNIVERSARY" | "ARTIST_BIRTHDAY" | "ARTIST_MEMORIAM" | "DJ_TOOLS" | "DJ_ARTIST_CURATED" | "THE_HITS" | "FROM_OUR_EDITORS" | "TOP_PLAYLISTS" | "FEATURED_TOP_TRACKS" | "FEATURED_TOP_ALBUMS" | "TOP_ARTISTS_ESSENTIALS" | "FEATURED_RECOMMENDED_PLAYLISTS" | "HOME_3_FEATURED_PLAYLISTS" | "HOME_3_FEATURED_UPLOAD_TRACKS" | "HOME_3_FEATURED_ALBUMS" | "POPULAR_ALBUMS" | "POPULAR_ARTISTS" | "POPULAR_MIXES" | "FEATURED_RECOMMENDED_TRACKS" | "FEATURED_RECOMMENDED_ALBUMS" | "FEATURED_RECOMMENDED_CLASSIC_ALBUMS" | "BACK_TO_SCHOOL_MUSIC_101" | "BACK_TO_SCHOOL_GENRES_FOR_BEGINNERS" | "HEADLINERS_2026" | "HOME_3_0_GENERIC_PLAYLISTS_1" | "HOME_3_0_GENERIC_PLAYLISTS_2" | "HOME_3_0_GENERIC_ALBUMS_1" | "HOME_3_0_GENERIC_TRACKS_1" | "HOME_3_0_GENERIC_ARTISTS_1" | "HOME_3_0_GENERIC_VIDEOS_1" | "STAFF_PICKS_PAGE_ALBUMS_WE_LOVE" | "STAFF_PICKS_PAGE_EXPLORE" | "STAFF_PICKS_PAGE_FAVORITE_SONGS" | "STAFF_PICKS_PAGE_RECENTLY_UPDATED_PLAYLISTS" | "STAFF_PICKS_PAGE_TIDAL_NEWS_MAGAZINE" | "STAFF_PICKS_PAGE_WHAT_LISTENING_TO" | "BASED_ON_YOUR_INTERESTS_1" | "BASED_ON_YOUR_INTERESTS_2" | "UPLOAD_PAGE_SPOTLIGHTED_PLAYLISTS" | "UPLOAD_PAGE_PAYGATED_ALBUMS" | "UPLOAD_PAGE_ALBUMS" | "TOP_UPLOADERS" | "UPLOAD_PAGE_ARTISTS" | "UPLOAD_PAGE_FEATURED_MAGAZINE" | "EXPLORE_DECADES" | "EXPLORE_GENRES" | "EXPLORE_MOODS" | "UNKNOWN";
|
|
20396
|
+
sourceType: "ALBUM_RECOMMENDATIONS" | "BECAUSE_YOU_LISTENED_TO_ALBUM" | "BECAUSE_YOU_ADDED_ALBUM" | "BECAUSE_YOU_ADDED_ARTIST" | "CONTINUE_LISTEN_TO" | "DAILY_MIXES" | "FORGOTTEN_FAVORITES" | "GENRE_MIXES" | "HISTORY_MIXES" | "LOCAL_PLAYLISTS" | "MY_PLAYLISTS" | "NEW_ALBUM_SUGGESTIONS" | "NEW_TRACK_SUGGESTIONS" | "NEW_ALBUMS" | "NEW_TRACKS" | "POPULAR_PLAYLISTS" | "RECENTLY_UPDATED_FAVORITED_PLAYLIST" | "RECOMMENDED_USERS_PLAYLISTS" | "SUGGESTED_ESSENTIAL_PLAYLISTS" | "SUGGESTED_RADIOS_MIXES" | "WELCOME_MIX" | "YOUR_FAVORITE_ARTISTS" | "UPLOADS_FOR_YOU" | "LATEST_SPOTLIGHTED_TRACKS" | "SHORTCUTS" | "ARTIST_TOP_TRACKS" | "ARTIST_SPOTLIGHTED_TRACKS" | "ARTIST_ALBUMS" | "ARTIST_TOP_SINGLES" | "ARTIST_COMPILATIONS" | "ARTIST_LIVE_ALBUMS" | "ARTIST_APPEARS_ON" | "ARTIST_PLAYLIST" | "ARTIST_PUBLIC_PLAYLIST" | "ARTIST_SIMILAR_ARTISTS" | "ARTIST_TRACK_UPLOADS" | "ARTIST_LINKS" | "ARTIST_VIDEOS" | "ARTIST_CREDITS" | "ARTIST_DISCOGRAPHY" | "ALBUM_ITEMS" | "ALBUM_MORE_BY_ARTIST" | "ALBUM_OTHER_VERSIONS" | "ALBUM_RELATED_ALBUMS" | "ALBUM_RELATED_ARTISTS" | "COLLECTION_ITEMS" | "ALBUM_ANNIVERSARY" | "ARTIST_BIRTHDAY" | "ARTIST_MEMORIAM" | "DJ_TOOLS" | "DJ_ARTIST_CURATED" | "THE_HITS" | "FROM_OUR_EDITORS" | "TOP_PLAYLISTS" | "FEATURED_TOP_TRACKS" | "FEATURED_TOP_ALBUMS" | "TOP_ARTISTS_ESSENTIALS" | "FEATURED_RECOMMENDED_PLAYLISTS" | "HOME_3_FEATURED_PLAYLISTS" | "HOME_3_FEATURED_UPLOAD_TRACKS" | "HOME_3_FEATURED_ALBUMS" | "POPULAR_ALBUMS" | "POPULAR_ARTISTS" | "POPULAR_MIXES" | "FEATURED_RECOMMENDED_TRACKS" | "FEATURED_RECOMMENDED_ALBUMS" | "FEATURED_RECOMMENDED_CLASSIC_ALBUMS" | "BACK_TO_SCHOOL_MUSIC_101" | "BACK_TO_SCHOOL_GENRES_FOR_BEGINNERS" | "HEADLINERS_2026" | "HOME_3_0_GENERIC_PLAYLISTS_1" | "HOME_3_0_GENERIC_PLAYLISTS_2" | "HOME_3_0_GENERIC_ALBUMS_1" | "HOME_3_0_GENERIC_TRACKS_1" | "HOME_3_0_GENERIC_ARTISTS_1" | "HOME_3_0_GENERIC_VIDEOS_1" | "STAFF_PICKS_PAGE_ALBUMS_WE_LOVE" | "STAFF_PICKS_PAGE_EXPLORE" | "STAFF_PICKS_PAGE_FAVORITE_SONGS" | "STAFF_PICKS_PAGE_RECENTLY_UPDATED_PLAYLISTS" | "STAFF_PICKS_PAGE_TIDAL_NEWS_MAGAZINE" | "STAFF_PICKS_PAGE_WHAT_LISTENING_TO" | "BASED_ON_YOUR_INTERESTS_1" | "BASED_ON_YOUR_INTERESTS_2" | "UPLOAD_PAGE_SPOTLIGHTED_PLAYLISTS" | "UPLOAD_PAGE_PAYGATED_ALBUMS" | "UPLOAD_PAGE_ALBUMS" | "TOP_UPLOADERS" | "UPLOAD_PAGE_ARTISTS" | "UPLOAD_PAGE_FEATURED_MAGAZINE" | "EXPLORE_DECADES" | "EXPLORE_GENRES" | "EXPLORE_MOODS" | "UNKNOWN";
|
|
20244
20397
|
/**
|
|
20245
20398
|
* @description Subtitle of the module
|
|
20246
20399
|
* @example Short description of this module
|
|
@@ -20290,7 +20443,7 @@ export interface components {
|
|
|
20290
20443
|
* @example HOME_STATIC
|
|
20291
20444
|
* @enum {string}
|
|
20292
20445
|
*/
|
|
20293
|
-
pageType: "HOME_STATIC" | "HOME_UPLOADS" | "HOME_EDITORIAL" | "HOME_FREE" | "ARTIST" | "ALBUM" | "PLAYLIST";
|
|
20446
|
+
pageType: "HOME_STATIC" | "HOME_UPLOADS" | "HOME_EDITORIAL" | "HOME_FREE" | "ARTIST" | "ALBUM" | "PLAYLIST" | "TRACK" | "VIDEO";
|
|
20294
20447
|
/**
|
|
20295
20448
|
* Format: uuid
|
|
20296
20449
|
* @description Id used for reporting user events
|
|
@@ -20472,7 +20625,7 @@ export interface components {
|
|
|
20472
20625
|
status: string;
|
|
20473
20626
|
}[];
|
|
20474
20627
|
};
|
|
20475
|
-
Included: (components["schemas"]["AcceptedTerms_Resource_Object"] | components["schemas"]["AlbumStatistics_Resource_Object"] | components["schemas"]["Albums_Resource_Object"] | components["schemas"]["Appreciations_Resource_Object"] | components["schemas"]["ArtistBiographies_Resource_Object"] | components["schemas"]["ArtistClaims_Resource_Object"] | components["schemas"]["ArtistRoles_Resource_Object"] | components["schemas"]["Artists_Resource_Object"] | components["schemas"]["Artworks_Resource_Object"] | components["schemas"]["Clients_Resource_Object"] | components["schemas"]["CollaborationInviteRedemptions_Resource_Object"] | components["schemas"]["CollaborationInvites_Resource_Object"] | components["schemas"]["Comments_Resource_Object"] | components["schemas"]["ContentClaims_Resource_Object"] | components["schemas"]["Credits_Resource_Object"] | components["schemas"]["Downloads_Resource_Object"] | components["schemas"]["DspSharingLinks_Resource_Object"] | components["schemas"]["DynamicModules_Resource_Object"] | components["schemas"]["DynamicPages_Resource_Object"] | components["schemas"]["Genres_Resource_Object"] | components["schemas"]["Installations_Resource_Object"] | components["schemas"]["Lyrics_Resource_Object"] | components["schemas"]["ManualArtistClaims_Resource_Object"] | components["schemas"]["OfflineTasks_Resource_Object"] | components["schemas"]["PlayQueues_Resource_Object"] | components["schemas"]["Playlists_Resource_Object"] | components["schemas"]["PriceConfigurations_Resource_Object"] | components["schemas"]["ProviderOwners_Resource_Object"] | components["schemas"]["ProviderProductInfos_Resource_Object"] | components["schemas"]["Providers_Resource_Object"] | components["schemas"]["Purchases_Resource_Object"] | components["schemas"]["Reactions_Resource_Object"] | components["schemas"]["SavedShares_Resource_Object"] | components["schemas"]["Scopes_Resource_Object"] | components["schemas"]["SearchHistoryEntries_Resource_Object"] | components["schemas"]["SearchResults_Resource_Object"] | components["schemas"]["SearchSuggestions_Resource_Object"] | components["schemas"]["Shares_Resource_Object"] | components["schemas"]["SquareConnections_Resource_Object"] | components["schemas"]["StripeConnections_Resource_Object"] | components["schemas"]["StripeDashboardLinks_Resource_Object"] | components["schemas"]["TemporaryUserTokens_Resource_Object"] | components["schemas"]["Terms_Resource_Object"] | components["schemas"]["TrackFiles_Resource_Object"] | components["schemas"]["TrackManifests_Resource_Object"] | components["schemas"]["TrackSourceFiles_Resource_Object"] | components["schemas"]["TrackStatistics_Resource_Object"] | components["schemas"]["Tracks_Resource_Object"] | components["schemas"]["TracksMetadataStatus_Resource_Object"] | components["schemas"]["UsageRules_Resource_Object"] | components["schemas"]["UserCollectionAlbums_Resource_Object"] | components["schemas"]["UserCollectionArtists_Resource_Object"] | components["schemas"]["UserCollectionFolders_Resource_Object"] | components["schemas"]["UserCollectionPlaylists_Resource_Object"] | components["schemas"]["UserCollectionSaveForLaters_Resource_Object"] | components["schemas"]["UserCollectionTracks_Resource_Object"] | components["schemas"]["UserCollectionVideos_Resource_Object"] | components["schemas"]["UserCollections_Resource_Object"] | components["schemas"]["UserDailyMixes_Resource_Object"] | components["schemas"]["UserDataExportRequests_Resource_Object"] | components["schemas"]["UserDiscoveryMixes_Resource_Object"] | components["schemas"]["UserNewReleaseMixes_Resource_Object"] | components["schemas"]["UserOfflineMixes_Resource_Object"] | components["schemas"]["UserRecommendationBlocks_Resource_Object"] | components["schemas"]["UserRecommendations_Resource_Object"] | components["schemas"]["UserReports_Resource_Object"] | components["schemas"]["Users_Resource_Object"] | components["schemas"]["VideoManifests_Resource_Object"] | components["schemas"]["Videos_Resource_Object"])[];
|
|
20628
|
+
Included: (components["schemas"]["AcceptedTerms_Resource_Object"] | components["schemas"]["AlbumStatistics_Resource_Object"] | components["schemas"]["Albums_Resource_Object"] | components["schemas"]["Appreciations_Resource_Object"] | components["schemas"]["ArtistBiographies_Resource_Object"] | components["schemas"]["ArtistClaimStatuses_Resource_Object"] | components["schemas"]["ArtistClaims_Resource_Object"] | components["schemas"]["ArtistRoles_Resource_Object"] | components["schemas"]["Artists_Resource_Object"] | components["schemas"]["Artworks_Resource_Object"] | components["schemas"]["Clients_Resource_Object"] | components["schemas"]["CollaborationInviteRedemptions_Resource_Object"] | components["schemas"]["CollaborationInvites_Resource_Object"] | components["schemas"]["Comments_Resource_Object"] | components["schemas"]["ContentClaims_Resource_Object"] | components["schemas"]["Credits_Resource_Object"] | components["schemas"]["Downloads_Resource_Object"] | components["schemas"]["DspSharingLinks_Resource_Object"] | components["schemas"]["DynamicModules_Resource_Object"] | components["schemas"]["DynamicPages_Resource_Object"] | components["schemas"]["Genres_Resource_Object"] | components["schemas"]["Installations_Resource_Object"] | components["schemas"]["Lyrics_Resource_Object"] | components["schemas"]["ManualArtistClaims_Resource_Object"] | components["schemas"]["OfflineTasks_Resource_Object"] | components["schemas"]["PlayQueues_Resource_Object"] | components["schemas"]["Playlists_Resource_Object"] | components["schemas"]["PriceConfigurations_Resource_Object"] | components["schemas"]["ProviderOwners_Resource_Object"] | components["schemas"]["ProviderProductInfos_Resource_Object"] | components["schemas"]["Providers_Resource_Object"] | components["schemas"]["Purchases_Resource_Object"] | components["schemas"]["Reactions_Resource_Object"] | components["schemas"]["SavedShares_Resource_Object"] | components["schemas"]["Scopes_Resource_Object"] | components["schemas"]["SearchHistoryEntries_Resource_Object"] | components["schemas"]["SearchResults_Resource_Object"] | components["schemas"]["SearchSuggestions_Resource_Object"] | components["schemas"]["Shares_Resource_Object"] | components["schemas"]["SquareConnections_Resource_Object"] | components["schemas"]["StripeConnections_Resource_Object"] | components["schemas"]["StripeDashboardLinks_Resource_Object"] | components["schemas"]["TemporaryUserTokens_Resource_Object"] | components["schemas"]["Terms_Resource_Object"] | components["schemas"]["TrackFiles_Resource_Object"] | components["schemas"]["TrackManifests_Resource_Object"] | components["schemas"]["TrackSourceFiles_Resource_Object"] | components["schemas"]["TrackStatistics_Resource_Object"] | components["schemas"]["Tracks_Resource_Object"] | components["schemas"]["TracksMetadataStatus_Resource_Object"] | components["schemas"]["UsageRules_Resource_Object"] | components["schemas"]["UserCollectionAlbums_Resource_Object"] | components["schemas"]["UserCollectionArtists_Resource_Object"] | components["schemas"]["UserCollectionFolders_Resource_Object"] | components["schemas"]["UserCollectionPlaylists_Resource_Object"] | components["schemas"]["UserCollectionSaveForLaters_Resource_Object"] | components["schemas"]["UserCollectionTracks_Resource_Object"] | components["schemas"]["UserCollectionVideos_Resource_Object"] | components["schemas"]["UserCollections_Resource_Object"] | components["schemas"]["UserDailyMixes_Resource_Object"] | components["schemas"]["UserDataExportRequests_Resource_Object"] | components["schemas"]["UserDiscoveryMixes_Resource_Object"] | components["schemas"]["UserNewReleaseMixes_Resource_Object"] | components["schemas"]["UserOfflineMixes_Resource_Object"] | components["schemas"]["UserRecommendationBlocks_Resource_Object"] | components["schemas"]["UserRecommendations_Resource_Object"] | components["schemas"]["UserReports_Resource_Object"] | components["schemas"]["Users_Resource_Object"] | components["schemas"]["VideoManifests_Resource_Object"] | components["schemas"]["Videos_Resource_Object"])[];
|
|
20476
20629
|
InstallationsCreateOperation_Payload: {
|
|
20477
20630
|
data: components["schemas"]["InstallationsCreateOperation_Payload_Data"];
|
|
20478
20631
|
};
|
|
@@ -24366,6 +24519,12 @@ export interface components {
|
|
|
24366
24519
|
* @example US
|
|
24367
24520
|
*/
|
|
24368
24521
|
country: string;
|
|
24522
|
+
/**
|
|
24523
|
+
* @description Developer access tier for this user.
|
|
24524
|
+
* @example THIRD_PARTY
|
|
24525
|
+
* @enum {string}
|
|
24526
|
+
*/
|
|
24527
|
+
developerAccessTier: "THIRD_PARTY" | "THIRD_PARTY_PROD" | "PARTNER" | "INTERNAL";
|
|
24369
24528
|
/**
|
|
24370
24529
|
* @description email address
|
|
24371
24530
|
* @example test@test.com
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CredentialsProvider } from '@tidal-music/common';
|
|
2
2
|
import { paths } from './allAPI.generated.js';
|
|
3
|
+
import { RetryOptions } from './retry.js';
|
|
3
4
|
/**
|
|
4
5
|
* Create a Tidal API client with the provided credentials.
|
|
5
6
|
*
|
|
6
7
|
* @param credentialsProvider The credentials provider, from Auth module.
|
|
7
8
|
* @param baseUrl Override the base URL to use for the API client.
|
|
9
|
+
* @param retryOptions Customize the retry mechanism applied to read-only
|
|
10
|
+
* (GET/HEAD/OPTIONS) requests. Pass `{ enabled: false }` to disable it.
|
|
8
11
|
* @returns A Tidal API client.
|
|
9
12
|
*/
|
|
10
|
-
export declare function createAPIClient(credentialsProvider: CredentialsProvider, baseUrl?: string): import('openapi-fetch').Client<paths, `${string}/${string}`>;
|
|
13
|
+
export declare function createAPIClient(credentialsProvider: CredentialsProvider, baseUrl?: string, retryOptions?: RetryOptions): import('openapi-fetch').Client<paths, `${string}/${string}`>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP retry mechanism for the TIDAL API client
|
|
3
|
+
*
|
|
4
|
+
* Read-only requests (GET/HEAD/OPTIONS) are retried with exponential backoff
|
|
5
|
+
* and jitter. The delay before a retry is
|
|
6
|
+
*
|
|
7
|
+
* D = min(B * 2 ** n * j, M)
|
|
8
|
+
*
|
|
9
|
+
* where B is the base delay, n is the zero-based retry number, j is a random
|
|
10
|
+
* jitter factor in [0.8, 1) and M is the maximum delay.
|
|
11
|
+
*
|
|
12
|
+
* Write requests (POST/PATCH/PUT/DELETE) are passed through untouched.
|
|
13
|
+
*/
|
|
14
|
+
/** A fetch implementation compatible with openapi-fetch's `fetch` option. */
|
|
15
|
+
type FetchLike = (input: Request) => Promise<Response>;
|
|
16
|
+
type RetryPolicy = {
|
|
17
|
+
/** Base delay B in milliseconds. */
|
|
18
|
+
baseDelayMs: number;
|
|
19
|
+
/** Maximum delay M in milliseconds; the backoff is clamped to this. */
|
|
20
|
+
maxDelayMs: number;
|
|
21
|
+
/** Maximum number of retries N, in addition to the initial attempt. */
|
|
22
|
+
maxRetries: number;
|
|
23
|
+
};
|
|
24
|
+
type RetryCategory = 'network' | 'status' | 'timeout';
|
|
25
|
+
export type RetryOptions = Partial<Record<RetryCategory, Partial<RetryPolicy>>> & {
|
|
26
|
+
/** Set to `false` to disable retries and the read timeout entirely. */
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** Per-attempt read timeout in milliseconds. */
|
|
30
|
+
export declare const READ_TIMEOUT_MS = 10000;
|
|
31
|
+
/**
|
|
32
|
+
* Wraps a fetch implementation with a retry mechanism. The returned function
|
|
33
|
+
* matches openapi-fetch's `fetch` option signature, so it can be passed
|
|
34
|
+
* straight to `createClient({ fetch })`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function fetchWithRetry(options?: RetryOptions, baseFetch?: FetchLike): FetchLike;
|
|
37
|
+
export {};
|