hookbridge 2.0.0 → 2.1.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 +4 -4
- data/lib/hookbridge/client.rb +19 -7
- data/lib/hookbridge/types.rb +8 -8
- data/lib/hookbridge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3faed23c2d36e3294b89adf7dd7843f9f6cc7f8697a3ffe9ceeb8541818fc257
|
|
4
|
+
data.tar.gz: a23ce4da13495686b9ad4322f6a02e5bd55a305f0a77405e43c23e1404e5d9c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 514e54ba5311f92a5a34d6a5a7fead2a2197467ad4ff5d79395d8af6d5218042ac82324d9858017f0eaf13cd256fa38ffff4f42aec1b63a7850a5ce35eac3a8b
|
|
7
|
+
data.tar.gz: a9d084fd4c19ea785642539de316b20aa5fdde48614da099a6da8a271b026b9b6123af1354a2f7dae25f941e4c83e96f379050905f7b2175a0fc3f08dc4c78c6
|
data/lib/hookbridge/client.rb
CHANGED
|
@@ -25,10 +25,11 @@ module HookBridge
|
|
|
25
25
|
@send_connection = build_connection(@send_url)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def send(endpoint_id:, payload:, headers: nil, idempotency_key: nil)
|
|
28
|
+
def send(endpoint_id:, payload:, headers: nil, idempotency_key: nil, retention_hours: nil)
|
|
29
29
|
body = { endpoint_id: endpoint_id, payload: payload }
|
|
30
30
|
body[:headers] = headers if headers
|
|
31
31
|
body[:idempotency_key] = idempotency_key if idempotency_key
|
|
32
|
+
body[:retention_hours] = retention_hours unless retention_hours.nil?
|
|
32
33
|
SendResponse.new(extract_data(request(:post, "/v1/webhooks/send", body, use_send_connection: true)))
|
|
33
34
|
end
|
|
34
35
|
|
|
@@ -128,13 +129,16 @@ module HookBridge
|
|
|
128
129
|
true
|
|
129
130
|
end
|
|
130
131
|
|
|
131
|
-
def create_endpoint(url:, description: nil, hmac_enabled: nil, rate_limit_rps: 0, burst: 0, headers: nil
|
|
132
|
+
def create_endpoint(url:, description: nil, hmac_enabled: nil, rate_limit_rps: 0, burst: 0, headers: nil,
|
|
133
|
+
ephemeral: nil, ttl_minutes: nil)
|
|
132
134
|
body = { url: url }
|
|
133
135
|
body[:description] = description if description
|
|
134
136
|
body[:hmac_enabled] = hmac_enabled unless hmac_enabled.nil?
|
|
135
137
|
body[:rate_limit_rps] = rate_limit_rps if rate_limit_rps.positive?
|
|
136
138
|
body[:burst] = burst if burst.positive?
|
|
137
139
|
body[:headers] = headers if headers
|
|
140
|
+
body[:ephemeral] = ephemeral unless ephemeral.nil?
|
|
141
|
+
body[:ttl_minutes] = ttl_minutes unless ttl_minutes.nil?
|
|
138
142
|
CreateEndpointResponse.new(extract_data(request(:post, "/v1/endpoints", body)))
|
|
139
143
|
end
|
|
140
144
|
|
|
@@ -198,11 +202,13 @@ module HookBridge
|
|
|
198
202
|
create_endpoint_signing_key(endpoint_id)
|
|
199
203
|
end
|
|
200
204
|
|
|
201
|
-
def create_pull_endpoint(name: nil, description: nil, retention_days: nil, event_type_source: nil,
|
|
205
|
+
def create_pull_endpoint(name: nil, description: nil, retention_days: nil, event_type_source: nil,
|
|
206
|
+
event_type_path: nil,
|
|
202
207
|
verify_static_token: nil, token_header_name: nil, token_query_param: nil, token_value: nil,
|
|
203
208
|
verify_hmac: nil, hmac_header_name: nil, hmac_secret: nil, timestamp_header_name: nil,
|
|
204
209
|
timestamp_ttl_seconds: nil, verify_ip_allowlist: nil, allowed_cidrs: nil,
|
|
205
|
-
idempotency_header_names: nil, ingest_response_code: nil
|
|
210
|
+
idempotency_header_names: nil, ingest_response_code: nil,
|
|
211
|
+
hmac_signature_encoding: nil)
|
|
206
212
|
body = compact_hash(
|
|
207
213
|
name: name,
|
|
208
214
|
description: description,
|
|
@@ -215,6 +221,7 @@ module HookBridge
|
|
|
215
221
|
token_value: token_value,
|
|
216
222
|
verify_hmac: verify_hmac,
|
|
217
223
|
hmac_header_name: hmac_header_name,
|
|
224
|
+
hmac_signature_encoding: hmac_signature_encoding,
|
|
218
225
|
hmac_secret: hmac_secret,
|
|
219
226
|
timestamp_header_name: timestamp_header_name,
|
|
220
227
|
timestamp_ttl_seconds: timestamp_ttl_seconds,
|
|
@@ -326,7 +333,7 @@ module HookBridge
|
|
|
326
333
|
InvoicesResponse.new(extract_data(response), extract_meta(response))
|
|
327
334
|
end
|
|
328
335
|
|
|
329
|
-
def create_inbound_endpoint(url: nil, name: nil, description: nil, mode: nil, verify_static_token: nil, token_header_name: nil, token_query_param: nil, token_value: nil, verify_hmac: nil, hmac_header_name: nil, hmac_secret: nil, timestamp_header_name: nil, timestamp_ttl_seconds: nil, verify_ip_allowlist: nil, allowed_cidrs: nil, idempotency_header_names: nil, ingest_response_code: nil, signing_enabled: nil)
|
|
336
|
+
def create_inbound_endpoint(url: nil, name: nil, description: nil, mode: nil, verify_static_token: nil, token_header_name: nil, token_query_param: nil, token_value: nil, verify_hmac: nil, hmac_header_name: nil, hmac_secret: nil, timestamp_header_name: nil, timestamp_ttl_seconds: nil, verify_ip_allowlist: nil, allowed_cidrs: nil, idempotency_header_names: nil, ingest_response_code: nil, signing_enabled: nil, ephemeral: nil, ttl_minutes: nil, hmac_signature_encoding: nil)
|
|
330
337
|
body = {}
|
|
331
338
|
body[:url] = url unless url.nil?
|
|
332
339
|
{
|
|
@@ -339,6 +346,7 @@ module HookBridge
|
|
|
339
346
|
token_value: token_value,
|
|
340
347
|
verify_hmac: verify_hmac,
|
|
341
348
|
hmac_header_name: hmac_header_name,
|
|
349
|
+
hmac_signature_encoding: hmac_signature_encoding,
|
|
342
350
|
hmac_secret: hmac_secret,
|
|
343
351
|
timestamp_header_name: timestamp_header_name,
|
|
344
352
|
timestamp_ttl_seconds: timestamp_ttl_seconds,
|
|
@@ -346,7 +354,9 @@ module HookBridge
|
|
|
346
354
|
allowed_cidrs: allowed_cidrs,
|
|
347
355
|
idempotency_header_names: idempotency_header_names,
|
|
348
356
|
ingest_response_code: ingest_response_code,
|
|
349
|
-
signing_enabled: signing_enabled
|
|
357
|
+
signing_enabled: signing_enabled,
|
|
358
|
+
ephemeral: ephemeral,
|
|
359
|
+
ttl_minutes: ttl_minutes
|
|
350
360
|
}.each do |key, value|
|
|
351
361
|
body[key] = value unless value.nil?
|
|
352
362
|
end
|
|
@@ -476,10 +486,12 @@ module HookBridge
|
|
|
476
486
|
)
|
|
477
487
|
end
|
|
478
488
|
|
|
479
|
-
def create_export(start_time:, end_time:, status: nil, endpoint_id: nil)
|
|
489
|
+
def create_export(start_time:, end_time:, status: nil, endpoint_id: nil, direction: nil, inbound_endpoint_id: nil)
|
|
480
490
|
body = { start_time: format_time(start_time), end_time: format_time(end_time) }
|
|
481
491
|
body[:status] = status if status
|
|
482
492
|
body[:endpoint_id] = endpoint_id if endpoint_id
|
|
493
|
+
body[:direction] = direction if direction
|
|
494
|
+
body[:inbound_endpoint_id] = inbound_endpoint_id if inbound_endpoint_id
|
|
483
495
|
ExportRecord.new(extract_data(request(:post, "/v1/exports", body)))
|
|
484
496
|
end
|
|
485
497
|
|
data/lib/hookbridge/types.rb
CHANGED
|
@@ -75,13 +75,13 @@ module HookBridge
|
|
|
75
75
|
|
|
76
76
|
class Message < BaseModel
|
|
77
77
|
def initialize(data)
|
|
78
|
-
super(data, time_fields: %w[next_attempt_at created_at updated_at deleted_at])
|
|
78
|
+
super(data, time_fields: %w[next_attempt_at first_attempt_at created_at updated_at deleted_at])
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
class MessageSummary < BaseModel
|
|
83
83
|
def initialize(data)
|
|
84
|
-
super(data, time_fields: %w[created_at delivered_at next_attempt_at deleted_at])
|
|
84
|
+
super(data, time_fields: %w[created_at delivered_at next_attempt_at first_attempt_at deleted_at])
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -162,19 +162,19 @@ module HookBridge
|
|
|
162
162
|
|
|
163
163
|
class CreateEndpointResponse < BaseModel
|
|
164
164
|
def initialize(data)
|
|
165
|
-
super(data, time_fields: %w[created_at])
|
|
165
|
+
super(data, time_fields: %w[created_at expires_at])
|
|
166
166
|
end
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
class Endpoint < BaseModel
|
|
170
170
|
def initialize(data)
|
|
171
|
-
super(data, time_fields: %w[created_at updated_at])
|
|
171
|
+
super(data, time_fields: %w[created_at updated_at expires_at])
|
|
172
172
|
end
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
class EndpointSummary < BaseModel
|
|
176
176
|
def initialize(data)
|
|
177
|
-
super(data, time_fields: %w[created_at])
|
|
177
|
+
super(data, time_fields: %w[created_at expires_at])
|
|
178
178
|
end
|
|
179
179
|
end
|
|
180
180
|
|
|
@@ -310,19 +310,19 @@ module HookBridge
|
|
|
310
310
|
|
|
311
311
|
class CreateInboundEndpointResponse < BaseModel
|
|
312
312
|
def initialize(data)
|
|
313
|
-
super(data, time_fields: %w[created_at])
|
|
313
|
+
super(data, time_fields: %w[created_at expires_at])
|
|
314
314
|
end
|
|
315
315
|
end
|
|
316
316
|
|
|
317
317
|
class InboundEndpoint < BaseModel
|
|
318
318
|
def initialize(data)
|
|
319
|
-
super(data, time_fields: %w[created_at updated_at])
|
|
319
|
+
super(data, time_fields: %w[created_at updated_at expires_at])
|
|
320
320
|
end
|
|
321
321
|
end
|
|
322
322
|
|
|
323
323
|
class InboundEndpointSummary < BaseModel
|
|
324
324
|
def initialize(data)
|
|
325
|
-
super(data, time_fields: %w[created_at])
|
|
325
|
+
super(data, time_fields: %w[created_at expires_at])
|
|
326
326
|
end
|
|
327
327
|
end
|
|
328
328
|
|
data/lib/hookbridge/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hookbridge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- HookBridge
|
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
180
180
|
- !ruby/object:Gem::Version
|
|
181
181
|
version: '0'
|
|
182
182
|
requirements: []
|
|
183
|
-
rubygems_version: 4.0.
|
|
183
|
+
rubygems_version: 4.0.23
|
|
184
184
|
specification_version: 4
|
|
185
185
|
summary: Ruby SDK for HookBridge - Guaranteed webhook delivery
|
|
186
186
|
test_files: []
|