sockudo 2.0.1 → 2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a69c1173084795c41b60abf8ebce95fe00d5cb6d550a960be09ec5a4b683723c
4
- data.tar.gz: 111fa3673255c2e094fccf7817f63f4f11a8d1710289a7090d8860b9a737df50
3
+ metadata.gz: 8cf03c803da80499345944846d538cf7adfd04b9738e965b4fdeda1236897b87
4
+ data.tar.gz: a6683ad145370135456319a6c1855119f086d9ee62521db6bb1a71f7cc23c09e
5
5
  SHA512:
6
- metadata.gz: bc5d7704e10cc78efac6c5d23d1cb9335f8363bd0a43e88ac74ac0668d97ab3563d8a77cb5b211b60244c8def5799a3607e2873ce46bbc1d31ffc1597233ccaa
7
- data.tar.gz: ffe8ce27b66c03cbd2c1369c4a5fe9813a6b0e6f3a88a695ede5809421babb89277a8bb3b779eec19d10e6fd9ec06fbd194d92408874acb66c1ac3b0288cdf82
6
+ metadata.gz: cfb7a47418538e78cd7fcb0b68edd077fe74c74bfe65208a7c216bdde1c3e6dab364bfc27ddf8f12a34b393b5b76985fc89dac4bb43de347fc28185afda301a0
7
+ data.tar.gz: 5d1a1ce9d2438c61b2d0721d87c0144259f2ede7b51de07193b3bb39029fe3d4d9dfa9735b04df2ece2629c4621e36c82c989aa737f3fbcffd54964a6f5e7731
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.0 - 2026-08-17
4
+
5
+ * [ADDED] Add `terminate_user_connections` and `force_reconnect_user` helpers.
6
+ * [ADDED] Add request coverage and usage documentation for user connection management.
7
+
8
+ ## 2.1.0 - 2026-06-27
9
+
10
+ * [ADDED] Forward-compatibility coverage for future webhook event names and nested payload fields.
11
+
3
12
  ## 2.0.1
4
13
 
5
14
  * [FIXED] multi_json deprecation warning.
data/README.md CHANGED
@@ -163,6 +163,24 @@ auth = sockudo.authenticate(
163
163
  auth = sockudo.authenticate_user(params[:socket_id], { id: 'user-123', name: 'Jane Doe' })
164
164
  ```
165
165
 
166
+ ## User Connection Management
167
+
168
+ ### Terminate User Connections
169
+
170
+ Disconnect every active socket for a user:
171
+
172
+ ```ruby
173
+ sockudo.terminate_user_connections("user-123")
174
+ ```
175
+
176
+ ### Force Reconnect User
177
+
178
+ Close all active connections for a user with code `4200`, prompting clients to reconnect:
179
+
180
+ ```ruby
181
+ sockudo.force_reconnect_user("user-123")
182
+ ```
183
+
166
184
  ## Webhooks
167
185
 
168
186
  Create a webhook object from a `Rack::Request` (available as `request` in Rails controllers and Sinatra handlers):
@@ -373,6 +373,36 @@ module Sockudo
373
373
  get("/channels/#{channel_name}/users", params)
374
374
  end
375
375
 
376
+ # Terminate all active connections for a user
377
+ #
378
+ # POST /apps/[id]/users/[user_id]/terminate_connections
379
+ #
380
+ # @param user_id [String] The user ID whose connections should be terminated
381
+ #
382
+ # @return [Hash] See Sockudo API docs
383
+ #
384
+ # @raise [Sockudo::Error] Unsuccessful response - see the error message
385
+ # @raise [Sockudo::HTTPError] Error raised inside http client. The original error is wrapped in error.original_error
386
+ #
387
+ def terminate_user_connections(user_id)
388
+ post("/users/#{user_id}/terminate_connections")
389
+ end
390
+
391
+ # Force reconnect all active connections for a user
392
+ #
393
+ # POST /apps/[id]/users/[user_id]/force_reconnect
394
+ #
395
+ # @param user_id [String] The user ID whose connections should be force-reconnected
396
+ #
397
+ # @return [Hash] See Sockudo API docs
398
+ #
399
+ # @raise [Sockudo::Error] Unsuccessful response - see the error message
400
+ # @raise [Sockudo::HTTPError] Error raised inside http client. The original error is wrapped in error.original_error
401
+ #
402
+ def force_reconnect_user(user_id)
403
+ post("/users/#{user_id}/force_reconnect")
404
+ end
405
+
376
406
  # Activate or create a push device registration with admin scope
377
407
  def activate_device(device, options = {})
378
408
  post(push_path('/deviceRegistrations'), device,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sockudo
4
- VERSION = '2.0.1'
4
+ VERSION = '2.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sockudo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sockudo