multiwoven-integrations 0.15.5 → 0.15.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5817a11d56cc84e9f21a860c1a3569341618601b7e45adfb11d63c69cef56bad
4
- data.tar.gz: de86e0f0cf8e03c2a502564c4433504069b8901351e19214cccd0024358146dc
3
+ metadata.gz: 32c240b4b7351393469c38c3a9350b48314081f8c86c3a47a1f5d2f8f5135551
4
+ data.tar.gz: 84ba1001f04a3aa82756309df45ab402ce602d1e87c9cca6a34228a6167e5129
5
5
  SHA512:
6
- metadata.gz: 128e2f06b1712097cf41f8b8e49d3724e4695fac476f606511d702c9eb1603dffd836e06c930032521a1579b3753fcd885b50f4c8f5889b180587690dedb50bc
7
- data.tar.gz: d3541afb998b37338318843b402fd00c4d9a2ab83ce24e4efc6ab5e2bc92931c8dc16a3d04eeafdeb053253887ad5c7d3a4411d6e0dca664f924cee157c4efe9
6
+ metadata.gz: 5657d3ad9501a1775fee054880615a0b8d181ce84e9ca05e63e6ad5629c8258266aa652e7aa37f10d817f71ab6df2c9bcb25fb8d6e036ce9eecf5d3bd8196cb6
7
+ data.tar.gz: 52be9d52894d822e4d003993ea4b5c82706cd740b70eb74ff917bb851bb9f5e48f18f43cfe3896bb996b75a51db2ebed31a70eeab4b057da91c4c1819f5349c5
@@ -65,9 +65,10 @@ module Multiwoven
65
65
  properties = stream.json_schema[:properties]
66
66
  records.each do |record_object|
67
67
  record = extract_data(record_object, properties)
68
- request, response = *process_record(stream, record)
68
+ args = [stream.name, "Id", record]
69
+ response = send_data_to_salesforce(args)
69
70
  write_success += 1
70
- log_message_array << log_request_response("info", request, response)
71
+ log_message_array << log_request_response("info", args, response)
71
72
  rescue StandardError => e
72
73
  # TODO: add sync_id and sync_run_id to the logs
73
74
  handle_exception(e, {
@@ -77,31 +78,14 @@ module Multiwoven
77
78
  sync_run_id: @sync_config.sync_run_id
78
79
  })
79
80
  write_failure += 1
80
- log_message_array << log_request_response("error", request, e.message)
81
+ log_message_array << log_request_response("error", args, e.message)
81
82
  end
82
83
  tracking_message(write_success, write_failure, log_message_array)
83
84
  end
84
85
 
85
- def process_record(stream, record)
86
- send_data_to_salesforce(stream.name, record)
87
- end
88
-
89
- def send_data_to_salesforce(stream_name, record = {})
90
- method_name = "#{@action}!"
91
- args = build_args(@action, stream_name, record)
92
- response = @client.send(method_name, *args)
93
- [args, response]
94
- end
95
-
96
- def build_args(action, stream_name, record)
97
- case action
98
- when :upsert
99
- [stream_name, record[:external_key], record]
100
- when :destroy
101
- [stream_name, record[:id]]
102
- else
103
- [stream_name, record]
104
- end
86
+ def send_data_to_salesforce(args)
87
+ method_name = "upsert!"
88
+ @client.send(method_name, *args)
105
89
  end
106
90
 
107
91
  def authenticate_client
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.15.5"
5
+ VERSION = "0.15.7"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -59,8 +59,9 @@ module Multiwoven::Integrations::Source
59
59
  url_host = connection_config[:url_host]
60
60
  headers = connection_config[:headers]
61
61
  config = connection_config[:config]
62
+ http_method = connection_config[:http_method]
62
63
  config[:timeout] ||= 30
63
- response = send_request(url_host, HTTP_POST, payload, headers, config)
64
+ response = send_request(url_host, http_method, payload, headers, config)
64
65
  process_response(response)
65
66
  rescue StandardError => e
66
67
  handle_exception(e, context: "HTTP MODEL:RUN_MODEL:EXCEPTION", type: "error")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.15.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-21 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport