multiwoven-integrations 0.30.5 → 0.31.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: 3dbd7e7732c2def6429731130b851205c4c663336372ce8b9883bb5ddca2bfe2
4
- data.tar.gz: d9a6e687dc680521257a56475ce92692751982d21143335f321792fbbbe53f0c
3
+ metadata.gz: e4b013bec2e364dc08a5d0b4043c7f43a6a115ba399266e2145e5688587e9157
4
+ data.tar.gz: d5a0860d637d31f05969453035e625699a2356e885bc650a36195ab019d1725e
5
5
  SHA512:
6
- metadata.gz: 1eba501c3b19dd4fe5b180cbfa6688a89ad75039e225a3bbf516a24c42df6e379eec183670b3fd41bcd9431a5e57236cdae2f91e06b0d5181944729ac55ef582
7
- data.tar.gz: d12e9399dd9bad7d2283c8ce80409999b203fedb5faba38750e573d5361c1567e4b168e136938550a70a632f08b9c542ef78eee3819590168823e569e6b18436
6
+ metadata.gz: de94dccb2b60dd33fda21275b98198a8f4bcff41ca50c36a883edb673f36e2e96da5119e19dd23f052ccc39e943eb691d69019f2d8e7af39c6f45180e8f35f38
7
+ data.tar.gz: 01b015d2f0b0bb4946f0f75237c20727766dd02f09793a51c71c5f57ddae5e4d11c54071ffd27199b62d70b108c375433255f58eff014a20062dbf7b48c49ef9
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.30.5"
5
+ VERSION = "0.31.0"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -31,6 +31,7 @@ module Multiwoven
31
31
  PineconeDB
32
32
  Qdrant
33
33
  Firecrawl
34
+ Odoo
34
35
  ].freeze
35
36
 
