svix 2.8.0 → 2.9.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/Gemfile.lock +1 -1
- data/lib/svix/models/connector_kind.rb +4 -0
- data/lib/svix/models/destination_in.rb +6 -1
- data/lib/svix/models/destination_out.rb +6 -1
- data/lib/svix/models/destination_patch.rb +6 -1
- data/lib/svix/models/elastic_search_config_in.rb +70 -0
- data/lib/svix/models/elastic_search_config_out.rb +55 -0
- data/lib/svix/models/elastic_search_config_patch.rb +58 -0
- data/lib/svix/models/event_example_in.rb +8 -1
- data/lib/svix/models/message_in.rb +3 -0
- data/lib/svix/models/stream_sink_in.rb +6 -1
- data/lib/svix/models/stream_sink_out.rb +6 -1
- data/lib/svix/models/stream_sink_patch.rb +6 -1
- data/lib/svix/svix_http_client.rb +23 -6
- data/lib/svix/version.rb +1 -1
- data/lib/svix.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 219f6162cb240aff1b25e1d83e4a61db92ff5a95e432340fa3bddc86d3739921
|
|
4
|
+
data.tar.gz: 3c5e25fbbc1d1435881c0310c84e1f5aca8fa9f1046c501efb04e100eec11b7d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e7f026fd4f0acb54ae39ad9912d102a515e9200fb8d9be84ba6ab150da22b070e9a4ce0cbc13952c4bc60b326f1079e63af4e06c31cb1ab94fd2cbd29980a34
|
|
7
|
+
data.tar.gz: 88b3d9acfc8a1d2a1228a70253f0679d363ef74576e9c1c005b1299b44cd52dac5fc7a8c4e8e5d0757967da83c43aef373628b8480ba9a03d80de0b0bba8f6cc
|
data/Gemfile.lock
CHANGED
|
@@ -8,9 +8,11 @@ module Svix
|
|
|
8
8
|
CUSTOMER_IO = "CustomerIO".freeze
|
|
9
9
|
DATADOG_TRACING = "DatadogTracing".freeze
|
|
10
10
|
DISCORD = "Discord".freeze
|
|
11
|
+
GRAFANA_CLOUD_TRACING = "GrafanaCloudTracing".freeze
|
|
11
12
|
HUBSPOT = "Hubspot".freeze
|
|
12
13
|
INNGEST = "Inngest".freeze
|
|
13
14
|
LOOPS = "Loops".freeze
|
|
15
|
+
NEW_RELIC_TRACING = "NewRelicTracing".freeze
|
|
14
16
|
OTEL = "Otel".freeze
|
|
15
17
|
RESEND = "Resend".freeze
|
|
16
18
|
SALESFORCE = "Salesforce".freeze
|
|
@@ -30,9 +32,11 @@ module Svix
|
|
|
30
32
|
CUSTOMER_IO,
|
|
31
33
|
DATADOG_TRACING,
|
|
32
34
|
DISCORD,
|
|
35
|
+
GRAFANA_CLOUD_TRACING,
|
|
33
36
|
HUBSPOT,
|
|
34
37
|
INNGEST,
|
|
35
38
|
LOOPS,
|
|
39
|
+
NEW_RELIC_TRACING,
|
|
36
40
|
OTEL,
|
|
37
41
|
RESEND,
|
|
38
42
|
SALESFORCE,
|
|
@@ -6,6 +6,7 @@ require_relative "./azure_blob_storage_config_in"
|
|
|
6
6
|
require_relative "./big_query_config_in"
|
|
7
7
|
require_relative "./clickhouse_config_in"
|
|
8
8
|
require_relative "./destination_status_in"
|
|
9
|
+
require_relative "./elastic_search_config_in"
|
|
9
10
|
require_relative "./event_bridge_config_in"
|
|
10
11
|
require_relative "./fifo_endpoint_config_in"
|
|
11
12
|
require_relative "./google_cloud_pub_sub_config_in"
|
|
@@ -81,6 +82,9 @@ module Svix
|
|
|
81
82
|
|
|
82
83
|
class Postgres < PostgresConfigIn
|
|
83
84
|
end
|
|
85
|
+
|
|
86
|
+
class ElasticSearch < ElasticSearchConfigIn
|
|
87
|
+
end
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
# The destination's type and type-specific configuration.
|
|
@@ -131,7 +135,8 @@ module Svix
|
|
|
131
135
|
DestinationInConfig::Snowflake => "snowflake",
|
|
132
136
|
DestinationInConfig::RabbitMq => "rabbitMq",
|
|
133
137
|
DestinationInConfig::Redshift => "redshift",
|
|
134
|
-
DestinationInConfig::Postgres => "postgres"
|
|
138
|
+
DestinationInConfig::Postgres => "postgres",
|
|
139
|
+
DestinationInConfig::ElasticSearch => "elasticSearch"
|
|
135
140
|
}
|
|
136
141
|
private_constant :TYPE_TO_NAME
|
|
137
142
|
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
@@ -6,6 +6,7 @@ require_relative "./azure_blob_storage_config_out"
|
|
|
6
6
|
require_relative "./big_query_config_out"
|
|
7
7
|
require_relative "./clickhouse_config_out"
|
|
8
8
|
require_relative "./destination_status"
|
|
9
|
+
require_relative "./elastic_search_config_out"
|
|
9
10
|
require_relative "./event_bridge_config_out"
|
|
10
11
|
require_relative "./google_cloud_pub_sub_config_out"
|
|
11
12
|
require_relative "./google_cloud_storage_config_out"
|
|
@@ -81,6 +82,9 @@ module Svix
|
|
|
81
82
|
|
|
82
83
|
class Postgres < PostgresConfigOut
|
|
83
84
|
end
|
|
85
|
+
|
|
86
|
+
class ElasticSearch < ElasticSearchConfigOut
|
|
87
|
+
end
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
class DestinationOut
|
|
@@ -134,7 +138,8 @@ module Svix
|
|
|
134
138
|
DestinationOutConfig::Sqs => "sqs",
|
|
135
139
|
DestinationOutConfig::EventBridge => "eventBridge",
|
|
136
140
|
DestinationOutConfig::Sns => "sns",
|
|
137
|
-
DestinationOutConfig::Postgres => "postgres"
|
|
141
|
+
DestinationOutConfig::Postgres => "postgres",
|
|
142
|
+
DestinationOutConfig::ElasticSearch => "elasticSearch"
|
|
138
143
|
}
|
|
139
144
|
private_constant :TYPE_TO_NAME
|
|
140
145
|
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
@@ -6,6 +6,7 @@ require_relative "./azure_blob_storage_config_patch"
|
|
|
6
6
|
require_relative "./big_query_config_patch"
|
|
7
7
|
require_relative "./clickhouse_config_patch"
|
|
8
8
|
require_relative "./destination_status_in"
|
|
9
|
+
require_relative "./elastic_search_config_patch"
|
|
9
10
|
require_relative "./event_bridge_config_patch"
|
|
10
11
|
require_relative "./google_cloud_pub_sub_config_patch"
|
|
11
12
|
require_relative "./google_cloud_storage_config_patch"
|
|
@@ -81,6 +82,9 @@ module Svix
|
|
|
81
82
|
|
|
82
83
|
class Postgres < PostgresConfigPatch
|
|
83
84
|
end
|
|
85
|
+
|
|
86
|
+
class ElasticSearch < ElasticSearchConfigPatch
|
|
87
|
+
end
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
class DestinationPatch
|
|
@@ -112,7 +116,8 @@ module Svix
|
|
|
112
116
|
DestinationPatchConfig::Snowflake => "snowflake",
|
|
113
117
|
DestinationPatchConfig::RabbitMq => "rabbitMq",
|
|
114
118
|
DestinationPatchConfig::Redshift => "redshift",
|
|
115
|
-
DestinationPatchConfig::Postgres => "postgres"
|
|
119
|
+
DestinationPatchConfig::Postgres => "postgres",
|
|
120
|
+
DestinationPatchConfig::ElasticSearch => "elasticSearch"
|
|
116
121
|
}
|
|
117
122
|
private_constant :TYPE_TO_NAME
|
|
118
123
|
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
# Configuration parameters for defining an ElasticSearch/OpenSearch sink.
|
|
7
|
+
class ElasticSearchConfigIn
|
|
8
|
+
# Name of the index to write to
|
|
9
|
+
#
|
|
10
|
+
# This can also be a data stream on sufficiently-new versions of ElasticSearch/OpenSearch
|
|
11
|
+
attr_accessor :index_name
|
|
12
|
+
# Base URL to send indexing requests
|
|
13
|
+
#
|
|
14
|
+
# This should not include the /{index}/_bulk suffix.
|
|
15
|
+
attr_accessor :url
|
|
16
|
+
# API key for authentication for ElasticSearch
|
|
17
|
+
#
|
|
18
|
+
# If not passed, any username:password embedded in the URL will be used. If none is passed,
|
|
19
|
+
# the indexing will be done unauthenticated.
|
|
20
|
+
attr_accessor :api_key
|
|
21
|
+
# If true, Elasticsearch refreshes the affected shards to make this operation visible to search.
|
|
22
|
+
attr_accessor :refresh
|
|
23
|
+
|
|
24
|
+
ALL_FIELD ||= ["index_name", "url", "api_key", "refresh"].freeze
|
|
25
|
+
private_constant :ALL_FIELD
|
|
26
|
+
|
|
27
|
+
def initialize(attributes = {})
|
|
28
|
+
unless attributes.is_a?(Hash)
|
|
29
|
+
fail(
|
|
30
|
+
ArgumentError,
|
|
31
|
+
"The input argument (attributes) must be a hash in `Svix::ElasticSearchConfigIn` new method"
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
attributes.each do |k, v|
|
|
36
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
37
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::ElasticSearchConfigIn")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
instance_variable_set("@#{k}", v)
|
|
41
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def self.deserialize(attributes = {})
|
|
46
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
47
|
+
attrs = Hash.new
|
|
48
|
+
attrs["index_name"] = attributes["indexName"]
|
|
49
|
+
attrs["url"] = attributes["url"]
|
|
50
|
+
attrs["api_key"] = attributes["apiKey"]
|
|
51
|
+
attrs["refresh"] = attributes["refresh"]
|
|
52
|
+
new(attrs)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def serialize
|
|
56
|
+
out = Hash.new
|
|
57
|
+
out["indexName"] = Svix::serialize_primitive(@index_name) unless @index_name.nil?
|
|
58
|
+
out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
|
|
59
|
+
out["apiKey"] = Svix::serialize_primitive(@api_key) unless @api_key.nil?
|
|
60
|
+
out["refresh"] = Svix::serialize_primitive(@refresh) unless @refresh.nil?
|
|
61
|
+
out
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Serializes the object to a json string
|
|
65
|
+
# @return String
|
|
66
|
+
def to_json(*args)
|
|
67
|
+
serialize.to_json(*args)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class ElasticSearchConfigOut
|
|
7
|
+
attr_accessor :index_name
|
|
8
|
+
attr_accessor :url
|
|
9
|
+
attr_accessor :refresh
|
|
10
|
+
|
|
11
|
+
ALL_FIELD ||= ["index_name", "url", "refresh"].freeze
|
|
12
|
+
private_constant :ALL_FIELD
|
|
13
|
+
|
|
14
|
+
def initialize(attributes = {})
|
|
15
|
+
unless attributes.is_a?(Hash)
|
|
16
|
+
fail(
|
|
17
|
+
ArgumentError,
|
|
18
|
+
"The input argument (attributes) must be a hash in `Svix::ElasticSearchConfigOut` new method"
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
attributes.each do |k, v|
|
|
23
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
24
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::ElasticSearchConfigOut")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
instance_variable_set("@#{k}", v)
|
|
28
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.deserialize(attributes = {})
|
|
33
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
34
|
+
attrs = Hash.new
|
|
35
|
+
attrs["index_name"] = attributes["indexName"]
|
|
36
|
+
attrs["url"] = attributes["url"]
|
|
37
|
+
attrs["refresh"] = attributes["refresh"]
|
|
38
|
+
new(attrs)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def serialize
|
|
42
|
+
out = Hash.new
|
|
43
|
+
out["indexName"] = Svix::serialize_primitive(@index_name) unless @index_name.nil?
|
|
44
|
+
out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
|
|
45
|
+
out["refresh"] = Svix::serialize_primitive(@refresh) unless @refresh.nil?
|
|
46
|
+
out
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Serializes the object to a json string
|
|
50
|
+
# @return String
|
|
51
|
+
def to_json(*args)
|
|
52
|
+
serialize.to_json(*args)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class ElasticSearchConfigPatch
|
|
7
|
+
attr_accessor :index_name
|
|
8
|
+
attr_accessor :url
|
|
9
|
+
attr_accessor :api_key
|
|
10
|
+
attr_accessor :refresh
|
|
11
|
+
|
|
12
|
+
ALL_FIELD ||= ["index_name", "url", "api_key", "refresh"].freeze
|
|
13
|
+
private_constant :ALL_FIELD
|
|
14
|
+
|
|
15
|
+
def initialize(attributes = {})
|
|
16
|
+
unless attributes.is_a?(Hash)
|
|
17
|
+
fail(
|
|
18
|
+
ArgumentError,
|
|
19
|
+
"The input argument (attributes) must be a hash in `Svix::ElasticSearchConfigPatch` new method"
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
attributes.each do |k, v|
|
|
24
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
25
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::ElasticSearchConfigPatch")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
instance_variable_set("@#{k}", v)
|
|
29
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.deserialize(attributes = {})
|
|
34
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
35
|
+
attrs = Hash.new
|
|
36
|
+
attrs["index_name"] = attributes["indexName"]
|
|
37
|
+
attrs["url"] = attributes["url"]
|
|
38
|
+
attrs["api_key"] = attributes["apiKey"]
|
|
39
|
+
attrs["refresh"] = attributes["refresh"]
|
|
40
|
+
new(attrs)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def serialize
|
|
44
|
+
out = Hash.new
|
|
45
|
+
out["indexName"] = Svix::serialize_primitive(@index_name) unless @index_name.nil?
|
|
46
|
+
out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
|
|
47
|
+
out["apiKey"] = Svix::serialize_primitive(@api_key) unless @api_key.nil?
|
|
48
|
+
out["refresh"] = Svix::serialize_primitive(@refresh) unless @refresh.nil?
|
|
49
|
+
out
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Serializes the object to a json string
|
|
53
|
+
# @return String
|
|
54
|
+
def to_json(*args)
|
|
55
|
+
serialize.to_json(*args)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -10,8 +10,13 @@ module Svix
|
|
|
10
10
|
#
|
|
11
11
|
# Defaults to the first example. Ignored if the schema doesn't contain an array of examples.
|
|
12
12
|
attr_accessor :example_index
|
|
13
|
+
# Custom payload to send as an example
|
|
14
|
+
#
|
|
15
|
+
# This is only available to allow-listed customers and should otherwise not be passed. Please
|
|
16
|
+
# contact us if you need access to this functionality
|
|
17
|
+
attr_accessor :payload
|
|
13
18
|
|
|
14
|
-
ALL_FIELD ||= ["event_type", "example_index"].freeze
|
|
19
|
+
ALL_FIELD ||= ["event_type", "example_index", "payload"].freeze
|
|
15
20
|
private_constant :ALL_FIELD
|
|
16
21
|
|
|
17
22
|
def initialize(attributes = {})
|
|
@@ -34,6 +39,7 @@ module Svix
|
|
|
34
39
|
attrs = Hash.new
|
|
35
40
|
attrs["event_type"] = attributes["eventType"]
|
|
36
41
|
attrs["example_index"] = attributes["exampleIndex"]
|
|
42
|
+
attrs["payload"] = attributes["payload"]
|
|
37
43
|
new(attrs)
|
|
38
44
|
end
|
|
39
45
|
|
|
@@ -41,6 +47,7 @@ module Svix
|
|
|
41
47
|
out = Hash.new
|
|
42
48
|
out["eventType"] = Svix::serialize_primitive(@event_type) unless @event_type.nil?
|
|
43
49
|
out["exampleIndex"] = Svix::serialize_primitive(@example_index) unless @example_index.nil?
|
|
50
|
+
out["payload"] = Svix::serialize_primitive(@payload) unless @payload.nil?
|
|
44
51
|
out
|
|
45
52
|
end
|
|
46
53
|
|
|
@@ -11,6 +11,9 @@ module Svix
|
|
|
11
11
|
# JSON payload to send as the request body of the webhook.
|
|
12
12
|
#
|
|
13
13
|
# We also support sending non-JSON payloads. Please contact us for more information.
|
|
14
|
+
#
|
|
15
|
+
# The serialized byte-length of this value should be under 1MiB. Please contact us
|
|
16
|
+
# if you need to send payloads large than 1MiB.
|
|
14
17
|
attr_accessor :payload
|
|
15
18
|
# List of free-form identifiers that endpoints can filter by
|
|
16
19
|
attr_accessor :channels
|
|
@@ -5,6 +5,7 @@ require "json"
|
|
|
5
5
|
require_relative "./azure_blob_storage_config_in"
|
|
6
6
|
require_relative "./big_query_config_in"
|
|
7
7
|
require_relative "./clickhouse_config_in"
|
|
8
|
+
require_relative "./elastic_search_config_in"
|
|
8
9
|
require_relative "./event_bridge_config_in"
|
|
9
10
|
require_relative "./google_cloud_pub_sub_config_in"
|
|
10
11
|
require_relative "./google_cloud_storage_config_in"
|
|
@@ -81,6 +82,9 @@ module Svix
|
|
|
81
82
|
|
|
82
83
|
class Postgres < PostgresConfigIn
|
|
83
84
|
end
|
|
85
|
+
|
|
86
|
+
class ElasticSearch < ElasticSearchConfigIn
|
|
87
|
+
end
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
class StreamSinkIn
|
|
@@ -126,7 +130,8 @@ module Svix
|
|
|
126
130
|
StreamSinkInConfig::Snowflake => "snowflake",
|
|
127
131
|
StreamSinkInConfig::RabbitMq => "rabbitMq",
|
|
128
132
|
StreamSinkInConfig::Redshift => "redshift",
|
|
129
|
-
StreamSinkInConfig::Postgres => "postgres"
|
|
133
|
+
StreamSinkInConfig::Postgres => "postgres",
|
|
134
|
+
StreamSinkInConfig::ElasticSearch => "elasticSearch"
|
|
130
135
|
}
|
|
131
136
|
private_constant :TYPE_TO_NAME
|
|
132
137
|
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
@@ -5,6 +5,7 @@ require "json"
|
|
|
5
5
|
require_relative "./azure_blob_storage_config_out"
|
|
6
6
|
require_relative "./big_query_config_out"
|
|
7
7
|
require_relative "./clickhouse_config_out"
|
|
8
|
+
require_relative "./elastic_search_config_out"
|
|
8
9
|
require_relative "./event_bridge_config_out"
|
|
9
10
|
require_relative "./google_cloud_pub_sub_config_out"
|
|
10
11
|
require_relative "./google_cloud_storage_config_out"
|
|
@@ -97,6 +98,9 @@ module Svix
|
|
|
97
98
|
|
|
98
99
|
class Postgres < PostgresConfigOut
|
|
99
100
|
end
|
|
101
|
+
|
|
102
|
+
class ElasticSearch < ElasticSearchConfigOut
|
|
103
|
+
end
|
|
100
104
|
end
|
|
101
105
|
|
|
102
106
|
class StreamSinkOut
|
|
@@ -151,7 +155,8 @@ module Svix
|
|
|
151
155
|
StreamSinkOutConfig::Sqs => "sqs",
|
|
152
156
|
StreamSinkOutConfig::EventBridge => "eventBridge",
|
|
153
157
|
StreamSinkOutConfig::Sns => "sns",
|
|
154
|
-
StreamSinkOutConfig::Postgres => "postgres"
|
|
158
|
+
StreamSinkOutConfig::Postgres => "postgres",
|
|
159
|
+
StreamSinkOutConfig::ElasticSearch => "elasticSearch"
|
|
155
160
|
}
|
|
156
161
|
private_constant :TYPE_TO_NAME
|
|
157
162
|
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
@@ -5,6 +5,7 @@ require "json"
|
|
|
5
5
|
require_relative "./azure_blob_storage_config_patch"
|
|
6
6
|
require_relative "./big_query_config_patch"
|
|
7
7
|
require_relative "./clickhouse_config_patch"
|
|
8
|
+
require_relative "./elastic_search_config_patch"
|
|
8
9
|
require_relative "./event_bridge_config_patch"
|
|
9
10
|
require_relative "./google_cloud_pub_sub_config_patch"
|
|
10
11
|
require_relative "./google_cloud_storage_config_patch"
|
|
@@ -81,6 +82,9 @@ module Svix
|
|
|
81
82
|
|
|
82
83
|
class Postgres < PostgresConfigPatch
|
|
83
84
|
end
|
|
85
|
+
|
|
86
|
+
class ElasticSearch < ElasticSearchConfigPatch
|
|
87
|
+
end
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
class StreamSinkPatch
|
|
@@ -112,7 +116,8 @@ module Svix
|
|
|
112
116
|
StreamSinkPatchConfig::Snowflake => "snowflake",
|
|
113
117
|
StreamSinkPatchConfig::RabbitMq => "rabbitMq",
|
|
114
118
|
StreamSinkPatchConfig::Redshift => "redshift",
|
|
115
|
-
StreamSinkPatchConfig::Postgres => "postgres"
|
|
119
|
+
StreamSinkPatchConfig::Postgres => "postgres",
|
|
120
|
+
StreamSinkPatchConfig::ElasticSearch => "elasticSearch"
|
|
116
121
|
}
|
|
117
122
|
private_constant :TYPE_TO_NAME
|
|
118
123
|
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
require "cgi"
|
|
4
4
|
require "uri"
|
|
5
5
|
require "net/http"
|
|
6
|
+
require "openssl"
|
|
6
7
|
require "securerandom"
|
|
7
8
|
|
|
8
9
|
module Svix
|
|
9
10
|
class SvixHttpClient
|
|
11
|
+
TIMEOUT_SECONDS = 15
|
|
12
|
+
|
|
10
13
|
def initialize(token, base_url)
|
|
11
14
|
@token = token
|
|
12
15
|
# Strip trailing slashes so that `https://api.svix.com/` does not
|
|
@@ -27,6 +30,9 @@ module Svix
|
|
|
27
30
|
|
|
28
31
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
29
32
|
http.use_ssl = (uri.scheme == "https")
|
|
33
|
+
http.open_timeout = TIMEOUT_SECONDS
|
|
34
|
+
http.read_timeout = TIMEOUT_SECONDS
|
|
35
|
+
http.write_timeout = TIMEOUT_SECONDS
|
|
30
36
|
|
|
31
37
|
# Dynamically select the request class based on method
|
|
32
38
|
request_class = case method.to_s.upcase
|
|
@@ -90,20 +96,31 @@ module Svix
|
|
|
90
96
|
end
|
|
91
97
|
end
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
# Network-level errors (timeouts, connection failures, etc.) that are retried
|
|
100
|
+
RETRYABLE_ERRORS = [
|
|
101
|
+
Timeout::Error,
|
|
102
|
+
SocketError,
|
|
103
|
+
SystemCallError,
|
|
104
|
+
IOError,
|
|
105
|
+
Net::ProtocolError,
|
|
106
|
+
Net::HTTPBadResponse,
|
|
107
|
+
OpenSSL::SSL::SSLError
|
|
108
|
+
].freeze
|
|
95
109
|
|
|
110
|
+
private def execute_request_with_retries(request, http)
|
|
96
111
|
[0.05, 0.1, 0.2].each_with_index do |sleep_duration, index|
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
begin
|
|
113
|
+
res = http.request(request)
|
|
114
|
+
return res unless Integer(res.code) >= 500
|
|
115
|
+
rescue *RETRYABLE_ERRORS
|
|
116
|
+
# retried below
|
|
99
117
|
end
|
|
100
118
|
|
|
101
119
|
sleep(sleep_duration)
|
|
102
120
|
request["svix-retry-count"] = index + 1
|
|
103
|
-
res = http.request(request)
|
|
104
121
|
end
|
|
105
122
|
|
|
106
|
-
|
|
123
|
+
http.request(request)
|
|
107
124
|
end
|
|
108
125
|
|
|
109
126
|
private def encode_query_params(query_params = {})
|
data/lib/svix/version.rb
CHANGED
data/lib/svix.rb
CHANGED
|
@@ -96,6 +96,9 @@ require "svix/models/docusign_config"
|
|
|
96
96
|
require "svix/models/docusign_config_out"
|
|
97
97
|
require "svix/models/easypost_config"
|
|
98
98
|
require "svix/models/easypost_config_out"
|
|
99
|
+
require "svix/models/elastic_search_config_in"
|
|
100
|
+
require "svix/models/elastic_search_config_out"
|
|
101
|
+
require "svix/models/elastic_search_config_patch"
|
|
99
102
|
require "svix/models/empty_response"
|
|
100
103
|
require "svix/models/endpoint_attempt_stats"
|
|
101
104
|
require "svix/models/endpoint_headers_in"
|
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: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Svix
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-10-
|
|
10
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: base64
|
|
@@ -207,6 +207,9 @@ files:
|
|
|
207
207
|
- lib/svix/models/docusign_config_out.rb
|
|
208
208
|
- lib/svix/models/easypost_config.rb
|
|
209
209
|
- lib/svix/models/easypost_config_out.rb
|
|
210
|
+
- lib/svix/models/elastic_search_config_in.rb
|
|
211
|
+
- lib/svix/models/elastic_search_config_out.rb
|
|
212
|
+
- lib/svix/models/elastic_search_config_patch.rb
|
|
210
213
|
- lib/svix/models/empty_response.rb
|
|
211
214
|
- lib/svix/models/endpoint_attempt_stats.rb
|
|
212
215
|
- lib/svix/models/endpoint_headers_in.rb
|