multiwoven-integrations 0.11.6 → 0.13.0

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: 0cb0d4182e8be51150d2fd84111f0815d68fa7582cdd29b8f4a03cb24befa668
4
- data.tar.gz: c2a79e6a6b172723cc4620ea029677490adeca529508bbdd45d058057c630856
3
+ metadata.gz: 1fced6e2ecbd8a74254326095629b4cdf9bac01e7699a0a02ecfccaf1e99f793
4
+ data.tar.gz: '039e2e673483c43b17af52f632a79307f3befea691f4086ad827e74ca998af99'
5
5
  SHA512:
6
- metadata.gz: b95df3f3c22521d8c682268a57d0bfe30a4a6d42106b6179de77f376df4f09aafb5cc1a3314cf50d2fd7b9f87a7ce7dfeb76d941a59c6157f2dc3e21167760a1
7
- data.tar.gz: 2b6af2a30fac74a3582bada5cb74377e456ded173dff215699802a31b86016b8f917e7ea24752b61d92e87b465d3f6a70e747a53abaf9750accb951f712d4276
6
+ metadata.gz: b9d9931adef3d6ce8df577e980909a5ce3a60f5ec7fff6369cdab22537896902b4c52d88e77427ed36ba3e2ac5568ab00c9058403c8ae98487779dd38a656f2f
7
+ data.tar.gz: 5be61f87b72c70d497497ef6412e90109640ae9cbc46fb18ab8a50118e86df26731309128d0a16b511a1264704a3bdabc2613334481e1e4b5a852a4feb4cb39f
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Multiwoven
4
+ module Integrations
5
+ module Destination
6
+ module Mailchimp
7
+ include Multiwoven::Integrations::Core
8
+
9
+ API_VERSION = "3.0"
10
+
11
+ class Client < DestinationConnector
12
+ prepend Multiwoven::Integrations::Core::RateLimiter
13
+
14
+ def check_connection(connection_config)
15
+ connection_config = connection_config.with_indifferent_access
16
+ initialize_client(connection_config)
17
+ authenticate_client
18
+ success_status
19
+ rescue StandardError => e
20
+ failure_status(e)
21
+ end
22
+
23
+ def discover(_connection_config = nil)
24
+ catalog = build_catalog(load_catalog)
25
+ catalog.to_multiwoven_message
26
+ rescue StandardError => e
27
+ handle_exception(e, {
28
+ context: "MAILCHIMP:DISCOVER:EXCEPTION",
29
+ type: "error"
30
+ })
31
+ end
32
+
33
+ def write(sync_config, records, _action = "create")
34
+ @sync_config = sync_config
35
+ initialize_client(sync_config.destination.connection_specification)
36
+ process_records(records, sync_config.stream)
37
+ rescue StandardError => e
38
+ handle_exception(e, {
39
+ context: "MAILCHIMP:WRITE:EXCEPTION",
40
+ type: "error",
41
+ sync_id: @sync_config.sync_id,
42
+ sync_run_id: @sync_config.sync_run_id
43
+ })
44
+ end
45
+
46
+ private
47
+
48
+ def initialize_client(config)
49
+ config = config.with_indifferent_access
50
+ @client = MailchimpMarketing::Client.new
51
+ @client.set_config({
52
+ api_key: config[:api_key],
53
+ server: config[:api_key].split("-").last
54
+ })
55
+ @list_id = config[:list_id]
56
+ @email_template_id = config[:email_template_id] || ""
57
+ end
58
+
59
+ def process_records(records, stream)
60
+ log_message_array = []
61
+ write_success = 0
62
+ write_failure = 0
63
+ properties = stream.json_schema[:properties]
64
+
65
+ records.each do |record_object|
66
+ record = extract_data(record_object, properties)
67
+ args = [stream.name, "Id", record]
68
+ begin
69
+ response = send_to_mailchimp(record, stream.name)
70
+ write_success += 1
71
+ log_message_array << log_request_response("info", args, response)
72
+ rescue StandardError => e
73
+ handle_exception(e, {
74
+ context: "MAILCHIMP:WRITE:EXCEPTION",
75
+ type: "error",
76
+ sync_id: @sync_config.sync_id,
77
+ sync_run_id: @sync_config.sync_run_id
78
+ })
79
+ write_failure += 1
80
+ log_message_array << log_request_response("error", args, e.message)
81
+ end
82
+ end
83
+ tracking_message(write_success, write_failure, log_message_array)
84
+ end
85
+
86
+ def send_to_mailchimp(record, stream_name)
87
+ case stream_name
88
+ when "Audience"
89
+ @client.lists.set_list_member(@list_id, Digest::MD5.hexdigest(record[:email].downcase), {
90
+ email_address: record[:email],
91
+ status_if_new: "subscribed",
92
+ merge_fields: {
93
+ FNAME: record[:first_name],
94
+ LNAME: record[:last_name]
95
+ }
96
+ })
97
+ when "Tags"
98
+ @client.lists.update_list_member_tags(@list_id, Digest::MD5.hexdigest(record[:email].downcase), {
99
+ tags: record[:tags].map { |tag| { name: tag, status: "active" } }
100
+ })
101
+ when "Campaigns"
102
+ campaign = @client.campaigns.create({
103
+ type: "regular",
104
+ recipients: { list_id: @list_id },
105
+ settings: {
106
+ subject_line: record[:subject],
107
+ from_name: record[:from_name],
108
+ reply_to: record[:reply_to]
109
+ }
110
+ })
111
+ if @email_template_id
112
+ @client.campaigns.set_content(campaign["id"], {
113
+ template: { id: @email_template_id }
114
+ })
115
+ else
116
+ @client.campaigns.set_content(campaign["id"], {
117
+ plain_text: record[:content]
118
+ })
119
+ end
120
+ @client.campaigns.send(campaign["id"])
121
+ else
122
+ raise "Unsupported stream type: #{stream_name}"
123
+ end
124
+ end
125
+
126
+ def authenticate_client
127
+ @client.lists.get_all_lists
128
+ end
129
+
130
+ def load_catalog
131
+ read_json(CATALOG_SPEC_PATH)
132
+ end
133
+
134
+ def log_debug(message)
135
+ Multiwoven::Integrations::Service.logger.debug(message)
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,141 @@
1
+ {
2
+ "request_rate_limit": 100000,
3
+ "request_rate_limit_unit": "day",
4
+ "request_rate_concurrency": 10,
5
+ "streams": [
6
+ {
7
+ "name": "Audience",
8
+ "action": "create",
9
+ "json_schema": {
10
+ "type": "object",
11
+ "additionalProperties": true,
12
+ "required": ["email"],
13
+ "properties": {
14
+ "email": {
15
+ "type": "string",
16
+ "format": "email"
17
+ },
18
+ "first_name": {
19
+ "type": "string"
20
+ },
21
+ "last_name": {
22
+ "type": "string"
23
+ },
24
+ "status": {
25
+ "type": "string",
26
+ "enum": ["subscribed", "unsubscribed", "cleaned", "pending"]
27
+ },
28
+ "tags": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "string"
32
+ }
33
+ },
34
+ "merge_fields": {
35
+ "type": "object",
36
+ "additionalProperties": true,
37
+ "properties": {
38
+ "FNAME": {
39
+ "type": "string"
40
+ },
41
+ "LNAME": {
42
+ "type": "string"
43
+ }
44
+ }
45
+ },
46
+ "language": {
47
+ "type": "string"
48
+ },
49
+ "vip": {
50
+ "type": "boolean"
51
+ },
52
+ "timestamp_signup": {
53
+ "type": "string",
54
+ "format": "date-time"
55
+ },
56
+ "ip_signup": {
57
+ "type": "string",
58
+ "format": "ipv4"
59
+ },
60
+ "timestamp_opt": {
61
+ "type": "string",
62
+ "format": "date-time"
63
+ },
64
+ "ip_opt": {
65
+ "type": "string",
66
+ "format": "ipv4"
67
+ }
68
+ }
69
+ },
70
+ "supported_sync_modes": ["incremental"],
71
+ "source_defined_cursor": true,
72
+ "default_cursor_field": ["timestamp_opt"],
73
+ "source_defined_primary_key": [["email"]]
74
+ },
75
+ {
76
+ "name": "Tags",
77
+ "action": "create",
78
+ "json_schema": {
79
+ "type": "object",
80
+ "additionalProperties": true,
81
+ "required": ["email", "tags"],
82
+ "properties": {
83
+ "email": {
84
+ "type": "string",
85
+ "format": "email"
86
+ },
87
+ "tags": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "supported_sync_modes": ["incremental"],
96
+ "source_defined_cursor": true,
97
+ "default_cursor_field": ["updated"]
98
+ },
99
+ {
100
+ "name": "Campaigns",
101
+ "action": "create",
102
+ "json_schema": {
103
+ "type": "object",
104
+ "additionalProperties": true,
105
+ "required": ["subject", "from_name", "reply_to", "recipients"],
106
+ "properties": {
107
+ "subject": {
108
+ "type": "string"
109
+ },
110
+ "from_name": {
111
+ "type": "string"
112
+ },
113
+ "reply_to": {
114
+ "type": "string",
115
+ "format": "email"
116
+ },
117
+ "recipients": {
118
+ "type": "object",
119
+ "properties": {
120
+ "list_id": {
121
+ "type": "string"
122
+ }
123
+ }
124
+ },
125
+ "template_id": {
126
+ "type": "string"
127
+ },
128
+ "content": {
129
+ "type": "string"
130
+ },
131
+ "send_time": {
132
+ "type": "string",
133
+ "format": "date-time"
134
+ }
135
+ }
136
+ },
137
+ "supported_sync_modes": ["full_refresh"],
138
+ "source_defined_cursor": false
139
+ }
140
+ ]
141
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "data": {
3
+ "name": "Mailchimp",
4
+ "title": "Mailchimp",
5
+ "connector_type": "destination",
6
+ "category": "Marketing Automation",
7
+ "documentation_url": "https://docs.multiwoven.com/destinations/crm/mailchimp",
8
+ "github_issue_label": "destination-mailchimp",
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,28 @@
1
+ {
2
+ "documentation_url": "https://docs.multiwoven.com/integrations/destination/mailchimp",
3
+ "stream_type": "static",
4
+ "connection_specification": {
5
+ "$schema": "http://json-schema.org/draft-07/schema#",
6
+ "title": "Mailchimp",
7
+ "type": "object",
8
+ "required": ["api_key", "list_id"],
9
+ "properties": {
10
+ "api_key": {
11
+ "type": "string",
12
+ "multiwoven_secret": true,
13
+ "title": "API Key",
14
+ "order": 0
15
+ },
16
+ "list_id": {
17
+ "type": "string",
18
+ "title": "List Id",
19
+ "order": 1
20
+ },
21
+ "email_template_id": {
22
+ "type": "string",
23
+ "title": "Email Template Id",
24
+ "order": 2
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
2
+ <svg fill="#000000" width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M23.974 15.12c0.219-0.026 0.443-0.026 0.661 0 0.12-0.271 0.141-0.745 0.031-1.255-0.156-0.76-0.37-1.224-0.818-1.151-0.443 0.073-0.458 0.625-0.302 1.385 0.094 0.427 0.25 0.797 0.427 1.021zM20.161 15.724c0.318 0.141 0.51 0.234 0.589 0.151 0.047-0.052 0.036-0.146-0.042-0.271-0.156-0.255-0.479-0.516-0.823-0.661-0.719-0.302-1.547-0.203-2.177 0.26-0.214 0.156-0.411 0.375-0.385 0.505 0.010 0.042 0.042 0.073 0.115 0.083 0.177 0.021 0.786-0.286 1.495-0.333 0.495-0.031 0.911 0.125 1.229 0.266zM19.521 16.089c-0.417 0.068-0.641 0.203-0.786 0.328-0.13 0.109-0.203 0.234-0.203 0.318l0.031 0.078 0.068 0.026c0.094 0 0.302-0.089 0.302-0.089 0.427-0.156 0.885-0.208 1.333-0.135 0.208 0.021 0.307 0.036 0.354-0.036 0.010-0.021 0.026-0.063-0.016-0.13-0.094-0.161-0.516-0.427-1.083-0.359zM22.688 17.432c0.281 0.135 0.589 0.083 0.688-0.12 0.104-0.208-0.042-0.49-0.323-0.625-0.281-0.141-0.589-0.083-0.693 0.12-0.099 0.208 0.047 0.484 0.328 0.625zM24.495 15.849c-0.229-0.005-0.422 0.245-0.422 0.562-0.005 0.313 0.172 0.568 0.401 0.573s0.417-0.245 0.422-0.557c0.005-0.313-0.177-0.573-0.401-0.578zM9.156 21.505c-0.057-0.068-0.151-0.047-0.24-0.026-0.073 0.016-0.146 0.026-0.214 0.031-0.156 0-0.302-0.073-0.391-0.198-0.104-0.161-0.099-0.401 0.016-0.672l0.052-0.125c0.188-0.411 0.49-1.099 0.146-1.755-0.255-0.495-0.677-0.802-1.188-0.865-0.49-0.063-0.974 0.109-1.313 0.469-0.505 0.557-0.583 1.318-0.484 1.589 0.036 0.099 0.094 0.125 0.135 0.13 0.083 0.010 0.208-0.052 0.292-0.266l0.021-0.068c0.036-0.115 0.104-0.328 0.208-0.495 0.281-0.427 0.849-0.547 1.271-0.266 0.354 0.229 0.495 0.667 0.344 1.078-0.078 0.219-0.208 0.625-0.177 0.964 0.057 0.682 0.474 0.953 0.849 0.984 0.365 0.016 0.62-0.193 0.688-0.344 0.036-0.089 0.005-0.141-0.016-0.167zM30.255 20.26c-0.016-0.052-0.104-0.385-0.229-0.781l-0.255-0.682c0.5-0.75 0.51-1.422 0.443-1.802-0.073-0.469-0.266-0.87-0.661-1.281-0.391-0.417-1.198-0.844-2.333-1.161l-0.594-0.161c0-0.026-0.031-1.406-0.057-1.995-0.016-0.427-0.052-1.099-0.26-1.755-0.245-0.891-0.677-1.672-1.214-2.172 1.479-1.536 2.406-3.229 2.401-4.677-0.005-2.797-3.427-3.641-7.646-1.891l-0.896 0.38c-0.547-0.536-1.089-1.073-1.641-1.609-4.813-4.203-19.854 12.542-15.047 16.615l1.052 0.891c-0.281 0.76-0.38 1.578-0.292 2.391 0.115 1.12 0.688 2.193 1.625 3.021 0.885 0.786 2.052 1.286 3.188 1.286 1.87 4.318 6.146 6.969 11.156 7.12 5.38 0.156 9.896-2.37 11.786-6.911 0.125-0.318 0.651-1.755 0.651-3.021 0-1.276-0.719-1.802-1.177-1.802zM8.25 23.656c-0.161 0.031-0.333 0.042-0.5 0.036-1.62-0.042-3.375-1.505-3.552-3.245-0.193-1.922 0.786-3.396 2.521-3.745 0.24-0.052 0.484-0.068 0.729-0.057 0.974 0.057 2.406 0.802 2.729 2.922 0.292 1.88-0.167 3.792-1.927 4.094zM6.438 15.552c-1.078 0.208-2.031 0.823-2.615 1.667-0.349-0.286-0.995-0.849-1.109-1.068-0.927-1.771 1.016-5.203 2.37-7.146 3.354-4.792 8.609-8.422 11.042-7.766 0.396 0.115 1.703 1.635 1.703 1.635s-2.432 1.349-4.688 3.234c-3.036 2.344-5.328 5.745-6.703 9.443zM23.484 22.943c0.036-0.016 0.063-0.057 0.057-0.094-0.005-0.052-0.047-0.089-0.099-0.083 0 0-2.542 0.38-4.948-0.505 0.26-0.849 0.958-0.542 2.010-0.458 1.635 0.099 3.276-0.078 4.854-0.526 1.089-0.313 2.516-0.927 3.63-1.807 0.375 0.823 0.505 1.729 0.505 1.729s0.292-0.052 0.531 0.099c0.229 0.141 0.396 0.438 0.281 1.193-0.229 1.417-0.833 2.568-1.844 3.63-0.63 0.682-1.38 1.245-2.219 1.656-0.464 0.245-0.948 0.448-1.443 0.615-3.813 1.245-7.714-0.125-8.974-3.068-0.099-0.224-0.182-0.458-0.25-0.698-0.536-1.938-0.083-4.266 1.344-5.729 0.083-0.094 0.172-0.203 0.172-0.344 0-0.115-0.073-0.234-0.135-0.323-0.495-0.724-2.219-1.953-1.875-4.339 0.25-1.714 1.745-2.917 3.141-2.849l0.354 0.021c0.604 0.036 1.13 0.115 1.625 0.135 0.833 0.036 1.583-0.083 2.469-0.823 0.297-0.25 0.536-0.469 0.943-0.536 0.042-0.005 0.151-0.047 0.359-0.036 0.219 0.010 0.427 0.078 0.609 0.198 0.714 0.474 0.813 1.62 0.849 2.458 0.021 0.479 0.078 1.635 0.099 1.969 0.047 0.76 0.245 0.87 0.646 1 0.229 0.078 0.443 0.135 0.75 0.219 0.943 0.266 1.5 0.536 1.849 0.88 0.214 0.214 0.307 0.443 0.339 0.661 0.115 0.813-0.625 1.813-2.583 2.724-2.141 0.995-4.734 1.245-6.526 1.047l-0.63-0.073c-1.432-0.193-2.25 1.661-1.391 2.938 0.552 0.818 2.068 1.354 3.578 1.354 3.464 0 6.13-1.484 7.12-2.766l0.078-0.115c0.052-0.073 0.010-0.109-0.052-0.068-0.807 0.552-4.406 2.755-8.25 2.094 0 0-0.469-0.078-0.896-0.245-0.339-0.13-1.047-0.458-1.135-1.188 3.104 0.964 5.057 0.052 5.057 0.052zM18.568 22.359h0.005zM12.63 8.984c1.193-1.38 2.661-2.578 3.974-3.25 0.047-0.026 0.094 0.026 0.073 0.068-0.104 0.188-0.307 0.599-0.37 0.901-0.010 0.047 0.042 0.083 0.078 0.057 0.823-0.557 2.245-1.156 3.495-1.234 0.052 0 0.078 0.068 0.036 0.099-0.208 0.161-0.391 0.344-0.552 0.552-0.026 0.036 0 0.083 0.042 0.083 0.88 0.010 2.115 0.318 2.917 0.771 0.057 0.031 0.021 0.135-0.042 0.12-1.219-0.281-3.214-0.495-5.286 0.016-1.849 0.453-3.26 1.146-4.292 1.901-0.052 0.036-0.115-0.031-0.073-0.083z"/>
4
+ </svg>
@@ -0,0 +1,137 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tiny_tds"
4
+
5
+ module Multiwoven::Integrations::Destination
6
+ module MicrosoftSql
7
+ include Multiwoven::Integrations::Core
8
+ class Client < DestinationConnector
9
+ def check_connection(connection_config)
10
+ connection_config = connection_config.with_indifferent_access
11
+ db_client = create_connection(connection_config)
12
+
13
+ if db_client.active?
14
+ ConnectionStatus.new(
15
+ status: ConnectionStatusType["succeeded"]
16
+ ).to_multiwoven_message
17
+ else
18
+ ConnectionStatus.new(
19
+ status: ConnectionStatusType["failed"], message: "MS SQL connection not active"
20
+ ).to_multiwoven_message
21
+ end
22
+ rescue TinyTds::Error => e
23
+ ConnectionStatus.new(
24
+ status: ConnectionStatusType["failed"], message: e.message
25
+ ).to_multiwoven_message
26
+ end
27
+
28
+ def discover(connection_config)
29
+ connection_config = connection_config.with_indifferent_access
30
+ query = "SELECT table_name, column_name, data_type, is_nullable
31
+ FROM information_schema.columns
32
+ WHERE table_schema = '#{connection_config[:schema]}' AND table_catalog = '#{connection_config[:database]}'
33
+ ORDER BY table_name, ordinal_position;"
34
+
35
+ db_client = create_connection(connection_config)
36
+ records = db_client.execute(query) do |result|
37
+ result.map do |row|
38
+ row
39
+ end
40
+ end
41
+ catalog = Catalog.new(streams: create_streams(records))
42
+ catalog.to_multiwoven_message
43
+ rescue StandardError => e
44
+ handle_exception(e, {
45
+ context: "MSSQL:DISCOVER:EXCEPTION",
46
+ type: "error"
47
+ })
48
+ ensure
49
+ db_client&.close
50
+ end
51
+
52
+ def write(sync_config, records, action = "destination_insert")
53
+ connection_config = sync_config.destination.connection_specification.with_indifferent_access
54
+ table_name = sync_config.stream.name
55
+ primary_key = sync_config.model.primary_key
56
+ log_message_array = []
57
+ db = create_connection(connection_config)
58
+
59
+ write_success = 0
60
+ write_failure = 0
61
+
62
+ records.each do |record|
63
+ query = Multiwoven::Integrations::Core::QueryBuilder.perform(action, table_name, record, primary_key)
64
+ logger.debug("MSSQL:WRITE:QUERY query = #{query} sync_id = #{sync_config.sync_id} sync_run_id = #{sync_config.sync_run_id}")
65
+ begin
66
+ response = db.execute(query)
67
+ response.do
68
+ write_success += 1
69
+ log_message_array << log_request_response("info", query, response)
70
+ rescue StandardError => e
71
+ handle_exception(e, {
72
+ context: "MSSQL:RECORD:WRITE:EXCEPTION",
73
+ type: "error",
74
+ sync_id: sync_config.sync_id,
75
+ sync_run_id: sync_config.sync_run_id
76
+ })
77
+ write_failure += 1
78
+ log_message_array << log_request_response("error", query, e.message)
79
+ end
80
+ end
81
+ tracking_message(write_success, write_failure, log_message_array)
82
+ rescue StandardError => e
83
+ handle_exception(e, {
84
+ context: "MSSQL:RECORD:WRITE:EXCEPTION",
85
+ type: "error",
86
+ sync_id: sync_config.sync_id,
87
+ sync_run_id: sync_config.sync_run_id
88
+ })
89
+ end
90
+
91
+ private
92
+
93
+ def query(connection, query)
94
+ connection.exec(query) do |result|
95
+ result.map do |row|
96
+ RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
97
+ end
98
+ end
99
+ end
100
+
101
+ def create_connection(connection_config)
102
+ raise "Unsupported Auth type" unless connection_config[:credentials][:auth_type] == "username/password"
103
+
104
+ TinyTds::Client.new(
105
+ username: connection_config[:credentials][:username],
106
+ password: connection_config[:credentials][:password],
107
+ host: connection_config[:host],
108
+ port: connection_config[:port],
109
+ database: connection_config[:database],
110
+ azure: true,
111
+ timeout: 3000
112
+ )
113
+ end
114
+
115
+ def create_streams(records)
116
+ group_by_table(records).map do |r|
117
+ Multiwoven::Integrations::Protocol::Stream.new(name: r[:tablename], action: StreamAction["fetch"], json_schema: convert_to_json_schema(r[:columns]))
118
+ end
119
+ end
120
+
121
+ def group_by_table(records)
122
+ records.group_by { |entry| entry["table_name"] }.map do |table_name, columns|
123
+ {
124
+ tablename: table_name,
125
+ columns: columns.map do |column|
126
+ {
127
+ column_name: column["column_name"],
128
+ type: column["data_type"],
129
+ optional: column["is_nullable"] == "YES"
130
+ }
131
+ end
132
+ }
133
+ end
134
+ end
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,15 @@
1
+ {
2
+ "data": {
3
+ "name": "MicrosoftSql",
4
+ "title": "Microsoft SQL",
5
+ "connector_type": "destination",
6
+ "category": "Database",
7
+ "documentation_url": "https://docs.mutliwoven.com",
8
+ "github_issue_label": "destination-mssql",
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,68 @@
1
+ {
2
+ "documentation_url": "https://docs.multiwoven.com/integrations/sources/mssql",
3
+ "stream_type": "dynamic",
4
+ "connection_specification": {
5
+ "$schema": "http://json-schema.org/draft-07/schema#",
6
+ "title": "MicrosoftSql",
7
+ "type": "object",
8
+ "required": ["host", "port", "database", "schema"],
9
+ "properties": {
10
+ "credentials": {
11
+ "title": "",
12
+ "type": "object",
13
+ "required": ["auth_type", "username", "password"],
14
+ "properties": {
15
+ "auth_type": {
16
+ "type": "string",
17
+ "default": "username/password",
18
+ "order": 0,
19
+ "readOnly": true
20
+ },
21
+ "username": {
22
+ "description": "Username refers to your individual MS SQL login credentials. At a minimum, the user associated with these credentials must be granted read access to the data intended for synchronization.",
23
+ "examples": ["MSSQL_USER"],
24
+ "type": "string",
25
+ "title": "Username",
26
+ "order": 1
27
+ },
28
+ "password": {
29
+ "description": "This field requires the password associated with the user account specified in the preceding section.",
30
+ "type": "string",
31
+ "multiwoven_secret": true,
32
+ "title": "Password",
33
+ "order": 2
34
+ }
35
+ },
36
+ "order": 0
37
+ },
38
+ "host": {
39
+ "description": "The hostname or IP address of your MS SQL server.",
40
+ "examples": ["127.0.0.1"],
41
+ "type": "string",
42
+ "title": "Host",
43
+ "order": 1
44
+ },
45
+ "port": {
46
+ "description": "The port number for your MS SQL server, which defaults to 1433, may vary based on your configuration. ",
47
+ "examples": ["1433"],
48
+ "type": "string",
49
+ "title": "Port",
50
+ "order": 2
51
+ },
52
+ "database": {
53
+ "description": "The specific MS SQL database to connect to.",
54
+ "examples": ["MSSQL_DB"],
55
+ "type": "string",
56
+ "title": "Database",
57
+ "order": 3
58
+ },
59
+ "schema": {
60
+ "description": "The schema within the MS SQL database.",
61
+ "examples": ["dbo"],
62
+ "type": "string",
63
+ "title": "Schema",
64
+ "order": 4
65
+ }
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <svg width="800px" height="800px" viewBox="0 -141.54 1478.201 1478.201" xmlns="http://www.w3.org/2000/svg">
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.11.6"
5
+ VERSION = "0.13.0"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -40,6 +40,8 @@ module Multiwoven
40
40
  DatabricksLakehouse
41
41
  Oracle
42
42
  MicrosoftExcel
43
+ MicrosoftSql
44
+ Mailchimp
43
45
  ].freeze
44
46
  end
45
47
  end
@@ -36,6 +36,7 @@ require "aws-sdk-sagemaker"
36
36
  require "aws-sdk-sagemakerruntime"
37
37
  require "google/cloud/ai_platform/v1"
38
38
  require "grpc"
39
+ require "MailchimpMarketing"
39
40
 
40
41
  # Service
41
42
  require_relative "integrations/config"
@@ -89,6 +90,8 @@ require_relative "integrations/destination/maria_db/client"
89
90
  require_relative "integrations/destination/databricks_lakehouse/client"
90
91
  require_relative "integrations/destination/oracle_db/client"
91
92
  require_relative "integrations/destination/microsoft_excel/client"
93
+ require_relative "integrations/destination/microsoft_sql/client"
94
+ require_relative "integrations/destination/mailchimp/client"
92
95
 
93
96
  module Multiwoven
94
97
  module Integrations
@@ -63,7 +63,9 @@ Gem::Specification.new do |spec|
63
63
  spec.add_runtime_dependency "sequel"
64
64
  spec.add_runtime_dependency "slack-ruby-client"
65
65
  spec.add_runtime_dependency "stripe"
66
+ spec.add_runtime_dependency "tiny_tds"
66
67
  spec.add_runtime_dependency "zendesk_api"
68
+ spec.add_development_dependency "MailchimpMarketing"
67
69
 
68
70
  spec.add_development_dependency "byebug"
69
71
  spec.add_development_dependency "rspec"
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.11.6
4
+ version: 0.13.0
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-10-01 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -430,6 +430,20 @@ dependencies:
430
430
  - - ">="
431
431
  - !ruby/object:Gem::Version
432
432
  version: '0'
433
+ - !ruby/object:Gem::Dependency
434
+ name: tiny_tds
435
+ requirement: !ruby/object:Gem::Requirement
436
+ requirements:
437
+ - - ">="
438
+ - !ruby/object:Gem::Version
439
+ version: '0'
440
+ type: :runtime
441
+ prerelease: false
442
+ version_requirements: !ruby/object:Gem::Requirement
443
+ requirements:
444
+ - - ">="
445
+ - !ruby/object:Gem::Version
446
+ version: '0'
433
447
  - !ruby/object:Gem::Dependency
434
448
  name: zendesk_api
435
449
  requirement: !ruby/object:Gem::Requirement
@@ -444,6 +458,20 @@ dependencies:
444
458
  - - ">="
445
459
  - !ruby/object:Gem::Version
446
460
  version: '0'
461
+ - !ruby/object:Gem::Dependency
462
+ name: MailchimpMarketing
463
+ requirement: !ruby/object:Gem::Requirement
464
+ requirements:
465
+ - - ">="
466
+ - !ruby/object:Gem::Version
467
+ version: '0'
468
+ type: :development
469
+ prerelease: false
470
+ version_requirements: !ruby/object:Gem::Requirement
471
+ requirements:
472
+ - - ">="
473
+ - !ruby/object:Gem::Version
474
+ version: '0'
447
475
  - !ruby/object:Gem::Dependency
448
476
  name: byebug
449
477
  requirement: !ruby/object:Gem::Requirement
@@ -596,6 +624,11 @@ files:
596
624
  - lib/multiwoven/integrations/destination/klaviyo/config/meta.json
597
625
  - lib/multiwoven/integrations/destination/klaviyo/config/spec.json
598
626
  - lib/multiwoven/integrations/destination/klaviyo/icon.svg
627
+ - lib/multiwoven/integrations/destination/mailchimp/client.rb
628
+ - lib/multiwoven/integrations/destination/mailchimp/config/catalog.json
629
+ - lib/multiwoven/integrations/destination/mailchimp/config/meta.json
630
+ - lib/multiwoven/integrations/destination/mailchimp/config/spec.json
631
+ - lib/multiwoven/integrations/destination/mailchimp/icon.svg
599
632
  - lib/multiwoven/integrations/destination/maria_db/client.rb
600
633
  - lib/multiwoven/integrations/destination/maria_db/config/meta.json
601
634
  - lib/multiwoven/integrations/destination/maria_db/config/spec.json
@@ -605,6 +638,10 @@ files:
605
638
  - lib/multiwoven/integrations/destination/microsoft_excel/config/meta.json
606
639
  - lib/multiwoven/integrations/destination/microsoft_excel/config/spec.json
607
640
  - lib/multiwoven/integrations/destination/microsoft_excel/icon.svg
641
+ - lib/multiwoven/integrations/destination/microsoft_sql/client.rb
642
+ - lib/multiwoven/integrations/destination/microsoft_sql/config/meta.json
643
+ - lib/multiwoven/integrations/destination/microsoft_sql/config/spec.json
644
+ - lib/multiwoven/integrations/destination/microsoft_sql/icon.svg
608
645
  - lib/multiwoven/integrations/destination/oracle_db/client.rb
609
646
  - lib/multiwoven/integrations/destination/oracle_db/config/meta.json
610
647
  - lib/multiwoven/integrations/destination/oracle_db/config/spec.json