multiwoven-integrations 0.30.5 → 0.31.1
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 +4 -4
- data/lib/multiwoven/integrations/rollout.rb +2 -1
- data/lib/multiwoven/integrations/source/odoo/client.rb +100 -0
- data/lib/multiwoven/integrations/source/odoo/config/meta.json +15 -0
- data/lib/multiwoven/integrations/source/odoo/config/spec.json +39 -0
- data/lib/multiwoven/integrations/source/odoo/icon.svg +21 -0
- data/lib/multiwoven/integrations.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e4488183b69dfe716d32c5a708f11327714fd9468f1a6ff60da7380ea3941af
|
4
|
+
data.tar.gz: 448c7dd7b3ef433378b79fbd1c252c527cd221e2a2388336b9c584cb449bd1ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c0168ad313208fee89993037c2b49f09d784560cb35a9526512ff47e52809c928492def4f69cf96554d671befd6b3f6a54a7c811c3e81f63e3c42d10452298d
|
7
|
+
data.tar.gz: bceece8420ae4bed069a8207af2cb21ba009353fbabd760d555a62d3a8e5249991e0dce65fa394414a5ece56d991a47cc28274b81ec30fc4a87a939fbb1fc11c
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Multiwoven
|
4
4
|
module Integrations
|
5
|
-
VERSION = "0.
|
5
|
+
VERSION = "0.31.1"
|
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,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Multiwoven::Integrations::Source
|
4
|
+
module Odoo
|
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
|
+
success_status
|
11
|
+
rescue StandardError => e
|
12
|
+
failure_status(e)
|
13
|
+
end
|
14
|
+
|
15
|
+
def discover(connection_config)
|
16
|
+
connection_config = connection_config.with_indifferent_access
|
17
|
+
create_connection(connection_config)
|
18
|
+
|
19
|
+
models = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
|
20
|
+
"ir.model", "search_read", [[["transient", "=", false], ["abstract", "=", false]]], { 'fields': %w[name model] })
|
21
|
+
|
22
|
+
catalog = Catalog.new(streams: create_streams(connection_config, models))
|
23
|
+
catalog.to_multiwoven_message
|
24
|
+
rescue StandardError => e
|
25
|
+
handle_exception(e, {
|
26
|
+
context: "ODOO:DISCOVER:EXCEPTION",
|
27
|
+
type: "error"
|
28
|
+
})
|
29
|
+
end
|
30
|
+
|
31
|
+
def read(sync_config)
|
32
|
+
connection_config = sync_config.source.connection_specification.with_indifferent_access
|
33
|
+
create_connection(connection_config)
|
34
|
+
query = sync_config.model.query
|
35
|
+
query(connection_config, query)
|
36
|
+
rescue StandardError => e
|
37
|
+
handle_exception(e, {
|
38
|
+
context: "ODOO:READ:EXCEPTION",
|
39
|
+
type: "error",
|
40
|
+
sync_id: sync_config.sync_id,
|
41
|
+
sync_run_id: sync_config.sync_run_id
|
42
|
+
})
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def create_streams(connection_config, models)
|
48
|
+
models.map do |model|
|
49
|
+
fields = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
|
50
|
+
model["model"], "fields_get", [], { 'attributes': %w[name type] })
|
51
|
+
Multiwoven::Integrations::Protocol::Stream.new(name: model["model"], action: StreamAction["fetch"],
|
52
|
+
supported_sync_modes: %w[incremental], json_schema: convert_to_json_schema(fields))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def convert_to_json_schema(fields)
|
57
|
+
json_schema = {
|
58
|
+
"type" => "object",
|
59
|
+
"properties" => {}
|
60
|
+
}
|
61
|
+
fields.each do |field|
|
62
|
+
column_name = field[1]["name"]
|
63
|
+
type = field[1]["type"]
|
64
|
+
json_schema["properties"][column_name] = {
|
65
|
+
"type" => type
|
66
|
+
}
|
67
|
+
end
|
68
|
+
json_schema
|
69
|
+
end
|
70
|
+
|
71
|
+
def create_connection(connection_config)
|
72
|
+
common = XMLRPC::Client.new2("#{connection_config[:url]}/xmlrpc/2/common")
|
73
|
+
common.call("version")
|
74
|
+
@uid = common.call("authenticate", connection_config[:database], connection_config[:username],
|
75
|
+
connection_config[:password], { 'raise_exception': true })
|
76
|
+
@client = XMLRPC::Client.new2("#{connection_config[:url]}/xmlrpc/2/object").proxy
|
77
|
+
connection_config
|
78
|
+
end
|
79
|
+
|
80
|
+
def query(connection, query)
|
81
|
+
limit = 0
|
82
|
+
limit = query.match(/LIMIT (\d+)/)[1].to_i if query.include? "LIMIT"
|
83
|
+
|
84
|
+
model = query.gsub(/LIMIT\s+\d+/i, "").gsub(/SELECT (.*) FROM/, "").strip
|
85
|
+
columns = if query.include? "SELECT *"
|
86
|
+
[]
|
87
|
+
else
|
88
|
+
query.match(/SELECT (.*) FROM/)[1].strip.downcase.split(", ")
|
89
|
+
end
|
90
|
+
|
91
|
+
records = @client.execute_kw(connection[:database], @uid, connection[:password],
|
92
|
+
model, "search_read", [], { limit: limit, 'fields': columns })
|
93
|
+
records.map do |row|
|
94
|
+
puts row
|
95
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
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>
|
@@ -41,6 +41,7 @@ require "aws-sdk-bedrockruntime"
|
|
41
41
|
require "pinecone"
|
42
42
|
require "intuit-oauth"
|
43
43
|
require "nokogiri"
|
44
|
+
require "xmlrpc/client"
|
44
45
|
|
45
46
|
# Service
|
46
47
|
require_relative "integrations/config"
|
@@ -90,6 +91,7 @@ require_relative "integrations/source/intuit_quick_books/client"
|
|
90
91
|
require_relative "integrations/source/pinecone_db/client"
|
91
92
|
require_relative "integrations/source/qdrant/client"
|
92
93
|
require_relative "integrations/source/firecrawl/client"
|
94
|
+
require_relative "integrations/source/odoo/client"
|
93
95
|
|
94
96
|
# Destination
|
95
97
|
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.
|
4
|
+
version: 0.31.1
|
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-
|
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
|