stream-chat-ruby 3.12.0 → 3.13.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: 6a82d5e57e78d2f495ea24218a4f5320e1d3e07d135ff6581ee3f6e0457b82f9
4
- data.tar.gz: 328487e5aa840033e84f189d8e02d101b71db31a775d6af6732b10991f8f8339
3
+ metadata.gz: 3f242a964e26ae0d7150830f886e9e1b96b8a3f0a203421c0f8b8b439a455146
4
+ data.tar.gz: 5ade6ec19923342d9508b1b2b139c68e107ae0458e38edd41773e9c8e41d088b
5
5
  SHA512:
6
- metadata.gz: b90f95c75dc4945afc521e05859181146a5d697026574363e0973a74dbe2409067ee51efac819c61c2922c81b8d19fc1b942cecde6ad7b68380f798e016c0763
7
- data.tar.gz: e93e5222e8746762c77a2d55d6b8544d9ae1e0be7441c083f334a0e26cc7a75f51fdd16a4e99d37067c256dd9f43de101c25c03b5323c7d5f8452621526b210f
6
+ metadata.gz: f1f4a36a5c7d9bc92cbd0ca7503fda1c18c67fac83e6cbbab46885703de71dd8aeac9b3312aba7c68b71ac4dcbba25ecb7b9eb7800ed3cdb7e6767a93c22ae93
7
+ data.tar.gz: d71f1a32e0e30f78a23bbd4bcd048215b15432f65645bd68d985d1d6650705f735d9ef3e8c36313903206e03366c5f71144c9faa6af042299e737bfc9367d112
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.13.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.12.0...v3.13.0) (2025-04-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * deactivate users ([#162](https://github.com/GetStream/stream-chat-ruby/issues/162)) ([12bf4d1](https://github.com/GetStream/stream-chat-ruby/commit/12bf4d19846b5100f1886929b74c7ad05d753be4))
11
+ * draft messages ([#161](https://github.com/GetStream/stream-chat-ruby/pull/161)) ([1719104](https://github.com/GetStream/stream-chat-ruby/commit/c7bccb3ad30721a20f32fd60eb13ab6d97a08208))
12
+
13
+ ### Other
14
+
15
+ * added nijeesh to code owners ([#156](https://github.com/GetStream/stream-chat-ruby/issues/156)) ([7cd4e54](https://github.com/GetStream/stream-chat-ruby/commit/7cd4e5443a8f283596b8eadc873030d737cd621c))
16
+ * **release:** v3.12.0 ([#157](https://github.com/GetStream/stream-chat-ruby/issues/157)) ([993b7a3](https://github.com/GetStream/stream-chat-ruby/commit/993b7a30bd2222ee328ca7a862384c7baf7d53e1))
17
+
5
18
  ## [3.11.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.9.0...v3.11.0) (2025-03-21)
6
19
 
7
20
 
@@ -360,6 +360,41 @@ module StreamChat
360
360
  @client.delete("#{self.url}/image", params: { url: url })
361
361
  end
362
362
 
363
+ # Creates or updates a draft message for this channel.
364
+ #
365
+ # @param [StringKeyHash] message The draft message content
366
+ # @param [String] user_id The ID of the user creating/updating the draft
367
+ # @return [StreamChat::StreamResponse]
368
+ sig { params(message: StringKeyHash, user_id: String).returns(StreamChat::StreamResponse) }
369
+ def create_draft(message, user_id)
370
+ payload = { message: add_user_id(message, user_id) }
371
+ @client.post("#{url}/draft", data: payload)
372
+ end
373
+
374
+ # Deletes a draft message for this channel.
375
+ #
376
+ # @param [String] user_id The ID of the user deleting the draft
377
+ # @param [String] parent_id Optional parent message ID for thread drafts
378
+ # @return [StreamChat::StreamResponse]
379
+ sig { params(user_id: String, parent_id: T.nilable(String)).returns(StreamChat::StreamResponse) }
380
+ def delete_draft(user_id, parent_id: nil)
381
+ params = { user_id: user_id }
382
+ params[:parent_id] = parent_id if parent_id
383
+ @client.delete("#{url}/draft", params: params)
384
+ end
385
+
386
+ # Gets a draft message for this channel.
387
+ #
388
+ # @param [String] user_id The ID of the user getting the draft
389
+ # @param [String] parent_id Optional parent message ID for thread drafts
390
+ # @return [StreamChat::StreamResponse]
391
+ sig { params(user_id: String, parent_id: T.nilable(String)).returns(StreamChat::StreamResponse) }
392
+ def get_draft(user_id, parent_id: nil)
393
+ params = { user_id: user_id }
394
+ params[:parent_id] = parent_id if parent_id
395
+ @client.get("#{url}/draft", params: params)
396
+ end
397
+
363
398
  private
364
399
 
365
400
  sig { params(payload: StringKeyHash, user_id: String).returns(StringKeyHash) }
@@ -280,6 +280,14 @@ module StreamChat
280
280
  post("users/#{user_id}/deactivate", params: options)
281
281
  end
282
282
 
283
+ # Deactivates a users
284
+ sig { params(user_ids: T::Array[String], options: T.untyped).returns(StreamChat::StreamResponse) }
285
+ def deactivate_users(user_ids, **options)
286
+ raise ArgumentError, 'user_ids should not be empty' if user_ids.empty?
287
+
288
+ post('users/deactivate', data: { user_ids: user_ids, **options })
289
+ end
290
+
283
291
  # Reactivates a deactivated user. Use deactivate_user to deactivate a user.
284
292
  sig { params(user_id: String, options: T.untyped).returns(StreamChat::StreamResponse) }
285
293
  def reactivate_user(user_id, **options)
@@ -783,6 +791,22 @@ module StreamChat
783
791
  post('commands', data: command)
784
792
  end
785
793
 
794
+ # Queries draft messages for the current user.
795
+ #
796
+ # @param [String] user_id The ID of the user to query drafts for
797
+ # @param [StringKeyHash] filter Optional filter conditions for the query
798
+ # @param [Array] sort Optional sort parameters
799
+ # @param [Hash] options Additional query options
800
+ # @return [StreamChat::StreamResponse]
801
+ sig { params(user_id: String, filter: T.nilable(StringKeyHash), sort: T.nilable(T::Array[StringKeyHash]), options: T.untyped).returns(StreamChat::StreamResponse) }
802
+ def query_drafts(user_id, filter: nil, sort: nil, **options)
803
+ data = { user_id: user_id }
804
+ data['filter'] = filter if filter
805
+ data['sort'] = sort if sort
806
+ data.merge!(options) if options
807
+ post('drafts/query', data: data)
808
+ end
809
+
786
810
  # Gets a comamnd.
787
811
  sig { params(name: String).returns(StreamChat::StreamResponse) }
788
812
  def get_command(name)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module StreamChat
5
- VERSION = '3.12.0'
5
+ VERSION = '3.13.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream-chat-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.0
4
+ version: 3.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - getstream.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-25 00:00:00.000000000 Z
11
+ date: 2025-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday