multiwoven-integrations 0.1.35 → 0.1.37
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/destination_connector.rb +0 -2
- data/lib/multiwoven/integrations/core/fullrefresher.rb +19 -0
- data/lib/multiwoven/integrations/destination/airtable/client.rb +1 -0
- data/lib/multiwoven/integrations/destination/facebook_custom_audience/client.rb +1 -0
- data/lib/multiwoven/integrations/destination/facebook_custom_audience/config/catalog.json +1 -1
- data/lib/multiwoven/integrations/destination/google_sheets/client.rb +51 -3
- data/lib/multiwoven/integrations/destination/hubspot/client.rb +1 -0
- data/lib/multiwoven/integrations/destination/klaviyo/client.rb +1 -0
- data/lib/multiwoven/integrations/destination/klaviyo/config/catalog.json +96 -117
- data/lib/multiwoven/integrations/destination/salesforce_crm/client.rb +1 -0
- data/lib/multiwoven/integrations/destination/slack/client.rb +1 -0
- data/lib/multiwoven/integrations/destination/stripe/client.rb +82 -0
- data/lib/multiwoven/integrations/destination/stripe/config/catalog.json +128 -0
- data/lib/multiwoven/integrations/destination/stripe/config/meta.json +15 -0
- data/lib/multiwoven/integrations/destination/stripe/config/spec.json +17 -0
- data/lib/multiwoven/integrations/destination/stripe/icon.svg +10 -0
- data/lib/multiwoven/integrations/protocol/protocol.rb +2 -1
- data/lib/multiwoven/integrations/rollout.rb +2 -1
- data/lib/multiwoven/integrations.rb +3 -0
- metadata +36 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13fe187a421657cfb45280d87ae9fdd88dfb57b684290aba50869fc73bbd19c2
|
4
|
+
data.tar.gz: 8d08feb79f2798e6955c482af4ec2ecaccc35ff723d60191c6efcfc85f173972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b828ceef6251ca0859da2c5fe74e763c2a3f366cd461839456b74d4791eec94e482d7cfa1673ff76511f3e48dc8e7d09a0b216ff2f8a47585ff69cb628745a96
|
7
|
+
data.tar.gz: 639488c9e265492f3e98b69cfd5010998c569a99c70bb11f2cbfbed92499f7b4c2eacf4f2febe0698cafebc6d039f3e18834eb6e8d010ff137f9603ac060ce6e
|
@@ -3,8 +3,6 @@
|
|
3
3
|
module Multiwoven
|
4
4
|
module Integrations::Core
|
5
5
|
class DestinationConnector < BaseConnector
|
6
|
-
prepend RateLimiter
|
7
|
-
|
8
6
|
# Records are transformed json payload send it to the destination
|
9
7
|
# SyncConfig is the Protocol::SyncConfig object
|
10
8
|
def write(_sync_config, _records, _action = "insert")
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Multiwoven
|
4
|
+
module Integrations::Core
|
5
|
+
module Fullrefresher
|
6
|
+
def write(sync_config, records, action = "insert")
|
7
|
+
if sync_config && sync_config.sync_mode == "full_refresh" && !@full_refreshed
|
8
|
+
response = clear_all_records(sync_config)
|
9
|
+
return response unless response &&
|
10
|
+
response.control.status == Multiwoven::Integrations::Protocol::ConnectionStatusType["succeeded"]
|
11
|
+
|
12
|
+
@full_refreshed = true
|
13
|
+
end
|
14
|
+
|
15
|
+
super(sync_config, records, action)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -7,6 +7,7 @@ module Multiwoven
|
|
7
7
|
module Airtable
|
8
8
|
include Multiwoven::Integrations::Core
|
9
9
|
class Client < DestinationConnector # rubocop:disable Metrics/ClassLength
|
10
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
10
11
|
MAX_CHUNK_SIZE = 10
|
11
12
|
def check_connection(connection_config)
|
12
13
|
connection_config = connection_config.with_indifferent_access
|
@@ -4,6 +4,7 @@ module Multiwoven::Integrations::Destination
|
|
4
4
|
module FacebookCustomAudience
|
5
5
|
include Multiwoven::Integrations::Core
|
6
6
|
class Client < DestinationConnector # rubocop:disable Metrics/ClassLength
|
7
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
7
8
|
MAX_CHUNK_SIZE = 10_000
|
8
9
|
def check_connection(connection_config)
|
9
10
|
connection_config = connection_config.with_indifferent_access
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"PAGEUID": { "type": ["string", "null"], "default": null, "title": "Page-Scoped ID", "x-hashRequired": false }
|
34
34
|
}
|
35
35
|
},
|
36
|
-
"supported_sync_modes": ["
|
36
|
+
"supported_sync_modes": ["incremental"],
|
37
37
|
"source_defined_cursor": true,
|
38
38
|
"default_cursor_field": ["updated"],
|
39
39
|
"source_defined_primary_key": [["email"]]
|
@@ -7,9 +7,12 @@ module Multiwoven
|
|
7
7
|
include Multiwoven::Integrations::Core
|
8
8
|
|
9
9
|
class Client < DestinationConnector # rubocop:disable Metrics/ClassLength
|
10
|
+
prepend Multiwoven::Integrations::Core::Fullrefresher
|
11
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
10
12
|
MAX_CHUNK_SIZE = 10_000
|
11
13
|
|
12
14
|
def check_connection(connection_config)
|
15
|
+
connection_config = connection_config.with_indifferent_access
|
13
16
|
authorize_client(connection_config)
|
14
17
|
fetch_google_spread_sheets(connection_config)
|
15
18
|
success_status
|
@@ -19,6 +22,7 @@ module Multiwoven
|
|
19
22
|
end
|
20
23
|
|
21
24
|
def discover(connection_config)
|
25
|
+
connection_config = connection_config.with_indifferent_access
|
22
26
|
authorize_client(connection_config)
|
23
27
|
spreadsheets = fetch_google_spread_sheets(connection_config)
|
24
28
|
catalog = build_catalog_from_spreadsheets(spreadsheets, connection_config)
|
@@ -34,6 +38,24 @@ module Multiwoven
|
|
34
38
|
handle_exception("GOOGLE_SHEETS:CRM:WRITE:EXCEPTION", "error", e)
|
35
39
|
end
|
36
40
|
|
41
|
+
def clear_all_records(sync_config)
|
42
|
+
setup_write_environment(sync_config, "clear")
|
43
|
+
connection_specification = sync_config.destination.connection_specification.with_indifferent_access
|
44
|
+
spreadsheet = fetch_google_spread_sheets(connection_specification)
|
45
|
+
sheet_ids = spreadsheet.sheets.map(&:properties).map(&:sheet_id)
|
46
|
+
|
47
|
+
delete_extra_sheets(sheet_ids)
|
48
|
+
|
49
|
+
unless sheet_ids.empty?
|
50
|
+
clear_response = clear_sheet_data(spreadsheet.sheets.first.properties.title)
|
51
|
+
return control_message("Successfully cleared data.", "succeeded") if clear_response&.cleared_range
|
52
|
+
end
|
53
|
+
|
54
|
+
control_message("Failed to clear data.", "failed")
|
55
|
+
rescue StandardError => e
|
56
|
+
control_message(e.message, "failed")
|
57
|
+
end
|
58
|
+
|
37
59
|
private
|
38
60
|
|
39
61
|
# To define the level of access granted to your app, you need to identify and declare authorization scopes which is provided by google scopse https://developers.google.com/sheets/api/scopes
|
@@ -99,7 +121,7 @@ module Multiwoven
|
|
99
121
|
batch_support: true,
|
100
122
|
batch_size: 10_000,
|
101
123
|
json_schema: generate_properties_schema(column_names),
|
102
|
-
supported_sync_modes: %w[incremental]
|
124
|
+
supported_sync_modes: %w[incremental full_refresh]
|
103
125
|
}.with_indifferent_access
|
104
126
|
end
|
105
127
|
|
@@ -113,8 +135,9 @@ module Multiwoven
|
|
113
135
|
|
114
136
|
def setup_write_environment(sync_config, action)
|
115
137
|
@action = sync_config.stream.action || action
|
116
|
-
|
117
|
-
|
138
|
+
connection_specification = sync_config.destination.connection_specification.with_indifferent_access
|
139
|
+
@spreadsheet_id = extract_spreadsheet_id(connection_specification[:spreadsheet_link])
|
140
|
+
authorize_client(connection_specification)
|
118
141
|
end
|
119
142
|
|
120
143
|
def extract_spreadsheet_id(link)
|
@@ -176,6 +199,31 @@ module Multiwoven
|
|
176
199
|
success: success, failed: failure
|
177
200
|
).to_multiwoven_message
|
178
201
|
end
|
202
|
+
|
203
|
+
def delete_extra_sheets(sheet_ids)
|
204
|
+
# Leave one sheet intact as a spreadsheet must have at least one sheet.
|
205
|
+
# Delete all other sheets.
|
206
|
+
(sheet_ids.length - 1).times do |i|
|
207
|
+
request = Google::Apis::SheetsV4::BatchUpdateSpreadsheetRequest.new(
|
208
|
+
requests: [{ delete_sheet: { sheet_id: sheet_ids[i + 1] } }]
|
209
|
+
)
|
210
|
+
@client.batch_update_spreadsheet(@spreadsheet_id, request)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def clear_sheet_data(sheet_title)
|
215
|
+
clear_request = Google::Apis::SheetsV4::ClearValuesRequest.new
|
216
|
+
@client&.clear_values(@spreadsheet_id, "#{sheet_title}!A2:Z", clear_request)
|
217
|
+
end
|
218
|
+
|
219
|
+
def control_message(message, status)
|
220
|
+
ControlMessage.new(
|
221
|
+
type: "full_refresh",
|
222
|
+
emitted_at: Time.now.to_i,
|
223
|
+
status: ConnectionStatusType[status],
|
224
|
+
meta: { detail: message }
|
225
|
+
).to_multiwoven_message
|
226
|
+
end
|
179
227
|
end
|
180
228
|
end
|
181
229
|
end
|
@@ -9,6 +9,7 @@ module Multiwoven
|
|
9
9
|
include Multiwoven::Integrations::Core
|
10
10
|
|
11
11
|
class Client < DestinationConnector
|
12
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
12
13
|
def check_connection(connection_config)
|
13
14
|
connection_config = connection_config.with_indifferent_access
|
14
15
|
initialize_client(connection_config)
|
@@ -4,6 +4,7 @@ module Multiwoven::Integrations::Destination
|
|
4
4
|
module Klaviyo
|
5
5
|
include Multiwoven::Integrations::Core
|
6
6
|
class Client < DestinationConnector
|
7
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
7
8
|
def check_connection(connection_config)
|
8
9
|
connection_config = connection_config.with_indifferent_access
|
9
10
|
api_key = connection_config[:private_api_key]
|
@@ -1,124 +1,103 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"
|
25
|
-
"
|
26
|
-
|
27
|
-
"
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
"
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
"location": {
|
55
|
-
"type": "object",
|
56
|
-
"properties": {
|
57
|
-
"address1": {
|
58
|
-
"type": "string"
|
59
|
-
},
|
60
|
-
"address2": {
|
61
|
-
"type": "string"
|
62
|
-
},
|
63
|
-
"city": {
|
64
|
-
"type": "string"
|
65
|
-
},
|
66
|
-
"country": {
|
67
|
-
"type": "string"
|
68
|
-
},
|
69
|
-
"region": {
|
70
|
-
"type": "string"
|
71
|
-
},
|
72
|
-
"zip": {
|
73
|
-
"type": "string"
|
74
|
-
},
|
75
|
-
"timezone": {
|
76
|
-
"type": "string"
|
77
|
-
},
|
78
|
-
"ip": {
|
79
|
-
"type": "string",
|
80
|
-
"format": "ipv4"
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
|
-
},
|
2
|
+
"request_rate_limit": 600,
|
3
|
+
"request_rate_limit_unit": "minute",
|
4
|
+
"request_rate_concurrency": 10,
|
5
|
+
"streams": [
|
6
|
+
{
|
7
|
+
"name": "profile",
|
8
|
+
"action": "create",
|
9
|
+
"url": "https://a.klaviyo.com/api/profiles",
|
10
|
+
"method": "POST",
|
11
|
+
"json_schema": {
|
12
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
13
|
+
"type": "object",
|
14
|
+
"properties": {
|
15
|
+
"data": {
|
16
|
+
"type": "object",
|
17
|
+
"properties": {
|
18
|
+
"type": {
|
19
|
+
"type": "string",
|
20
|
+
"enum": ["profile"]
|
21
|
+
},
|
22
|
+
"attributes": {
|
23
|
+
"type": "object",
|
24
|
+
"properties": {
|
25
|
+
"email": {
|
26
|
+
"type": "string",
|
27
|
+
"format": "email"
|
28
|
+
},
|
29
|
+
"phone_number": {
|
30
|
+
"type": "string"
|
31
|
+
},
|
32
|
+
"external_id": {
|
33
|
+
"type": "string",
|
34
|
+
"format": "uuid"
|
35
|
+
},
|
36
|
+
"first_name": {
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"last_name": {
|
40
|
+
"type": "string"
|
41
|
+
},
|
42
|
+
"organization": {
|
43
|
+
"type": "string"
|
44
|
+
},
|
45
|
+
"title": {
|
46
|
+
"type": "string"
|
47
|
+
},
|
48
|
+
"image": {
|
49
|
+
"type": "string",
|
50
|
+
"format": "uri"
|
51
|
+
},
|
52
|
+
"location": {
|
53
|
+
"type": "object",
|
85
54
|
"properties": {
|
86
|
-
"
|
87
|
-
|
55
|
+
"address1": {
|
56
|
+
"type": "string"
|
57
|
+
},
|
58
|
+
"address2": {
|
59
|
+
"type": "string"
|
60
|
+
},
|
61
|
+
"city": {
|
62
|
+
"type": "string"
|
63
|
+
},
|
64
|
+
"country": {
|
65
|
+
"type": "string"
|
66
|
+
},
|
67
|
+
"region": {
|
88
68
|
"type": "string"
|
69
|
+
},
|
70
|
+
"zip": {
|
71
|
+
"type": "string"
|
72
|
+
},
|
73
|
+
"timezone": {
|
74
|
+
"type": "string"
|
75
|
+
},
|
76
|
+
"ip": {
|
77
|
+
"type": "string",
|
78
|
+
"format": "ipv4"
|
89
79
|
}
|
90
80
|
}
|
91
81
|
},
|
92
|
-
"
|
93
|
-
"
|
94
|
-
"
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
"
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
}
|
104
|
-
"required": [
|
105
|
-
"data"
|
106
|
-
]
|
82
|
+
"properties": {
|
83
|
+
"type": "object",
|
84
|
+
"additionalProperties": {
|
85
|
+
"type": "string"
|
86
|
+
}
|
87
|
+
}
|
88
|
+
},
|
89
|
+
"required": ["email", "phone_number"]
|
90
|
+
}
|
91
|
+
},
|
92
|
+
"required": ["type", "attributes"]
|
93
|
+
}
|
107
94
|
},
|
108
|
-
"
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
"id",
|
118
|
-
"email"
|
119
|
-
]
|
120
|
-
]
|
121
|
-
|
122
|
-
}
|
123
|
-
]
|
124
|
-
}
|
95
|
+
"required": ["data"]
|
96
|
+
},
|
97
|
+
"supported_sync_modes": ["incremental"],
|
98
|
+
"source_defined_cursor": true,
|
99
|
+
"default_cursor_field": ["updated"],
|
100
|
+
"source_defined_primary_key": [["id", "email"]]
|
101
|
+
}
|
102
|
+
]
|
103
|
+
}
|
@@ -11,6 +11,7 @@ module Multiwoven
|
|
11
11
|
API_VERSION = "59.0"
|
12
12
|
|
13
13
|
class Client < DestinationConnector
|
14
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
14
15
|
def check_connection(connection_config)
|
15
16
|
connection_config = connection_config.with_indifferent_access
|
16
17
|
initialize_client(connection_config)
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Multiwoven
|
4
|
+
module Integrations
|
5
|
+
module Destination
|
6
|
+
module Stripe
|
7
|
+
include Multiwoven::Integrations::Core
|
8
|
+
|
9
|
+
API_VERSION = "59.0"
|
10
|
+
|
11
|
+
class Client < DestinationConnector
|
12
|
+
prepend Multiwoven::Integrations::Core::RateLimiter
|
13
|
+
def check_connection(connection_config)
|
14
|
+
connection_config = connection_config.with_indifferent_access
|
15
|
+
initialize_client(connection_config)
|
16
|
+
authenticate_client
|
17
|
+
success_status
|
18
|
+
rescue StandardError => 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("STRIPE: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("STRIPE:CRM:WRITE:EXCEPTION", "error", e)
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def initialize_client(config)
|
40
|
+
config = config.with_indifferent_access
|
41
|
+
::Stripe.api_key = config[:api_key]
|
42
|
+
@client = ::Stripe
|
43
|
+
end
|
44
|
+
|
45
|
+
def process_records(records, stream)
|
46
|
+
write_success = 0
|
47
|
+
write_failure = 0
|
48
|
+
properties = stream.json_schema[:properties]
|
49
|
+
records.each do |record_object|
|
50
|
+
record = extract_data(record_object, properties)
|
51
|
+
klass = @client.const_get(stream.name)
|
52
|
+
klass.send(@action, record)
|
53
|
+
write_success += 1
|
54
|
+
rescue StandardError => e
|
55
|
+
handle_exception("STRIPE:CRM:WRITE:EXCEPTION", "error", e)
|
56
|
+
write_failure += 1
|
57
|
+
end
|
58
|
+
tracking_message(write_success, write_failure)
|
59
|
+
end
|
60
|
+
|
61
|
+
def authenticate_client
|
62
|
+
@client::Customer.list
|
63
|
+
end
|
64
|
+
|
65
|
+
def load_catalog
|
66
|
+
read_json(CATALOG_SPEC_PATH)
|
67
|
+
end
|
68
|
+
|
69
|
+
def tracking_message(success, failure)
|
70
|
+
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
71
|
+
success: success, failed: failure
|
72
|
+
).to_multiwoven_message
|
73
|
+
end
|
74
|
+
|
75
|
+
def log_debug(message)
|
76
|
+
Multiwoven::Integrations::Service.logger.debug(message)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
{
|
2
|
+
"request_rate_limit": 100000,
|
3
|
+
"request_rate_limit_unit": "day",
|
4
|
+
"request_rate_concurrency": 10,
|
5
|
+
"streams": [
|
6
|
+
{
|
7
|
+
"name": "Customer",
|
8
|
+
"action": "create",
|
9
|
+
"json_schema": {
|
10
|
+
"type": "object",
|
11
|
+
"additionalProperties": true,
|
12
|
+
"properties": {
|
13
|
+
"email": {
|
14
|
+
"type": "string"
|
15
|
+
},
|
16
|
+
"description": {
|
17
|
+
"type": "string"
|
18
|
+
},
|
19
|
+
"name": {
|
20
|
+
"type": "string"
|
21
|
+
},
|
22
|
+
"payment_method": {
|
23
|
+
"type": "string"
|
24
|
+
},
|
25
|
+
"metadata": {
|
26
|
+
"type": "object"
|
27
|
+
},
|
28
|
+
"phone": {
|
29
|
+
"type": "string"
|
30
|
+
},
|
31
|
+
"address": {
|
32
|
+
"type": "object",
|
33
|
+
"additionalProperties": true,
|
34
|
+
"properties": {
|
35
|
+
"city": {
|
36
|
+
"type": "string"
|
37
|
+
},
|
38
|
+
"country": {
|
39
|
+
"type": "string"
|
40
|
+
},
|
41
|
+
"line1": {
|
42
|
+
"type": "string"
|
43
|
+
},
|
44
|
+
"line2": {
|
45
|
+
"type": "string"
|
46
|
+
},
|
47
|
+
"postal_code": {
|
48
|
+
"type": "string"
|
49
|
+
},
|
50
|
+
"state": {
|
51
|
+
"type": "string"
|
52
|
+
}
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"shipping": {
|
56
|
+
"type": "object",
|
57
|
+
"additionalProperties": true,
|
58
|
+
"properties": {
|
59
|
+
"address": {
|
60
|
+
"type": "object",
|
61
|
+
"additionalProperties": true,
|
62
|
+
"properties": {
|
63
|
+
"city": {
|
64
|
+
"type": "string"
|
65
|
+
},
|
66
|
+
"country": {
|
67
|
+
"type": "string"
|
68
|
+
},
|
69
|
+
"line1": {
|
70
|
+
"type": "string"
|
71
|
+
},
|
72
|
+
"line2": {
|
73
|
+
"type": "string"
|
74
|
+
},
|
75
|
+
"postal_code": {
|
76
|
+
"type": "string"
|
77
|
+
},
|
78
|
+
"state": {
|
79
|
+
"type": "string"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
"name": {
|
84
|
+
"type": "string"
|
85
|
+
},
|
86
|
+
"phone": {
|
87
|
+
"type": "string"
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
},
|
93
|
+
"supported_sync_modes": ["incremental"],
|
94
|
+
"source_defined_cursor": true,
|
95
|
+
"default_cursor_field": ["updated"],
|
96
|
+
"source_defined_primary_key": [["Id"]]
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"name": "Product",
|
100
|
+
"action": "create",
|
101
|
+
"json_schema": {
|
102
|
+
"type": "object",
|
103
|
+
"additionalProperties": true,
|
104
|
+
"required": ["name"],
|
105
|
+
"properties": {
|
106
|
+
"name": {
|
107
|
+
"type": "string"
|
108
|
+
},
|
109
|
+
"description": {
|
110
|
+
"type": "string"
|
111
|
+
},
|
112
|
+
"active": {
|
113
|
+
"type": "boolean"
|
114
|
+
},
|
115
|
+
"id": {
|
116
|
+
"type": "string"
|
117
|
+
},
|
118
|
+
"metadata": {
|
119
|
+
"type": "object"
|
120
|
+
}
|
121
|
+
}
|
122
|
+
},
|
123
|
+
"supported_sync_modes": ["incremental"],
|
124
|
+
"source_defined_cursor": true,
|
125
|
+
"default_cursor_field": ["updated"]
|
126
|
+
}
|
127
|
+
]
|
128
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Stripe",
|
4
|
+
"title": "Stripe",
|
5
|
+
"connector_type": "destination",
|
6
|
+
"category": "Payments",
|
7
|
+
"documentation_url": "https://docs.mutliwoven.com",
|
8
|
+
"github_issue_label": "destination-stripe",
|
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/integrations/destination/payments/stripe",
|
3
|
+
"stream_type": "static",
|
4
|
+
"connection_specification": {
|
5
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
6
|
+
"title": "Stripe",
|
7
|
+
"type": "object",
|
8
|
+
"required": ["api_key"],
|
9
|
+
"properties": {
|
10
|
+
"api_key": {
|
11
|
+
"type": "string",
|
12
|
+
"title": "API Key",
|
13
|
+
"order": 0
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28.87 28.87" id="stripe">
|
2
|
+
<g data-name="Layer 2">
|
3
|
+
<g data-name="Layer 1">
|
4
|
+
<rect width="28.87" height="28.87" fill="#6772e5" rx="6.48" ry="6.48"></rect>
|
5
|
+
<path fill="#fff" fill-rule="evenodd"
|
6
|
+
d="M13.3 11.2c0-.69.57-1 1.49-1a9.84 9.84 0 0 1 4.37 1.13V7.24a11.6 11.6 0 0 0-4.36-.8c-3.56 0-5.94 1.86-5.94 5 0 4.86 6.68 4.07 6.68 6.17 0 .81-.71 1.07-1.68 1.07A11.06 11.06 0 0 1 9 17.25v4.19a12.19 12.19 0 0 0 4.8 1c3.65 0 6.17-1.8 6.17-5 .03-5.21-6.67-4.27-6.67-6.24z">
|
7
|
+
</path>
|
8
|
+
</g>
|
9
|
+
</g>
|
10
|
+
</svg>
|
@@ -20,7 +20,7 @@ module Multiwoven
|
|
20
20
|
"tracking"
|
21
21
|
)
|
22
22
|
ControlMessageType = Types::String.enum(
|
23
|
-
"rate_limit", "connection_config"
|
23
|
+
"rate_limit", "connection_config", "full_refresh"
|
24
24
|
)
|
25
25
|
LogLevel = Types::String.enum("fatal", "error", "warn", "info", "debug", "trace")
|
26
26
|
RequestRateLimitingUnit = Types::String.default("minute").enum("minute", "hour", "day")
|
@@ -170,6 +170,7 @@ module Multiwoven
|
|
170
170
|
class ControlMessage < ProtocolModel
|
171
171
|
attribute :type, ControlMessageType
|
172
172
|
attribute :emitted_at, Types::Integer
|
173
|
+
attribute? :status, ConnectionStatusType.optional
|
173
174
|
attribute? :meta, Types::Hash
|
174
175
|
|
175
176
|
def to_multiwoven_message
|
@@ -18,6 +18,7 @@ require "ruby-limiter"
|
|
18
18
|
require "hubspot-api-client"
|
19
19
|
require "google/apis/sheets_v4"
|
20
20
|
require "stringio"
|
21
|
+
require "stripe"
|
21
22
|
|
22
23
|
# Service
|
23
24
|
require_relative "integrations/config"
|
@@ -28,6 +29,7 @@ require_relative "integrations/service"
|
|
28
29
|
require_relative "integrations/core/constants"
|
29
30
|
require_relative "integrations/core/utils"
|
30
31
|
require_relative "integrations/core/rate_limiter"
|
32
|
+
require_relative "integrations/core/fullrefresher"
|
31
33
|
require_relative "integrations/protocol/protocol"
|
32
34
|
require_relative "integrations/core/base_connector"
|
33
35
|
require_relative "integrations/core/source_connector"
|
@@ -49,6 +51,7 @@ require_relative "integrations/destination/slack/client"
|
|
49
51
|
require_relative "integrations/destination/hubspot/client"
|
50
52
|
require_relative "integrations/destination/google_sheets/client"
|
51
53
|
require_relative "integrations/destination/airtable/client"
|
54
|
+
require_relative "integrations/destination/stripe/client"
|
52
55
|
|
53
56
|
module Multiwoven
|
54
57
|
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.37
|
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-03-
|
11
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: google-apis-sheets_v4
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: google-cloud-bigquery
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,6 +234,20 @@ dependencies:
|
|
220
234
|
- - ">="
|
221
235
|
- !ruby/object:Gem::Version
|
222
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: stripe
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :runtime
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
223
251
|
- !ruby/object:Gem::Dependency
|
224
252
|
name: byebug
|
225
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -326,6 +354,7 @@ files:
|
|
326
354
|
- lib/multiwoven/integrations/core/base_connector.rb
|
327
355
|
- lib/multiwoven/integrations/core/constants.rb
|
328
356
|
- lib/multiwoven/integrations/core/destination_connector.rb
|
357
|
+
- lib/multiwoven/integrations/core/fullrefresher.rb
|
329
358
|
- lib/multiwoven/integrations/core/http_client.rb
|
330
359
|
- lib/multiwoven/integrations/core/rate_limiter.rb
|
331
360
|
- lib/multiwoven/integrations/core/source_connector.rb
|
@@ -366,6 +395,11 @@ files:
|
|
366
395
|
- lib/multiwoven/integrations/destination/slack/config/meta.json
|
367
396
|
- lib/multiwoven/integrations/destination/slack/config/spec.json
|
368
397
|
- lib/multiwoven/integrations/destination/slack/icon.svg
|
398
|
+
- lib/multiwoven/integrations/destination/stripe/client.rb
|
399
|
+
- lib/multiwoven/integrations/destination/stripe/config/catalog.json
|
400
|
+
- lib/multiwoven/integrations/destination/stripe/config/meta.json
|
401
|
+
- lib/multiwoven/integrations/destination/stripe/config/spec.json
|
402
|
+
- lib/multiwoven/integrations/destination/stripe/icon.svg
|
369
403
|
- lib/multiwoven/integrations/protocol/protocol.json
|
370
404
|
- lib/multiwoven/integrations/protocol/protocol.rb
|
371
405
|
- lib/multiwoven/integrations/rollout.rb
|