multiwoven-integrations 0.8.4 → 0.8.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df3f02afacced944c3524d23a471e1d6a761b6b1c1169479b3da1199f7f6b4c0
|
4
|
+
data.tar.gz: f918fc9763ae26e8de2bb9e1fe1990a225b822af6366cd9523d3dde68a238193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b429f6c8883c361693b726f19dff78ada6957f2637c58c76df0afb718b7aef88176e7fa2bf3528c4ac3a80d6235c91fc4990603cfea1dd1130f4238e51287046
|
7
|
+
data.tar.gz: b20f80e85b814ff6a38696432e0cee2c6841d24ef62fa1409e42cd77c48bef7f40c3931fc5511b2f9aaa0a0c49c6c73248ffe47738d35c08afc17f7de714751e
|
@@ -59,13 +59,15 @@ module Multiwoven
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def process_records(records, stream)
|
62
|
+
log_message_array = []
|
62
63
|
write_success = 0
|
63
64
|
write_failure = 0
|
64
65
|
properties = stream.json_schema[:properties]
|
65
66
|
records.each do |record_object|
|
66
67
|
record = extract_data(record_object, properties)
|
67
|
-
process_record(stream, record)
|
68
|
+
request, response = *process_record(stream, record)
|
68
69
|
write_success += 1
|
70
|
+
log_message_array << log_request_response("info", request, response)
|
69
71
|
rescue StandardError => e
|
70
72
|
# TODO: add sync_id and sync_run_id to the logs
|
71
73
|
handle_exception(e, {
|
@@ -75,8 +77,9 @@ module Multiwoven
|
|
75
77
|
sync_run_id: @sync_config.sync_run_id
|
76
78
|
})
|
77
79
|
write_failure += 1
|
80
|
+
log_message_array << log_request_response("error", request, e.message)
|
78
81
|
end
|
79
|
-
tracking_message(write_success, write_failure)
|
82
|
+
tracking_message(write_success, write_failure, log_message_array)
|
80
83
|
end
|
81
84
|
|
82
85
|
def process_record(stream, record)
|
@@ -86,7 +89,8 @@ module Multiwoven
|
|
86
89
|
def send_data_to_salesforce(stream_name, record = {})
|
87
90
|
method_name = "#{@action}!"
|
88
91
|
args = build_args(@action, stream_name, record)
|
89
|
-
@client.send(method_name, *args)
|
92
|
+
response = @client.send(method_name, *args)
|
93
|
+
[args, response]
|
90
94
|
end
|
91
95
|
|
92
96
|
def build_args(action, stream_name, record)
|
@@ -116,12 +120,6 @@ module Multiwoven
|
|
116
120
|
read_json(CATALOG_SPEC_PATH)
|
117
121
|
end
|
118
122
|
|
119
|
-
def tracking_message(success, failure)
|
120
|
-
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
121
|
-
success: success, failed: failure
|
122
|
-
).to_multiwoven_message
|
123
|
-
end
|
124
|
-
|
125
123
|
def log_debug(message)
|
126
124
|
Multiwoven::Integrations::Service.logger.debug(message)
|
127
125
|
end
|
@@ -52,14 +52,17 @@ module Multiwoven
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def process_records(records, stream)
|
55
|
+
log_message_array = []
|
55
56
|
write_success = 0
|
56
57
|
write_failure = 0
|
57
58
|
properties = stream.json_schema[:properties]
|
58
59
|
records.each do |record_object|
|
59
60
|
record = extract_data(record_object, properties)
|
60
|
-
|
61
|
-
klass.
|
61
|
+
args = [stream.name, "Id", record]
|
62
|
+
klass = @client.const_get(stream.name)
|
63
|
+
response = klass.send(@action, record)
|
62
64
|
write_success += 1
|
65
|
+
log_message_array << log_request_response("info", args, response)
|
63
66
|
rescue StandardError => e
|
64
67
|
handle_exception(e, {
|
65
68
|
context: "STRIPE:CRM:WRITE:EXCEPTION",
|
@@ -68,8 +71,9 @@ module Multiwoven
|
|
68
71
|
sync_run_id: @sync_config.sync_run_id
|
69
72
|
})
|
70
73
|
write_failure += 1
|
74
|
+
log_message_array << log_request_response("error", args, e.message)
|
71
75
|
end
|
72
|
-
tracking_message(write_success, write_failure)
|
76
|
+
tracking_message(write_success, write_failure, log_message_array)
|
73
77
|
end
|
74
78
|
|
75
79
|
def authenticate_client
|
@@ -80,12 +84,6 @@ module Multiwoven
|
|
80
84
|
read_json(CATALOG_SPEC_PATH)
|
81
85
|
end
|
82
86
|
|
83
|
-
def tracking_message(success, failure)
|
84
|
-
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
85
|
-
success: success, failed: failure
|
86
|
-
).to_multiwoven_message
|
87
|
-
end
|
88
|
-
|
89
87
|
def log_debug(message)
|
90
88
|
Multiwoven::Integrations::Service.logger.debug(message)
|
91
89
|
end
|
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.8.
|
4
|
+
version: 0.8.6
|
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-08-
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|