multiwoven-integrations 0.43.3 → 0.43.4
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ecf2fa7bbd831e1ea77bf61ca36f9d2daedeb36c7aa1c58c8a338541cc0b3634
|
|
4
|
+
data.tar.gz: d04571851a2b2c1c740191a51abdfbd98ef36d199587a159c084d260c2164d4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d961d5d255f7b2f2621ed269cad521c7baf203f4f975ca8a9a61af0ec96c32a7e15f24c8cc10ebe1c99d15592e2829ea18f29319a60a21ace58699407519bd6
|
|
7
|
+
data.tar.gz: a27914b0f2b5fcfd156aad9f2ed42c8942ba1e5223f41b5bf5eb731cd333d0769047ce33ff1b45a532f7085c7a2f455244832921ad3df2cae97428f9ad6133e7
|
|
@@ -54,6 +54,15 @@ module Multiwoven
|
|
|
54
54
|
)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
def parse_request_format(request_format, required:)
|
|
58
|
+
return [request_format, nil] if request_format.is_a?(Hash)
|
|
59
|
+
return [nil, required ? "Request Format is required to test the connection" : nil] if request_format.blank?
|
|
60
|
+
|
|
61
|
+
[JSON.parse(request_format), nil]
|
|
62
|
+
rescue JSON::ParserError
|
|
63
|
+
[nil, "Request Format must be valid JSON"]
|
|
64
|
+
end
|
|
65
|
+
|
|
57
66
|
def send_streaming_request(options = {})
|
|
58
67
|
Multiwoven::Integrations::Core::StreamingHttpClient.request(
|
|
59
68
|
options[:url],
|
|
@@ -6,10 +6,13 @@ module Multiwoven::Integrations::Source
|
|
|
6
6
|
class Client < SourceConnector
|
|
7
7
|
def check_connection(connection_config)
|
|
8
8
|
connection_config = prepare_config(connection_config)
|
|
9
|
+
payload, error = parse_request_format(connection_config[:request_format], required: true)
|
|
10
|
+
return failure_status(error) if error
|
|
11
|
+
|
|
9
12
|
response = send_request(
|
|
10
13
|
url: connection_config[:url],
|
|
11
14
|
http_method: HTTP_POST,
|
|
12
|
-
payload:
|
|
15
|
+
payload: payload,
|
|
13
16
|
headers: auth_headers(connection_config[:api_key]),
|
|
14
17
|
config: connection_config[:config]
|
|
15
18
|
)
|
|
@@ -6,10 +6,13 @@ module Multiwoven::Integrations::Source
|
|
|
6
6
|
class Client < SourceConnector
|
|
7
7
|
def check_connection(connection_config)
|
|
8
8
|
connection_config = prepare_config(connection_config)
|
|
9
|
+
payload, error = parse_request_format(connection_config[:request_format], required: false)
|
|
10
|
+
return failure_status(error) if error
|
|
11
|
+
|
|
9
12
|
response = send_request(
|
|
10
13
|
url: connection_config[:url_host],
|
|
11
14
|
http_method: connection_config[:http_method],
|
|
12
|
-
payload:
|
|
15
|
+
payload: payload,
|
|
13
16
|
headers: connection_config[:headers],
|
|
14
17
|
config: connection_config[:config]
|
|
15
18
|
)
|