@rocksky/sdk 0.1.0 → 0.2.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 +5 -0
- package/dist/generated/types.d.ts +1812 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/http.d.ts +2 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/namespaces/_helpers.d.ts +1 -1
- package/dist/namespaces/_helpers.d.ts.map +1 -1
- package/dist/namespaces/actor.d.ts +13 -23
- package/dist/namespaces/actor.d.ts.map +1 -1
- package/dist/namespaces/album.d.ts +5 -11
- package/dist/namespaces/album.d.ts.map +1 -1
- package/dist/namespaces/apikey.d.ts +4 -17
- package/dist/namespaces/apikey.d.ts.map +1 -1
- package/dist/namespaces/artist.d.ts +8 -23
- package/dist/namespaces/artist.d.ts.map +1 -1
- package/dist/namespaces/charts.d.ts +6 -18
- package/dist/namespaces/charts.d.ts.map +1 -1
- package/dist/namespaces/dropbox.d.ts +6 -13
- package/dist/namespaces/dropbox.d.ts.map +1 -1
- package/dist/namespaces/feed.d.ts +12 -31
- package/dist/namespaces/feed.d.ts.map +1 -1
- package/dist/namespaces/googledrive.d.ts +5 -10
- package/dist/namespaces/googledrive.d.ts.map +1 -1
- package/dist/namespaces/graph.d.ts +9 -22
- package/dist/namespaces/graph.d.ts.map +1 -1
- package/dist/namespaces/like.d.ts +7 -8
- package/dist/namespaces/like.d.ts.map +1 -1
- package/dist/namespaces/mirror.d.ts +3 -7
- package/dist/namespaces/mirror.d.ts.map +1 -1
- package/dist/namespaces/player.d.ts +13 -35
- package/dist/namespaces/player.d.ts.map +1 -1
- package/dist/namespaces/playlist.d.ts +10 -34
- package/dist/namespaces/playlist.d.ts.map +1 -1
- package/dist/namespaces/scrobble.d.ts +4 -35
- package/dist/namespaces/scrobble.d.ts.map +1 -1
- package/dist/namespaces/shout.d.ts +11 -32
- package/dist/namespaces/shout.d.ts.map +1 -1
- package/dist/namespaces/song.d.ts +4 -38
- package/dist/namespaces/song.d.ts.map +1 -1
- package/dist/namespaces/spotify.d.ts +4 -7
- package/dist/namespaces/spotify.d.ts.map +1 -1
- package/dist/namespaces/stats.d.ts +4 -8
- package/dist/namespaces/stats.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/types.ts +2019 -0
- package/src/http.ts +3 -3
- package/src/namespaces/_helpers.ts +1 -1
- package/src/namespaces/actor.ts +23 -19
- package/src/namespaces/album.ts +9 -9
- package/src/namespaces/apikey.ts +9 -9
- package/src/namespaces/artist.ts +15 -21
- package/src/namespaces/charts.ts +10 -19
- package/src/namespaces/dropbox.ts +11 -5
- package/src/namespaces/feed.ts +22 -16
- package/src/namespaces/googledrive.ts +9 -4
- package/src/namespaces/graph.ts +15 -16
- package/src/namespaces/like.ts +12 -6
- package/src/namespaces/mirror.ts +3 -7
- package/src/namespaces/player.ts +25 -27
- package/src/namespaces/playlist.ts +19 -9
- package/src/namespaces/scrobble.ts +8 -34
- package/src/namespaces/shout.ts +21 -12
- package/src/namespaces/song.ts +15 -36
- package/src/namespaces/spotify.ts +7 -3
- package/src/namespaces/stats.ts +7 -3
package/src/namespaces/player.ts
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AddDirectoryToQueueParams,
|
|
3
|
+
AddItemsToQueueParams,
|
|
4
|
+
GetCurrentlyPlayingParams,
|
|
5
|
+
GetPlaybackQueueParams,
|
|
6
|
+
NextParams,
|
|
7
|
+
PauseParams,
|
|
8
|
+
PlayDirectoryParams,
|
|
9
|
+
PlayFileParams,
|
|
10
|
+
PlayParams,
|
|
11
|
+
PreviousParams,
|
|
12
|
+
SeekParams,
|
|
13
|
+
} from "../generated/types";
|
|
2
14
|
import type { RequestOptions } from "../types";
|
|
3
|
-
|
|
4
|
-
type PlayerId = { playerId?: string };
|
|
15
|
+
import type { Call } from "./_helpers";
|
|
5
16
|
|
|
6
17
|
export class PlayerNamespace {
|
|
7
18
|
constructor(private readonly call: Call) {}
|
|
8
19
|
|
|
9
20
|
getCurrentlyPlaying<T = unknown>(
|
|
10
|
-
params:
|
|
21
|
+
params: GetCurrentlyPlayingParams = {},
|
|
11
22
|
opts?: RequestOptions,
|
|
12
23
|
) {
|
|
13
24
|
return this.call<T>("app.rocksky.player.getCurrentlyPlaying", "GET", {
|
|
@@ -17,7 +28,7 @@ export class PlayerNamespace {
|
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
getPlaybackQueue<T = unknown>(
|
|
20
|
-
params:
|
|
31
|
+
params: GetPlaybackQueueParams = {},
|
|
21
32
|
opts?: RequestOptions,
|
|
22
33
|
) {
|
|
23
34
|
return this.call<T>("app.rocksky.player.getPlaybackQueue", "GET", {
|
|
@@ -26,7 +37,7 @@ export class PlayerNamespace {
|
|
|
26
37
|
});
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
play<T = unknown>(params:
|
|
40
|
+
play<T = unknown>(params: PlayParams = {}, opts?: RequestOptions) {
|
|
30
41
|
return this.call<T>("app.rocksky.player.play", "POST", {
|
|
31
42
|
params,
|
|
32
43
|
requireAuth: true,
|
|
@@ -34,7 +45,7 @@ export class PlayerNamespace {
|
|
|
34
45
|
});
|
|
35
46
|
}
|
|
36
47
|
|
|
37
|
-
pause<T = unknown>(params:
|
|
48
|
+
pause<T = unknown>(params: PauseParams = {}, opts?: RequestOptions) {
|
|
38
49
|
return this.call<T>("app.rocksky.player.pause", "POST", {
|
|
39
50
|
params,
|
|
40
51
|
requireAuth: true,
|
|
@@ -42,7 +53,7 @@ export class PlayerNamespace {
|
|
|
42
53
|
});
|
|
43
54
|
}
|
|
44
55
|
|
|
45
|
-
next<T = unknown>(params:
|
|
56
|
+
next<T = unknown>(params: NextParams = {}, opts?: RequestOptions) {
|
|
46
57
|
return this.call<T>("app.rocksky.player.next", "POST", {
|
|
47
58
|
params,
|
|
48
59
|
requireAuth: true,
|
|
@@ -50,7 +61,7 @@ export class PlayerNamespace {
|
|
|
50
61
|
});
|
|
51
62
|
}
|
|
52
63
|
|
|
53
|
-
previous<T = unknown>(params:
|
|
64
|
+
previous<T = unknown>(params: PreviousParams = {}, opts?: RequestOptions) {
|
|
54
65
|
return this.call<T>("app.rocksky.player.previous", "POST", {
|
|
55
66
|
params,
|
|
56
67
|
requireAuth: true,
|
|
@@ -59,7 +70,7 @@ export class PlayerNamespace {
|
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
seek<T = unknown>(
|
|
62
|
-
params:
|
|
73
|
+
params: SeekParams,
|
|
63
74
|
opts?: RequestOptions,
|
|
64
75
|
) {
|
|
65
76
|
return this.call<T>("app.rocksky.player.seek", "POST", {
|
|
@@ -70,7 +81,7 @@ export class PlayerNamespace {
|
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
playFile<T = unknown>(
|
|
73
|
-
params:
|
|
84
|
+
params: PlayFileParams,
|
|
74
85
|
opts?: RequestOptions,
|
|
75
86
|
) {
|
|
76
87
|
return this.call<T>("app.rocksky.player.playFile", "POST", {
|
|
@@ -81,12 +92,7 @@ export class PlayerNamespace {
|
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
playDirectory<T = unknown>(
|
|
84
|
-
params:
|
|
85
|
-
directoryId: string;
|
|
86
|
-
shuffle?: boolean;
|
|
87
|
-
recurse?: boolean;
|
|
88
|
-
position?: number;
|
|
89
|
-
},
|
|
95
|
+
params: PlayDirectoryParams,
|
|
90
96
|
opts?: RequestOptions,
|
|
91
97
|
) {
|
|
92
98
|
return this.call<T>("app.rocksky.player.playDirectory", "POST", {
|
|
@@ -97,11 +103,7 @@ export class PlayerNamespace {
|
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
addItemsToQueue<T = unknown>(
|
|
100
|
-
params:
|
|
101
|
-
items: string[];
|
|
102
|
-
position?: number;
|
|
103
|
-
shuffle?: boolean;
|
|
104
|
-
},
|
|
106
|
+
params: AddItemsToQueueParams,
|
|
105
107
|
opts?: RequestOptions,
|
|
106
108
|
) {
|
|
107
109
|
return this.call<T>("app.rocksky.player.addItemsToQueue", "POST", {
|
|
@@ -112,11 +114,7 @@ export class PlayerNamespace {
|
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
addDirectoryToQueue<T = unknown>(
|
|
115
|
-
params:
|
|
116
|
-
directory: string;
|
|
117
|
-
position?: number;
|
|
118
|
-
shuffle?: boolean;
|
|
119
|
-
},
|
|
117
|
+
params: AddDirectoryToQueueParams,
|
|
120
118
|
opts?: RequestOptions,
|
|
121
119
|
) {
|
|
122
120
|
return this.call<T>("app.rocksky.player.addDirectoryToQueue", "POST", {
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CreatePlaylistParams,
|
|
3
|
+
GetPlaylistParams,
|
|
4
|
+
GetPlaylistsParams,
|
|
5
|
+
InsertDirectoryParams,
|
|
6
|
+
InsertFilesParams,
|
|
7
|
+
RemovePlaylistParams,
|
|
8
|
+
RemoveTrackParams,
|
|
9
|
+
StartPlaylistParams,
|
|
10
|
+
} from "../generated/types";
|
|
2
11
|
import type { RequestOptions } from "../types";
|
|
12
|
+
import type { Call } from "./_helpers";
|
|
3
13
|
|
|
4
14
|
export class PlaylistNamespace {
|
|
5
15
|
constructor(private readonly call: Call) {}
|
|
6
16
|
|
|
7
17
|
getPlaylists<T = unknown>(
|
|
8
|
-
params:
|
|
18
|
+
params: GetPlaylistsParams = {},
|
|
9
19
|
opts?: RequestOptions,
|
|
10
20
|
) {
|
|
11
21
|
return this.call<T>("app.rocksky.playlist.getPlaylists", "GET", {
|
|
@@ -14,7 +24,7 @@ export class PlaylistNamespace {
|
|
|
14
24
|
});
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
getPlaylist<T = unknown>(params:
|
|
27
|
+
getPlaylist<T = unknown>(params: GetPlaylistParams, opts?: RequestOptions) {
|
|
18
28
|
return this.call<T>("app.rocksky.playlist.getPlaylist", "GET", {
|
|
19
29
|
params,
|
|
20
30
|
...opts,
|
|
@@ -22,7 +32,7 @@ export class PlaylistNamespace {
|
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
createPlaylist<T = unknown>(
|
|
25
|
-
params:
|
|
35
|
+
params: CreatePlaylistParams,
|
|
26
36
|
opts?: RequestOptions,
|
|
27
37
|
) {
|
|
28
38
|
return this.call<T>("app.rocksky.playlist.createPlaylist", "POST", {
|
|
@@ -32,7 +42,7 @@ export class PlaylistNamespace {
|
|
|
32
42
|
});
|
|
33
43
|
}
|
|
34
44
|
|
|
35
|
-
removePlaylist<T = unknown>(params:
|
|
45
|
+
removePlaylist<T = unknown>(params: RemovePlaylistParams, opts?: RequestOptions) {
|
|
36
46
|
return this.call<T>("app.rocksky.playlist.removePlaylist", "POST", {
|
|
37
47
|
params,
|
|
38
48
|
requireAuth: true,
|
|
@@ -41,7 +51,7 @@ export class PlaylistNamespace {
|
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
startPlaylist<T = unknown>(
|
|
44
|
-
params:
|
|
54
|
+
params: StartPlaylistParams,
|
|
45
55
|
opts?: RequestOptions,
|
|
46
56
|
) {
|
|
47
57
|
return this.call<T>("app.rocksky.playlist.startPlaylist", "POST", {
|
|
@@ -52,7 +62,7 @@ export class PlaylistNamespace {
|
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
insertDirectory<T = unknown>(
|
|
55
|
-
params:
|
|
65
|
+
params: InsertDirectoryParams,
|
|
56
66
|
opts?: RequestOptions,
|
|
57
67
|
) {
|
|
58
68
|
return this.call<T>("app.rocksky.playlist.insertDirectory", "POST", {
|
|
@@ -63,7 +73,7 @@ export class PlaylistNamespace {
|
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
insertFiles<T = unknown>(
|
|
66
|
-
params:
|
|
76
|
+
params: InsertFilesParams,
|
|
67
77
|
opts?: RequestOptions,
|
|
68
78
|
) {
|
|
69
79
|
return this.call<T>("app.rocksky.playlist.insertFiles", "POST", {
|
|
@@ -74,7 +84,7 @@ export class PlaylistNamespace {
|
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
removeTrack<T = unknown>(
|
|
77
|
-
params:
|
|
87
|
+
params: RemoveTrackParams,
|
|
78
88
|
opts?: RequestOptions,
|
|
79
89
|
) {
|
|
80
90
|
return this.call<T>("app.rocksky.playlist.removeTrack", "POST", {
|
|
@@ -1,38 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CreateScrobbleInput,
|
|
3
|
+
GetScrobbleParams,
|
|
4
|
+
GetScrobblesParams,
|
|
5
|
+
} from "../generated/types";
|
|
2
6
|
import type { RequestOptions } from "../types";
|
|
7
|
+
import type { Call } from "./_helpers";
|
|
3
8
|
|
|
4
|
-
export type CreateScrobbleInput
|
|
5
|
-
title: string;
|
|
6
|
-
artist: string;
|
|
7
|
-
album?: string;
|
|
8
|
-
duration?: number;
|
|
9
|
-
mbId?: string;
|
|
10
|
-
isrc?: string;
|
|
11
|
-
albumArt?: string;
|
|
12
|
-
trackNumber?: number;
|
|
13
|
-
releaseDate?: string;
|
|
14
|
-
year?: number;
|
|
15
|
-
discNumber?: number;
|
|
16
|
-
lyrics?: string;
|
|
17
|
-
composer?: string;
|
|
18
|
-
copyrightMessage?: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
artistPicture?: string;
|
|
21
|
-
spotifyLink?: string;
|
|
22
|
-
lastfmLink?: string;
|
|
23
|
-
tidalLink?: string;
|
|
24
|
-
appleMusicLink?: string;
|
|
25
|
-
youtubeLink?: string;
|
|
26
|
-
deezerLink?: string;
|
|
27
|
-
timestamp?: number;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type GetScrobblesParams = {
|
|
31
|
-
did?: string;
|
|
32
|
-
following?: boolean;
|
|
33
|
-
limit?: number;
|
|
34
|
-
offset?: number;
|
|
35
|
-
};
|
|
9
|
+
export type { CreateScrobbleInput, GetScrobblesParams };
|
|
36
10
|
|
|
37
11
|
export class ScrobbleNamespace {
|
|
38
12
|
constructor(private readonly call: Call) {}
|
|
@@ -48,7 +22,7 @@ export class ScrobbleNamespace {
|
|
|
48
22
|
});
|
|
49
23
|
}
|
|
50
24
|
|
|
51
|
-
getScrobble<T = unknown>(params:
|
|
25
|
+
getScrobble<T = unknown>(params: GetScrobbleParams, opts?: RequestOptions) {
|
|
52
26
|
return this.call<T>("app.rocksky.scrobble.getScrobble", "GET", {
|
|
53
27
|
params,
|
|
54
28
|
...opts,
|
package/src/namespaces/shout.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CreateShoutInput,
|
|
3
|
+
GetAlbumShoutsParams,
|
|
4
|
+
GetArtistShoutsParams,
|
|
5
|
+
GetProfileShoutsParams,
|
|
6
|
+
GetShoutRepliesParams,
|
|
7
|
+
GetTrackShoutsParams,
|
|
8
|
+
RemoveShoutParams,
|
|
9
|
+
ReplyShoutInput,
|
|
10
|
+
ReportShoutInput,
|
|
11
|
+
} from "../generated/types";
|
|
2
12
|
import type { RequestOptions } from "../types";
|
|
3
|
-
|
|
4
|
-
type UriPage = { uri: string; limit?: number; offset?: number };
|
|
13
|
+
import type { Call } from "./_helpers";
|
|
5
14
|
|
|
6
15
|
export class ShoutNamespace {
|
|
7
16
|
constructor(private readonly call: Call) {}
|
|
8
17
|
|
|
9
18
|
createShout<T = unknown>(
|
|
10
|
-
input:
|
|
19
|
+
input: CreateShoutInput = {},
|
|
11
20
|
opts?: RequestOptions,
|
|
12
21
|
) {
|
|
13
22
|
return this.call<T>("app.rocksky.shout.createShout", "POST", {
|
|
@@ -18,7 +27,7 @@ export class ShoutNamespace {
|
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
replyShout<T = unknown>(
|
|
21
|
-
input:
|
|
30
|
+
input: ReplyShoutInput,
|
|
22
31
|
opts?: RequestOptions,
|
|
23
32
|
) {
|
|
24
33
|
return this.call<T>("app.rocksky.shout.replyShout", "POST", {
|
|
@@ -29,7 +38,7 @@ export class ShoutNamespace {
|
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
reportShout<T = unknown>(
|
|
32
|
-
input:
|
|
41
|
+
input: ReportShoutInput,
|
|
33
42
|
opts?: RequestOptions,
|
|
34
43
|
) {
|
|
35
44
|
return this.call<T>("app.rocksky.shout.reportShout", "POST", {
|
|
@@ -39,7 +48,7 @@ export class ShoutNamespace {
|
|
|
39
48
|
});
|
|
40
49
|
}
|
|
41
50
|
|
|
42
|
-
removeShout<T = unknown>(params:
|
|
51
|
+
removeShout<T = unknown>(params: RemoveShoutParams, opts?: RequestOptions) {
|
|
43
52
|
return this.call<T>("app.rocksky.shout.removeShout", "POST", {
|
|
44
53
|
params,
|
|
45
54
|
requireAuth: true,
|
|
@@ -47,7 +56,7 @@ export class ShoutNamespace {
|
|
|
47
56
|
});
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
getShoutReplies<T = unknown>(params:
|
|
59
|
+
getShoutReplies<T = unknown>(params: GetShoutRepliesParams, opts?: RequestOptions) {
|
|
51
60
|
return this.call<T>("app.rocksky.shout.getShoutReplies", "GET", {
|
|
52
61
|
params,
|
|
53
62
|
...opts,
|
|
@@ -55,7 +64,7 @@ export class ShoutNamespace {
|
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
getProfileShouts<T = unknown>(
|
|
58
|
-
params:
|
|
67
|
+
params: GetProfileShoutsParams,
|
|
59
68
|
opts?: RequestOptions,
|
|
60
69
|
) {
|
|
61
70
|
return this.call<T>("app.rocksky.shout.getProfileShouts", "GET", {
|
|
@@ -65,7 +74,7 @@ export class ShoutNamespace {
|
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
getTrackShouts<T = unknown>(
|
|
68
|
-
params:
|
|
77
|
+
params: GetTrackShoutsParams,
|
|
69
78
|
opts?: RequestOptions,
|
|
70
79
|
) {
|
|
71
80
|
return this.call<T>("app.rocksky.shout.getTrackShouts", "GET", {
|
|
@@ -74,14 +83,14 @@ export class ShoutNamespace {
|
|
|
74
83
|
});
|
|
75
84
|
}
|
|
76
85
|
|
|
77
|
-
getArtistShouts<T = unknown>(params:
|
|
86
|
+
getArtistShouts<T = unknown>(params: GetArtistShoutsParams, opts?: RequestOptions) {
|
|
78
87
|
return this.call<T>("app.rocksky.shout.getArtistShouts", "GET", {
|
|
79
88
|
params,
|
|
80
89
|
...opts,
|
|
81
90
|
});
|
|
82
91
|
}
|
|
83
92
|
|
|
84
|
-
getAlbumShouts<T = unknown>(params:
|
|
93
|
+
getAlbumShouts<T = unknown>(params: GetAlbumShoutsParams, opts?: RequestOptions) {
|
|
85
94
|
return this.call<T>("app.rocksky.shout.getAlbumShouts", "GET", {
|
|
86
95
|
params,
|
|
87
96
|
...opts,
|
package/src/namespaces/song.ts
CHANGED
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CreateSongInput,
|
|
3
|
+
GetSongParams,
|
|
4
|
+
GetSongRecentListenersParams,
|
|
5
|
+
GetSongsParams,
|
|
6
|
+
MatchSongParams,
|
|
7
|
+
} from "../generated/types";
|
|
2
8
|
import type { RequestOptions } from "../types";
|
|
9
|
+
import type { Call } from "./_helpers";
|
|
3
10
|
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type GetSongsParams = GetSongParams & {
|
|
12
|
-
limit?: number;
|
|
13
|
-
offset?: number;
|
|
14
|
-
genre?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type MatchSongParams = {
|
|
18
|
-
title: string;
|
|
19
|
-
artist: string;
|
|
20
|
-
mbId?: string;
|
|
21
|
-
isrc?: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type CreateSongInput = {
|
|
25
|
-
title: string;
|
|
26
|
-
artist: string;
|
|
27
|
-
albumArtist: string;
|
|
28
|
-
album: string;
|
|
29
|
-
duration?: number;
|
|
30
|
-
mbId?: string;
|
|
31
|
-
isrc?: string;
|
|
32
|
-
albumArt?: string;
|
|
33
|
-
trackNumber?: number;
|
|
34
|
-
releaseDate?: string;
|
|
35
|
-
year?: number;
|
|
36
|
-
discNumber?: number;
|
|
37
|
-
lyrics?: string;
|
|
11
|
+
export type {
|
|
12
|
+
CreateSongInput,
|
|
13
|
+
GetSongParams,
|
|
14
|
+
GetSongRecentListenersParams,
|
|
15
|
+
GetSongsParams,
|
|
16
|
+
MatchSongParams,
|
|
38
17
|
};
|
|
39
18
|
|
|
40
19
|
export class SongNamespace {
|
|
@@ -55,7 +34,7 @@ export class SongNamespace {
|
|
|
55
34
|
}
|
|
56
35
|
|
|
57
36
|
getSongRecentListeners<T = unknown>(
|
|
58
|
-
params:
|
|
37
|
+
params: GetSongRecentListenersParams,
|
|
59
38
|
opts?: RequestOptions,
|
|
60
39
|
) {
|
|
61
40
|
return this.call<T>("app.rocksky.song.getSongRecentListeners", "GET", {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GetCurrentlyPlayingParams,
|
|
3
|
+
SeekParams,
|
|
4
|
+
} from "../generated/types";
|
|
2
5
|
import type { RequestOptions } from "../types";
|
|
6
|
+
import type { Call } from "./_helpers";
|
|
3
7
|
|
|
4
8
|
export class SpotifyNamespace {
|
|
5
9
|
constructor(private readonly call: Call) {}
|
|
6
10
|
|
|
7
11
|
getCurrentlyPlaying<T = unknown>(
|
|
8
|
-
params:
|
|
12
|
+
params: GetCurrentlyPlayingParams = {},
|
|
9
13
|
opts?: RequestOptions,
|
|
10
14
|
) {
|
|
11
15
|
return this.call<T>("app.rocksky.spotify.getCurrentlyPlaying", "GET", {
|
|
@@ -42,7 +46,7 @@ export class SpotifyNamespace {
|
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
seek<T = unknown>(params:
|
|
49
|
+
seek<T = unknown>(params: SeekParams, opts?: RequestOptions) {
|
|
46
50
|
return this.call<T>("app.rocksky.spotify.seek", "POST", {
|
|
47
51
|
params,
|
|
48
52
|
requireAuth: true,
|
package/src/namespaces/stats.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GetStatsParams,
|
|
3
|
+
GetWrappedParams,
|
|
4
|
+
} from "../generated/types";
|
|
2
5
|
import type { RequestOptions } from "../types";
|
|
6
|
+
import type { Call } from "./_helpers";
|
|
3
7
|
|
|
4
8
|
export class StatsNamespace {
|
|
5
9
|
constructor(private readonly call: Call) {}
|
|
6
10
|
|
|
7
|
-
getStats<T = unknown>(params:
|
|
11
|
+
getStats<T = unknown>(params: GetStatsParams, opts?: RequestOptions) {
|
|
8
12
|
return this.call<T>("app.rocksky.stats.getStats", "GET", {
|
|
9
13
|
params,
|
|
10
14
|
...opts,
|
|
@@ -12,7 +16,7 @@ export class StatsNamespace {
|
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
getWrapped<T = unknown>(
|
|
15
|
-
params:
|
|
19
|
+
params: GetWrappedParams,
|
|
16
20
|
opts?: RequestOptions,
|
|
17
21
|
) {
|
|
18
22
|
return this.call<T>("app.rocksky.stats.getWrapped", "GET", {
|