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.
Files changed (1016) hide show
  1. mage_integrations/__init__.py +0 -0
  2. mage_integrations/connections/__init__.py +0 -0
  3. mage_integrations/connections/airtable/__init__.py +31 -0
  4. mage_integrations/connections/base.py +19 -0
  5. mage_integrations/connections/bigquery/__init__.py +49 -0
  6. mage_integrations/connections/constants.py +3 -0
  7. mage_integrations/connections/couchbase/__init__.py +43 -0
  8. mage_integrations/connections/doris/__init__.py +89 -0
  9. mage_integrations/connections/dremio/__init__.py +104 -0
  10. mage_integrations/connections/google_analytics/__init__.py +104 -0
  11. mage_integrations/connections/google_analytics/constants.py +266 -0
  12. mage_integrations/connections/google_analytics/utils.py +14 -0
  13. mage_integrations/connections/google_cloud_storage/__init__.py +33 -0
  14. mage_integrations/connections/google_search_console/__init__.py +58 -0
  15. mage_integrations/connections/google_sheets/__init__.py +96 -0
  16. mage_integrations/connections/mssql/__init__.py +60 -0
  17. mage_integrations/connections/mysql/__init__.py +93 -0
  18. mage_integrations/connections/oracledb/__init__.py +33 -0
  19. mage_integrations/connections/postgresql/__init__.py +39 -0
  20. mage_integrations/connections/redshift/__init__.py +45 -0
  21. mage_integrations/connections/snowflake/__init__.py +47 -0
  22. mage_integrations/connections/sql/__init__.py +0 -0
  23. mage_integrations/connections/sql/base.py +124 -0
  24. mage_integrations/connections/teradata/__init__.py +33 -0
  25. mage_integrations/connections/trino/__init__.py +40 -0
  26. mage_integrations/connections/trino/connection_wrapper.py +28 -0
  27. mage_integrations/connections/utils/__init__.py +0 -0
  28. mage_integrations/connections/utils/google.py +14 -0
  29. mage_integrations/connections/utils/sql.py +2 -0
  30. mage_integrations/destinations/__init__.py +0 -0
  31. mage_integrations/destinations/airtable/Readme.md +27 -0
  32. mage_integrations/destinations/airtable/__init__.py +92 -0
  33. mage_integrations/destinations/airtable/templates/config.json +4 -0
  34. mage_integrations/destinations/amazon_s3/README.md +24 -0
  35. mage_integrations/destinations/amazon_s3/__init__.py +172 -0
  36. mage_integrations/destinations/amazon_s3/templates/config.json +10 -0
  37. mage_integrations/destinations/amplitude/README.md +58 -0
  38. mage_integrations/destinations/amplitude/__init__.py +91 -0
  39. mage_integrations/destinations/amplitude/templates/config.json +5 -0
  40. mage_integrations/destinations/base.py +810 -0
  41. mage_integrations/destinations/bigquery/README.md +54 -0
  42. mage_integrations/destinations/bigquery/__init__.py +834 -0
  43. mage_integrations/destinations/bigquery/constants.py +8 -0
  44. mage_integrations/destinations/bigquery/templates/config.json +8 -0
  45. mage_integrations/destinations/bigquery/utils.py +304 -0
  46. mage_integrations/destinations/clickhouse/LICENSE +201 -0
  47. mage_integrations/destinations/clickhouse/README.md +14 -0
  48. mage_integrations/destinations/clickhouse/__init__.py +32 -0
  49. mage_integrations/destinations/clickhouse/target_clickhouse/__init__.py +1 -0
  50. mage_integrations/destinations/clickhouse/target_clickhouse/sinks.py +234 -0
  51. mage_integrations/destinations/clickhouse/target_clickhouse/target.py +137 -0
  52. mage_integrations/destinations/clickhouse/templates/config.json +4 -0
  53. mage_integrations/destinations/constants.py +50 -0
  54. mage_integrations/destinations/delta_lake/README.md +0 -0
  55. mage_integrations/destinations/delta_lake/__init__.py +0 -0
  56. mage_integrations/destinations/delta_lake/base.py +227 -0
  57. mage_integrations/destinations/delta_lake/constants.py +2 -0
  58. mage_integrations/destinations/delta_lake_azure/README.md +18 -0
  59. mage_integrations/destinations/delta_lake_azure/__init__.py +45 -0
  60. mage_integrations/destinations/delta_lake_azure/templates/config.json +6 -0
  61. mage_integrations/destinations/delta_lake_s3/README.md +21 -0
  62. mage_integrations/destinations/delta_lake_s3/__init__.py +130 -0
  63. mage_integrations/destinations/delta_lake_s3/templates/config.json +9 -0
  64. mage_integrations/destinations/doris/README.md +32 -0
  65. mage_integrations/destinations/doris/__init__.py +209 -0
  66. mage_integrations/destinations/doris/constants.py +755 -0
  67. mage_integrations/destinations/doris/templates/config.json +9 -0
  68. mage_integrations/destinations/doris/utils.py +118 -0
  69. mage_integrations/destinations/elasticsearch/README.md +57 -0
  70. mage_integrations/destinations/elasticsearch/__init__.py +37 -0
  71. mage_integrations/destinations/elasticsearch/target_elasticsearch/__init__.py +0 -0
  72. mage_integrations/destinations/elasticsearch/target_elasticsearch/common.py +32 -0
  73. mage_integrations/destinations/elasticsearch/target_elasticsearch/sinks.py +262 -0
  74. mage_integrations/destinations/elasticsearch/target_elasticsearch/target.py +267 -0
  75. mage_integrations/destinations/elasticsearch/templates/config.json +8 -0
  76. mage_integrations/destinations/google_cloud_storage/README.md +19 -0
  77. mage_integrations/destinations/google_cloud_storage/__init__.py +109 -0
  78. mage_integrations/destinations/google_cloud_storage/templates/config.json +8 -0
  79. mage_integrations/destinations/kafka/README.md +18 -0
  80. mage_integrations/destinations/kafka/__init__.py +91 -0
  81. mage_integrations/destinations/kafka/templates/config.json +5 -0
  82. mage_integrations/destinations/mongodb/README.md +11 -0
  83. mage_integrations/destinations/mongodb/__init__.py +28 -0
  84. mage_integrations/destinations/mongodb/target_mongodb/__init__.py +0 -0
  85. mage_integrations/destinations/mongodb/target_mongodb/sinks.py +135 -0
  86. mage_integrations/destinations/mongodb/target_mongodb/target.py +169 -0
  87. mage_integrations/destinations/mongodb/templates/config.json +5 -0
  88. mage_integrations/destinations/mssql/README.md +31 -0
  89. mage_integrations/destinations/mssql/__init__.py +214 -0
  90. mage_integrations/destinations/mssql/templates/config.json +10 -0
  91. mage_integrations/destinations/mssql/utils.py +101 -0
  92. mage_integrations/destinations/mysql/README.md +36 -0
  93. mage_integrations/destinations/mysql/__init__.py +215 -0
  94. mage_integrations/destinations/mysql/constants.py +755 -0
  95. mage_integrations/destinations/mysql/templates/config.json +9 -0
  96. mage_integrations/destinations/mysql/utils.py +154 -0
  97. mage_integrations/destinations/opensearch/README.md +22 -0
  98. mage_integrations/destinations/opensearch/__init__.py +35 -0
  99. mage_integrations/destinations/opensearch/target_opensearch/__init__.py +0 -0
  100. mage_integrations/destinations/opensearch/target_opensearch/common.py +30 -0
  101. mage_integrations/destinations/opensearch/target_opensearch/sinks.py +221 -0
  102. mage_integrations/destinations/opensearch/target_opensearch/target.py +241 -0
  103. mage_integrations/destinations/opensearch/templates/config.json +5 -0
  104. mage_integrations/destinations/oracledb/README.md +22 -0
  105. mage_integrations/destinations/oracledb/__init__.py +241 -0
  106. mage_integrations/destinations/oracledb/templates/config.json +10 -0
  107. mage_integrations/destinations/oracledb/utils.py +114 -0
  108. mage_integrations/destinations/postgresql/README.md +30 -0
  109. mage_integrations/destinations/postgresql/__init__.py +264 -0
  110. mage_integrations/destinations/postgresql/templates/config.json +9 -0
  111. mage_integrations/destinations/postgresql/utils.py +77 -0
  112. mage_integrations/destinations/redshift/README.md +45 -0
  113. mage_integrations/destinations/redshift/__init__.py +306 -0
  114. mage_integrations/destinations/redshift/constants.py +155 -0
  115. mage_integrations/destinations/redshift/templates/config.json +11 -0
  116. mage_integrations/destinations/redshift/utils.py +28 -0
  117. mage_integrations/destinations/salesforce/README.md +38 -0
  118. mage_integrations/destinations/salesforce/__init__.py +37 -0
  119. mage_integrations/destinations/salesforce/target_salesforce/__init__.py +0 -0
  120. mage_integrations/destinations/salesforce/target_salesforce/session_credentials.py +96 -0
  121. mage_integrations/destinations/salesforce/target_salesforce/sinks.py +161 -0
  122. mage_integrations/destinations/salesforce/target_salesforce/target.py +182 -0
  123. mage_integrations/destinations/salesforce/target_salesforce/utils/__init__.py +0 -0
  124. mage_integrations/destinations/salesforce/target_salesforce/utils/exceptions.py +10 -0
  125. mage_integrations/destinations/salesforce/target_salesforce/utils/transformation.py +25 -0
  126. mage_integrations/destinations/salesforce/target_salesforce/utils/validation.py +54 -0
  127. mage_integrations/destinations/salesforce/templates/config.json +8 -0
  128. mage_integrations/destinations/sink.py +594 -0
  129. mage_integrations/destinations/snowflake/README.md +39 -0
  130. mage_integrations/destinations/snowflake/__init__.py +582 -0
  131. mage_integrations/destinations/snowflake/constants.py +1 -0
  132. mage_integrations/destinations/snowflake/templates/config.json +14 -0
  133. mage_integrations/destinations/snowflake/utils.py +92 -0
  134. mage_integrations/destinations/sql/__init__.py +0 -0
  135. mage_integrations/destinations/sql/base.py +435 -0
  136. mage_integrations/destinations/sql/constants.py +843 -0
  137. mage_integrations/destinations/sql/utils.py +363 -0
  138. mage_integrations/destinations/sqlsink.py +414 -0
  139. mage_integrations/destinations/target.py +561 -0
  140. mage_integrations/destinations/teradata/README.md +18 -0
  141. mage_integrations/destinations/teradata/__init__.py +357 -0
  142. mage_integrations/destinations/teradata/templates/config.json +7 -0
  143. mage_integrations/destinations/teradata/utils.py +103 -0
  144. mage_integrations/destinations/trino/README.md +84 -0
  145. mage_integrations/destinations/trino/__init__.py +27 -0
  146. mage_integrations/destinations/trino/connectors/__init__.py +0 -0
  147. mage_integrations/destinations/trino/connectors/base.py +325 -0
  148. mage_integrations/destinations/trino/connectors/deltalake.py +53 -0
  149. mage_integrations/destinations/trino/connectors/iceberg.py +19 -0
  150. mage_integrations/destinations/trino/templates/config.json +14 -0
  151. mage_integrations/destinations/trino/utils.py +33 -0
  152. mage_integrations/destinations/utils.py +50 -0
  153. mage_integrations/sources/README.md +3 -0
  154. mage_integrations/sources/__init__.py +0 -0
  155. mage_integrations/sources/airtable/README.md +27 -0
  156. mage_integrations/sources/airtable/__init__.py +180 -0
  157. mage_integrations/sources/airtable/templates/config.json +5 -0
  158. mage_integrations/sources/amazon_s3/README.md +25 -0
  159. mage_integrations/sources/amazon_s3/__init__.py +298 -0
  160. mage_integrations/sources/amazon_s3/templates/config.json +11 -0
  161. mage_integrations/sources/amplitude/README.md +67 -0
  162. mage_integrations/sources/amplitude/__init__.py +356 -0
  163. mage_integrations/sources/amplitude/constants.py +58 -0
  164. mage_integrations/sources/amplitude/schemas/active_users.json +28 -0
  165. mage_integrations/sources/amplitude/schemas/annotations.json +54 -0
  166. mage_integrations/sources/amplitude/schemas/average_session_length.json +28 -0
  167. mage_integrations/sources/amplitude/schemas/cohort_members.json +34 -0
  168. mage_integrations/sources/amplitude/schemas/cohorts.json +144 -0
  169. mage_integrations/sources/amplitude/schemas/event_properties.json +72 -0
  170. mage_integrations/sources/amplitude/schemas/event_types.json +77 -0
  171. mage_integrations/sources/amplitude/schemas/events.json +349 -0
  172. mage_integrations/sources/amplitude/schemas/new_users.json +28 -0
  173. mage_integrations/sources/amplitude/schemas/sessions_per_user.json +28 -0
  174. mage_integrations/sources/amplitude/schemas/user_properties.json +66 -0
  175. mage_integrations/sources/amplitude/templates/config.json +7 -0
  176. mage_integrations/sources/amplitude/templates/query.json +4 -0
  177. mage_integrations/sources/api/README.md +211 -0
  178. mage_integrations/sources/api/__init__.py +279 -0
  179. mage_integrations/sources/api/templates/config.json +9 -0
  180. mage_integrations/sources/azure_blob_storage/README.md +21 -0
  181. mage_integrations/sources/azure_blob_storage/__init__.py +160 -0
  182. mage_integrations/sources/azure_blob_storage/templates/config.json +5 -0
  183. mage_integrations/sources/base.py +781 -0
  184. mage_integrations/sources/bigquery/README.md +49 -0
  185. mage_integrations/sources/bigquery/__init__.py +56 -0
  186. mage_integrations/sources/bigquery/templates/config.json +4 -0
  187. mage_integrations/sources/catalog.py +125 -0
  188. mage_integrations/sources/chargebee/README.md +21 -0
  189. mage_integrations/sources/chargebee/__init__.py +83 -0
  190. mage_integrations/sources/chargebee/client.py +194 -0
  191. mage_integrations/sources/chargebee/schemas/common/cards.json +57 -0
  192. mage_integrations/sources/chargebee/schemas/common/comments.json +30 -0
  193. mage_integrations/sources/chargebee/schemas/common/credit_notes.json +404 -0
  194. mage_integrations/sources/chargebee/schemas/common/customers.json +428 -0
  195. mage_integrations/sources/chargebee/schemas/common/gifts.json +85 -0
  196. mage_integrations/sources/chargebee/schemas/common/invoices.json +680 -0
  197. mage_integrations/sources/chargebee/schemas/common/orders.json +431 -0
  198. mage_integrations/sources/chargebee/schemas/common/payment_sources.json +180 -0
  199. mage_integrations/sources/chargebee/schemas/common/promotional_credits.json +46 -0
  200. mage_integrations/sources/chargebee/schemas/common/quotes.json +380 -0
  201. mage_integrations/sources/chargebee/schemas/common/transactions.json +241 -0
  202. mage_integrations/sources/chargebee/schemas/common/virtual_bank_accounts.json +56 -0
  203. mage_integrations/sources/chargebee/schemas/item_model/coupons.json +251 -0
  204. mage_integrations/sources/chargebee/schemas/item_model/events.json +653 -0
  205. mage_integrations/sources/chargebee/schemas/item_model/item_families.json +63 -0
  206. mage_integrations/sources/chargebee/schemas/item_model/item_prices.json +342 -0
  207. mage_integrations/sources/chargebee/schemas/item_model/items.json +187 -0
  208. mage_integrations/sources/chargebee/schemas/item_model/subscriptions.json +873 -0
  209. mage_integrations/sources/chargebee/schemas/plan_model/addons.json +163 -0
  210. mage_integrations/sources/chargebee/schemas/plan_model/coupons.json +103 -0
  211. mage_integrations/sources/chargebee/schemas/plan_model/events.json +647 -0
  212. mage_integrations/sources/chargebee/schemas/plan_model/plans.json +250 -0
  213. mage_integrations/sources/chargebee/schemas/plan_model/subscriptions.json +465 -0
  214. mage_integrations/sources/chargebee/state.py +44 -0
  215. mage_integrations/sources/chargebee/streams/__init__.py +69 -0
  216. mage_integrations/sources/chargebee/streams/addons.py +19 -0
  217. mage_integrations/sources/chargebee/streams/base.py +244 -0
  218. mage_integrations/sources/chargebee/streams/comments.py +19 -0
  219. mage_integrations/sources/chargebee/streams/coupons.py +24 -0
  220. mage_integrations/sources/chargebee/streams/credit_notes.py +19 -0
  221. mage_integrations/sources/chargebee/streams/customers.py +19 -0
  222. mage_integrations/sources/chargebee/streams/events.py +24 -0
  223. mage_integrations/sources/chargebee/streams/gifts.py +19 -0
  224. mage_integrations/sources/chargebee/streams/invoices.py +19 -0
  225. mage_integrations/sources/chargebee/streams/item_families.py +19 -0
  226. mage_integrations/sources/chargebee/streams/item_prices.py +19 -0
  227. mage_integrations/sources/chargebee/streams/items.py +19 -0
  228. mage_integrations/sources/chargebee/streams/orders.py +19 -0
  229. mage_integrations/sources/chargebee/streams/payment_sources.py +19 -0
  230. mage_integrations/sources/chargebee/streams/plans.py +19 -0
  231. mage_integrations/sources/chargebee/streams/promotional_credits.py +19 -0
  232. mage_integrations/sources/chargebee/streams/quotes.py +19 -0
  233. mage_integrations/sources/chargebee/streams/subscriptions.py +24 -0
  234. mage_integrations/sources/chargebee/streams/transactions.py +19 -0
  235. mage_integrations/sources/chargebee/streams/util.py +6 -0
  236. mage_integrations/sources/chargebee/streams/virtual_bank_accounts.py +19 -0
  237. mage_integrations/sources/chargebee/templates/config.json +7 -0
  238. mage_integrations/sources/commercetools/README.md +28 -0
  239. mage_integrations/sources/commercetools/__init__.py +40 -0
  240. mage_integrations/sources/commercetools/client.py +54 -0
  241. mage_integrations/sources/commercetools/schemas/customers.json +108 -0
  242. mage_integrations/sources/commercetools/schemas/discount_codes.json +77 -0
  243. mage_integrations/sources/commercetools/schemas/inventory.json +50 -0
  244. mage_integrations/sources/commercetools/schemas/orders.json +542 -0
  245. mage_integrations/sources/commercetools/schemas/payments.json +113 -0
  246. mage_integrations/sources/commercetools/schemas/products.json +82 -0
  247. mage_integrations/sources/commercetools/schemas/shared/address.json +83 -0
  248. mage_integrations/sources/commercetools/schemas/shared/created_by.json +17 -0
  249. mage_integrations/sources/commercetools/schemas/shared/custom.json +17 -0
  250. mage_integrations/sources/commercetools/schemas/shared/dimension.json +11 -0
  251. mage_integrations/sources/commercetools/schemas/shared/discounted_price_per_quantity.json +30 -0
  252. mage_integrations/sources/commercetools/schemas/shared/field_type.json +8 -0
  253. mage_integrations/sources/commercetools/schemas/shared/key_reference.json +11 -0
  254. mage_integrations/sources/commercetools/schemas/shared/last_modified_by.json +17 -0
  255. mage_integrations/sources/commercetools/schemas/shared/localized_string.json +8 -0
  256. mage_integrations/sources/commercetools/schemas/shared/money.json +17 -0
  257. mage_integrations/sources/commercetools/schemas/shared/price.json +56 -0
  258. mage_integrations/sources/commercetools/schemas/shared/price_scoped.json +45 -0
  259. mage_integrations/sources/commercetools/schemas/shared/product_data.json +52 -0
  260. mage_integrations/sources/commercetools/schemas/shared/product_variant.json +132 -0
  261. mage_integrations/sources/commercetools/schemas/shared/reference.json +22 -0
  262. mage_integrations/sources/commercetools/schemas/shared/shipping_details.json +22 -0
  263. mage_integrations/sources/commercetools/schemas/shared/state.json +11 -0
  264. mage_integrations/sources/commercetools/schemas/shared/taxed_item_price.json +11 -0
  265. mage_integrations/sources/commercetools/schemas/shared/taxed_price.json +28 -0
  266. mage_integrations/sources/commercetools/schemas/shared/taxrate.json +37 -0
  267. mage_integrations/sources/commercetools/schemas.py +25 -0
  268. mage_integrations/sources/commercetools/streams/__init__.py +0 -0
  269. mage_integrations/sources/commercetools/streams/base.py +30 -0
  270. mage_integrations/sources/commercetools/streams/customers.py +7 -0
  271. mage_integrations/sources/commercetools/streams/discount_codes.py +7 -0
  272. mage_integrations/sources/commercetools/streams/inventory.py +7 -0
  273. mage_integrations/sources/commercetools/streams/orders.py +7 -0
  274. mage_integrations/sources/commercetools/streams/payments.py +7 -0
  275. mage_integrations/sources/commercetools/streams/products.py +7 -0
  276. mage_integrations/sources/commercetools/templates/config.json +7 -0
  277. mage_integrations/sources/constants.py +46 -0
  278. mage_integrations/sources/couchbase/README.md +25 -0
  279. mage_integrations/sources/couchbase/__init__.py +140 -0
  280. mage_integrations/sources/couchbase/templates/config.json +7 -0
  281. mage_integrations/sources/couchbase/utils.py +58 -0
  282. mage_integrations/sources/datadog/README.md +25 -0
  283. mage_integrations/sources/datadog/__init__.py +55 -0
  284. mage_integrations/sources/datadog/client.py +18 -0
  285. mage_integrations/sources/datadog/schemas/audit_logs.json +49 -0
  286. mage_integrations/sources/datadog/schemas/dashboards.json +55 -0
  287. mage_integrations/sources/datadog/schemas/downtimes.json +103 -0
  288. mage_integrations/sources/datadog/schemas/incident_teams.json +92 -0
  289. mage_integrations/sources/datadog/schemas/incidents.json +135 -0
  290. mage_integrations/sources/datadog/schemas/logs.json +61 -0
  291. mage_integrations/sources/datadog/schemas/synthetic_tests.json +105 -0
  292. mage_integrations/sources/datadog/schemas/users.json +76 -0
  293. mage_integrations/sources/datadog/streams/__init__.py +275 -0
  294. mage_integrations/sources/datadog/templates/config.json +9 -0
  295. mage_integrations/sources/doris/README.md +28 -0
  296. mage_integrations/sources/doris/__init__.py +68 -0
  297. mage_integrations/sources/doris/templates/config.json +13 -0
  298. mage_integrations/sources/dremio/README.md +44 -0
  299. mage_integrations/sources/dremio/__init__.py +174 -0
  300. mage_integrations/sources/dremio/templates/config.json +6 -0
  301. mage_integrations/sources/dremio/utils.py +28 -0
  302. mage_integrations/sources/dynamodb/README.md +14 -0
  303. mage_integrations/sources/dynamodb/__init__.py +225 -0
  304. mage_integrations/sources/dynamodb/templates/config.json +6 -0
  305. mage_integrations/sources/facebook_ads/README.md +49 -0
  306. mage_integrations/sources/facebook_ads/__init__.py +45 -0
  307. mage_integrations/sources/facebook_ads/tap_facebook/__init__.py +1040 -0
  308. mage_integrations/sources/facebook_ads/tap_facebook/process_output.py +114 -0
  309. mage_integrations/sources/facebook_ads/tap_facebook/schemas/adcreative.json +1440 -0
  310. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads.json +859 -0
  311. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights.json +339 -0
  312. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_age_and_gender.json +352 -0
  313. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_country.json +345 -0
  314. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_dma.json +183 -0
  315. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_hourly_advertiser.json +311 -0
  316. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_platform_and_device.json +363 -0
  317. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_region.json +345 -0
  318. mage_integrations/sources/facebook_ads/tap_facebook/schemas/adsets.json +200 -0
  319. mage_integrations/sources/facebook_ads/tap_facebook/schemas/campaigns.json +98 -0
  320. mage_integrations/sources/facebook_ads/tap_facebook/schemas/leads.json +65 -0
  321. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_action_stats.json +74 -0
  322. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_histogram_stats.json +32 -0
  323. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_image_crops.json +134 -0
  324. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/geo_locations.json +270 -0
  325. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/targeting.json +401 -0
  326. mage_integrations/sources/facebook_ads/templates/config.json +5 -0
  327. mage_integrations/sources/facebook_ads/tests/base.py +396 -0
  328. mage_integrations/sources/facebook_ads/tests/facebook_ads/adcreative/output/00000000000000000000 +8 -0
  329. mage_integrations/sources/facebook_ads/tests/facebook_ads/ads/output/00000000000000000000 +10 -0
  330. mage_integrations/sources/facebook_ads/tests/facebook_ads/adsets/output/00000000000000000000 +11 -0
  331. mage_integrations/sources/facebook_ads/tests/facebook_ads/campaigns/output/00000000000000000000 +14 -0
  332. mage_integrations/sources/facebook_ads/tests/test_facebook_archived_data.py +115 -0
  333. mage_integrations/sources/facebook_ads/tests/test_facebook_attribution_window.py +104 -0
  334. mage_integrations/sources/facebook_ads/tests/test_facebook_automatic_fields.py +85 -0
  335. mage_integrations/sources/facebook_ads/tests/test_facebook_bookmarks.py +256 -0
  336. mage_integrations/sources/facebook_ads/tests/test_facebook_discovery.py +122 -0
  337. mage_integrations/sources/facebook_ads/tests/test_facebook_field_selection.py +118 -0
  338. mage_integrations/sources/facebook_ads/tests/test_facebook_invalid_attribution_window.py +65 -0
  339. mage_integrations/sources/facebook_ads/tests/test_facebook_start_date.py +145 -0
  340. mage_integrations/sources/facebook_ads/tests/unittests/test_attribute_error_retry.py +193 -0
  341. mage_integrations/sources/facebook_ads/tests/unittests/test_attribution_window.py +29 -0
  342. mage_integrations/sources/facebook_ads/tests/unittests/test_request_timeout.py +504 -0
  343. mage_integrations/sources/facebook_ads/tests/unittests/test_retry_logic.py +261 -0
  344. mage_integrations/sources/facebook_ads/tests/unittests/test_sync_batches_retry.py +154 -0
  345. mage_integrations/sources/facebook_ads/tests/unittests/test_tap_facebook.py +160 -0
  346. mage_integrations/sources/freshdesk/README.md +24 -0
  347. mage_integrations/sources/freshdesk/__init__.py +25 -0
  348. mage_integrations/sources/freshdesk/tap_freshdesk/__init__.py +325 -0
  349. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/agents.json +85 -0
  350. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/companies.json +45 -0
  351. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/contacts.json +165 -0
  352. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/conversations.json +178 -0
  353. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/groups.json +40 -0
  354. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/roles.json +25 -0
  355. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/satisfaction_ratings.json +75 -0
  356. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/tickets.json +332 -0
  357. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/time_entries.json +72 -0
  358. mage_integrations/sources/freshdesk/tap_freshdesk/utils.py +93 -0
  359. mage_integrations/sources/freshdesk/templates/config.json +5 -0
  360. mage_integrations/sources/freshdesk/tests/base.py +262 -0
  361. mage_integrations/sources/freshdesk/tests/test_freshdesk_bookmarks.py +250 -0
  362. mage_integrations/sources/freshdesk/tests/test_freshdesk_check.py +29 -0
  363. mage_integrations/sources/freshdesk/tests/test_freshdesk_pagination.py +58 -0
  364. mage_integrations/sources/freshdesk/tests/test_freshdesk_start_date.py +181 -0
  365. mage_integrations/sources/front/README.md +25 -0
  366. mage_integrations/sources/front/__init__.py +40 -0
  367. mage_integrations/sources/front/client.py +76 -0
  368. mage_integrations/sources/front/context.py +62 -0
  369. mage_integrations/sources/front/schemas/accounts.json +37 -0
  370. mage_integrations/sources/front/schemas/analytics.json +71 -0
  371. mage_integrations/sources/front/schemas/channels.json +28 -0
  372. mage_integrations/sources/front/schemas/contact_groups.json +15 -0
  373. mage_integrations/sources/front/schemas/contacts.json +49 -0
  374. mage_integrations/sources/front/schemas/conversations.json +40 -0
  375. mage_integrations/sources/front/schemas/custom_fields.json +18 -0
  376. mage_integrations/sources/front/schemas/events.json +27 -0
  377. mage_integrations/sources/front/schemas/rules.json +21 -0
  378. mage_integrations/sources/front/schemas/tags.json +27 -0
  379. mage_integrations/sources/front/schemas/teammates.json +30 -0
  380. mage_integrations/sources/front/schemas/teams.json +12 -0
  381. mage_integrations/sources/front/schemas.py +43 -0
  382. mage_integrations/sources/front/streams/__init__.py +0 -0
  383. mage_integrations/sources/front/streams/accounts.py +7 -0
  384. mage_integrations/sources/front/streams/analytics.py +97 -0
  385. mage_integrations/sources/front/streams/base.py +29 -0
  386. mage_integrations/sources/front/streams/channels.py +7 -0
  387. mage_integrations/sources/front/streams/contact_groups.py +7 -0
  388. mage_integrations/sources/front/streams/contacts.py +7 -0
  389. mage_integrations/sources/front/streams/conversations.py +7 -0
  390. mage_integrations/sources/front/streams/custom_fields.py +7 -0
  391. mage_integrations/sources/front/streams/events.py +7 -0
  392. mage_integrations/sources/front/streams/rules.py +7 -0
  393. mage_integrations/sources/front/streams/tags.py +7 -0
  394. mage_integrations/sources/front/streams/teammates.py +7 -0
  395. mage_integrations/sources/front/streams/teams.py +7 -0
  396. mage_integrations/sources/front/templates/config.json +6 -0
  397. mage_integrations/sources/github/README.md +55 -0
  398. mage_integrations/sources/github/__init__.py +48 -0
  399. mage_integrations/sources/github/tap_github/__init__.py +47 -0
  400. mage_integrations/sources/github/tap_github/client.py +430 -0
  401. mage_integrations/sources/github/tap_github/discover.py +41 -0
  402. mage_integrations/sources/github/tap_github/schema.py +88 -0
  403. mage_integrations/sources/github/tap_github/schemas/assignees.json +72 -0
  404. mage_integrations/sources/github/tap_github/schemas/collaborators.json +75 -0
  405. mage_integrations/sources/github/tap_github/schemas/comments.json +120 -0
  406. mage_integrations/sources/github/tap_github/schemas/commit_comments.json +114 -0
  407. mage_integrations/sources/github/tap_github/schemas/commits.json +278 -0
  408. mage_integrations/sources/github/tap_github/schemas/events.json +1055 -0
  409. mage_integrations/sources/github/tap_github/schemas/issue_events.json +963 -0
  410. mage_integrations/sources/github/tap_github/schemas/issue_labels.json +29 -0
  411. mage_integrations/sources/github/tap_github/schemas/issue_milestones.json +125 -0
  412. mage_integrations/sources/github/tap_github/schemas/issues.json +276 -0
  413. mage_integrations/sources/github/tap_github/schemas/pr_commits.json +323 -0
  414. mage_integrations/sources/github/tap_github/schemas/project_cards.json +120 -0
  415. mage_integrations/sources/github/tap_github/schemas/project_columns.json +34 -0
  416. mage_integrations/sources/github/tap_github/schemas/projects.json +117 -0
  417. mage_integrations/sources/github/tap_github/schemas/pull_requests.json +1646 -0
  418. mage_integrations/sources/github/tap_github/schemas/releases.json +192 -0
  419. mage_integrations/sources/github/tap_github/schemas/review_comments.json +178 -0
  420. mage_integrations/sources/github/tap_github/schemas/reviews.json +70 -0
  421. mage_integrations/sources/github/tap_github/schemas/shared/issue_permissions.json +20 -0
  422. mage_integrations/sources/github/tap_github/schemas/shared/performed_via_github_app.json +61 -0
  423. mage_integrations/sources/github/tap_github/schemas/shared/pull_permissions.json +20 -0
  424. mage_integrations/sources/github/tap_github/schemas/shared/reactions.json +35 -0
  425. mage_integrations/sources/github/tap_github/schemas/shared/user.json +68 -0
  426. mage_integrations/sources/github/tap_github/schemas/stargazers.json +19 -0
  427. mage_integrations/sources/github/tap_github/schemas/team_members.json +74 -0
  428. mage_integrations/sources/github/tap_github/schemas/team_memberships.json +20 -0
  429. mage_integrations/sources/github/tap_github/schemas/teams.json +47 -0
  430. mage_integrations/sources/github/tap_github/streams.py +952 -0
  431. mage_integrations/sources/github/tap_github/sync.py +306 -0
  432. mage_integrations/sources/github/templates/config.json +7 -0
  433. mage_integrations/sources/github/tests/__init__.py +0 -0
  434. mage_integrations/sources/github/tests/base.py +445 -0
  435. mage_integrations/sources/google_ads/README.md +28 -0
  436. mage_integrations/sources/google_ads/__init__.py +41 -0
  437. mage_integrations/sources/google_ads/tap_google_ads/__init__.py +57 -0
  438. mage_integrations/sources/google_ads/tap_google_ads/client.py +17 -0
  439. mage_integrations/sources/google_ads/tap_google_ads/discover.py +268 -0
  440. mage_integrations/sources/google_ads/tap_google_ads/report_definitions.py +1877 -0
  441. mage_integrations/sources/google_ads/tap_google_ads/schemas/accounts.json +171 -0
  442. mage_integrations/sources/google_ads/tap_google_ads/schemas/ad_groups.json +268 -0
  443. mage_integrations/sources/google_ads/tap_google_ads/schemas/ads.json +1759 -0
  444. mage_integrations/sources/google_ads/tap_google_ads/schemas/campaigns.json +858 -0
  445. mage_integrations/sources/google_ads/tap_google_ads/streams.py +1170 -0
  446. mage_integrations/sources/google_ads/tap_google_ads/sync.py +144 -0
  447. mage_integrations/sources/google_ads/tap_google_ads/tests/base.py +434 -0
  448. mage_integrations/sources/google_ads/templates/config.json +13 -0
  449. mage_integrations/sources/google_analytics/README.md +31 -0
  450. mage_integrations/sources/google_analytics/__init__.py +128 -0
  451. mage_integrations/sources/google_analytics/templates/config.json +6 -0
  452. mage_integrations/sources/google_cloud_storage/README.md +40 -0
  453. mage_integrations/sources/google_cloud_storage/__init__.py +166 -0
  454. mage_integrations/sources/google_cloud_storage/templates/config.json +7 -0
  455. mage_integrations/sources/google_search_console/README.md +20 -0
  456. mage_integrations/sources/google_search_console/__init__.py +99 -0
  457. mage_integrations/sources/google_search_console/schemas/performance_report_country.json +31 -0
  458. mage_integrations/sources/google_search_console/schemas/performance_report_custom.json +40 -0
  459. mage_integrations/sources/google_search_console/schemas/performance_report_date.json +28 -0
  460. mage_integrations/sources/google_search_console/schemas/performance_report_device.json +31 -0
  461. mage_integrations/sources/google_search_console/schemas/performance_report_page.json +31 -0
  462. mage_integrations/sources/google_search_console/schemas/performance_report_query.json +31 -0
  463. mage_integrations/sources/google_search_console/streams.py +118 -0
  464. mage_integrations/sources/google_search_console/templates/config.json +6 -0
  465. mage_integrations/sources/google_sheets/README.md +24 -0
  466. mage_integrations/sources/google_sheets/__init__.py +460 -0
  467. mage_integrations/sources/google_sheets/templates/config.json +5 -0
  468. mage_integrations/sources/google_sheets/transform.py +297 -0
  469. mage_integrations/sources/http/__init__.py +0 -0
  470. mage_integrations/sources/http/client.py +179 -0
  471. mage_integrations/sources/hubspot/README.md +48 -0
  472. mage_integrations/sources/hubspot/__init__.py +41 -0
  473. mage_integrations/sources/hubspot/bin/run-a-test.sh +5 -0
  474. mage_integrations/sources/hubspot/bin/run-all-tests.sh +1 -0
  475. mage_integrations/sources/hubspot/tap_hubspot/__init__.py +1548 -0
  476. mage_integrations/sources/hubspot/tap_hubspot/constants.py +13 -0
  477. mage_integrations/sources/hubspot/tap_hubspot/schemas/campaigns.json +91 -0
  478. mage_integrations/sources/hubspot/tap_hubspot/schemas/companies.json +11 -0
  479. mage_integrations/sources/hubspot/tap_hubspot/schemas/contact_lists.json +97 -0
  480. mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts.json +201 -0
  481. mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts_by_company.json +12 -0
  482. mage_integrations/sources/hubspot/tap_hubspot/schemas/deal_pipelines.json +46 -0
  483. mage_integrations/sources/hubspot/tap_hubspot/schemas/deals.json +37 -0
  484. mage_integrations/sources/hubspot/tap_hubspot/schemas/email_events.json +118 -0
  485. mage_integrations/sources/hubspot/tap_hubspot/schemas/engagements.json +179 -0
  486. mage_integrations/sources/hubspot/tap_hubspot/schemas/forms.json +229 -0
  487. mage_integrations/sources/hubspot/tap_hubspot/schemas/owners.json +72 -0
  488. mage_integrations/sources/hubspot/tap_hubspot/schemas/subscription_changes.json +54 -0
  489. mage_integrations/sources/hubspot/tap_hubspot/schemas/versions.json +30 -0
  490. mage_integrations/sources/hubspot/tap_hubspot/schemas/workflows.json +48 -0
  491. mage_integrations/sources/hubspot/tap_hubspot/tests/__init__.py +0 -0
  492. mage_integrations/sources/hubspot/tap_hubspot/tests/test_bookmarks.py +62 -0
  493. mage_integrations/sources/hubspot/tap_hubspot/tests/test_deals.py +32 -0
  494. mage_integrations/sources/hubspot/tap_hubspot/tests/test_get_streams_to_sync.py +44 -0
  495. mage_integrations/sources/hubspot/tap_hubspot/tests/test_offsets.py +57 -0
  496. mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_get_start.py +94 -0
  497. mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_request_timeout.py +121 -0
  498. mage_integrations/sources/hubspot/tap_hubspot/tests/utils.py +80 -0
  499. mage_integrations/sources/hubspot/templates/config.json +6 -0
  500. mage_integrations/sources/hubspot/tests/base.py +383 -0
  501. mage_integrations/sources/hubspot/tests/client.py +1583 -0
  502. mage_integrations/sources/hubspot/tests/client_tester.py +280 -0
  503. mage_integrations/sources/hubspot/tests/test_hubspot_all_fields.py +323 -0
  504. mage_integrations/sources/hubspot/tests/test_hubspot_automatic_fields.py +109 -0
  505. mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks.py +236 -0
  506. mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks_static.py +127 -0
  507. mage_integrations/sources/hubspot/tests/test_hubspot_child_stream_only.py +88 -0
  508. mage_integrations/sources/hubspot/tests/test_hubspot_discovery.py +131 -0
  509. mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync.py +137 -0
  510. mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync_offset.py +135 -0
  511. mage_integrations/sources/hubspot/tests/test_hubspot_pagination.py +140 -0
  512. mage_integrations/sources/hubspot/tests/test_hubspot_start_date.py +179 -0
  513. mage_integrations/sources/hubspot/tests/unittests/test_deals.py +101 -0
  514. mage_integrations/sources/intercom/README.md +19 -0
  515. mage_integrations/sources/intercom/__init__.py +54 -0
  516. mage_integrations/sources/intercom/client.py +246 -0
  517. mage_integrations/sources/intercom/schema.py +57 -0
  518. mage_integrations/sources/intercom/schemas/admins.json +65 -0
  519. mage_integrations/sources/intercom/schemas/companies.json +106 -0
  520. mage_integrations/sources/intercom/schemas/company_attributes.json +63 -0
  521. mage_integrations/sources/intercom/schemas/company_segments.json +26 -0
  522. mage_integrations/sources/intercom/schemas/contact_attributes.json +104 -0
  523. mage_integrations/sources/intercom/schemas/contacts.json +534 -0
  524. mage_integrations/sources/intercom/schemas/conversation_parts.json +180 -0
  525. mage_integrations/sources/intercom/schemas/conversations.json +797 -0
  526. mage_integrations/sources/intercom/schemas/segments.json +26 -0
  527. mage_integrations/sources/intercom/schemas/tags.json +15 -0
  528. mage_integrations/sources/intercom/schemas/teams.json +28 -0
  529. mage_integrations/sources/intercom/streams.py +739 -0
  530. mage_integrations/sources/intercom/templates/config.json +4 -0
  531. mage_integrations/sources/intercom/transform.py +134 -0
  532. mage_integrations/sources/knowi/README.md +20 -0
  533. mage_integrations/sources/knowi/__init__.py +68 -0
  534. mage_integrations/sources/knowi/client.py +249 -0
  535. mage_integrations/sources/knowi/schema.py +60 -0
  536. mage_integrations/sources/knowi/schemas/dashboards.json +150 -0
  537. mage_integrations/sources/knowi/schemas/widgets.json +688 -0
  538. mage_integrations/sources/knowi/streams.py +190 -0
  539. mage_integrations/sources/knowi/templates/config.json +6 -0
  540. mage_integrations/sources/linkedin_ads/README.md +34 -0
  541. mage_integrations/sources/linkedin_ads/__init__.py +66 -0
  542. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/__init__.py +65 -0
  543. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/client.py +335 -0
  544. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/discover.py +30 -0
  545. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schema.py +91 -0
  546. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/account_users.json +91 -0
  547. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/accounts.json +190 -0
  548. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_campaign.json +501 -0
  549. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_creative.json +501 -0
  550. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaign_groups.json +133 -0
  551. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaigns.json +469 -0
  552. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/creatives.json +182 -0
  553. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/video_ads.json +115 -0
  554. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/sync.py +868 -0
  555. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/transform.py +323 -0
  556. mage_integrations/sources/linkedin_ads/templates/config.json +9 -0
  557. mage_integrations/sources/linkedin_ads/tests/base.py +305 -0
  558. mage_integrations/sources/linkedin_ads/tests/test_all_fields.py +94 -0
  559. mage_integrations/sources/linkedin_ads/tests/test_discovery.py +95 -0
  560. mage_integrations/sources/linkedin_ads/tests/test_pagination.py +53 -0
  561. mage_integrations/sources/linkedin_ads/tests/test_start_date.py +130 -0
  562. mage_integrations/sources/linkedin_ads/tests/test_sync_canary.py +31 -0
  563. mage_integrations/sources/linkedin_ads/tests/test_sync_without_refrence_organization_id.py +31 -0
  564. mage_integrations/sources/linkedin_ads/tests/test_sync_without_refresh_token.py +131 -0
  565. mage_integrations/sources/linkedin_ads/tests/unittests/test_account_number.py +81 -0
  566. mage_integrations/sources/linkedin_ads/tests/unittests/test_adCampaignGroup_4XX.py +97 -0
  567. mage_integrations/sources/linkedin_ads/tests/unittests/test_client.py +94 -0
  568. mage_integrations/sources/linkedin_ads/tests/unittests/test_exception_handling.py +351 -0
  569. mage_integrations/sources/linkedin_ads/tests/unittests/test_fetch_access_token.py +36 -0
  570. mage_integrations/sources/linkedin_ads/tests/unittests/test_sync.py +197 -0
  571. mage_integrations/sources/linkedin_ads/tests/unittests/test_sync_endpoint.py +42 -0
  572. mage_integrations/sources/linkedin_ads/tests/unittests/test_timeout.py +279 -0
  573. mage_integrations/sources/messages.py +138 -0
  574. mage_integrations/sources/mode/README.md +21 -0
  575. mage_integrations/sources/mode/__init__.py +58 -0
  576. mage_integrations/sources/mode/client.py +251 -0
  577. mage_integrations/sources/mode/schema.py +57 -0
  578. mage_integrations/sources/mode/schemas/charts.json +116 -0
  579. mage_integrations/sources/mode/schemas/queries.json +41 -0
  580. mage_integrations/sources/mode/schemas/reports.json +128 -0
  581. mage_integrations/sources/mode/schemas/spaces.json +36 -0
  582. mage_integrations/sources/mode/streams.py +310 -0
  583. mage_integrations/sources/mode/templates/config.json +7 -0
  584. mage_integrations/sources/monday/README.md +24 -0
  585. mage_integrations/sources/monday/__init__.py +39 -0
  586. mage_integrations/sources/monday/client.py +35 -0
  587. mage_integrations/sources/monday/schemas/board_views.json +18 -0
  588. mage_integrations/sources/monday/schemas/boards.json +32 -0
  589. mage_integrations/sources/monday/schemas/columns.json +27 -0
  590. mage_integrations/sources/monday/schemas/groups.json +21 -0
  591. mage_integrations/sources/monday/schemas/workspaces.json +18 -0
  592. mage_integrations/sources/monday/streams.py +260 -0
  593. mage_integrations/sources/monday/templates/config.json +5 -0
  594. mage_integrations/sources/mongodb/README.md +33 -0
  595. mage_integrations/sources/mongodb/__init__.py +194 -0
  596. mage_integrations/sources/mongodb/schema.py +78 -0
  597. mage_integrations/sources/mongodb/spikes/atlas_setup.md +47 -0
  598. mage_integrations/sources/mongodb/spikes/dbreps_and_hackathon_review.md +46 -0
  599. mage_integrations/sources/mongodb/spikes/local_mongo_setup.md +92 -0
  600. mage_integrations/sources/mongodb/spikes/pymongo_spike.py +115 -0
  601. mage_integrations/sources/mongodb/spikes/supported_versions_spike.md +58 -0
  602. mage_integrations/sources/mongodb/tap_mongodb/__init__.py +465 -0
  603. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/common.py +354 -0
  604. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/full_table.py +162 -0
  605. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/incremental.py +125 -0
  606. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/oplog.py +271 -0
  607. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/utils.py +39 -0
  608. mage_integrations/sources/mongodb/templates/config.json +7 -0
  609. mage_integrations/sources/mongodb/tests/__init__.py +0 -0
  610. mage_integrations/sources/mongodb/tests/mongodb_common.py +37 -0
  611. mage_integrations/sources/mongodb/tests/test_mongodb_cname_restrictions.py +252 -0
  612. mage_integrations/sources/mongodb/tests/test_mongodb_configurable_properties.py +195 -0
  613. mage_integrations/sources/mongodb/tests/test_mongodb_datatype.py +246 -0
  614. mage_integrations/sources/mongodb/tests/test_mongodb_discovery.py +272 -0
  615. mage_integrations/sources/mongodb/tests/test_mongodb_fname_restrictions.py +302 -0
  616. mage_integrations/sources/mongodb/tests/test_mongodb_full_table.py +288 -0
  617. mage_integrations/sources/mongodb/tests/test_mongodb_full_table_id.py +227 -0
  618. mage_integrations/sources/mongodb/tests/test_mongodb_full_table_interruptible.py +232 -0
  619. mage_integrations/sources/mongodb/tests/test_mongodb_id_pk_variations.py +273 -0
  620. mage_integrations/sources/mongodb/tests/test_mongodb_incremental.py +480 -0
  621. mage_integrations/sources/mongodb/tests/test_mongodb_incremental_open_transactions.py +312 -0
  622. mage_integrations/sources/mongodb/tests/test_mongodb_index.py +162 -0
  623. mage_integrations/sources/mongodb/tests/test_mongodb_log_based_interruptible.py +328 -0
  624. mage_integrations/sources/mongodb/tests/test_mongodb_namespace_restrictions.py +258 -0
  625. mage_integrations/sources/mongodb/tests/test_mongodb_oplog.py +260 -0
  626. mage_integrations/sources/mongodb/tests/test_mongodb_oplog_aged_out.py +181 -0
  627. mage_integrations/sources/mongodb/tests/test_mongodb_oplog_bookmarks.py +245 -0
  628. mage_integrations/sources/mongodb/tests/test_mongodb_projection.py +271 -0
  629. mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_inc.py +300 -0
  630. mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_log.py +209 -0
  631. mage_integrations/sources/mongodb/tests/test_mongodb_views.py +159 -0
  632. mage_integrations/sources/mongodb/tests/unittests/test_common.py +436 -0
  633. mage_integrations/sources/mssql/README.md +28 -0
  634. mage_integrations/sources/mssql/__init__.py +88 -0
  635. mage_integrations/sources/mssql/templates/config.json +9 -0
  636. mage_integrations/sources/mysql/README.md +32 -0
  637. mage_integrations/sources/mysql/__init__.py +70 -0
  638. mage_integrations/sources/mysql/templates/config.json +13 -0
  639. mage_integrations/sources/oracledb/README.md +22 -0
  640. mage_integrations/sources/oracledb/__init__.py +152 -0
  641. mage_integrations/sources/oracledb/templates/config.json +8 -0
  642. mage_integrations/sources/outreach/README.md +68 -0
  643. mage_integrations/sources/outreach/__init__.py +47 -0
  644. mage_integrations/sources/outreach/tap_outreach/__init__.py +50 -0
  645. mage_integrations/sources/outreach/tap_outreach/client.py +131 -0
  646. mage_integrations/sources/outreach/tap_outreach/discover.py +87 -0
  647. mage_integrations/sources/outreach/tap_outreach/schemas/accounts.json +356 -0
  648. mage_integrations/sources/outreach/tap_outreach/schemas/call_dispositions.json +49 -0
  649. mage_integrations/sources/outreach/tap_outreach/schemas/call_purposes.json +43 -0
  650. mage_integrations/sources/outreach/tap_outreach/schemas/calls.json +179 -0
  651. mage_integrations/sources/outreach/tap_outreach/schemas/content_categories.json +55 -0
  652. mage_integrations/sources/outreach/tap_outreach/schemas/duties.json +23 -0
  653. mage_integrations/sources/outreach/tap_outreach/schemas/events.json +97 -0
  654. mage_integrations/sources/outreach/tap_outreach/schemas/mailboxes.json +306 -0
  655. mage_integrations/sources/outreach/tap_outreach/schemas/mailings.json +283 -0
  656. mage_integrations/sources/outreach/tap_outreach/schemas/opportunities.json +724 -0
  657. mage_integrations/sources/outreach/tap_outreach/schemas/personas.json +37 -0
  658. mage_integrations/sources/outreach/tap_outreach/schemas/prospects.json +906 -0
  659. mage_integrations/sources/outreach/tap_outreach/schemas/sequence_states.json +161 -0
  660. mage_integrations/sources/outreach/tap_outreach/schemas/sequence_steps.json +152 -0
  661. mage_integrations/sources/outreach/tap_outreach/schemas/sequence_templates.json +122 -0
  662. mage_integrations/sources/outreach/tap_outreach/schemas/sequences.json +275 -0
  663. mage_integrations/sources/outreach/tap_outreach/schemas/stages.json +55 -0
  664. mage_integrations/sources/outreach/tap_outreach/schemas/tasks.json +186 -0
  665. mage_integrations/sources/outreach/tap_outreach/schemas/teams.json +30 -0
  666. mage_integrations/sources/outreach/tap_outreach/schemas/users.json +361 -0
  667. mage_integrations/sources/outreach/tap_outreach/sync.py +378 -0
  668. mage_integrations/sources/outreach/templates/config.json +7 -0
  669. mage_integrations/sources/paystack/README.md +15 -0
  670. mage_integrations/sources/paystack/__init__.py +44 -0
  671. mage_integrations/sources/paystack/client.py +14 -0
  672. mage_integrations/sources/paystack/schemas/customers.json +45 -0
  673. mage_integrations/sources/paystack/schemas/transactions.json +170 -0
  674. mage_integrations/sources/paystack/streams/__init__.py +8 -0
  675. mage_integrations/sources/paystack/streams/base.py +122 -0
  676. mage_integrations/sources/paystack/streams/customers.py +18 -0
  677. mage_integrations/sources/paystack/streams/transactions.py +18 -0
  678. mage_integrations/sources/paystack/templates/config.json +5 -0
  679. mage_integrations/sources/pipedrive/README.md +14 -0
  680. mage_integrations/sources/pipedrive/__init__.py +38 -0
  681. mage_integrations/sources/pipedrive/tap_pipedrive/__init__.py +1 -0
  682. mage_integrations/sources/pipedrive/tap_pipedrive/cli.py +32 -0
  683. mage_integrations/sources/pipedrive/tap_pipedrive/config.py +5 -0
  684. mage_integrations/sources/pipedrive/tap_pipedrive/exceptions.py +46 -0
  685. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/activity_types.json +37 -0
  686. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/currency.json +26 -0
  687. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/deal_products.json +125 -0
  688. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/dealflow.json +45 -0
  689. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/filters.json +37 -0
  690. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/pipelines.json +31 -0
  691. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/activities.json +112 -0
  692. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/deals.json +197 -0
  693. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/notes.json +90 -0
  694. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/organizations.json +156 -0
  695. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/persons.json +174 -0
  696. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/products.json +81 -0
  697. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/files.json +97 -0
  698. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/users.json +75 -0
  699. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/stages.json +40 -0
  700. mage_integrations/sources/pipedrive/tap_pipedrive/stream.py +195 -0
  701. mage_integrations/sources/pipedrive/tap_pipedrive/streams/__init__.py +22 -0
  702. mage_integrations/sources/pipedrive/tap_pipedrive/streams/activity_types.py +9 -0
  703. mage_integrations/sources/pipedrive/tap_pipedrive/streams/currencies.py +7 -0
  704. mage_integrations/sources/pipedrive/tap_pipedrive/streams/deal_products.py +17 -0
  705. mage_integrations/sources/pipedrive/tap_pipedrive/streams/dealflow.py +24 -0
  706. mage_integrations/sources/pipedrive/tap_pipedrive/streams/filters.py +9 -0
  707. mage_integrations/sources/pipedrive/tap_pipedrive/streams/notes.py +8 -0
  708. mage_integrations/sources/pipedrive/tap_pipedrive/streams/pipelines.py +9 -0
  709. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/__init__.py +36 -0
  710. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/__init__.py +86 -0
  711. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/activities.py +16 -0
  712. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/deals.py +22 -0
  713. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/notes.py +14 -0
  714. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/organizations.py +22 -0
  715. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/persons.py +21 -0
  716. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/products.py +13 -0
  717. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/files.py +10 -0
  718. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/users.py +21 -0
  719. mage_integrations/sources/pipedrive/tap_pipedrive/streams/stages.py +9 -0
  720. mage_integrations/sources/pipedrive/tap_pipedrive/tap.py +426 -0
  721. mage_integrations/sources/pipedrive/templates/config.json +4 -0
  722. mage_integrations/sources/postgresql/README.md +34 -0
  723. mage_integrations/sources/postgresql/__init__.py +499 -0
  724. mage_integrations/sources/postgresql/decoders.py +396 -0
  725. mage_integrations/sources/postgresql/templates/config.json +10 -0
  726. mage_integrations/sources/postmark/README.md +20 -0
  727. mage_integrations/sources/postmark/__init__.py +43 -0
  728. mage_integrations/sources/postmark/tap_postmark/__init__.py +4 -0
  729. mage_integrations/sources/postmark/tap_postmark/cleaners.py +331 -0
  730. mage_integrations/sources/postmark/tap_postmark/discover.py +55 -0
  731. mage_integrations/sources/postmark/tap_postmark/postmark.py +552 -0
  732. mage_integrations/sources/postmark/tap_postmark/schema.py +40 -0
  733. mage_integrations/sources/postmark/tap_postmark/schemas/messages_opens.json +134 -0
  734. mage_integrations/sources/postmark/tap_postmark/schemas/messages_outbound.json +93 -0
  735. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_bounces.json +81 -0
  736. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_clients.json +19 -0
  737. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_overview.json +88 -0
  738. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_platform.json +46 -0
  739. mage_integrations/sources/postmark/tap_postmark/streams.py +535 -0
  740. mage_integrations/sources/postmark/tap_postmark/sync.py +124 -0
  741. mage_integrations/sources/postmark/tap_postmark/tap.py +51 -0
  742. mage_integrations/sources/postmark/tap_postmark/tools.py +87 -0
  743. mage_integrations/sources/postmark/templates/config.json +4 -0
  744. mage_integrations/sources/powerbi/README.md +20 -0
  745. mage_integrations/sources/powerbi/__init__.py +68 -0
  746. mage_integrations/sources/powerbi/client.py +249 -0
  747. mage_integrations/sources/powerbi/schema.py +60 -0
  748. mage_integrations/sources/powerbi/schemas/apps.json +22 -0
  749. mage_integrations/sources/powerbi/schemas/dashboards.json +36 -0
  750. mage_integrations/sources/powerbi/schemas/datasets.json +31 -0
  751. mage_integrations/sources/powerbi/schemas/groups.json +34 -0
  752. mage_integrations/sources/powerbi/schemas/reports.json +25 -0
  753. mage_integrations/sources/powerbi/schemas/tiles.json +31 -0
  754. mage_integrations/sources/powerbi/streams.py +365 -0
  755. mage_integrations/sources/powerbi/templates/config.json +6 -0
  756. mage_integrations/sources/query.py +23 -0
  757. mage_integrations/sources/redshift/README.md +36 -0
  758. mage_integrations/sources/redshift/__init__.py +143 -0
  759. mage_integrations/sources/redshift/constants.py +57 -0
  760. mage_integrations/sources/redshift/templates/config.json +9 -0
  761. mage_integrations/sources/redshift/utils.py +26 -0
  762. mage_integrations/sources/salesforce/README.md +149 -0
  763. mage_integrations/sources/salesforce/__init__.py +77 -0
  764. mage_integrations/sources/salesforce/client/LICENSE +620 -0
  765. mage_integrations/sources/salesforce/client/__init__.py +0 -0
  766. mage_integrations/sources/salesforce/client/tap_salesforce/__init__.py +616 -0
  767. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/__init__.py +400 -0
  768. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/bulk.py +353 -0
  769. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/credentials.py +112 -0
  770. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/exceptions.py +8 -0
  771. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/rest.py +109 -0
  772. mage_integrations/sources/salesforce/client/tap_salesforce/sync.py +221 -0
  773. mage_integrations/sources/salesforce/templates/config.json +10 -0
  774. mage_integrations/sources/sftp/LICENSE +620 -0
  775. mage_integrations/sources/sftp/README.md +47 -0
  776. mage_integrations/sources/sftp/__init__.py +39 -0
  777. mage_integrations/sources/sftp/tap_sftp/__init__.py +0 -0
  778. mage_integrations/sources/sftp/tap_sftp/aws_ssm.py +24 -0
  779. mage_integrations/sources/sftp/tap_sftp/client.py +217 -0
  780. mage_integrations/sources/sftp/tap_sftp/decrypt.py +24 -0
  781. mage_integrations/sources/sftp/tap_sftp/discover.py +32 -0
  782. mage_integrations/sources/sftp/tap_sftp/singer_encodings/__init__.py +0 -0
  783. mage_integrations/sources/sftp/tap_sftp/singer_encodings/compression.py +20 -0
  784. mage_integrations/sources/sftp/tap_sftp/singer_encodings/csv_handler.py +58 -0
  785. mage_integrations/sources/sftp/tap_sftp/singer_encodings/json_schema.py +204 -0
  786. mage_integrations/sources/sftp/tap_sftp/stats.py +44 -0
  787. mage_integrations/sources/sftp/tap_sftp/sync.py +122 -0
  788. mage_integrations/sources/sftp/tap_sftp/tap.py +97 -0
  789. mage_integrations/sources/sftp/templates/config.json +22 -0
  790. mage_integrations/sources/snowflake/README.md +36 -0
  791. mage_integrations/sources/snowflake/__init__.py +63 -0
  792. mage_integrations/sources/snowflake/constants.py +0 -0
  793. mage_integrations/sources/snowflake/templates/config.json +11 -0
  794. mage_integrations/sources/sql/__init__.py +0 -0
  795. mage_integrations/sources/sql/base.py +464 -0
  796. mage_integrations/sources/sql/constants.py +10 -0
  797. mage_integrations/sources/sql/utils.py +77 -0
  798. mage_integrations/sources/stripe/README.md +43 -0
  799. mage_integrations/sources/stripe/__init__.py +1297 -0
  800. mage_integrations/sources/stripe/schemas/balance_transactions.json +145 -0
  801. mage_integrations/sources/stripe/schemas/charges.json +1 -0
  802. mage_integrations/sources/stripe/schemas/coupons.json +120 -0
  803. mage_integrations/sources/stripe/schemas/customers.json +501 -0
  804. mage_integrations/sources/stripe/schemas/disputes.json +210 -0
  805. mage_integrations/sources/stripe/schemas/events.json +68 -0
  806. mage_integrations/sources/stripe/schemas/invoice_items.json +251 -0
  807. mage_integrations/sources/stripe/schemas/invoice_line_items.json +504 -0
  808. mage_integrations/sources/stripe/schemas/invoices.json +966 -0
  809. mage_integrations/sources/stripe/schemas/payment_intents.json +1101 -0
  810. mage_integrations/sources/stripe/schemas/payout_transactions.json +20 -0
  811. mage_integrations/sources/stripe/schemas/payouts.json +280 -0
  812. mage_integrations/sources/stripe/schemas/plans.json +1 -0
  813. mage_integrations/sources/stripe/schemas/products.json +181 -0
  814. mage_integrations/sources/stripe/schemas/shared/charge.json +1896 -0
  815. mage_integrations/sources/stripe/schemas/shared/discount.json +177 -0
  816. mage_integrations/sources/stripe/schemas/shared/plan.json +190 -0
  817. mage_integrations/sources/stripe/schemas/shared/source.json +573 -0
  818. mage_integrations/sources/stripe/schemas/shared/tax_ids.json +84 -0
  819. mage_integrations/sources/stripe/schemas/subscription_items.json +456 -0
  820. mage_integrations/sources/stripe/schemas/subscriptions.json +494 -0
  821. mage_integrations/sources/stripe/schemas/transfers.json +170 -0
  822. mage_integrations/sources/stripe/templates/config.json +5 -0
  823. mage_integrations/sources/tableau/README.md +22 -0
  824. mage_integrations/sources/tableau/__init__.py +71 -0
  825. mage_integrations/sources/tableau/client.py +251 -0
  826. mage_integrations/sources/tableau/schema.py +60 -0
  827. mage_integrations/sources/tableau/schemas/views.json +50 -0
  828. mage_integrations/sources/tableau/schemas/workbooks.json +250 -0
  829. mage_integrations/sources/tableau/streams.py +193 -0
  830. mage_integrations/sources/tableau/templates/config.json +7 -0
  831. mage_integrations/sources/teradata/README.md +24 -0
  832. mage_integrations/sources/teradata/__init__.py +255 -0
  833. mage_integrations/sources/teradata/templates/config.json +7 -0
  834. mage_integrations/sources/titanic/README.md +0 -0
  835. mage_integrations/sources/titanic/__init__.py +34 -0
  836. mage_integrations/sources/titanic/schemas/passengers.json +81 -0
  837. mage_integrations/sources/titanic/templates/config.json +4 -0
  838. mage_integrations/sources/twitter_ads/README.md +29 -0
  839. mage_integrations/sources/twitter_ads/__init__.py +56 -0
  840. mage_integrations/sources/twitter_ads/tap_twitter_ads/__init__.py +132 -0
  841. mage_integrations/sources/twitter_ads/tap_twitter_ads/client.py +108 -0
  842. mage_integrations/sources/twitter_ads/tap_twitter_ads/discover.py +31 -0
  843. mage_integrations/sources/twitter_ads/tap_twitter_ads/schema.py +223 -0
  844. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/account_media.json +74 -0
  845. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/accounts.json +45 -0
  846. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/advertiser_business_categories.json +25 -0
  847. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/campaigns.json +69 -0
  848. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards.json +37 -0
  849. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_image_conversation.json +56 -0
  850. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_poll.json +73 -0
  851. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_video_conversation.json +62 -0
  852. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/content_categories.json +25 -0
  853. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/funding_instruments.json +71 -0
  854. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/iab_categories.json +15 -0
  855. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_item_apps.json +32 -0
  856. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_items.json +127 -0
  857. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/media_creatives.json +38 -0
  858. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/preroll_call_to_actions.json +32 -0
  859. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promotable_users.json +26 -0
  860. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_accounts.json +35 -0
  861. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_tweets.json +35 -0
  862. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/scheduled_promoted_tweets.json +32 -0
  863. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/billing.json +12 -0
  864. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/dimensions.json +87 -0
  865. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_all.json +39 -0
  866. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_basic.json +24 -0
  867. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/media.json +12 -0
  868. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion.json +60 -0
  869. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion_obj.json +21 -0
  870. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_account.json +23 -0
  871. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_funding_instrument.json +26 -0
  872. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_mobile_conversion.json +23 -0
  873. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_organic_tweet.json +26 -0
  874. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_other.json +38 -0
  875. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_web_conversion.json +23 -0
  876. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/video.json +36 -0
  877. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion.json +21 -0
  878. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion_obj.json +36 -0
  879. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tailored_audiences.json +70 -0
  880. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_app_store_categories.json +18 -0
  881. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_conversations.json +18 -0
  882. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_criteria.json +44 -0
  883. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_devices.json +21 -0
  884. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_events.json +123 -0
  885. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_interests.json +15 -0
  886. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_languages.json +15 -0
  887. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_locations.json +21 -0
  888. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_network_operators.json +18 -0
  889. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platform_versions.json +21 -0
  890. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platforms.json +15 -0
  891. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_markets.json +15 -0
  892. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_shows.json +37 -0
  893. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tracking_tags.json +30 -0
  894. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tweets.json +920 -0
  895. mage_integrations/sources/twitter_ads/tap_twitter_ads/streams.py +1875 -0
  896. mage_integrations/sources/twitter_ads/tap_twitter_ads/sync.py +176 -0
  897. mage_integrations/sources/twitter_ads/tap_twitter_ads/transform.py +165 -0
  898. mage_integrations/sources/twitter_ads/templates/config.json +27 -0
  899. mage_integrations/sources/utils.py +318 -0
  900. mage_integrations/sources/zendesk/README.md +64 -0
  901. mage_integrations/sources/zendesk/__init__.py +45 -0
  902. mage_integrations/sources/zendesk/spikes/ticket_events.py +138 -0
  903. mage_integrations/sources/zendesk/tap_zendesk/__init__.py +253 -0
  904. mage_integrations/sources/zendesk/tap_zendesk/discover.py +80 -0
  905. mage_integrations/sources/zendesk/tap_zendesk/http.py +253 -0
  906. mage_integrations/sources/zendesk/tap_zendesk/metrics.py +102 -0
  907. mage_integrations/sources/zendesk/tap_zendesk/schemas/group_memberships.json +52 -0
  908. mage_integrations/sources/zendesk/tap_zendesk/schemas/groups.json +46 -0
  909. mage_integrations/sources/zendesk/tap_zendesk/schemas/macros.json +116 -0
  910. mage_integrations/sources/zendesk/tap_zendesk/schemas/organizations.json +114 -0
  911. mage_integrations/sources/zendesk/tap_zendesk/schemas/satisfaction_ratings.json +49 -0
  912. mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/attachments.json +148 -0
  913. mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/metadata.json +145 -0
  914. mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/via.json +122 -0
  915. mage_integrations/sources/zendesk/tap_zendesk/schemas/sla_policies.json +128 -0
  916. mage_integrations/sources/zendesk/tap_zendesk/schemas/tags.json +20 -0
  917. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_audits.json +789 -0
  918. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_comments.json +72 -0
  919. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_fields.json +199 -0
  920. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_forms.json +113 -0
  921. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_metrics.json +277 -0
  922. mage_integrations/sources/zendesk/tap_zendesk/schemas/tickets.json +393 -0
  923. mage_integrations/sources/zendesk/tap_zendesk/schemas/users.json +382 -0
  924. mage_integrations/sources/zendesk/tap_zendesk/streams.py +657 -0
  925. mage_integrations/sources/zendesk/tap_zendesk/sync.py +61 -0
  926. mage_integrations/sources/zendesk/templates/config.json +6 -0
  927. mage_integrations/sources/zendesk/test/__init__.py +0 -0
  928. mage_integrations/sources/zendesk/test/base.py +400 -0
  929. mage_integrations/sources/zendesk/test/test_all_fields.py +83 -0
  930. mage_integrations/sources/zendesk/test/test_all_streams.py +150 -0
  931. mage_integrations/sources/zendesk/test/test_automatic_fields.py +71 -0
  932. mage_integrations/sources/zendesk/test/test_bookmarks.py +160 -0
  933. mage_integrations/sources/zendesk/test/test_custom_fields_discover.py +43 -0
  934. mage_integrations/sources/zendesk/test/test_discovery.py +129 -0
  935. mage_integrations/sources/zendesk/test/test_minimal_selection.py +67 -0
  936. mage_integrations/sources/zendesk/test/test_pagination.py +74 -0
  937. mage_integrations/sources/zendesk/test/test_standard_bookmark.py +197 -0
  938. mage_integrations/sources/zendesk/test/test_start_date.py +165 -0
  939. mage_integrations/sources/zendesk/test/unittests/test_discovery_mode.py +308 -0
  940. mage_integrations/sources/zendesk/test/unittests/test_exception.py +55 -0
  941. mage_integrations/sources/zendesk/test/unittests/test_http.py +481 -0
  942. mage_integrations/sources/zendesk/test/unittests/test_init.py +23 -0
  943. mage_integrations/sources/zendesk/test/unittests/test_request_timeout.py +628 -0
  944. mage_integrations/sources/zendesk/test/unittests/test_tickets_child_stream_skip_404_error.py +82 -0
  945. mage_integrations/sources/zendesk/test/unittests/test_yield_records.py +193 -0
  946. mage_integrations/tests/__init__.py +0 -0
  947. mage_integrations/tests/connections/__init__.py +0 -0
  948. mage_integrations/tests/destinations/__init__.py +0 -0
  949. mage_integrations/tests/destinations/amplitude/__init__.py +0 -0
  950. mage_integrations/tests/destinations/amplitude/test_amplitude.py +117 -0
  951. mage_integrations/tests/destinations/bigquery/__init__.py +0 -0
  952. mage_integrations/tests/destinations/bigquery/test_bigquery.py +54 -0
  953. mage_integrations/tests/destinations/doris/__init__.py +0 -0
  954. mage_integrations/tests/destinations/doris/test_doris.py +64 -0
  955. mage_integrations/tests/destinations/mongodb/__init__.py +0 -0
  956. mage_integrations/tests/destinations/mongodb/test_mongodb.py +67 -0
  957. mage_integrations/tests/destinations/mssql/__init__.py +0 -0
  958. mage_integrations/tests/destinations/mssql/test_mssql.py +64 -0
  959. mage_integrations/tests/destinations/mysql/__init__.py +0 -0
  960. mage_integrations/tests/destinations/mysql/test_mysql.py +116 -0
  961. mage_integrations/tests/destinations/oracledb/__init__.py +0 -0
  962. mage_integrations/tests/destinations/oracledb/test_oracledb.py +63 -0
  963. mage_integrations/tests/destinations/postgresql/__init__.py +0 -0
  964. mage_integrations/tests/destinations/postgresql/test_postgres.py +60 -0
  965. mage_integrations/tests/destinations/redshift/__init__.py +0 -0
  966. mage_integrations/tests/destinations/redshift/test_redshift.py +68 -0
  967. mage_integrations/tests/destinations/search/__init__.py +0 -0
  968. mage_integrations/tests/destinations/search/test_sinks.py +71 -0
  969. mage_integrations/tests/destinations/snowflake/__init__.py +0 -0
  970. mage_integrations/tests/destinations/snowflake/test_snowflake.py +113 -0
  971. mage_integrations/tests/destinations/sql/__init__.py +0 -0
  972. mage_integrations/tests/destinations/sql/mixins.py +48 -0
  973. mage_integrations/tests/destinations/sql/test_truncate.py +94 -0
  974. mage_integrations/tests/destinations/test_base.py +557 -0
  975. mage_integrations/tests/sources/__init__.py +0 -0
  976. mage_integrations/tests/sources/amplitude/__init__.py +0 -0
  977. mage_integrations/tests/sources/amplitude/test_amplitude.py +232 -0
  978. mage_integrations/tests/sources/api/__init__.py +0 -0
  979. mage_integrations/tests/sources/api/test_api.py +377 -0
  980. mage_integrations/tests/sources/bigquery/__init__.py +0 -0
  981. mage_integrations/tests/sources/bigquery/test_bigquery.py +232 -0
  982. mage_integrations/tests/sources/couchbase/__init__.py +0 -0
  983. mage_integrations/tests/sources/couchbase/test_couchbase.py +379 -0
  984. mage_integrations/tests/sources/doris/__init__.py +0 -0
  985. mage_integrations/tests/sources/doris/test_doris.py +118 -0
  986. mage_integrations/tests/sources/mongodb/__init__.py +0 -0
  987. mage_integrations/tests/sources/mongodb/test_common.py +73 -0
  988. mage_integrations/tests/sources/mongodb/test_schema.py +91 -0
  989. mage_integrations/tests/sources/mysql/__init__.py +0 -0
  990. mage_integrations/tests/sources/mysql/test_mysql.py +114 -0
  991. mage_integrations/tests/sources/postgresql/__init__.py +0 -0
  992. mage_integrations/tests/sources/postgresql/test_postgresql.py +46 -0
  993. mage_integrations/tests/sources/sql/__init__.py +0 -0
  994. mage_integrations/tests/sources/sql/test_base.py +215 -0
  995. mage_integrations/tests/sources/test_base.py +404 -0
  996. mage_integrations/tests/test_dependency_contracts.py +28 -0
  997. mage_integrations/tests/utils/__init__.py +0 -0
  998. mage_integrations/tests/utils/test_frames.py +122 -0
  999. mage_integrations/transformers/__init__.py +0 -0
  1000. mage_integrations/transformers/base.py +183 -0
  1001. mage_integrations/transformers/utils.py +39 -0
  1002. mage_integrations/utils/__init__.py +0 -0
  1003. mage_integrations/utils/array.py +40 -0
  1004. mage_integrations/utils/dates.py +45 -0
  1005. mage_integrations/utils/dictionary.py +108 -0
  1006. mage_integrations/utils/files.py +5 -0
  1007. mage_integrations/utils/frames.py +123 -0
  1008. mage_integrations/utils/logger/__init__.py +103 -0
  1009. mage_integrations/utils/logger/constants.py +11 -0
  1010. mage_integrations/utils/parsers.py +56 -0
  1011. mage_integrations/utils/schema_helpers.py +37 -0
  1012. mage_integrations/utils/strings.py +6 -0
  1013. mage_integrations-0.2.1.dist-info/METADATA +304 -0
  1014. mage_integrations-0.2.1.dist-info/RECORD +1016 -0
  1015. mage_integrations-0.2.1.dist-info/WHEEL +5 -0
  1016. mage_integrations-0.2.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,356 @@
