svix 1.94.0 → 1.95.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: f628f335f05d95af048e5e5db697f0d61a9836d9e0bb8a07775dbfa3c826c6ec
4
- data.tar.gz: '084af0b17af5b537532d2b5accbbf285b32d37631d02e7354904ab35191364fc'
3
+ metadata.gz: dae006aeabb1a9a07bd490e8ef702a90c29af5be4e35a4619d7980cb9d65ee7a
4
+ data.tar.gz: e2c4a068a1e3d4a8735d7c4b9307f967d8348e30a8e9ff0cd2a28fc4d52d6b5e
5
5
  SHA512:
6
- metadata.gz: dc9eb0665138ed9619c3fbd7ddef3bf379aa7f3e0faaefb5f79eeddcb7e6dbe9b38fdf3e10f455ad5a4208bd2ee3bc39c80ad44245a3085c92ca7e5976e0d8dc
7
- data.tar.gz: 4618a327fc1545fb01f1b0a97742fd5c7b422503fb51b233408172ba61cb46bf0d0c4d6077bae6d772c6ce335e4342f1b9ca1b35365172b0bf1cea0f301d0684
6
+ metadata.gz: e295701012f2f72b34090e4a0f4b61d75fe49859fd975087094049270c81c3ddf0b2a5eb4c62b8dba7201c0f449105c2caef5003f8572ba3f9bb8367bec95118
7
+ data.tar.gz: 54d2b0a9ae9c345c2803138aa185d98bf20f890fdddc086de13193e7c091cbc8fa93bdba3c40a83c7f4501c88f3dc71d6badd833a5b08cb6f9fc8800c5353414
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (1.94.0)
4
+ svix (1.95.0)
5
5
  base64 (~> 0.3.0)
6
6
  logger (~> 1.0)
7
7
 
data/lib/svix/errors.rb CHANGED
@@ -14,4 +14,7 @@ module Svix
14
14
 
15
15
  class WebhookSigningError < SvixError
16
16
  end
17
+
18
+ class EmptyWebhookSecretError < SvixError
19
+ end
17
20
  end
@@ -7,8 +7,9 @@ module Svix
7
7
  attr_accessor :code
8
8
  attr_accessor :enabled
9
9
  attr_accessor :updated_at
10
+ attr_accessor :variables
10
11
 
11
- ALL_FIELD ||= ["code", "enabled", "updated_at"].freeze
12
+ ALL_FIELD ||= ["code", "enabled", "updated_at", "variables"].freeze
12
13
  private_constant :ALL_FIELD
13
14
 
14
15
  def initialize(attributes = {})
@@ -35,6 +36,7 @@ module Svix
35
36
  attrs["code"] = attributes["code"]
36
37
  attrs["enabled"] = attributes["enabled"]
37
38
  attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time if attributes["updatedAt"]
39
+ attrs["variables"] = attributes["variables"]
38
40
  new(attrs)
39
41
  end
40
42
 
@@ -43,6 +45,7 @@ module Svix
43
45
  out["code"] = Svix::serialize_primitive(@code) if @code
44
46
  out["enabled"] = Svix::serialize_primitive(@enabled) if @enabled
45
47
  out["updatedAt"] = Svix::serialize_primitive(@updated_at) if @updated_at
48
+ out["variables"] = Svix::serialize_primitive(@variables) if @variables
46
49
  out
47
50
  end
48
51
 
@@ -6,8 +6,9 @@ module Svix
6
6
  class EndpointTransformationPatch
7
7
  attr_accessor :code
8
8
  attr_accessor :enabled
9
+ attr_accessor :variables
9
10
 
10
- ALL_FIELD ||= ["code", "enabled"].freeze
11
+ ALL_FIELD ||= ["code", "enabled", "variables"].freeze
11
12
  private_constant :ALL_FIELD
12
13
 
13
14
  def initialize(attributes = {})
@@ -33,6 +34,7 @@ module Svix
33
34
  attrs = Hash.new
34
35
  attrs["code"] = attributes["code"]
35
36
  attrs["enabled"] = attributes["enabled"]
37
+ attrs["variables"] = attributes["variables"]
36
38
  new(attrs)
37
39
  end
38
40
 
@@ -40,6 +42,7 @@ module Svix
40
42
  out = Hash.new
41
43
  out["code"] = Svix::serialize_primitive(@code) if @__code_is_defined
42
44
  out["enabled"] = Svix::serialize_primitive(@enabled) if @enabled
45
+ out["variables"] = Svix::serialize_primitive(@variables) if @__variables_is_defined
43
46
  out
44
47
  end
45
48
 
@@ -101,7 +101,7 @@ module Svix
101
101
  private def encode_query_params(query_params = {})
102
102
  encoded_query_pairs = []
103
103
  query_params.each do |k, v|
104
- unless v.nil?
104
+ if !v.nil?
105
105
  if v.kind_of?(Array)
106
106
  encoded_query_pairs.append("#{k}=" + CGI::escape(v.sort.join(",")))
107
107
  elsif v.kind_of?(Time)
@@ -109,6 +109,10 @@ module Svix
109
109
  else
110
110
  encoded_query_pairs.append("#{k}=#{CGI::escape(v)}")
111
111
  end
112
+ elsif k == "expanded_statuses"
113
+ # HACK: default expanded_statuses to true, it only defaults to false
114
+ # server-side because of backwards-compatibility for old SDKs
115
+ encoded_query_pairs.append("#{k}=true")
112
116
  end
113
117
  end
114
118
 
data/lib/svix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svix
4
- VERSION = "1.94.0"
4
+ VERSION = "1.95.0"
5
5
  end
data/lib/svix/webhook.rb CHANGED
@@ -13,6 +13,10 @@ module Svix
13
13
  end
14
14
 
15
15
  @secret = Base64.decode64(secret)
16
+
17
+ if @secret.empty?
18
+ raise EmptyWebhookSecretError, "Webhook secret must not be blank"
19
+ end
16
20
  end
17
21
 
18
22
  def verify(payload, headers)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.94.0
4
+ version: 1.95.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-05-19 00:00:00.000000000 Z
10
+ date: 2026-05-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64