diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml
index f9db69d76094..28bfa93da730 100644
--- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml
+++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml
@@ -1103,11 +1103,14 @@
- name: Mailchimp
sourceDefinitionId: b03a9f3e-22a5-11eb-adc1-0242ac120002
dockerRepository: airbyte/source-mailchimp
- dockerImageTag: 0.3.4
+ dockerImageTag: 0.3.5
documentationUrl: https://docs.airbyte.com/integrations/sources/mailchimp
icon: mailchimp.svg
sourceType: api
releaseStage: generally_available
+ allowedHosts:
+ hosts:
+ - "*.api.mailchimp.com"
- name: Mailjet Mail
sourceDefinitionId: 56582331-5de2-476b-b913-5798de77bbdf
dockerRepository: airbyte/source-mailjet-mail
diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml
index cddfeea862ea..231766145039 100644
--- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml
+++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml
@@ -8074,7 +8074,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
-- dockerImage: "airbyte/source-mailchimp:0.3.4"
+- dockerImage: "airbyte/source-mailchimp:0.3.5"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/mailchimp"
connectionSpecification:
diff --git a/airbyte-integrations/connectors/source-mailchimp/Dockerfile b/airbyte-integrations/connectors/source-mailchimp/Dockerfile
index 46f63dc351cd..193609f6a4a2 100644
--- a/airbyte-integrations/connectors/source-mailchimp/Dockerfile
+++ b/airbyte-integrations/connectors/source-mailchimp/Dockerfile
@@ -12,5 +12,5 @@ COPY main.py ./
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
-LABEL io.airbyte.version=0.3.4
+LABEL io.airbyte.version=0.3.5
LABEL io.airbyte.name=airbyte/source-mailchimp
diff --git a/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml b/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml
index f248066567ba..dd219a017cfc 100644
--- a/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml
+++ b/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml
@@ -47,6 +47,7 @@ acceptance_tests:
lists: ["date_created"]
campaigns: ["create_time"]
email_activity: ["49d68626f3", "timestamp"]
+ reports: ["send_time"]
# Email activities stream has working campaigns with email newsletters.
# Due to this sequential_reads test could be failed.
full_refresh:
diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json
index 04af755e9e2b..b940ec8e0f59 100644
--- a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json
+++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json
@@ -23,7 +23,7 @@
"default_cursor_field": ["date_created"],
"source_defined_primary_key": [["id"]]
},
- "sync_mode": "incremental",
+ "sync_mode": "incremental",
"cursor_field": ["date_created"],
"destination_sync_mode": "append",
"primary_key": [["id"]]
@@ -41,6 +41,20 @@
"cursor_field": ["timestamp"],
"primary_key": [["timestamp"], ["email_id"], ["action"]],
"destination_sync_mode": "append"
+ },
+ {
+ "stream": {
+ "name": "reports",
+ "json_schema": {},
+ "supported_sync_modes": ["full_refresh", "incremental"],
+ "source_defined_cursor": true,
+ "default_cursor_field": ["send_time"],
+ "source_defined_primary_key": [["id"]]
+ },
+ "sync_mode": "incremental",
+ "cursor_field": ["send_time"],
+ "primary_key": [["id"]],
+ "destination_sync_mode": "append"
}
]
}
diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json
index 80710c6af509..d1c17cde4378 100644
--- a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json
+++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json
@@ -27,6 +27,20 @@
"cursor_field": ["date_created"],
"primary_key": [["id"]],
"destination_sync_mode": "append"
+ },
+ {
+ "stream": {
+ "name": "reports",
+ "json_schema": {},
+ "supported_sync_modes": ["full_refresh", "incremental"],
+ "source_defined_cursor": true,
+ "default_cursor_field": ["send_time"],
+ "source_defined_primary_key": [["id"]]
+ },
+ "sync_mode": "incremental",
+ "cursor_field": ["send_time"],
+ "primary_key": [["id"]],
+ "destination_sync_mode": "append"
}
]
}
diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json b/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json
index 723f2c8ca5df..519e2032847f 100644
--- a/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json
+++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json
@@ -21,5 +21,12 @@
},
"stream_descriptor": { "name": "email_activity" }
}
+ },
+ {
+ "type": "STREAM",
+ "stream": {
+ "stream_state": { "send_time": "2230-02-26T05:42:10+00:00" },
+ "stream_descriptor": { "name": "reports" }
+ }
}
]
diff --git a/airbyte-integrations/connectors/source-mailchimp/sample_files/configured_catalog.json b/airbyte-integrations/connectors/source-mailchimp/sample_files/configured_catalog.json
index 8685a0a679b6..ff565d564dd1 100644
--- a/airbyte-integrations/connectors/source-mailchimp/sample_files/configured_catalog.json
+++ b/airbyte-integrations/connectors/source-mailchimp/sample_files/configured_catalog.json
@@ -1146,6 +1146,18 @@
"sync_mode": "incremental",
"cursor_field": ["timestamp"],
"destination_sync_mode": "append"
+ },
+ {
+ "stream": {
+ "name": "reports",
+ "json_schema": {},
+ "supported_sync_modes": ["incremental", "full_refresh"],
+ "source_defined_cursor": true,
+ "default_cursor_field": ["send_time"]
+ },
+ "sync_mode": "incremental",
+ "cursor_field": ["send_time"],
+ "destination_sync_mode": "append"
}
]
}
diff --git a/airbyte-integrations/connectors/source-mailchimp/sample_files/state.json b/airbyte-integrations/connectors/source-mailchimp/sample_files/state.json
index 7fe6fa04915b..da4fe3c4c6c3 100644
--- a/airbyte-integrations/connectors/source-mailchimp/sample_files/state.json
+++ b/airbyte-integrations/connectors/source-mailchimp/sample_files/state.json
@@ -3,5 +3,8 @@
"lists": { "date_created": "2020-09-25T04:47:31+00:00" },
"email_activity": {
"49d68626f3": { "timestamp": "2020-11-23T05:42:10+00:00" }
+ },
+ "reports": {
+ "49d68626f3": { "send_time": "2020-11-23T05:42:10+00:00" }
}
}
diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/reports.json b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/reports.json
new file mode 100644
index 000000000000..d94cb73ad0df
--- /dev/null
+++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/reports.json
@@ -0,0 +1,559 @@
+{
+ "type": "object",
+ "title": "Campaign Reports",
+ "description": "A list of reports containing campaigns marked as Sent.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "title": "Campaign ID",
+ "description": "A string that uniquely identifies this campaign."
+ },
+ "campaign_title": {
+ "type": "string",
+ "title": "Campaign Title",
+ "description": "The title of the campaign.",
+ "readOnly": true
+ },
+ "type": {
+ "type": "string",
+ "title": "Campaign Type",
+ "description": "The type of campaign (regular, plain-text, ab_split, rss, automation, variate, or auto)."
+ },
+ "list_id": {
+ "type": "string",
+ "title": "List ID",
+ "description": "The unique list id.",
+ "readOnly": true
+ },
+ "list_is_active": {
+ "type": "boolean",
+ "title": "List Status",
+ "description": "The status of the list used, namely if it's deleted or disabled.",
+ "readOnly": true
+ },
+ "list_name": {
+ "type": "string",
+ "title": "List Name",
+ "description": "The name of the list.",
+ "readOnly": true
+ },
+ "subject_line": {
+ "type": "string",
+ "title": "Campaign Subject Line",
+ "description": "The subject line for the campaign.",
+ "readOnly": true
+ },
+ "preview_text": {
+ "type": "string",
+ "title": "Campaign Preview Text",
+ "description": "The preview text for the campaign."
+ },
+ "emails_sent": {
+ "type": "integer",
+ "title": "Emails Sent",
+ "description": "The total number of emails sent for this campaign."
+ },
+ "abuse_reports": {
+ "type": "integer",
+ "title": "Abuse Reports",
+ "description": "The number of abuse reports generated for this campaign."
+ },
+ "unsubscribed": {
+ "type": "integer",
+ "title": "Unsubscribe Count",
+ "description": "The total number of unsubscribed members for this campaign.",
+ "readOnly": true
+ },
+ "send_time": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Send Time",
+ "description": "The date and time a campaign was sent in ISO 8601 format.",
+ "readOnly": true
+ },
+ "rss_last_send": {
+ "type": "string",
+ "format": "date-time",
+ "title": "RSS Last Send",
+ "description": "For RSS campaigns, the date and time of the last send in ISO 8601 format.",
+ "readOnly": true
+ },
+ "bounces": {
+ "type": "object",
+ "title": "Bounces",
+ "description": "An object describing the bounce summary for the campaign.",
+ "properties": {
+ "hard_bounces": {
+ "type": "integer",
+ "title": "Hard Bounces",
+ "description": "The total number of hard bounced email addresses."
+ },
+ "soft_bounces": {
+ "type": "integer",
+ "title": "Soft Bounces",
+ "description": "The total number of soft bounced email addresses."
+ },
+ "syntax_errors": {
+ "type": "integer",
+ "title": "Syntax Errors",
+ "description": "The total number of addresses that were syntax-related bounces."
+ }
+ }
+ },
+ "forwards": {
+ "type": "object",
+ "title": "Forwards",
+ "description": "An object describing the forwards and forward activity for the campaign.",
+ "properties": {
+ "forwards_count": {
+ "type": "integer",
+ "title": "Total Forwards",
+ "description": "How many times the campaign has been forwarded."
+ },
+ "forwards_opens": {
+ "type": "integer",
+ "title": "Forward Opens",
+ "description": "How many times the forwarded campaign has been opened."
+ }
+ }
+ },
+ "opens": {
+ "type": "object",
+ "title": "Opens",
+ "description": "An object describing the open activity for the campaign.",
+ "properties": {
+ "opens_total": {
+ "type": "integer",
+ "title": "Total Opens",
+ "description": "The total number of opens for a campaign."
+ },
+ "unique_opens": {
+ "type": "integer",
+ "title": "Unique Opens",
+ "description": "The total number of unique opens."
+ },
+ "open_rate": {
+ "type": "number",
+ "title": "Open Rate",
+ "description": "The number of unique opens divided by the total number of successful deliveries."
+ },
+ "last_open": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Last Open",
+ "description": "The date and time of the last recorded open in ISO 8601 format."
+ }
+ }
+ },
+ "clicks": {
+ "type": "object",
+ "title": "Clicks",
+ "description": "An object describing the click activity for the campaign.",
+ "properties": {
+ "clicks_total": {
+ "type": "integer",
+ "title": "Total Clicks",
+ "description": "The total number of clicks for the campaign."
+ },
+ "unique_clicks": {
+ "type": "integer",
+ "title": "Unique Clicks",
+ "description": "The total number of unique clicks for links across a campaign."
+ },
+ "unique_subscriber_clicks": {
+ "type": "integer",
+ "title": "Unique Subscriber Clicks",
+ "description": "The total number of subscribers who clicked on a campaign."
+ },
+ "click_rate": {
+ "type": "number",
+ "title": "Click Rate",
+ "description": "The number of unique clicks divided by the total number of successful deliveries."
+ },
+ "last_click": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Last Click",
+ "description": "The date and time of the last recorded click for the campaign in ISO 8601 format."
+ }
+ }
+ },
+ "facebook_likes": {
+ "type": "object",
+ "title": "Facebook Likes",
+ "description": "An object describing campaign engagement on Facebook.",
+ "properties": {
+ "recipient_likes": {
+ "type": "integer",
+ "title": "Recipient Likes",
+ "description": "The number of recipients who liked the campaign on Facebook."
+ },
+ "unique_likes": {
+ "type": "integer",
+ "title": "Unique Likes",
+ "description": "The number of unique likes."
+ },
+ "facebook_likes": {
+ "type": "integer",
+ "title": "Facebook Likes",
+ "description": "The number of Facebook likes for the campaign."
+ }
+ }
+ },
+ "industry_stats": {
+ "type": "object",
+ "title": "Industry Stats",
+ "description": "The average campaign statistics for your industry.",
+ "properties": {
+ "type": {
+ "type": "string",
+ "title": "Industry Type",
+ "description": "The type of business industry associated with your account. For example: retail, education, etc."
+ },
+ "open_rate": {
+ "type": "number",
+ "title": "Open Rate",
+ "description": "The industry open rate."
+ },
+ "click_rate": {
+ "type": "number",
+ "title": "Click Rate",
+ "description": "The industry click rate."
+ },
+ "bounce_rate": {
+ "type": "number",
+ "title": "Bounce Rate",
+ "description": "The industry bounce rate."
+ },
+ "unopen_rate": {
+ "type": "number",
+ "title": "Unopened Rate",
+ "description": "The industry unopened rate."
+ },
+ "unsub_rate": {
+ "type": "number",
+ "title": "Unsubscribe Rate",
+ "description": "The industry unsubscribe rate."
+ },
+ "abuse_rate": {
+ "type": "number",
+ "title": "Abuse Rate",
+ "description": "The industry abuse rate."
+ }
+ }
+ },
+ "list_stats": {
+ "type": "object",
+ "title": "List Stats",
+ "description": "The average campaign statistics for your list. This won't be present if we haven't calculated it yet for this list.",
+ "properties": {
+ "sub_rate": {
+ "type": "number",
+ "title": "Average Subscription Rate",
+ "description": "The average number of subscriptions per month for the list.",
+ "readOnly": true
+ },
+ "unsub_rate": {
+ "type": "number",
+ "title": "Average Unsubscription Rate",
+ "description": "The average number of unsubscriptions per month for the list.",
+ "readOnly": true
+ },
+ "open_rate": {
+ "type": "number",
+ "title": "Open Rate",
+ "description": "The average open rate (a percentage represented as a number between 0 and 100) per campaign for the list.",
+ "readOnly": true
+ },
+ "click_rate": {
+ "type": "number",
+ "title": "Click Rate",
+ "description": "The average click rate (a percentage represented as a number between 0 and 100) per campaign for the list.",
+ "readOnly": true
+ }
+ }
+ },
+ "ab_split": {
+ "type": "object",
+ "title": "A/B Split Stats",
+ "description": "General stats about different groups of an A/B Split campaign. Does not return information about Multivariate Campaigns.",
+ "properties": {
+ "a": {
+ "type": "object",
+ "title": "Campaign A",
+ "description": "Stats for Campaign A.",
+ "properties": {
+ "bounces": {
+ "type": "integer",
+ "title": "Bounces",
+ "description": "Bounces for Campaign A."
+ },
+ "abuse_reports": {
+ "type": "integer",
+ "title": "Abuse Reports",
+ "description": "Abuse reports for Campaign A."
+ },
+ "unsubs": {
+ "type": "integer",
+ "title": "Unsubscribes",
+ "description": "Unsubscribes for Campaign A."
+ },
+ "recipient_clicks": {
+ "type": "integer",
+ "title": "Recipient Clicks",
+ "description": "Recipient Clicks for Campaign A."
+ },
+ "forwards": {
+ "type": "integer",
+ "title": "Forwards",
+ "description": "Forwards for Campaign A."
+ },
+ "forwards_opens": {
+ "type": "integer",
+ "title": "Forward Opens",
+ "description": "Opens from forwards for Campaign A."
+ },
+ "opens": {
+ "type": "integer",
+ "title": "Opens",
+ "description": "Opens for Campaign A."
+ },
+ "last_open": {
+ "type": "string",
+ "title": "Last Open",
+ "description": "The last open for Campaign A."
+ },
+ "unique_opens": {
+ "type": "integer",
+ "title": "Unique Opens",
+ "description": "Unique opens for Campaign A."
+ }
+ }
+ },
+ "b": {
+ "type": "object",
+ "title": "Campaign B",
+ "description": "Stats for Campaign B.",
+ "properties": {
+ "bounces": {
+ "type": "integer",
+ "title": "Bounces",
+ "description": "Bounces for Campaign B."
+ },
+ "abuse_reports": {
+ "type": "integer",
+ "title": "Abuse Reports",
+ "description": "Abuse reports for Campaign B."
+ },
+ "unsubs": {
+ "type": "integer",
+ "title": "Unsubscribes",
+ "description": "Unsubscribes for Campaign B."
+ },
+ "recipient_clicks": {
+ "type": "integer",
+ "title": "Recipient Clicks",
+ "description": "Recipients clicks for Campaign B."
+ },
+ "forwards": {
+ "type": "integer",
+ "title": "Forwards",
+ "description": "Forwards for Campaign B."
+ },
+ "forwards_opens": {
+ "type": "integer",
+ "title": "Forward Opens",
+ "description": "Opens for forwards from Campaign B."
+ },
+ "opens": {
+ "type": "integer",
+ "title": "Opens",
+ "description": "Opens for Campaign B."
+ },
+ "last_open": {
+ "type": "string",
+ "title": "Last Open",
+ "description": "The last open for Campaign B."
+ },
+ "unique_opens": {
+ "type": "integer",
+ "title": "Unique Opens",
+ "description": "Unique opens for Campaign B."
+ }
+ }
+ }
+ }
+ },
+ "timewarp": {
+ "type": "array",
+ "title": "Timewarp Stats",
+ "description": "An hourly breakdown of sends, opens, and clicks if a campaign is sent using timewarp.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "gmt_offset": {
+ "type": "integer",
+ "title": "GMT Offset",
+ "description": "For campaigns sent with timewarp, the time zone group the member is apart of."
+ },
+ "opens": {
+ "type": "integer",
+ "title": "Opens",
+ "description": "The number of opens."
+ },
+ "last_open": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Last Open",
+ "description": "The date and time of the last open in ISO 8601 format."
+ },
+ "unique_opens": {
+ "type": "integer",
+ "title": "Unique Opens",
+ "description": "The number of unique opens."
+ },
+ "clicks": {
+ "type": "integer",
+ "title": "Clicks",
+ "description": "The number of clicks."
+ },
+ "last_click": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Last Click",
+ "description": "The date and time of the last click in ISO 8601 format."
+ },
+ "unique_clicks": {
+ "type": "integer",
+ "title": "Unique Clicks",
+ "description": "The number of unique clicks."
+ },
+ "bounces": {
+ "type": "integer",
+ "title": "Bounces",
+ "description": "The number of bounces."
+ }
+ }
+ }
+ },
+ "timeseries": {
+ "type": "array",
+ "title": "Timeseries",
+ "description": "An hourly breakdown of the performance of the campaign over the first 24 hours.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Timestamp",
+ "description": "The date and time for the series in ISO 8601 format."
+ },
+ "emails_sent": {
+ "type": "integer",
+ "title": "Emails Sent",
+ "description": "The number of emails sent in the timeseries."
+ },
+ "unique_opens": {
+ "type": "integer",
+ "title": "Unique Opens",
+ "description": "The number of unique opens in the timeseries."
+ },
+ "recipients_clicks": {
+ "type": "integer",
+ "title": "Recipient Clicks",
+ "description": "The number of clicks in the timeseries."
+ }
+ }
+ }
+ },
+ "share_report": {
+ "type": "object",
+ "title": "Share Report",
+ "description": "The url and password for the [VIP report](https://mailchimp.com/help/share-a-campaign-report/).",
+ "properties": {
+ "share_url": {
+ "type": "string",
+ "title": "Report URL",
+ "description": "The URL for the VIP report.",
+ "readOnly": true
+ },
+ "share_password": {
+ "type": "string",
+ "title": "Report Password",
+ "description": "If password protected, the password for the VIP report.",
+ "readOnly": true
+ }
+ }
+ },
+ "ecommerce": {
+ "type": "object",
+ "title": "E-Commerce Report",
+ "description": "E-Commerce stats for a campaign.",
+ "properties": {
+ "total_orders": {
+ "type": "integer",
+ "title": "Total Orders",
+ "description": "The total orders for a campaign.",
+ "readOnly": true
+ },
+ "total_spent": {
+ "type": "number",
+ "title": "Total Spent",
+ "description": "The total spent for a campaign. Calculated as the sum of all order totals with no deductions.",
+ "readOnly": true
+ },
+ "total_revenue": {
+ "type": "number",
+ "title": "Total Revenue",
+ "description": "The total revenue for a campaign. Calculated as the sum of all order totals minus shipping and tax totals.",
+ "readOnly": true
+ },
+ "currency_code": {
+ "type": "string",
+ "title": "Three letter currency code for this user",
+ "readOnly": true,
+ "example": "USD"
+ }
+ }
+ },
+ "delivery_status": {
+ "type": "object",
+ "title": "Campaign Delivery Status",
+ "description": "Updates on campaigns in the process of sending.",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "title": "Delivery Status Enabled",
+ "description": "Whether Campaign Delivery Status is enabled for this account and campaign.",
+ "readOnly": true
+ },
+ "can_cancel": {
+ "type": "boolean",
+ "title": "Campaign Cancelable",
+ "description": "Whether a campaign send can be canceled.",
+ "readOnly": true
+ },
+ "status": {
+ "type": "string",
+ "title": "Campaign Delivery Status",
+ "description": "The current state of a campaign delivery.",
+ "enum": ["delivering", "delivered", "canceling", "canceled"],
+ "readOnly": true
+ },
+ "emails_sent": {
+ "type": "integer",
+ "title": "Emails Sent",
+ "description": "The total number of emails confirmed sent for this campaign so far.",
+ "readOnly": true
+ },
+ "emails_canceled": {
+ "type": "integer",
+ "title": "Emails Canceled",
+ "description": "The total number of emails canceled for this campaign.",
+ "readOnly": true
+ }
+ }
+ }
+ }
+}
diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py
index b4ea636e5c25..fff7fcb1cc50 100644
--- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py
+++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py
@@ -13,7 +13,7 @@
from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator
from requests.auth import AuthBase
-from .streams import Campaigns, EmailActivity, Lists
+from .streams import Campaigns, EmailActivity, Lists, Reports
class MailChimpAuthenticator:
@@ -68,4 +68,5 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
Lists(authenticator=authenticator),
Campaigns(authenticator=authenticator),
EmailActivity(authenticator=authenticator, campaign_id=campaign_id),
+ Reports(authenticator=authenticator),
]
diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py
index eebe4931f661..1e78ce85d713 100644
--- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py
+++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py
@@ -187,3 +187,10 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp
for item in data:
for activity_item in item.pop("activity", []):
yield {**item, **activity_item}
+
+class Reports(IncrementalMailChimpStream):
+ cursor_field = "send_time"
+ data_field = "reports"
+
+ def path(self, **kwargs) -> str:
+ return "reports"
diff --git a/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_source.py b/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_source.py
index a3ccaebcc161..16438c067753 100644
--- a/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_source.py
+++ b/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_source.py
@@ -66,4 +66,4 @@ def test_wrong_config(wrong_config):
def test_streams_count(config):
streams = SourceMailchimp().streams(config)
- assert len(streams) == 3
+ assert len(streams) == 4
diff --git a/connectors.md b/connectors.md
index 3afd773eafaf..684b7a46b4f6 100644
--- a/connectors.md
+++ b/connectors.md
@@ -128,7 +128,7 @@
| **Linnworks** | | Source | airbyte/source-linnworks:0.1.5 | alpha | [link](https://docs.airbyte.com/integrations/sources/linnworks) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-linnworks) | `7b86879e-26c5-4ef6-a5ce-2be5c7b46d1e` |
| **Lokalise** | | Source | airbyte/source-lokalise:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/lokalise) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-lokalise) | `45e0b135-615c-40ac-b38e-e65b0944197f` |
| **Looker** | | Source | airbyte/source-looker:0.2.8 | alpha | [link](https://docs.airbyte.com/integrations/sources/looker) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-looker) | `00405b19-9768-4e0c-b1ae-9fc2ee2b2a8c` |
-| **Mailchimp** | | Source | airbyte/source-mailchimp:0.3.4 | generally_available | [link](https://docs.airbyte.com/integrations/sources/mailchimp) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-mailchimp) | `b03a9f3e-22a5-11eb-adc1-0242ac120002` |
+| **Mailchimp** | | Source | airbyte/source-mailchimp:0.3.5 | generally_available | [link](https://docs.airbyte.com/integrations/sources/mailchimp) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-mailchimp) | `b03a9f3e-22a5-11eb-adc1-0242ac120002` |
| **MailerLite** | | Source | airbyte/source-mailerlite:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/mailerlite) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-mailerlite) | `dc3b9003-2432-4e93-a7f4-4620b0f14674` |
| **MailerSend** | | Source | airbyte/source-mailersend:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/mailersend) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-mailersend) | `2707d529-3c04-46eb-9c7e-40d4038df6f7` |
| **Mailgun** | | Source | airbyte/source-mailgun:0.1.1 | alpha | [link](https://docs.airbyte.com/integrations/sources/mailgun) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-mailgun) | `5b9cb09e-1003-4f9c-983d-5779d1b2cd51` |
diff --git a/docs/integrations/sources/mailchimp.md b/docs/integrations/sources/mailchimp.md
index 2fc466385300..a16e8c5c777a 100644
--- a/docs/integrations/sources/mailchimp.md
+++ b/docs/integrations/sources/mailchimp.md
@@ -230,6 +230,7 @@ Now that you have set up the Mailchimp source connector, check out the following
| Version | Date | Pull Request | Subject |
|---------|------------|----------------------------------------------------------|----------------------------------------------------------------------------|
+| 0.3.5 | 2023-02-28 | [23464](https://github.com/airbytehq/airbyte/pull/23464) | Add Reports stream |
| 0.3.4 | 2023-02-06 | [22405](https://github.com/airbytehq/airbyte/pull/22405) | Revert extra logging |
| 0.3.3 | 2023-02-01 | [22228](https://github.com/airbytehq/airbyte/pull/22228) | Add extra logging |
| 0.3.2 | 2023-01-27 | [22014](https://github.com/airbytehq/airbyte/pull/22014) | Set `AvailabilityStrategy` for streams explicitly to `None` |