nexmo 7.0.0 → 7.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -6
- data/lib/nexmo.rb +1 -1
- data/lib/nexmo/abstract_authentication.rb +0 -2
- data/lib/nexmo/applications.rb +24 -4
- data/lib/nexmo/client.rb +40 -19
- data/lib/nexmo/config.rb +42 -9
- data/lib/nexmo/conversations.rb +24 -1
- data/lib/nexmo/conversations/events.rb +1 -1
- data/lib/nexmo/conversations/legs.rb +1 -1
- data/lib/nexmo/conversations/members.rb +1 -1
- data/lib/nexmo/conversations/users.rb +1 -1
- data/lib/nexmo/conversions.rb +4 -1
- data/lib/nexmo/entity.rb +2 -2
- data/lib/nexmo/errors.rb +6 -1
- data/lib/nexmo/files.rb +7 -3
- data/lib/nexmo/gsm7.rb +0 -2
- data/lib/nexmo/http.rb +12 -4
- data/lib/nexmo/json.rb +4 -1
- data/lib/nexmo/jwt.rb +11 -12
- data/lib/nexmo/key_secret_params.rb +9 -3
- data/lib/nexmo/keys.rb +24 -3
- data/lib/nexmo/logger.rb +14 -5
- data/lib/nexmo/messages.rb +6 -1
- data/lib/nexmo/number_insight.rb +1 -1
- data/lib/nexmo/numbers.rb +1 -1
- data/lib/nexmo/pricing.rb +1 -1
- data/lib/nexmo/pricing_types.rb +1 -1
- data/lib/nexmo/redact.rb +4 -1
- data/lib/nexmo/response.rb +1 -1
- data/lib/nexmo/secrets.rb +1 -1
- data/lib/nexmo/signature.rb +1 -1
- data/lib/nexmo/sms.rb +1 -1
- data/lib/nexmo/tfa.rb +1 -1
- data/lib/nexmo/verify.rb +66 -3
- data/lib/nexmo/version.rb +1 -1
- data/lib/nexmo/voice.rb +1 -1
- data/lib/nexmo/voice/dtmf.rb +1 -1
- data/lib/nexmo/voice/stream.rb +1 -1
- data/lib/nexmo/voice/talk.rb +1 -1
- data/nexmo.gemspec +13 -1
- metadata +29 -6
data/lib/nexmo/messages.rb
CHANGED
@@ -1,18 +1,23 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Nexmo
|
5
5
|
class Messages < Namespace
|
6
|
+
extend T::Sig
|
7
|
+
|
6
8
|
self.host = :rest_host
|
7
9
|
|
10
|
+
sig { params(id: String).returns(Nexmo::Response) }
|
8
11
|
def get(id)
|
9
12
|
request('/search/message', params: {id: id})
|
10
13
|
end
|
11
14
|
|
15
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
12
16
|
def search(params)
|
13
17
|
request('/search/messages', params: params)
|
14
18
|
end
|
15
19
|
|
20
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
16
21
|
def rejections(params)
|
17
22
|
request('/search/rejections', params: params)
|
18
23
|
end
|
data/lib/nexmo/number_insight.rb
CHANGED
data/lib/nexmo/numbers.rb
CHANGED
data/lib/nexmo/pricing.rb
CHANGED
data/lib/nexmo/pricing_types.rb
CHANGED
data/lib/nexmo/redact.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Nexmo
|
5
5
|
class Redact < Namespace
|
6
|
+
extend T::Sig
|
7
|
+
|
6
8
|
self.authentication = Basic
|
7
9
|
|
8
10
|
self.request_body = JSON
|
@@ -27,6 +29,7 @@ module Nexmo
|
|
27
29
|
#
|
28
30
|
# @see https://developer.nexmo.com/api/redact#redact-message
|
29
31
|
#
|
32
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
30
33
|
def transaction(params)
|
31
34
|
request('/v1/redact/transaction', params: params, type: Post)
|
32
35
|
end
|
data/lib/nexmo/response.rb
CHANGED
data/lib/nexmo/secrets.rb
CHANGED
data/lib/nexmo/signature.rb
CHANGED
data/lib/nexmo/sms.rb
CHANGED
data/lib/nexmo/tfa.rb
CHANGED
data/lib/nexmo/verify.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Nexmo
|
5
5
|
class Verify < Namespace
|
6
|
+
extend T::Sig
|
6
7
|
alias_method :http_request, :request
|
7
8
|
|
8
9
|
private :http_request
|
@@ -59,8 +60,9 @@ module Nexmo
|
|
59
60
|
#
|
60
61
|
# @see https://developer.nexmo.com/api/verify#verifyRequest
|
61
62
|
#
|
62
|
-
|
63
|
-
|
63
|
+
sig { params(params: T.untyped, uri: T.untyped).returns(T.untyped) }
|
64
|
+
def request(params, uri = '/verify/json')
|
65
|
+
response = http_request(uri, params: params, type: Post)
|
64
66
|
|
65
67
|
raise Error, response[:error_text] if error?(response)
|
66
68
|
|
@@ -91,6 +93,7 @@ module Nexmo
|
|
91
93
|
#
|
92
94
|
# @see https://developer.nexmo.com/api/verify#verifyCheck
|
93
95
|
#
|
96
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
94
97
|
def check(params)
|
95
98
|
response = http_request('/verify/check/json', params: params, type: Post)
|
96
99
|
|
@@ -117,6 +120,7 @@ module Nexmo
|
|
117
120
|
#
|
118
121
|
# @see https://developer.nexmo.com/api/verify#verifySearch
|
119
122
|
#
|
123
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(T.any(T::Hash[Symbol, T.untyped], Nexmo::Response)) }
|
120
124
|
def search(params)
|
121
125
|
response = http_request('/verify/search/json', params: params)
|
122
126
|
|
@@ -143,6 +147,7 @@ module Nexmo
|
|
143
147
|
#
|
144
148
|
# @see https://developer.nexmo.com/api/verify#verifyControl
|
145
149
|
#
|
150
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(T.untyped) }
|
146
151
|
def control(params)
|
147
152
|
response = http_request('/verify/control/json', params: params, type: Post)
|
148
153
|
|
@@ -162,6 +167,7 @@ module Nexmo
|
|
162
167
|
#
|
163
168
|
# @see https://developer.nexmo.com/api/verify#verifyControl
|
164
169
|
#
|
170
|
+
sig { params(id: String).returns(Nexmo::Response) }
|
165
171
|
def cancel(id)
|
166
172
|
control(request_id: id, cmd: 'cancel')
|
167
173
|
end
|
@@ -177,12 +183,69 @@ module Nexmo
|
|
177
183
|
#
|
178
184
|
# @see https://developer.nexmo.com/api/verify#verifyControl
|
179
185
|
#
|
186
|
+
sig { params(id: String).returns(Nexmo::Response) }
|
180
187
|
def trigger_next_event(id)
|
181
188
|
control(request_id: id, cmd: 'trigger_next_event')
|
182
189
|
end
|
183
190
|
|
191
|
+
# Send a PSD2-compliant payment token to a user for payment authorization
|
192
|
+
#
|
193
|
+
# @example
|
194
|
+
# response = client.verify.psd2(number: '447700900000', payee: 'Acme Inc', amount: 48.00)
|
195
|
+
#
|
196
|
+
# @option params [required, String] :number
|
197
|
+
# The mobile or landline phone number to verify.
|
198
|
+
# Unless you are setting **:country** explicitly, this number must be in E.164 format.
|
199
|
+
#
|
200
|
+
# @option params [String] :country
|
201
|
+
# If you do not provide **:number** in international format or you are not sure if **:number** is correctly formatted, specify the two-character country code in **:country**.
|
202
|
+
# Verify will then format the number for you.
|
203
|
+
#
|
204
|
+
# @option params [required, String] :payee
|
205
|
+
# An alphanumeric string to indicate to the user the name of the recipient that they are confirming a payment to.
|
206
|
+
#
|
207
|
+
# @option params [required, Float] :amount
|
208
|
+
# The decimal amount of the payment to be confirmed, in Euros
|
209
|
+
#
|
210
|
+
# @option params [Integer] :code_length
|
211
|
+
# The length of the verification code.
|
212
|
+
#
|
213
|
+
# @option params [String] :lg
|
214
|
+
# By default, the SMS or text-to-speech (TTS) message is generated in the locale that matches the **:number**.
|
215
|
+
# For example, the text message or TTS message for a `33*` number is sent in French.
|
216
|
+
# Use this parameter to explicitly control the language, accent and gender used for the Verify request.
|
217
|
+
#
|
218
|
+
# @option params [Integer] :pin_expiry
|
219
|
+
# How log the generated verification code is valid for, in seconds.
|
220
|
+
# When you specify both **:pin_expiry** and **:next_event_wait** then **:pin_expiry** must be an integer multiple of **:next_event_wait** otherwise **:pin_expiry** is defaulted to equal **:next_event_wait**.
|
221
|
+
# See [changing the event timings](https://developer.nexmo.com/verify/guides/changing-default-timings).
|
222
|
+
#
|
223
|
+
# @option params [Integer] :next_event_wait
|
224
|
+
# Specifies the wait time in seconds between attempts to deliver the verification code.
|
225
|
+
#
|
226
|
+
# @option params [Integer] :workflow_id
|
227
|
+
# Selects the predefined sequence of SMS and TTS (Text To Speech) actions to use in order to convey the PIN to your user.
|
228
|
+
# For example, an id of 1 identifies the workflow SMS - TTS - TTS.
|
229
|
+
# For a list of all workflows and their associated ids, please visit the [developer portal](https://developer.nexmo.com/verify/guides/workflows-and-events).
|
230
|
+
#
|
231
|
+
# @param [Hash] params
|
232
|
+
#
|
233
|
+
# @return [Response]
|
234
|
+
#
|
235
|
+
# @see https://developer.nexmo.com/api/verify#verifyRequestWithPSD2
|
236
|
+
#
|
237
|
+
sig { params(params: T.untyped, uri: T.untyped).returns(T.any(Nexmo::Error, Nexmo::Response)) }
|
238
|
+
def psd2(params, uri = '/verify/psd2/json')
|
239
|
+
response = http_request(uri, params: params, type: Post)
|
240
|
+
|
241
|
+
raise Error, response[:error_text] if error?(response)
|
242
|
+
|
243
|
+
response
|
244
|
+
end
|
245
|
+
|
184
246
|
private
|
185
247
|
|
248
|
+
sig { params(response: T.untyped).returns(T::Boolean) }
|
186
249
|
def error?(response)
|
187
250
|
response.respond_to?(:error_text)
|
188
251
|
end
|
data/lib/nexmo/version.rb
CHANGED
data/lib/nexmo/voice.rb
CHANGED
data/lib/nexmo/voice/dtmf.rb
CHANGED
data/lib/nexmo/voice/stream.rb
CHANGED
data/lib/nexmo/voice/talk.rb
CHANGED
data/nexmo.gemspec
CHANGED
@@ -12,10 +12,22 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = 'This is the Ruby client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up for free at https://www.nexmo.com'
|
13
13
|
s.files = Dir.glob('lib/**/*.rb') + %w(LICENSE.txt README.md nexmo.gemspec)
|
14
14
|
s.required_ruby_version = '>= 2.5.0'
|
15
|
-
s.add_dependency('jwt', '~>
|
15
|
+
s.add_dependency('nexmo-jwt', '~> 0.1.1')
|
16
16
|
s.add_dependency('zeitwerk', '~> 2', '>= 2.2')
|
17
17
|
s.add_dependency('sorbet-runtime', '~> 0.5')
|
18
|
+
s.add_development_dependency('timecop', '~> 0.9')
|
18
19
|
s.require_path = 'lib'
|
20
|
+
s.post_install_message = <<~HEREDOC
|
21
|
+
This Ruby gem has moved to `vonage`!
|
22
|
+
|
23
|
+
We will support this last release of `nexmo` through October 2021 with any needed bug fixes or security fixes.
|
24
|
+
|
25
|
+
New features will only be relased under the new `vonage` gem, so make sure to switch as soon as you can.
|
26
|
+
|
27
|
+
To switch now, change your dependency in your `Gemfile` to `vonage` or run `gem install vonage` from the command line.
|
28
|
+
|
29
|
+
You can find more information on GitHub at https://github.com/Vonage/vonage-ruby-sdk.
|
30
|
+
HEREDOC
|
19
31
|
s.metadata = {
|
20
32
|
'homepage' => 'https://github.com/Nexmo/nexmo-ruby',
|
21
33
|
'source_code_uri' => 'https://github.com/Nexmo/nexmo-ruby',
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nexmo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: jwt
|
14
|
+
name: nexmo-jwt
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: zeitwerk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0.5'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: timecop
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0.9'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0.9'
|
61
75
|
description: Nexmo Client Library for Ruby
|
62
76
|
email:
|
63
77
|
- devrel@nexmo.com
|
@@ -132,7 +146,16 @@ metadata:
|
|
132
146
|
bug_tracker_uri: https://github.com/Nexmo/nexmo-ruby/issues
|
133
147
|
changelog_uri: https://github.com/Nexmo/nexmo-ruby/blob/master/CHANGES.md
|
134
148
|
documentation_uri: https://www.rubydoc.info/github/nexmo/nexmo-ruby
|
135
|
-
post_install_message:
|
149
|
+
post_install_message: |
|
150
|
+
This Ruby gem has moved to `vonage`!
|
151
|
+
|
152
|
+
We will support this last release of `nexmo` through October 2021 with any needed bug fixes or security fixes.
|
153
|
+
|
154
|
+
New features will only be relased under the new `vonage` gem, so make sure to switch as soon as you can.
|
155
|
+
|
156
|
+
To switch now, change your dependency in your `Gemfile` to `vonage` or run `gem install vonage` from the command line.
|
157
|
+
|
158
|
+
You can find more information on GitHub at https://github.com/Vonage/vonage-ruby-sdk.
|
136
159
|
rdoc_options: []
|
137
160
|
require_paths:
|
138
161
|
- lib
|