rocksky 0.7.0 → 0.8.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.
- checksums.yaml +4 -4
- data/lib/rocksky/manifest.json +7 -7
- data/lib/rocksky/version.rb +1 -1
- data/lib/rocksky.rb +45 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0b8b76d8708ad8f7131598c1440f644a6e037f5f83d15438c64b9b855e41cbca
|
|
4
|
+
data.tar.gz: 746d5eaad86c2ecc50fc8e24b64e34c06619df8f7446258d5974e84050df9088
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8978ba1c65543698e7af1790d8e2eb0e9c38048b6b1d15c15abc8482681ea13238bda48fb810ef122a6de59ba42ed1983522d336df809c3277c50650f5c6330a
|
|
7
|
+
data.tar.gz: 3e573bd6311727ae239f95de13b0dcc38b77bd8aa0a1d3d7c74e08c0e97d7747d3de144f076a9956a6445c10de3bac1e2598d7da51dc62871287cfd07811e57a
|
data/lib/rocksky/manifest.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repo": "tsirysndr/rocksky",
|
|
3
|
-
"tag": "bindings-v0.
|
|
3
|
+
"tag": "bindings-v0.5.0",
|
|
4
4
|
"checksums": {
|
|
5
|
-
"aarch64-apple-darwin": "
|
|
6
|
-
"aarch64-linux-gnu": "
|
|
7
|
-
"x86_64-apple-darwin": "
|
|
8
|
-
"x86_64-linux-gnu": "
|
|
9
|
-
"x86_64-unknown-freebsd": "
|
|
10
|
-
"x86_64-unknown-netbsd": "
|
|
5
|
+
"aarch64-apple-darwin": "f0a2965681967c261cd9b11ddf3ccf33fbc813cd4551cad35316f25e988c9e2c",
|
|
6
|
+
"aarch64-linux-gnu": "345f0545415ea86a9b1d6f397c36f1810ce78140c7b1db3eee4bdb7b9299f4f2",
|
|
7
|
+
"x86_64-apple-darwin": "d2568ab8c781851023c9922f7b7853adbd7af40bfa606814ef6abcd541510eb7",
|
|
8
|
+
"x86_64-linux-gnu": "9b6b17d884207a3fb79b0c89d7db4d24817ca01a947616ffafdde9f47f1f4931",
|
|
9
|
+
"x86_64-unknown-freebsd": "aba544031f8e146086a0ea5628382bcf19c9f6a3311cbb6586fa8661ca5da914",
|
|
10
|
+
"x86_64-unknown-netbsd": "483a0b272e080f596709812eb55cbe983332cf3f40ae3fa15ed7e0179df21636"
|
|
11
11
|
}
|
|
12
12
|
}
|
data/lib/rocksky/version.rb
CHANGED
data/lib/rocksky.rb
CHANGED
|
@@ -27,6 +27,7 @@ module Rocksky
|
|
|
27
27
|
"char* rocksky_top_tracks(const char*, unsigned int, unsigned int)",
|
|
28
28
|
"char* rocksky_global_stats(const char*)",
|
|
29
29
|
"char* rocksky_get(const char*, const char*, const char*, const char*)",
|
|
30
|
+
"char* rocksky_update_seen(const char*, const char*, const char*)",
|
|
30
31
|
"char* rocksky_library_get(const char*, const char*, const char*, const char*)",
|
|
31
32
|
"char* rocksky_library_post(const char*, const char*, const char*, const char*)",
|
|
32
33
|
"char* rocksky_match_song(const char*, const char*, const char*, const char*, const char*)",
|
|
@@ -44,6 +45,8 @@ module Rocksky
|
|
|
44
45
|
"char* rocksky_agent_like(void*, const char*, const char*)",
|
|
45
46
|
"char* rocksky_agent_follow(void*, const char*)",
|
|
46
47
|
"char* rocksky_agent_shout(void*, const char*, const char*, const char*)",
|
|
48
|
+
"char* rocksky_agent_shout_with_gif(void*, const char*, const char*, const char*, const char*)",
|
|
49
|
+
"char* rocksky_agent_reply_shout_with_gif(void*, const char*, const char*, const char*, const char*, const char*, const char*)",
|
|
47
50
|
"char* rocksky_agent_refresh_session(void*)"
|
|
48
51
|
].each { |sig| extern sig }
|
|
49
52
|
end
|
|
@@ -102,6 +105,30 @@ module Rocksky
|
|
|
102
105
|
unwrap(C.rocksky_get(base.to_s, nsid, JSON.generate(params), token.to_s))
|
|
103
106
|
end
|
|
104
107
|
|
|
108
|
+
# ---- notifications (auth-gated; +token+ required) ----
|
|
109
|
+
|
|
110
|
+
# The authenticated viewer's unread-notification count. Returns
|
|
111
|
+
# { "count" => Integer }.
|
|
112
|
+
def self.unread_count(token:, base: nil)
|
|
113
|
+
get("app.rocksky.notification.getUnreadCount", {}, base: base, token: token)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# The authenticated viewer's notifications, most recent first. +limit+ defaults
|
|
117
|
+
# to 30 server-side; +cursor+ paginates. Returns
|
|
118
|
+
# { "notifications" => [...], "unreadCount" => Integer, "cursor" => String? }.
|
|
119
|
+
def self.notifications(token:, limit: nil, cursor: nil, base: nil)
|
|
120
|
+
params = {}
|
|
121
|
+
params[:limit] = limit unless limit.nil?
|
|
122
|
+
params[:cursor] = cursor unless cursor.nil?
|
|
123
|
+
get("app.rocksky.notification.listNotifications", params, base: base, token: token)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Mark notifications as viewed. +ids+ is an array of notification ids, or an
|
|
127
|
+
# empty array to mark *all* as viewed. Returns { "unreadCount" => Integer }.
|
|
128
|
+
def self.update_seen(token:, ids: [], base: nil)
|
|
129
|
+
unwrap(C.rocksky_update_seen(base.to_s, token.to_s, JSON.generate(ids)))
|
|
130
|
+
end
|
|
131
|
+
|
|
105
132
|
# Resolve full canonical metadata for a bare title + artist (matchSong).
|
|
106
133
|
def self.match_song(title, artist, mb_id: nil, isrc: nil, base: nil)
|
|
107
134
|
unwrap(C.rocksky_match_song(base.to_s, title, artist, mb_id.to_s, isrc.to_s))
|
|
@@ -200,6 +227,24 @@ module Rocksky
|
|
|
200
227
|
Rocksky.unwrap(C.rocksky_agent_shout(@ptr, subject_uri, subject_cid, message))
|
|
201
228
|
end
|
|
202
229
|
|
|
230
|
+
# Post a shout with an optional GIF/sticker/clip attachment. Pass at least
|
|
231
|
+
# one of +message+ / +gif+. +gif+ is a Hash with camelCase keys ("url"
|
|
232
|
+
# required, plus "previewUrl", "alt", "width", "height").
|
|
233
|
+
def shout_with_gif(subject_uri, subject_cid, message: nil, gif: nil)
|
|
234
|
+
Rocksky.unwrap(C.rocksky_agent_shout_with_gif(
|
|
235
|
+
@ptr, subject_uri, subject_cid, message.to_s, gif ? JSON.generate(gif) : ""
|
|
236
|
+
))
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Reply to a shout with an optional GIF/sticker/clip attachment. Semantics
|
|
240
|
+
# match #shout_with_gif, plus a parent strong-ref (+parent_uri+/+parent_cid+).
|
|
241
|
+
def reply_shout_with_gif(subject_uri, subject_cid, parent_uri, parent_cid, message: nil, gif: nil)
|
|
242
|
+
Rocksky.unwrap(C.rocksky_agent_reply_shout_with_gif(
|
|
243
|
+
@ptr, subject_uri, subject_cid, parent_uri, parent_cid,
|
|
244
|
+
message.to_s, gif ? JSON.generate(gif) : ""
|
|
245
|
+
))
|
|
246
|
+
end
|
|
247
|
+
|
|
203
248
|
def refresh_session
|
|
204
249
|
Rocksky.unwrap(C.rocksky_agent_refresh_session(@ptr))
|
|
205
250
|
end
|