sendly 3.10.0 → 3.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7758a53dce946b2294f1760a7e4741c4bdc927da246ab81d6f5cf3425518a1fd
4
- data.tar.gz: b8cecc7352f2da3eb75bd66fc722a1cb7c2d4a2f49b148ed41ae10ed742e64a7
3
+ metadata.gz: 857bab925f91bce21378c883fd8e361abe57b790601509a2adceb83728710edd
4
+ data.tar.gz: 591b4c74dc12919752ae157d25cdb8bae760545db8905d75d18073a4b06eba74
5
5
  SHA512:
6
- metadata.gz: 73549a842bc7be6923f04917bfc4ddc52822d20ba36cec9fdf50ea4d2110cdd1529d3f5cca56b301f7e9e15167db1140f67164ff92ca071af35fd648a3879d39
7
- data.tar.gz: 428c9df2724d1deafce9ee04e7d47aa7bd99c3d896e61a8306ef469666e572a0a9a766d56d34d5e11ce0fb92377e3d316873c8db3012f50b7fbdbc1efb50d108
6
+ metadata.gz: af04849ac6912ebeead0dfe399f0415b47994c92ab269c70cd94ecd8da48a0c4289ef5031180c6e45dd3518dd5d9d6017bd92127c7dd60951abcd41570598ad2
7
+ data.tar.gz: e040fd53133f80179688c64f46cf23de752fbb63b60ce666aab4e791413bd4ccd137eeb3d214b4ed2440b122ce989cc70ffec8dc80bd3aa6a431c2f18f0b9753
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sendly (3.10.0)
4
+ sendly (3.12.0)
5
5
  faraday (~> 2.0)
6
6
  faraday-retry (~> 2.0)
7
7
 
data/lib/sendly/types.rb CHANGED
@@ -52,7 +52,7 @@ module Sendly
52
52
  attr_reader :delivered_at
53
53
 
54
54
  # Message status constants (sending removed - doesn't exist in database)
55
- STATUSES = %w[queued sent delivered failed].freeze
55
+ STATUSES = %w[queued sent delivered failed bounced].freeze
56
56
 
57
57
  # Sender type constants
58
58
  SENDER_TYPES = %w[number_pool alphanumeric sandbox].freeze
data/lib/sendly/verify.rb CHANGED
@@ -86,9 +86,81 @@ module Sendly
86
86
  end
87
87
  end
88
88
 
89
+ class VerifySession
90
+ attr_reader :id, :url, :status, :success_url, :cancel_url, :brand_name,
91
+ :brand_color, :phone, :verification_id, :token, :metadata,
92
+ :expires_at, :created_at
93
+
94
+ def initialize(data)
95
+ @id = data["id"]
96
+ @url = data["url"]
97
+ @status = data["status"]
98
+ @success_url = data["success_url"]
99
+ @cancel_url = data["cancel_url"]
100
+ @brand_name = data["brand_name"]
101
+ @brand_color = data["brand_color"]
102
+ @phone = data["phone"]
103
+ @verification_id = data["verification_id"]
104
+ @token = data["token"]
105
+ @metadata = data["metadata"] || {}
106
+ @expires_at = data["expires_at"]
107
+ @created_at = data["created_at"]
108
+ end
109
+
110
+ def to_h
111
+ {
112
+ id: id, url: url, status: status, success_url: success_url,
113
+ cancel_url: cancel_url, brand_name: brand_name, brand_color: brand_color,
114
+ phone: phone, verification_id: verification_id, token: token,
115
+ metadata: metadata, expires_at: expires_at, created_at: created_at
116
+ }.compact
117
+ end
118
+ end
119
+
120
+ class ValidateSessionResponse
121
+ attr_reader :valid, :session_id, :phone, :verified_at, :metadata
122
+
123
+ def initialize(data)
124
+ @valid = data["valid"]
125
+ @session_id = data["session_id"]
126
+ @phone = data["phone"]
127
+ @verified_at = data["verified_at"]
128
+ @metadata = data["metadata"] || {}
129
+ end
130
+
131
+ def valid?
132
+ valid
133
+ end
134
+ end
135
+
136
+ class SessionsResource
137
+ def initialize(client)
138
+ @client = client
139
+ end
140
+
141
+ def create(success_url:, cancel_url: nil, brand_name: nil, brand_color: nil, metadata: nil)
142
+ body = { success_url: success_url }
143
+ body[:cancel_url] = cancel_url if cancel_url
144
+ body[:brand_name] = brand_name if brand_name
145
+ body[:brand_color] = brand_color if brand_color
146
+ body[:metadata] = metadata if metadata
147
+
148
+ response = @client.post("/verify/sessions", body)
149
+ VerifySession.new(response)
150
+ end
151
+
152
+ def validate(token:)
153
+ response = @client.post("/verify/sessions/validate", { token: token })
154
+ ValidateSessionResponse.new(response)
155
+ end
156
+ end
157
+
89
158
  class VerifyResource
159
+ attr_reader :sessions
160
+
90
161
  def initialize(client)
91
162
  @client = client
163
+ @sessions = SessionsResource.new(client)
92
164
  end
93
165
 
94
166
  def send(phone:, channel: nil, code_length: nil, expires_in: nil, max_attempts: nil,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sendly
4
- VERSION = "3.10.0"
4
+ VERSION = "3.12.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sendly
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-05 00:00:00.000000000 Z
11
+ date: 2026-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday