mage-integrations 0.2.1__py3-none-any.whl
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.
- mage_integrations/__init__.py +0 -0
- mage_integrations/connections/__init__.py +0 -0
- mage_integrations/connections/airtable/__init__.py +31 -0
- mage_integrations/connections/base.py +19 -0
- mage_integrations/connections/bigquery/__init__.py +49 -0
- mage_integrations/connections/constants.py +3 -0
- mage_integrations/connections/couchbase/__init__.py +43 -0
- mage_integrations/connections/doris/__init__.py +89 -0
- mage_integrations/connections/dremio/__init__.py +104 -0
- mage_integrations/connections/google_analytics/__init__.py +104 -0
- mage_integrations/connections/google_analytics/constants.py +266 -0
- mage_integrations/connections/google_analytics/utils.py +14 -0
- mage_integrations/connections/google_cloud_storage/__init__.py +33 -0
- mage_integrations/connections/google_search_console/__init__.py +58 -0
- mage_integrations/connections/google_sheets/__init__.py +96 -0
- mage_integrations/connections/mssql/__init__.py +60 -0
- mage_integrations/connections/mysql/__init__.py +93 -0
- mage_integrations/connections/oracledb/__init__.py +33 -0
- mage_integrations/connections/postgresql/__init__.py +39 -0
- mage_integrations/connections/redshift/__init__.py +45 -0
- mage_integrations/connections/snowflake/__init__.py +47 -0
- mage_integrations/connections/sql/__init__.py +0 -0
- mage_integrations/connections/sql/base.py +124 -0
- mage_integrations/connections/teradata/__init__.py +33 -0
- mage_integrations/connections/trino/__init__.py +40 -0
- mage_integrations/connections/trino/connection_wrapper.py +28 -0
- mage_integrations/connections/utils/__init__.py +0 -0
- mage_integrations/connections/utils/google.py +14 -0
- mage_integrations/connections/utils/sql.py +2 -0
- mage_integrations/destinations/__init__.py +0 -0
- mage_integrations/destinations/airtable/Readme.md +27 -0
- mage_integrations/destinations/airtable/__init__.py +92 -0
- mage_integrations/destinations/airtable/templates/config.json +4 -0
- mage_integrations/destinations/amazon_s3/README.md +24 -0
- mage_integrations/destinations/amazon_s3/__init__.py +172 -0
- mage_integrations/destinations/amazon_s3/templates/config.json +10 -0
- mage_integrations/destinations/amplitude/README.md +58 -0
- mage_integrations/destinations/amplitude/__init__.py +91 -0
- mage_integrations/destinations/amplitude/templates/config.json +5 -0
- mage_integrations/destinations/base.py +810 -0
- mage_integrations/destinations/bigquery/README.md +54 -0
- mage_integrations/destinations/bigquery/__init__.py +834 -0
- mage_integrations/destinations/bigquery/constants.py +8 -0
- mage_integrations/destinations/bigquery/templates/config.json +8 -0
- mage_integrations/destinations/bigquery/utils.py +304 -0
- mage_integrations/destinations/clickhouse/LICENSE +201 -0
- mage_integrations/destinations/clickhouse/README.md +14 -0
- mage_integrations/destinations/clickhouse/__init__.py +32 -0
- mage_integrations/destinations/clickhouse/target_clickhouse/__init__.py +1 -0
- mage_integrations/destinations/clickhouse/target_clickhouse/sinks.py +234 -0
- mage_integrations/destinations/clickhouse/target_clickhouse/target.py +137 -0
- mage_integrations/destinations/clickhouse/templates/config.json +4 -0
- mage_integrations/destinations/constants.py +50 -0
- mage_integrations/destinations/delta_lake/README.md +0 -0
- mage_integrations/destinations/delta_lake/__init__.py +0 -0
- mage_integrations/destinations/delta_lake/base.py +227 -0
- mage_integrations/destinations/delta_lake/constants.py +2 -0
- mage_integrations/destinations/delta_lake_azure/README.md +18 -0
- mage_integrations/destinations/delta_lake_azure/__init__.py +45 -0
- mage_integrations/destinations/delta_lake_azure/templates/config.json +6 -0
- mage_integrations/destinations/delta_lake_s3/README.md +21 -0
- mage_integrations/destinations/delta_lake_s3/__init__.py +130 -0
- mage_integrations/destinations/delta_lake_s3/templates/config.json +9 -0
- mage_integrations/destinations/doris/README.md +32 -0
- mage_integrations/destinations/doris/__init__.py +209 -0
- mage_integrations/destinations/doris/constants.py +755 -0
- mage_integrations/destinations/doris/templates/config.json +9 -0
- mage_integrations/destinations/doris/utils.py +118 -0
- mage_integrations/destinations/elasticsearch/README.md +57 -0
- mage_integrations/destinations/elasticsearch/__init__.py +37 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/__init__.py +0 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/common.py +32 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/sinks.py +262 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/target.py +267 -0
- mage_integrations/destinations/elasticsearch/templates/config.json +8 -0
- mage_integrations/destinations/google_cloud_storage/README.md +19 -0
- mage_integrations/destinations/google_cloud_storage/__init__.py +109 -0
- mage_integrations/destinations/google_cloud_storage/templates/config.json +8 -0
- mage_integrations/destinations/kafka/README.md +18 -0
- mage_integrations/destinations/kafka/__init__.py +91 -0
- mage_integrations/destinations/kafka/templates/config.json +5 -0
- mage_integrations/destinations/mongodb/README.md +11 -0
- mage_integrations/destinations/mongodb/__init__.py +28 -0
- mage_integrations/destinations/mongodb/target_mongodb/__init__.py +0 -0
- mage_integrations/destinations/mongodb/target_mongodb/sinks.py +135 -0
- mage_integrations/destinations/mongodb/target_mongodb/target.py +169 -0
- mage_integrations/destinations/mongodb/templates/config.json +5 -0
- mage_integrations/destinations/mssql/README.md +31 -0
- mage_integrations/destinations/mssql/__init__.py +214 -0
- mage_integrations/destinations/mssql/templates/config.json +10 -0
- mage_integrations/destinations/mssql/utils.py +101 -0
- mage_integrations/destinations/mysql/README.md +36 -0
- mage_integrations/destinations/mysql/__init__.py +215 -0
- mage_integrations/destinations/mysql/constants.py +755 -0
- mage_integrations/destinations/mysql/templates/config.json +9 -0
- mage_integrations/destinations/mysql/utils.py +154 -0
- mage_integrations/destinations/opensearch/README.md +22 -0
- mage_integrations/destinations/opensearch/__init__.py +35 -0
- mage_integrations/destinations/opensearch/target_opensearch/__init__.py +0 -0
- mage_integrations/destinations/opensearch/target_opensearch/common.py +30 -0
- mage_integrations/destinations/opensearch/target_opensearch/sinks.py +221 -0
- mage_integrations/destinations/opensearch/target_opensearch/target.py +241 -0
- mage_integrations/destinations/opensearch/templates/config.json +5 -0
- mage_integrations/destinations/oracledb/README.md +22 -0
- mage_integrations/destinations/oracledb/__init__.py +241 -0
- mage_integrations/destinations/oracledb/templates/config.json +10 -0
- mage_integrations/destinations/oracledb/utils.py +114 -0
- mage_integrations/destinations/postgresql/README.md +30 -0
- mage_integrations/destinations/postgresql/__init__.py +264 -0
- mage_integrations/destinations/postgresql/templates/config.json +9 -0
- mage_integrations/destinations/postgresql/utils.py +77 -0
- mage_integrations/destinations/redshift/README.md +45 -0
- mage_integrations/destinations/redshift/__init__.py +306 -0
- mage_integrations/destinations/redshift/constants.py +155 -0
- mage_integrations/destinations/redshift/templates/config.json +11 -0
- mage_integrations/destinations/redshift/utils.py +28 -0
- mage_integrations/destinations/salesforce/README.md +38 -0
- mage_integrations/destinations/salesforce/__init__.py +37 -0
- mage_integrations/destinations/salesforce/target_salesforce/__init__.py +0 -0
- mage_integrations/destinations/salesforce/target_salesforce/session_credentials.py +96 -0
- mage_integrations/destinations/salesforce/target_salesforce/sinks.py +161 -0
- mage_integrations/destinations/salesforce/target_salesforce/target.py +182 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/__init__.py +0 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/exceptions.py +10 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/transformation.py +25 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/validation.py +54 -0
- mage_integrations/destinations/salesforce/templates/config.json +8 -0
- mage_integrations/destinations/sink.py +594 -0
- mage_integrations/destinations/snowflake/README.md +39 -0
- mage_integrations/destinations/snowflake/__init__.py +582 -0
- mage_integrations/destinations/snowflake/constants.py +1 -0
- mage_integrations/destinations/snowflake/templates/config.json +14 -0
- mage_integrations/destinations/snowflake/utils.py +92 -0
- mage_integrations/destinations/sql/__init__.py +0 -0
- mage_integrations/destinations/sql/base.py +435 -0
- mage_integrations/destinations/sql/constants.py +843 -0
- mage_integrations/destinations/sql/utils.py +363 -0
- mage_integrations/destinations/sqlsink.py +414 -0
- mage_integrations/destinations/target.py +561 -0
- mage_integrations/destinations/teradata/README.md +18 -0
- mage_integrations/destinations/teradata/__init__.py +357 -0
- mage_integrations/destinations/teradata/templates/config.json +7 -0
- mage_integrations/destinations/teradata/utils.py +103 -0
- mage_integrations/destinations/trino/README.md +84 -0
- mage_integrations/destinations/trino/__init__.py +27 -0
- mage_integrations/destinations/trino/connectors/__init__.py +0 -0
- mage_integrations/destinations/trino/connectors/base.py +325 -0
- mage_integrations/destinations/trino/connectors/deltalake.py +53 -0
- mage_integrations/destinations/trino/connectors/iceberg.py +19 -0
- mage_integrations/destinations/trino/templates/config.json +14 -0
- mage_integrations/destinations/trino/utils.py +33 -0
- mage_integrations/destinations/utils.py +50 -0
- mage_integrations/sources/README.md +3 -0
- mage_integrations/sources/__init__.py +0 -0
- mage_integrations/sources/airtable/README.md +27 -0
- mage_integrations/sources/airtable/__init__.py +180 -0
- mage_integrations/sources/airtable/templates/config.json +5 -0
- mage_integrations/sources/amazon_s3/README.md +25 -0
- mage_integrations/sources/amazon_s3/__init__.py +298 -0
- mage_integrations/sources/amazon_s3/templates/config.json +11 -0
- mage_integrations/sources/amplitude/README.md +67 -0
- mage_integrations/sources/amplitude/__init__.py +356 -0
- mage_integrations/sources/amplitude/constants.py +58 -0
- mage_integrations/sources/amplitude/schemas/active_users.json +28 -0
- mage_integrations/sources/amplitude/schemas/annotations.json +54 -0
- mage_integrations/sources/amplitude/schemas/average_session_length.json +28 -0
- mage_integrations/sources/amplitude/schemas/cohort_members.json +34 -0
- mage_integrations/sources/amplitude/schemas/cohorts.json +144 -0
- mage_integrations/sources/amplitude/schemas/event_properties.json +72 -0
- mage_integrations/sources/amplitude/schemas/event_types.json +77 -0
- mage_integrations/sources/amplitude/schemas/events.json +349 -0
- mage_integrations/sources/amplitude/schemas/new_users.json +28 -0
- mage_integrations/sources/amplitude/schemas/sessions_per_user.json +28 -0
- mage_integrations/sources/amplitude/schemas/user_properties.json +66 -0
- mage_integrations/sources/amplitude/templates/config.json +7 -0
- mage_integrations/sources/amplitude/templates/query.json +4 -0
- mage_integrations/sources/api/README.md +211 -0
- mage_integrations/sources/api/__init__.py +279 -0
- mage_integrations/sources/api/templates/config.json +9 -0
- mage_integrations/sources/azure_blob_storage/README.md +21 -0
- mage_integrations/sources/azure_blob_storage/__init__.py +160 -0
- mage_integrations/sources/azure_blob_storage/templates/config.json +5 -0
- mage_integrations/sources/base.py +781 -0
- mage_integrations/sources/bigquery/README.md +49 -0
- mage_integrations/sources/bigquery/__init__.py +56 -0
- mage_integrations/sources/bigquery/templates/config.json +4 -0
- mage_integrations/sources/catalog.py +125 -0
- mage_integrations/sources/chargebee/README.md +21 -0
- mage_integrations/sources/chargebee/__init__.py +83 -0
- mage_integrations/sources/chargebee/client.py +194 -0
- mage_integrations/sources/chargebee/schemas/common/cards.json +57 -0
- mage_integrations/sources/chargebee/schemas/common/comments.json +30 -0
- mage_integrations/sources/chargebee/schemas/common/credit_notes.json +404 -0
- mage_integrations/sources/chargebee/schemas/common/customers.json +428 -0
- mage_integrations/sources/chargebee/schemas/common/gifts.json +85 -0
- mage_integrations/sources/chargebee/schemas/common/invoices.json +680 -0
- mage_integrations/sources/chargebee/schemas/common/orders.json +431 -0
- mage_integrations/sources/chargebee/schemas/common/payment_sources.json +180 -0
- mage_integrations/sources/chargebee/schemas/common/promotional_credits.json +46 -0
- mage_integrations/sources/chargebee/schemas/common/quotes.json +380 -0
- mage_integrations/sources/chargebee/schemas/common/transactions.json +241 -0
- mage_integrations/sources/chargebee/schemas/common/virtual_bank_accounts.json +56 -0
- mage_integrations/sources/chargebee/schemas/item_model/coupons.json +251 -0
- mage_integrations/sources/chargebee/schemas/item_model/events.json +653 -0
- mage_integrations/sources/chargebee/schemas/item_model/item_families.json +63 -0
- mage_integrations/sources/chargebee/schemas/item_model/item_prices.json +342 -0
- mage_integrations/sources/chargebee/schemas/item_model/items.json +187 -0
- mage_integrations/sources/chargebee/schemas/item_model/subscriptions.json +873 -0
- mage_integrations/sources/chargebee/schemas/plan_model/addons.json +163 -0
- mage_integrations/sources/chargebee/schemas/plan_model/coupons.json +103 -0
- mage_integrations/sources/chargebee/schemas/plan_model/events.json +647 -0
- mage_integrations/sources/chargebee/schemas/plan_model/plans.json +250 -0
- mage_integrations/sources/chargebee/schemas/plan_model/subscriptions.json +465 -0
- mage_integrations/sources/chargebee/state.py +44 -0
- mage_integrations/sources/chargebee/streams/__init__.py +69 -0
- mage_integrations/sources/chargebee/streams/addons.py +19 -0
- mage_integrations/sources/chargebee/streams/base.py +244 -0
- mage_integrations/sources/chargebee/streams/comments.py +19 -0
- mage_integrations/sources/chargebee/streams/coupons.py +24 -0
- mage_integrations/sources/chargebee/streams/credit_notes.py +19 -0
- mage_integrations/sources/chargebee/streams/customers.py +19 -0
- mage_integrations/sources/chargebee/streams/events.py +24 -0
- mage_integrations/sources/chargebee/streams/gifts.py +19 -0
- mage_integrations/sources/chargebee/streams/invoices.py +19 -0
- mage_integrations/sources/chargebee/streams/item_families.py +19 -0
- mage_integrations/sources/chargebee/streams/item_prices.py +19 -0
- mage_integrations/sources/chargebee/streams/items.py +19 -0
- mage_integrations/sources/chargebee/streams/orders.py +19 -0
- mage_integrations/sources/chargebee/streams/payment_sources.py +19 -0
- mage_integrations/sources/chargebee/streams/plans.py +19 -0
- mage_integrations/sources/chargebee/streams/promotional_credits.py +19 -0
- mage_integrations/sources/chargebee/streams/quotes.py +19 -0
- mage_integrations/sources/chargebee/streams/subscriptions.py +24 -0
- mage_integrations/sources/chargebee/streams/transactions.py +19 -0
- mage_integrations/sources/chargebee/streams/util.py +6 -0
- mage_integrations/sources/chargebee/streams/virtual_bank_accounts.py +19 -0
- mage_integrations/sources/chargebee/templates/config.json +7 -0
- mage_integrations/sources/commercetools/README.md +28 -0
- mage_integrations/sources/commercetools/__init__.py +40 -0
- mage_integrations/sources/commercetools/client.py +54 -0
- mage_integrations/sources/commercetools/schemas/customers.json +108 -0
- mage_integrations/sources/commercetools/schemas/discount_codes.json +77 -0
- mage_integrations/sources/commercetools/schemas/inventory.json +50 -0
- mage_integrations/sources/commercetools/schemas/orders.json +542 -0
- mage_integrations/sources/commercetools/schemas/payments.json +113 -0
- mage_integrations/sources/commercetools/schemas/products.json +82 -0
- mage_integrations/sources/commercetools/schemas/shared/address.json +83 -0
- mage_integrations/sources/commercetools/schemas/shared/created_by.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/custom.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/dimension.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/discounted_price_per_quantity.json +30 -0
- mage_integrations/sources/commercetools/schemas/shared/field_type.json +8 -0
- mage_integrations/sources/commercetools/schemas/shared/key_reference.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/last_modified_by.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/localized_string.json +8 -0
- mage_integrations/sources/commercetools/schemas/shared/money.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/price.json +56 -0
- mage_integrations/sources/commercetools/schemas/shared/price_scoped.json +45 -0
- mage_integrations/sources/commercetools/schemas/shared/product_data.json +52 -0
- mage_integrations/sources/commercetools/schemas/shared/product_variant.json +132 -0
- mage_integrations/sources/commercetools/schemas/shared/reference.json +22 -0
- mage_integrations/sources/commercetools/schemas/shared/shipping_details.json +22 -0
- mage_integrations/sources/commercetools/schemas/shared/state.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/taxed_item_price.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/taxed_price.json +28 -0
- mage_integrations/sources/commercetools/schemas/shared/taxrate.json +37 -0
- mage_integrations/sources/commercetools/schemas.py +25 -0
- mage_integrations/sources/commercetools/streams/__init__.py +0 -0
- mage_integrations/sources/commercetools/streams/base.py +30 -0
- mage_integrations/sources/commercetools/streams/customers.py +7 -0
- mage_integrations/sources/commercetools/streams/discount_codes.py +7 -0
- mage_integrations/sources/commercetools/streams/inventory.py +7 -0
- mage_integrations/sources/commercetools/streams/orders.py +7 -0
- mage_integrations/sources/commercetools/streams/payments.py +7 -0
- mage_integrations/sources/commercetools/streams/products.py +7 -0
- mage_integrations/sources/commercetools/templates/config.json +7 -0
- mage_integrations/sources/constants.py +46 -0
- mage_integrations/sources/couchbase/README.md +25 -0
- mage_integrations/sources/couchbase/__init__.py +140 -0
- mage_integrations/sources/couchbase/templates/config.json +7 -0
- mage_integrations/sources/couchbase/utils.py +58 -0
- mage_integrations/sources/datadog/README.md +25 -0
- mage_integrations/sources/datadog/__init__.py +55 -0
- mage_integrations/sources/datadog/client.py +18 -0
- mage_integrations/sources/datadog/schemas/audit_logs.json +49 -0
- mage_integrations/sources/datadog/schemas/dashboards.json +55 -0
- mage_integrations/sources/datadog/schemas/downtimes.json +103 -0
- mage_integrations/sources/datadog/schemas/incident_teams.json +92 -0
- mage_integrations/sources/datadog/schemas/incidents.json +135 -0
- mage_integrations/sources/datadog/schemas/logs.json +61 -0
- mage_integrations/sources/datadog/schemas/synthetic_tests.json +105 -0
- mage_integrations/sources/datadog/schemas/users.json +76 -0
- mage_integrations/sources/datadog/streams/__init__.py +275 -0
- mage_integrations/sources/datadog/templates/config.json +9 -0
- mage_integrations/sources/doris/README.md +28 -0
- mage_integrations/sources/doris/__init__.py +68 -0
- mage_integrations/sources/doris/templates/config.json +13 -0
- mage_integrations/sources/dremio/README.md +44 -0
- mage_integrations/sources/dremio/__init__.py +174 -0
- mage_integrations/sources/dremio/templates/config.json +6 -0
- mage_integrations/sources/dremio/utils.py +28 -0
- mage_integrations/sources/dynamodb/README.md +14 -0
- mage_integrations/sources/dynamodb/__init__.py +225 -0
- mage_integrations/sources/dynamodb/templates/config.json +6 -0
- mage_integrations/sources/facebook_ads/README.md +49 -0
- mage_integrations/sources/facebook_ads/__init__.py +45 -0
- mage_integrations/sources/facebook_ads/tap_facebook/__init__.py +1040 -0
- mage_integrations/sources/facebook_ads/tap_facebook/process_output.py +114 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/adcreative.json +1440 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads.json +859 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights.json +339 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_age_and_gender.json +352 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_country.json +345 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_dma.json +183 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_hourly_advertiser.json +311 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_platform_and_device.json +363 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_region.json +345 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/adsets.json +200 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/campaigns.json +98 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/leads.json +65 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_action_stats.json +74 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_histogram_stats.json +32 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_image_crops.json +134 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/geo_locations.json +270 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/targeting.json +401 -0
- mage_integrations/sources/facebook_ads/templates/config.json +5 -0
- mage_integrations/sources/facebook_ads/tests/base.py +396 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/adcreative/output/00000000000000000000 +8 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/ads/output/00000000000000000000 +10 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/adsets/output/00000000000000000000 +11 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/campaigns/output/00000000000000000000 +14 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_archived_data.py +115 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_attribution_window.py +104 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_automatic_fields.py +85 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_bookmarks.py +256 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_discovery.py +122 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_field_selection.py +118 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_invalid_attribution_window.py +65 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_start_date.py +145 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_attribute_error_retry.py +193 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_attribution_window.py +29 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_request_timeout.py +504 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_retry_logic.py +261 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_sync_batches_retry.py +154 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_tap_facebook.py +160 -0
- mage_integrations/sources/freshdesk/README.md +24 -0
- mage_integrations/sources/freshdesk/__init__.py +25 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/__init__.py +325 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/agents.json +85 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/companies.json +45 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/contacts.json +165 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/conversations.json +178 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/groups.json +40 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/roles.json +25 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/satisfaction_ratings.json +75 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/tickets.json +332 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/time_entries.json +72 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/utils.py +93 -0
- mage_integrations/sources/freshdesk/templates/config.json +5 -0
- mage_integrations/sources/freshdesk/tests/base.py +262 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_bookmarks.py +250 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_check.py +29 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_pagination.py +58 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_start_date.py +181 -0
- mage_integrations/sources/front/README.md +25 -0
- mage_integrations/sources/front/__init__.py +40 -0
- mage_integrations/sources/front/client.py +76 -0
- mage_integrations/sources/front/context.py +62 -0
- mage_integrations/sources/front/schemas/accounts.json +37 -0
- mage_integrations/sources/front/schemas/analytics.json +71 -0
- mage_integrations/sources/front/schemas/channels.json +28 -0
- mage_integrations/sources/front/schemas/contact_groups.json +15 -0
- mage_integrations/sources/front/schemas/contacts.json +49 -0
- mage_integrations/sources/front/schemas/conversations.json +40 -0
- mage_integrations/sources/front/schemas/custom_fields.json +18 -0
- mage_integrations/sources/front/schemas/events.json +27 -0
- mage_integrations/sources/front/schemas/rules.json +21 -0
- mage_integrations/sources/front/schemas/tags.json +27 -0
- mage_integrations/sources/front/schemas/teammates.json +30 -0
- mage_integrations/sources/front/schemas/teams.json +12 -0
- mage_integrations/sources/front/schemas.py +43 -0
- mage_integrations/sources/front/streams/__init__.py +0 -0
- mage_integrations/sources/front/streams/accounts.py +7 -0
- mage_integrations/sources/front/streams/analytics.py +97 -0
- mage_integrations/sources/front/streams/base.py +29 -0
- mage_integrations/sources/front/streams/channels.py +7 -0
- mage_integrations/sources/front/streams/contact_groups.py +7 -0
- mage_integrations/sources/front/streams/contacts.py +7 -0
- mage_integrations/sources/front/streams/conversations.py +7 -0
- mage_integrations/sources/front/streams/custom_fields.py +7 -0
- mage_integrations/sources/front/streams/events.py +7 -0
- mage_integrations/sources/front/streams/rules.py +7 -0
- mage_integrations/sources/front/streams/tags.py +7 -0
- mage_integrations/sources/front/streams/teammates.py +7 -0
- mage_integrations/sources/front/streams/teams.py +7 -0
- mage_integrations/sources/front/templates/config.json +6 -0
- mage_integrations/sources/github/README.md +55 -0
- mage_integrations/sources/github/__init__.py +48 -0
- mage_integrations/sources/github/tap_github/__init__.py +47 -0
- mage_integrations/sources/github/tap_github/client.py +430 -0
- mage_integrations/sources/github/tap_github/discover.py +41 -0
- mage_integrations/sources/github/tap_github/schema.py +88 -0
- mage_integrations/sources/github/tap_github/schemas/assignees.json +72 -0
- mage_integrations/sources/github/tap_github/schemas/collaborators.json +75 -0
- mage_integrations/sources/github/tap_github/schemas/comments.json +120 -0
- mage_integrations/sources/github/tap_github/schemas/commit_comments.json +114 -0
- mage_integrations/sources/github/tap_github/schemas/commits.json +278 -0
- mage_integrations/sources/github/tap_github/schemas/events.json +1055 -0
- mage_integrations/sources/github/tap_github/schemas/issue_events.json +963 -0
- mage_integrations/sources/github/tap_github/schemas/issue_labels.json +29 -0
- mage_integrations/sources/github/tap_github/schemas/issue_milestones.json +125 -0
- mage_integrations/sources/github/tap_github/schemas/issues.json +276 -0
- mage_integrations/sources/github/tap_github/schemas/pr_commits.json +323 -0
- mage_integrations/sources/github/tap_github/schemas/project_cards.json +120 -0
- mage_integrations/sources/github/tap_github/schemas/project_columns.json +34 -0
- mage_integrations/sources/github/tap_github/schemas/projects.json +117 -0
- mage_integrations/sources/github/tap_github/schemas/pull_requests.json +1646 -0
- mage_integrations/sources/github/tap_github/schemas/releases.json +192 -0
- mage_integrations/sources/github/tap_github/schemas/review_comments.json +178 -0
- mage_integrations/sources/github/tap_github/schemas/reviews.json +70 -0
- mage_integrations/sources/github/tap_github/schemas/shared/issue_permissions.json +20 -0
- mage_integrations/sources/github/tap_github/schemas/shared/performed_via_github_app.json +61 -0
- mage_integrations/sources/github/tap_github/schemas/shared/pull_permissions.json +20 -0
- mage_integrations/sources/github/tap_github/schemas/shared/reactions.json +35 -0
- mage_integrations/sources/github/tap_github/schemas/shared/user.json +68 -0
- mage_integrations/sources/github/tap_github/schemas/stargazers.json +19 -0
- mage_integrations/sources/github/tap_github/schemas/team_members.json +74 -0
- mage_integrations/sources/github/tap_github/schemas/team_memberships.json +20 -0
- mage_integrations/sources/github/tap_github/schemas/teams.json +47 -0
- mage_integrations/sources/github/tap_github/streams.py +952 -0
- mage_integrations/sources/github/tap_github/sync.py +306 -0
- mage_integrations/sources/github/templates/config.json +7 -0
- mage_integrations/sources/github/tests/__init__.py +0 -0
- mage_integrations/sources/github/tests/base.py +445 -0
- mage_integrations/sources/google_ads/README.md +28 -0
- mage_integrations/sources/google_ads/__init__.py +41 -0
- mage_integrations/sources/google_ads/tap_google_ads/__init__.py +57 -0
- mage_integrations/sources/google_ads/tap_google_ads/client.py +17 -0
- mage_integrations/sources/google_ads/tap_google_ads/discover.py +268 -0
- mage_integrations/sources/google_ads/tap_google_ads/report_definitions.py +1877 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/accounts.json +171 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/ad_groups.json +268 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/ads.json +1759 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/campaigns.json +858 -0
- mage_integrations/sources/google_ads/tap_google_ads/streams.py +1170 -0
- mage_integrations/sources/google_ads/tap_google_ads/sync.py +144 -0
- mage_integrations/sources/google_ads/tap_google_ads/tests/base.py +434 -0
- mage_integrations/sources/google_ads/templates/config.json +13 -0
- mage_integrations/sources/google_analytics/README.md +31 -0
- mage_integrations/sources/google_analytics/__init__.py +128 -0
- mage_integrations/sources/google_analytics/templates/config.json +6 -0
- mage_integrations/sources/google_cloud_storage/README.md +40 -0
- mage_integrations/sources/google_cloud_storage/__init__.py +166 -0
- mage_integrations/sources/google_cloud_storage/templates/config.json +7 -0
- mage_integrations/sources/google_search_console/README.md +20 -0
- mage_integrations/sources/google_search_console/__init__.py +99 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_country.json +31 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_custom.json +40 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_date.json +28 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_device.json +31 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_page.json +31 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_query.json +31 -0
- mage_integrations/sources/google_search_console/streams.py +118 -0
- mage_integrations/sources/google_search_console/templates/config.json +6 -0
- mage_integrations/sources/google_sheets/README.md +24 -0
- mage_integrations/sources/google_sheets/__init__.py +460 -0
- mage_integrations/sources/google_sheets/templates/config.json +5 -0
- mage_integrations/sources/google_sheets/transform.py +297 -0
- mage_integrations/sources/http/__init__.py +0 -0
- mage_integrations/sources/http/client.py +179 -0
- mage_integrations/sources/hubspot/README.md +48 -0
- mage_integrations/sources/hubspot/__init__.py +41 -0
- mage_integrations/sources/hubspot/bin/run-a-test.sh +5 -0
- mage_integrations/sources/hubspot/bin/run-all-tests.sh +1 -0
- mage_integrations/sources/hubspot/tap_hubspot/__init__.py +1548 -0
- mage_integrations/sources/hubspot/tap_hubspot/constants.py +13 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/campaigns.json +91 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/companies.json +11 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/contact_lists.json +97 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts.json +201 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts_by_company.json +12 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/deal_pipelines.json +46 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/deals.json +37 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/email_events.json +118 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/engagements.json +179 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/forms.json +229 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/owners.json +72 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/subscription_changes.json +54 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/versions.json +30 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/workflows.json +48 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/__init__.py +0 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_bookmarks.py +62 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_deals.py +32 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_get_streams_to_sync.py +44 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_offsets.py +57 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_get_start.py +94 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_request_timeout.py +121 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/utils.py +80 -0
- mage_integrations/sources/hubspot/templates/config.json +6 -0
- mage_integrations/sources/hubspot/tests/base.py +383 -0
- mage_integrations/sources/hubspot/tests/client.py +1583 -0
- mage_integrations/sources/hubspot/tests/client_tester.py +280 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_all_fields.py +323 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_automatic_fields.py +109 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks.py +236 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks_static.py +127 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_child_stream_only.py +88 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_discovery.py +131 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync.py +137 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync_offset.py +135 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_pagination.py +140 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_start_date.py +179 -0
- mage_integrations/sources/hubspot/tests/unittests/test_deals.py +101 -0
- mage_integrations/sources/intercom/README.md +19 -0
- mage_integrations/sources/intercom/__init__.py +54 -0
- mage_integrations/sources/intercom/client.py +246 -0
- mage_integrations/sources/intercom/schema.py +57 -0
- mage_integrations/sources/intercom/schemas/admins.json +65 -0
- mage_integrations/sources/intercom/schemas/companies.json +106 -0
- mage_integrations/sources/intercom/schemas/company_attributes.json +63 -0
- mage_integrations/sources/intercom/schemas/company_segments.json +26 -0
- mage_integrations/sources/intercom/schemas/contact_attributes.json +104 -0
- mage_integrations/sources/intercom/schemas/contacts.json +534 -0
- mage_integrations/sources/intercom/schemas/conversation_parts.json +180 -0
- mage_integrations/sources/intercom/schemas/conversations.json +797 -0
- mage_integrations/sources/intercom/schemas/segments.json +26 -0
- mage_integrations/sources/intercom/schemas/tags.json +15 -0
- mage_integrations/sources/intercom/schemas/teams.json +28 -0
- mage_integrations/sources/intercom/streams.py +739 -0
- mage_integrations/sources/intercom/templates/config.json +4 -0
- mage_integrations/sources/intercom/transform.py +134 -0
- mage_integrations/sources/knowi/README.md +20 -0
- mage_integrations/sources/knowi/__init__.py +68 -0
- mage_integrations/sources/knowi/client.py +249 -0
- mage_integrations/sources/knowi/schema.py +60 -0
- mage_integrations/sources/knowi/schemas/dashboards.json +150 -0
- mage_integrations/sources/knowi/schemas/widgets.json +688 -0
- mage_integrations/sources/knowi/streams.py +190 -0
- mage_integrations/sources/knowi/templates/config.json +6 -0
- mage_integrations/sources/linkedin_ads/README.md +34 -0
- mage_integrations/sources/linkedin_ads/__init__.py +66 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/__init__.py +65 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/client.py +335 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/discover.py +30 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schema.py +91 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/account_users.json +91 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/accounts.json +190 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_campaign.json +501 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_creative.json +501 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaign_groups.json +133 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaigns.json +469 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/creatives.json +182 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/video_ads.json +115 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/sync.py +868 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/transform.py +323 -0
- mage_integrations/sources/linkedin_ads/templates/config.json +9 -0
- mage_integrations/sources/linkedin_ads/tests/base.py +305 -0
- mage_integrations/sources/linkedin_ads/tests/test_all_fields.py +94 -0
- mage_integrations/sources/linkedin_ads/tests/test_discovery.py +95 -0
- mage_integrations/sources/linkedin_ads/tests/test_pagination.py +53 -0
- mage_integrations/sources/linkedin_ads/tests/test_start_date.py +130 -0
- mage_integrations/sources/linkedin_ads/tests/test_sync_canary.py +31 -0
- mage_integrations/sources/linkedin_ads/tests/test_sync_without_refrence_organization_id.py +31 -0
- mage_integrations/sources/linkedin_ads/tests/test_sync_without_refresh_token.py +131 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_account_number.py +81 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_adCampaignGroup_4XX.py +97 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_client.py +94 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_exception_handling.py +351 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_fetch_access_token.py +36 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_sync.py +197 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_sync_endpoint.py +42 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_timeout.py +279 -0
- mage_integrations/sources/messages.py +138 -0
- mage_integrations/sources/mode/README.md +21 -0
- mage_integrations/sources/mode/__init__.py +58 -0
- mage_integrations/sources/mode/client.py +251 -0
- mage_integrations/sources/mode/schema.py +57 -0
- mage_integrations/sources/mode/schemas/charts.json +116 -0
- mage_integrations/sources/mode/schemas/queries.json +41 -0
- mage_integrations/sources/mode/schemas/reports.json +128 -0
- mage_integrations/sources/mode/schemas/spaces.json +36 -0
- mage_integrations/sources/mode/streams.py +310 -0
- mage_integrations/sources/mode/templates/config.json +7 -0
- mage_integrations/sources/monday/README.md +24 -0
- mage_integrations/sources/monday/__init__.py +39 -0
- mage_integrations/sources/monday/client.py +35 -0
- mage_integrations/sources/monday/schemas/board_views.json +18 -0
- mage_integrations/sources/monday/schemas/boards.json +32 -0
- mage_integrations/sources/monday/schemas/columns.json +27 -0
- mage_integrations/sources/monday/schemas/groups.json +21 -0
- mage_integrations/sources/monday/schemas/workspaces.json +18 -0
- mage_integrations/sources/monday/streams.py +260 -0
- mage_integrations/sources/monday/templates/config.json +5 -0
- mage_integrations/sources/mongodb/README.md +33 -0
- mage_integrations/sources/mongodb/__init__.py +194 -0
- mage_integrations/sources/mongodb/schema.py +78 -0
- mage_integrations/sources/mongodb/spikes/atlas_setup.md +47 -0
- mage_integrations/sources/mongodb/spikes/dbreps_and_hackathon_review.md +46 -0
- mage_integrations/sources/mongodb/spikes/local_mongo_setup.md +92 -0
- mage_integrations/sources/mongodb/spikes/pymongo_spike.py +115 -0
- mage_integrations/sources/mongodb/spikes/supported_versions_spike.md +58 -0
- mage_integrations/sources/mongodb/tap_mongodb/__init__.py +465 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/common.py +354 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/full_table.py +162 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/incremental.py +125 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/oplog.py +271 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/utils.py +39 -0
- mage_integrations/sources/mongodb/templates/config.json +7 -0
- mage_integrations/sources/mongodb/tests/__init__.py +0 -0
- mage_integrations/sources/mongodb/tests/mongodb_common.py +37 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_cname_restrictions.py +252 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_configurable_properties.py +195 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_datatype.py +246 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_discovery.py +272 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_fname_restrictions.py +302 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_full_table.py +288 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_full_table_id.py +227 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_full_table_interruptible.py +232 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_id_pk_variations.py +273 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_incremental.py +480 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_incremental_open_transactions.py +312 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_index.py +162 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_log_based_interruptible.py +328 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_namespace_restrictions.py +258 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_oplog.py +260 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_oplog_aged_out.py +181 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_oplog_bookmarks.py +245 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_projection.py +271 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_inc.py +300 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_log.py +209 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_views.py +159 -0
- mage_integrations/sources/mongodb/tests/unittests/test_common.py +436 -0
- mage_integrations/sources/mssql/README.md +28 -0
- mage_integrations/sources/mssql/__init__.py +88 -0
- mage_integrations/sources/mssql/templates/config.json +9 -0
- mage_integrations/sources/mysql/README.md +32 -0
- mage_integrations/sources/mysql/__init__.py +70 -0
- mage_integrations/sources/mysql/templates/config.json +13 -0
- mage_integrations/sources/oracledb/README.md +22 -0
- mage_integrations/sources/oracledb/__init__.py +152 -0
- mage_integrations/sources/oracledb/templates/config.json +8 -0
- mage_integrations/sources/outreach/README.md +68 -0
- mage_integrations/sources/outreach/__init__.py +47 -0
- mage_integrations/sources/outreach/tap_outreach/__init__.py +50 -0
- mage_integrations/sources/outreach/tap_outreach/client.py +131 -0
- mage_integrations/sources/outreach/tap_outreach/discover.py +87 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/accounts.json +356 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/call_dispositions.json +49 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/call_purposes.json +43 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/calls.json +179 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/content_categories.json +55 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/duties.json +23 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/events.json +97 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/mailboxes.json +306 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/mailings.json +283 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/opportunities.json +724 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/personas.json +37 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/prospects.json +906 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequence_states.json +161 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequence_steps.json +152 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequence_templates.json +122 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequences.json +275 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/stages.json +55 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/tasks.json +186 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/teams.json +30 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/users.json +361 -0
- mage_integrations/sources/outreach/tap_outreach/sync.py +378 -0
- mage_integrations/sources/outreach/templates/config.json +7 -0
- mage_integrations/sources/paystack/README.md +15 -0
- mage_integrations/sources/paystack/__init__.py +44 -0
- mage_integrations/sources/paystack/client.py +14 -0
- mage_integrations/sources/paystack/schemas/customers.json +45 -0
- mage_integrations/sources/paystack/schemas/transactions.json +170 -0
- mage_integrations/sources/paystack/streams/__init__.py +8 -0
- mage_integrations/sources/paystack/streams/base.py +122 -0
- mage_integrations/sources/paystack/streams/customers.py +18 -0
- mage_integrations/sources/paystack/streams/transactions.py +18 -0
- mage_integrations/sources/paystack/templates/config.json +5 -0
- mage_integrations/sources/pipedrive/README.md +14 -0
- mage_integrations/sources/pipedrive/__init__.py +38 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/__init__.py +1 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/cli.py +32 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/config.py +5 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/exceptions.py +46 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/activity_types.json +37 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/currency.json +26 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/deal_products.json +125 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/dealflow.json +45 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/filters.json +37 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/pipelines.json +31 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/activities.json +112 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/deals.json +197 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/notes.json +90 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/organizations.json +156 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/persons.json +174 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/products.json +81 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/files.json +97 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/users.json +75 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/stages.json +40 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/stream.py +195 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/__init__.py +22 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/activity_types.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/currencies.py +7 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/deal_products.py +17 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/dealflow.py +24 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/filters.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/notes.py +8 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/pipelines.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/__init__.py +36 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/__init__.py +86 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/activities.py +16 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/deals.py +22 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/notes.py +14 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/organizations.py +22 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/persons.py +21 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/products.py +13 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/files.py +10 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/users.py +21 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/stages.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/tap.py +426 -0
- mage_integrations/sources/pipedrive/templates/config.json +4 -0
- mage_integrations/sources/postgresql/README.md +34 -0
- mage_integrations/sources/postgresql/__init__.py +499 -0
- mage_integrations/sources/postgresql/decoders.py +396 -0
- mage_integrations/sources/postgresql/templates/config.json +10 -0
- mage_integrations/sources/postmark/README.md +20 -0
- mage_integrations/sources/postmark/__init__.py +43 -0
- mage_integrations/sources/postmark/tap_postmark/__init__.py +4 -0
- mage_integrations/sources/postmark/tap_postmark/cleaners.py +331 -0
- mage_integrations/sources/postmark/tap_postmark/discover.py +55 -0
- mage_integrations/sources/postmark/tap_postmark/postmark.py +552 -0
- mage_integrations/sources/postmark/tap_postmark/schema.py +40 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/messages_opens.json +134 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/messages_outbound.json +93 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_bounces.json +81 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_clients.json +19 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_overview.json +88 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_platform.json +46 -0
- mage_integrations/sources/postmark/tap_postmark/streams.py +535 -0
- mage_integrations/sources/postmark/tap_postmark/sync.py +124 -0
- mage_integrations/sources/postmark/tap_postmark/tap.py +51 -0
- mage_integrations/sources/postmark/tap_postmark/tools.py +87 -0
- mage_integrations/sources/postmark/templates/config.json +4 -0
- mage_integrations/sources/powerbi/README.md +20 -0
- mage_integrations/sources/powerbi/__init__.py +68 -0
- mage_integrations/sources/powerbi/client.py +249 -0
- mage_integrations/sources/powerbi/schema.py +60 -0
- mage_integrations/sources/powerbi/schemas/apps.json +22 -0
- mage_integrations/sources/powerbi/schemas/dashboards.json +36 -0
- mage_integrations/sources/powerbi/schemas/datasets.json +31 -0
- mage_integrations/sources/powerbi/schemas/groups.json +34 -0
- mage_integrations/sources/powerbi/schemas/reports.json +25 -0
- mage_integrations/sources/powerbi/schemas/tiles.json +31 -0
- mage_integrations/sources/powerbi/streams.py +365 -0
- mage_integrations/sources/powerbi/templates/config.json +6 -0
- mage_integrations/sources/query.py +23 -0
- mage_integrations/sources/redshift/README.md +36 -0
- mage_integrations/sources/redshift/__init__.py +143 -0
- mage_integrations/sources/redshift/constants.py +57 -0
- mage_integrations/sources/redshift/templates/config.json +9 -0
- mage_integrations/sources/redshift/utils.py +26 -0
- mage_integrations/sources/salesforce/README.md +149 -0
- mage_integrations/sources/salesforce/__init__.py +77 -0
- mage_integrations/sources/salesforce/client/LICENSE +620 -0
- mage_integrations/sources/salesforce/client/__init__.py +0 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/__init__.py +616 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/__init__.py +400 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/bulk.py +353 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/credentials.py +112 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/exceptions.py +8 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/rest.py +109 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/sync.py +221 -0
- mage_integrations/sources/salesforce/templates/config.json +10 -0
- mage_integrations/sources/sftp/LICENSE +620 -0
- mage_integrations/sources/sftp/README.md +47 -0
- mage_integrations/sources/sftp/__init__.py +39 -0
- mage_integrations/sources/sftp/tap_sftp/__init__.py +0 -0
- mage_integrations/sources/sftp/tap_sftp/aws_ssm.py +24 -0
- mage_integrations/sources/sftp/tap_sftp/client.py +217 -0
- mage_integrations/sources/sftp/tap_sftp/decrypt.py +24 -0
- mage_integrations/sources/sftp/tap_sftp/discover.py +32 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/__init__.py +0 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/compression.py +20 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/csv_handler.py +58 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/json_schema.py +204 -0
- mage_integrations/sources/sftp/tap_sftp/stats.py +44 -0
- mage_integrations/sources/sftp/tap_sftp/sync.py +122 -0
- mage_integrations/sources/sftp/tap_sftp/tap.py +97 -0
- mage_integrations/sources/sftp/templates/config.json +22 -0
- mage_integrations/sources/snowflake/README.md +36 -0
- mage_integrations/sources/snowflake/__init__.py +63 -0
- mage_integrations/sources/snowflake/constants.py +0 -0
- mage_integrations/sources/snowflake/templates/config.json +11 -0
- mage_integrations/sources/sql/__init__.py +0 -0
- mage_integrations/sources/sql/base.py +464 -0
- mage_integrations/sources/sql/constants.py +10 -0
- mage_integrations/sources/sql/utils.py +77 -0
- mage_integrations/sources/stripe/README.md +43 -0
- mage_integrations/sources/stripe/__init__.py +1297 -0
- mage_integrations/sources/stripe/schemas/balance_transactions.json +145 -0
- mage_integrations/sources/stripe/schemas/charges.json +1 -0
- mage_integrations/sources/stripe/schemas/coupons.json +120 -0
- mage_integrations/sources/stripe/schemas/customers.json +501 -0
- mage_integrations/sources/stripe/schemas/disputes.json +210 -0
- mage_integrations/sources/stripe/schemas/events.json +68 -0
- mage_integrations/sources/stripe/schemas/invoice_items.json +251 -0
- mage_integrations/sources/stripe/schemas/invoice_line_items.json +504 -0
- mage_integrations/sources/stripe/schemas/invoices.json +966 -0
- mage_integrations/sources/stripe/schemas/payment_intents.json +1101 -0
- mage_integrations/sources/stripe/schemas/payout_transactions.json +20 -0
- mage_integrations/sources/stripe/schemas/payouts.json +280 -0
- mage_integrations/sources/stripe/schemas/plans.json +1 -0
- mage_integrations/sources/stripe/schemas/products.json +181 -0
- mage_integrations/sources/stripe/schemas/shared/charge.json +1896 -0
- mage_integrations/sources/stripe/schemas/shared/discount.json +177 -0
- mage_integrations/sources/stripe/schemas/shared/plan.json +190 -0
- mage_integrations/sources/stripe/schemas/shared/source.json +573 -0
- mage_integrations/sources/stripe/schemas/shared/tax_ids.json +84 -0
- mage_integrations/sources/stripe/schemas/subscription_items.json +456 -0
- mage_integrations/sources/stripe/schemas/subscriptions.json +494 -0
- mage_integrations/sources/stripe/schemas/transfers.json +170 -0
- mage_integrations/sources/stripe/templates/config.json +5 -0
- mage_integrations/sources/tableau/README.md +22 -0
- mage_integrations/sources/tableau/__init__.py +71 -0
- mage_integrations/sources/tableau/client.py +251 -0
- mage_integrations/sources/tableau/schema.py +60 -0
- mage_integrations/sources/tableau/schemas/views.json +50 -0
- mage_integrations/sources/tableau/schemas/workbooks.json +250 -0
- mage_integrations/sources/tableau/streams.py +193 -0
- mage_integrations/sources/tableau/templates/config.json +7 -0
- mage_integrations/sources/teradata/README.md +24 -0
- mage_integrations/sources/teradata/__init__.py +255 -0
- mage_integrations/sources/teradata/templates/config.json +7 -0
- mage_integrations/sources/titanic/README.md +0 -0
- mage_integrations/sources/titanic/__init__.py +34 -0
- mage_integrations/sources/titanic/schemas/passengers.json +81 -0
- mage_integrations/sources/titanic/templates/config.json +4 -0
- mage_integrations/sources/twitter_ads/README.md +29 -0
- mage_integrations/sources/twitter_ads/__init__.py +56 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/__init__.py +132 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/client.py +108 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/discover.py +31 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schema.py +223 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/account_media.json +74 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/accounts.json +45 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/advertiser_business_categories.json +25 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/campaigns.json +69 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards.json +37 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_image_conversation.json +56 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_poll.json +73 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_video_conversation.json +62 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/content_categories.json +25 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/funding_instruments.json +71 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/iab_categories.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_item_apps.json +32 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_items.json +127 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/media_creatives.json +38 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/preroll_call_to_actions.json +32 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promotable_users.json +26 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_accounts.json +35 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_tweets.json +35 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/scheduled_promoted_tweets.json +32 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/billing.json +12 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/dimensions.json +87 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_all.json +39 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_basic.json +24 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/media.json +12 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion.json +60 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion_obj.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_account.json +23 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_funding_instrument.json +26 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_mobile_conversion.json +23 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_organic_tweet.json +26 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_other.json +38 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_web_conversion.json +23 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/video.json +36 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion_obj.json +36 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tailored_audiences.json +70 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_app_store_categories.json +18 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_conversations.json +18 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_criteria.json +44 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_devices.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_events.json +123 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_interests.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_languages.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_locations.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_network_operators.json +18 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platform_versions.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platforms.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_markets.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_shows.json +37 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tracking_tags.json +30 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tweets.json +920 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/streams.py +1875 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/sync.py +176 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/transform.py +165 -0
- mage_integrations/sources/twitter_ads/templates/config.json +27 -0
- mage_integrations/sources/utils.py +318 -0
- mage_integrations/sources/zendesk/README.md +64 -0
- mage_integrations/sources/zendesk/__init__.py +45 -0
- mage_integrations/sources/zendesk/spikes/ticket_events.py +138 -0
- mage_integrations/sources/zendesk/tap_zendesk/__init__.py +253 -0
- mage_integrations/sources/zendesk/tap_zendesk/discover.py +80 -0
- mage_integrations/sources/zendesk/tap_zendesk/http.py +253 -0
- mage_integrations/sources/zendesk/tap_zendesk/metrics.py +102 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/group_memberships.json +52 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/groups.json +46 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/macros.json +116 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/organizations.json +114 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/satisfaction_ratings.json +49 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/attachments.json +148 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/metadata.json +145 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/via.json +122 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/sla_policies.json +128 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/tags.json +20 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_audits.json +789 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_comments.json +72 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_fields.json +199 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_forms.json +113 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_metrics.json +277 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/tickets.json +393 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/users.json +382 -0
- mage_integrations/sources/zendesk/tap_zendesk/streams.py +657 -0
- mage_integrations/sources/zendesk/tap_zendesk/sync.py +61 -0
- mage_integrations/sources/zendesk/templates/config.json +6 -0
- mage_integrations/sources/zendesk/test/__init__.py +0 -0
- mage_integrations/sources/zendesk/test/base.py +400 -0
- mage_integrations/sources/zendesk/test/test_all_fields.py +83 -0
- mage_integrations/sources/zendesk/test/test_all_streams.py +150 -0
- mage_integrations/sources/zendesk/test/test_automatic_fields.py +71 -0
- mage_integrations/sources/zendesk/test/test_bookmarks.py +160 -0
- mage_integrations/sources/zendesk/test/test_custom_fields_discover.py +43 -0
- mage_integrations/sources/zendesk/test/test_discovery.py +129 -0
- mage_integrations/sources/zendesk/test/test_minimal_selection.py +67 -0
- mage_integrations/sources/zendesk/test/test_pagination.py +74 -0
- mage_integrations/sources/zendesk/test/test_standard_bookmark.py +197 -0
- mage_integrations/sources/zendesk/test/test_start_date.py +165 -0
- mage_integrations/sources/zendesk/test/unittests/test_discovery_mode.py +308 -0
- mage_integrations/sources/zendesk/test/unittests/test_exception.py +55 -0
- mage_integrations/sources/zendesk/test/unittests/test_http.py +481 -0
- mage_integrations/sources/zendesk/test/unittests/test_init.py +23 -0
- mage_integrations/sources/zendesk/test/unittests/test_request_timeout.py +628 -0
- mage_integrations/sources/zendesk/test/unittests/test_tickets_child_stream_skip_404_error.py +82 -0
- mage_integrations/sources/zendesk/test/unittests/test_yield_records.py +193 -0
- mage_integrations/tests/__init__.py +0 -0
- mage_integrations/tests/connections/__init__.py +0 -0
- mage_integrations/tests/destinations/__init__.py +0 -0
- mage_integrations/tests/destinations/amplitude/__init__.py +0 -0
- mage_integrations/tests/destinations/amplitude/test_amplitude.py +117 -0
- mage_integrations/tests/destinations/bigquery/__init__.py +0 -0
- mage_integrations/tests/destinations/bigquery/test_bigquery.py +54 -0
- mage_integrations/tests/destinations/doris/__init__.py +0 -0
- mage_integrations/tests/destinations/doris/test_doris.py +64 -0
- mage_integrations/tests/destinations/mongodb/__init__.py +0 -0
- mage_integrations/tests/destinations/mongodb/test_mongodb.py +67 -0
- mage_integrations/tests/destinations/mssql/__init__.py +0 -0
- mage_integrations/tests/destinations/mssql/test_mssql.py +64 -0
- mage_integrations/tests/destinations/mysql/__init__.py +0 -0
- mage_integrations/tests/destinations/mysql/test_mysql.py +116 -0
- mage_integrations/tests/destinations/oracledb/__init__.py +0 -0
- mage_integrations/tests/destinations/oracledb/test_oracledb.py +63 -0
- mage_integrations/tests/destinations/postgresql/__init__.py +0 -0
- mage_integrations/tests/destinations/postgresql/test_postgres.py +60 -0
- mage_integrations/tests/destinations/redshift/__init__.py +0 -0
- mage_integrations/tests/destinations/redshift/test_redshift.py +68 -0
- mage_integrations/tests/destinations/search/__init__.py +0 -0
- mage_integrations/tests/destinations/search/test_sinks.py +71 -0
- mage_integrations/tests/destinations/snowflake/__init__.py +0 -0
- mage_integrations/tests/destinations/snowflake/test_snowflake.py +113 -0
- mage_integrations/tests/destinations/sql/__init__.py +0 -0
- mage_integrations/tests/destinations/sql/mixins.py +48 -0
- mage_integrations/tests/destinations/sql/test_truncate.py +94 -0
- mage_integrations/tests/destinations/test_base.py +557 -0
- mage_integrations/tests/sources/__init__.py +0 -0
- mage_integrations/tests/sources/amplitude/__init__.py +0 -0
- mage_integrations/tests/sources/amplitude/test_amplitude.py +232 -0
- mage_integrations/tests/sources/api/__init__.py +0 -0
- mage_integrations/tests/sources/api/test_api.py +377 -0
- mage_integrations/tests/sources/bigquery/__init__.py +0 -0
- mage_integrations/tests/sources/bigquery/test_bigquery.py +232 -0
- mage_integrations/tests/sources/couchbase/__init__.py +0 -0
- mage_integrations/tests/sources/couchbase/test_couchbase.py +379 -0
- mage_integrations/tests/sources/doris/__init__.py +0 -0
- mage_integrations/tests/sources/doris/test_doris.py +118 -0
- mage_integrations/tests/sources/mongodb/__init__.py +0 -0
- mage_integrations/tests/sources/mongodb/test_common.py +73 -0
- mage_integrations/tests/sources/mongodb/test_schema.py +91 -0
- mage_integrations/tests/sources/mysql/__init__.py +0 -0
- mage_integrations/tests/sources/mysql/test_mysql.py +114 -0
- mage_integrations/tests/sources/postgresql/__init__.py +0 -0
- mage_integrations/tests/sources/postgresql/test_postgresql.py +46 -0
- mage_integrations/tests/sources/sql/__init__.py +0 -0
- mage_integrations/tests/sources/sql/test_base.py +215 -0
- mage_integrations/tests/sources/test_base.py +404 -0
- mage_integrations/tests/test_dependency_contracts.py +28 -0
- mage_integrations/tests/utils/__init__.py +0 -0
- mage_integrations/tests/utils/test_frames.py +122 -0
- mage_integrations/transformers/__init__.py +0 -0
- mage_integrations/transformers/base.py +183 -0
- mage_integrations/transformers/utils.py +39 -0
- mage_integrations/utils/__init__.py +0 -0
- mage_integrations/utils/array.py +40 -0
- mage_integrations/utils/dates.py +45 -0
- mage_integrations/utils/dictionary.py +108 -0
- mage_integrations/utils/files.py +5 -0
- mage_integrations/utils/frames.py +123 -0
- mage_integrations/utils/logger/__init__.py +103 -0
- mage_integrations/utils/logger/constants.py +11 -0
- mage_integrations/utils/parsers.py +56 -0
- mage_integrations/utils/schema_helpers.py +37 -0
- mage_integrations/utils/strings.py +6 -0
- mage_integrations-0.2.1.dist-info/METADATA +304 -0
- mage_integrations-0.2.1.dist-info/RECORD +1016 -0
- mage_integrations-0.2.1.dist-info/WHEEL +5 -0
- mage_integrations-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Postmark tap."""
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
import logging
|
|
4
|
+
from argparse import Namespace
|
|
5
|
+
|
|
6
|
+
from singer import get_logger, utils
|
|
7
|
+
from singer.catalog import Catalog
|
|
8
|
+
|
|
9
|
+
from mage_integrations.sources.postmark.tap_postmark.discover import discover
|
|
10
|
+
from mage_integrations.sources.postmark.tap_postmark.postmark import Postmark
|
|
11
|
+
from mage_integrations.sources.postmark.tap_postmark.sync import sync
|
|
12
|
+
|
|
13
|
+
LOGGER: logging.RootLogger = get_logger()
|
|
14
|
+
REQUIRED_CONFIG_KEYS: tuple = (
|
|
15
|
+
'postmark_server_token',
|
|
16
|
+
'start_date',
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@utils.handle_top_exception(LOGGER)
|
|
21
|
+
def main() -> None:
|
|
22
|
+
"""Run tap."""
|
|
23
|
+
# Parse command line arguments
|
|
24
|
+
args: Namespace = utils.parse_args(REQUIRED_CONFIG_KEYS)
|
|
25
|
+
|
|
26
|
+
# LOGGER.info(f'>>> Running tap-postmark v{VERSION}')
|
|
27
|
+
|
|
28
|
+
# If discover flag was passed, run discovery mode and dump output to stdout
|
|
29
|
+
if args.discover:
|
|
30
|
+
catalog: Catalog = discover()
|
|
31
|
+
catalog.dump()
|
|
32
|
+
return
|
|
33
|
+
|
|
34
|
+
# Otherwise run in sync mode
|
|
35
|
+
if args.catalog:
|
|
36
|
+
# Load command line catalog
|
|
37
|
+
catalog = args.catalog
|
|
38
|
+
else:
|
|
39
|
+
# Loadt the catalog
|
|
40
|
+
catalog = discover()
|
|
41
|
+
|
|
42
|
+
# Initialize postmark client
|
|
43
|
+
postmark: Postmark = Postmark(
|
|
44
|
+
args.config['postmark_server_token'],
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
sync(postmark, args.state, catalog, args.config['start_date'])
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if __name__ == '__main__':
|
|
51
|
+
main()
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Tools."""
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
from datetime import date, datetime, timedelta
|
|
4
|
+
from functools import reduce
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def clear_currently_syncing(state: dict) -> dict:
|
|
9
|
+
"""Clear the currently syncing from the state.
|
|
10
|
+
|
|
11
|
+
Arguments:
|
|
12
|
+
state (dict) -- State file
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
dict -- New state file
|
|
16
|
+
"""
|
|
17
|
+
return state.pop('currently_syncing', None)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_stream_state(state: dict, tap_stream_id: str) -> dict:
|
|
21
|
+
"""Return the state of the stream.
|
|
22
|
+
|
|
23
|
+
Arguments:
|
|
24
|
+
state {dict} -- The state
|
|
25
|
+
tap_stream_id {str} -- The id of the stream
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
dict -- The state of the stream
|
|
29
|
+
"""
|
|
30
|
+
return state.get(
|
|
31
|
+
'bookmarks',
|
|
32
|
+
{},
|
|
33
|
+
).get(tap_stream_id)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def retrieve_bookmark_with_path(path: str, row: dict) -> Optional[str]:
|
|
37
|
+
"""Bookmark exists in the row of data which is an dictionary.
|
|
38
|
+
|
|
39
|
+
The bookmark can either be a key such as row[key] but also a subkey such as
|
|
40
|
+
row[key][subkey]. In the streams definition file, the key can be saved as
|
|
41
|
+
a string, but [key][subkey] cannot. Therefore, in the streams file, if we
|
|
42
|
+
want to use a subkey as bookmark, we save it in the format 'key.subkey',
|
|
43
|
+
which is our path in the dictionary.
|
|
44
|
+
This helper function parses the string and checks whether it has a dot.
|
|
45
|
+
If it has one, it returns the value of the subkey in the row of data, e.g.
|
|
46
|
+
row[key][subkey]. If not it returns the alue of the key, e.g row[path].
|
|
47
|
+
|
|
48
|
+
Arguments:
|
|
49
|
+
path {str} -- Path in the dictionary
|
|
50
|
+
row {dict} -- Data row
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
Optional[str] -- The value or from the key or subkey
|
|
54
|
+
"""
|
|
55
|
+
# If the path has a dot, then parse it as key and subkeys
|
|
56
|
+
if '.' in path:
|
|
57
|
+
return str(reduce(dict.get, path.split('.'), row)) # type: ignore
|
|
58
|
+
# Else if the path is just a key, parse it as a normal key
|
|
59
|
+
elif path:
|
|
60
|
+
return row[path]
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def create_bookmark(stream_name: str, bookmark_value: str) -> str:
|
|
65
|
+
"""Create bookmark.
|
|
66
|
+
|
|
67
|
+
Arguments:
|
|
68
|
+
stream_name {str} -- Name of stream
|
|
69
|
+
bookmark_value {str} -- Bookmark value
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
str -- Created bookmark
|
|
73
|
+
"""
|
|
74
|
+
if stream_name in {
|
|
75
|
+
'messages_opens',
|
|
76
|
+
'messages_outbound',
|
|
77
|
+
'stats_outbound_bounces',
|
|
78
|
+
'stats_outbound_clients',
|
|
79
|
+
'stats_outbound_overview',
|
|
80
|
+
'stats_outbound_platform',
|
|
81
|
+
}:
|
|
82
|
+
# Return tomorrow's date
|
|
83
|
+
tomorrow: date = datetime.strptime(
|
|
84
|
+
bookmark_value,
|
|
85
|
+
'%Y-%m-%d',
|
|
86
|
+
).date() + timedelta(days=1)
|
|
87
|
+
return tomorrow.isoformat()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# PowerBI
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
## Config
|
|
6
|
+
|
|
7
|
+
You must enter the following credentials when configuring this source:
|
|
8
|
+
|
|
9
|
+
| Key | Description | Sample value
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `access_token` | (REQUIRED) The access token used to authenticate your PowerBI account. | `abcdefg123456` |
|
|
12
|
+
| `request_timeout` | (OPTIONAL) The amout of time before the request times out, default: 300 | `300`|
|
|
13
|
+
| `user_agent` | (OPTIONAL) The User Agent string to send in the request header | `my-app-v1.0`|
|
|
14
|
+
| `start_date` | (OPTIONAL) Used to filter the results. When using IncrementalSync, only fetch records updated after `start_date` | `2023-01-01` |
|
|
15
|
+
|
|
16
|
+
<br />
|
|
17
|
+
|
|
18
|
+
### How to get your `access_token`
|
|
19
|
+
|
|
20
|
+
Follow PowerBI's [instructions](https://community.fabric.microsoft.com/t5/Developer/REST-API-Get-Access-Token/m-p/1895937/) to get your `access_token`.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Dict, Generator, List
|
|
3
|
+
|
|
4
|
+
import singer
|
|
5
|
+
|
|
6
|
+
from mage_integrations.sources.base import Source, main
|
|
7
|
+
from mage_integrations.sources.constants import REPLICATION_METHOD_INCREMENTAL
|
|
8
|
+
from mage_integrations.sources.powerbi.client import PowerbiClient
|
|
9
|
+
from mage_integrations.sources.powerbi.streams import STREAMS
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PowerBI(Source):
|
|
13
|
+
def load_data(
|
|
14
|
+
self,
|
|
15
|
+
stream,
|
|
16
|
+
bookmarks: Dict = None,
|
|
17
|
+
query: Dict = None,
|
|
18
|
+
**kwargs,
|
|
19
|
+
) -> Generator[List[Dict], None, None]:
|
|
20
|
+
if query is None:
|
|
21
|
+
query = {}
|
|
22
|
+
|
|
23
|
+
access_token = self.config.get("access_token")
|
|
24
|
+
client = PowerbiClient(
|
|
25
|
+
self.logger,
|
|
26
|
+
access_token,
|
|
27
|
+
self.config.get("request_timeout"),
|
|
28
|
+
self.config.get("user_agent"),
|
|
29
|
+
)
|
|
30
|
+
tap_stream_id = stream.tap_stream_id
|
|
31
|
+
stream_obj = STREAMS[tap_stream_id](client, logger=self.logger)
|
|
32
|
+
|
|
33
|
+
bookmarks = bookmarks or dict()
|
|
34
|
+
if REPLICATION_METHOD_INCREMENTAL == stream.replication_method:
|
|
35
|
+
bookmark_datetime = bookmarks.get(
|
|
36
|
+
"updated_at", self.config.get("start_date")
|
|
37
|
+
)
|
|
38
|
+
else:
|
|
39
|
+
bookmark_datetime = None
|
|
40
|
+
if bookmark_datetime is not None:
|
|
41
|
+
if type(bookmark_datetime) is int:
|
|
42
|
+
bookmark_datetime = datetime.fromtimestamp(bookmark_datetime)
|
|
43
|
+
else:
|
|
44
|
+
bookmark_datetime = singer.utils.strptime_to_utc(bookmark_datetime)
|
|
45
|
+
for record in stream_obj.get_records(bookmark_datetime=bookmark_datetime):
|
|
46
|
+
yield [record]
|
|
47
|
+
|
|
48
|
+
def get_forced_replication_method(self, stream_id):
|
|
49
|
+
return STREAMS[stream_id].replication_method
|
|
50
|
+
|
|
51
|
+
def get_table_key_properties(self, stream_id):
|
|
52
|
+
return STREAMS[stream_id].key_properties
|
|
53
|
+
|
|
54
|
+
def get_valid_replication_keys(self, stream_id):
|
|
55
|
+
return STREAMS[stream_id].valid_replication_keys
|
|
56
|
+
|
|
57
|
+
def test_connection(self) -> None:
|
|
58
|
+
client = PowerbiClient(
|
|
59
|
+
self.logger,
|
|
60
|
+
self.config.get("access_token"),
|
|
61
|
+
self.config.get("request_timeout"),
|
|
62
|
+
self.config.get("user_agent"),
|
|
63
|
+
)
|
|
64
|
+
client.check_access_token()
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == "__main__":
|
|
68
|
+
main(PowerBI)
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from singer import metrics, utils
|
|
3
|
+
|
|
4
|
+
REQUEST_TIMEOUT = 300
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Server5xxError(Exception):
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Server429Error(Exception):
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PowerbiError(Exception):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PowerbiBadRequestError(PowerbiError):
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PowerbiScrollExistsError(PowerbiError):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class PowerbiUnauthorizedError(PowerbiError):
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class PowerbiPaymentRequiredError(PowerbiError):
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class PowerbiForbiddenError(PowerbiError):
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class PowerbiNotFoundError(PowerbiError):
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class PowerbiMethodNotAllowedError(PowerbiError):
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class PowerbiNotAcceptableError(PowerbiError):
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class PowerbiRequestTimeoutError(PowerbiError):
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class PowerbiConflictError(PowerbiError):
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class PowerbiUserConflictError(PowerbiError):
|
|
60
|
+
pass
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class PowerbiUnsupportedMediaTypeError(PowerbiError):
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class PowerbiUnprocessableEntityError(PowerbiError):
|
|
68
|
+
pass
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class PowerbiInternalServiceError(PowerbiError):
|
|
72
|
+
pass
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
ERROR_CODE_EXCEPTION_MAPPING = {
|
|
76
|
+
400: PowerbiBadRequestError,
|
|
77
|
+
401: PowerbiUnauthorizedError,
|
|
78
|
+
402: PowerbiPaymentRequiredError,
|
|
79
|
+
403: PowerbiForbiddenError,
|
|
80
|
+
404: PowerbiNotFoundError,
|
|
81
|
+
405: PowerbiMethodNotAllowedError,
|
|
82
|
+
406: PowerbiNotAcceptableError,
|
|
83
|
+
408: PowerbiRequestTimeoutError,
|
|
84
|
+
409: PowerbiUserConflictError,
|
|
85
|
+
415: PowerbiUnsupportedMediaTypeError,
|
|
86
|
+
422: PowerbiUnprocessableEntityError,
|
|
87
|
+
423: PowerbiScrollExistsError,
|
|
88
|
+
500: PowerbiInternalServiceError,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def get_exception_for_error_code(error_code, powerbi_error_code):
|
|
93
|
+
if powerbi_error_code == "scroll_exists":
|
|
94
|
+
error_code = 423
|
|
95
|
+
return ERROR_CODE_EXCEPTION_MAPPING.get(error_code, PowerbiError)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def raise_for_error(response, logger):
|
|
99
|
+
try:
|
|
100
|
+
response.raise_for_status()
|
|
101
|
+
except (requests.HTTPError, requests.ConnectionError) as error:
|
|
102
|
+
try:
|
|
103
|
+
content_length = len(response.content)
|
|
104
|
+
if content_length == 0:
|
|
105
|
+
# There is nothing we can do here since Powerbi has neither sent
|
|
106
|
+
# us a 2xx response nor a response content.
|
|
107
|
+
return
|
|
108
|
+
response_json = response.json()
|
|
109
|
+
status_code = response.status_code
|
|
110
|
+
logger.error("RESPONSE: {}".format(response_json))
|
|
111
|
+
if response_json.get("type") == "error.list":
|
|
112
|
+
message = ""
|
|
113
|
+
for err in response_json["errors"]:
|
|
114
|
+
error_message = err.get("message")
|
|
115
|
+
error_code = err.get("code")
|
|
116
|
+
ex = get_exception_for_error_code(
|
|
117
|
+
error_code=status_code, Powerbi_error_code=error_code
|
|
118
|
+
)
|
|
119
|
+
if status_code == 401 and "access_token" in error_code:
|
|
120
|
+
logger.error(
|
|
121
|
+
"Your API access_token is expired/invalid as per Powerbi's"
|
|
122
|
+
"security policy. \n Please re-authenticate your connection to "
|
|
123
|
+
"generate a new access_token and resume extraction."
|
|
124
|
+
)
|
|
125
|
+
message = "{}: {}\n{}".format(error_code, error_message, message)
|
|
126
|
+
raise ex("{}".format(message)) from error
|
|
127
|
+
raise PowerbiError(error) from error
|
|
128
|
+
except (ValueError, TypeError) as inner_error:
|
|
129
|
+
raise PowerbiError(error) from inner_error
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class PowerbiClient(object):
|
|
133
|
+
def __init__(
|
|
134
|
+
self,
|
|
135
|
+
logger,
|
|
136
|
+
access_token,
|
|
137
|
+
config_request_timeout, # request_timeout parameter
|
|
138
|
+
user_agent=None,
|
|
139
|
+
):
|
|
140
|
+
self.__access_token = access_token
|
|
141
|
+
self.__user_agent = user_agent
|
|
142
|
+
# Rate limit initial values, reset by check_access_token headers
|
|
143
|
+
self.__session = requests.Session()
|
|
144
|
+
self.__verified = False
|
|
145
|
+
self.base_url = "https://api.powerbi.com/v1.0/myorg"
|
|
146
|
+
self.logger = logger
|
|
147
|
+
|
|
148
|
+
# Set request timeout to config param `request_timeout` value.
|
|
149
|
+
# If value is 0,"0","" or not passed then it set default to 300 seconds.
|
|
150
|
+
if config_request_timeout and float(config_request_timeout):
|
|
151
|
+
self.__request_timeout = float(config_request_timeout)
|
|
152
|
+
else:
|
|
153
|
+
self.__request_timeout = REQUEST_TIMEOUT
|
|
154
|
+
|
|
155
|
+
# `check_access_token` may throw timeout error. `request` method also call `check_access_token`.
|
|
156
|
+
# So, to add backoff over `check_access_token` may cause 5*5 = 25 times backoff which
|
|
157
|
+
# is not expected. That's why added backoff here.
|
|
158
|
+
def __enter__(self):
|
|
159
|
+
self.__verified = self.check_access_token()
|
|
160
|
+
return self
|
|
161
|
+
|
|
162
|
+
def __exit__(self, exception_type, exception_value, traceback):
|
|
163
|
+
self.__session.close()
|
|
164
|
+
|
|
165
|
+
@utils.ratelimit(1000, 60)
|
|
166
|
+
def check_access_token(self):
|
|
167
|
+
if self.__access_token is None:
|
|
168
|
+
raise Exception("Error: Missing access_token.")
|
|
169
|
+
headers = {}
|
|
170
|
+
if self.__user_agent:
|
|
171
|
+
headers["User-Agent"] = self.__user_agent
|
|
172
|
+
|
|
173
|
+
headers["Authorization"] = "Bearer {}".format(self.__access_token)
|
|
174
|
+
headers["Accept"] = "application/json"
|
|
175
|
+
response = self.__session.get(
|
|
176
|
+
# Simple endpoint that returns 1 Account record (to check API/access_token access):
|
|
177
|
+
url="{}/{}".format(self.base_url, "dashboards"),
|
|
178
|
+
timeout=self.__request_timeout, # Pass request timeout
|
|
179
|
+
headers=headers,
|
|
180
|
+
)
|
|
181
|
+
if response.status_code != 200:
|
|
182
|
+
self.logger.error("Error status_code = {}".format(response.status_code))
|
|
183
|
+
raise_for_error(response, self.logger)
|
|
184
|
+
else:
|
|
185
|
+
resp = response.json()
|
|
186
|
+
if "value" in resp:
|
|
187
|
+
return True
|
|
188
|
+
return False
|
|
189
|
+
|
|
190
|
+
@utils.ratelimit(1000, 60)
|
|
191
|
+
def request(self, method, path=None, url=None, **kwargs):
|
|
192
|
+
if not self.__verified:
|
|
193
|
+
self.__verified = self.check_access_token()
|
|
194
|
+
|
|
195
|
+
if not url and path:
|
|
196
|
+
url = "{}/{}".format(self.base_url, path)
|
|
197
|
+
|
|
198
|
+
self.logger.info(
|
|
199
|
+
"URL: {} {}, Params: {}, JSON Body: {}".format(
|
|
200
|
+
method,
|
|
201
|
+
url,
|
|
202
|
+
kwargs.get("params"),
|
|
203
|
+
kwargs.get("json"),
|
|
204
|
+
)
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
if "endpoint" in kwargs:
|
|
208
|
+
endpoint = kwargs["endpoint"]
|
|
209
|
+
del kwargs["endpoint"]
|
|
210
|
+
else:
|
|
211
|
+
endpoint = None
|
|
212
|
+
|
|
213
|
+
if "headers" not in kwargs:
|
|
214
|
+
kwargs["headers"] = {}
|
|
215
|
+
|
|
216
|
+
kwargs["headers"]["Authorization"] = "Bearer {}".format(self.__access_token)
|
|
217
|
+
kwargs["headers"]["Accept"] = "application/json"
|
|
218
|
+
|
|
219
|
+
if self.__user_agent:
|
|
220
|
+
kwargs["headers"]["User-Agent"] = self.__user_agent
|
|
221
|
+
|
|
222
|
+
if method == "POST":
|
|
223
|
+
kwargs["headers"]["Content-Type"] = "application/json"
|
|
224
|
+
|
|
225
|
+
with metrics.http_request_timer(endpoint) as timer:
|
|
226
|
+
response = self.__session.request(
|
|
227
|
+
method, url, timeout=self.__request_timeout, **kwargs
|
|
228
|
+
)
|
|
229
|
+
timer.tags[metrics.Tag.http_status_code] = response.status_code
|
|
230
|
+
|
|
231
|
+
if response.status_code >= 500:
|
|
232
|
+
raise Server5xxError()
|
|
233
|
+
|
|
234
|
+
if response.status_code != 200:
|
|
235
|
+
raise_for_error(response, self.logger)
|
|
236
|
+
|
|
237
|
+
return response.json()
|
|
238
|
+
|
|
239
|
+
def get(self, path, **kwargs):
|
|
240
|
+
self.logger.info(f"Get request with the path: {path}")
|
|
241
|
+
return self.request("GET", path=path, **kwargs)
|
|
242
|
+
|
|
243
|
+
def post(self, path, **kwargs):
|
|
244
|
+
return self.request("POST", path=path, **kwargs)
|
|
245
|
+
|
|
246
|
+
def perform(self, method, path, **kwargs):
|
|
247
|
+
if method == "POST":
|
|
248
|
+
return self.post(path, **kwargs)
|
|
249
|
+
return self.get(path, **kwargs)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from singer import metadata
|
|
5
|
+
|
|
6
|
+
from mage_integrations.sources.powerbi.streams import STREAMS
|
|
7
|
+
|
|
8
|
+
# Reference:
|
|
9
|
+
# https://github.com/singer-io/getting-started/blob/master/docs/DISCOVERY_MODE.md#Metadata
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def get_abs_path(path):
|
|
13
|
+
return os.path.join(os.path.dirname(os.path.realpath(__file__)), path)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def get_schemas():
|
|
17
|
+
"""
|
|
18
|
+
Loads the schemas defined for the tap.
|
|
19
|
+
|
|
20
|
+
This function iterates through the STREAMS dictionary which contains
|
|
21
|
+
a mapping of the stream name and its corresponding class and loads
|
|
22
|
+
the matching schema file from the schemas directory.
|
|
23
|
+
"""
|
|
24
|
+
schemas = {}
|
|
25
|
+
field_metadata = {}
|
|
26
|
+
|
|
27
|
+
for stream_name, stream_object in STREAMS.items():
|
|
28
|
+
replication_ind = stream_object.to_replicate
|
|
29
|
+
if replication_ind:
|
|
30
|
+
schema_path = get_abs_path("schemas/{}.json".format(stream_name))
|
|
31
|
+
with open(schema_path) as file:
|
|
32
|
+
schema = json.load(file)
|
|
33
|
+
schemas[stream_name] = schema
|
|
34
|
+
|
|
35
|
+
# Documentation:
|
|
36
|
+
# https://github.com/singer-io/getting-started/blob/master/docs/DISCOVERY_MODE.md#singer-python-helper-functions
|
|
37
|
+
# Reference:
|
|
38
|
+
# https://github.com/singer-io/singer-python/blob/master/singer/metadata.py#L25-L44
|
|
39
|
+
mdata = metadata.get_standard_metadata(
|
|
40
|
+
schema=schema,
|
|
41
|
+
key_properties=stream_object.key_properties,
|
|
42
|
+
valid_replication_keys=stream_object.valid_replication_keys,
|
|
43
|
+
replication_method=stream_object.replication_method,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
mdata = metadata.to_map(mdata)
|
|
47
|
+
|
|
48
|
+
if stream_object.replication_key:
|
|
49
|
+
mdata = metadata.write(
|
|
50
|
+
mdata,
|
|
51
|
+
("properties", stream_object.replication_key),
|
|
52
|
+
"inclusion",
|
|
53
|
+
"automatic",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
mdata = metadata.to_list(mdata)
|
|
57
|
+
|
|
58
|
+
field_metadata[stream_name] = mdata
|
|
59
|
+
|
|
60
|
+
return schemas, field_metadata
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"properties": {
|
|
5
|
+
"id": {
|
|
6
|
+
"type": ["string", "null"]
|
|
7
|
+
},
|
|
8
|
+
"description": {
|
|
9
|
+
"type": ["string", "null"]
|
|
10
|
+
},
|
|
11
|
+
"lastUpdate": {
|
|
12
|
+
"type": ["string", "null"],
|
|
13
|
+
"format": "date-time"
|
|
14
|
+
},
|
|
15
|
+
"name": {
|
|
16
|
+
"type": ["string", "null"]
|
|
17
|
+
},
|
|
18
|
+
"publishedBy": {
|
|
19
|
+
"type": ["string", "null"]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"properties": {
|
|
5
|
+
"id": {
|
|
6
|
+
"type": ["string", "null"],
|
|
7
|
+
"format": "uuid"
|
|
8
|
+
},
|
|
9
|
+
"displayName": {
|
|
10
|
+
"type": ["string", "null"]
|
|
11
|
+
},
|
|
12
|
+
"isReadOnly": {
|
|
13
|
+
"type": ["boolean", "null"]
|
|
14
|
+
},
|
|
15
|
+
"webUrl": {
|
|
16
|
+
"type": ["string", "null"],
|
|
17
|
+
"format": "uri"
|
|
18
|
+
},
|
|
19
|
+
"embedUrl": {
|
|
20
|
+
"type": ["string", "null"],
|
|
21
|
+
"format": "uri"
|
|
22
|
+
},
|
|
23
|
+
"users": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": ["string", "null"]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"subscriptions": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": {
|
|
32
|
+
"type": ["string", "null"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"properties": {
|
|
5
|
+
"id": {
|
|
6
|
+
"type": ["string", "null"],
|
|
7
|
+
"format": "uuid"
|
|
8
|
+
},
|
|
9
|
+
"name": {
|
|
10
|
+
"type": ["string", "null"]
|
|
11
|
+
},
|
|
12
|
+
"addRowsAPIEnabled": {
|
|
13
|
+
"type": ["boolean", "null"]
|
|
14
|
+
},
|
|
15
|
+
"configuredBy": {
|
|
16
|
+
"type": ["string", "null"]
|
|
17
|
+
},
|
|
18
|
+
"isRefreshable": {
|
|
19
|
+
"type": ["boolean", "null"]
|
|
20
|
+
},
|
|
21
|
+
"isEffectiveIdentityRequired": {
|
|
22
|
+
"type": ["boolean", "null"]
|
|
23
|
+
},
|
|
24
|
+
"isEffectiveIdentityRolesRequired": {
|
|
25
|
+
"type": ["boolean", "null"]
|
|
26
|
+
},
|
|
27
|
+
"isOnPremGatewayRequired": {
|
|
28
|
+
"type": ["boolean", "null"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"properties": {
|
|
5
|
+
"id": {
|
|
6
|
+
"type": ["string", "null"],
|
|
7
|
+
"format": "uuid"
|
|
8
|
+
},
|
|
9
|
+
"name": {
|
|
10
|
+
"type": ["string", "null"]
|
|
11
|
+
},
|
|
12
|
+
"isReadOnly": {
|
|
13
|
+
"type": ["boolean", "null"]
|
|
14
|
+
},
|
|
15
|
+
"isOnDedicatedCapacity": {
|
|
16
|
+
"type": ["boolean", "null"]
|
|
17
|
+
},
|
|
18
|
+
"defaultDatasetStorageFormat": {
|
|
19
|
+
"type": ["string", "null"]
|
|
20
|
+
},
|
|
21
|
+
"embedUrl": {
|
|
22
|
+
"type": ["string", "null"],
|
|
23
|
+
"format": "uri"
|
|
24
|
+
},
|
|
25
|
+
"capacityId": {
|
|
26
|
+
"type": ["string", "null"],
|
|
27
|
+
"format": "uuid"
|
|
28
|
+
},
|
|
29
|
+
"dataflowStorageId": {
|
|
30
|
+
"type": ["string", "null"],
|
|
31
|
+
"format": "uuid"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"properties": {
|
|
5
|
+
"id": {
|
|
6
|
+
"type": ["string", "null"],
|
|
7
|
+
"format": "uuid"
|
|
8
|
+
},
|
|
9
|
+
"name": {
|
|
10
|
+
"type": ["string", "null"]
|
|
11
|
+
},
|
|
12
|
+
"datasetId": {
|
|
13
|
+
"type": ["string", "null"],
|
|
14
|
+
"format": "uuid"
|
|
15
|
+
},
|
|
16
|
+
"webUrl": {
|
|
17
|
+
"type": ["string", "null"],
|
|
18
|
+
"format": "uri"
|
|
19
|
+
},
|
|
20
|
+
"embedUrl": {
|
|
21
|
+
"type": ["string", "null"],
|
|
22
|
+
"format": "uri"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|