From 996c19b17b44e04eccdff120702682a9ae7b0ac2 Mon Sep 17 00:00:00 2001 From: Tope Folorunso Date: Mon, 23 Oct 2023 15:26:05 +0100 Subject: [PATCH] add mails stream --- .../integration_tests/configured_catalog.json | 9 +++ .../source_pipedrive/manifest.yaml | 36 ++++++++++++ .../source_pipedrive/schemas/mails.json | 57 +++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 airbyte-integrations/connectors/source-pipedrive/source_pipedrive/schemas/mails.json diff --git a/airbyte-integrations/connectors/source-pipedrive/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-pipedrive/integration_tests/configured_catalog.json index fa5189b4b909..a946e5678967 100644 --- a/airbyte-integrations/connectors/source-pipedrive/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-pipedrive/integration_tests/configured_catalog.json @@ -131,6 +131,15 @@ "sync_mode": "full_refresh", "destination_sync_mode": "overwrite" }, + { + "stream": { + "name": "mails", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, { "stream": { "name": "organizations", diff --git a/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/manifest.yaml b/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/manifest.yaml index 7beaaa42b232..a5215164835b 100644 --- a/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/manifest.yaml +++ b/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/manifest.yaml @@ -190,6 +190,41 @@ definitions: $parameters: path: "/currencies" + mails_stream: + $ref: "#/definitions/base_stream" + name: mails + primary_key: "id" + retriever: + $ref: "#/definitions/retriever" + partition_router: + - type: SubstreamPartitionRouter + parent_stream_configs: + - type: ParentStreamConfig + parent_key: id + partition_field: thread_id + stream: + $ref: "#/definitions/base_stream" + name: mailthreads + primary_key: "id" + retriever: + $ref: "#/definitions/retriever" + partition_router: + - type: ListPartitionRouter + values: + - inbox + - drafts + - sent + - archive + cursor_field: folder + request_option: + inject_into: request_parameter + type: RequestOption + field_name: folder + $parameters: + path: "mailbox/mailThreads" + $parameters: + path: "mailbox/mailThreads/{{ stream_partition.thread_id }}/mailMessages" + organization_stream: $ref: "#/definitions/base_stream" name: "organizations" @@ -330,6 +365,7 @@ streams: - "#/definitions/activity_types_stream" - "#/definitions/activity_fields_stream" - "#/definitions/currencies_stream" + - "#/definitions/mails_stream" - "#/definitions/organization_stream" - "#/definitions/organization_fields_stream" - "#/definitions/permission_sets_stream" diff --git a/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/schemas/mails.json b/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/schemas/mails.json new file mode 100644 index 000000000000..4b2299608b72 --- /dev/null +++ b/airbyte-integrations/connectors/source-pipedrive/source_pipedrive/schemas/mails.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "properties": { + "id": {"type": ["null", "integer"]}, + "from": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "id": {"type": ["null", "integer"]}, + "email_address": {"type": ["null", "string"]}, + "name": {"type": ["null", "string"]}, + "linked_person_id": {"type": ["null", "integer"]}, + "linked_person_name": {"type": ["null", "string"]}, + "mail_message_party_id": {"type": ["null", "integer"]} + } + } + }, + "to": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "id": {"type": ["null", "integer"]}, + "email_address": {"type": ["null", "string"]}, + "name": {"type": ["null", "string"]}, + "linked_person_id": {"type": ["null", "integer"]}, + "linked_person_name": {"type": ["null", "string"]}, + "mail_message_party_id": {"type": ["null", "integer"]} + } + } + }, + "body_url": {"type": ["null", "string"]}, + "account_id": {"type": ["null", "string"]}, + "user_id": {"type": ["null", "integer"]}, + "mail_thread_id": {"type": ["null", "integer"]}, + "subject": {"type": ["null", "string"]}, + "snippet": {"type": ["null", "string"]}, + "mail_link_tracking_enabled_flag": {"type": ["null", "integer"]}, + "read_flag": {"type": ["null", "integer"]}, + "draft_flag": {"type": ["null", "integer"]}, + "synced_flag": {"type": ["null", "integer"]}, + "deleted_flag": {"type": ["null", "integer"]}, + "has_body_flag": {"type": ["null", "integer"]}, + "sent_flag": {"type": ["null", "integer"]}, + "sent_from_pipedrive_flag": {"type": ["null", "integer"]}, + "smart_bcc_flag": {"type": ["null", "integer"]}, + "message_time": {"type": ["null", "string"], "format": "date-time"}, + "add_time": {"type": ["null", "string"], "format": "date-time"}, + "update_time": {"type": ["null", "string"], "format": "date-time"}, + "has_attachments_flag": {"type": ["null", "integer"]}, + "has_inline_attachments_flag": {"type": ["null", "integer"]}, + "has_real_attachments_flag": {"type": ["null", "integer"]} + } +} \ No newline at end of file