paubox 1.2.0 → 1.3.1

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: 5ba4ee3af31174ce6a77fb403a770afe36a35bbdb36b04358d613d8e7762bbf0
4
- data.tar.gz: c89efb57681fa92d3957f27df88a95b54f121b1c13cd6f6b25fb69751482d9bf
3
+ metadata.gz: a395e42ff2b437190b9f616d271d43d7e5a1aa3261df3ccb5d6bb0f215b25fb2
4
+ data.tar.gz: e6c4a6aee47b2772effc6c3b2ee30675dad09fff9cc3c02ab489fae9eb974a4d
5
5
  SHA512:
6
- metadata.gz: 64f70fb89c5a13f75fcdc376742389a8fb27dec34f1a25f8f480c357fb8680b70d35429d3622de55daa626aa62b61a19e17ed945adc7e3eced25c36e73d63234
7
- data.tar.gz: 6aa4d4a5ef992be5cc041a7f09a9ceb7ecaa412f085028ce1d26ebfe8411c099e688d79906efff72ebae74d4cfd412b006b276673ec550fcd2d6b966dbef6917
6
+ metadata.gz: 156377e1f23f858c1bde721eae80b7531584d3b679a49cc8488c151f56c3c6b5b7e60400498f9bf78517555e99cd5846f6685a9512b02b50ae39867e0fc4b5fc
7
+ data.tar.gz: fc8f289e1d03bfec48a15c175f236f4acd46d0e860eaf028a844aa68d3fca68e7bd0e955e91ff6dff25dad811c0bee8dddedf896a4df8a24d1e32866a6895a65
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.2.0"
2
+ ".": "1.3.1"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.3.1](https://github.com/Paubox/paubox-ruby/compare/v1.3.0...v1.3.1) (2026-10-02)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **receiving:** key attachment downloads on attachment_id and pass list filters ([#33](https://github.com/Paubox/paubox-ruby/issues/33)) ([875dea3](https://github.com/Paubox/paubox-ruby/commit/875dea3c1f897286061766aac6f73070288f4eab))
11
+
12
+ ## [1.3.0](https://github.com/Paubox/paubox-ruby/compare/v1.2.0...v1.3.0) (2026-09-17)
13
+
14
+
15
+ ### Features
16
+
17
+ * webhook endpoint CRUD support ([#31](https://github.com/Paubox/paubox-ruby/issues/31)) ([1d78b47](https://github.com/Paubox/paubox-ruby/commit/1d78b4743658d81461ae2b6154ccf13209e6b329))
18
+
5
19
  ## [1.2.0](https://github.com/Paubox/paubox-ruby/compare/v1.1.0...v1.2.0) (2026-09-16)
6
20
 
7
21
 
data/lib/paubox/client.rb CHANGED
@@ -142,8 +142,9 @@ module Paubox
142
142
  JSON.parse(response.body)
143
143
  end
144
144
 
145
- def list_received_emails(limit: nil, after: nil, before: nil)
146
- params = { limit: limit, after: after, before: before }.compact
145
+ def list_received_emails(limit: nil, after: nil, before: nil, search: nil, sort: nil, ascending: nil)
146
+ params = { limit: limit, after: after, before: before,
147
+ search: search, sort: sort, ascending: ascending }.compact
147
148
  query = params.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
148
149
  url = request_endpoint('receiving')
149
150
  url = "#{url}?#{query}" unless query.empty?
@@ -157,9 +158,41 @@ module Paubox
157
158
  JSON.parse(response.body)
158
159
  end
159
160
 
160
- def get_received_email_attachment(email_id, blob_id)
161
- url = request_endpoint("receiving/#{email_id}/attachments/#{blob_id}")
162
- RestClient.get(url, auth_header)
161
+ def get_received_email_attachment(email_id, attachment_id)
162
+ url = request_endpoint("receiving/#{email_id}/attachments/#{attachment_id}")
163
+ RestClient.get(url, auth_header.merge(accept: '*/*'))
164
+ end
165
+
166
+ def list_webhook_endpoints
167
+ url = request_endpoint('webhook_endpoints')
168
+ response = RestClient.get(url, auth_header)
169
+ JSON.parse(response.body)
170
+ end
171
+
172
+ def create_webhook_endpoint(target_url:, events:, signing_key: nil, api_key: nil, active: true)
173
+ url = request_endpoint('webhook_endpoints')
174
+ payload = { target_url: target_url, events: events, active: active,
175
+ signing_key: signing_key, api_key: api_key }.compact.to_json
176
+ response = RestClient.post(url, payload, auth_header)
177
+ JSON.parse(response.body)
178
+ end
179
+
180
+ def get_webhook_endpoint(id)
181
+ url = request_endpoint("webhook_endpoints/#{id}")
182
+ response = RestClient.get(url, auth_header)
183
+ JSON.parse(response.body)
184
+ end
185
+
186
+ def update_webhook_endpoint(id, **params)
187
+ url = request_endpoint("webhook_endpoints/#{id}")
188
+ response = RestClient.patch(url, params.to_json, auth_header)
189
+ JSON.parse(response.body)
190
+ end
191
+
192
+ def delete_webhook_endpoint(id)
193
+ url = request_endpoint("webhook_endpoints/#{id}")
194
+ response = RestClient.delete(url, auth_header)
195
+ JSON.parse(response.body)
163
196
  end
164
197
 
165
198
  def send_request(method: :get, payload: {}, path: '')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paubox
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paubox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paubox