vonage 7.8.1 → 7.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16cb2584a98415fd28d34ff48e122bba7e74dc3274f3ccbce54e573bb5639d75
4
- data.tar.gz: 4dde646ce5357983ac61bd80981e758875f0289e535afdb1b961c230895489b8
3
+ metadata.gz: 9d8620ac3418486f818675d3b75efdf29a572c38100d00aeb8f36ab36aae4fb0
4
+ data.tar.gz: 7c1f845f11ba6b1eb625cdf20b703c2b19af2f789dd41e5368ce99465eab2d05
5
5
  SHA512:
6
- metadata.gz: ce5cc6037fcc81f6ce5cd99ec6b61a0a237fd94502dd85bd5a7e98bbc768834b8108babc3d4f81ff1f85fc9668d41165b3464f20f1218295b3a462d5343d4482
7
- data.tar.gz: 464c94d4e284b83c68796f6324ec54a8e0c70d93537b800f8b140d5425db14f575369b1a500e2595cce0559371d363033508cce9c49737bbb6a20be238b0a10e
6
+ metadata.gz: 04e95b2647f1d19323fa512b803de87baa245379957fa051c3b13cb12571bf5cb93e735aa28ef332b47f5cf1ccaded503f628b88ee73856ab1e94ee09573d175
7
+ data.tar.gz: 37ae894d0413c3b72d4c9d8d65462fcb5853740cd8bfcc254f4701fd1529dc3fc3a66fed0888db1e8b0de2ea28461cb4822d7e7e3f06ba5a5db53fce202c4ab3
data/lib/vonage/gsm7.rb CHANGED
@@ -4,7 +4,7 @@ module Vonage
4
4
  module GSM7
5
5
  extend T::Sig
6
6
 
7
- CHARACTERS = "\n\f\r !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~ ¡£¤¥§¿ÄÅÆÉÑÖØÜßàäåæçèéìñòöøùüΓΔΘΛΞΠΣΦΨΩ€"
7
+ CHARACTERS = "\n\f\r !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~ ¡£¤¥§¿ÄÅÆÇÉÑÖØÜßàäåæèéìñòöøùüΓΔΘΛΞΠΣΦΨΩ€"
8
8
 
