@rocksky/sdk 0.1.0 → 0.2.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/README.md +5 -0
- package/dist/client.d.ts +37 -28
- package/dist/client.d.ts.map +1 -1
- package/dist/generated/types.d.ts +1932 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/http.d.ts +3 -3
- package/dist/http.d.ts.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/namespaces/_helpers.d.ts +11 -5
- package/dist/namespaces/_helpers.d.ts.map +1 -1
- package/dist/namespaces/actor.d.ts +15 -25
- package/dist/namespaces/actor.d.ts.map +1 -1
- package/dist/namespaces/album.d.ts +7 -13
- package/dist/namespaces/album.d.ts.map +1 -1
- package/dist/namespaces/apikey.d.ts +9 -22
- package/dist/namespaces/apikey.d.ts.map +1 -1
- package/dist/namespaces/artist.d.ts +11 -26
- package/dist/namespaces/artist.d.ts.map +1 -1
- package/dist/namespaces/charts.d.ts +8 -20
- package/dist/namespaces/charts.d.ts.map +1 -1
- package/dist/namespaces/dropbox.d.ts +7 -14
- package/dist/namespaces/dropbox.d.ts.map +1 -1
- package/dist/namespaces/feed.d.ts +14 -33
- package/dist/namespaces/feed.d.ts.map +1 -1
- package/dist/namespaces/googledrive.d.ts +6 -11
- package/dist/namespaces/googledrive.d.ts.map +1 -1
- package/dist/namespaces/graph.d.ts +10 -23
- package/dist/namespaces/graph.d.ts.map +1 -1
- package/dist/namespaces/like.d.ts +8 -9
- package/dist/namespaces/like.d.ts.map +1 -1
- package/dist/namespaces/mirror.d.ts +6 -10
- package/dist/namespaces/mirror.d.ts.map +1 -1
- package/dist/namespaces/player.d.ts +14 -36
- package/dist/namespaces/player.d.ts.map +1 -1
- package/dist/namespaces/playlist.d.ts +11 -35
- package/dist/namespaces/playlist.d.ts.map +1 -1
- package/dist/namespaces/scrobble.d.ts +7 -38
- package/dist/namespaces/scrobble.d.ts.map +1 -1
- package/dist/namespaces/shout.d.ts +12 -33
- package/dist/namespaces/shout.d.ts.map +1 -1
- package/dist/namespaces/song.d.ts +9 -43
- package/dist/namespaces/song.d.ts.map +1 -1
- package/dist/namespaces/spotify.d.ts +9 -12
- package/dist/namespaces/spotify.d.ts.map +1 -1
- package/dist/namespaces/stats.d.ts +5 -9
- package/dist/namespaces/stats.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +50 -33
- package/src/generated/types.ts +2143 -0
- package/src/http.ts +5 -5
- package/src/index.ts +17 -17
- package/src/namespaces/_helpers.ts +23 -13
- package/src/namespaces/actor.ts +37 -33
- package/src/namespaces/album.ts +14 -14
- package/src/namespaces/apikey.ts +18 -18
- package/src/namespaces/artist.ts +26 -32
- package/src/namespaces/charts.ts +15 -24
- package/src/namespaces/dropbox.ts +19 -13
- package/src/namespaces/feed.ts +42 -36
- package/src/namespaces/googledrive.ts +15 -10
- package/src/namespaces/graph.ts +24 -25
- package/src/namespaces/like.ts +17 -11
- package/src/namespaces/mirror.ts +8 -12
- package/src/namespaces/player.ts +44 -46
- package/src/namespaces/playlist.ts +34 -24
- package/src/namespaces/scrobble.ts +14 -40
- package/src/namespaces/shout.ts +36 -27
- package/src/namespaces/song.ts +27 -48
- package/src/namespaces/spotify.ts +19 -15
- package/src/namespaces/stats.ts +11 -7
- package/src/pipe.ts +1 -1
- package/src/realtime.ts +2 -2
|
@@ -1,65 +1,39 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
CreateScrobbleInput,
|
|
3
|
+
GetScrobbleParams,
|
|
4
|
+
GetScrobblesParams,
|
|
5
|
+
} from "../generated/types.js";
|
|
6
|
+
import type { RequestOptions } from "../types.js";
|
|
7
|
+
import type { Call } from "./_helpers.js";
|
|
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) {}
|
|
39
13
|
|
|
40
|
-
createScrobble
|
|
14
|
+
createScrobble(
|
|
41
15
|
input: CreateScrobbleInput,
|
|
42
16
|
opts?: RequestOptions,
|
|
43
17
|
) {
|
|
44
|
-
return this.call
|
|
18
|
+
return this.call("app.rocksky.scrobble.createScrobble", "POST", {
|
|
45
19
|
body: input,
|
|
46
20
|
requireAuth: true,
|
|
47
21
|
...opts,
|
|
48
22
|
});
|
|
49
23
|
}
|
|
50
24
|
|
|
51
|
-
getScrobble
|
|
52
|
-
return this.call
|
|
25
|
+
getScrobble(params: GetScrobbleParams, opts?: RequestOptions) {
|
|
26
|
+
return this.call("app.rocksky.scrobble.getScrobble", "GET", {
|
|
53
27
|
params,
|
|
54
28
|
...opts,
|
|
55
29
|
});
|
|
56
30
|
}
|
|
57
31
|
|
|
58
|
-
getScrobbles
|
|
32
|
+
getScrobbles(
|
|
59
33
|
params: GetScrobblesParams = {},
|
|
60
34
|
opts?: RequestOptions,
|
|
61
35
|
) {
|
|
62
|
-
return this.call
|
|
36
|
+
return this.call("app.rocksky.scrobble.getScrobbles", "GET", {
|
|
63
37
|
params,
|
|
64
38
|
...opts,
|
|
65
39
|
});
|
package/src/namespaces/shout.ts
CHANGED
|
@@ -1,88 +1,97 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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.js";
|
|
12
|
+
import type { RequestOptions } from "../types.js";
|
|
13
|
+
import type { Call } from "./_helpers.js";
|
|
5
14
|
|
|
6
15
|
export class ShoutNamespace {
|
|
7
16
|
constructor(private readonly call: Call) {}
|
|
8
17
|
|
|
9
|
-
createShout
|
|
10
|
-
input:
|
|
18
|
+
createShout(
|
|
19
|
+
input: CreateShoutInput = {},
|
|
11
20
|
opts?: RequestOptions,
|
|
12
21
|
) {
|
|
13
|
-
return this.call
|
|
22
|
+
return this.call("app.rocksky.shout.createShout", "POST", {
|
|
14
23
|
body: input,
|
|
15
24
|
requireAuth: true,
|
|
16
25
|
...opts,
|
|
17
26
|
});
|
|
18
27
|
}
|
|
19
28
|
|
|
20
|
-
replyShout
|
|
21
|
-
input:
|
|
29
|
+
replyShout(
|
|
30
|
+
input: ReplyShoutInput,
|
|
22
31
|
opts?: RequestOptions,
|
|
23
32
|
) {
|
|
24
|
-
return this.call
|
|
33
|
+
return this.call("app.rocksky.shout.replyShout", "POST", {
|
|
25
34
|
body: input,
|
|
26
35
|
requireAuth: true,
|
|
27
36
|
...opts,
|
|
28
37
|
});
|
|
29
38
|
}
|
|
30
39
|
|
|
31
|
-
reportShout
|
|
32
|
-
input:
|
|
40
|
+
reportShout(
|
|
41
|
+
input: ReportShoutInput,
|
|
33
42
|
opts?: RequestOptions,
|
|
34
43
|
) {
|
|
35
|
-
return this.call
|
|
44
|
+
return this.call("app.rocksky.shout.reportShout", "POST", {
|
|
36
45
|
body: input,
|
|
37
46
|
requireAuth: true,
|
|
38
47
|
...opts,
|
|
39
48
|
});
|
|
40
49
|
}
|
|
41
50
|
|
|
42
|
-
removeShout
|
|
43
|
-
return this.call
|
|
51
|
+
removeShout(params: RemoveShoutParams, opts?: RequestOptions) {
|
|
52
|
+
return this.call("app.rocksky.shout.removeShout", "POST", {
|
|
44
53
|
params,
|
|
45
54
|
requireAuth: true,
|
|
46
55
|
...opts,
|
|
47
56
|
});
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
getShoutReplies
|
|
51
|
-
return this.call
|
|
59
|
+
getShoutReplies(params: GetShoutRepliesParams, opts?: RequestOptions) {
|
|
60
|
+
return this.call("app.rocksky.shout.getShoutReplies", "GET", {
|
|
52
61
|
params,
|
|
53
62
|
...opts,
|
|
54
63
|
});
|
|
55
64
|
}
|
|
56
65
|
|
|
57
|
-
getProfileShouts
|
|
58
|
-
params:
|
|
66
|
+
getProfileShouts(
|
|
67
|
+
params: GetProfileShoutsParams,
|
|
59
68
|
opts?: RequestOptions,
|
|
60
69
|
) {
|
|
61
|
-
return this.call
|
|
70
|
+
return this.call("app.rocksky.shout.getProfileShouts", "GET", {
|
|
62
71
|
params,
|
|
63
72
|
...opts,
|
|
64
73
|
});
|
|
65
74
|
}
|
|
66
75
|
|
|
67
|
-
getTrackShouts
|
|
68
|
-
params:
|
|
76
|
+
getTrackShouts(
|
|
77
|
+
params: GetTrackShoutsParams,
|
|
69
78
|
opts?: RequestOptions,
|
|
70
79
|
) {
|
|
71
|
-
return this.call
|
|
80
|
+
return this.call("app.rocksky.shout.getTrackShouts", "GET", {
|
|
72
81
|
params,
|
|
73
82
|
...opts,
|
|
74
83
|
});
|
|
75
84
|
}
|
|
76
85
|
|
|
77
|
-
getArtistShouts
|
|
78
|
-
return this.call
|
|
86
|
+
getArtistShouts(params: GetArtistShoutsParams, opts?: RequestOptions) {
|
|
87
|
+
return this.call("app.rocksky.shout.getArtistShouts", "GET", {
|
|
79
88
|
params,
|
|
80
89
|
...opts,
|
|
81
90
|
});
|
|
82
91
|
}
|
|
83
92
|
|
|
84
|
-
getAlbumShouts
|
|
85
|
-
return this.call
|
|
93
|
+
getAlbumShouts(params: GetAlbumShoutsParams, opts?: RequestOptions) {
|
|
94
|
+
return this.call("app.rocksky.shout.getAlbumShouts", "GET", {
|
|
86
95
|
params,
|
|
87
96
|
...opts,
|
|
88
97
|
});
|
package/src/namespaces/song.ts
CHANGED
|
@@ -1,78 +1,57 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
1
|
+
import type {
|
|
2
|
+
CreateSongInput,
|
|
3
|
+
GetSongParams,
|
|
4
|
+
GetSongRecentListenersParams,
|
|
5
|
+
GetSongsParams,
|
|
6
|
+
MatchSongParams,
|
|
7
|
+
} from "../generated/types.js";
|
|
8
|
+
import type { RequestOptions } from "../types.js";
|
|
9
|
+
import type { Call } from "./_helpers.js";
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
CreateSongInput,
|
|
13
|
+
GetSongParams,
|
|
14
|
+
GetSongRecentListenersParams,
|
|
15
|
+
GetSongsParams,
|
|
16
|
+
MatchSongParams,
|
|
38
17
|
};
|
|
39
18
|
|
|
40
19
|
export class SongNamespace {
|
|
41
20
|
constructor(private readonly call: Call) {}
|
|
42
21
|
|
|
43
|
-
getSong
|
|
44
|
-
return this.call
|
|
22
|
+
getSong(params: GetSongParams, opts?: RequestOptions) {
|
|
23
|
+
return this.call("app.rocksky.song.getSong", "GET", {
|
|
45
24
|
params,
|
|
46
25
|
...opts,
|
|
47
26
|
});
|
|
48
27
|
}
|
|
49
28
|
|
|
50
|
-
getSongs
|
|
51
|
-
return this.call
|
|
29
|
+
getSongs(params: GetSongsParams = {}, opts?: RequestOptions) {
|
|
30
|
+
return this.call("app.rocksky.song.getSongs", "GET", {
|
|
52
31
|
params,
|
|
53
32
|
...opts,
|
|
54
33
|
});
|
|
55
34
|
}
|
|
56
35
|
|
|
57
|
-
getSongRecentListeners
|
|
58
|
-
params:
|
|
36
|
+
getSongRecentListeners(
|
|
37
|
+
params: GetSongRecentListenersParams,
|
|
59
38
|
opts?: RequestOptions,
|
|
60
39
|
) {
|
|
61
|
-
return this.call
|
|
40
|
+
return this.call("app.rocksky.song.getSongRecentListeners", "GET", {
|
|
62
41
|
params,
|
|
63
42
|
...opts,
|
|
64
43
|
});
|
|
65
44
|
}
|
|
66
45
|
|
|
67
|
-
matchSong
|
|
68
|
-
return this.call
|
|
46
|
+
matchSong(params: MatchSongParams, opts?: RequestOptions) {
|
|
47
|
+
return this.call("app.rocksky.song.matchSong", "GET", {
|
|
69
48
|
params,
|
|
70
49
|
...opts,
|
|
71
50
|
});
|
|
72
51
|
}
|
|
73
52
|
|
|
74
|
-
createSong
|
|
75
|
-
return this.call
|
|
53
|
+
createSong(input: CreateSongInput, opts?: RequestOptions) {
|
|
54
|
+
return this.call("app.rocksky.song.createSong", "POST", {
|
|
76
55
|
body: input,
|
|
77
56
|
requireAuth: true,
|
|
78
57
|
...opts,
|
|
@@ -1,49 +1,53 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
GetCurrentlyPlayingParams,
|
|
3
|
+
SeekParams,
|
|
4
|
+
} from "../generated/types.js";
|
|
5
|
+
import type { RequestOptions } from "../types.js";
|
|
6
|
+
import type { Call } from "./_helpers.js";
|
|
3
7
|
|
|
4
8
|
export class SpotifyNamespace {
|
|
5
9
|
constructor(private readonly call: Call) {}
|
|
6
10
|
|
|
7
|
-
getCurrentlyPlaying
|
|
8
|
-
params:
|
|
11
|
+
getCurrentlyPlaying(
|
|
12
|
+
params: GetCurrentlyPlayingParams = {},
|
|
9
13
|
opts?: RequestOptions,
|
|
10
14
|
) {
|
|
11
|
-
return this.call
|
|
15
|
+
return this.call("app.rocksky.spotify.getCurrentlyPlaying", "GET", {
|
|
12
16
|
params,
|
|
13
17
|
...opts,
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
play
|
|
18
|
-
return this.call
|
|
21
|
+
play(opts?: RequestOptions) {
|
|
22
|
+
return this.call("app.rocksky.spotify.play", "POST", {
|
|
19
23
|
requireAuth: true,
|
|
20
24
|
...opts,
|
|
21
25
|
});
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
pause
|
|
25
|
-
return this.call
|
|
28
|
+
pause(opts?: RequestOptions) {
|
|
29
|
+
return this.call("app.rocksky.spotify.pause", "POST", {
|
|
26
30
|
requireAuth: true,
|
|
27
31
|
...opts,
|
|
28
32
|
});
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
next
|
|
32
|
-
return this.call
|
|
35
|
+
next(opts?: RequestOptions) {
|
|
36
|
+
return this.call("app.rocksky.spotify.next", "POST", {
|
|
33
37
|
requireAuth: true,
|
|
34
38
|
...opts,
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
previous
|
|
39
|
-
return this.call
|
|
42
|
+
previous(opts?: RequestOptions) {
|
|
43
|
+
return this.call("app.rocksky.spotify.previous", "POST", {
|
|
40
44
|
requireAuth: true,
|
|
41
45
|
...opts,
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
seek
|
|
46
|
-
return this.call
|
|
49
|
+
seek(params: SeekParams, opts?: RequestOptions) {
|
|
50
|
+
return this.call("app.rocksky.spotify.seek", "POST", {
|
|
47
51
|
params,
|
|
48
52
|
requireAuth: true,
|
|
49
53
|
...opts,
|
package/src/namespaces/stats.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
GetStatsParams,
|
|
3
|
+
GetWrappedParams,
|
|
4
|
+
} from "../generated/types.js";
|
|
5
|
+
import type { RequestOptions } from "../types.js";
|
|
6
|
+
import type { Call } from "./_helpers.js";
|
|
3
7
|
|
|
4
8
|
export class StatsNamespace {
|
|
5
9
|
constructor(private readonly call: Call) {}
|
|
6
10
|
|
|
7
|
-
getStats
|
|
8
|
-
return this.call
|
|
11
|
+
getStats(params: GetStatsParams, opts?: RequestOptions) {
|
|
12
|
+
return this.call("app.rocksky.stats.getStats", "GET", {
|
|
9
13
|
params,
|
|
10
14
|
...opts,
|
|
11
15
|
});
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
getWrapped
|
|
15
|
-
params:
|
|
18
|
+
getWrapped(
|
|
19
|
+
params: GetWrappedParams,
|
|
16
20
|
opts?: RequestOptions,
|
|
17
21
|
) {
|
|
18
|
-
return this.call
|
|
22
|
+
return this.call("app.rocksky.stats.getWrapped", "GET", {
|
|
19
23
|
params,
|
|
20
24
|
...opts,
|
|
21
25
|
});
|
package/src/pipe.ts
CHANGED
package/src/realtime.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RockskyError } from "./errors";
|
|
2
|
-
import { DEFAULT_BASE_URL } from "./types";
|
|
1
|
+
import { RockskyError } from "./errors.js";
|
|
2
|
+
import { DEFAULT_BASE_URL } from "./types.js";
|
|
3
3
|
|
|
4
4
|
/** Minimal WebSocket interface — works with browser `WebSocket`, `ws`, `bun`. */
|
|
5
5
|
export interface WebSocketLike {
|