multiwoven-integrations 0.1.39 → 0.1.41

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: e3123a99f29451e56f8a1e29734986e05912dde86c00bd4b5acce1b2cf00e6ba
4
- data.tar.gz: 1490775563ce10d3c4054e481f5827317028a3da65b2c84aaaafe7f6122f02cc
3
+ metadata.gz: 82b67da3db5fd718642d785a6c88d95aab50098e900ace51d275839b0282ce1d
4
+ data.tar.gz: 5e749c3149f853de00482ddb1899b622a062cf96b3ee22dfd428e0fa94a68ca9
5
5
  SHA512:
6
- metadata.gz: 5c0d4b213125850a7ee7d421cb8dcd0af7bfbaf9ebb5a18adbf3ba2e3140b91ebbda4b27c2d8f5d8a90a16c5a0291e06ee4e0b1318ccd45be3f4a5f22c8af228
7
- data.tar.gz: 87cb23b0dad389a43688edafa6cda3f367ad59aeb1682d8c78f1d46a8969081742c860ffc2eb713454bd0b3479189ed83b918d9c86f597e85e29ca1516f2bc25
6
+ metadata.gz: 18fc7eb3472d27029851e6768cec57b9d1cf0c13dd462938a76d7ecc3770f041be0f5c5de3609d5270869358e5080af969bca7296ee11bfb41244b40aa05bcf5
7
+ data.tar.gz: aaa27f548de6c20a6444644fe784ee708b7f6b8f9113812ab046d8b72ea161e114e16cc5d524a196aa479c707d3055143952658fd018a026e484905a2b30b7c4
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.1.39"
5
+ VERSION = "0.1.41"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -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
@@ -19,7 +19,7 @@
19
19
  "title": "Username",
20
20
  "order": 0
21
21
  },
22
- "refresh_token": {
22
+ "password": {
23
23
  "type": "string",
24
24
  "title": "Password",
25
25
  "order": 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.39
4
+ version: 0.1.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P