9
9
  REGEXP = /\A[#{Regexp.escape(CHARACTERS)}]*\z/
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Vonage
4
4
  class Messaging::Channels::Viber < Messaging::Message
5
- MESSAGE_TYPES = ['text', 'image']
5
+ MESSAGE_TYPES = ['text', 'image', 'video', 'file']
6
6
 
7
7
  attr_reader :data
8
8
 
@@ -33,6 +33,13 @@ module Vonage
33
33
  when 'image'
34
34
  raise Vonage::ClientError.new(":message must be a Hash") unless message.is_a? Hash
35
35
  raise Vonage::ClientError.new(":url is required in :message") unless message[:url]
36
+ when 'video'
37
+ raise Vonage::ClientError.new(":message must be a Hash") unless message.is_a? Hash
38
+ raise Vonage::ClientError.new(":url is required in :message") unless message[:url]
39
+ raise Vonage::ClientError.new(":thumb_url is required in :message") unless message[:thumb_url]
40
+ when 'file'
41
+ raise Vonage::ClientError.new(":message must be a Hash") unless message.is_a? Hash
42
+ raise Vonage::ClientError.new(":url is required in :message") unless message[:url]
36
43
  end
37
44
  end
38
45
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Vonage
4
4
  class Messaging::Channels::WhatsApp < Messaging::Message
5
- MESSAGE_TYPES = ['text', 'image', 'audio', 'video', 'file', 'template', 'custom']
5
+ MESSAGE_TYPES = ['text', 'image', 'audio', 'video', 'file', 'template', 'sticker', 'custom']
6
6
 
7
7
  attr_reader :data
8
8
 
@@ -35,6 +35,8 @@ module Vonage
35
35
  raise Vonage::ClientError.new(":name is required in :template") unless message[:name]
36
36
  raise Vonage::ClientError.new(":whatsapp is required in :opts") unless opts[:whatsapp]
37
37
  raise Vonage::ClientError.new(":locale is required in :whatsapp") unless opts[:whatsapp][:locale]
38
+ when 'sticker'
39
+ raise Vonage::ClientError.new(":message must contain either :id or :url") unless message.has_key?(:id) ^ message.has_key?(:url)
38
40
  when 'custom'
39
41
  raise Vonage::ClientError.new(":message must be a Hash") unless message.is_a? Hash
40
42
  else
@@ -5,6 +5,8 @@ module Vonage
5
5
  class Numbers < Namespace
6
6
  include Keys
7
7
 
8
+ self.authentication = Basic
9
+
8
10
  self.host = :rest_host
9
11
 
10
12
  # Retrieve all the inbound numbers associated with your Vonage account.
@@ -52,7 +54,7 @@ module Vonage
52
54
  # @see https://developer.nexmo.com/api/developer/numbers#getOwnedNumbers
53
55
  #
54
56
  def list(params = nil)
55
- request('/account/numbers', params: params, response_class: ListResponse)
57
+ request("/account/numbers", params: params, response_class: ListResponse)
56
58
  end
57
59
 
58
60
  # Retrieve inbound numbers that are available for the specified country.
@@ -100,7 +102,7 @@ module Vonage
100
102
  # @see https://developer.nexmo.com/api/developer/numbers#getAvailableNumbers
101
103
  #
102
104
  def search(params)
103
- request('/number/search', params: params, response_class: ListResponse)
105
+ request("/number/search", params: params, response_class: ListResponse)
104
106
  end
105
107
 
106
108
  # Request to purchase a specific inbound number.
@@ -125,7 +127,12 @@ module Vonage
125
127
  # @see https://developer.nexmo.com/api/developer/numbers#buyANumber
126
128
  #
127
129
  def buy(params)
128
- request('/number/buy', params: params, type: Post, response_class: Response)
130
+ request(
131
+ "/number/buy",
132
+ params: params,
133
+ type: Post,
134
+ response_class: Response
135
+ )
129
136
  end
130
137
 
131
138
  # Cancel your subscription for a specific inbound number.
@@ -150,7 +157,12 @@ module Vonage
150
157
  # @see https://developer.nexmo.com/api/developer/numbers#cancelANumber
151
158
  #
152
159
  def cancel(params)
153
- request('/number/cancel', params: params, type: Post, response_class: Response)
160
+ request(
161
+ "/number/cancel",
162
+ params: params,
163
+ type: Post,
164
+ response_class: Response
165
+ )
154
166
  end
155
167
 
156
168
  # Change the behaviour of a number that you own.
@@ -198,14 +210,25 @@ module Vonage
198
210
  # @see https://developer.nexmo.com/api/developer/numbers#updateANumber
199
211
  #
200
212
  def update(params)
201
- request('/number/update', params: camelcase(params), type: Post, response_class: Response)
213
+ request(
214
+ "/number/update",
215
+ params: camelcase(params),
216
+ type: Post,
217
+ response_class: Response
218
+ )
202
219
  end
203
220
 
204
221
  private
205
222
 
206
223
  # A specific implementation of iterable_request for Numbers, because the Numbers API
207
224
  # handles pagination differently to other Vonage APIs
208
- def iterable_request(path, response: nil, response_class: nil, params: {}, &block)
225
+ def iterable_request(
226
+ path,
227
+ response: nil,
228
+ response_class: nil,
229
+ params: {},
230
+ &block
231
+ )
209
232
  response = parse(response, response_class)
210
233
  params[:index] = 1 unless params.has_key?(:index)
211
234
  size = params.fetch(:size, 10)
@@ -32,7 +32,7 @@ module Vonage
32
32
 
33
33
  signature = params.delete('sig')
34
34
 
35
- ::JWT::SecurityUtils.secure_compare(signature, digest(params, signature_method))
35
+ ::JWT::Algos::Hmac::SecurityUtils.secure_compare(signature, digest(params, signature_method))
36
36
  end
37
37
 
38
38
  private
data/lib/vonage/sms.rb CHANGED
@@ -47,14 +47,6 @@ module Vonage
47
47
  # @option params [String] :type
48
48
  # The format of the message body.
49
49
  #
50
- # @option params [String] :vcard
51
- # A business card in [vCard format](https://en.wikipedia.org/wiki/VCard).
52
- # Depends on **:type** option having the value `vcard`.
53
- #
54
- # @option params [String] :vcal
55
- # A calendar event in [vCal format](https://en.wikipedia.org/wiki/VCal).
56
- # Depends on **:type** option having the value `vcal`.
57
- #
58
50
  # @option params [String] :body
59
51
  # Hex encoded binary data.
60
52
  # Depends on **:type** option having the value `binary`.
@@ -67,18 +59,6 @@ module Vonage
67
59
  # The value of the [protocol identifier](https://en.wikipedia.org/wiki/GSM_03.40#Protocol_Identifier) to use.
68
60
  # Ensure that the value is aligned with **:udh**.
69
61
  #
70
- # @option params [String] :title
71
- # The title for a wappush SMS.
72
- # Depends on **:type** option having the value `wappush`.
73
- #
74
- # @option params [String] :url
75
- # The URL of your website.
76
- # Depends on **:type** option having the value `wappush`.
77
- #
78
- # @option params [String] :validity
79
- # The availability for an SMS in milliseconds.
80
- # Depends on **:type** option having the value `wappush`.
81
- #
82
62
  # @option params [String] :client_ref
83
63
  # You can optionally include your own reference of up to 40 characters.
84
64
  #
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = '7.8.1'
4
+ VERSION = "7.9.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vonage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.8.1
4
+ version: 7.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vonage-jwt
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.3.26
195
+ rubygems_version: 3.4.10
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: This is the Ruby Server SDK for Vonage APIs. To use it you'll need a Vonage