stream-chat-ruby 2.22.2 → 2.23.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 +8 -0
- data/lib/stream-chat/client.rb +118 -2
- data/lib/stream-chat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e555a899a1f327f6ab64ae55a383c84bf76991df3530d67b8c29a84a27e0b4
|
4
|
+
data.tar.gz: 93df6034f3d3f76d735f3a023ef0e160b1c74930509b52c80df3e9436b28780d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 668c718c2dc5b9c75db14601a3c8d2ebf6eaf3f7a53d14b654c05236304b8bc46fd8c76f6790cde9c16453911bc07bc6f4efb6c7be5547a036b2f98d33c58b35
|
7
|
+
data.tar.gz: e5b37cf05fedfe43a6d5b512dd36a0443010c7261070d40aa3455448c98a47842cbe2dbdd4b03cd83c315851aa810e66fda1e7cba4c358da1d015bde6f484484
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
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
|
+
## [2.23.0](https://github.com/GetStream/stream-chat-ruby/compare/v2.22.2...v2.23.0) (2022-05-19)
|
6
|
+
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* **campaign:** add campaign endpoints ([c8c698b](https://github.com/GetStream/stream-chat-ruby/commit/c8c698b51ee2c9f54819c2b9407a3fff7808efd5))
|
11
|
+
* **import:** add import endpoints ([#102](https://github.com/GetStream/stream-chat-ruby/issues/102)) ([4d7358d](https://github.com/GetStream/stream-chat-ruby/commit/4d7358d39615c5346f9fdcb2b0dfbffa3c2ae79c))
|
12
|
+
|
5
13
|
### [2.22.2](https://github.com/GetStream/stream-chat-ruby/compare/v2.22.1...v2.22.2) (2022-04-21)
|
6
14
|
|
7
15
|
|
data/lib/stream-chat/client.rb
CHANGED
@@ -206,14 +206,14 @@ module StreamChat
|
|
206
206
|
get('search', params: { payload: options.merge(to_merge).to_json })
|
207
207
|
end
|
208
208
|
|
209
|
-
#
|
209
|
+
# @deprecated Use {#upsert_users} instead.
|
210
210
|
T::Sig::WithoutRuntime.sig { params(users: T::Array[StringKeyHash]).returns(StreamChat::StreamResponse) }
|
211
211
|
def update_users(users)
|
212
212
|
warn '[DEPRECATION] `update_users` is deprecated. Please use `upsert_users` instead.'
|
213
213
|
upsert_users(users)
|
214
214
|
end
|
215
215
|
|
216
|
-
#
|
216
|
+
# @deprecated Use {#upsert_user} instead.
|
217
217
|
T::Sig::WithoutRuntime.sig { params(user: StringKeyHash).returns(StreamChat::StreamResponse) }
|
218
218
|
def update_user(user)
|
219
219
|
warn '[DEPRECATION] `update_user` is deprecated. Please use `upsert_user` instead.'
|
@@ -834,6 +834,122 @@ module StreamChat
|
|
834
834
|
get('push_providers')
|
835
835
|
end
|
836
836
|
|
837
|
+
# Creates a signed URL for imports.
|
838
|
+
# @example
|
839
|
+
# url_resp = client.create_import_url('myfile.json')
|
840
|
+
# Faraday.put(url_resp['upload_url'], File.read('myfile.json'), 'Content-Type' => 'application/json')
|
841
|
+
# client.create_import(url_resp['path'], 'upsert')
|
842
|
+
T::Sig::WithoutRuntime.sig { params(filename: String).returns(StreamChat::StreamResponse) }
|
843
|
+
def create_import_url(filename)
|
844
|
+
post('import_urls', data: { filename: filename })
|
845
|
+
end
|
846
|
+
|
847
|
+
# Creates a new import.
|
848
|
+
# @example
|
849
|
+
# url_resp = client.create_import_url('myfile.json')
|
850
|
+
# Faraday.put(url_resp['upload_url'], File.read('myfile.json'), 'Content-Type' => 'application/json')
|
851
|
+
# client.create_import(url_resp['path'], 'upsert')
|
852
|
+
T::Sig::WithoutRuntime.sig { params(path: String, mode: String).returns(StreamChat::StreamResponse) }
|
853
|
+
def create_import(path, mode)
|
854
|
+
post('imports', data: { path: path, mode: mode })
|
855
|
+
end
|
856
|
+
|
857
|
+
# Returns an import by id.
|
858
|
+
T::Sig::WithoutRuntime.sig { params(id: String).returns(StreamChat::StreamResponse) }
|
859
|
+
def get_import(id)
|
860
|
+
get("imports/#{id}")
|
861
|
+
end
|
862
|
+
|
863
|
+
# Lists imports. Options dictionary can contain 'offset' and 'limit' keys for pagination.
|
864
|
+
T::Sig::WithoutRuntime.sig { params(options: T.untyped).returns(StreamChat::StreamResponse) }
|
865
|
+
def list_imports(options)
|
866
|
+
get('imports', params: options)
|
867
|
+
end
|
868
|
+
|
869
|
+
# Creates a campaign.
|
870
|
+
T::Sig::WithoutRuntime.sig { params(campaign: StringKeyHash).returns(StreamChat::StreamResponse) }
|
871
|
+
def create_campaign(campaign)
|
872
|
+
post('campaigns', data: { campaign: campaign })
|
873
|
+
end
|
874
|
+
|
875
|
+
# Gets a campaign.
|
876
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String).returns(StreamChat::StreamResponse) }
|
877
|
+
def get_campaign(campaign_id)
|
878
|
+
get("campaigns/#{campaign_id}")
|
879
|
+
end
|
880
|
+
|
881
|
+
# Lists all campaigns. Options dictionary can contain 'offset' and 'limit' keys for pagination.
|
882
|
+
T::Sig::WithoutRuntime.sig { params(options: StringKeyHash).returns(StreamChat::StreamResponse) }
|
883
|
+
def list_campaigns(options)
|
884
|
+
get('campaigns', params: options)
|
885
|
+
end
|
886
|
+
|
887
|
+
# Updates a campaign.
|
888
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String, campaign: StringKeyHash).returns(StreamChat::StreamResponse) }
|
889
|
+
def update_campaign(campaign_id, campaign)
|
890
|
+
put("campaigns/#{campaign_id}", data: { campaign: campaign })
|
891
|
+
end
|
892
|
+
|
893
|
+
# Deletes a campaign.
|
894
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String).returns(StreamChat::StreamResponse) }
|
895
|
+
def delete_campaign(campaign_id)
|
896
|
+
delete("campaigns/#{campaign_id}")
|
897
|
+
end
|
898
|
+
|
899
|
+
# Schedules a campaign.
|
900
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String, send_at: Integer).returns(StreamChat::StreamResponse) }
|
901
|
+
def schedule_campaign(campaign_id, send_at)
|
902
|
+
patch("campaigns/#{campaign_id}/schedule", data: { send_at: send_at })
|
903
|
+
end
|
904
|
+
|
905
|
+
# Stops a campaign.
|
906
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String).returns(StreamChat::StreamResponse) }
|
907
|
+
def stop_campaign(campaign_id)
|
908
|
+
patch("campaigns/#{campaign_id}/stop")
|
909
|
+
end
|
910
|
+
|
911
|
+
# Resumes a campaign.
|
912
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String).returns(StreamChat::StreamResponse) }
|
913
|
+
def resume_campaign(campaign_id)
|
914
|
+
patch("campaigns/#{campaign_id}/resume")
|
915
|
+
end
|
916
|
+
|
917
|
+
# Tests a campaign.
|
918
|
+
T::Sig::WithoutRuntime.sig { params(campaign_id: String, users: T::Array[StringKeyHash]).returns(StreamChat::StreamResponse) }
|
919
|
+
def test_campaign(campaign_id, users)
|
920
|
+
post("campaigns/#{campaign_id}/test", data: { users: users })
|
921
|
+
end
|
922
|
+
|
923
|
+
# Creates a campaign segment.
|
924
|
+
T::Sig::WithoutRuntime.sig { params(segment: StringKeyHash).returns(StreamChat::StreamResponse) }
|
925
|
+
def create_segment(segment)
|
926
|
+
post('segments', data: { segment: segment })
|
927
|
+
end
|
928
|
+
|
929
|
+
# Gets a campaign segment.
|
930
|
+
T::Sig::WithoutRuntime.sig { params(segment_id: String).returns(StreamChat::StreamResponse) }
|
931
|
+
def get_segment(segment_id)
|
932
|
+
get("segments/#{segment_id}")
|
933
|
+
end
|
934
|
+
|
935
|
+
# Lists all campaign segments. Options dictionary can contain 'offset' and 'limit' keys for pagination.
|
936
|
+
T::Sig::WithoutRuntime.sig { params(options: StringKeyHash).returns(StreamChat::StreamResponse) }
|
937
|
+
def list_segments(options)
|
938
|
+
get('segments', params: options)
|
939
|
+
end
|
940
|
+
|
941
|
+
# Updates a campaign segment.
|
942
|
+
T::Sig::WithoutRuntime.sig { params(segment_id: String, segment: StringKeyHash).returns(StreamChat::StreamResponse) }
|
943
|
+
def update_segment(segment_id, segment)
|
944
|
+
put("segments/#{segment_id}", data: { segment: segment })
|
945
|
+
end
|
946
|
+
|
947
|
+
# Deletes a campaign segment.
|
948
|
+
T::Sig::WithoutRuntime.sig { params(segment_id: String).returns(StreamChat::StreamResponse) }
|
949
|
+
def delete_segment(segment_id)
|
950
|
+
delete("segments/#{segment_id}")
|
951
|
+
end
|
952
|
+
|
837
953
|
private
|
838
954
|
|
839
955
|
T::Sig::WithoutRuntime.sig { returns(T::Hash[String, String]) }
|
data/lib/stream-chat/version.rb
CHANGED
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: 2.
|
4
|
+
version: 2.23.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: 2022-
|
11
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|