multiwoven-integrations 0.1.29 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/multiwoven/integrations/core/constants.rb +2 -0
- data/lib/multiwoven/integrations/destination/hubspot/client.rb +106 -0
- data/lib/multiwoven/integrations/destination/hubspot/config/catalog.json +351 -0
- data/lib/multiwoven/integrations/destination/hubspot/config/meta.json +15 -0
- data/lib/multiwoven/integrations/destination/hubspot/config/spec.json +17 -0
- data/lib/multiwoven/integrations/destination/hubspot/icon.svg +5 -0
- data/lib/multiwoven/integrations/rollout.rb +3 -1
- data/lib/multiwoven/integrations/source/databricks/client.rb +98 -0
- data/lib/multiwoven/integrations/source/databricks/config/meta.json +16 -0
- data/lib/multiwoven/integrations/source/databricks/config/spec.json +60 -0
- data/lib/multiwoven/integrations/source/databricks/icon.svg +19 -0
- data/lib/multiwoven/integrations.rb +3 -0
- metadata +25 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e3ffd041d8b25bfbae7c39e01491aad0d56d4a0e6b55707c57587b1a3b6993d
|
4
|
+
data.tar.gz: ed377a5d5c51060b7f288da572586194c1a846b5a10396c1a27f30cef960837d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4623a3a407aa222480eff99d1a862b0d59a1d1fe941255d0a31fd3539d5bda79faf87042eb281a9b0a15c254cc04ce0ed314d4f27bd8fa2798ce0e084afafde7
|
7
|
+
data.tar.gz: 8fc6cd88f2c293d2c84f0e923e25c9a57aea1fc21802e1d41dab5a3ee96e816deaefc635a4e06309b10128e3ce9ffc4b8e2d69274e95f1fd4e96f7315fe12bfb
|
@@ -12,9 +12,11 @@ module Multiwoven
|
|
12
12
|
CONNECTOR_SPEC_PATH = "config/spec.json"
|
13
13
|
CATALOG_SPEC_PATH = "config/catalog.json"
|
14
14
|
SNOWFLAKE_MAC_DRIVER_PATH = "/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib"
|
15
|
+
DATABRICKS_MAC_DRIVER_PATH = "/Library/simba/spark/lib/libsparkodbc_sb64-universal.dylib"
|
15
16
|
MAIN_BRANCH_SHA = Git.ls_remote("https://github.com/Multiwoven/multiwoven-integrations")["head"][:sha]
|
16
17
|
|
17
18
|
SNOWFLAKE_DRIVER_PATH = ENV["SNOWFLAKE_DRIVER_PATH"] || SNOWFLAKE_MAC_DRIVER_PATH
|
19
|
+
DATABRICKS_DRIVER_PATH = ENV["DATABRICKS_DRIVER_PATH"] || DATABRICKS_MAC_DRIVER_PATH
|
18
20
|
|
19
21
|
# CONNECTORS
|
20
22
|
KLAVIYO_AUTH_ENDPOINT = "https://a.klaviyo.com/api/lists/"
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "stringio"
|
4
|
+
|
5
|
+
module Multiwoven
|
6
|
+
module Integrations
|
7
|
+
module Destination
|
8
|
+
module Hubspot
|
9
|
+
include Multiwoven::Integrations::Core
|
10
|
+
|
11
|
+
class Client < DestinationConnector
|
12
|
+
def check_connection(connection_config)
|
13
|
+
connection_config = connection_config.with_indifferent_access
|
14
|
+
initialize_client(connection_config)
|
15
|
+
authenticate_client
|
16
|
+
success_status
|
17
|
+
rescue StandardError => e
|
18
|
+
handle_exception("HUBSPOT:CRM:DISCOVER:EXCEPTION", "error", e)
|
19
|
+
failure_status(e)
|
20
|
+
end
|
21
|
+
|
22
|
+
def discover(_connection_config = nil)
|
23
|
+
catalog = build_catalog(load_catalog)
|
24
|
+
catalog.to_multiwoven_message
|
25
|
+
rescue StandardError => e
|
26
|
+
handle_exception("HUBSPOT:CRM:DISCOVER:EXCEPTION", "error", e)
|
27
|
+
end
|
28
|
+
|
29
|
+
def write(sync_config, records, action = "create")
|
30
|
+
@action = sync_config.stream.action || action
|
31
|
+
initialize_client(sync_config.destination.connection_specification)
|
32
|
+
process_records(records, sync_config.stream)
|
33
|
+
rescue StandardError => e
|
34
|
+
handle_exception("HUBSPOT:CRM:WRITE:EXCEPTION", "error", e)
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def initialize_client(config)
|
40
|
+
config = config.with_indifferent_access
|
41
|
+
@client = ::Hubspot::Client.new(access_token: config[:access_token])
|
42
|
+
end
|
43
|
+
|
44
|
+
def process_records(records, stream)
|
45
|
+
write_success = 0
|
46
|
+
write_failure = 0
|
47
|
+
properties = stream.json_schema.with_indifferent_access[:properties]
|
48
|
+
records.each do |record_object|
|
49
|
+
record = extract_data(record_object, properties)
|
50
|
+
send_data_to_hubspot(stream.name, record)
|
51
|
+
write_success += 1
|
52
|
+
rescue StandardError => e
|
53
|
+
handle_exception("HUBSPOT:CRM:WRITE:EXCEPTION", "error", e)
|
54
|
+
write_failure += 1
|
55
|
+
end
|
56
|
+
tracking_message(write_success, write_failure)
|
57
|
+
end
|
58
|
+
|
59
|
+
def send_data_to_hubspot(stream_name, record = {})
|
60
|
+
args = build_args(@action, stream_name, record)
|
61
|
+
hubspot_stream = @client.crm.send(stream_name)
|
62
|
+
hubspot_data = { simple_public_object_input_for_create: args }
|
63
|
+
hubspot_stream.basic_api.send(@action, hubspot_data)
|
64
|
+
end
|
65
|
+
|
66
|
+
def build_args(action, stream_name, record)
|
67
|
+
case action
|
68
|
+
when :upsert
|
69
|
+
[stream_name, record[:external_key], record]
|
70
|
+
when :destroy
|
71
|
+
[stream_name, record[:id]]
|
72
|
+
else
|
73
|
+
record
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def authenticate_client
|
78
|
+
@client.crm.contacts.basic_api.get_page
|
79
|
+
end
|
80
|
+
|
81
|
+
def success_status
|
82
|
+
ConnectionStatus.new(status: ConnectionStatusType["succeeded"]).to_multiwoven_message
|
83
|
+
end
|
84
|
+
|
85
|
+
def failure_status(error)
|
86
|
+
ConnectionStatus.new(status: ConnectionStatusType["failed"], message: error.message).to_multiwoven_message
|
87
|
+
end
|
88
|
+
|
89
|
+
def load_catalog
|
90
|
+
read_json(CATALOG_SPEC_PATH)
|
91
|
+
end
|
92
|
+
|
93
|
+
def tracking_message(success, failure)
|
94
|
+
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
95
|
+
success: success, failed: failure
|
96
|
+
).to_multiwoven_message
|
97
|
+
end
|
98
|
+
|
99
|
+
def log_debug(message)
|
100
|
+
Multiwoven::Integrations::Service.logger.debug(message)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,351 @@
|
|
1
|
+
{
|
2
|
+
"request_rate_limit": 600,
|
3
|
+
"request_rate_limit_unit": "minute",
|
4
|
+
"request_rate_concurrency": 10,
|
5
|
+
"streams": [
|
6
|
+
{
|
7
|
+
"name": "contacts",
|
8
|
+
"action": "create",
|
9
|
+
"json_schema": {
|
10
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
11
|
+
"title": "HubSpot CRM",
|
12
|
+
"type": "object",
|
13
|
+
"required": ["email"],
|
14
|
+
"properties": {
|
15
|
+
"properties": {
|
16
|
+
"type": "object",
|
17
|
+
"properties": {
|
18
|
+
"email": {
|
19
|
+
"type": "string",
|
20
|
+
"format": "email",
|
21
|
+
"description": "The contact's email address."
|
22
|
+
},
|
23
|
+
"firstname": {
|
24
|
+
"type": "string",
|
25
|
+
"description": "The contact's first name."
|
26
|
+
},
|
27
|
+
"lastname": {
|
28
|
+
"type": "string",
|
29
|
+
"description": "The contact's last name."
|
30
|
+
},
|
31
|
+
"phone": {
|
32
|
+
"type": "string",
|
33
|
+
"description": "The contact's phone number."
|
34
|
+
},
|
35
|
+
"company": {
|
36
|
+
"type": "string",
|
37
|
+
"description": "The contact's company name."
|
38
|
+
},
|
39
|
+
"website": {
|
40
|
+
"type": "string",
|
41
|
+
"format": "uri",
|
42
|
+
"description": "The contact's website URL."
|
43
|
+
},
|
44
|
+
"lifecyclestage": {
|
45
|
+
"type": "string",
|
46
|
+
"description": "The contact's lifecycle stage."
|
47
|
+
}
|
48
|
+
},
|
49
|
+
"additionalProperties": {
|
50
|
+
"type": ["string", "number", "boolean"],
|
51
|
+
"description": "Allows for additional custom properties with basic data types."
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"associations": {
|
55
|
+
"type": "array",
|
56
|
+
"description": "An array of associated objects for the contact.",
|
57
|
+
"items": {
|
58
|
+
"type": "object",
|
59
|
+
"properties": {
|
60
|
+
"to": {
|
61
|
+
"type": "object",
|
62
|
+
"required": ["id"],
|
63
|
+
"properties": {
|
64
|
+
"id": {
|
65
|
+
"type": "integer",
|
66
|
+
"description": "The unique identifier of the associated object."
|
67
|
+
}
|
68
|
+
}
|
69
|
+
},
|
70
|
+
"types": {
|
71
|
+
"type": "array",
|
72
|
+
"items": {
|
73
|
+
"type": "object",
|
74
|
+
"required": ["associationCategory", "associationTypeId"],
|
75
|
+
"properties": {
|
76
|
+
"associationCategory": {
|
77
|
+
"type": "string",
|
78
|
+
"description": "The category of the association.",
|
79
|
+
"enum": [
|
80
|
+
"HUBSPOT_DEFINED",
|
81
|
+
"USER_DEFINED",
|
82
|
+
"INTEGRATOR_DEFINED"
|
83
|
+
]
|
84
|
+
},
|
85
|
+
"associationTypeId": {
|
86
|
+
"type": "integer",
|
87
|
+
"description": "The unique identifier of the association type."
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
},
|
97
|
+
"supported_sync_modes": ["full_refresh", "incremental"],
|
98
|
+
"source_defined_cursor": true,
|
99
|
+
"default_cursor_field": ["updated"]
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"name": "companies",
|
103
|
+
"action": "create",
|
104
|
+
"json_schema": {
|
105
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
106
|
+
"type": "object",
|
107
|
+
"properties": {
|
108
|
+
"inputs": {
|
109
|
+
"type": "array",
|
110
|
+
"items": {
|
111
|
+
"type": "object",
|
112
|
+
"properties": {
|
113
|
+
"associations": {
|
114
|
+
"type": "array",
|
115
|
+
"items": {
|
116
|
+
"type": "object",
|
117
|
+
"properties": {
|
118
|
+
"types": {
|
119
|
+
"type": "array",
|
120
|
+
"items": {
|
121
|
+
"type": "object",
|
122
|
+
"properties": {
|
123
|
+
"associationCategory": {
|
124
|
+
"type": "string",
|
125
|
+
"enum": [
|
126
|
+
"HUBSPOT_DEFINED",
|
127
|
+
"USER_DEFINED",
|
128
|
+
"INTEGRATOR_DEFINED"
|
129
|
+
]
|
130
|
+
},
|
131
|
+
"associationTypeId": {
|
132
|
+
"type": "integer"
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
},
|
137
|
+
"to": {
|
138
|
+
"type": "object",
|
139
|
+
"properties": {
|
140
|
+
"id": {
|
141
|
+
"type": "string"
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
},
|
148
|
+
"properties": {
|
149
|
+
"type": "object",
|
150
|
+
"properties": {
|
151
|
+
"city": {
|
152
|
+
"type": "string"
|
153
|
+
},
|
154
|
+
"name": {
|
155
|
+
"type": "string"
|
156
|
+
},
|
157
|
+
"phone": {
|
158
|
+
"type": "string"
|
159
|
+
},
|
160
|
+
"state": {
|
161
|
+
"type": "string"
|
162
|
+
},
|
163
|
+
"domain": {
|
164
|
+
"type": "string"
|
165
|
+
},
|
166
|
+
"industry": {
|
167
|
+
"type": "string"
|
168
|
+
}
|
169
|
+
},
|
170
|
+
"required": ["name", "domain"]
|
171
|
+
}
|
172
|
+
},
|
173
|
+
"required": ["properties"]
|
174
|
+
}
|
175
|
+
}
|
176
|
+
},
|
177
|
+
"required": ["inputs"]
|
178
|
+
},
|
179
|
+
"supported_sync_modes": ["full_refresh", "incremental"],
|
180
|
+
"source_defined_cursor": true,
|
181
|
+
"default_cursor_field": ["updated"]
|
182
|
+
},
|
183
|
+
{
|
184
|
+
"name": "deals",
|
185
|
+
"action": "create",
|
186
|
+
"json_schema": {
|
187
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
188
|
+
"type": "object",
|
189
|
+
"properties": {
|
190
|
+
"properties": {
|
191
|
+
"type": "object",
|
192
|
+
"properties": {
|
193
|
+
"amount": {
|
194
|
+
"type": "string",
|
195
|
+
"pattern": "^[0-9]+(\\.[0-9]{1,2})?$"
|
196
|
+
},
|
197
|
+
"closedate": {
|
198
|
+
"type": "string",
|
199
|
+
"format": "date-time"
|
200
|
+
},
|
201
|
+
"dealname": {
|
202
|
+
"type": "string"
|
203
|
+
},
|
204
|
+
"pipeline": {
|
205
|
+
"type": "string"
|
206
|
+
},
|
207
|
+
"dealstage": {
|
208
|
+
"type": "string",
|
209
|
+
"enum": [
|
210
|
+
"appointmentscheduled",
|
211
|
+
"qualifiedtobuy",
|
212
|
+
"presentationscheduled",
|
213
|
+
"decisionmakerboughtin",
|
214
|
+
"contractsent",
|
215
|
+
"closedwon",
|
216
|
+
"closedlost"
|
217
|
+
]
|
218
|
+
},
|
219
|
+
"hubspot_owner_id": {
|
220
|
+
"type": "string",
|
221
|
+
"pattern": "^[0-9]+$"
|
222
|
+
}
|
223
|
+
},
|
224
|
+
"required": ["dealname", "pipeline", "dealstage"]
|
225
|
+
},
|
226
|
+
"associations": {
|
227
|
+
"type": "array",
|
228
|
+
"items": {
|
229
|
+
"type": "object",
|
230
|
+
"properties": {
|
231
|
+
"to": {
|
232
|
+
"type": "object",
|
233
|
+
"properties": {
|
234
|
+
"id": {
|
235
|
+
"type": "integer"
|
236
|
+
}
|
237
|
+
},
|
238
|
+
"required": ["id"]
|
239
|
+
},
|
240
|
+
"types": {
|
241
|
+
"type": "array",
|
242
|
+
"items": {
|
243
|
+
"type": "object",
|
244
|
+
"properties": {
|
245
|
+
"associationCategory": {
|
246
|
+
"type": "string",
|
247
|
+
"enum": [
|
248
|
+
"HUBSPOT_DEFINED",
|
249
|
+
"USER_DEFINED",
|
250
|
+
"INTEGRATOR_DEFINED"
|
251
|
+
]
|
252
|
+
},
|
253
|
+
"associationTypeId": {
|
254
|
+
"type": "integer"
|
255
|
+
}
|
256
|
+
},
|
257
|
+
"required": ["associationCategory", "associationTypeId"]
|
258
|
+
}
|
259
|
+
}
|
260
|
+
},
|
261
|
+
"required": ["to", "types"]
|
262
|
+
}
|
263
|
+
}
|
264
|
+
},
|
265
|
+
"required": ["properties"]
|
266
|
+
},
|
267
|
+
"supported_sync_modes": ["full_refresh", "incremental"],
|
268
|
+
"source_defined_cursor": true,
|
269
|
+
"default_cursor_field": ["updated"]
|
270
|
+
},
|
271
|
+
{
|
272
|
+
"name": "line_items",
|
273
|
+
"action": "create",
|
274
|
+
"json_schema": {
|
275
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
276
|
+
"type": "object",
|
277
|
+
"properties": {
|
278
|
+
"properties": {
|
279
|
+
"type": "object",
|
280
|
+
"properties": {
|
281
|
+
"name": {
|
282
|
+
"type": "string"
|
283
|
+
},
|
284
|
+
"price": {
|
285
|
+
"type": "string",
|
286
|
+
"pattern": "^[0-9]+(\\.[0-9]{1,2})?$"
|
287
|
+
},
|
288
|
+
"quantity": {
|
289
|
+
"type": "string",
|
290
|
+
"pattern": "^[0-9]+$"
|
291
|
+
},
|
292
|
+
"hs_product_id": {
|
293
|
+
"type": "string",
|
294
|
+
"pattern": "^[0-9]+$"
|
295
|
+
},
|
296
|
+
"recurringbillingfrequency": {
|
297
|
+
"type": "string"
|
298
|
+
},
|
299
|
+
"hs_recurring_billing_period": {
|
300
|
+
"type": "string"
|
301
|
+
}
|
302
|
+
},
|
303
|
+
"required": ["name", "price"]
|
304
|
+
},
|
305
|
+
"associations": {
|
306
|
+
"type": "array",
|
307
|
+
"items": {
|
308
|
+
"type": "object",
|
309
|
+
"properties": {
|
310
|
+
"to": {
|
311
|
+
"type": "object",
|
312
|
+
"properties": {
|
313
|
+
"id": {
|
314
|
+
"type": "integer"
|
315
|
+
}
|
316
|
+
},
|
317
|
+
"required": ["id"]
|
318
|
+
},
|
319
|
+
"types": {
|
320
|
+
"type": "array",
|
321
|
+
"items": {
|
322
|
+
"type": "object",
|
323
|
+
"properties": {
|
324
|
+
"associationCategory": {
|
325
|
+
"type": "string",
|
326
|
+
"enum": [
|
327
|
+
"HUBSPOT_DEFINED",
|
328
|
+
"USER_DEFINED",
|
329
|
+
"INTEGRATOR_DEFINED"
|
330
|
+
]
|
331
|
+
},
|
332
|
+
"associationTypeId": {
|
333
|
+
"type": "integer"
|
334
|
+
}
|
335
|
+
},
|
336
|
+
"required": ["associationCategory", "associationTypeId"]
|
337
|
+
}
|
338
|
+
}
|
339
|
+
},
|
340
|
+
"required": ["to", "types"]
|
341
|
+
}
|
342
|
+
}
|
343
|
+
},
|
344
|
+
"required": ["properties", "associations"]
|
345
|
+
},
|
346
|
+
"supported_sync_modes": ["full_refresh", "incremental"],
|
347
|
+
"source_defined_cursor": true,
|
348
|
+
"default_cursor_field": ["updated"]
|
349
|
+
}
|
350
|
+
]
|
351
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Hubspot",
|
4
|
+
"title": "HubSpot CRM",
|
5
|
+
"connector_type": "destination",
|
6
|
+
"category": "CRM",
|
7
|
+
"documentation_url": "https://docs.multiwoven.com/destinations/crm/hubspot",
|
8
|
+
"github_issue_label": "destination-hubspot-crm",
|
9
|
+
"icon": "icon.svg",
|
10
|
+
"license": "MIT",
|
11
|
+
"release_stage": "alpha",
|
12
|
+
"support_level": "community",
|
13
|
+
"tags": ["language:ruby", "multiwoven"]
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.multiwoven.com/destinations/crm/hubspot",
|
3
|
+
"stream_type": "static",
|
4
|
+
"connection_specification": {
|
5
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
6
|
+
"title": "HubSpot CRM",
|
7
|
+
"type": "object",
|
8
|
+
"required": ["access_token"],
|
9
|
+
"properties": {
|
10
|
+
"access_token": {
|
11
|
+
"type": "string",
|
12
|
+
"title": "Access Token",
|
13
|
+
"order": 0
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<circle cx="512" cy="512" r="512" style="fill:#ff7a59"/>
|
4
|
+
<path d="M623.8 624.94c-38.23 0-69.24-30.67-69.24-68.51s31-68.52 69.24-68.52 69.26 30.67 69.26 68.52-31 68.51-69.26 68.51m20.74-200.42v-61a46.83 46.83 0 0 0 27.33-42.29v-1.41c0-25.78-21.32-46.86-47.35-46.86h-1.43c-26 0-47.35 21.09-47.35 46.86v1.41a46.85 46.85 0 0 0 27.33 42.29v61a135.08 135.08 0 0 0-63.86 27.79l-169.1-130.17A52.49 52.49 0 0 0 372 309c0-29.21-23.89-52.92-53.4-53s-53.45 23.59-53.48 52.81 23.85 52.88 53.36 52.93a53.29 53.29 0 0 0 26.33-7.09l166.38 128.1a132.14 132.14 0 0 0 2.07 150.3l-50.62 50.1A43.42 43.42 0 1 0 450.1 768c24.24 0 43.9-19.46 43.9-43.45a42.24 42.24 0 0 0-2-12.42l50-49.52a135.28 135.28 0 0 0 81.8 27.47c74.61 0 135.06-59.83 135.06-133.65 0-66.82-49.62-122-114.33-131.91" style="fill:#ffffff;fill-rule:evenodd"/>
|
5
|
+
</svg>
|
@@ -2,13 +2,14 @@
|
|
2
2
|
|
3
3
|
module Multiwoven
|
4
4
|
module Integrations
|
5
|
-
VERSION = "0.1.
|
5
|
+
VERSION = "0.1.31"
|
6
6
|
|
7
7
|
ENABLED_SOURCES = %w[
|
8
8
|
Snowflake
|
9
9
|
Redshift
|
10
10
|
Bigquery
|
11
11
|
Postgresql
|
12
|
+
Databricks
|
12
13
|
].freeze
|
13
14
|
|
14
15
|
ENABLED_DESTINATIONS = %w[
|
@@ -16,6 +17,7 @@ module Multiwoven
|
|
16
17
|
SalesforceCrm
|
17
18
|
FacebookCustomAudience
|
18
19
|
Slack
|
20
|
+
Hubspot
|
19
21
|
].freeze
|
20
22
|
end
|
21
23
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Multiwoven::Integrations::Source
|
4
|
+
module Databricks
|
5
|
+
include Multiwoven::Integrations::Core
|
6
|
+
class Client < SourceConnector
|
7
|
+
def check_connection(connection_config)
|
8
|
+
connection_config = connection_config.with_indifferent_access
|
9
|
+
create_connection(connection_config)
|
10
|
+
ConnectionStatus.new(status: ConnectionStatusType["succeeded"]).to_multiwoven_message
|
11
|
+
rescue Sequel::DatabaseConnectionError => e
|
12
|
+
ConnectionStatus.new(status: ConnectionStatusType["failed"], message: e.message).to_multiwoven_message
|
13
|
+
end
|
14
|
+
|
15
|
+
def discover(connection_config)
|
16
|
+
connection_config = connection_config.with_indifferent_access
|
17
|
+
query = "SELECT table_name, column_name, data_type, is_nullable
|
18
|
+
FROM system.information_schema.columns
|
19
|
+
WHERE table_schema = \'#{connection_config[:schema]}\' AND table_catalog = \'#{connection_config[:catalog]}\'
|
20
|
+
ORDER BY table_name, ordinal_position;"
|
21
|
+
|
22
|
+
db = create_connection(connection_config)
|
23
|
+
|
24
|
+
records = []
|
25
|
+
db.fetch(query.gsub("\n", "")) do |row|
|
26
|
+
records << row
|
27
|
+
end
|
28
|
+
catalog = Catalog.new(streams: create_streams(records))
|
29
|
+
catalog.to_multiwoven_message
|
30
|
+
rescue StandardError => e
|
31
|
+
handle_exception(
|
32
|
+
"DATABRICKS:DISCOVER:EXCEPTION",
|
33
|
+
"error",
|
34
|
+
e
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def read(sync_config)
|
39
|
+
connection_config = sync_config.source.connection_specification
|
40
|
+
connection_config = connection_config.with_indifferent_access
|
41
|
+
query = sync_config.model.query
|
42
|
+
query = batched_query(query, sync_config.limit, sync_config.offset) unless sync_config.limit.nil? && sync_config.offset.nil?
|
43
|
+
|
44
|
+
db = create_connection(connection_config)
|
45
|
+
|
46
|
+
query(db, query)
|
47
|
+
rescue StandardError => e
|
48
|
+
handle_exception(
|
49
|
+
"DATABRICKS:READ:EXCEPTION",
|
50
|
+
"error",
|
51
|
+
e
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def query(connection, query)
|
58
|
+
records = []
|
59
|
+
connection.fetch(query) do |row|
|
60
|
+
records << RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
|
61
|
+
end
|
62
|
+
records
|
63
|
+
end
|
64
|
+
|
65
|
+
def create_connection(connection_config)
|
66
|
+
Sequel.odbc(drvconnect: generate_drvconnect(connection_config))
|
67
|
+
end
|
68
|
+
|
69
|
+
def generate_drvconnect(connection_config)
|
70
|
+
"Driver=#{DATABRICKS_DRIVER_PATH};
|
71
|
+
Host=#{connection_config[:host]};
|
72
|
+
PORT=#{connection_config[:port]};
|
73
|
+
SSL=1;
|
74
|
+
HTTPPath=#{connection_config[:http_path]};
|
75
|
+
PWD=#{connection_config[:access_token]};
|
76
|
+
UID=token;
|
77
|
+
ThriftTransport=2;AuthMech=3;
|
78
|
+
AllowSelfSignedServerCert=1;
|
79
|
+
CAIssuedCertNamesMismatch=1"
|
80
|
+
end
|
81
|
+
|
82
|
+
def create_streams(records)
|
83
|
+
group_by_table(records).map do |r|
|
84
|
+
Multiwoven::Integrations::Protocol::Stream.new(name: r[:tablename], action: StreamAction["fetch"], json_schema: convert_to_json_schema(r[:columns]))
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def group_by_table(records)
|
89
|
+
records.group_by { |entry| entry[:table_name] }.map do |table_name, columns|
|
90
|
+
{
|
91
|
+
tablename: table_name,
|
92
|
+
columns: columns.map { |column| { column_name: column[:column_name], type: column[:data_type], optional: column[:is_nullable] == "YES" } }
|
93
|
+
}
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Databricks",
|
4
|
+
"title": "Databricks",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "Data Warehouse",
|
7
|
+
"documentation_url": "https://docs.mutliwoven.com",
|
8
|
+
"github_issue_label": "source-databricks",
|
9
|
+
"icon": "icon.svg",
|
10
|
+
"license": "MIT",
|
11
|
+
"release_stage": "alpha",
|
12
|
+
"support_level": "community",
|
13
|
+
"tags": ["language:ruby", "multiwoven"]
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.multiwoven.com/integrations/sources/databricks",
|
3
|
+
"stream_type": "dynamic",
|
4
|
+
"connection_specification": {
|
5
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
6
|
+
"title": "Databricks",
|
7
|
+
"type": "object",
|
8
|
+
"required": ["host", "port", "database", "schema"],
|
9
|
+
"properties": {
|
10
|
+
"title": "",
|
11
|
+
"type": "object",
|
12
|
+
"required": ["host", "port", "access_token", "http_path", "catalog", "schema"],
|
13
|
+
"properties": {
|
14
|
+
"host": {
|
15
|
+
"title": "Server Hostname",
|
16
|
+
"description": "Server host name for the Databricks Cluster. It is different from the SQL Endpoint Cluster.",
|
17
|
+
"type": "string",
|
18
|
+
"examples": "abc-12345678-wxyz.cloud.databricks.com",
|
19
|
+
"order": 0
|
20
|
+
},
|
21
|
+
"port": {
|
22
|
+
"title": "Port",
|
23
|
+
"description": "",
|
24
|
+
"type": "string",
|
25
|
+
"default": "443",
|
26
|
+
"order": 1
|
27
|
+
},
|
28
|
+
"access_token": {
|
29
|
+
"title": "Personal Access Token",
|
30
|
+
"description": "",
|
31
|
+
"type": "string",
|
32
|
+
"multiwoven_secret": true,
|
33
|
+
"order": 2
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"http_path": {
|
37
|
+
"title": "HTTP Path",
|
38
|
+
"description": "",
|
39
|
+
"examples": "sql/protocolvx/o/1234567489/0000-1111111-abcd90",
|
40
|
+
"type": "string",
|
41
|
+
"order": 3
|
42
|
+
},
|
43
|
+
"catalog": {
|
44
|
+
"description": "The name of the catalog",
|
45
|
+
"default": "hive_metastore",
|
46
|
+
"type": "string",
|
47
|
+
"title": "Databricks catalog",
|
48
|
+
"order": 4
|
49
|
+
},
|
50
|
+
"schema": {
|
51
|
+
"description": " The default schema tables are written.",
|
52
|
+
"default": "default",
|
53
|
+
"type": "string",
|
54
|
+
"title": "Database schema",
|
55
|
+
"order": 5
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns:x="ns_extend;" xmlns:i="ns_ai;" xmlns:graph="ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 40.1 42" style="enable-background:new 0 0 40.1 42;" xml:space="preserve">
|
2
|
+
<style type="text/css">
|
3
|
+
.st0{fill:#FF3621;}
|
4
|
+
</style>
|
5
|
+
<metadata>
|
6
|
+
<sfw xmlns="ns_sfw;">
|
7
|
+
<slices>
|
8
|
+
</slices>
|
9
|
+
<sliceSourceBounds bottomLeftOrigin="true" height="42" width="40.1" x="-69.1" y="-10.5">
|
10
|
+
</sliceSourceBounds>
|
11
|
+
</sfw>
|
12
|
+
</metadata>
|
13
|
+
<g>
|
14
|
+
<path class="st0" d="M40.1,31.1v-7.4l-0.8-0.5L20.1,33.7l-18.2-10l0-4.3l18.2,9.9l20.1-10.9v-7.3l-0.8-0.5L20.1,21.2L2.6,11.6
|
15
|
+
L20.1,2l14.1,7.7l1.1-0.6V8.3L20.1,0L0,10.9V12L20.1,23l18.2-10v4.4l-18.2,10L0.8,16.8L0,17.3v7.4l20.1,10.9l18.2-9.9v4.3l-18.2,10
|
16
|
+
L0.8,29.5L0,30v1.1L20.1,42L40.1,31.1z">
|
17
|
+
</path>
|
18
|
+
</g>
|
19
|
+
</svg>
|
@@ -15,6 +15,7 @@ require "logger"
|
|
15
15
|
require "slack-ruby-client"
|
16
16
|
require "git"
|
17
17
|
require "ruby-limiter"
|
18
|
+
require "hubspot-api-client"
|
18
19
|
|
19
20
|
# Service
|
20
21
|
require_relative "integrations/config"
|
@@ -36,12 +37,14 @@ require_relative "integrations/source/snowflake/client"
|
|
36
37
|
require_relative "integrations/source/redshift/client"
|
37
38
|
require_relative "integrations/source/bigquery/client"
|
38
39
|
require_relative "integrations/source/postgresql/client"
|
40
|
+
require_relative "integrations/source/databricks/client"
|
39
41
|
|
40
42
|
# Destination
|
41
43
|
require_relative "integrations/destination/klaviyo/client"
|
42
44
|
require_relative "integrations/destination/salesforce_crm/client"
|
43
45
|
require_relative "integrations/destination/facebook_custom_audience/client"
|
44
46
|
require_relative "integrations/destination/slack/client"
|
47
|
+
require_relative "integrations/destination/hubspot/client"
|
45
48
|
|
46
49
|
module Multiwoven
|
47
50
|
module Integrations
|
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.1.
|
4
|
+
version: 0.1.31
|
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
|
+
date: 2024-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: hubspot-api-client
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: pg
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -321,6 +335,11 @@ files:
|
|
321
335
|
- lib/multiwoven/integrations/destination/facebook_custom_audience/config/meta.json
|
322
336
|
- lib/multiwoven/integrations/destination/facebook_custom_audience/config/spec.json
|
323
337
|
- lib/multiwoven/integrations/destination/facebook_custom_audience/icon.svg
|
338
|
+
- lib/multiwoven/integrations/destination/hubspot/client.rb
|
339
|
+
- lib/multiwoven/integrations/destination/hubspot/config/catalog.json
|
340
|
+
- lib/multiwoven/integrations/destination/hubspot/config/meta.json
|
341
|
+
- lib/multiwoven/integrations/destination/hubspot/config/spec.json
|
342
|
+
- lib/multiwoven/integrations/destination/hubspot/icon.svg
|
324
343
|
- lib/multiwoven/integrations/destination/klaviyo/client.rb
|
325
344
|
- lib/multiwoven/integrations/destination/klaviyo/config/catalog.json
|
326
345
|
- lib/multiwoven/integrations/destination/klaviyo/config/meta.json
|
@@ -344,6 +363,10 @@ files:
|
|
344
363
|
- lib/multiwoven/integrations/source/bigquery/config/meta.json
|
345
364
|
- lib/multiwoven/integrations/source/bigquery/config/spec.json
|
346
365
|
- lib/multiwoven/integrations/source/bigquery/icon.svg
|
366
|
+
- lib/multiwoven/integrations/source/databricks/client.rb
|
367
|
+
- lib/multiwoven/integrations/source/databricks/config/meta.json
|
368
|
+
- lib/multiwoven/integrations/source/databricks/config/spec.json
|
369
|
+
- lib/multiwoven/integrations/source/databricks/icon.svg
|
347
370
|
- lib/multiwoven/integrations/source/postgresql/client.rb
|
348
371
|
- lib/multiwoven/integrations/source/postgresql/config/meta.json
|
349
372
|
- lib/multiwoven/integrations/source/postgresql/config/spec.json
|