@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
package/src/namespaces/feed.ts
CHANGED
|
@@ -1,104 +1,110 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
GetAlbumRecommendationsParams,
|
|
3
|
+
GetArtistRecommendationsParams,
|
|
4
|
+
GetFeedGeneratorParams,
|
|
5
|
+
GetFeedGeneratorsParams,
|
|
6
|
+
GetFeedParams,
|
|
7
|
+
GetFeedSkeletonParams,
|
|
8
|
+
GetRecommendationsParams,
|
|
9
|
+
GetStoriesParams,
|
|
10
|
+
SearchParams,
|
|
11
|
+
} from "../generated/types.js";
|
|
12
|
+
import type { RequestOptions } from "../types.js";
|
|
13
|
+
import type { Call } from "./_helpers.js";
|
|
3
14
|
|
|
4
|
-
export type RecommendParams =
|
|
15
|
+
export type RecommendParams = GetRecommendationsParams;
|
|
5
16
|
|
|
6
17
|
export class FeedNamespace {
|
|
7
18
|
constructor(private readonly call: Call) {}
|
|
8
19
|
|
|
9
|
-
search
|
|
10
|
-
return this.call
|
|
20
|
+
search(params: SearchParams, opts?: RequestOptions) {
|
|
21
|
+
return this.call("app.rocksky.feed.search", "GET", {
|
|
11
22
|
params,
|
|
12
23
|
...opts,
|
|
13
24
|
});
|
|
14
25
|
}
|
|
15
26
|
|
|
16
|
-
getFeed
|
|
17
|
-
params:
|
|
27
|
+
getFeed(
|
|
28
|
+
params: GetFeedParams,
|
|
18
29
|
opts?: RequestOptions,
|
|
19
30
|
) {
|
|
20
|
-
return this.call
|
|
31
|
+
return this.call("app.rocksky.feed.getFeed", "GET", {
|
|
21
32
|
params,
|
|
22
33
|
...opts,
|
|
23
34
|
});
|
|
24
35
|
}
|
|
25
36
|
|
|
26
|
-
getFeedGenerators
|
|
27
|
-
params:
|
|
37
|
+
getFeedGenerators(
|
|
38
|
+
params: GetFeedGeneratorsParams = {},
|
|
28
39
|
opts?: RequestOptions,
|
|
29
40
|
) {
|
|
30
|
-
return this.call
|
|
41
|
+
return this.call("app.rocksky.feed.getFeedGenerators", "GET", {
|
|
31
42
|
params,
|
|
32
43
|
...opts,
|
|
33
44
|
});
|
|
34
45
|
}
|
|
35
46
|
|
|
36
|
-
getFeedGenerator
|
|
37
|
-
params:
|
|
47
|
+
getFeedGenerator(
|
|
48
|
+
params: GetFeedGeneratorParams,
|
|
38
49
|
opts?: RequestOptions,
|
|
39
50
|
) {
|
|
40
|
-
return this.call
|
|
51
|
+
return this.call("app.rocksky.feed.getFeedGenerator", "GET", {
|
|
41
52
|
params,
|
|
42
53
|
...opts,
|
|
43
54
|
});
|
|
44
55
|
}
|
|
45
56
|
|
|
46
|
-
describeFeedGenerator
|
|
47
|
-
return this.call
|
|
57
|
+
describeFeedGenerator(opts?: RequestOptions) {
|
|
58
|
+
return this.call("app.rocksky.feed.describeFeedGenerator", "GET", {
|
|
48
59
|
...opts,
|
|
49
60
|
});
|
|
50
61
|
}
|
|
51
62
|
|
|
52
|
-
getFeedSkeleton
|
|
53
|
-
params:
|
|
54
|
-
feed: string;
|
|
55
|
-
limit?: number;
|
|
56
|
-
offset?: number;
|
|
57
|
-
cursor?: string;
|
|
58
|
-
},
|
|
63
|
+
getFeedSkeleton(
|
|
64
|
+
params: GetFeedSkeletonParams,
|
|
59
65
|
opts?: RequestOptions,
|
|
60
66
|
) {
|
|
61
|
-
return this.call
|
|
67
|
+
return this.call("app.rocksky.feed.getFeedSkeleton", "GET", {
|
|
62
68
|
params,
|
|
63
69
|
...opts,
|
|
64
70
|
});
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
getRecommendations
|
|
68
|
-
params:
|
|
73
|
+
getRecommendations(
|
|
74
|
+
params: GetRecommendationsParams,
|
|
69
75
|
opts?: RequestOptions,
|
|
70
76
|
) {
|
|
71
|
-
return this.call
|
|
77
|
+
return this.call("app.rocksky.feed.getRecommendations", "GET", {
|
|
72
78
|
params,
|
|
73
79
|
...opts,
|
|
74
80
|
});
|
|
75
81
|
}
|
|
76
82
|
|
|
77
|
-
getArtistRecommendations
|
|
78
|
-
params:
|
|
83
|
+
getArtistRecommendations(
|
|
84
|
+
params: GetArtistRecommendationsParams,
|
|
79
85
|
opts?: RequestOptions,
|
|
80
86
|
) {
|
|
81
|
-
return this.call
|
|
87
|
+
return this.call("app.rocksky.feed.getArtistRecommendations", "GET", {
|
|
82
88
|
params,
|
|
83
89
|
...opts,
|
|
84
90
|
});
|
|
85
91
|
}
|
|
86
92
|
|
|
87
|
-
getAlbumRecommendations
|
|
88
|
-
params:
|
|
93
|
+
getAlbumRecommendations(
|
|
94
|
+
params: GetAlbumRecommendationsParams,
|
|
89
95
|
opts?: RequestOptions,
|
|
90
96
|
) {
|
|
91
|
-
return this.call
|
|
97
|
+
return this.call("app.rocksky.feed.getAlbumRecommendations", "GET", {
|
|
92
98
|
params,
|
|
93
99
|
...opts,
|
|
94
100
|
});
|
|
95
101
|
}
|
|
96
102
|
|
|
97
|
-
getStories
|
|
98
|
-
params:
|
|
103
|
+
getStories(
|
|
104
|
+
params: GetStoriesParams = {},
|
|
99
105
|
opts?: RequestOptions,
|
|
100
106
|
) {
|
|
101
|
-
return this.call
|
|
107
|
+
return this.call("app.rocksky.feed.getStories", "GET", {
|
|
102
108
|
params,
|
|
103
109
|
...opts,
|
|
104
110
|
});
|
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
DownloadFileParams,
|
|
3
|
+
GetFileParams,
|
|
4
|
+
GetFilesParams,
|
|
5
|
+
} from "../generated/types.js";
|
|
6
|
+
import type { RequestOptions } from "../types.js";
|
|
7
|
+
import type { Call } from "./_helpers.js";
|
|
3
8
|
|
|
4
9
|
export class GoogleDriveNamespace {
|
|
5
10
|
constructor(private readonly call: Call) {}
|
|
6
11
|
|
|
7
|
-
getFile
|
|
8
|
-
return this.call
|
|
12
|
+
getFile(params: GetFileParams, opts?: RequestOptions) {
|
|
13
|
+
return this.call("app.rocksky.googledrive.getFile", "GET", {
|
|
9
14
|
params,
|
|
10
15
|
requireAuth: true,
|
|
11
16
|
...opts,
|
|
12
17
|
});
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
getFiles
|
|
16
|
-
params:
|
|
20
|
+
getFiles(
|
|
21
|
+
params: GetFilesParams = {},
|
|
17
22
|
opts?: RequestOptions,
|
|
18
23
|
) {
|
|
19
|
-
return this.call
|
|
24
|
+
return this.call("app.rocksky.googledrive.getFiles", "GET", {
|
|
20
25
|
params,
|
|
21
26
|
requireAuth: true,
|
|
22
27
|
...opts,
|
|
23
28
|
});
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
downloadFile
|
|
27
|
-
params:
|
|
31
|
+
downloadFile(
|
|
32
|
+
params: DownloadFileParams,
|
|
28
33
|
opts?: RequestOptions,
|
|
29
34
|
) {
|
|
30
|
-
return this.call
|
|
35
|
+
return this.call("app.rocksky.googledrive.downloadFile", "GET", {
|
|
31
36
|
params,
|
|
32
37
|
requireAuth: true,
|
|
33
38
|
...opts,
|
package/src/namespaces/graph.ts
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
FollowAccountParams,
|
|
3
|
+
GetFollowersParams,
|
|
4
|
+
GetFollowsParams,
|
|
5
|
+
GetKnownFollowersParams,
|
|
6
|
+
UnfollowAccountParams,
|
|
7
|
+
} from "../generated/types.js";
|
|
8
|
+
import type { RequestOptions } from "../types.js";
|
|
9
|
+
import type { Call } from "./_helpers.js";
|
|
3
10
|
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
limit?: number;
|
|
7
|
-
cursor?: string;
|
|
8
|
-
dids?: string[];
|
|
9
|
-
};
|
|
10
|
-
export type KnownFollowersParams = ActorParam & {
|
|
11
|
-
limit?: number;
|
|
12
|
-
cursor?: string;
|
|
13
|
-
};
|
|
11
|
+
export type FollowListParams = GetFollowersParams;
|
|
12
|
+
export type KnownFollowersParams = GetKnownFollowersParams;
|
|
14
13
|
|
|
15
14
|
export class GraphNamespace {
|
|
16
15
|
constructor(private readonly call: Call) {}
|
|
17
16
|
|
|
18
|
-
followAccount
|
|
19
|
-
params:
|
|
17
|
+
followAccount(
|
|
18
|
+
params: FollowAccountParams,
|
|
20
19
|
opts?: RequestOptions,
|
|
21
20
|
) {
|
|
22
|
-
return this.call
|
|
21
|
+
return this.call("app.rocksky.graph.followAccount", "POST", {
|
|
23
22
|
params,
|
|
24
23
|
requireAuth: true,
|
|
25
24
|
...opts,
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
unfollowAccount
|
|
30
|
-
params:
|
|
28
|
+
unfollowAccount(
|
|
29
|
+
params: UnfollowAccountParams,
|
|
31
30
|
opts?: RequestOptions,
|
|
32
31
|
) {
|
|
33
|
-
return this.call
|
|
32
|
+
return this.call("app.rocksky.graph.unfollowAccount", "POST", {
|
|
34
33
|
params,
|
|
35
34
|
requireAuth: true,
|
|
36
35
|
...opts,
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
getFollowers
|
|
41
|
-
return this.call
|
|
39
|
+
getFollowers(params: GetFollowersParams, opts?: RequestOptions) {
|
|
40
|
+
return this.call("app.rocksky.graph.getFollowers", "GET", {
|
|
42
41
|
params,
|
|
43
42
|
...opts,
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
getFollows
|
|
48
|
-
return this.call
|
|
46
|
+
getFollows(params: GetFollowsParams, opts?: RequestOptions) {
|
|
47
|
+
return this.call("app.rocksky.graph.getFollows", "GET", {
|
|
49
48
|
params,
|
|
50
49
|
...opts,
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
getKnownFollowers
|
|
55
|
-
params:
|
|
53
|
+
getKnownFollowers(
|
|
54
|
+
params: GetKnownFollowersParams,
|
|
56
55
|
opts?: RequestOptions,
|
|
57
56
|
) {
|
|
58
|
-
return this.call
|
|
57
|
+
return this.call("app.rocksky.graph.getKnownFollowers", "GET", {
|
|
59
58
|
params,
|
|
60
59
|
...opts,
|
|
61
60
|
});
|
package/src/namespaces/like.ts
CHANGED
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
DislikeShoutInput,
|
|
3
|
+
DislikeSongInput,
|
|
4
|
+
LikeShoutInput,
|
|
5
|
+
LikeSongInput,
|
|
6
|
+
} from "../generated/types.js";
|
|
7
|
+
import type { RequestOptions } from "../types.js";
|
|
8
|
+
import type { Call } from "./_helpers.js";
|
|
3
9
|
|
|
4
|
-
export type LikeInput =
|
|
10
|
+
export type LikeInput = LikeSongInput;
|
|
5
11
|
|
|
6
12
|
export class LikeNamespace {
|
|
7
13
|
constructor(private readonly call: Call) {}
|
|
8
14
|
|
|
9
|
-
likeSong
|
|
10
|
-
return this.call
|
|
15
|
+
likeSong(input: LikeSongInput = {}, opts?: RequestOptions) {
|
|
16
|
+
return this.call("app.rocksky.like.likeSong", "POST", {
|
|
11
17
|
body: input,
|
|
12
18
|
requireAuth: true,
|
|
13
19
|
...opts,
|
|
14
20
|
});
|
|
15
21
|
}
|
|
16
22
|
|
|
17
|
-
dislikeSong
|
|
18
|
-
return this.call
|
|
23
|
+
dislikeSong(input: DislikeSongInput = {}, opts?: RequestOptions) {
|
|
24
|
+
return this.call("app.rocksky.like.dislikeSong", "POST", {
|
|
19
25
|
body: input,
|
|
20
26
|
requireAuth: true,
|
|
21
27
|
...opts,
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
likeShout
|
|
26
|
-
return this.call
|
|
31
|
+
likeShout(input: LikeShoutInput = {}, opts?: RequestOptions) {
|
|
32
|
+
return this.call("app.rocksky.like.likeShout", "POST", {
|
|
27
33
|
body: input,
|
|
28
34
|
requireAuth: true,
|
|
29
35
|
...opts,
|
|
30
36
|
});
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
dislikeShout
|
|
34
|
-
return this.call
|
|
39
|
+
dislikeShout(input: DislikeShoutInput = {}, opts?: RequestOptions) {
|
|
40
|
+
return this.call("app.rocksky.like.dislikeShout", "POST", {
|
|
35
41
|
body: input,
|
|
36
42
|
requireAuth: true,
|
|
37
43
|
...opts,
|
package/src/namespaces/mirror.ts
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RequestOptions } from "../types";
|
|
1
|
+
import type { PutMirrorSourceInput } from "../generated/types.js";
|
|
2
|
+
import type { RequestOptions } from "../types.js";
|
|
3
|
+
import type { Call } from "./_helpers.js";
|
|
3
4
|
|
|
4
|
-
export type PutMirrorSourceInput
|
|
5
|
-
provider: string;
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
externalUsername?: string;
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
};
|
|
5
|
+
export type { PutMirrorSourceInput };
|
|
10
6
|
|
|
11
7
|
export class MirrorNamespace {
|
|
12
8
|
constructor(private readonly call: Call) {}
|
|
13
9
|
|
|
14
|
-
getMirrorSources
|
|
15
|
-
return this.call
|
|
10
|
+
getMirrorSources(opts?: RequestOptions) {
|
|
11
|
+
return this.call("app.rocksky.mirror.getMirrorSources", "GET", {
|
|
16
12
|
requireAuth: true,
|
|
17
13
|
...opts,
|
|
18
14
|
});
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
putMirrorSource
|
|
17
|
+
putMirrorSource(
|
|
22
18
|
input: PutMirrorSourceInput,
|
|
23
19
|
opts?: RequestOptions,
|
|
24
20
|
) {
|
|
25
|
-
return this.call
|
|
21
|
+
return this.call("app.rocksky.mirror.putMirrorSource", "POST", {
|
|
26
22
|
body: input,
|
|
27
23
|
requireAuth: true,
|
|
28
24
|
...opts,
|
package/src/namespaces/player.ts
CHANGED
|
@@ -1,125 +1,123 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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.js";
|
|
14
|
+
import type { RequestOptions } from "../types.js";
|
|
15
|
+
import type { Call } from "./_helpers.js";
|
|
5
16
|
|
|
6
17
|
export class PlayerNamespace {
|
|
7
18
|
constructor(private readonly call: Call) {}
|
|
8
19
|
|
|
9
|
-
getCurrentlyPlaying
|
|
10
|
-
params:
|
|
20
|
+
getCurrentlyPlaying(
|
|
21
|
+
params: GetCurrentlyPlayingParams = {},
|
|
11
22
|
opts?: RequestOptions,
|
|
12
23
|
) {
|
|
13
|
-
return this.call
|
|
24
|
+
return this.call("app.rocksky.player.getCurrentlyPlaying", "GET", {
|
|
14
25
|
params,
|
|
15
26
|
...opts,
|
|
16
27
|
});
|
|
17
28
|
}
|
|
18
29
|
|
|
19
|
-
getPlaybackQueue
|
|
20
|
-
params:
|
|
30
|
+
getPlaybackQueue(
|
|
31
|
+
params: GetPlaybackQueueParams = {},
|
|
21
32
|
opts?: RequestOptions,
|
|
22
33
|
) {
|
|
23
|
-
return this.call
|
|
34
|
+
return this.call("app.rocksky.player.getPlaybackQueue", "GET", {
|
|
24
35
|
params,
|
|
25
36
|
...opts,
|
|
26
37
|
});
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
play
|
|
30
|
-
return this.call
|
|
40
|
+
play(params: PlayParams = {}, opts?: RequestOptions) {
|
|
41
|
+
return this.call("app.rocksky.player.play", "POST", {
|
|
31
42
|
params,
|
|
32
43
|
requireAuth: true,
|
|
33
44
|
...opts,
|
|
34
45
|
});
|
|
35
46
|
}
|
|
36
47
|
|
|
37
|
-
pause
|
|
38
|
-
return this.call
|
|
48
|
+
pause(params: PauseParams = {}, opts?: RequestOptions) {
|
|
49
|
+
return this.call("app.rocksky.player.pause", "POST", {
|
|
39
50
|
params,
|
|
40
51
|
requireAuth: true,
|
|
41
52
|
...opts,
|
|
42
53
|
});
|
|
43
54
|
}
|
|
44
55
|
|
|
45
|
-
next
|
|
46
|
-
return this.call
|
|
56
|
+
next(params: NextParams = {}, opts?: RequestOptions) {
|
|
57
|
+
return this.call("app.rocksky.player.next", "POST", {
|
|
47
58
|
params,
|
|
48
59
|
requireAuth: true,
|
|
49
60
|
...opts,
|
|
50
61
|
});
|
|
51
62
|
}
|
|
52
63
|
|
|
53
|
-
previous
|
|
54
|
-
return this.call
|
|
64
|
+
previous(params: PreviousParams = {}, opts?: RequestOptions) {
|
|
65
|
+
return this.call("app.rocksky.player.previous", "POST", {
|
|
55
66
|
params,
|
|
56
67
|
requireAuth: true,
|
|
57
68
|
...opts,
|
|
58
69
|
});
|
|
59
70
|
}
|
|
60
71
|
|
|
61
|
-
seek
|
|
62
|
-
params:
|
|
72
|
+
seek(
|
|
73
|
+
params: SeekParams,
|
|
63
74
|
opts?: RequestOptions,
|
|
64
75
|
) {
|
|
65
|
-
return this.call
|
|
76
|
+
return this.call("app.rocksky.player.seek", "POST", {
|
|
66
77
|
params,
|
|
67
78
|
requireAuth: true,
|
|
68
79
|
...opts,
|
|
69
80
|
});
|
|
70
81
|
}
|
|
71
82
|
|
|
72
|
-
playFile
|
|
73
|
-
params:
|
|
83
|
+
playFile(
|
|
84
|
+
params: PlayFileParams,
|
|
74
85
|
opts?: RequestOptions,
|
|
75
86
|
) {
|
|
76
|
-
return this.call
|
|
87
|
+
return this.call("app.rocksky.player.playFile", "POST", {
|
|
77
88
|
params,
|
|
78
89
|
requireAuth: true,
|
|
79
90
|
...opts,
|
|
80
91
|
});
|
|
81
92
|
}
|
|
82
93
|
|
|
83
|
-
playDirectory
|
|
84
|
-
params:
|
|
85
|
-
directoryId: string;
|
|
86
|
-
shuffle?: boolean;
|
|
87
|
-
recurse?: boolean;
|
|
88
|
-
position?: number;
|
|
89
|
-
},
|
|
94
|
+
playDirectory(
|
|
95
|
+
params: PlayDirectoryParams,
|
|
90
96
|
opts?: RequestOptions,
|
|
91
97
|
) {
|
|
92
|
-
return this.call
|
|
98
|
+
return this.call("app.rocksky.player.playDirectory", "POST", {
|
|
93
99
|
params,
|
|
94
100
|
requireAuth: true,
|
|
95
101
|
...opts,
|
|
96
102
|
});
|
|
97
103
|
}
|
|
98
104
|
|
|
99
|
-
addItemsToQueue
|
|
100
|
-
params:
|
|
101
|
-
items: string[];
|
|
102
|
-
position?: number;
|
|
103
|
-
shuffle?: boolean;
|
|
104
|
-
},
|
|
105
|
+
addItemsToQueue(
|
|
106
|
+
params: AddItemsToQueueParams,
|
|
105
107
|
opts?: RequestOptions,
|
|
106
108
|
) {
|
|
107
|
-
return this.call
|
|
109
|
+
return this.call("app.rocksky.player.addItemsToQueue", "POST", {
|
|
108
110
|
params,
|
|
109
111
|
requireAuth: true,
|
|
110
112
|
...opts,
|
|
111
113
|
});
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
addDirectoryToQueue
|
|
115
|
-
params:
|
|
116
|
-
directory: string;
|
|
117
|
-
position?: number;
|
|
118
|
-
shuffle?: boolean;
|
|
119
|
-
},
|
|
116
|
+
addDirectoryToQueue(
|
|
117
|
+
params: AddDirectoryToQueueParams,
|
|
120
118
|
opts?: RequestOptions,
|
|
121
119
|
) {
|
|
122
|
-
return this.call
|
|
120
|
+
return this.call("app.rocksky.player.addDirectoryToQueue", "POST", {
|
|
123
121
|
params,
|
|
124
122
|
...opts,
|
|
125
123
|
});
|
|
@@ -1,83 +1,93 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
CreatePlaylistParams,
|
|
3
|
+
GetPlaylistParams,
|
|
4
|
+
GetPlaylistsParams,
|
|
5
|
+
InsertDirectoryParams,
|
|
6
|
+
InsertFilesParams,
|
|
7
|
+
RemovePlaylistParams,
|
|
8
|
+
RemoveTrackParams,
|
|
9
|
+
StartPlaylistParams,
|
|
10
|
+
} from "../generated/types.js";
|
|
11
|
+
import type { RequestOptions } from "../types.js";
|
|
12
|
+
import type { Call } from "./_helpers.js";
|
|
3
13
|
|
|
4
14
|
export class PlaylistNamespace {
|
|
5
15
|
constructor(private readonly call: Call) {}
|
|
6
16
|
|
|
7
|
-
getPlaylists
|
|
8
|
-
params:
|
|
17
|
+
getPlaylists(
|
|
18
|
+
params: GetPlaylistsParams = {},
|
|
9
19
|
opts?: RequestOptions,
|
|
10
20
|
) {
|
|
11
|
-
return this.call
|
|
21
|
+
return this.call("app.rocksky.playlist.getPlaylists", "GET", {
|
|
12
22
|
params,
|
|
13
23
|
...opts,
|
|
14
24
|
});
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
getPlaylist
|
|
18
|
-
return this.call
|
|
27
|
+
getPlaylist(params: GetPlaylistParams, opts?: RequestOptions) {
|
|
28
|
+
return this.call("app.rocksky.playlist.getPlaylist", "GET", {
|
|
19
29
|
params,
|
|
20
30
|
...opts,
|
|
21
31
|
});
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
createPlaylist
|
|
25
|
-
params:
|
|
34
|
+
createPlaylist(
|
|
35
|
+
params: CreatePlaylistParams,
|
|
26
36
|
opts?: RequestOptions,
|
|
27
37
|
) {
|
|
28
|
-
return this.call
|
|
38
|
+
return this.call("app.rocksky.playlist.createPlaylist", "POST", {
|
|
29
39
|
params,
|
|
30
40
|
requireAuth: true,
|
|
31
41
|
...opts,
|
|
32
42
|
});
|
|
33
43
|
}
|
|
34
44
|
|
|
35
|
-
removePlaylist
|
|
36
|
-
return this.call
|
|
45
|
+
removePlaylist(params: RemovePlaylistParams, opts?: RequestOptions) {
|
|
46
|
+
return this.call("app.rocksky.playlist.removePlaylist", "POST", {
|
|
37
47
|
params,
|
|
38
48
|
requireAuth: true,
|
|
39
49
|
...opts,
|
|
40
50
|
});
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
startPlaylist
|
|
44
|
-
params:
|
|
53
|
+
startPlaylist(
|
|
54
|
+
params: StartPlaylistParams,
|
|
45
55
|
opts?: RequestOptions,
|
|
46
56
|
) {
|
|
47
|
-
return this.call
|
|
57
|
+
return this.call("app.rocksky.playlist.startPlaylist", "POST", {
|
|
48
58
|
params,
|
|
49
59
|
requireAuth: true,
|
|
50
60
|
...opts,
|
|
51
61
|
});
|
|
52
62
|
}
|
|
53
63
|
|
|
54
|
-
insertDirectory
|
|
55
|
-
params:
|
|
64
|
+
insertDirectory(
|
|
65
|
+
params: InsertDirectoryParams,
|
|
56
66
|
opts?: RequestOptions,
|
|
57
67
|
) {
|
|
58
|
-
return this.call
|
|
68
|
+
return this.call("app.rocksky.playlist.insertDirectory", "POST", {
|
|
59
69
|
params,
|
|
60
70
|
requireAuth: true,
|
|
61
71
|
...opts,
|
|
62
72
|
});
|
|
63
73
|
}
|
|
64
74
|
|
|
65
|
-
insertFiles
|
|
66
|
-
params:
|
|
75
|
+
insertFiles(
|
|
76
|
+
params: InsertFilesParams,
|
|
67
77
|
opts?: RequestOptions,
|
|
68
78
|
) {
|
|
69
|
-
return this.call
|
|
79
|
+
return this.call("app.rocksky.playlist.insertFiles", "POST", {
|
|
70
80
|
params,
|
|
71
81
|
requireAuth: true,
|
|
72
82
|
...opts,
|
|
73
83
|
});
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
removeTrack
|
|
77
|
-
params:
|
|
86
|
+
removeTrack(
|
|
87
|
+
params: RemoveTrackParams,
|
|
78
88
|
opts?: RequestOptions,
|
|
79
89
|
) {
|
|
80
|
-
return this.call
|
|
90
|
+
return this.call("app.rocksky.playlist.removeTrack", "POST", {
|
|
81
91
|
params,
|
|
82
92
|
...opts,
|
|
83
93
|
});
|