ringcentral_sdk 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ringcentral_sdk/rest/client.rb +3 -3
- data/lib/ringcentral_sdk/rest/configuration.rb +4 -4
- data/lib/ringcentral_sdk/rest/subscription.rb +1 -1
- data/lib/ringcentral_sdk.rb +1 -1
- data/pubnub.log +26 -0
- data/test/test_base.rb +2 -2
- data/test/test_client.rb +13 -13
- data/test/test_extension_presence.rb +4 -4
- data/test/test_setup.rb +4 -4
- data/test/test_subscription.rb +4 -4
- 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: 7b4759611557577079618f5bbc1064364479457195d8ff6f467fd08531132517
|
4
|
+
data.tar.gz: 0d5f363462e4e4915d8a878ed9aa6f423e54f5186d5c586db79f4e11b70478bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c2e06de3986a6dc7d86331834521cfa536b23379f66235bd5ea52d0fad06244ade05ff75e4d0597117204dea9f488018d76b9c01f0a9eab5707729aed0c0bff
|
7
|
+
data.tar.gz: ad0f95ee35ad69875a10718dc7f3a1eaca8e4d57ffc3a5cfcd4139df640a3bf5943c64de7565351fb3ac23a7c9e9b037600d57b71c510471a5d62bfebd1029d3
|
@@ -158,8 +158,8 @@ module RingCentralSdk
|
|
158
158
|
|
159
159
|
def new_oauth2_client
|
160
160
|
OAuth2::Client.new(
|
161
|
-
@config.
|
162
|
-
@config.
|
161
|
+
@config.client_id,
|
162
|
+
@config.client_secret,
|
163
163
|
site: @config.server_url,
|
164
164
|
authorize_url: @config.authorize_url,
|
165
165
|
token_url: TOKEN_ENDPOINT
|
@@ -177,7 +177,7 @@ module RingCentralSdk
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def api_key
|
180
|
-
Base64.encode64("#{@config.
|
180
|
+
Base64.encode64("#{@config.client_id}:#{@config.client_secret}").gsub(/\s/, '')
|
181
181
|
end
|
182
182
|
|
183
183
|
def send_request(request_sdk = {})
|
@@ -10,8 +10,8 @@ module RingCentralSdk
|
|
10
10
|
# Configuration class populated by Client constructor block
|
11
11
|
class Configuration
|
12
12
|
attr_accessor :server_url
|
13
|
-
attr_accessor :
|
14
|
-
attr_accessor :
|
13
|
+
attr_accessor :client_id
|
14
|
+
attr_accessor :client_secret
|
15
15
|
attr_accessor :redirect_url
|
16
16
|
|
17
17
|
attr_accessor :username
|
@@ -44,8 +44,8 @@ module RingCentralSdk
|
|
44
44
|
def load_environment
|
45
45
|
Dotenv.load
|
46
46
|
@server_url = ENV['RINGCENTRAL_SERVER_URL'] if ENV.key? 'RINGCENTRAL_SERVER_URL'
|
47
|
-
@
|
48
|
-
@
|
47
|
+
@client_id = ENV['RINGCENTRAL_CLIENT_ID'] if ENV.key? 'RINGCENTRAL_CLIENT_ID'
|
48
|
+
@client_secret = ENV['RINGCENTRAL_CLIENT_SECRET'] if ENV.key? 'RINGCENTRAL_CLIENT_SECRET'
|
49
49
|
@redirect_url = ENV['RINGCENTRAL_REDIRECT_URL'] if ENV.key? 'RINGCENTRAL_REDIRECT_URL'
|
50
50
|
@username = ENV['RINGCENTRAL_USERNAME'] if ENV.key? 'RINGCENTRAL_USERNAME'
|
51
51
|
@extension = ENV['RINGCENTRAL_EXTENSION'] if ENV.key? 'RINGCENTRAL_EXTENSION'
|
@@ -73,7 +73,7 @@ module RingCentralSdk
|
|
73
73
|
req.url 'subscription'
|
74
74
|
req.headers['Content-Type'] = 'application/json'
|
75
75
|
req.body = {
|
76
|
-
eventFilters: @
|
76
|
+
eventFilters: @event_filters,
|
77
77
|
deliveryMode: {
|
78
78
|
transportType: 'PubNub',
|
79
79
|
encryption: 'true'
|
data/lib/ringcentral_sdk.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RingCentralSdk is a SDK for the RingCentral REST API
|
2
2
|
module RingCentralSdk
|
3
|
-
VERSION = '
|
3
|
+
VERSION = '3.0.0'.freeze
|
4
4
|
|
5
5
|
RC_SERVER_PRODUCTION = 'https://platform.ringcentral.com'.freeze
|
6
6
|
RC_SERVER_SANDBOX = 'https://platform.devtest.ringcentral.com'.freeze
|
data/pubnub.log
CHANGED
@@ -5,3 +5,29 @@ E, [2023-02-15T02:11:20.883247 #93948] ERROR -- Pubnub:
|
|
5
5
|
E, [2023-02-15T02:11:20.885876 #93948] ERROR -- Pubnub:
|
6
6
|
E, [2023-02-16T06:48:39.603723 #31050] ERROR -- Pubnub:
|
7
7
|
E, [2023-02-16T06:48:39.606400 #31050] ERROR -- Pubnub:
|
8
|
+
E, [2023-02-20T07:44:44.471088 #17509] ERROR -- Pubnub:
|
9
|
+
E, [2023-02-20T07:44:44.473823 #17509] ERROR -- Pubnub:
|
10
|
+
D, [2023-02-20T07:49:14.914208 #17675] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
11
|
+
D, [2023-02-20T07:49:14.914366 #17675] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
12
|
+
D, [2023-02-20T07:49:14.916120 #17675] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
13
|
+
D, [2023-02-20T07:49:14.916153 #17675] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
14
|
+
D, [2023-02-20T07:50:17.787848 #17689] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
15
|
+
D, [2023-02-20T07:50:17.787980 #17689] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
16
|
+
D, [2023-02-20T07:50:17.789667 #17689] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
17
|
+
D, [2023-02-20T07:50:17.789703 #17689] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
18
|
+
D, [2023-02-20T07:50:48.431452 #17717] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
19
|
+
D, [2023-02-20T07:50:48.431596 #17717] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
20
|
+
D, [2023-02-20T07:50:48.433495 #17717] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
21
|
+
D, [2023-02-20T07:50:48.433536 #17717] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
22
|
+
D, [2023-02-20T07:51:01.926515 #17728] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
23
|
+
D, [2023-02-20T07:51:01.926655 #17728] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
24
|
+
D, [2023-02-20T07:51:01.928410 #17728] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
25
|
+
D, [2023-02-20T07:51:01.928445 #17728] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
26
|
+
D, [2023-02-20T07:51:40.221636 #17750] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
27
|
+
D, [2023-02-20T07:51:40.221778 #17750] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
28
|
+
D, [2023-02-20T07:51:40.223735 #17750] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
29
|
+
D, [2023-02-20T07:51:40.223773 #17750] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
30
|
+
D, [2023-02-20T07:51:48.766805 #17761] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
31
|
+
D, [2023-02-20T07:51:48.766950 #17761] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
32
|
+
D, [2023-02-20T07:51:48.768788 #17761] DEBUG -- Pubnub::Telementry: Initialized Telemetry
|
33
|
+
D, [2023-02-20T07:51:48.768823 #17761] DEBUG -- Pubnub::Client: Created new Pubnub::Client instance. Version: 4.8.0
|
data/test/test_base.rb
CHANGED
@@ -6,8 +6,8 @@ require 'mocha/test_unit'
|
|
6
6
|
require 'ringcentral_sdk'
|
7
7
|
|
8
8
|
RingCentralSdk::REST::Client.new do |config|
|
9
|
-
config.
|
10
|
-
config.
|
9
|
+
config.client_id = 'my_app_client_id'
|
10
|
+
config.client_secret = 'my_app_client_secret'
|
11
11
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
12
12
|
end
|
13
13
|
|
data/test/test_client.rb
CHANGED
@@ -7,21 +7,21 @@ class RingCentralSdkPlatformTest < Test::Unit::TestCase
|
|
7
7
|
def setup
|
8
8
|
@rcsdk = RingCentralSdk::REST::Client.new do |config|
|
9
9
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
10
|
-
config.
|
11
|
-
config.
|
10
|
+
config.client_id = 'my_app_client_id'
|
11
|
+
config.client_secret = 'my_app_client_secret'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_main
|
16
|
-
assert_equal '
|
16
|
+
assert_equal 'bXlfYXBwX2NsaWVudF9pZDpteV9hcHBfY2xpZW50X3NlY3JldA==', @rcsdk.send(:api_key)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_config
|
20
20
|
redirect_url = 'http://localhost:4567/oauth'
|
21
21
|
client = RingCentralSdk::REST::Client.new do |config|
|
22
22
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
23
|
-
config.
|
24
|
-
config.
|
23
|
+
config.client_id = 'my_app_client_id'
|
24
|
+
config.client_secret = 'my_app_client_secret'
|
25
25
|
config.redirect_url = redirect_url
|
26
26
|
end
|
27
27
|
assert_equal redirect_url, client.config.redirect_url
|
@@ -36,8 +36,8 @@ class RingCentralSdkPlatformTest < Test::Unit::TestCase
|
|
36
36
|
|
37
37
|
rcsdk = new_client
|
38
38
|
oauth2client = OAuth2::Client.new(
|
39
|
-
'
|
40
|
-
'
|
39
|
+
'my_app_client_id',
|
40
|
+
'my_app_client_secret',
|
41
41
|
site: RingCentralSdk::RC_SERVER_SANDBOX,
|
42
42
|
token_url: rcsdk.class::TOKEN_ENDPOINT
|
43
43
|
)
|
@@ -64,8 +64,8 @@ class RingCentralSdkPlatformTest < Test::Unit::TestCase
|
|
64
64
|
|
65
65
|
def test_authorize_url_default
|
66
66
|
rcsdk = RingCentralSdk::REST::Client.new do |config|
|
67
|
-
config.
|
68
|
-
config.
|
67
|
+
config.client_id = 'my_app_client_id'
|
68
|
+
config.client_secret = 'my_app_client_secret'
|
69
69
|
config.server_url = RingCentralSdk::RC_SERVER_PRODUCTION
|
70
70
|
config.redirect_url = 'http://localhost:4567/oauth'
|
71
71
|
end
|
@@ -117,8 +117,8 @@ class RingCentralSdkPlatformTest < Test::Unit::TestCase
|
|
117
117
|
assert_equal 'OAuth2::AccessToken', rcsdk.token.class.name
|
118
118
|
|
119
119
|
rcsdk = RingCentralSdk::REST::Client.new do |config|
|
120
|
-
config.
|
121
|
-
config.
|
120
|
+
config.client_id = 'my_app_client_id'
|
121
|
+
config.client_secret = 'my_app_client_secret'
|
122
122
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
123
123
|
config.redirect_url = 'http://localhost:4567/oauth'
|
124
124
|
end
|
@@ -303,8 +303,8 @@ class RingCentralSdkPlatformTest < Test::Unit::TestCase
|
|
303
303
|
|
304
304
|
def new_client
|
305
305
|
RingCentralSdk::REST::Client.new do |config|
|
306
|
-
config.
|
307
|
-
config.
|
306
|
+
config.client_id = 'my_app_client_id'
|
307
|
+
config.client_secret = 'my_app_client_secret'
|
308
308
|
config.server_url = RingCentralSdk::RC_SERVER_PRODUCTION
|
309
309
|
end
|
310
310
|
end
|
@@ -3,8 +3,8 @@ require './test/test_base.rb'
|
|
3
3
|
class RingCentralSdkRESTExtensionPresenceTest < Test::Unit::TestCase
|
4
4
|
def new_client
|
5
5
|
RingCentralSdk::REST::Client.new do |config|
|
6
|
-
config.
|
7
|
-
config.
|
6
|
+
config.client_id = 'my_app_client_id'
|
7
|
+
config.client_secret = 'my_app_client_secret'
|
8
8
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
9
9
|
end
|
10
10
|
end
|
@@ -109,8 +109,8 @@ end
|
|
109
109
|
class RingCentralSdkTestSubAuth
|
110
110
|
def new_client
|
111
111
|
RingCentralSdk::REST::Client.new do |config|
|
112
|
-
config.
|
113
|
-
config.
|
112
|
+
config.client_id = 'my_app_client_id'
|
113
|
+
config.client_secret = 'my_app_client_secret'
|
114
114
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
115
115
|
end
|
116
116
|
end
|
data/test/test_setup.rb
CHANGED
@@ -7,8 +7,8 @@ class RingCentralSdkTest < Test::Unit::TestCase
|
|
7
7
|
|
8
8
|
def new_sdk
|
9
9
|
RingCentralSdk::REST::Client.new do |config|
|
10
|
-
config.
|
11
|
-
config.
|
10
|
+
config.client_id = 'my_app_client_id'
|
11
|
+
config.client_secret = 'my_app_client_secret'
|
12
12
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
13
13
|
end
|
14
14
|
end
|
@@ -31,8 +31,8 @@ class RingCentralSdkTest < Test::Unit::TestCase
|
|
31
31
|
OAuth2::Strategy::Password.any_instance.stubs(:get_token).returns(stub_token)
|
32
32
|
|
33
33
|
rcsdk = RingCentralSdk::REST::Client.new do |config|
|
34
|
-
config.
|
35
|
-
config.
|
34
|
+
config.client_id = 'my_app_client_id'
|
35
|
+
config.client_secret = 'my_app_client_secret'
|
36
36
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
37
37
|
config.username = 'my_username'
|
38
38
|
config.password = 'my_password'
|
data/test/test_subscription.rb
CHANGED
@@ -3,8 +3,8 @@ require './test/test_base.rb'
|
|
3
3
|
class RingCentralSdkSubscriptionTest < Test::Unit::TestCase
|
4
4
|
def setup
|
5
5
|
@rcsdk = RingCentralSdk::REST::Client.new do |config|
|
6
|
-
config.
|
7
|
-
config.
|
6
|
+
config.client_id = 'my_app_client_id'
|
7
|
+
config.client_secret = 'my_app_client_secret'
|
8
8
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
9
9
|
end
|
10
10
|
end
|
@@ -71,8 +71,8 @@ class RingCentralSdkSubscriptionTest < Test::Unit::TestCase
|
|
71
71
|
|
72
72
|
def build_rcsdk_authorized
|
73
73
|
rcsdk = RingCentralSdk::REST::Client.new do |config|
|
74
|
-
config.
|
75
|
-
config.
|
74
|
+
config.client_id = 'my_app_client_id'
|
75
|
+
config.client_secret = 'my_app_client_secret'
|
76
76
|
config.server_url = RingCentralSdk::RC_SERVER_SANDBOX
|
77
77
|
end
|
78
78
|
rcsdk.set_oauth2_client
|