pusher-chatkit-server 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/chatkit/client.rb +29 -6
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: f132c6890c4c1b9c7ca4230ba21170ec33279c8dddc1d8a8536bf7210e5f4bcb
4
- data.tar.gz: 4fa2791c7b84d65494cd71554dfda3bff2d2eec030cda828bc6dd1647d235a16
2
+ SHA1:
3
+ metadata.gz: 33f07005b4cb0c21c10e08a20c9bd900eaaed285
4
+ data.tar.gz: d10d392516329d82feb0faba20480ae83f86d320
5
5
  SHA512:
6
- metadata.gz: 60220ad10c2e728fc8e2cf7fb902c79226707a992c5ccabcc1ade0387af24accdaa9787ae3b020116f762d8d82d33ffc6dfb3b21f21716c493d78345d2a1e185
7
- data.tar.gz: c3c01e8ed88377b3b0fc494bc3ddc12f13b63479b043675906b61b46a495e1b2307f61c3d54e09e314b9c781e5187fb77dc8cfabc7b70caf3d367e37d580f268
6
+ metadata.gz: 914f3bd6446f16d55cb994fe50ea2561d015df8c043e6a6740ef85f56911c644c5095d1a51c91f3f70d8aa40a0b6da5ed9c0caf68c264527d04669148741e0b9
7
+ data.tar.gz: 3ed09704600ab9a1d7a850cec77cc36d8d3f89f15c22dc5dccec8dd301011d3d5d13cd8c54a4aef7a56e396be2fb6f62041828c16ff8a1520bde983304362f02
@@ -59,6 +59,13 @@ module Chatkit
59
59
  service_version: 'v2'
60
60
  })
61
61
  )
62
+
63
+ @scheduler_instance = PusherPlatform::Instance.new(
64
+ base_options.merge({
65
+ service_name: 'chatkit_scheduler',
66
+ service_version: 'v1'
67
+ })
68
+ )
62
69
  end
63
70
 
64
71
  def authenticate(options)
@@ -144,18 +151,30 @@ module Chatkit
144
151
  })
145
152
  end
146
153
 
147
- def delete_user(options)
154
+ def async_delete_user(options)
148
155
  if options[:id].nil?
149
156
  raise Chatkit::MissingParameterError.new("You must provide the ID of the user you want to delete")
150
157
  end
151
158
 
152
- api_request({
153
- method: "DELETE",
159
+ scheduler_request({
160
+ method: "PUT",
154
161
  path: "/users/#{CGI::escape options[:id]}",
155
162
  jwt: generate_su_token[:token]
156
163
  })
157
164
  end
158
165
 
166
+ def get_delete_status(options)
167
+ if options[:id].nil?
168
+ raise Chatkit::MissingParameterError.new("You must provide the ID of the job you want to query status of")
169
+ end
170
+
171
+ scheduler_request({
172
+ method: "GET",
173
+ path: "/status/#{CGI::escape options[:id]}",
174
+ jwt: generate_su_token[:token]
175
+ })
176
+ end
177
+
159
178
  def get_user(options)
160
179
  if options[:id].nil?
161
180
  raise Chatkit::MissingParameterError.new("You must provide the ID of the user you want to fetch")
@@ -251,13 +270,13 @@ module Chatkit
251
270
  })
252
271
  end
253
272
 
254
- def delete_room(options)
273
+ def async_delete_room(options)
255
274
  if options[:id].nil?
256
275
  raise Chatkit::MissingParameterError.new("You must provide the ID of the room to delete")
257
276
  end
258
277
 
259
- api_request({
260
- method: "DELETE",
278
+ scheduler_request({
279
+ method: "PUT",
261
280
  path: "/rooms/#{CGI::escape options[:id]}",
262
281
  jwt: generate_su_token[:token]
263
282
  })
@@ -658,6 +677,10 @@ module Chatkit
658
677
  make_request(@cursors_instance, options)
659
678
  end
660
679
 
680
+ def scheduler_request(options)
681
+ make_request(@scheduler_instance, options)
682
+ end
683
+
661
684
  private
662
685
 
663
686
  def make_request(instance, options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher-chatkit-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pusher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-08 00:00:00.000000000 Z
11
+ date: 2019-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pusher-platform
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  version: '0'
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.7.6
59
+ rubygems_version: 2.6.12
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Pusher Chatkit Ruby SDK