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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +18 -0
- data/lib/sockudo/client.rb +30 -0
- data/lib/sockudo/version.rb +1 -1
- 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: 8cf03c803da80499345944846d538cf7adfd04b9738e965b4fdeda1236897b87
|
|
4
|
+
data.tar.gz: a6683ad145370135456319a6c1855119f086d9ee62521db6bb1a71f7cc23c09e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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):
|
data/lib/sockudo/client.rb
CHANGED
|
@@ -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,
|
data/lib/sockudo/version.rb
CHANGED