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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04a23ddf1b0b2c3207cb576fa5809509520ffe2caa5af6edd45c8e8d56f6a873
4
- data.tar.gz: e3477fabe8cded03dadb16353781143f9c70722c7e38196154a4c01e47a54583
3
+ metadata.gz: 0b8b76d8708ad8f7131598c1440f644a6e037f5f83d15438c64b9b855e41cbca
4
+ data.tar.gz: 746d5eaad86c2ecc50fc8e24b64e34c06619df8f7446258d5974e84050df9088
5
5
  SHA512:
6
- metadata.gz: 14b72030dbe0dd39f5b277af0729913f71739c89e62d57c89b46abb8bc23300f991bcb6e8b5ee485197886058d372c57e31a27d92b5fd53d3b2e2d644e50d859
7
- data.tar.gz: 83c8ce3c29d4b90f2baa3f9111fe1207099bb89435aa142edbbbd3bef2a13af9ba19ec2d997b4544b72e2e972958ebe98f78083aff6a0d167d8756d76294c1b4
6
+ metadata.gz: 8978ba1c65543698e7af1790d8e2eb0e9c38048b6b1d15c15abc8482681ea13238bda48fb810ef122a6de59ba42ed1983522d336df809c3277c50650f5c6330a
7
+ data.tar.gz: 3e573bd6311727ae239f95de13b0dcc38b77bd8aa0a1d3d7c74e08c0e97d7747d3de144f076a9956a6445c10de3bac1e2598d7da51dc62871287cfd07811e57a
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "repo": "tsirysndr/rocksky",
3
- "tag": "bindings-v0.4.0",
3
+ "tag": "bindings-v0.5.0",
4
4
  "checksums": {
5
- "aarch64-apple-darwin": "cd828960ba30880c121eca655a890625360c8b6f3d7d1e15ecbfeda9934c1496",
6
- "aarch64-linux-gnu": "43d52700719ca325a7cc4bf24ae6e8eef8e71bdf532968bcc029f067e09e660f",
7
- "x86_64-apple-darwin": "54749d2c37bd2f4f487a24b91ab935a6806f359e2bf8b52ec192d4421524aed0",
8
- "x86_64-linux-gnu": "6750513f2a592637c436e28113aaa4e2cc2890829b337a3dcf999b40bbd7d924",
9
- "x86_64-unknown-freebsd": "f1fa22d790c30dee2d4418e5a781338d4aeffbd334db48bc5d70bc94b88f23db",
10
- "x86_64-unknown-netbsd": "4bb233727e965c45187cfa254206a25756c2c2fdc25e64df39f84f5d5eeb01d5"
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
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rocksky
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocksky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rocksky