Skip to content

Commit

Permalink
✨ Source Intercom: Add new stream Activity logs stream (#33882)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik0 authored Jan 15, 2024
1 parent a0623c5 commit 4a6924e
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,16 @@
"updated_at": 7626086649
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "activity_logs"
},
"stream_state": {
"created_at": 7626086649
}
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
"primary_key": [["id"]],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "activity_logs",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"cursor_field": ["created_at"],
"primary_key": [["id"]],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "companies",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"streams": [
{
"stream": {
"name": "activity_logs",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"cursor_field": ["created_at"],
"primary_key": [["id"]],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "companies",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: d8313939-3782-41b0-be29-b3ca20d8dd3a
dockerImageTag: 0.3.2
dockerImageTag: 0.4.0
dockerRepository: airbyte/source-intercom
documentationUrl: https://docs.airbyte.com/integrations/sources/intercom
githubIssueLabel: source-intercom
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-intercom/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import find_packages, setup

MAIN_REQUIREMENTS = [
"airbyte-cdk",
"airbyte-cdk>=0.58.8", # previous versions had a bug with http_method value from the manifest
]

TEST_REQUIREMENTS = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def read_parent_stream(
)

for parent_slice in parent_stream_slices_gen:

parent_records_gen = self.parent_stream.read_records(
sync_mode=sync_mode, cursor_field=cursor_field, stream_slice=parent_slice, stream_state=stream_state
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,46 @@ definitions:
data_field: "conversations"
page_size: 150

# activity logs stream is incremental based on created_at field
activity_logs:
$ref: "#/definitions/stream_full_refresh"
primary_key: id
$parameters:
name: "activity_logs"
path: "admins/activity_logs"
data_field: "activity_logs"
retriever:
$ref: "#/definitions/retriever"
description: "The Retriever without passing page size option"
paginator:
type: "DefaultPaginator"
url_base: "#/definitions/requester/url_base"
pagination_strategy:
type: "CursorPagination"
cursor_value: "{{ response.get('pages', {}).get('next') }}"
stop_condition: "{{ 'next' not in response.get('pages', {}) }}"
page_token_option:
type: RequestPath
incremental_sync:
type: DatetimeBasedCursor
cursor_field: created_at
cursor_datetime_formats:
- "%s"
datetime_format: "%s"
cursor_granularity: "PT1S"
step: "P30D"
start_datetime:
datetime: "{{ config['start_date'] }}"
datetime_format: "%Y-%m-%dT%H:%M:%SZ"
end_time_option:
field_name: "created_at_before"
inject_into: "request_parameter"
start_time_option:
field_name: "created_at_after"
inject_into: "request_parameter"

streams:
- "#/definitions/activity_logs"
- "#/definitions/admins"
- "#/definitions/tags"
- "#/definitions/teams"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"type": "object",
"properties": {
"performed_by": {
"type": ["null", "object"],
"properties": {
"id": {
"type": ["null", "string"]
},
"type": {
"type": ["null", "string"]
},
"ip": {
"type": ["null", "string"]
},
"email": {
"type": ["null", "string"]
}
}
},
"id": {
"type": ["null", "string"]
},
"metadata": {
"type": ["null", "object"]
},
"activity_type": {
"type": ["null", "string"]
},
"activity_description": {
"type": ["null", "string"]
},
"created_at": {
"type": ["null", "integer"]
}
}
}
1 change: 1 addition & 0 deletions docs/integrations/sources/intercom.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The Intercom connector should not run into Intercom API limitations under normal

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:---------------------------------------------------------------------------------------------------------|
| 0.4.0 | 2024-01-11 | [33882](https://github.com/airbytehq/airbyte/pull/33882) | Add new stream `Activity Logs` |
| 0.3.2 | 2023-12-07 | [33223](https://github.com/airbytehq/airbyte/pull/33223) | Ignore 404 error for `Conversation Parts` |
| 0.3.1 | 2023-10-19 | [31599](https://github.com/airbytehq/airbyte/pull/31599) | Base image migration: remove Dockerfile and use the python-connector-base image |
| 0.3.0 | 2023-05-25 | [29598](https://github.com/airbytehq/airbyte/pull/29598) | Update custom components to make them compatible with latest cdk version, simplify logic, update schemas |
Expand Down

0 comments on commit 4a6924e

Please sign in to comment.