Class: Outhad::Integrations::Core::BaseConnector
- Inherits:
-
Object
- Object
- Outhad::Integrations::Core::BaseConnector
- Defined in:
- lib/outhad/integrations/core/base_connector.rb
Direct Known Subclasses
Constant Summary
Constants included from Constants
Constants::AIRTABLE_BASES_ENDPOINT, Constants::AIRTABLE_GET_BASE_SCHEMA_ENDPOINT, Constants::AIRTABLE_URL_BASE, Constants::ANTHROPIC_URL, Constants::CATALOG_SPEC_PATH, Constants::CONNECTOR_SPEC_PATH, Constants::DATABRICKS_DRIVER_PATH, Constants::DATABRICKS_HEALTH_URL, Constants::DATABRICKS_MAC_DRIVER_PATH, Constants::DATABRICKS_SERVING_URL, Constants::FACEBOOK_AUDIENCE_GET_ALL_ACCOUNTS, Constants::FIRECRAWL_CRAWL_ACTIVE_URL, Constants::FIRECRAWL_CRAWL_URL, Constants::FIRECRAWL_GET_CRAWL_URL, Constants::FIRECRAWL_REQUEST_RATE_LIMIT, Constants::FIRECRAWL_SCRAPE_URL, Constants::GOOGLE_SHEETS_SCOPE, Constants::GOOGLE_SPREADSHEET_ID_REGEX, Constants::GOOGLE_VERTEX_ENDPOINT_SERVICE_URL, Constants::GOOGLE_VERTEX_MODEL_NAME, Constants::HTTP_DELETE, Constants::HTTP_GET, Constants::HTTP_PATCH, Constants::HTTP_POST, Constants::HTTP_PUT, Constants::INSTALL_HTTPFS_QUERY, Constants::JSON_SCHEMA_URL, Constants::KLAVIYO_AUTH_ENDPOINT, Constants::KLAVIYO_AUTH_PAYLOAD, Constants::META_DATA_PATH, Constants::MISTRAL_AI_MODEL, Constants::MS_DYNAMICS_REST_API, Constants::MS_DYNAMICS_WHOAMI_API, Constants::MS_EXCEL_AUTH_ENDPOINT, Constants::MS_EXCEL_FILES_API, Constants::MS_EXCEL_SHEET_RANGE_API, Constants::MS_EXCEL_TABLE_API, Constants::MS_EXCEL_TABLE_ROW_WRITE_API, Constants::MS_EXCEL_WORKSHEETS_API, Constants::OPEN_AI_URL, Constants::QDRANT_SEARCH_URL, Constants::QUICKBOOKS_PRODUCTION_QUERY_URL, Constants::QUICKBOOKS_REDIRECT_URL, Constants::QUICKBOOKS_SANDBOX_QUERY_URL, Constants::SNOWFLAKE_DRIVER_PATH, Constants::SNOWFLAKE_MAC_DRIVER_PATH, Constants::WATSONX_DATA_QUERIES_URL, Constants::WATSONX_GENERATION_DEPLOYMENT_URL, Constants::WATSONX_HEALTH_DEPLOYMENT_URL, Constants::WATSONX_PREDICTION_DEPLOYMENT_URL, Constants::WATSONX_STREAM_DEPLOYMENT_URL, Constants::ZENDESK_URL_SUFFIX
Constants included from Protocol
Protocol::CompressionType, Protocol::ConnectionStatusType, Protocol::ConnectorQueryType, Protocol::ConnectorType, Protocol::ControlMessageType, Protocol::DestinationSyncMode, Protocol::FileFormatType, Protocol::LogLevel, Protocol::ModelQueryType, Protocol::OuthadMessageType, Protocol::RequestRateLimitingUnit, Protocol::SchemaMode, Protocol::StreamAction, Protocol::StreamType, Protocol::SyncMode, Protocol::SyncStatus
Instance Method Summary collapse
-
#check_connection(_connection_config) ⇒ Object
Connection config is a hash.
- #connector_spec ⇒ Object
-
#discover(_connection_config) ⇒ Object
Connection config is a hash.
- #meta_data ⇒ Object
- #relative_path ⇒ Object
Methods included from Utils
#build_catalog, #build_stream, #convert_to_json_schema, #create_log_message, #extract_data, #handle_exception, #hash_to_string, #keys_to_symbols, #log_request_response, #logger, #map_type_to_json_schema, #report_exception, #success?
Instance Method Details
#check_connection(_connection_config) ⇒ Object
Connection config is a hash
37 38 39 40 |
# File 'lib/outhad/integrations/core/base_connector.rb', line 37 def check_connection(_connection_config) raise "Not implemented" # returns Protocol.ConnectionStatus end |
#connector_spec ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/outhad/integrations/core/base_connector.rb', line 10 def connector_spec @connector_spec ||= begin spec_json = keys_to_symbols(read_json(CONNECTOR_SPEC_PATH)).to_json # returns Protocol::ConnectorSpecification ConnectorSpecification.from_json(spec_json) end end |
#discover(_connection_config) ⇒ Object
Connection config is a hash
43 44 45 46 |
# File 'lib/outhad/integrations/core/base_connector.rb', line 43 def discover(_connection_config) raise "Not implemented" # returns Protocol::Catalog end |
#meta_data ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/outhad/integrations/core/base_connector.rb', line 18 def = read_json(META_DATA_PATH).deep_symbolize_keys icon_name = [:data][:icon] icon_url = "https://raw.githubusercontent.com/Outhad/outhad/main/integrations#{relative_path}/#{icon_name}" [:data][:icon] = icon_url # returns hash @meta_data ||= end |
#relative_path ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/outhad/integrations/core/base_connector.rb', line 27 def relative_path path = Object.const_source_location(self.class.to_s)[0] connector_folder = File.dirname(path) marker = "/lib/outhad/integrations/" parts = connector_folder.split(marker) marker + parts.last if parts.length > 1 end |