outhad-integrations 0.32.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 +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +43 -0
- data/.ruby-version +1 -0
- data/.vscode/settings.json +5 -0
- data/README.md +76 -0
- data/Rakefile +12 -0
- data/lib/outhad/integrations/config.rb +14 -0
- data/lib/outhad/integrations/core/base_connector.rb +79 -0
- data/lib/outhad/integrations/core/constants.rb +103 -0
- data/lib/outhad/integrations/core/destination_connector.rb +20 -0
- data/lib/outhad/integrations/core/fullrefresher.rb +19 -0
- data/lib/outhad/integrations/core/http_client.rb +17 -0
- data/lib/outhad/integrations/core/http_helper.rb +36 -0
- data/lib/outhad/integrations/core/query_builder.rb +33 -0
- data/lib/outhad/integrations/core/rate_limiter.rb +19 -0
- data/lib/outhad/integrations/core/source_connector.rb +66 -0
- data/lib/outhad/integrations/core/streaming_http_client.rb +21 -0
- data/lib/outhad/integrations/core/unstructured_source_connector.rb +52 -0
- data/lib/outhad/integrations/core/utils.rb +123 -0
- data/lib/outhad/integrations/core/vector_source_connector.rb +14 -0
- data/lib/outhad/integrations/destination/airtable/client.rb +157 -0
- data/lib/outhad/integrations/destination/airtable/config/catalog.json +6 -0
- data/lib/outhad/integrations/destination/airtable/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/airtable/config/spec.json +23 -0
- data/lib/outhad/integrations/destination/airtable/icon.svg +6 -0
- data/lib/outhad/integrations/destination/airtable/schema_helper.rb +141 -0
- data/lib/outhad/integrations/destination/ais_data_store/client.rb +130 -0
- data/lib/outhad/integrations/destination/ais_data_store/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/ais_data_store/config/spec.json +68 -0
- data/lib/outhad/integrations/destination/ais_data_store/icon.svg +4 -0
- data/lib/outhad/integrations/destination/amazon_s3/client.rb +92 -0
- data/lib/outhad/integrations/destination/amazon_s3/config/catalog.json +16 -0
- data/lib/outhad/integrations/destination/amazon_s3/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/amazon_s3/config/spec.json +56 -0
- data/lib/outhad/integrations/destination/amazon_s3/icon.svg +34 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/client.rb +147 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/config/spec.json +44 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/icon.svg +65 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/client.rb +125 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/config/catalog.json +42 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/config/spec.json +28 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/icon.svg +23 -0
- data/lib/outhad/integrations/destination/google_sheets/client.rb +240 -0
- data/lib/outhad/integrations/destination/google_sheets/config/catalog.json +6 -0
- data/lib/outhad/integrations/destination/google_sheets/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/google_sheets/config/spec.json +75 -0
- data/lib/outhad/integrations/destination/google_sheets/icon.svg +1 -0
- data/lib/outhad/integrations/destination/http/client.rb +106 -0
- data/lib/outhad/integrations/destination/http/config/catalog.json +16 -0
- data/lib/outhad/integrations/destination/http/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/http/config/spec.json +24 -0
- data/lib/outhad/integrations/destination/http/icon.svg +9 -0
- data/lib/outhad/integrations/destination/hubspot/client.rb +122 -0
- data/lib/outhad/integrations/destination/hubspot/config/catalog.json +351 -0
- data/lib/outhad/integrations/destination/hubspot/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/hubspot/config/spec.json +18 -0
- data/lib/outhad/integrations/destination/hubspot/icon.svg +5 -0
- data/lib/outhad/integrations/destination/iterable/client.rb +111 -0
- data/lib/outhad/integrations/destination/iterable/config/catalog.json +47 -0
- data/lib/outhad/integrations/destination/iterable/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/iterable/config/spec.json +19 -0
- data/lib/outhad/integrations/destination/iterable/icon.svg +71 -0
- data/lib/outhad/integrations/destination/klaviyo/client.rb +119 -0
- data/lib/outhad/integrations/destination/klaviyo/config/catalog.json +103 -0
- data/lib/outhad/integrations/destination/klaviyo/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/klaviyo/config/spec.json +24 -0
- data/lib/outhad/integrations/destination/klaviyo/icon.svg +6 -0
- data/lib/outhad/integrations/destination/mailchimp/client.rb +141 -0
- data/lib/outhad/integrations/destination/mailchimp/config/catalog.json +142 -0
- data/lib/outhad/integrations/destination/mailchimp/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/mailchimp/config/spec.json +28 -0
- data/lib/outhad/integrations/destination/mailchimp/icon.svg +4 -0
- data/lib/outhad/integrations/destination/maria_db/client.rb +114 -0
- data/lib/outhad/integrations/destination/maria_db/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/maria_db/config/spec.json +48 -0
- data/lib/outhad/integrations/destination/maria_db/icon.svg +15 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/client.rb +150 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/config/catalog.json +161 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/config/spec.json +35 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/icon.svg +2 -0
- data/lib/outhad/integrations/destination/microsoft_excel/client.rb +198 -0
- data/lib/outhad/integrations/destination/microsoft_excel/config/catalog.json +7 -0
- data/lib/outhad/integrations/destination/microsoft_excel/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/microsoft_excel/config/spec.json +19 -0
- data/lib/outhad/integrations/destination/microsoft_excel/icon.svg +18 -0
- data/lib/outhad/integrations/destination/microsoft_sql/client.rb +137 -0
- data/lib/outhad/integrations/destination/microsoft_sql/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/microsoft_sql/config/spec.json +68 -0
- data/lib/outhad/integrations/destination/microsoft_sql/icon.svg +22 -0
- data/lib/outhad/integrations/destination/odoo/client.rb +109 -0
- data/lib/outhad/integrations/destination/odoo/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/odoo/config/spec.json +39 -0
- data/lib/outhad/integrations/destination/odoo/icon.svg +21 -0
- data/lib/outhad/integrations/destination/oracle_db/client.rb +112 -0
- data/lib/outhad/integrations/destination/oracle_db/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/oracle_db/config/spec.json +47 -0
- data/lib/outhad/integrations/destination/oracle_db/icon.svg +4 -0
- data/lib/outhad/integrations/destination/pinecone_db/client.rb +154 -0
- data/lib/outhad/integrations/destination/pinecone_db/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/pinecone_db/config/spec.json +32 -0
- data/lib/outhad/integrations/destination/pinecone_db/icon.svg +1 -0
- data/lib/outhad/integrations/destination/postgresql/client.rb +130 -0
- data/lib/outhad/integrations/destination/postgresql/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/postgresql/config/spec.json +68 -0
- data/lib/outhad/integrations/destination/postgresql/icon.svg +20 -0
- data/lib/outhad/integrations/destination/qdrant/client.rb +184 -0
- data/lib/outhad/integrations/destination/qdrant/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/qdrant/config/spec.json +23 -0
- data/lib/outhad/integrations/destination/qdrant/icon.svg +1 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/client.rb +136 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/config/catalog.json +6 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/config/meta.json +16 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/config/spec.json +52 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/icon.svg +16 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/schema_helper.rb +132 -0
- data/lib/outhad/integrations/destination/salesforce_crm/client.rb +114 -0
- data/lib/outhad/integrations/destination/salesforce_crm/config/catalog.json +320 -0
- data/lib/outhad/integrations/destination/salesforce_crm/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/salesforce_crm/config/spec.json +46 -0
- data/lib/outhad/integrations/destination/salesforce_crm/icon.svg +16 -0
- data/lib/outhad/integrations/destination/sftp/client.rb +186 -0
- data/lib/outhad/integrations/destination/sftp/config/catalog.json +16 -0
- data/lib/outhad/integrations/destination/sftp/config/meta.json +16 -0
- data/lib/outhad/integrations/destination/sftp/config/spec.json +73 -0
- data/lib/outhad/integrations/destination/sftp/icon.svg +1 -0
- data/lib/outhad/integrations/destination/slack/client.rb +125 -0
- data/lib/outhad/integrations/destination/slack/config/catalog.json +22 -0
- data/lib/outhad/integrations/destination/slack/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/slack/config/spec.json +23 -0
- data/lib/outhad/integrations/destination/slack/icon.svg +26 -0
- data/lib/outhad/integrations/destination/stripe/client.rb +94 -0
- data/lib/outhad/integrations/destination/stripe/config/catalog.json +128 -0
- data/lib/outhad/integrations/destination/stripe/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/stripe/config/spec.json +18 -0
- data/lib/outhad/integrations/destination/stripe/icon.svg +10 -0
- data/lib/outhad/integrations/destination/zendesk/client.rb +132 -0
- data/lib/outhad/integrations/destination/zendesk/config/catalog.json +110 -0
- data/lib/outhad/integrations/destination/zendesk/config/meta.json +18 -0
- data/lib/outhad/integrations/destination/zendesk/config/spec.json +32 -0
- data/lib/outhad/integrations/destination/zendesk/icon.svg +63 -0
- data/lib/outhad/integrations/protocol/protocol.json +189 -0
- data/lib/outhad/integrations/protocol/protocol.rb +228 -0
- data/lib/outhad/integrations/rollout.rb +66 -0
- data/lib/outhad/integrations/service.rb +55 -0
- data/lib/outhad/integrations/source/amazon_s3/client.rb +235 -0
- data/lib/outhad/integrations/source/amazon_s3/config/meta.json +16 -0
- data/lib/outhad/integrations/source/amazon_s3/config/spec.json +119 -0
- data/lib/outhad/integrations/source/amazon_s3/icon.svg +34 -0
- data/lib/outhad/integrations/source/anthropic/client.rb +135 -0
- data/lib/outhad/integrations/source/anthropic/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/anthropic/config/meta.json +16 -0
- data/lib/outhad/integrations/source/anthropic/config/spec.json +56 -0
- data/lib/outhad/integrations/source/anthropic/icon.svg +1 -0
- data/lib/outhad/integrations/source/aws_athena/client.rb +109 -0
- data/lib/outhad/integrations/source/aws_athena/config/meta.json +16 -0
- data/lib/outhad/integrations/source/aws_athena/config/spec.json +63 -0
- data/lib/outhad/integrations/source/aws_athena/icon.svg +22 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/client.rb +91 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/config/meta.json +16 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/config/spec.json +58 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/icon.svg +1 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/client.rb +79 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/config/meta.json +16 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/config/spec.json +52 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/icon.svg +7 -0
- data/lib/outhad/integrations/source/bigquery/client.rb +98 -0
- data/lib/outhad/integrations/source/bigquery/config/meta.json +16 -0
- data/lib/outhad/integrations/source/bigquery/config/spec.json +83 -0
- data/lib/outhad/integrations/source/bigquery/icon.svg +1 -0
- data/lib/outhad/integrations/source/clickhouse/client.rb +102 -0
- data/lib/outhad/integrations/source/clickhouse/config/meta.json +16 -0
- data/lib/outhad/integrations/source/clickhouse/config/spec.json +42 -0
- data/lib/outhad/integrations/source/clickhouse/icon.svg +25 -0
- data/lib/outhad/integrations/source/databricks/client.rb +98 -0
- data/lib/outhad/integrations/source/databricks/config/meta.json +17 -0
- data/lib/outhad/integrations/source/databricks/config/spec.json +56 -0
- data/lib/outhad/integrations/source/databricks/icon.svg +19 -0
- data/lib/outhad/integrations/source/databrics_model/client.rb +89 -0
- data/lib/outhad/integrations/source/databrics_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/databrics_model/config/meta.json +17 -0
- data/lib/outhad/integrations/source/databrics_model/config/spec.json +63 -0
- data/lib/outhad/integrations/source/databrics_model/icon.svg +19 -0
- data/lib/outhad/integrations/source/firecrawl/client.rb +151 -0
- data/lib/outhad/integrations/source/firecrawl/config/catalog.json +29 -0
- data/lib/outhad/integrations/source/firecrawl/config/meta.json +17 -0
- data/lib/outhad/integrations/source/firecrawl/config/spec.json +31 -0
- data/lib/outhad/integrations/source/firecrawl/icon.svg +4 -0
- data/lib/outhad/integrations/source/generic_open_ai/client.rb +118 -0
- data/lib/outhad/integrations/source/generic_open_ai/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/generic_open_ai/config/meta.json +16 -0
- data/lib/outhad/integrations/source/generic_open_ai/config/spec.json +63 -0
- data/lib/outhad/integrations/source/generic_open_ai/icon.svg +6 -0
- data/lib/outhad/integrations/source/google_vertex_model/client.rb +83 -0
- data/lib/outhad/integrations/source/google_vertex_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/google_vertex_model/config/meta.json +17 -0
- data/lib/outhad/integrations/source/google_vertex_model/config/spec.json +105 -0
- data/lib/outhad/integrations/source/google_vertex_model/icon.svg +2 -0
- data/lib/outhad/integrations/source/http_model/client.rb +108 -0
- data/lib/outhad/integrations/source/http_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/http_model/config/meta.json +16 -0
- data/lib/outhad/integrations/source/http_model/config/spec.json +70 -0
- data/lib/outhad/integrations/source/http_model/icon.svg +9 -0
- data/lib/outhad/integrations/source/intuit_quick_books/client.rb +213 -0
- data/lib/outhad/integrations/source/intuit_quick_books/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/intuit_quick_books/config/meta.json +17 -0
- data/lib/outhad/integrations/source/intuit_quick_books/config/spec.json +44 -0
- data/lib/outhad/integrations/source/intuit_quick_books/icon.svg +1 -0
- data/lib/outhad/integrations/source/maria_db/client.rb +92 -0
- data/lib/outhad/integrations/source/maria_db/config/meta.json +16 -0
- data/lib/outhad/integrations/source/maria_db/config/spec.json +48 -0
- data/lib/outhad/integrations/source/maria_db/icon.svg +15 -0
- data/lib/outhad/integrations/source/odoo/client.rb +106 -0
- data/lib/outhad/integrations/source/odoo/config/meta.json +15 -0
- data/lib/outhad/integrations/source/odoo/config/spec.json +39 -0
- data/lib/outhad/integrations/source/odoo/icon.svg +21 -0
- data/lib/outhad/integrations/source/open_ai/client.rb +118 -0
- data/lib/outhad/integrations/source/open_ai/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/open_ai/config/meta.json +16 -0
- data/lib/outhad/integrations/source/open_ai/config/spec.json +56 -0
- data/lib/outhad/integrations/source/open_ai/icon.svg +1 -0
- data/lib/outhad/integrations/source/oracle_db/client.rb +127 -0
- data/lib/outhad/integrations/source/oracle_db/config/meta.json +16 -0
- data/lib/outhad/integrations/source/oracle_db/config/spec.json +47 -0
- data/lib/outhad/integrations/source/oracle_db/icon.svg +4 -0
- data/lib/outhad/integrations/source/pinecone_db/client.rb +73 -0
- data/lib/outhad/integrations/source/pinecone_db/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/pinecone_db/config/meta.json +16 -0
- data/lib/outhad/integrations/source/pinecone_db/config/spec.json +34 -0
- data/lib/outhad/integrations/source/pinecone_db/icon.svg +2 -0
- data/lib/outhad/integrations/source/postgresql/client.rb +112 -0
- data/lib/outhad/integrations/source/postgresql/config/meta.json +16 -0
- data/lib/outhad/integrations/source/postgresql/config/spec.json +86 -0
- data/lib/outhad/integrations/source/postgresql/icon.svg +20 -0
- data/lib/outhad/integrations/source/qdrant/client.rb +86 -0
- data/lib/outhad/integrations/source/qdrant/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/qdrant/config/meta.json +16 -0
- data/lib/outhad/integrations/source/qdrant/config/spec.json +29 -0
- data/lib/outhad/integrations/source/qdrant/icon.svg +1 -0
- data/lib/outhad/integrations/source/redshift/client.rb +109 -0
- data/lib/outhad/integrations/source/redshift/config/meta.json +16 -0
- data/lib/outhad/integrations/source/redshift/config/spec.json +71 -0
- data/lib/outhad/integrations/source/redshift/icon.svg +15 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/client.rb +133 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/config/meta.json +18 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/config/spec.json +53 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/icon.svg +16 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/schema_helper.rb +130 -0
- data/lib/outhad/integrations/source/sftp/client.rb +133 -0
- data/lib/outhad/integrations/source/sftp/config/meta.json +16 -0
- data/lib/outhad/integrations/source/sftp/config/spec.json +59 -0
- data/lib/outhad/integrations/source/sftp/icon.svg +1 -0
- data/lib/outhad/integrations/source/snowflake/client.rb +92 -0
- data/lib/outhad/integrations/source/snowflake/config/meta.json +16 -0
- data/lib/outhad/integrations/source/snowflake/config/spec.json +82 -0
- data/lib/outhad/integrations/source/snowflake/icon.svg +10 -0
- data/lib/outhad/integrations/source/watsonx_ai/client.rb +194 -0
- data/lib/outhad/integrations/source/watsonx_ai/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/watsonx_ai/config/meta.json +16 -0
- data/lib/outhad/integrations/source/watsonx_ai/config/spec.json +74 -0
- data/lib/outhad/integrations/source/watsonx_ai/icon.svg +1 -0
- data/lib/outhad/integrations/source/watsonx_data/client.rb +146 -0
- data/lib/outhad/integrations/source/watsonx_data/config/meta.json +17 -0
- data/lib/outhad/integrations/source/watsonx_data/config/spec.json +72 -0
- data/lib/outhad/integrations/source/watsonx_data/icon.svg +1 -0
- data/lib/outhad/integrations.rb +129 -0
- data/outhad-integrations.gemspec +79 -0
- data/sig/outhad/integrations.rbs +6 -0
- metadata +866 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 309.88 252.72">
|
3
|
+
<defs>
|
4
|
+
<style>.cls-1{fill:#003545;}</style>
|
5
|
+
</defs>
|
6
|
+
<title>MDB-VLogo_RGB</title>
|
7
|
+
<path class="cls-1" d="M61.74,214.91,73,258.46h-8.5L57,227.09,42.86,258.46H35.68L21.62,227.27,13.9,258.46H5.58l11.16-43.55H24.1l15.2,33.72,15.14-33.72Z" transform="translate(-5.58 -6.4)"></path>
|
8
|
+
<path class="cls-1" d="M105.11,231.74v-5.07h8.21v31.79h-8.21v-5.12c-2.17,3.68-6.63,5.79-12.06,5.79-11.35,0-17.68-8-17.68-17.2,0-8.87,6-16,16.47-16C97.81,226,102.76,228,105.11,231.74Zm-21,10.62c0,5.85,3.68,10.86,10.8,10.86,6.87,0,10.61-4.89,10.61-10.68s-3.86-10.74-11-10.74C87.68,231.8,84.12,236.74,84.12,242.36Z" transform="translate(-5.58 -6.4)"></path>
|
9
|
+
<path class="cls-1" d="M131.83,258.46h-8.2V226.67h8.2v7.12A12.58,12.58,0,0,1,143.29,226a14.84,14.84,0,0,1,5.13.84l-1.75,6a18,18,0,0,0-4.34-.6c-5.92,0-10.5,4.46-10.5,11Z" transform="translate(-5.58 -6.4)"></path>
|
10
|
+
<path class="cls-1" d="M152.52,218.28a4.17,4.17,0,0,1,4.4-4.28,4.33,4.33,0,0,1,4.47,4.41,4.15,4.15,0,0,1-4.47,4.22A4.22,4.22,0,0,1,152.52,218.28Zm.36,8.39h8.21V249.9c0,1.44.3,2.47,1.5,2.47a8.85,8.85,0,0,0,1.57-.18l1.27,6a14.36,14.36,0,0,1-5.43,1c-3.44,0-7.12-1-7.12-8.81Z" transform="translate(-5.58 -6.4)"></path>
|
11
|
+
<path class="cls-1" d="M197.76,231.74v-5.07H206v31.79h-8.21v-5.12c-2.17,3.68-6.63,5.79-12.06,5.79-11.34,0-17.68-8-17.68-17.2,0-8.87,6-16,16.47-16C190.46,226,195.41,228,197.76,231.74Zm-21,10.62c0,5.85,3.68,10.86,10.8,10.86,6.88,0,10.62-4.89,10.62-10.68s-3.87-10.74-11-10.74C180.33,231.8,176.77,236.74,176.77,242.36Z" transform="translate(-5.58 -6.4)"></path>
|
12
|
+
<path class="cls-1" d="M218.57,214.91h19.67c16.53,0,24.79,9.11,24.67,21.77.12,13.16-9,21.78-23.22,21.78H218.57Zm5.43,3.86v35.89h15c13.15,0,18.16-8.87,18.16-18.1,0-10.43-6.27-17.79-18.16-17.79Z" transform="translate(-5.58 -6.4)"></path>
|
13
|
+
<path class="cls-1" d="M296.45,258.46h-25V214.91H294c8.62,0,16.83,1.62,16.71,11.28,0,6.81-4.23,8.69-8.69,9.41,6.33.54,10.14,4.58,10.14,11.1C312.2,256.47,303.63,258.46,296.45,258.46Zm-1.87-24.55c8.63,0,10.56-3.32,10.56-7.54,0-6.34-3.86-7.78-10.56-7.78H276.66v15.32Zm.24,3.68H276.66v17.19H295.6c5.31,0,10.92-1.75,10.92-8.44C306.52,238.62,300.07,237.59,294.82,237.59Z" transform="translate(-5.58 -6.4)"></path>
|
14
|
+
<path class="cls-1" d="M314.08,7.35a4.18,4.18,0,0,0-2.84-.95c-2.83,0-6.49,1.92-8.46,2.95l-.78.4a26.86,26.86,0,0,1-10.57,2.66c-3.76.12-7,.34-11.22.78-25,2.57-36.15,21.73-46.89,40.26C227.47,63.53,221.43,74,213.15,82a54.4,54.4,0,0,1-5.45,4.63C199.13,93,188.37,97.55,180,100.77c-8.06,3.08-16.86,5.85-25.36,8.53-7.79,2.45-15.14,4.77-21.9,7.28-3.05,1.13-5.64,2-7.93,2.76-6.16,2-10.6,3.53-17.09,8-2.53,1.73-5.07,3.6-6.79,5a71.62,71.62,0,0,0-13.55,14.27A84.25,84.25,0,0,1,76,160.27c-1.37,1.34-3.8,2-7.44,2-4.26,0-9.43-.88-14.9-1.81-5.64-1-11.47-1.95-16.47-1.95-4.06,0-7.17.66-9.49,2,0,0-3.91,2.28-5.56,5.23l1.62.73a33.21,33.21,0,0,1,6.92,5,34.72,34.72,0,0,0,7.2,5.12A6.18,6.18,0,0,1,40.1,178c-.68,1-1.68,2.29-2.73,3.67-5.77,7.55-9.14,12.32-7.21,14.92a6.07,6.07,0,0,0,3,.68c12.58,0,19.34-3.27,27.89-7.41,2.48-1.2,5-2.43,8-3.7,5-2.17,10.38-5.63,16.09-9.29C92.61,172,100.42,167,108,164.59a62.3,62.3,0,0,1,19.23-2.7c8,0,16.42,1.07,24.54,2.11,6.05.78,12.32,1.58,18.47,1.95,2.39.14,4.6.21,6.75.21a78.21,78.21,0,0,0,8.61-.45l.69-.24c4.31-2.65,6.33-8.34,8.29-13.84,1.26-3.54,2.32-6.72,4-8.74a2.55,2.55,0,0,1,.32-.27.4.4,0,0,1,.49.08s0,.05,0,.16c-1,21.51-9.66,35.17-18.42,47.31l-5.85,6.27s8.19,0,12.85-1.8c17-5.08,29.83-16.28,39.17-34.14a145.7,145.7,0,0,0,6.17-14.09c.16-.4,1.63-1.14,1.49.93-.05.61-.09,1.29-.14,2h0c0,.42,0,.85-.08,1.28-.24,3-.95,9.34-.95,9.34l5.25-2.81c12.66-8,22.42-24.14,29.82-49.25,3.08-10.46,5.34-20.85,7.33-30,2.38-11,4.43-20.43,6.78-24.09,3.69-5.74,9.32-9.62,14.77-13.39.74-.51,1.49-1,2.22-1.54,6.85-4.81,13.66-10.36,15.16-20.71l0-.23C316.05,10.22,315.13,8.25,314.08,7.35Z" transform="translate(-5.58 -6.4)"></path>
|
15
|
+
</svg>
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Outhad::Integrations::Source
|
4
|
+
module Odoo
|
5
|
+
include Outhad::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_outhad_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 = batched_query(query, sync_config.limit, sync_config.offset) unless sync_config.limit.nil? && sync_config.offset.nil?
|
36
|
+
query(connection_config, query)
|
37
|
+
rescue StandardError => e
|
38
|
+
handle_exception(e, {
|
39
|
+
context: "ODOO:READ: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 create_streams(connection_config, models)
|
49
|
+
models.map do |model|
|
50
|
+
fields = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
|
51
|
+
model["model"], "fields_get", [], { 'attributes': %w[name type] })
|
52
|
+
Outhad::Integrations::Protocol::Stream.new(name: model["model"], action: StreamAction["fetch"],
|
53
|
+
supported_sync_modes: %w[incremental], json_schema: convert_to_json_schema(fields))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def convert_to_json_schema(fields)
|
58
|
+
json_schema = {
|
59
|
+
"type" => "object",
|
60
|
+
"properties" => {}
|
61
|
+
}
|
62
|
+
fields.each do |field|
|
63
|
+
column_name = field[1]["name"]
|
64
|
+
type = field[1]["type"]
|
65
|
+
json_schema["properties"][column_name] = {
|
66
|
+
"type" => type
|
67
|
+
}
|
68
|
+
end
|
69
|
+
json_schema
|
70
|
+
end
|
71
|
+
|
72
|
+
def create_connection(connection_config)
|
73
|
+
common = XMLRPC::Client.new2("#{connection_config[:url]}/xmlrpc/2/common")
|
74
|
+
common.call("version")
|
75
|
+
@uid = common.call("authenticate", connection_config[:database], connection_config[:username],
|
76
|
+
connection_config[:password], { 'raise_exception': true })
|
77
|
+
@client = XMLRPC::Client.new2("#{connection_config[:url]}/xmlrpc/2/object").proxy
|
78
|
+
connection_config
|
79
|
+
end
|
80
|
+
|
81
|
+
def query(connection, query)
|
82
|
+
limit = 0
|
83
|
+
offset = 0
|
84
|
+
order = "id DESC"
|
85
|
+
|
86
|
+
limit = query.match(/LIMIT (\d+)/)[1].to_i if query.include? "LIMIT"
|
87
|
+
offset = query.match(/OFFSET (\d+)/)[1].to_i if query.include? "OFFSET"
|
88
|
+
order = query.match(/ORDER BY (.*) LIMIT/)[1] if query.include? "ORDER BY"
|
89
|
+
model = query.match(/FROM ([aA-zZ.aA-zZ]*)/i)[1]
|
90
|
+
|
91
|
+
columns = if query.include? "SELECT *"
|
92
|
+
[]
|
93
|
+
else
|
94
|
+
query.match(/SELECT (.*) FROM/)[1].strip.downcase.split(", ")
|
95
|
+
end
|
96
|
+
|
97
|
+
records = @client.execute_kw(connection[:database], @uid, connection[:password],
|
98
|
+
model, "search_read", [], { limit: limit,
|
99
|
+
offset: offset, order: order, 'fields': columns })
|
100
|
+
records.map do |row|
|
101
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_outhad_message
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
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", "outhad"]
|
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
|
+
"outhad_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>
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Outhad::Integrations::Source
|
4
|
+
module OpenAI
|
5
|
+
include Outhad::Integrations::Core
|
6
|
+
class Client < SourceConnector
|
7
|
+
def check_connection(connection_config)
|
8
|
+
connection_config = prepare_config(connection_config)
|
9
|
+
response = send_request(
|
10
|
+
url: OPEN_AI_URL,
|
11
|
+
http_method: HTTP_POST,
|
12
|
+
payload: JSON.parse(connection_config[:request_format]),
|
13
|
+
headers: auth_headers(connection_config[:api_key]),
|
14
|
+
config: connection_config[:config]
|
15
|
+
)
|
16
|
+
success?(response) ? success_status : failure_status(nil)
|
17
|
+
rescue StandardError => e
|
18
|
+
handle_exception(e, { context: "OPEN AI:CHECK_CONNECTION:EXCEPTION", type: "error" })
|
19
|
+
failure_status(e)
|
20
|
+
end
|
21
|
+
|
22
|
+
def discover(_connection_config = nil)
|
23
|
+
catalog_json = read_json(CATALOG_SPEC_PATH)
|
24
|
+
catalog = build_catalog(catalog_json)
|
25
|
+
catalog.to_outhad_message
|
26
|
+
rescue StandardError => e
|
27
|
+
handle_exception(e, { context: "OPEN AI:DISCOVER:EXCEPTION", type: "error" })
|
28
|
+
end
|
29
|
+
|
30
|
+
def read(sync_config)
|
31
|
+
connection_config = prepare_config(sync_config.source.connection_specification)
|
32
|
+
stream = connection_config[:is_stream] ||= false
|
33
|
+
# The server checks the ConnectorQueryType.
|
34
|
+
# If it's "ai_ml," the server calculates the payload and passes it as a query in the sync config model protocol.
|
35
|
+
# This query is then sent to the AI/ML model.
|
36
|
+
payload = parse_json(sync_config.model.query)
|
37
|
+
|
38
|
+
if stream
|
39
|
+
run_model_stream(connection_config, payload) { |message| yield message if block_given? }
|
40
|
+
else
|
41
|
+
run_model(connection_config, payload)
|
42
|
+
end
|
43
|
+
rescue StandardError => e
|
44
|
+
handle_exception(e, { context: "OPEN AI:READ:EXCEPTION", type: "error" })
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def prepare_config(config)
|
50
|
+
config.with_indifferent_access.tap do |conf|
|
51
|
+
conf[:config][:timeout] ||= 30
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def parse_json(json_string)
|
56
|
+
JSON.parse(json_string)
|
57
|
+
rescue JSON::ParserError => e
|
58
|
+
handle_exception(e, { context: "OPEN AI:PARSE_JSON:EXCEPTION", type: "error" })
|
59
|
+
{}
|
60
|
+
end
|
61
|
+
|
62
|
+
def run_model(connection_config, payload)
|
63
|
+
response = send_request(
|
64
|
+
url: OPEN_AI_URL,
|
65
|
+
http_method: HTTP_POST,
|
66
|
+
payload: payload,
|
67
|
+
headers: auth_headers(connection_config[:api_key]),
|
68
|
+
config: connection_config[:config]
|
69
|
+
)
|
70
|
+
process_response(response)
|
71
|
+
rescue StandardError => e
|
72
|
+
handle_exception(e, { context: "OPEN AI:RUN_MODEL:EXCEPTION", type: "error" })
|
73
|
+
end
|
74
|
+
|
75
|
+
def run_model_stream(connection_config, payload)
|
76
|
+
send_streaming_request(
|
77
|
+
url: OPEN_AI_URL,
|
78
|
+
http_method: HTTP_POST,
|
79
|
+
payload: payload,
|
80
|
+
headers: auth_headers(connection_config[:api_key]),
|
81
|
+
config: connection_config[:config]
|
82
|
+
) do |chunk|
|
83
|
+
process_streaming_response(chunk) { |message| yield message if block_given? }
|
84
|
+
end
|
85
|
+
rescue StandardError => e
|
86
|
+
handle_exception(e, { context: "OPEN AI:RUN_STREAM_MODEL:EXCEPTION", type: "error" })
|
87
|
+
end
|
88
|
+
|
89
|
+
def process_response(response)
|
90
|
+
if success?(response)
|
91
|
+
data = JSON.parse(response.body)
|
92
|
+
[RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_outhad_message]
|
93
|
+
else
|
94
|
+
create_log_message("OPEN AI:RUN_MODEL", "error", "request failed: #{response.body}")
|
95
|
+
end
|
96
|
+
rescue StandardError => e
|
97
|
+
handle_exception(e, { context: "OPEN AI:PROCESS_RESPONSE:EXCEPTION", type: "error" })
|
98
|
+
end
|
99
|
+
|
100
|
+
def extract_data_entries(chunk)
|
101
|
+
chunk.split(/^data: /).map(&:strip).reject(&:empty?)
|
102
|
+
end
|
103
|
+
|
104
|
+
def process_streaming_response(chunk)
|
105
|
+
data_entries = extract_data_entries(chunk)
|
106
|
+
data_entries.each do |entry|
|
107
|
+
next if entry == "[DONE]"
|
108
|
+
|
109
|
+
data = parse_json(entry)
|
110
|
+
|
111
|
+
raise StandardError, "Error: #{data["error"]["message"]}" if data["error"] && data["error"]["message"]
|
112
|
+
|
113
|
+
yield [RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_outhad_message] if block_given?
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "OpenAI",
|
4
|
+
"title": "OpenAI Model Endpoint",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "AI Model",
|
7
|
+
"sub_category": "LLM",
|
8
|
+
"documentation_url": "https://docs.squared.ai/activation/ai-ml-sources/open_ai-model",
|
9
|
+
"github_issue_label": "source-open-ai-model",
|
10
|
+
"icon": "icon.svg",
|
11
|
+
"license": "MIT",
|
12
|
+
"release_stage": "alpha",
|
13
|
+
"support_level": "community",
|
14
|
+
"tags": ["language:ruby", "outhad"]
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.squared.ai/activation/ai-ml-sources/open_ai-model",
|
3
|
+
"stream_type": "user_defined",
|
4
|
+
"connector_query_type": "ai_ml",
|
5
|
+
"connection_specification": {
|
6
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
7
|
+
"title": "Open AI Endpoint",
|
8
|
+
"type": "object",
|
9
|
+
"required": ["api_key", "request_format", "response_format"],
|
10
|
+
"properties": {
|
11
|
+
"api_key": {
|
12
|
+
"type": "string",
|
13
|
+
"outhad_secret": true,
|
14
|
+
"title": "API Key",
|
15
|
+
"order": 0
|
16
|
+
},
|
17
|
+
"is_stream": {
|
18
|
+
"type": "boolean",
|
19
|
+
"title": "Enable streaming",
|
20
|
+
"description": "Enables data streaming for such as chat, when supported by the model. When true, messages and model data are processed in chunks for immediate delivery, enhancing responsiveness. Default is false, processing only after the entire response is received.",
|
21
|
+
"default": false,
|
22
|
+
"order": 1
|
23
|
+
},
|
24
|
+
"config": {
|
25
|
+
"title": "",
|
26
|
+
"type": "object",
|
27
|
+
"properties": {
|
28
|
+
"timeout": {
|
29
|
+
"type": "string",
|
30
|
+
"default": "30",
|
31
|
+
"title": "HTTP Timeout",
|
32
|
+
"description": "The maximum time, in seconds, to wait for a response from the server before the request is canceled.",
|
33
|
+
"order": 0
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"order": 2
|
37
|
+
},
|
38
|
+
"request_format": {
|
39
|
+
"title": "Request Format",
|
40
|
+
"description": "Sample Request Format",
|
41
|
+
"type": "string",
|
42
|
+
"default": "{\"model\":\"gpt-4o-mini\", \"messages\":[{\"role\": \"user\", \"content\": \"What do you know about APIs?\"}], \"stream\": false}",
|
43
|
+
"x-request-format": true,
|
44
|
+
"order": 3
|
45
|
+
},
|
46
|
+
"response_format": {
|
47
|
+
"title": "Response Format",
|
48
|
+
"description": "Sample Response Format",
|
49
|
+
"type": "string",
|
50
|
+
"default": "{\"choices\":[{\"index\": 0, \"delta\":{\"role\": \"assistant\", \"content\": \"APIs, or Application Programming Interfaces, are tools that allow different software applications to communicate with each other. They define a set of rules and protocols for building and interacting with software applications.\"}, \"finish_reason\": \"stop\"}]}",
|
51
|
+
"x-response-format": true,
|
52
|
+
"order": 4
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg viewBox="0 0 1180 320" xmlns="http://www.w3.org/2000/svg"><path d="m367.44 153.84c0 52.32 33.6 88.8 80.16 88.8s80.16-36.48 80.16-88.8-33.6-88.8-80.16-88.8-80.16 36.48-80.16 88.8zm129.6 0c0 37.44-20.4 61.68-49.44 61.68s-49.44-24.24-49.44-61.68 20.4-61.68 49.44-61.68 49.44 24.24 49.44 61.68z"/><path d="m614.27 242.64c35.28 0 55.44-29.76 55.44-65.52s-20.16-65.52-55.44-65.52c-16.32 0-28.32 6.48-36.24 15.84v-13.44h-28.8v169.2h28.8v-56.4c7.92 9.36 19.92 15.84 36.24 15.84zm-36.96-69.12c0-23.76 13.44-36.72 31.2-36.72 20.88 0 32.16 16.32 32.16 40.32s-11.28 40.32-32.16 40.32c-17.76 0-31.2-13.2-31.2-36.48z"/><path d="m747.65 242.64c25.2 0 45.12-13.2 54-35.28l-24.72-9.36c-3.84 12.96-15.12 20.16-29.28 20.16-18.48 0-31.44-13.2-33.6-34.8h88.32v-9.6c0-34.56-19.44-62.16-55.92-62.16s-60 28.56-60 65.52c0 38.88 25.2 65.52 61.2 65.52zm-1.44-106.8c18.24 0 26.88 12 27.12 25.92h-57.84c4.32-17.04 15.84-25.92 30.72-25.92z"/><path d="m823.98 240h28.8v-73.92c0-18 13.2-27.6 26.16-27.6 15.84 0 22.08 11.28 22.08 26.88v74.64h28.8v-83.04c0-27.12-15.84-45.36-42.24-45.36-16.32 0-27.6 7.44-34.8 15.84v-13.44h-28.8z"/><path d="m1014.17 67.68-65.28 172.32h30.48l14.64-39.36h74.4l14.88 39.36h30.96l-65.28-172.32zm16.8 34.08 27.36 72h-54.24z"/><path d="m1163.69 68.18h-30.72v172.32h30.72z"/><path d="m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"/></svg>
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Outhad::Integrations::Source
|
4
|
+
module Oracle
|
5
|
+
include Outhad::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(
|
11
|
+
status: ConnectionStatusType["succeeded"]
|
12
|
+
).to_outhad_message
|
13
|
+
rescue StandardError => e
|
14
|
+
ConnectionStatus.new(
|
15
|
+
status: ConnectionStatusType["failed"], message: e.message
|
16
|
+
).to_outhad_message
|
17
|
+
end
|
18
|
+
|
19
|
+
def discover(connection_config)
|
20
|
+
records = []
|
21
|
+
connection_config = connection_config.with_indifferent_access
|
22
|
+
query = "SELECT table_name, column_name, data_type, nullable
|
23
|
+
FROM all_tab_columns
|
24
|
+
WHERE owner = '#{connection_config[:username].upcase}'
|
25
|
+
ORDER BY table_name, column_id"
|
26
|
+
conn = create_connection(connection_config)
|
27
|
+
cursor = conn.exec(query)
|
28
|
+
while (row = cursor.fetch)
|
29
|
+
records << row
|
30
|
+
end
|
31
|
+
catalog = Catalog.new(streams: create_streams(records))
|
32
|
+
catalog.to_outhad_message
|
33
|
+
rescue StandardError => e
|
34
|
+
handle_exception(
|
35
|
+
"ORACLE:DISCOVER:EXCEPTION",
|
36
|
+
"error",
|
37
|
+
e
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
def read(sync_config)
|
42
|
+
connection_config = sync_config.source.connection_specification.with_indifferent_access
|
43
|
+
query = sync_config.model.query
|
44
|
+
db = create_connection(connection_config)
|
45
|
+
query(db, query)
|
46
|
+
rescue StandardError => e
|
47
|
+
handle_exception(e, {
|
48
|
+
context: "ORACLE:READ:EXCEPTION",
|
49
|
+
type: "error",
|
50
|
+
sync_id: sync_config.sync_id,
|
51
|
+
sync_run_id: sync_config.sync_run_id
|
52
|
+
})
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def create_connection(connection_config)
|
58
|
+
OCI8.new(connection_config[:username], connection_config[:password], "#{connection_config[:host]}:#{connection_config[:port]}/#{connection_config[:sid]}")
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_streams(records)
|
62
|
+
group_by_table(records).map do |_, r|
|
63
|
+
Outhad::Integrations::Protocol::Stream.new(name: r[:tablename], action: StreamAction["fetch"], json_schema: convert_to_json_schema(r[:columns]))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def query(connection, query)
|
68
|
+
records = []
|
69
|
+
query = reformat_query(query)
|
70
|
+
cursor = connection.exec(query)
|
71
|
+
columns = cursor.get_col_names
|
72
|
+
while (row = cursor.fetch)
|
73
|
+
data_hash = columns.zip(row).to_h
|
74
|
+
records << RecordMessage.new(data: data_hash, emitted_at: Time.now.to_i).to_outhad_message
|
75
|
+
end
|
76
|
+
records
|
77
|
+
end
|
78
|
+
|
79
|
+
def group_by_table(records)
|
80
|
+
result = {}
|
81
|
+
records.each_with_index do |entry, index|
|
82
|
+
table_name = entry[0]
|
83
|
+
column_data = {
|
84
|
+
column_name: entry[1],
|
85
|
+
data_type: entry[2],
|
86
|
+
is_nullable: entry[3] == "Y"
|
87
|
+
}
|
88
|
+
result[index] ||= {}
|
89
|
+
result[index][:tablename] = table_name
|
90
|
+
result[index][:columns] = [column_data]
|
91
|
+
end
|
92
|
+
result.values.group_by { |entry| entry[:tablename] }.transform_values do |entries|
|
93
|
+
{ tablename: entries.first[:tablename], columns: entries.flat_map { |entry| entry[:columns] } }
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def reformat_query(sql_query)
|
98
|
+
offset = nil
|
99
|
+
limit = nil
|
100
|
+
|
101
|
+
sql_query = sql_query.gsub(";", "")
|
102
|
+
|
103
|
+
if sql_query.match?(/LIMIT (\d+)/i)
|
104
|
+
limit = sql_query.match(/LIMIT (\d+)/i)[1].to_i
|
105
|
+
sql_query.sub!(/LIMIT \d+/i, "")
|
106
|
+
end
|
107
|
+
|
108
|
+
if sql_query.match?(/OFFSET (\d+)/i)
|
109
|
+
offset = sql_query.match(/OFFSET (\d+)/i)[1].to_i
|
110
|
+
sql_query.sub!(/OFFSET \d+/i, "")
|
111
|
+
end
|
112
|
+
|
113
|
+
sql_query.strip!
|
114
|
+
|
115
|
+
if offset && limit
|
116
|
+
"#{sql_query} OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY"
|
117
|
+
elsif offset
|
118
|
+
"#{sql_query} OFFSET #{offset} ROWS"
|
119
|
+
elsif limit
|
120
|
+
"#{sql_query} FETCH NEXT #{limit} ROWS ONLY"
|
121
|
+
else
|
122
|
+
sql_query
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Oracle",
|
4
|
+
"title": "Oracle DB",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "Database",
|
7
|
+
"sub_category": "Relational Database",
|
8
|
+
"documentation_url": "https://docs.squared.ai/guides/sources/data-sources/oracle",
|
9
|
+
"github_issue_label": "source-oracle",
|
10
|
+
"icon": "icon.svg",
|
11
|
+
"license": "MIT",
|
12
|
+
"release_stage": "alpha",
|
13
|
+
"support_level": "community",
|
14
|
+
"tags": ["language:ruby", "outhad"]
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.squared.ai/guides/sources/data-sources/oracle",
|
3
|
+
"stream_type": "dynamic",
|
4
|
+
"connector_query_type": "raw_sql",
|
5
|
+
"connection_specification": {
|
6
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
7
|
+
"title": "Oracle",
|
8
|
+
"type": "object",
|
9
|
+
"required": ["host", "port", "sid", "username", "password"],
|
10
|
+
"properties": {
|
11
|
+
"host": {
|
12
|
+
"description": "The Oracle host.",
|
13
|
+
"examples": ["localhost"],
|
14
|
+
"type": "string",
|
15
|
+
"title": "Host",
|
16
|
+
"order": 0
|
17
|
+
},
|
18
|
+
"port": {
|
19
|
+
"description": "The Oracle port number.",
|
20
|
+
"examples": ["1521"],
|
21
|
+
"type": "string",
|
22
|
+
"title": "Port",
|
23
|
+
"order": 1
|
24
|
+
},
|
25
|
+
"sid": {
|
26
|
+
"description": "The name of your service in Oracle.",
|
27
|
+
"examples": ["ORCLPDB1"],
|
28
|
+
"type": "string",
|
29
|
+
"title": "SID",
|
30
|
+
"order": 2
|
31
|
+
},
|
32
|
+
"username": {
|
33
|
+
"description": "The username used to authenticate and connect.",
|
34
|
+
"type": "string",
|
35
|
+
"title": "Username",
|
36
|
+
"order": 3
|
37
|
+
},
|
38
|
+
"password": {
|
39
|
+
"description": "The password corresponding to the username used for authentication.",
|
40
|
+
"type": "string",
|
41
|
+
"outhad_secret": true,
|
42
|
+
"title": "Password",
|
43
|
+
"order": 4
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
@@ -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 width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path fill="#F00" fill-rule="evenodd" d="M7.957359,18.9123664 C4.11670252,18.9123664 1,15.803458 1,11.9617373 C1,8.12000773 4.11670252,5 7.957359,5 L16.0437948,5 C19.8855156,5 23,8.12000773 23,11.9617373 C23,15.803458 19.8855156,18.9123664 16.0437948,18.9123664 L7.957359,18.9123664 L7.957359,18.9123664 Z M15.8639176,16.4585488 C18.352201,16.4585488 20.3674397,14.448858 20.3674397,11.9617373 C20.3674397,9.47460595 18.352201,7.45381934 15.8639176,7.45381934 L8.1360824,7.45381934 C5.64895285,7.45381934 3.63255855,9.47460595 3.63255855,11.9617373 C3.63255855,14.448858 5.64895285,16.4585488 8.1360824,16.4585488 L15.8639176,16.4585488 L15.8639176,16.4585488 Z"/>
|
4
|
+
</svg>
|