multiwoven-integrations 0.1.40 → 0.1.41
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: 82b67da3db5fd718642d785a6c88d95aab50098e900ace51d275839b0282ce1d
|
|
4
|
+
data.tar.gz: 5e749c3149f853de00482ddb1899b622a062cf96b3ee22dfd428e0fa94a68ca9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18fc7eb3472d27029851e6768cec57b9d1cf0c13dd462938a76d7ecc3770f041be0f5c5de3609d5270869358e5080af969bca7296ee11bfb41244b40aa05bcf5
|
|
7
|
+
data.tar.gz: aaa27f548de6c20a6444644fe784ee708b7f6b8f9113812ab046d8b72ea161e114e16cc5d524a196aa479c707d3055143952658fd018a026e484905a2b30b7c4
|
|
@@ -9,7 +9,7 @@ module Multiwoven
|
|
|
9
9
|
include Multiwoven::Integrations::Core
|
|
10
10
|
|
|
11
11
|
API_VERSION = "59.0"
|
|
12
|
-
SALESFORCE_OBJECTS = %w[Account User].freeze
|
|
12
|
+
SALESFORCE_OBJECTS = %w[Account User Visit RetailStore].freeze
|
|
13
13
|
|
|
14
14
|
class Client < SourceConnector # rubocop:disable Metrics/ClassLength
|
|
15
15
|
prepend Multiwoven::Integrations::Core::RateLimiter
|
|
@@ -55,13 +55,29 @@ module Multiwoven
|
|
|
55
55
|
|
|
56
56
|
private
|
|
57
57
|
|
|
58
|
+
def query(connection, query)
|
|
59
|
+
exclude_keys = ["attributes"]
|
|
60
|
+
queried_data = connection.query(query)
|
|
61
|
+
results = queried_data.map do |record|
|
|
62
|
+
record.reject { |key, _| exclude_keys.include?(key) }
|
|
63
|
+
end
|
|
64
|
+
results.map do |row|
|
|
65
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def create_connection(connection_config)
|
|
70
|
+
initialize_client(connection_config)
|
|
71
|
+
end
|
|
72
|
+
|
|
58
73
|
def initialize_client(config)
|
|
59
74
|
config = config.with_indifferent_access
|
|
60
75
|
@client = Restforce.new(username: config[:username],
|
|
61
76
|
password: config[:password] + config[:security_token],
|
|
62
77
|
host: config[:host],
|
|
63
78
|
client_id: config[:client_id],
|
|
64
|
-
client_secret: config[:client_secret]
|
|
79
|
+
client_secret: config[:client_secret],
|
|
80
|
+
api_version: API_VERSION)
|
|
65
81
|
end
|
|
66
82
|
|
|
67
83
|
def salesforce_field_to_json_schema_type(sf_field) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
|