1
+ """
2
+ The Amplitude source of data integration pipelines.
3
+
4
+ Streams:
5
+ - events: every event, from the Export API, by the hour Amplitude received it
6
+ (server_upload_time). Each sync continues from the last hour it exported up to the
7
+ newest hour Amplitude has finished (about two hours ago), and saves its position after
8
+ each window, so a failed sync goes on from there. Events are keyed by uuid, which
9
+ destinations use to drop the repeats Amplitude can send.
10
+ - active_users, new_users, average_session_length, sessions_per_user: daily metrics of
11
+ the Dashboard REST API; the last days are read again, as late events change them.
12
+ - event_types, event_properties, user_properties: the tracking plan (Taxonomy API).
13
+ - annotations, cohorts: chart annotations and the behavioral cohorts.
14
+ - cohort_members: the users of the cohorts listed in cohort_ids.
15
+
16
+ The window of a scheduled run (_start_date and _end_date) is not used: the last hours of
17
+ a day were exported before Amplitude had them, and never read again. backfill_start_date
18
+ and backfill_end_date in the settings read a range again without moving the saved position
19
+ back.
20
+ """
21
+ import datetime as dt
22
+ from typing import Dict, Generator, List
23
+
24
+ import singer
25
+
26
+ from mage_ai.io.amplitude import (
27
+ AVAILABILITY_DELAY_HOURS,
28
+ WINDOW_HOURS,
29
+ )
30
+ from mage_ai.io.amplitude import Amplitude as AmplitudeClient
31
+ from mage_ai.io.amplitude import (
32
+ AmplitudeError,
33
+ floor_hour,
34
+ last_complete_hour,
35
+ to_utc,
36
+ utc_now,
37
+ )
38
+ from mage_integrations.sources.amplitude.constants import (
39
+ DEFAULT_METRICS_LOOKBACK_DAYS,
40
+ DEFAULT_START_DAYS,
41
+ METRIC_STREAMS,
42
+ REPLICATION_KEYS,
43
+ REPLICATION_METHODS,
44
+ SAMPLE_ROWS,
45
+ STREAM_ACTIVE_USERS,
46
+ STREAM_ANNOTATIONS,
47
+ STREAM_AVERAGE_SESSION_LENGTH,
48
+ STREAM_COHORT_MEMBERS,
49
+ STREAM_COHORTS,
50
+ STREAM_EVENT_PROPERTIES,
51
+ STREAM_EVENT_TYPES,
52
+ STREAM_EVENTS,
53
+ STREAM_NEW_USERS,
54
+ STREAM_SESSIONS_PER_USER,
55
+ STREAM_USER_PROPERTIES,
56
+ TABLE_KEY_PROPERTIES,
57
+ )
58
+ from mage_integrations.sources.base import Source, main
59
+ from mage_integrations.sources.messages import write_state
60
+
61
+ LOGGER = singer.get_logger()
62
+ # Ranges the editor's sample reads, newest first, until one has events.
63
+ SAMPLE_LOOKBACK_HOURS = (1, 6, 24, 168)
64
+ EU_HOSTS = ('analytics.eu.amplitude.com',)
65
+ STANDARD_HOSTS = ('https://amplitude.com', 'https://analytics.eu.amplitude.com')
66
+ TIME_FIELDS = (
67
+ 'client_event_time', 'client_upload_time', 'event_time', 'processed_time',
68
+ 'server_received_time', 'server_upload_time', 'user_creation_time',
69
+ )
70
+
71
+
72
+ def iso_time(value):
73
+ """Amplitude's 'YYYY-MM-DD HH:MM:SS.ffffff' (UTC) as ISO 8601 with its offset."""
74
+ if not isinstance(value, str) or not value:
75
+ return value
76
+ try:
77
+ return to_utc(value).isoformat()
78
+ except (ValueError, OverflowError):
79
+ return value
80
+
81
+
82
+ def event_record(event: Dict) -> Dict:
83
+ record = dict(event)
84
+ for field in TIME_FIELDS:
85
+ if field in record:
86
+ record[field] = iso_time(record[field])
87
+ return record
88
+
89
+
90
+ def next_hour(bookmark: str) -> dt.datetime:
91
+ """
92
+ The first hour to export after a saved position. A window's position is its last
93
+ microsecond, so the next hour follows; a position inside an hour (a sync stopped in
94
+ the middle of it) reads that hour again.
95
+ """
96
+ return floor_hour(to_utc(bookmark) + dt.timedelta(microseconds=1))
97
+
98
+
99
+ def window_bookmark(last_hour: dt.datetime) -> str:
100
+ return (last_hour + dt.timedelta(hours=1) - dt.timedelta(microseconds=1)).isoformat()
101
+
102
+
103
+ class Amplitude(Source):
104
+ def __init__(self, **kwargs):
105
+ super().__init__(**kwargs)
106
+ self._client = None
107
+
108
+ @property
109
+ def client(self) -> AmplitudeClient:
110
+ if self._client is None:
111
+ config = self.config or {}
112
+ host = (config.get('host') or '').strip() or None
113
+ region = (config.get('region') or '').strip().upper() or None
114
+ if region is None:
115
+ region = 'EU' if host and any(h in host for h in EU_HOSTS) else 'US'
116
+ if host and host.rstrip('/') in STANDARD_HOSTS:
117
+ host = None
118
+ self._client = AmplitudeClient(
119
+ api_key=config.get('api_key'),
120
+ secret_key=config.get('secret_key'),
121
+ region=region,
122
+ host=host,
123
+ verbose=False,
124
+ log=self.logger.info,
125
+ )
126
+ return self._client
127
+
128
+ def setting(self, key: str, default=None):
129
+ value = (self.config or {}).get(key)
130
+ return default if value in (None, '') else value
131
+
132
+ # ---- Catalog ------------------------------------------------------------------------
133
+
134
+ def get_forced_replication_method(self, stream_id: str) -> str:
135
+ return REPLICATION_METHODS[stream_id]
136
+
137
+ def get_table_key_properties(self, stream_id: str) -> List[str]:
138
+ return TABLE_KEY_PROPERTIES[stream_id]
139
+
140
+ def get_valid_replication_keys(self, stream_id: str) -> List[str]:
141
+ key = REPLICATION_KEYS.get(stream_id)
142
+ return [key] if key else []
143
+
144
+ def build_catalog_entry(self, stream_id: str, schema, **kwargs):
145
+ """
146
+ Streams come with their keys and replication key, and destinations upsert by the
147
+ keys: Amplitude can send an event again, and metrics of recent days are read
148
+ again, so rows are replaced instead of repeated.
149
+ """
150
+ keys = TABLE_KEY_PROPERTIES[stream_id]
151
+ replication_key = REPLICATION_KEYS.get(stream_id)
152
+ kwargs.setdefault('key_properties', keys)
153
+ kwargs.setdefault('unique_constraints', keys)
154
+ kwargs.setdefault('unique_conflict_method', 'UPDATE')
155
+ if replication_key:
156
+ kwargs.setdefault('replication_key', replication_key)
157
+ kwargs.setdefault('bookmark_properties', [replication_key])
158
+ return super().build_catalog_entry(stream_id, schema, **kwargs)
159
+
160
+ def test_connection(self) -> None:
161
+ # The editor waits 10 seconds for the answer: one try, so an unreachable host is
162
+ # reported as that instead of the editor's timeout.
163
+ client = self.client
164
+ client.timeout, client.max_retries = 6, 0
165
+ client.test_connection()
166
+
167
+ # ---- Sync ---------------------------------------------------------------------------
168
+
169
+ def start_date(self) -> dt.datetime:
170
+ configured = to_utc(self.setting('start_date'))
171
+ return configured or utc_now() - dt.timedelta(days=DEFAULT_START_DAYS)
172
+
173
+ def query_range(self, query: Dict):
174
+ """
175
+ A range to read once (a backfill): backfill_start_date and backfill_end_date in the
176
+ settings, or start_date and end_date in the query. Integration pipelines pass the
177
+ scheduler's interval (_start_date, _end_date), not a run's variables, so the
178
+ settings are where a user sets one.
179
+ """
180
+ query = query or {}
181
+ start = query.get('start_date') or self.setting('backfill_start_date')
182
+ end = query.get('end_date') or self.setting('backfill_end_date')
183
+ return to_utc(start or None), to_utc(end or None)
184
+
185
+ def sync_stream(self, stream, properties: Dict = None) -> int:
186
+ if stream.tap_stream_id != STREAM_EVENTS:
187
+ return super().sync_stream(stream, properties)
188
+ return self.sync_events(stream, properties)
189
+
190
+ def sync_events(self, stream, properties: Dict = None) -> int:
191
+ """Events window by window, saving the position after each one."""
192
+ bookmark = ((self.state or {}).get('bookmarks') or {}).get(STREAM_EVENTS) or {}
193
+ saved = bookmark.get(REPLICATION_KEYS[STREAM_EVENTS])
194
+ start, end = self.query_range(self.query)
195
+ backfill = start is not None
196
+ if not backfill:
197
+ start = next_hour(saved) if saved else self.start_date()
198
+ delay = int(self.setting('availability_delay_hours', AVAILABILITY_DELAY_HOURS))
199
+ newest = last_complete_hour(delay_hours=delay)
200
+ if start > newest:
201
+ self.logger.info(
202
+ f'Amplitude events: nothing new; the next hour, {start:%Y-%m-%d %H}:00 UTC, '
203
+ f'can be exported after {start + dt.timedelta(hours=1 + delay):%H}:00 UTC.',
204
+ )
205
+ return 0
206
+ event_types = self.setting('event_types') or None
207
+ if isinstance(event_types, str):
208
+ event_types = [t.strip() for t in event_types.split(',') if t.strip()]
209
+ wanted = set(event_types) if event_types else None
210
+
211
+ sorted_before = self.is_sorted
212
+ # The position is saved per window, not per record: a STATE message for each of
213
+ # millions of events cost more than the events.
214
+ self.is_sorted = False
215
+ count = 0
216
+ try:
217
+ for first, last, batches in self.client.export_windows(
218
+ start,
219
+ end,
220
+ window_hours=int(self.setting('window_hours', WINDOW_HOURS)),
221
+ delay_hours=delay,
222
+ ):
223
+ window_count = 0
224
+ for batch in batches:
225
+ rows = [
226
+ event_record(event) for event in batch
227
+ if wanted is None or event.get('event_type') in wanted
228
+ ]
229
+ if rows:
230
+ self.write_records(stream, rows, properties)
231
+ window_count += len(rows)
232
+ count += window_count
233
+ self.logger.info(
234
+ f'Amplitude events of {first:%Y-%m-%d %H}:00 to {last:%Y-%m-%d %H}:59 UTC: '
235
+ f'{window_count}.',
236
+ )
237
+ position = window_bookmark(last)
238
+ if not saved or to_utc(position) > to_utc(saved):
239
+ state = {}
240
+ singer.write_bookmark(
241
+ state, STREAM_EVENTS, REPLICATION_KEYS[STREAM_EVENTS], position,
242
+ )
243
+ write_state(state)
244
+ saved = position
245
+ if self.load_sample_data and count >= SAMPLE_ROWS:
246
+ break
247
+ finally:
248
+ self.is_sorted = sorted_before
249
+ return count
250
+
251
+ def load_data(
252
+ self,
253
+ stream=None,
254
+ bookmarks: Dict = None,
255
+ query: Dict = None,
256
+ sample_data: bool = False,
257
+ **kwargs,
258
+ ) -> Generator[List[Dict], None, None]:
259
+ stream_id = stream.tap_stream_id if stream is not None else STREAM_EVENTS
260
+ client = self.client
261
+
262
+ if stream_id == STREAM_EVENTS:
263
+ yield self.sample_events()
264
+ return
265
+
266
+ if stream_id in METRIC_STREAMS:
267
+ yield self.metric_rows(stream_id, bookmarks, query, sample_data)
268
+ return
269
+
270
+ if stream_id == STREAM_EVENT_TYPES:
271
+ yield client._data('/api/2/taxonomy/event')
272
+ elif stream_id == STREAM_EVENT_PROPERTIES:
273
+ yield client._data('/api/2/taxonomy/event-property')
274
+ elif stream_id == STREAM_USER_PROPERTIES:
275
+ yield client._data('/api/2/taxonomy/user-property')
276
+ elif stream_id == STREAM_ANNOTATIONS:
277
+ yield client._data('/api/3/annotations')
278
+ elif stream_id == STREAM_COHORTS:
279
+ yield client._json('/api/3/cohorts').get('cohorts') or []
280
+ elif stream_id == STREAM_COHORT_MEMBERS:
281
+ yield from self.cohort_member_batches()
282
+
283
+ def sample_events(self) -> List[Dict]:
284
+ """
285
+ Sample data in the editor: the newest events, from the newest complete hour, or the
286
+ last 6 hours, day or week when it has none (a quiet project), without downloading
287
+ more than the first range that has events.
288
+ """
289
+ newest = last_complete_hour()
290
+ for hours in SAMPLE_LOOKBACK_HOURS:
291
+ events = []
292
+ first = newest - dt.timedelta(hours=hours - 1)
293
+ for event in self.client.iter_events(first, newest, window_hours=hours):
294
+ events.append(event_record(event))
295
+ if len(events) >= SAMPLE_ROWS:
296
+ return events
297
+ if events:
298
+ return events
299
+ return []
300
+
301
+ def metric_rows(
302
+ self, stream_id: str, bookmarks: Dict, query: Dict, sample_data: bool = False,
303
+ ) -> List[Dict]:
304
+ start, end = self.query_range(query)
305
+ if start is None:
306
+ saved = (bookmarks or {}).get('date')
307
+ lookback = int(self.setting('metrics_lookback_days', DEFAULT_METRICS_LOOKBACK_DAYS))
308
+ start = (
309
+ to_utc(saved) - dt.timedelta(days=lookback) if saved else self.start_date()
310
+ )
311
+ end = end or utc_now()
312
+ if sample_data or self.load_sample_data:
313
+ start = end - dt.timedelta(days=7)
314
+ series = {
315
+ STREAM_ACTIVE_USERS: ('/api/2/users', dict(m='active', i=1)),
316
+ STREAM_NEW_USERS: ('/api/2/users', dict(m='new', i=1)),
317
+ STREAM_AVERAGE_SESSION_LENGTH: ('/api/2/sessions/average', {}),
318
+ STREAM_SESSIONS_PER_USER: ('/api/2/sessions/peruser', {}),
319
+ }
320
+ path, params = series[stream_id]
321
+ # The Dashboard REST API reads at most a year a request.
322
+ rows = []
323
+ first = start
324
+ while first <= end:
325
+ last = min(first + dt.timedelta(days=364), end)
326
+ rows += self.client._series(path, first, last, params)
327
+ first = last + dt.timedelta(days=1)
328
+ return sorted(rows, key=lambda row: (row['date'], row['segment']))
329
+
330
+ def cohort_member_batches(self) -> Generator[List[Dict], None, None]:
331
+ cohort_ids = self.setting('cohort_ids') or []
332
+ if isinstance(cohort_ids, str):
333
+ cohort_ids = [c.strip() for c in cohort_ids.split(',') if c.strip()]
334
+ if not cohort_ids:
335
+ self.logger.info(
336
+ 'Amplitude cohort_members: no cohort_ids in the source settings; nothing '
337
+ 'to read. Each cohort download counts toward 500 a month.',
338
+ )
339
+ return
340
+ properties = self.setting('cohort_properties') or False
341
+ for cohort_id in cohort_ids:
342
+ batch = []
343
+ for row in self.client.iter_cohort_members(str(cohort_id), properties):
344
+ batch.append(row)
345
+ if len(batch) >= 10_000:
346
+ yield batch
347
+ batch = []
348
+ if batch:
349
+ yield batch
350
+
351
+
352
+ __all__ = ['Amplitude', 'AmplitudeError']
353
+
354
+
355
+ if __name__ == '__main__':
356
+ main(Amplitude)
@@ -0,0 +1,58 @@
1
+ from mage_integrations.sources.constants import (
2
+ REPLICATION_METHOD_FULL_TABLE,
3
+ REPLICATION_METHOD_INCREMENTAL,
4
+ )
5
+
6
+ STREAM_EVENTS = 'events'
7
+ STREAM_ACTIVE_USERS = 'active_users'
8
+ STREAM_NEW_USERS = 'new_users'
9
+ STREAM_AVERAGE_SESSION_LENGTH = 'average_session_length'
10
+ STREAM_SESSIONS_PER_USER = 'sessions_per_user'
11
+ STREAM_EVENT_TYPES = 'event_types'
12
+ STREAM_EVENT_PROPERTIES = 'event_properties'
13
+ STREAM_USER_PROPERTIES = 'user_properties'
14
+ STREAM_ANNOTATIONS = 'annotations'
15
+ STREAM_COHORTS = 'cohorts'
16
+ STREAM_COHORT_MEMBERS = 'cohort_members'
17
+
18
+ METRIC_STREAMS = (
19
+ STREAM_ACTIVE_USERS,
20
+ STREAM_NEW_USERS,
21
+ STREAM_AVERAGE_SESSION_LENGTH,
22
+ STREAM_SESSIONS_PER_USER,
23
+ )
24
+
25
+ TABLE_KEY_PROPERTIES = {
26
+ STREAM_EVENTS: ['uuid'],
27
+ STREAM_ACTIVE_USERS: ['date', 'segment'],
28
+ STREAM_NEW_USERS: ['date', 'segment'],
29
+ STREAM_AVERAGE_SESSION_LENGTH: ['date', 'segment'],
30
+ STREAM_SESSIONS_PER_USER: ['date', 'segment'],
31
+ STREAM_EVENT_TYPES: ['event_type'],
32
+ STREAM_EVENT_PROPERTIES: ['event_type', 'event_property'],
33
+ STREAM_USER_PROPERTIES: ['user_property'],
34
+ STREAM_ANNOTATIONS: ['id'],
35
+ STREAM_COHORTS: ['id'],
36
+ STREAM_COHORT_MEMBERS: ['cohort_id', 'amplitude_id'],
37
+ }
38
+
39
+ # Events are exported by the hour Amplitude received them; metrics by day.
40
+ REPLICATION_KEYS = {
41
+ STREAM_EVENTS: 'server_upload_time',
42
+ STREAM_ACTIVE_USERS: 'date',
43
+ STREAM_NEW_USERS: 'date',
44
+ STREAM_AVERAGE_SESSION_LENGTH: 'date',
45
+ STREAM_SESSIONS_PER_USER: 'date',
46
+ }
47
+
48
+ REPLICATION_METHODS = {
49
+ stream: REPLICATION_METHOD_INCREMENTAL if stream in REPLICATION_KEYS
50
+ else REPLICATION_METHOD_FULL_TABLE
51
+ for stream in TABLE_KEY_PROPERTIES
52
+ }
53
+
54
+ # The first sync, without start_date, reads this far back.
55
+ DEFAULT_START_DAYS = 30
56
+ # Metrics of recent days change as late events arrive: each sync reads them again.
57
+ DEFAULT_METRICS_LOOKBACK_DAYS = 3
58
+ SAMPLE_ROWS = 100
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "Active users per day.",
3
+ "type": [
4
+ "null",
5
+ "object"
6
+ ],
7
+ "properties": {
8
+ "date": {
9
+ "type": [
10
+ "null",
11
+ "string"
12
+ ],
13
+ "format": "date"
14
+ },
15
+ "segment": {
16
+ "type": [
17
+ "null",
18
+ "string"
19
+ ]
20
+ },
21
+ "value": {
22
+ "type": [
23
+ "null",
24
+ "number"
25
+ ]
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "description": "Chart annotations: releases, campaigns and other marked dates.",
3
+ "type": [
4
+ "null",
5
+ "object"
6
+ ],
7
+ "properties": {
8
+ "id": {
9
+ "type": [
10
+ "null",
11
+ "integer"
12
+ ]
13
+ },
14
+ "start": {
15
+ "type": [
16
+ "null",
17
+ "string"
18
+ ],
19
+ "format": "date-time"
20
+ },
21
+ "end": {
22
+ "type": [
23
+ "null",
24
+ "string"
25
+ ],
26
+ "format": "date-time"
27
+ },
28
+ "label": {
29
+ "type": [
30
+ "null",
31
+ "string"
32
+ ]
33
+ },
34
+ "details": {
35
+ "type": [
36
+ "null",
37
+ "string"
38
+ ]
39
+ },
40
+ "category": {
41
+ "type": [
42
+ "null",
43
+ "object"
44
+ ],
45
+ "properties": {}
46
+ },
47
+ "chart_id": {
48
+ "type": [
49
+ "null",
50
+ "string"
51
+ ]
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "Average session length per day, in seconds.",
3
+ "type": [
4
+ "null",
5
+ "object"
6
+ ],
7
+ "properties": {
8
+ "date": {
9
+ "type": [
10
+ "null",
11
+ "string"
12
+ ],
13
+ "format": "date"
14
+ },
15
+ "segment": {
16
+ "type": [
17
+ "null",
18
+ "string"
19
+ ]
20
+ },
21
+ "value": {
22
+ "type": [
23
+ "null",
24
+ "number"
25
+ ]
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "description": "The users of the cohorts in cohort_ids (500 downloads a month).",
3
+ "type": [
4
+ "null",
5
+ "object"
6
+ ],
7
+ "properties": {
8
+ "cohort_id": {
9
+ "type": [
10
+ "null",
11
+ "string"
12
+ ]
13
+ },
14
+ "amplitude_id": {
15
+ "type": [
16
+ "null",
17
+ "integer"
18
+ ]
19
+ },
20
+ "user_id": {
21
+ "type": [
22
+ "null",
23
+ "string"
24
+ ]
25
+ },
26
+ "properties": {
27
+ "type": [
28
+ "null",
29
+ "object"
30
+ ],
31
+ "properties": {}
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "description": "Behavioral cohorts: name, size and owners.",
3
+ "type": [
4
+ "null",
5
+ "object"
6
+ ],
7
+ "properties": {
8
+ "id": {
9
+ "type": [
10
+ "null",
11
+ "string"
12
+ ]
13
+ },
14
+ "appId": {
15
+ "type": [
16
+ "null",
17
+ "integer"
18
+ ]
19
+ },
20
+ "name": {
21
+ "type": [
22
+ "null",
23
+ "string"
24
+ ]
25
+ },
26
+ "description": {
27
+ "type": [
28
+ "null",
29
+ "string"
30
+ ]
31
+ },
32
+ "archived": {
33
+ "type": [
34
+ "null",
35
+ "boolean"
36
+ ]
37
+ },
38
+ "finished": {
39
+ "type": [
40
+ "null",
41
+ "boolean"
42
+ ]
43
+ },
44
+ "published": {
45
+ "type": [
46
+ "null",
47
+ "boolean"
48
+ ]
49
+ },
50
+ "hidden": {
51
+ "type": [
52
+ "null",
53
+ "boolean"
54
+ ]
55
+ },
56
+ "size": {
57
+ "type": [
58
+ "null",
59
+ "integer"
60
+ ]
61
+ },
62
+ "type": {
63
+ "type": [
64
+ "null",
65
+ "string"
66
+ ]
67
+ },
68
+ "owners": {
69
+ "type": [
70
+ "null",
71
+ "array"
72
+ ],
73
+ "items": {}
74
+ },
75
+ "viewers": {
76
+ "type": [
77
+ "null",
78
+ "array"
79
+ ],
80
+ "items": {}
81
+ },
82
+ "definition": {
83
+ "type": [
84
+ "null",
85
+ "object"
86
+ ],
87
+ "properties": {}
88
+ },
89
+ "lastMod": {
90
+ "type": [
91
+ "null",
92
+ "integer"
93
+ ]
94
+ },
95
+ "createdAt": {
96
+ "type": [
97
+ "null",
98
+ "integer"
99
+ ]
100
+ },
101
+ "lastComputed": {
102
+ "type": [
103
+ "null",
104
+ "integer"
105
+ ]
106
+ },
107
+ "last_viewed": {
108
+ "type": [
109
+ "null",
110
+ "integer"
111
+ ]
112
+ },
113
+ "chart_id": {
114
+ "type": [
115
+ "null",
116
+ "string"
117
+ ]
118
+ },
119
+ "is_predictive": {
120
+ "type": [
121
+ "null",
122
+ "boolean"
123
+ ]
124
+ },
125
+ "is_official_content": {
126
+ "type": [
127
+ "null",
128
+ "boolean"
129
+ ]
130
+ },
131
+ "view_count": {
132
+ "type": [
133
+ "null",
134
+ "integer"
135
+ ]
136
+ },
137
+ "popularity": {
138
+ "type": [
139
+ "null",
140
+ "integer"
141
+ ]
142
+ }
143
+ }
144
+ }