harmonyy 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/README.md +103 -0
- package/dist/App.d.ts +8 -0
- package/dist/App.js +1 -0
- package/dist/apple/index.d.ts +13 -0
- package/dist/apple/index.js +97 -0
- package/dist/apple/types.d.ts +533 -0
- package/dist/apple/types.js +1 -0
- package/dist/spotify/index.d.ts +53 -0
- package/dist/spotify/index.js +212 -0
- package/dist/spotify/types.d.ts +406 -0
- package/dist/spotify/types.js +2 -0
- package/dist/youtube/index.d.ts +16 -0
- package/dist/youtube/index.js +93 -0
- package/dist/youtube/types.d.ts +418 -0
- package/dist/youtube/types.js +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
type ArtworkBase = {
|
|
2
|
+
bgColor: string;
|
|
3
|
+
hasP3: boolean;
|
|
4
|
+
height: number;
|
|
5
|
+
textColor1: string;
|
|
6
|
+
textColor2: string;
|
|
7
|
+
textColor3: string;
|
|
8
|
+
textColor4: string;
|
|
9
|
+
url: string;
|
|
10
|
+
width: number;
|
|
11
|
+
};
|
|
12
|
+
type ArtistArtwork = ArtworkBase & {
|
|
13
|
+
defaultCropCode: string;
|
|
14
|
+
};
|
|
15
|
+
type HeroArtwork = ArtworkBase & {
|
|
16
|
+
recommendedCropCodes: string[];
|
|
17
|
+
};
|
|
18
|
+
type EditorialArtwork = {
|
|
19
|
+
centeredFullscreenBackground: ArtworkBase;
|
|
20
|
+
originalFlowcaseBrick: ArtworkBase;
|
|
21
|
+
storeFlowcase: ArtworkBase;
|
|
22
|
+
};
|
|
23
|
+
type HeroContent = {
|
|
24
|
+
artwork: HeroArtwork;
|
|
25
|
+
};
|
|
26
|
+
type Hero = {
|
|
27
|
+
content: HeroContent[];
|
|
28
|
+
};
|
|
29
|
+
type PlainEditorialNotes = {
|
|
30
|
+
short: string;
|
|
31
|
+
};
|
|
32
|
+
type ArtistAttributes = {
|
|
33
|
+
artistBio: string;
|
|
34
|
+
artwork: ArtistArtwork;
|
|
35
|
+
bornOrFormed: string;
|
|
36
|
+
editorialArtwork: EditorialArtwork;
|
|
37
|
+
genreNames: string[];
|
|
38
|
+
hero: Hero[];
|
|
39
|
+
isGroup: boolean;
|
|
40
|
+
name: string;
|
|
41
|
+
origin: string;
|
|
42
|
+
plainEditorialNotes: PlainEditorialNotes;
|
|
43
|
+
url: string;
|
|
44
|
+
};
|
|
45
|
+
type ResourceRef<T extends string> = {
|
|
46
|
+
id: string;
|
|
47
|
+
type: T;
|
|
48
|
+
href: string;
|
|
49
|
+
};
|
|
50
|
+
type RelationshipList<T extends string> = {
|
|
51
|
+
href: string;
|
|
52
|
+
data: ResourceRef<T>[];
|
|
53
|
+
};
|
|
54
|
+
type ArtistRelationships = {
|
|
55
|
+
bands: RelationshipList<'bands'>;
|
|
56
|
+
persons: RelationshipList<'persons'>;
|
|
57
|
+
};
|
|
58
|
+
type ViewBase<T extends string> = {
|
|
59
|
+
href: string;
|
|
60
|
+
next?: string;
|
|
61
|
+
attributes: {
|
|
62
|
+
title: string;
|
|
63
|
+
};
|
|
64
|
+
data: ResourceRef<T>[];
|
|
65
|
+
meta?: {
|
|
66
|
+
count: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
type ArtistViews = {
|
|
70
|
+
'all-upcoming-concerts': ViewBase<'concerts'> & {
|
|
71
|
+
meta: {
|
|
72
|
+
count: number;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
'appears-on-albums': ViewBase<'albums'>;
|
|
76
|
+
'compilation-albums': ViewBase<'albums'>;
|
|
77
|
+
'featured-albums': ViewBase<'albums'>;
|
|
78
|
+
'featured-release': ViewBase<never>;
|
|
79
|
+
'full-albums': ViewBase<'albums'>;
|
|
80
|
+
'latest-release': ViewBase<never>;
|
|
81
|
+
'live-albums': ViewBase<'albums'>;
|
|
82
|
+
'more-to-hear': ViewBase<'stations'>;
|
|
83
|
+
'more-to-see': ViewBase<'uploaded-videos'>;
|
|
84
|
+
'music-videos': ViewBase<'music-videos'>;
|
|
85
|
+
playlists: ViewBase<'playlists'>;
|
|
86
|
+
'radio-shows': ViewBase<'apple-curators'>;
|
|
87
|
+
'similar-artists': ViewBase<'artists'>;
|
|
88
|
+
singles: ViewBase<'albums'>;
|
|
89
|
+
'top-songs': ViewBase<'songs'>;
|
|
90
|
+
};
|
|
91
|
+
type ViewOrder = keyof ArtistViews;
|
|
92
|
+
type ArtistMeta = {
|
|
93
|
+
views: {
|
|
94
|
+
order: ViewOrder[];
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
type Artist = {
|
|
98
|
+
id: string;
|
|
99
|
+
type: 'artists';
|
|
100
|
+
href: string;
|
|
101
|
+
attributes: ArtistAttributes;
|
|
102
|
+
relationships: ArtistRelationships;
|
|
103
|
+
views: ArtistViews;
|
|
104
|
+
meta: ArtistMeta;
|
|
105
|
+
};
|
|
106
|
+
type AudioTrait = 'atmos' | 'lossless' | 'lossy-stereo' | 'spatial' | 'hi-res-lossless';
|
|
107
|
+
type ContentRating = 'explicit' | 'clean';
|
|
108
|
+
type SuperHeroTall = ArtworkBase & {
|
|
109
|
+
gradient: Record<string, unknown>;
|
|
110
|
+
};
|
|
111
|
+
type AlbumEditorialArtwork = {
|
|
112
|
+
storeFlowcase?: ArtworkBase;
|
|
113
|
+
subscriptionHero?: ArtworkBase;
|
|
114
|
+
superHeroTall?: SuperHeroTall;
|
|
115
|
+
centeredFullscreenBackground?: ArtworkBase;
|
|
116
|
+
};
|
|
117
|
+
type AlbumPlainEditorialNotes = {
|
|
118
|
+
short?: string;
|
|
119
|
+
standard?: string;
|
|
120
|
+
};
|
|
121
|
+
type PlayParams = {
|
|
122
|
+
id: string;
|
|
123
|
+
kind: 'album';
|
|
124
|
+
};
|
|
125
|
+
type AlbumAttributes = {
|
|
126
|
+
artistName: string;
|
|
127
|
+
artwork: ArtworkBase;
|
|
128
|
+
audioTraits: AudioTrait[];
|
|
129
|
+
contentRating?: ContentRating;
|
|
130
|
+
copyright: string;
|
|
131
|
+
editorialArtwork: AlbumEditorialArtwork;
|
|
132
|
+
genreNames: string[];
|
|
133
|
+
isCompilation: boolean;
|
|
134
|
+
isComplete: boolean;
|
|
135
|
+
isMasteredForItunes: boolean;
|
|
136
|
+
isPrerelease: boolean;
|
|
137
|
+
isSingle: boolean;
|
|
138
|
+
name: string;
|
|
139
|
+
plainEditorialNotes?: AlbumPlainEditorialNotes;
|
|
140
|
+
playParams: PlayParams;
|
|
141
|
+
recordLabel: string;
|
|
142
|
+
releaseDate: string;
|
|
143
|
+
trackCount: number;
|
|
144
|
+
upc: string;
|
|
145
|
+
url: string;
|
|
146
|
+
};
|
|
147
|
+
type Album = {
|
|
148
|
+
id: string;
|
|
149
|
+
type: 'albums';
|
|
150
|
+
href: string;
|
|
151
|
+
attributes: AlbumAttributes;
|
|
152
|
+
};
|
|
153
|
+
type ConcertAttributes = {
|
|
154
|
+
endISODateTime: string;
|
|
155
|
+
name: string;
|
|
156
|
+
startISODateTime: string;
|
|
157
|
+
timezone: string;
|
|
158
|
+
url: string;
|
|
159
|
+
};
|
|
160
|
+
type ConcertRelationships = {
|
|
161
|
+
venues: RelationshipList<'venues'>;
|
|
162
|
+
};
|
|
163
|
+
type Concert = {
|
|
164
|
+
id: string;
|
|
165
|
+
type: 'concerts';
|
|
166
|
+
href: string;
|
|
167
|
+
attributes: ConcertAttributes;
|
|
168
|
+
relationships: ConcertRelationships;
|
|
169
|
+
};
|
|
170
|
+
type VideoTrait = '4K' | 'HDR';
|
|
171
|
+
type MusicVideoPlayParams = {
|
|
172
|
+
id: string;
|
|
173
|
+
kind: 'musicVideo';
|
|
174
|
+
};
|
|
175
|
+
type Preview = {
|
|
176
|
+
artwork: ArtworkBase;
|
|
177
|
+
hlsUrl: string;
|
|
178
|
+
url: string;
|
|
179
|
+
};
|
|
180
|
+
type MusicVideoAttributes = {
|
|
181
|
+
artistName: string;
|
|
182
|
+
artwork: ArtworkBase;
|
|
183
|
+
durationInMillis: number;
|
|
184
|
+
editorialArtwork: Partial<AlbumEditorialArtwork>;
|
|
185
|
+
genreNames: string[];
|
|
186
|
+
has4K: boolean;
|
|
187
|
+
hasHDR: boolean;
|
|
188
|
+
isrc: string;
|
|
189
|
+
name: string;
|
|
190
|
+
playParams: MusicVideoPlayParams;
|
|
191
|
+
previews: Preview[];
|
|
192
|
+
releaseDate: string;
|
|
193
|
+
url: string;
|
|
194
|
+
videoTraits: VideoTrait[];
|
|
195
|
+
};
|
|
196
|
+
type MusicVideoRelationships = {
|
|
197
|
+
artists: RelationshipList<'artists'>;
|
|
198
|
+
};
|
|
199
|
+
type MusicVideo = {
|
|
200
|
+
id: string;
|
|
201
|
+
type: 'music-videos';
|
|
202
|
+
href: string;
|
|
203
|
+
attributes: MusicVideoAttributes;
|
|
204
|
+
relationships: MusicVideoRelationships;
|
|
205
|
+
};
|
|
206
|
+
type PersonAttributes = {
|
|
207
|
+
name: string;
|
|
208
|
+
primaryRole: string;
|
|
209
|
+
roleDescription: string;
|
|
210
|
+
url: string;
|
|
211
|
+
};
|
|
212
|
+
type Person = {
|
|
213
|
+
id: string;
|
|
214
|
+
type: 'persons';
|
|
215
|
+
attributes: PersonAttributes;
|
|
216
|
+
};
|
|
217
|
+
type EditorialVideoEntry = {
|
|
218
|
+
previewFrame: ArtworkBase;
|
|
219
|
+
video: string;
|
|
220
|
+
};
|
|
221
|
+
type EditorialVideo = {
|
|
222
|
+
motionMediumVideo16x9?: EditorialVideoEntry;
|
|
223
|
+
motionSquareVideo1x1?: EditorialVideoEntry;
|
|
224
|
+
motionTallVideo3x4?: EditorialVideoEntry;
|
|
225
|
+
motionWideVideo21x9?: EditorialVideoEntry;
|
|
226
|
+
};
|
|
227
|
+
type CuratorEditorialArtwork = {
|
|
228
|
+
bannerUber?: ArtworkBase;
|
|
229
|
+
brandLogo?: ArtworkBase;
|
|
230
|
+
epicStageWide?: ArtworkBase;
|
|
231
|
+
musicFullscreenStatic16x9?: ArtworkBase;
|
|
232
|
+
storeFlowcase?: ArtworkBase;
|
|
233
|
+
subscriptionCover?: ArtworkBase;
|
|
234
|
+
subscriptionHero?: ArtworkBase;
|
|
235
|
+
superHeroTall?: ArtworkBase;
|
|
236
|
+
superHeroWide?: ArtworkBase;
|
|
237
|
+
};
|
|
238
|
+
type CuratorPlainEditorialNotes = {
|
|
239
|
+
name?: string;
|
|
240
|
+
short?: string;
|
|
241
|
+
standard?: string;
|
|
242
|
+
tagline?: string;
|
|
243
|
+
};
|
|
244
|
+
type CuratorKind = 'Show' | 'Curator';
|
|
245
|
+
type AppleCuratorAttributes = {
|
|
246
|
+
artwork: ArtworkBase;
|
|
247
|
+
editorialArtwork: CuratorEditorialArtwork;
|
|
248
|
+
editorialVideo: EditorialVideo;
|
|
249
|
+
kind: CuratorKind;
|
|
250
|
+
name: string;
|
|
251
|
+
plainEditorialNotes: CuratorPlainEditorialNotes;
|
|
252
|
+
shortName: string;
|
|
253
|
+
showHostName: string;
|
|
254
|
+
url: string;
|
|
255
|
+
};
|
|
256
|
+
type AppleCurator = {
|
|
257
|
+
id: string;
|
|
258
|
+
type: 'apple-curators';
|
|
259
|
+
href: string;
|
|
260
|
+
attributes: AppleCuratorAttributes;
|
|
261
|
+
};
|
|
262
|
+
type PlaylistDescription = {
|
|
263
|
+
short?: string;
|
|
264
|
+
standard?: string;
|
|
265
|
+
};
|
|
266
|
+
type PlaylistEditorialArtwork = {
|
|
267
|
+
subscriptionCover?: ArtworkBase;
|
|
268
|
+
subscriptionHero?: ArtworkBase;
|
|
269
|
+
};
|
|
270
|
+
type PlaylistEditorialVideo = {
|
|
271
|
+
motionDetailSquare?: EditorialVideoEntry;
|
|
272
|
+
motionDetailTall?: EditorialVideoEntry;
|
|
273
|
+
motionSquareVideo1x1?: EditorialVideoEntry;
|
|
274
|
+
motionWideVideo21x9?: EditorialVideoEntry;
|
|
275
|
+
};
|
|
276
|
+
type EditorialPlaylistKind = 'artist-franchise' | 'editorial' | 'kids' | 'managed' | 'podcasts' | 'sports';
|
|
277
|
+
type PlaylistType = 'editorial' | 'external' | 'personal-mix' | 'replay' | 'user-shared';
|
|
278
|
+
type PlaylistPlayParams = {
|
|
279
|
+
id: string;
|
|
280
|
+
kind: 'playlist';
|
|
281
|
+
versionHash?: string;
|
|
282
|
+
};
|
|
283
|
+
type PlaylistPlainEditorialNotes = {
|
|
284
|
+
name?: string;
|
|
285
|
+
short?: string;
|
|
286
|
+
standard?: string;
|
|
287
|
+
tagline?: string;
|
|
288
|
+
};
|
|
289
|
+
type PlaylistAttributes = {
|
|
290
|
+
artwork: ArtworkBase;
|
|
291
|
+
audioTraits: AudioTrait[];
|
|
292
|
+
curatorName: string;
|
|
293
|
+
description?: PlaylistDescription;
|
|
294
|
+
editorialArtwork: PlaylistEditorialArtwork;
|
|
295
|
+
editorialPlaylistKind?: EditorialPlaylistKind;
|
|
296
|
+
editorialVideo?: PlaylistEditorialVideo;
|
|
297
|
+
hasCollaboration: boolean;
|
|
298
|
+
isChart: boolean;
|
|
299
|
+
lastModifiedDate: string;
|
|
300
|
+
name: string;
|
|
301
|
+
plainEditorialNotes?: PlaylistPlainEditorialNotes;
|
|
302
|
+
playParams: PlaylistPlayParams;
|
|
303
|
+
playlistType: PlaylistType;
|
|
304
|
+
supportsSing: boolean;
|
|
305
|
+
trackCount: number;
|
|
306
|
+
url: string;
|
|
307
|
+
};
|
|
308
|
+
type Playlist = {
|
|
309
|
+
id: string;
|
|
310
|
+
type: 'playlists';
|
|
311
|
+
href: string;
|
|
312
|
+
attributes: PlaylistAttributes;
|
|
313
|
+
};
|
|
314
|
+
type SongPreview = {
|
|
315
|
+
url: string;
|
|
316
|
+
};
|
|
317
|
+
type ExtendedAssetUrls = {
|
|
318
|
+
enhancedHls?: string;
|
|
319
|
+
lightweight?: string;
|
|
320
|
+
lightweightPlus?: string;
|
|
321
|
+
plus?: string;
|
|
322
|
+
superLightweight?: string;
|
|
323
|
+
};
|
|
324
|
+
type SongPlayParams = {
|
|
325
|
+
id: string;
|
|
326
|
+
kind: 'song';
|
|
327
|
+
};
|
|
328
|
+
type SongAttributes = {
|
|
329
|
+
albumArtistName: string;
|
|
330
|
+
albumName: string;
|
|
331
|
+
artistName: string;
|
|
332
|
+
artwork: ArtworkBase;
|
|
333
|
+
audioLocale: string;
|
|
334
|
+
audioTraits: AudioTrait[];
|
|
335
|
+
composerName?: string;
|
|
336
|
+
contentRating?: ContentRating;
|
|
337
|
+
discNumber: number;
|
|
338
|
+
durationInMillis: number;
|
|
339
|
+
editorialArtwork: Partial<AlbumEditorialArtwork>;
|
|
340
|
+
extendedAssetUrls?: ExtendedAssetUrls;
|
|
341
|
+
genreNames: string[];
|
|
342
|
+
hasLyrics: boolean;
|
|
343
|
+
hasTimeSyncedLyrics: boolean;
|
|
344
|
+
isAppleDigitalMaster: boolean;
|
|
345
|
+
isMasteredForItunes: boolean;
|
|
346
|
+
isVocalAttenuationAllowed: boolean;
|
|
347
|
+
isrc: string;
|
|
348
|
+
name: string;
|
|
349
|
+
playParams: SongPlayParams;
|
|
350
|
+
previews: SongPreview[];
|
|
351
|
+
releaseDate: string;
|
|
352
|
+
trackNumber: number;
|
|
353
|
+
url: string;
|
|
354
|
+
};
|
|
355
|
+
type SongRelationships = {
|
|
356
|
+
albums: RelationshipList<'albums'>;
|
|
357
|
+
artists: RelationshipList<'artists'>;
|
|
358
|
+
};
|
|
359
|
+
type Song = {
|
|
360
|
+
id: string;
|
|
361
|
+
type: 'songs';
|
|
362
|
+
href: string;
|
|
363
|
+
attributes: SongAttributes;
|
|
364
|
+
relationships: SongRelationships;
|
|
365
|
+
};
|
|
366
|
+
type AirTime = {
|
|
367
|
+
end: string;
|
|
368
|
+
start: string;
|
|
369
|
+
};
|
|
370
|
+
type StationEditorialArtwork = {
|
|
371
|
+
subscriptionCover?: ArtworkBase;
|
|
372
|
+
subscriptionHero?: ArtworkBase;
|
|
373
|
+
superHeroTall?: ArtworkBase;
|
|
374
|
+
superHeroWide?: ArtworkBase;
|
|
375
|
+
};
|
|
376
|
+
type StationKind = 'streaming' | 'programmed';
|
|
377
|
+
type MediaKind = 'audio' | 'video';
|
|
378
|
+
type DrmType = 'fairplay' | 'playready' | 'widevine';
|
|
379
|
+
type StreamingRadioSubType = 'Episode' | 'Live' | 'Default';
|
|
380
|
+
type StationPlayParams = {
|
|
381
|
+
format: string;
|
|
382
|
+
hasDrm: boolean;
|
|
383
|
+
id: string;
|
|
384
|
+
kind: 'radioStation';
|
|
385
|
+
mediaType: number;
|
|
386
|
+
stationHash: string;
|
|
387
|
+
streamingKind: number;
|
|
388
|
+
};
|
|
389
|
+
type StationPlainEditorialNotes = {
|
|
390
|
+
name?: string;
|
|
391
|
+
short?: string;
|
|
392
|
+
standard?: string;
|
|
393
|
+
};
|
|
394
|
+
type StationAttributes = {
|
|
395
|
+
airTime?: AirTime;
|
|
396
|
+
artwork: ArtworkBase;
|
|
397
|
+
durationInMillis?: number;
|
|
398
|
+
editorialArtwork: StationEditorialArtwork;
|
|
399
|
+
isLive: boolean;
|
|
400
|
+
kind: StationKind;
|
|
401
|
+
mediaKind: MediaKind;
|
|
402
|
+
name: string;
|
|
403
|
+
plainEditorialNotes?: StationPlainEditorialNotes;
|
|
404
|
+
playParams: StationPlayParams;
|
|
405
|
+
radioUrl: string;
|
|
406
|
+
requiresSubscription: boolean;
|
|
407
|
+
streamingRadioSubType?: StreamingRadioSubType;
|
|
408
|
+
supportedDrms: DrmType[];
|
|
409
|
+
url: string;
|
|
410
|
+
};
|
|
411
|
+
type Station = {
|
|
412
|
+
id: string;
|
|
413
|
+
type: 'stations';
|
|
414
|
+
href: string;
|
|
415
|
+
attributes: StationAttributes;
|
|
416
|
+
};
|
|
417
|
+
type AssetTokens = {
|
|
418
|
+
'1080pHdVideo'?: string;
|
|
419
|
+
sd480pVideo?: string;
|
|
420
|
+
sdVideo?: string;
|
|
421
|
+
sdVideoWithPlusAudio?: string;
|
|
422
|
+
};
|
|
423
|
+
type UploadedVideoEditorialArtwork = {
|
|
424
|
+
superHeroTall?: ArtworkBase;
|
|
425
|
+
superHeroWide?: ArtworkBase;
|
|
426
|
+
};
|
|
427
|
+
type UploadedVideoPlayParams = {
|
|
428
|
+
id: string;
|
|
429
|
+
kind: 'uploadedVideo';
|
|
430
|
+
};
|
|
431
|
+
type UploadedVideoAttributes = {
|
|
432
|
+
artistName: string;
|
|
433
|
+
artwork: ArtworkBase;
|
|
434
|
+
assetTokens: AssetTokens;
|
|
435
|
+
contentRatingsBySystem: Record<string, unknown>;
|
|
436
|
+
durationInMilliseconds: number;
|
|
437
|
+
editorialArtwork: UploadedVideoEditorialArtwork;
|
|
438
|
+
editorialVideo: Partial<EditorialVideo>;
|
|
439
|
+
name: string;
|
|
440
|
+
playParams: UploadedVideoPlayParams;
|
|
441
|
+
postUrl: string;
|
|
442
|
+
uploadDate: string;
|
|
443
|
+
uploadingArtistName: string;
|
|
444
|
+
};
|
|
445
|
+
type UploadedVideo = {
|
|
446
|
+
id: string;
|
|
447
|
+
type: 'uploaded-videos';
|
|
448
|
+
href: string;
|
|
449
|
+
attributes: UploadedVideoAttributes;
|
|
450
|
+
};
|
|
451
|
+
type GeoLocation = {
|
|
452
|
+
latitude: number;
|
|
453
|
+
longitude: number;
|
|
454
|
+
};
|
|
455
|
+
type StructuredAddress = {
|
|
456
|
+
address: string;
|
|
457
|
+
city: string;
|
|
458
|
+
country: string;
|
|
459
|
+
countryIsoCode: string;
|
|
460
|
+
postCode: string;
|
|
461
|
+
region: string;
|
|
462
|
+
};
|
|
463
|
+
type VenueAttributes = {
|
|
464
|
+
geoLocation: GeoLocation;
|
|
465
|
+
name: string;
|
|
466
|
+
structuredAddress: StructuredAddress;
|
|
467
|
+
};
|
|
468
|
+
type Venue = {
|
|
469
|
+
id: string;
|
|
470
|
+
type: 'venues';
|
|
471
|
+
href: string;
|
|
472
|
+
attributes: VenueAttributes;
|
|
473
|
+
};
|
|
474
|
+
export interface ArtistResponse {
|
|
475
|
+
data: ResourceRef<'artists'>[];
|
|
476
|
+
resources: {
|
|
477
|
+
albums: Record<number, Album>;
|
|
478
|
+
'apple-curators': Record<number, AppleCurator>;
|
|
479
|
+
artists: Record<number, Artist>;
|
|
480
|
+
concerts: Record<string, Concert>;
|
|
481
|
+
'music-videos': Record<number, MusicVideo>;
|
|
482
|
+
persons: Record<number, Person>;
|
|
483
|
+
playlists: Record<string, Playlist>;
|
|
484
|
+
songs: Record<number, Song>;
|
|
485
|
+
stations: Record<string, Station>;
|
|
486
|
+
'uploaded-videos': Record<number, UploadedVideo>;
|
|
487
|
+
venues: Record<string, Venue>;
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
export interface AlbumResponse {
|
|
491
|
+
data: ResourceRef<'albums'>[];
|
|
492
|
+
resources: {
|
|
493
|
+
albums: Record<number, Album>;
|
|
494
|
+
'apple-curators': Record<number, AppleCurator>;
|
|
495
|
+
artists: Record<number, Artist>;
|
|
496
|
+
'music-videos': Record<number, MusicVideo>;
|
|
497
|
+
playlists: Record<string, Playlist>;
|
|
498
|
+
songs: Record<number, Song>;
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
type SearchGroup<T extends string> = {
|
|
502
|
+
href?: string;
|
|
503
|
+
next?: string;
|
|
504
|
+
groupId: string;
|
|
505
|
+
name: string;
|
|
506
|
+
data: ResourceRef<T>[];
|
|
507
|
+
};
|
|
508
|
+
export interface SearchResponse {
|
|
509
|
+
results: {
|
|
510
|
+
album?: SearchGroup<'albums'>;
|
|
511
|
+
artist?: SearchGroup<'artists'>;
|
|
512
|
+
music_video?: SearchGroup<'music-videos'>;
|
|
513
|
+
playlist?: SearchGroup<'playlists'>;
|
|
514
|
+
radio_episode?: SearchGroup<'stations'>;
|
|
515
|
+
radio_show?: SearchGroup<'apple-curators'>;
|
|
516
|
+
song?: SearchGroup<'songs'>;
|
|
517
|
+
station?: SearchGroup<'stations'>;
|
|
518
|
+
top?: SearchGroup<'albums' | 'artists' | 'songs' | 'playlists' | 'music-videos' | 'stations'>;
|
|
519
|
+
video_extra?: SearchGroup<'uploaded-videos'>;
|
|
520
|
+
};
|
|
521
|
+
resources: {
|
|
522
|
+
albums?: Record<number, Album>;
|
|
523
|
+
'apple-curators'?: Record<number, AppleCurator>;
|
|
524
|
+
artists?: Record<number, Artist>;
|
|
525
|
+
'music-videos'?: Record<number, MusicVideo>;
|
|
526
|
+
playlists?: Record<string, Playlist>;
|
|
527
|
+
songs?: Record<number, Song>;
|
|
528
|
+
stations?: Record<string, Station>;
|
|
529
|
+
'uploaded-videos'?: Record<number, UploadedVideo>;
|
|
530
|
+
};
|
|
531
|
+
meta?: Record<string, unknown>;
|
|
532
|
+
}
|
|
533
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AlbumUnion, Artist, SearchV2, HomeSection } from './types.js';
|
|
2
|
+
import type { App } from '../App.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
interface Variables {
|
|
5
|
+
buildVer: string;
|
|
6
|
+
buildDate: string;
|
|
7
|
+
clientVersion: string;
|
|
8
|
+
serverTime: string;
|
|
9
|
+
}
|
|
10
|
+
interface SecretBytes {
|
|
11
|
+
version: number;
|
|
12
|
+
secret: number[];
|
|
13
|
+
}
|
|
14
|
+
interface AccessToken {
|
|
15
|
+
clientId: string;
|
|
16
|
+
accessToken: string;
|
|
17
|
+
accessTokenExpirationTimestampMs: number;
|
|
18
|
+
}
|
|
19
|
+
interface ClientToken {
|
|
20
|
+
token: string;
|
|
21
|
+
refreshAt: number;
|
|
22
|
+
}
|
|
23
|
+
interface SearchOptions {
|
|
24
|
+
offset?: number;
|
|
25
|
+
limit?: number;
|
|
26
|
+
numberOfTopResults?: number;
|
|
27
|
+
includeAudiobooks?: boolean;
|
|
28
|
+
includeArtistHasConcertsField?: boolean;
|
|
29
|
+
includePreReleases?: boolean;
|
|
30
|
+
includeLocalConcertsField?: boolean;
|
|
31
|
+
includeAuthors?: boolean;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export default class Spotify implements App {
|
|
35
|
+
$latestSecret: SecretBytes;
|
|
36
|
+
$deviceId: string;
|
|
37
|
+
$cookie: string;
|
|
38
|
+
$accessToken: AccessToken;
|
|
39
|
+
$clientToken: ClientToken;
|
|
40
|
+
$variables?: Variables;
|
|
41
|
+
$secretsReady: Promise<void>;
|
|
42
|
+
constructor();
|
|
43
|
+
$fetchSecrets(): Promise<void>;
|
|
44
|
+
$getVariables(): Promise<Variables>;
|
|
45
|
+
$toSecret(input: number[]): Buffer;
|
|
46
|
+
$generateTOTP(timestamp?: number): string;
|
|
47
|
+
$pullAccessToken(): Promise<void>;
|
|
48
|
+
$getHeaders(): Promise<Record<string, string>>;
|
|
49
|
+
search(query: string, opts?: SearchOptions): Promise<SearchV2>;
|
|
50
|
+
getPopular(timezone?: string): Promise<HomeSection[]>;
|
|
51
|
+
getAlbum(uri: string): Promise<AlbumUnion>;
|
|
52
|
+
getArtist(uri: string): Promise<Artist>;
|
|
53
|
+
}
|