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 62daadc7e336..cca6dc9684b3 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -660,6 +660,13 @@ icon: mailchimp.svg sourceType: api releaseStage: generally_available +- name: MailerLite + sourceDefinitionId: dc3b9003-2432-4e93-a7f4-4620b0f14674 + dockerRepository: airbyte/source-mailerlite + dockerImageTag: 0.1.0 + documentationUrl: https://docs.airbyte.com/integrations/sources/mailerlite + sourceType: api + releaseStage: alpha - name: Mailgun sourceDefinitionId: 5b9cb09e-1003-4f9c-983d-5779d1b2cd51 dockerRepository: airbyte/source-mailgun 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 21ff56090cf0..d421eddce129 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -6411,6 +6411,25 @@ path_in_connector_config: - "credentials" - "client_secret" +- dockerImage: "airbyte/source-mailerlite:0.1.0" + spec: + documentationUrl: "https://docs.airbyte.com/integrations/sources/mailerlite" + connectionSpecification: + $schema: "http://json-schema.org/draft-07/schema#" + title: "Mailerlite Spec" + type: "object" + required: + - "api_token" + additionalProperties: true + properties: + api_token: + type: "string" + description: "Your API Token. See here." + airbyte_secret: true + supportsNormalization: false + supportsDBT: false + supported_destination_sync_modes: [] - dockerImage: "airbyte/source-mailgun:0.1.0" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/mailgun" diff --git a/airbyte-integrations/connectors/source-mailerlite/.dockerignore b/airbyte-integrations/connectors/source-mailerlite/.dockerignore new file mode 100644 index 000000000000..50fb533d4521 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/.dockerignore @@ -0,0 +1,6 @@ +* +!Dockerfile +!main.py +!source_mailerlite +!setup.py +!secrets diff --git a/airbyte-integrations/connectors/source-mailerlite/Dockerfile b/airbyte-integrations/connectors/source-mailerlite/Dockerfile new file mode 100644 index 000000000000..07a11b787733 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/Dockerfile @@ -0,0 +1,38 @@ +FROM python:3.9.11-alpine3.15 as base + +# build and load all requirements +FROM base as builder +WORKDIR /airbyte/integration_code + +# upgrade pip to the latest version +RUN apk --no-cache upgrade \ + && pip install --upgrade pip \ + && apk --no-cache add tzdata build-base + + +COPY setup.py ./ +# install necessary packages to a temporary folder +RUN pip install --prefix=/install . + +# build a clean environment +FROM base +WORKDIR /airbyte/integration_code + +# copy all loaded and built libraries to a pure basic image +COPY --from=builder /install /usr/local +# add default timezone settings +COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime +RUN echo "Etc/UTC" > /etc/timezone + +# bash is installed for more convenient debugging. +RUN apk --no-cache add bash + +# copy payload code only +COPY main.py ./ +COPY source_mailerlite ./source_mailerlite + +ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" +ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] + +LABEL io.airbyte.version=0.1.0 +LABEL io.airbyte.name=airbyte/source-mailerlite diff --git a/airbyte-integrations/connectors/source-mailerlite/README.md b/airbyte-integrations/connectors/source-mailerlite/README.md new file mode 100644 index 000000000000..eae17dff484c --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/README.md @@ -0,0 +1,79 @@ +# Mailerlite Source + +This is the repository for the Mailerlite configuration based source connector. +For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/mailerlite). + +## Local development + +#### Building via Gradle +You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow. + +To build using Gradle, from the Airbyte repository root, run: +``` +./gradlew :airbyte-integrations:connectors:source-mailerlite:build +``` + +#### Create credentials +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/mailerlite) +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_mailerlite/spec.yaml` file. +Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. +See `integration_tests/sample_config.json` for a sample config file. + +**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source mailerlite test creds` +and place them into `secrets/config.json`. + +### Locally running the connector docker image + +#### Build +First, make sure you build the latest Docker image: +``` +docker build . -t airbyte/source-mailerlite:dev +``` + +You can also build the connector image via Gradle: +``` +./gradlew :airbyte-integrations:connectors:source-mailerlite:airbyteDocker +``` +When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in +the Dockerfile. + +#### Run +Then run any of the connector commands as follows: +``` +docker run --rm airbyte/source-mailerlite:dev spec +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-mailerlite:dev check --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-mailerlite:dev discover --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-mailerlite:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json +``` +## Testing + +#### Acceptance Tests +Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information. +If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py. + +To run your integration tests with docker + +### Using gradle to run tests +All commands should be run from airbyte project root. +To run unit tests: +``` +./gradlew :airbyte-integrations:connectors:source-mailerlite:unitTest +``` +To run acceptance and custom integration tests: +``` +./gradlew :airbyte-integrations:connectors:source-mailerlite:integrationTest +``` + +## Dependency Management +All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development. +We split dependencies between two groups, dependencies that are: +* required for your connector to work need to go to `MAIN_REQUIREMENTS` list. +* required for the testing need to go to `TEST_REQUIREMENTS` list + +### Publishing a new version of the connector +You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? +1. Make sure your changes are passing unit and integration tests. +1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)). +1. Create a Pull Request. +1. Pat yourself on the back for being an awesome contributor. +1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master. diff --git a/airbyte-integrations/connectors/source-mailerlite/__init__.py b/airbyte-integrations/connectors/source-mailerlite/__init__.py new file mode 100644 index 000000000000..1100c1c58cf5 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# diff --git a/airbyte-integrations/connectors/source-mailerlite/acceptance-test-config.yml b/airbyte-integrations/connectors/source-mailerlite/acceptance-test-config.yml new file mode 100644 index 000000000000..2ceeef4ebece --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/acceptance-test-config.yml @@ -0,0 +1,30 @@ +# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference) +# for more information about how to configure these tests +connector_image: airbyte/source-mailerlite:dev +tests: + spec: + - spec_path: "source_mailerlite/spec.yaml" + connection: + - config_path: "secrets/config.json" + status: "succeed" + - config_path: "integration_tests/invalid_config.json" + status: "failed" + discovery: + - config_path: "secrets/config.json" + basic_read: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" + empty_streams: [] + # TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file + # expect_records: + # path: "integration_tests/expected_records.txt" + # extra_fields: no + # exact_order: no + # extra_records: yes + # incremental: # TODO if your connector does not implement incremental sync, remove this block + # - config_path: "secrets/config.json" + # configured_catalog_path: "integration_tests/configured_catalog.json" + # future_state_path: "integration_tests/abnormal_state.json" + full_refresh: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-mailerlite/acceptance-test-docker.sh b/airbyte-integrations/connectors/source-mailerlite/acceptance-test-docker.sh new file mode 100644 index 000000000000..c51577d10690 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/acceptance-test-docker.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +# Build latest connector image +docker build . -t $(cat acceptance-test-config.yml | grep "connector_image" | head -n 1 | cut -d: -f2-) + +# Pull latest acctest image +docker pull airbyte/source-acceptance-test:latest + +# Run +docker run --rm -it \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /tmp:/tmp \ + -v $(pwd):/test_input \ + airbyte/source-acceptance-test \ + --acceptance-test-config /test_input + diff --git a/airbyte-integrations/connectors/source-mailerlite/build.gradle b/airbyte-integrations/connectors/source-mailerlite/build.gradle new file mode 100644 index 000000000000..eb5cc9daee14 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'airbyte-python' + id 'airbyte-docker' + id 'airbyte-source-acceptance-test' +} + +airbytePython { + moduleDirectory 'source_mailerlite' +} diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/__init__.py b/airbyte-integrations/connectors/source-mailerlite/integration_tests/__init__.py new file mode 100644 index 000000000000..1100c1c58cf5 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-mailerlite/integration_tests/abnormal_state.json new file mode 100644 index 000000000000..52b0f2c2118f --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/abnormal_state.json @@ -0,0 +1,5 @@ +{ + "todo-stream-name": { + "todo-field-name": "todo-abnormal-value" + } +} diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/acceptance.py b/airbyte-integrations/connectors/source-mailerlite/integration_tests/acceptance.py new file mode 100644 index 000000000000..1302b2f57e10 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/acceptance.py @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +import pytest + +pytest_plugins = ("source_acceptance_test.plugin",) + + +@pytest.fixture(scope="session", autouse=True) +def connector_setup(): + """This fixture is a placeholder for external resources that acceptance test might require.""" + # TODO: setup test dependencies if needed. otherwise remove the TODO comments + yield + # TODO: clean up test dependencies diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-mailerlite/integration_tests/configured_catalog.json new file mode 100644 index 000000000000..84ad8862b8e5 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/configured_catalog.json @@ -0,0 +1,76 @@ +{ + "streams": [ + { + "stream": { + "name": "subscribers", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "segments", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "campaigns", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "automations", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "timezones", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "forms_popup", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "forms_embedded", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "forms_promotion", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + } + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/invalid_config.json b/airbyte-integrations/connectors/source-mailerlite/integration_tests/invalid_config.json new file mode 100644 index 000000000000..871a8395c5c5 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/invalid_config.json @@ -0,0 +1,3 @@ +{ + "api_token": "" +} diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/sample_config.json b/airbyte-integrations/connectors/source-mailerlite/integration_tests/sample_config.json new file mode 100644 index 000000000000..5d547f94643e --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/sample_config.json @@ -0,0 +1,3 @@ +{ + "api_token": "" +} diff --git a/airbyte-integrations/connectors/source-mailerlite/integration_tests/sample_state.json b/airbyte-integrations/connectors/source-mailerlite/integration_tests/sample_state.json new file mode 100644 index 000000000000..3587e579822d --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/integration_tests/sample_state.json @@ -0,0 +1,5 @@ +{ + "todo-stream-name": { + "todo-field-name": "value" + } +} diff --git a/airbyte-integrations/connectors/source-mailerlite/main.py b/airbyte-integrations/connectors/source-mailerlite/main.py new file mode 100644 index 000000000000..58a60c98140b --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/main.py @@ -0,0 +1,13 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +import sys + +from airbyte_cdk.entrypoint import launch +from source_mailerlite import SourceMailerlite + +if __name__ == "__main__": + source = SourceMailerlite() + launch(source, sys.argv[1:]) diff --git a/airbyte-integrations/connectors/source-mailerlite/requirements.txt b/airbyte-integrations/connectors/source-mailerlite/requirements.txt new file mode 100644 index 000000000000..0411042aa091 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/requirements.txt @@ -0,0 +1,2 @@ +-e ../../bases/source-acceptance-test +-e . diff --git a/airbyte-integrations/connectors/source-mailerlite/setup.py b/airbyte-integrations/connectors/source-mailerlite/setup.py new file mode 100644 index 000000000000..705801cb0329 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/setup.py @@ -0,0 +1,29 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +from setuptools import find_packages, setup + +MAIN_REQUIREMENTS = [ + "airbyte-cdk~=0.1", +] + +TEST_REQUIREMENTS = [ + "pytest~=6.1", + "pytest-mock~=3.6.1", + "source-acceptance-test", +] + +setup( + name="source_mailerlite", + description="Source implementation for Mailerlite.", + author="Airbyte", + author_email="contact@airbyte.io", + packages=find_packages(), + install_requires=MAIN_REQUIREMENTS, + package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]}, + extras_require={ + "tests": TEST_REQUIREMENTS, + }, +) diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/__init__.py b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/__init__.py new file mode 100644 index 000000000000..2176a697b86a --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/__init__.py @@ -0,0 +1,8 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +from .source import SourceMailerlite + +__all__ = ["SourceMailerlite"] diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/mailerlite.yaml b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/mailerlite.yaml new file mode 100644 index 000000000000..a82887180375 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/mailerlite.yaml @@ -0,0 +1,150 @@ +version: "0.1.0" + +definitions: + selector: + extractor: + field_pointer: ["data"] + + requester: + url_base: "https://connect.mailerlite.com/api" + http_method: "GET" + authenticator: + type: BearerAuthenticator + api_token: "{{ config['api_token'] }}" + + increment_paginator: + type: "DefaultPaginator" + url_base: "*ref(definitions.requester.url_base)" + page_size_option: + inject_into: "request_parameter" + field_name: "limit" + pagination_strategy: + type: "PageIncrement" + page_size: 25 + page_token_option: + inject_into: "request_parameter" + field_name: "page" + + retriever: + record_selector: + $ref: "*ref(definitions.selector)" + paginator: + type: NoPagination + requester: + $ref: "*ref(definitions.requester)" + + base_stream: + retriever: + $ref: "*ref(definitions.retriever)" + + # STREAMS + # API Docs: https://developers.mailerlite.com/docs/subscribers.html + subscribers_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "subscribers" + primary_key: "id" + path: "/subscribers" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + + # API Docs: https://developers.mailerlite.com/docs/segments.html + segments_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "segments" + primary_key: "id" + path: "/segments" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + pagination_strategy: + type: "PageIncrement" + page_size: 50 + + # API Docs: https://developers.mailerlite.com/docs/automations.html + automations_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "automations" + primary_key: "id" + path: "/automations" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + pagination_strategy: + type: "PageIncrement" + page_size: 10 + + # API Docs: https://developers.mailerlite.com/docs/campaigns.html + campaigns_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "campaigns" + primary_key: "id" + path: "/campaigns" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + + # API Docs: https://developers.mailerlite.com/docs/timezones.html + timezones_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "timezones" + primary_key: "id" + path: "/timezones" + + # API Docs: https://developers.mailerlite.com/docs/forms.html + forms_popup_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "forms_popup" + primary_key: "id" + path: "/forms/popup" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + + # API Docs: https://developers.mailerlite.com/docs/forms.html + forms_embedded_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "forms_embedded" + primary_key: "id" + path: "/forms/embedded" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + + # API Docs: https://developers.mailerlite.com/docs/forms.html + forms_promotion_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "forms_promotion" + primary_key: "id" + path: "/forms/promotion" + retriever: + $ref: "*ref(definitions.retriever)" + paginator: + $ref: "*ref(definitions.increment_paginator)" + +streams: + - "*ref(definitions.subscribers_stream)" + - "*ref(definitions.segments_stream)" + - "*ref(definitions.automations_stream)" + - "*ref(definitions.campaigns_stream)" + - "*ref(definitions.timezones_stream)" + - "*ref(definitions.forms_popup_stream)" + - "*ref(definitions.forms_embedded_stream)" + - "*ref(definitions.forms_promotion_stream)" + +check: + stream_names: ["timezones"] diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/automations.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/automations.json new file mode 100644 index 000000000000..c7cf008c2d0b --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/automations.json @@ -0,0 +1,559 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "trigger_data": { + "type": "object", + "properties": { + "track_ecommerce": { + "type": "boolean" + }, + "repeatable": { + "type": "boolean" + }, + "group_id": { + "type": "integer" + }, + "exclude_group_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "valid": { + "type": "boolean" + } + }, + "required": ["valid"] + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "parent_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "from": { + "type": "string" + }, + "from_name": { + "type": "string" + }, + "email_id": { + "type": "string" + }, + "email": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "account_id": { + "type": "string" + }, + "emailable_id": { + "type": "string" + }, + "emailable_type": { + "type": "string" + }, + "type": { + "type": "string" + }, + "from": { + "type": "string" + }, + "from_name": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "plain_text": { + "type": ["string", "null"] + }, + "screenshot_url": { + "type": ["string", "null"] + }, + "preview_url": { + "type": ["string", "null"] + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "is_designed": { + "type": "boolean" + }, + "language_id": { + "type": "integer" + }, + "is_winner": { + "type": "boolean" + }, + "stats": { + "type": "object", + "properties": { + "sent": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "unique_opens_count": { + "type": "integer" + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "clicks_count": { + "type": "integer" + }, + "unique_clicks_count": { + "type": "integer" + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "unsubscribes_count": { + "type": "integer" + }, + "unsubscribe_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "spam_count": { + "type": "integer" + }, + "spam_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "hard_bounces_count": { + "type": "integer" + }, + "hard_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "soft_bounces_count": { + "type": "integer" + }, + "soft_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "forwards_count": { + "type": "integer" + } + }, + "required": [ + "sent", + "opens_count", + "unique_opens_count", + "open_rate", + "clicks_count", + "unique_clicks_count", + "click_rate", + "unsubscribes_count", + "unsubscribe_rate", + "spam_count", + "spam_rate", + "hard_bounces_count", + "hard_bounce_rate", + "soft_bounces_count", + "soft_bounce_rate", + "forwards_count" + ] + }, + "send_after": { + "type": ["string", "null"] + }, + "track_opens": { + "type": "boolean" + } + }, + "required": [ + "id", + "account_id", + "emailable_id", + "emailable_type", + "type", + "from", + "from_name", + "name", + "subject", + "plain_text", + "screenshot_url", + "preview_url", + "created_at", + "updated_at", + "is_designed", + "language_id", + "is_winner", + "stats", + "send_after", + "track_opens" + ] + }, + "language_id": { + "type": "integer" + }, + "complete": { + "type": "boolean" + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "track_opens": { + "type": "boolean" + }, + "google_analytics": { + "type": ["string", "null"] + }, + "tracking_was_disabled": { + "type": "boolean" + }, + "description": { + "type": "string" + } + }, + "required": ["id"] + } + }, + "triggers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "group": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": ["string", "null"] + } + }, + "required": ["id", "name", "url"] + }, + "exclude_group_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "excluded_groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "broken": { + "type": "boolean" + } + }, + "required": [ + "id", + "type", + "group_id", + "group", + "exclude_group_ids", + "excluded_groups", + "broken" + ] + } + }, + "complete": { + "type": "boolean" + }, + "broken": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "emails_count": { + "type": "integer" + }, + "first_email_screenshot_url": { + "type": ["string", "null"] + }, + "stats": { + "type": "object", + "properties": { + "completed_subscribers_count": { + "type": "integer" + }, + "subscribers_in_queue_count": { + "type": "integer" + }, + "bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "click_to_open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "sent": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "unique_opens_count": { + "type": ["integer", "null"] + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "clicks_count": { + "type": "integer" + }, + "unique_clicks_count": { + "type": ["integer", "null"] + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "unsubscribes_count": { + "type": "integer" + }, + "unsubscribe_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "spam_count": { + "type": "integer" + }, + "spam_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "hard_bounces_count": { + "type": "integer" + }, + "hard_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "soft_bounces_count": { + "type": "integer" + }, + "soft_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + } + }, + "required": [ + "completed_subscribers_count", + "subscribers_in_queue_count", + "bounce_rate", + "click_to_open_rate", + "sent", + "opens_count", + "unique_opens_count", + "open_rate", + "clicks_count", + "unique_clicks_count", + "click_rate", + "unsubscribes_count", + "unsubscribe_rate", + "spam_count", + "spam_rate", + "hard_bounces_count", + "hard_bounce_rate", + "soft_bounces_count", + "soft_bounce_rate" + ] + }, + "created_at": { + "type": "string" + }, + "has_banned_content": { + "type": "boolean" + }, + "qualified_subscribers_count": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "enabled", + "trigger_data", + "steps", + "triggers", + "complete", + "broken", + "warnings", + "emails_count", + "first_email_screenshot_url", + "stats", + "created_at", + "has_banned_content", + "qualified_subscribers_count" + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/campaigns.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/campaigns.json new file mode 100644 index 000000000000..b6ad9a125a0c --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/campaigns.json @@ -0,0 +1,567 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "integer" + }, + "account_id": { + "type": "string", + "format": "integer" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "status": { + "type": "string" + }, + "missing_data": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "type": "object", + "properties": { + "track_opens": { + "type": "string", + "format": "integer" + }, + "use_google_analytics": { + "type": "string", + "format": "integer" + }, + "ecommerce_tracking": { + "type": "string", + "format": "integer" + } + }, + "required": ["ecommerce_tracking", "track_opens", "use_google_analytics"] + }, + "filter": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "operator": { + "type": "string" + }, + "args": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string", + "format": "integer" + } + }, + { + "type": "string" + } + ] + } + } + }, + "required": ["args", "operator"] + } + } + }, + "filter_for_humans": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "delivery_schedule": { + "type": "string" + }, + "language_id": { + "type": "string", + "format": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "scheduled_for": { + "type": "string", + "format": "date-time" + }, + "queued_at": { + "type": ["string", "null"], + "format": "date-time" + }, + "started_at": { + "type": ["string", "null"], + "format": "date-time" + }, + "finished_at": { + "type": ["string", "null"], + "format": "date-time" + }, + "stopped_at": { + "type": ["string", "null"] + }, + "default_email_id": { + "type": "string" + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "integer" + }, + "account_id": { + "type": "string", + "format": "integer" + }, + "emailable_id": { + "type": "string", + "format": "integer" + }, + "emailable_type": { + "type": "string" + }, + "type": { + "type": "string" + }, + "from": { + "type": "string" + }, + "from_name": { + "type": "string" + }, + "name": { + "type": ["string", "null"] + }, + "subject": { + "type": "string" + }, + "plain_text": { + "type": "string" + }, + "screenshot_url": { + "type": ["string", "null"] + }, + "preview_url": { + "type": ["string", "null"] + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "is_designed": { + "type": "boolean" + }, + "language_id": { + "type": ["integer", "null"] + }, + "is_winner": { + "type": "boolean" + }, + "stats": { + "type": "object", + "properties": { + "sent": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "unique_opens_count": { + "type": "integer" + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "clicks_count": { + "type": "integer" + }, + "unique_clicks_count": { + "type": "integer" + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "unsubscribes_count": { + "type": "integer" + }, + "unsubscribe_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "spam_count": { + "type": "integer" + }, + "spam_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "hard_bounces_count": { + "type": "integer" + }, + "hard_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "soft_bounces_count": { + "type": "integer" + }, + "soft_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "forwards_count": { + "type": "integer" + }, + "click_to_open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + } + }, + "required": [ + "click_rate", + "clicks_count", + "forwards_count", + "hard_bounce_rate", + "hard_bounces_count", + "open_rate", + "opens_count", + "sent", + "soft_bounce_rate", + "soft_bounces_count", + "spam_count", + "spam_rate", + "unique_clicks_count", + "unique_opens_count", + "unsubscribe_rate", + "unsubscribes_count" + ] + }, + "send_after": { + "type": ["string", "null"] + }, + "track_opens": { + "type": "boolean" + } + }, + "required": [ + "account_id", + "created_at", + "emailable_id", + "emailable_type", + "from", + "from_name", + "id", + "is_designed", + "is_winner", + "language_id", + "name", + "plain_text", + "preview_url", + "screenshot_url", + "send_after", + "stats", + "subject", + "track_opens", + "type", + "updated_at" + ] + } + }, + "used_in_automations": { + "type": "boolean" + }, + "type_for_humans": { + "type": "string" + }, + "stats": { + "type": "object", + "properties": { + "sent": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "unique_opens_count": { + "type": "integer" + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "clicks_count": { + "type": "integer" + }, + "unique_clicks_count": { + "type": "integer" + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "unsubscribes_count": { + "type": "integer" + }, + "unsubscribe_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "spam_count": { + "type": "integer" + }, + "spam_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "hard_bounces_count": { + "type": "integer" + }, + "hard_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "soft_bounces_count": { + "type": "integer" + }, + "soft_bounce_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "forwards_count": { + "type": "integer" + }, + "click_to_open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + } + }, + "required": [ + "click_rate", + "clicks_count", + "forwards_count", + "hard_bounce_rate", + "hard_bounces_count", + "open_rate", + "opens_count", + "sent", + "soft_bounce_rate", + "soft_bounces_count", + "spam_count", + "spam_rate", + "unique_clicks_count", + "unique_opens_count", + "unsubscribe_rate", + "unsubscribes_count" + ] + }, + "is_stopped": { + "type": "boolean" + }, + "has_winner": { + "type": ["string", "null"] + }, + "winner_version_for_human": { + "type": ["string", "null"] + }, + "winner_sending_time_for_humans": { + "type": ["string", "null"] + }, + "winner_selected_manually_at": { + "type": ["string", "null"] + }, + "uses_ecommerce": { + "type": "boolean" + }, + "uses_survey": { + "type": "boolean" + }, + "can_be_scheduled": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "initial_created_at": { + "type": ["string", "null"] + }, + "is_currently_sending_out": { + "type": "boolean" + } + }, + "required": [ + "account_id", + "can_be_scheduled", + "created_at", + "default_email_id", + "delivery_schedule", + "emails", + "filter", + "filter_for_humans", + "finished_at", + "has_winner", + "id", + "initial_created_at", + "is_currently_sending_out", + "is_stopped", + "language_id", + "missing_data", + "name", + "queued_at", + "scheduled_for", + "settings", + "started_at", + "status", + "stopped_at", + "type", + "type_for_humans", + "updated_at", + "used_in_automations", + "uses_ecommerce", + "uses_survey", + "warnings", + "winner_selected_manually_at", + "winner_sending_time_for_humans", + "winner_version_for_human" + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_embedded.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_embedded.json new file mode 100644 index 000000000000..0a9a1749a10e --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_embedded.json @@ -0,0 +1,191 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "conversions_count": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "conversion_rate": { + "type": "object", + "properties": { + "float": { + "type": "integer" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "settings": { + "type": "object", + "properties": { + "double_optin": { + "type": "boolean" + }, + "groot_id": { + "type": "integer" + } + }, + "required": ["double_optin", "groot_id"] + }, + "last_registration_at": { + "type": ["null", "string"] + }, + "active": { + "type": "boolean" + }, + "is_broken": { + "type": "boolean" + }, + "has_content": { + "type": "boolean" + }, + "can": { + "type": "object", + "properties": { + "update": { + "type": "boolean" + } + }, + "required": ["update"] + }, + "used_in_automations": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "double_optin": { + "type": "boolean" + }, + "screenshot_url": { + "type": "string" + }, + "has_missing_groups": { + "type": "boolean" + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "active_count": { + "type": "integer" + }, + "sent_count": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "clicks_count": { + "type": "integer" + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "unsubscribed_count": { + "type": "integer" + }, + "unconfirmed_count": { + "type": "integer" + }, + "bounced_count": { + "type": "integer" + }, + "junk_count": { + "type": "integer" + }, + "created_at": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "active_count", + "sent_count", + "opens_count", + "open_rate", + "clicks_count", + "click_rate", + "unsubscribed_count", + "unconfirmed_count", + "bounced_count", + "junk_count", + "created_at" + ] + } + } + }, + "required": [ + "id", + "type", + "slug", + "name", + "created_at", + "conversions_count", + "opens_count", + "conversion_rate", + "settings", + "last_registration_at", + "active", + "is_broken", + "has_content", + "can", + "used_in_automations", + "warnings", + "double_optin", + "screenshot_url", + "has_missing_groups", + "groups" + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_popup.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_popup.json new file mode 100644 index 000000000000..fa12ba28badc --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_popup.json @@ -0,0 +1,245 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "conversions_count": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "conversion_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "settings": { + "type": "object", + "properties": { + "double_optin": { + "type": "boolean" + }, + "groot_id": { + "type": "integer" + }, + "form_type": { + "type": "string" + }, + "triggers": { + "type": "array", + "items": { + "type": "string" + } + }, + "timeout_seconds": { + "type": "integer" + }, + "scroll_percentage": { + "type": "integer" + }, + "frequency": { + "type": "integer" + }, + "frequency_unit": { + "type": "string" + }, + "visibility": { + "type": "string" + }, + "url_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "url_list_strict": { + "type": ["null", "string"] + }, + "hide_on": { + "type": "array", + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string" + } + }, + "required": [ + "double_optin", + "groot_id", + "form_type", + "triggers", + "timeout_seconds", + "scroll_percentage", + "frequency", + "frequency_unit", + "visibility", + "url_list", + "url_list_strict", + "hide_on", + "schedule" + ] + }, + "last_registration_at": { + "type": ["string", "null"] + }, + "active": { + "type": "boolean" + }, + "is_broken": { + "type": "boolean" + }, + "has_content": { + "type": "boolean" + }, + "can": { + "type": "object", + "properties": { + "update": { + "type": "boolean" + } + }, + "required": ["update"] + }, + "used_in_automations": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "double_optin": { + "type": ["boolean", "null"] + }, + "screenshot_url": { + "type": ["string", "null"] + }, + "has_missing_groups": { + "type": "boolean" + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "active_count": { + "type": "integer" + }, + "sent_count": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "integer" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "clicks_count": { + "type": "integer" + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "integer" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "unsubscribed_count": { + "type": "integer" + }, + "unconfirmed_count": { + "type": "integer" + }, + "bounced_count": { + "type": "integer" + }, + "junk_count": { + "type": "integer" + }, + "created_at": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "active_count", + "sent_count", + "opens_count", + "open_rate", + "clicks_count", + "click_rate", + "unsubscribed_count", + "unconfirmed_count", + "bounced_count", + "junk_count", + "created_at" + ] + } + } + }, + "required": [ + "id", + "type", + "slug", + "name", + "created_at", + "conversions_count", + "opens_count", + "conversion_rate", + "settings", + "last_registration_at", + "active", + "is_broken", + "has_content", + "can", + "used_in_automations", + "warnings", + "double_optin", + "screenshot_url" + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_promotion.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_promotion.json new file mode 100644 index 000000000000..501d8d238114 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/forms_promotion.json @@ -0,0 +1,185 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "conversions_count": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "conversion_rate": { + "type": "object", + "properties": { + "float": { + "type": "integer" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "settings": { + "type": "object", + "properties": { + "groot_id": { + "type": "integer" + }, + "form_type": { + "type": "string" + }, + "triggers": { + "type": "array", + "items": { + "type": "string" + } + }, + "timeout_seconds": { + "type": "integer" + }, + "scroll_percentage": { + "type": "integer" + }, + "frequency": { + "type": "integer" + }, + "frequency_unit": { + "type": "string" + }, + "visibility": { + "type": "string" + }, + "url_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "url_list_strict": { + "type": ["array", "null"], + "items": { + "type": "string" + } + }, + "hide_on": { + "type": "array", + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string" + }, + "schedule_from": { + "type": "string" + }, + "schedule_until": { + "type": "string" + }, + "schedule_timezone_id": { + "type": "string" + } + }, + "required": [ + "groot_id", + "form_type", + "triggers", + "timeout_seconds", + "scroll_percentage", + "frequency", + "frequency_unit", + "visibility", + "url_list", + "url_list_strict", + "hide_on", + "schedule", + "schedule_from", + "schedule_until", + "schedule_timezone_id" + ] + }, + "last_registration_at": { + "type": ["string", "null"] + }, + "active": { + "type": "boolean" + }, + "is_broken": { + "type": "boolean" + }, + "has_content": { + "type": "boolean" + }, + "can": { + "type": "object", + "properties": { + "update": { + "type": "boolean" + } + }, + "required": ["update"] + }, + "used_in_automations": { + "type": "boolean" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "double_optin": { + "type": ["string", "null"] + }, + "screenshot_url": { + "type": "string" + }, + "has_missing_groups": { + "type": "boolean" + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "type", + "slug", + "name", + "created_at", + "conversions_count", + "opens_count", + "conversion_rate", + "settings", + "last_registration_at", + "active", + "is_broken", + "has_content", + "can", + "used_in_automations", + "warnings", + "double_optin", + "screenshot_url", + "has_missing_groups", + "groups" + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/segments.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/segments.json new file mode 100644 index 000000000000..c743d2b7d085 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/segments.json @@ -0,0 +1,42 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "total": { + "type": "integer" + }, + "open_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "click_rate": { + "type": "object", + "properties": { + "float": { + "type": "number" + }, + "string": { + "type": "string" + } + }, + "required": ["float", "string"] + }, + "created_at": { + "type": "string" + } + }, + "required": ["id", "name", "total", "open_rate", "click_rate", "created_at"] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/subscribers.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/subscribers.json new file mode 100644 index 000000000000..160b5ae38e96 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/subscribers.json @@ -0,0 +1,111 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "status": { + "type": "string" + }, + "source": { + "type": "string" + }, + "sent": { + "type": "integer" + }, + "opens_count": { + "type": "integer" + }, + "clicks_count": { + "type": "integer" + }, + "open_rate": { + "type": "integer" + }, + "click_rate": { + "type": "integer" + }, + "ip_address": { + "type": ["string", "null"] + }, + "subscribed_at": { + "type": "string" + }, + "unsubscribed_at": { + "type": ["string", "null"] + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "fields": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "last_name": { + "type": ["string", "null"] + }, + "company": { + "type": ["string", "null"] + }, + "country": { + "type": ["string", "null"] + }, + "city": { + "type": ["string", "null"] + }, + "phone": { + "type": ["string", "null"] + }, + "state": { + "type": ["string", "null"] + }, + "z_i_p": { + "type": ["string", "null"] + } + }, + "required": [ + "name", + "last_name", + "company", + "country", + "city", + "phone", + "state", + "z_i_p" + ] + }, + "opted_in_at": { + "type": ["string", "null"] + }, + "optin_ip": { + "type": ["string", "null"] + } + }, + "required": [ + "id", + "email", + "status", + "source", + "sent", + "opens_count", + "clicks_count", + "open_rate", + "click_rate", + "ip_address", + "subscribed_at", + "unsubscribed_at", + "created_at", + "updated_at", + "fields", + "opted_in_at", + "optin_ip" + ] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/timezones.json b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/timezones.json new file mode 100644 index 000000000000..5d05b42913c3 --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/schemas/timezones.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "name_for_humans": { + "type": "string" + }, + "offset_name": { + "type": "string" + }, + "offset": { + "type": "integer" + } + }, + "required": ["id", "name", "name_for_humans", "offset_name", "offset"] +} diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/source.py b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/source.py new file mode 100644 index 000000000000..fc42b3678c9b --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/source.py @@ -0,0 +1,18 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + +from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource + +""" +This file provides the necessary constructs to interpret a provided declarative YAML configuration file into +source connector. + +WARNING: Do not modify this file. +""" + + +# Declarative Source +class SourceMailerlite(YamlDeclarativeSource): + def __init__(self): + super().__init__(**{"path_to_yaml": "mailerlite.yaml"}) diff --git a/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/spec.yaml b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/spec.yaml new file mode 100644 index 000000000000..0e54f5173f2f --- /dev/null +++ b/airbyte-integrations/connectors/source-mailerlite/source_mailerlite/spec.yaml @@ -0,0 +1,13 @@ +documentationUrl: https://docs.airbyte.com/integrations/sources/mailerlite +connectionSpecification: + $schema: http://json-schema.org/draft-07/schema# + title: Mailerlite Spec + type: object + required: + - api_token + additionalProperties: true + properties: + api_token: + type: string + description: Your API Token. See here. + airbyte_secret: true diff --git a/docs/integrations/README.md b/docs/integrations/README.md index b81b6a10c8b2..11ba90803f8d 100644 --- a/docs/integrations/README.md +++ b/docs/integrations/README.md @@ -100,6 +100,7 @@ For more information about the grading system, see [Product Release Stages](http | [Looker](sources/looker.md) | Alpha | Yes | | [Magento](sources/magento.md) | Alpha | No | | [Mailchimp](sources/mailchimp.md) | Generally Available | Yes | +| [Mailerlite](sources/mailerlite.md) | Alpha | No | | [Marketo](sources/marketo.md) | Generally Available | Yes | | [Metabase](sources/metabase.md) | Alpha | Yes | | [Microsoft Dynamics AX](sources/microsoft-dynamics-ax.md) | Alpha | No | diff --git a/docs/integrations/sources/mailerlite.md b/docs/integrations/sources/mailerlite.md new file mode 100644 index 000000000000..2e192db53de6 --- /dev/null +++ b/docs/integrations/sources/mailerlite.md @@ -0,0 +1,39 @@ +# ActiveCampaign + +## Sync overview + +This source can sync data from the [MailerLite API](https://developers.mailerlite.com/docs/#mailerlite-api). At present this connector only supports full refresh syncs meaning that each time you use the connector it will sync all available records from scratch. Please use cautiously if you expect your API to have a lot of records. + +## This Source Supports the Following Streams + +* campaigns +* subscribers +* automations +* timezones +* segments +* forms_popup +* forms_embedded +* forms_promotion + +### Features + +| Feature | Supported?\(Yes/No\) | Notes | +| :--- | :--- | :--- | +| Full Refresh Sync | Yes | | +| Incremental Sync | No | | + +### Performance considerations + +MailerLite API has a global rate limit of 120 requests per minute. + +## Getting started + +### Requirements + +* MailerLite API Key + +## Changelog + +| Version | Date | Pull Request | Subject | +| :------ | :--------- | :------------------------------------------------------- | :------------- | +| 0.1.0 | 2022-10-25 | [18336](https://github.com/airbytehq/airbyte/pull/18336) | Initial commit |