36
37
  ENABLED_DESTINATIONS = %w[
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "xmlrpc/client"
4
+
5
+ module Multiwoven::Integrations::Source
6
+ module Odoo
7
+ include Multiwoven::Integrations::Core
8
+ class Client < SourceConnector
9
+ def check_connection(connection_config)
10
+ connection_config = connection_config.with_indifferent_access
11
+ create_connection(connection_config)
12
+ success_status
13
+ rescue StandardError => e
14
+ failure_status(e)
15
+ end
16
+
17
+ def discover(connection_config)
18
+ connection_config = connection_config.with_indifferent_access
19
+ create_connection(connection_config)
20
+
21
+ models = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
22
+ "ir.model", "search_read", [[["transient", "=", false], ["abstract", "=", false]]], { 'fields': %w[name model] })
23
+
24
+ catalog = Catalog.new(streams: create_streams(connection_config, models))
25
+ catalog.to_multiwoven_message
26
+ rescue StandardError => e
27
+ handle_exception(e, {
28
+ context: "ODOO:DISCOVER:EXCEPTION",
29
+ type: "error"
30
+ })
31
+ end
32
+
33
+ def read(sync_config)
34
+ connection_config = sync_config.source.connection_specification.with_indifferent_access
35
+ create_connection(connection_config)
36
+ query = sync_config.model.query
37
+ query(connection_config, query)
38
+ rescue StandardError => e
39
+ handle_exception(e, {
40
+ context: "ODOO:READ:EXCEPTION",
41
+ type: "error",
42
+ sync_id: sync_config.sync_id,
43
+ sync_run_id: sync_config.sync_run_id
44
+ })
45
+ end
46
+
47
+ private
48
+
49
+ def create_streams(connection_config, models)
50
+ models.map do |model|
51
+ fields = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
52
+ model["model"], "fields_get", [], { 'attributes': %w[name type] })
53
+ Multiwoven::Integrations::Protocol::Stream.new(name: model["model"], action: StreamAction["fetch"],
54
+ supported_sync_modes: %w[incremental], json_schema: convert_to_json_schema(fields))
55
+ end
56
+ end
57
+
58
+ def convert_to_json_schema(fields)
59
+ json_schema = {
60
+ "type" => "object",
61
+ "properties" => {}
62
+ }
63
+ fields.each do |field|
64
+ column_name = field[1]["name"]
65
+ type = field[1]["type"]
66
+ json_schema["properties"][column_name] = {
67
+ "type" => type
68
+ }
69
+ end
70
+ json_schema
71
+ end
72
+
73
+ def create_connection(connection_config)
74
+ common = XMLRPC::Client.new2("#{connection_config[:url]}/xmlrpc/2/common")
75
+ common.call("version")
76
+ @uid = common.call("authenticate", connection_config[:database], connection_config[:username],
77
+ connection_config[:password], { 'raise_exception': true })
78
+ @client = XMLRPC::Client.new2("#{connection_config[:url]}/xmlrpc/2/object").proxy
79
+ connection_config
80
+ end
81
+
82
+ def query(connection, query)
83
+ limit = 0
84
+ limit = query.match(/LIMIT (\d+)/)[1].to_i if query.include? "LIMIT"
85
+
86
+ model = query.gsub(/LIMIT\s+\d+/i, "").gsub(/SELECT (.*) FROM/, "").strip
87
+ columns = if query.include? "SELECT *"
88
+ []
89
+ else
90
+ query.match(/SELECT (.*) FROM/)[1].strip.downcase.split(", ")
91
+ end
92
+
93
+ records = @client.execute_kw(connection[:database], @uid, connection[:password],
94
+ model, "search_read", [], { limit: limit, 'fields': columns })
95
+ records.map do |row|
96
+ puts row
97
+ RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,15 @@
1
+ {
2
+ "data": {
3
+ "name": "Odoo",
4
+ "title": "Odoo",
5
+ "connector_type": "source",
6
+ "category": "Database",
7
+ "documentation_url": "https://docs.squared.ai/guides/sources/data-sources/odoo",
8
+ "github_issue_label": "source-odoo",
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,39 @@
1
+
2
+ {
3
+ "documentation_url": "https://docs.squared.ai/guides/destinations/retl-destinations/database/odoo",
4
+ "stream_type": "static",
5
+ "connector_query_type": "raw_sql",
6
+ "connection_specification": {
7
+ "$schema": "http://json-schema.org/draft-07/schema#",
8
+ "title": "Odoo",
9
+ "type": "object",
10
+ "required": ["url","database","username","password"],
11
+ "properties": {
12
+ "url": {
13
+ "description": "The Odoo host url.",
14
+ "type": "string",
15
+ "title": "URL",
16
+ "order": 0
17
+ },
18
+ "database": {
19
+ "description": "The Odoo database.",
20
+ "type": "string",
21
+ "title": "Database",
22
+ "order": 1
23
+ },
24
+ "username": {
25
+ "description": "The Odoo username.",
26
+ "type": "string",
27
+ "title": "Username",
28
+ "order": 2
29
+ },
30
+ "password": {
31
+ "description": "The Odoo password.",
32
+ "type": "string",
33
+ "multiwoven_secret": true,
34
+ "title": "Password",
35
+ "order": 3
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 126.2 40" style="enable-background:new 0 0 126.2 40;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#8F8F8F;}
7
+ .st1{fill:#714B67;}
8
+ </style>
9
+ <g id="Group_982" transform="translate(-13.729 -4.35)">
10
+ <path id="Path_172" class="st0" d="M60.9,38c4.9,0,8.9-4,8.9-8.9c0-4.9-4-8.9-8.9-8.9c-4.9,0-8.9,4-8.9,8.9c0,0,0,0,0,0
11
+ C51.9,34,55.9,38,60.9,38 M76.1,28.8c0.1,8.4-6.6,15.4-15,15.5c-8.4,0.1-15.4-6.6-15.5-15c0-0.2,0-0.3,0-0.5
12
+ c0.3-8.6,7.6-15.4,16.2-15.1c2.9,0.1,5.6,1,8,2.6V7.4c0.1-1.7,1.5-3.1,3.3-3.1c1.7,0,3,1.4,3.1,3.1L76.1,28.8z M92.7,38
13
+ c4.9,0,8.9-4,8.9-8.9c0-4.9-4-8.9-8.9-8.9c-4.9,0-8.9,4-8.9,8.9c0,0,0,0,0,0C83.8,34,87.8,38,92.7,38L92.7,38 M92.7,44.3
14
+ c-8.4,0-15.2-6.8-15.2-15.2c0-8.4,6.8-15.2,15.2-15.2c8.4,0,15.2,6.8,15.2,15.2c0,0,0,0,0,0C108,37.4,101.2,44.3,92.7,44.3
15
+ M124.6,38c4.9,0,8.9-4,8.9-8.9s-4-8.9-8.9-8.9c-4.9,0-8.9,4-8.9,8.9c0,0,0,0,0,0C115.7,34,119.7,38,124.6,38 M124.6,44.3
16
+ c-8.4,0-15.2-6.8-15.2-15.2c0-8.4,6.8-15.2,15.2-15.2c8.4,0,15.2,6.8,15.2,15.2c0,0,0,0,0,0C139.9,37.4,133,44.3,124.6,44.3"/>
17
+ <path id="Path_173" class="st1" d="M29,38c4.9,0,8.9-4,8.9-8.9c0-4.9-4-8.9-8.9-8.9c-4.9,0-8.9,4-8.9,8.9c0,0,0,0,0,0
18
+ C20,34,24,38,29,38 M29,44.3c-8.4,0-15.2-6.8-15.2-15.2S20.5,13.8,29,13.8S44.2,20.6,44.2,29c0,0,0,0,0,0
19
+ C44.2,37.4,37.4,44.3,29,44.3C29,44.3,29,44.3,29,44.3"/>
20
+ </g>
21
+ </svg>
@@ -90,6 +90,7 @@ require_relative "integrations/source/intuit_quick_books/client"
90
90
  require_relative "integrations/source/pinecone_db/client"
91
91
  require_relative "integrations/source/qdrant/client"
92
92
  require_relative "integrations/source/firecrawl/client"
93
+ require_relative "integrations/source/odoo/client"
93
94
 
94
95
  # Destination
95
96
  require_relative "integrations/destination/klaviyo/client"
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.30.5
4
+ version: 0.31.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: 2025-07-07 00:00:00.000000000 Z
11
+ date: 2025-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -780,6 +780,10 @@ files:
780
780
  - lib/multiwoven/integrations/source/maria_db/config/meta.json
781
781
  - lib/multiwoven/integrations/source/maria_db/config/spec.json
782
782
  - lib/multiwoven/integrations/source/maria_db/icon.svg
783
+ - lib/multiwoven/integrations/source/odoo/client.rb
784
+ - lib/multiwoven/integrations/source/odoo/config/meta.json
785
+ - lib/multiwoven/integrations/source/odoo/config/spec.json
786
+ - lib/multiwoven/integrations/source/odoo/icon.svg
783
787
  - lib/multiwoven/integrations/source/open_ai/client.rb
784
788
  - lib/multiwoven/integrations/source/open_ai/config/catalog.json
785
789
  - lib/multiwoven/integrations/source/open_ai/config/meta.json