Add Activepieces integration for workflow automation

- Add Activepieces fork with SmoothSchedule custom piece
- Create integrations app with Activepieces service layer
- Add embed token endpoint for iframe integration
- Create Automations page with embedded workflow builder
- Add sidebar visibility fix for embed mode
- Add list inactive customers endpoint to Public API
- Include SmoothSchedule triggers: event created/updated/cancelled
- Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Open-Source-Marketing-Automationssoftware",
"Base URL": "Basis-URL",
"Username": "Benutzername",
"Password": "Kennwort",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFolgen Sie diesen Schritten:\n\n1. **Geben Sie die Basis-URL ein:** Öffnen Sie Ihre Mautiker-Instanz und kopieren Sie die URL aus der Adressleiste. Wenn Ihr Dashboard-Link \"https://mautic.ddev.site/s/dashboard\" ist, setzen Sie Ihre Basis-URL als \"https://mautic. dev.site/\".\n\n2. **Authentifizierung aktivieren:** Bei Mautic anmelden, gehen Sie zu **Einstellungen** > **Konfiguration** > **API-Einstellungen**, und stellen Sie sicher, dass die grundlegende Authentifizierung aktiviert ist.\n\n",
"Create Contact": "Kontakt erstellen",
"Search Contact": "Kontakt suchen",
"Update Contact With Contact Id": "Kontakt mit Kontakt-Id aktualisieren",
"Create Company": "Firma erstellen",
"Search Company": "Firma suchen",
"Update Company With Contact Id": "Firma mit Kontakt-Id aktualisieren",
"Custom API Call": "Eigener API-Aufruf",
"Creates a new contact in Mautic CRM": "Erstellt einen neuen Kontakt in Mautic CRM",
"Search for a contact in Mautic CRM": "Suche nach einem Kontakt in Mautic CRM",
"Update a contact in Mautic CRM": "Kontakt in Mautic CRM aktualisieren",
"Creates a new company in Mautic CRM": "Erstellt ein neues Unternehmen in Mautic CRM",
"Search for a company in Mautic CRM": "Suche nach einem Unternehmen in Mautic CRM",
"Update a company in Mautic CRM": "Unternehmen in Mautic CRM aktualisieren",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"All Fields": "Alle Felder",
"Id of the entity": "Id der Entität",
"Method": "Methode",
"Headers": "Kopfzeilen",
"Query Parameters": "Abfrageparameter",
"Body": "Körper",
"Response is Binary ?": "Antwort ist binär?",
"No Error on Failure": "Kein Fehler bei Fehler",
"Timeout (in seconds)": "Timeout (in Sekunden)",
"List of all possible fields present": "Liste aller vorhandenen Felder",
"Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
"Enable for files like PDFs, images, etc..": "Aktivieren für Dateien wie PDFs, Bilder, etc..",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD",
"Contact Updated": "Kontakt aktualisiert",
"Contact Company Subscription Change": "Änderung des Unternehmensabonnements kontaktieren",
"Contact Channel Subscription Change": "Kontakt-Kanal-Abonnement-Änderung",
"New Contact": "Neuer Kontakt",
"Triggers when a contact is updated.": "Wird ausgelöst, wenn ein Kontakt aktualisiert wird.",
"Triggers when a commpany is added or removed to/from contact.": "Wird ausgelöst, wenn ein Commpany hinzugefügt oder entfernt wird.",
"Triggers when a contact's channel subscription status changes.": "Wird ausgelöst, wenn sich der Status eines Kanals ändert.",
"Triggers when a new contact is created.": "Wird ausgelöst, wenn ein neuer Kontakt erstellt wird.",
"Webhook Name": "Webhook-Name",
"Description": "Beschreibung",
"The name the webhook will be searchable by in mautic the webhooks page.": "Der Name des Webhook wird von der mautischen Seite der Webhooks durchsuchbar sein.",
"A short description of the webhook": "Eine kurze Beschreibung des Webhook"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Software de automatización de marketing de código abierto",
"Base URL": "URL base",
"Username": "Usuario",
"Password": "Contraseña",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Crear contacto",
"Search Contact": "Buscar contacto",
"Update Contact With Contact Id": "Actualizar contacto con el Id de contacto",
"Create Company": "Crear empresa",
"Search Company": "Buscar empresa",
"Update Company With Contact Id": "Actualizar empresa con ID de contacto",
"Custom API Call": "Llamada API personalizada",
"Creates a new contact in Mautic CRM": "Crea un nuevo contacto en Mautic CRM",
"Search for a contact in Mautic CRM": "Buscar un contacto en Mautic CRM",
"Update a contact in Mautic CRM": "Actualizar un contacto en Mautic CRM",
"Creates a new company in Mautic CRM": "Crea una nueva empresa en Mautic CRM",
"Search for a company in Mautic CRM": "Buscar una empresa en Mautic CRM",
"Update a company in Mautic CRM": "Actualizar una empresa en Mautic CRM",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"All Fields": "Todos los campos",
"Id of the entity": "Id de la entidad",
"Method": "Método",
"Headers": "Encabezados",
"Query Parameters": "Parámetros de consulta",
"Body": "Cuerpo",
"Response is Binary ?": "¿Respuesta es binaria?",
"No Error on Failure": "No hay ningún error en fallo",
"Timeout (in seconds)": "Tiempo de espera (en segundos)",
"List of all possible fields present": "Lista de todos los campos posibles presentes",
"Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
"Enable for files like PDFs, images, etc..": "Activar para archivos como PDFs, imágenes, etc.",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO",
"Contact Updated": "Contacto actualizado",
"Contact Company Subscription Change": "Cambio de suscripción a la empresa de contacto",
"Contact Channel Subscription Change": "Cambio de suscripción al canal de contacto",
"New Contact": "Nuevo contacto",
"Triggers when a contact is updated.": "Dispara cuando un contacto es actualizado.",
"Triggers when a commpany is added or removed to/from contact.": "Dispara cuando se agrega o quita una orden para/del contacto.",
"Triggers when a contact's channel subscription status changes.": "Se activa cuando el estado de la suscripción a un canal de contacto cambia.",
"Triggers when a new contact is created.": "Dispara cuando se crea un nuevo contacto.",
"Webhook Name": "Nombre del webhook",
"Description": "Descripción",
"The name the webhook will be searchable by in mautic the webhooks page.": "El nombre que el webhook podrá buscar en mautic la página de webhooks.",
"A short description of the webhook": "Una breve descripción del webhook"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Logiciel d'automatisation de marketing open source",
"Base URL": "URL de base",
"Username": "Nom d'utilisateur",
"Password": "Password",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Créer un contact",
"Search Contact": "Rechercher un contact",
"Update Contact With Contact Id": "Mettre à jour le contact avec l'id du contact",
"Create Company": "Créer une entreprise",
"Search Company": "Rechercher une entreprise",
"Update Company With Contact Id": "Mettre à jour l'entreprise avec l'ID du contact",
"Custom API Call": "Appel API personnalisé",
"Creates a new contact in Mautic CRM": "Crée un nouveau contact dans Mautic CRM",
"Search for a contact in Mautic CRM": "Rechercher un contact dans Mautic CRM",
"Update a contact in Mautic CRM": "Mettre à jour un contact dans Mautic CRM",
"Creates a new company in Mautic CRM": "Crée une nouvelle entreprise dans Mautic CRM",
"Search for a company in Mautic CRM": "Rechercher une entreprise dans le CRM Mautic",
"Update a company in Mautic CRM": "Mettre à jour une entreprise dans Mautic CRM",
"Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un point de terminaison spécifique",
"All Fields": "Tous les champs",
"Id of the entity": "Id de l'entité",
"Method": "Méthode",
"Headers": "En-têtes",
"Query Parameters": "Paramètres de requête",
"Body": "Corps",
"Response is Binary ?": "La réponse est Binaire ?",
"No Error on Failure": "Aucune erreur en cas d'échec",
"Timeout (in seconds)": "Délai d'attente (en secondes)",
"List of all possible fields present": "Liste des champs possibles présents",
"Authorization headers are injected automatically from your connection.": "Les en-têtes d'autorisation sont injectés automatiquement à partir de votre connexion.",
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
"GET": "OBTENIR",
"POST": "POSTER",
"PATCH": "PATCH",
"PUT": "EFFACER",
"DELETE": "SUPPRIMER",
"HEAD": "TÊTE",
"Contact Updated": "Contact mis à jour",
"Contact Company Subscription Change": "Contacter la société de changement d'abonnement",
"Contact Channel Subscription Change": "Changement du canal d'abonnement",
"New Contact": "Nouveau contact",
"Triggers when a contact is updated.": "Déclenche lorsqu'un contact est mis à jour.",
"Triggers when a commpany is added or removed to/from contact.": "Déclenche quand une virgule est ajoutée ou retirée de/vers le contact.",
"Triggers when a contact's channel subscription status changes.": "Déclenche quand le statut d'abonnement de canal d'un contact change.",
"Triggers when a new contact is created.": "Déclenche lorsqu'un nouveau contact est créé.",
"Webhook Name": "Nom du Webhook",
"Description": "Libellé",
"The name the webhook will be searchable by in mautic the webhooks page.": "Le nom du webhook sera consultable en mautique la page des webhooks.",
"A short description of the webhook": "Une courte description du webhook"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "オープンソースのマーケティング自動化ソフトウェア",
"Base URL": "ベースURL",
"Username": "ユーザー名",
"Password": "Password",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "連絡先を作成",
"Search Contact": "連絡先を検索",
"Update Contact With Contact Id": "連絡先IDで連絡先を更新",
"Create Company": "所属を作成",
"Search Company": "会社を検索",
"Update Company With Contact Id": "連絡先IDで会社を更新",
"Custom API Call": "カスタムAPI通話",
"Creates a new contact in Mautic CRM": "Mautic CRM に新しい連絡先を作成します。",
"Search for a contact in Mautic CRM": "Mautic CRM で連絡先を検索",
"Update a contact in Mautic CRM": "Mautic CRM の連絡先を更新",
"Creates a new company in Mautic CRM": "Mautic CRM に新しい会社を作成",
"Search for a company in Mautic CRM": "Mautic CRM で企業を検索",
"Update a company in Mautic CRM": "Mautic CRM の会社を更新",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"All Fields": "すべてのフィールド",
"Id of the entity": "エンティティの Id",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"List of all possible fields present": "可能なすべてのフィールドのリスト",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭",
"Contact Updated": "連絡先を更新しました",
"Contact Company Subscription Change": "連絡先会社のサブスクリプションの変更",
"Contact Channel Subscription Change": "連絡先チャネル購読の変更",
"New Contact": "新しい連絡先",
"Triggers when a contact is updated.": "連絡先が更新されたときにトリガーします。",
"Triggers when a commpany is added or removed to/from contact.": "通信が連絡先に追加または削除されたときにトリガーします。",
"Triggers when a contact's channel subscription status changes.": "連絡先のチャンネル登録ステータスが変更されたときにトリガーされます。",
"Triggers when a new contact is created.": "新しい連絡先が作成されたときにトリガーします.",
"Webhook Name": "Webhook名",
"Description": "説明",
"The name the webhook will be searchable by in mautic the webhooks page.": "webhookの名前はmauticページで検索可能になります。",
"A short description of the webhook": "Webhookの簡単な説明"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Open-source marketing automatiseringssoftware",
"Base URL": "Basis URL",
"Username": "Gebruikersnaam",
"Password": "Wachtwoord",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nVolg deze stappen:\n\n1. **Voer de basis-URL in:** Open uw Mautische exemplaar en kopieer de URL uit de adresbalk. Als uw dashboard link \"https://mautic.ddev.site/s/dashboard\" is, stel uw base URL in als \"https://mautic. dev.site/\".\n\n2. **Basis authenticatie inschakelen:** Log in bij Mautiek, ga naar **Instellingen** > **Configuratie** > **API Instellingen**, en zorg ervoor dat basis authenticatie is ingeschakeld.\n\n",
"Create Contact": "Contactpersoon aanmaken",
"Search Contact": "Zoek contact",
"Update Contact With Contact Id": "Bijwerken Contact Met Contactpersoon Id",
"Create Company": "Bedrijf aanmaken",
"Search Company": "Bedrijf zoeken",
"Update Company With Contact Id": "Update Bedrijf met Contactpersoon Id",
"Custom API Call": "Custom API Call",
"Creates a new contact in Mautic CRM": "Maakt een nieuw contact in Mautisch CRM",
"Search for a contact in Mautic CRM": "Zoek voor een contact in Mautisch CRM",
"Update a contact in Mautic CRM": "Bijwerken van een contact in Mautisch CRM",
"Creates a new company in Mautic CRM": "Maakt een nieuw bedrijf in Mautisch CRM",
"Search for a company in Mautic CRM": "Zoek naar een bedrijf in Mautisch CRM",
"Update a company in Mautic CRM": "Update een bedrijf in Mautisch CRM",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"All Fields": "Alle velden",
"Id of the entity": "Id van de entiteit",
"Method": "Methode",
"Headers": "Kopteksten",
"Query Parameters": "Query parameters",
"Body": "Lichaam",
"Response is Binary ?": "Antwoord is binair?",
"No Error on Failure": "Geen fout bij fout",
"Timeout (in seconds)": "Time-out (in seconden)",
"List of all possible fields present": "Lijst van alle mogelijke velden aanwezig",
"Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
"Enable for files like PDFs, images, etc..": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc..",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD",
"Contact Updated": "Contactpersoon bijgewerkt",
"Contact Company Subscription Change": "Contact Bedrijf Abonnement Wijziging",
"Contact Channel Subscription Change": "Contact kanaal abonnement wijzigen",
"New Contact": "Nieuw contactpersoon",
"Triggers when a contact is updated.": "Triggert wanneer een contact is bijgewerkt.",
"Triggers when a commpany is added or removed to/from contact.": "Triggert wanneer een commpany wordt toegevoegd aan of verwijderd van contactpersoon.",
"Triggers when a contact's channel subscription status changes.": "Triggert wanneer de status van het kanaal van een contactpersoon verandert.",
"Triggers when a new contact is created.": "Triggert wanneer een nieuw contact wordt aangemaakt.",
"Webhook Name": "Webhook Naam",
"Description": "Beschrijving",
"The name the webhook will be searchable by in mautic the webhooks page.": "De naam van de webhook is doorzoekbaar in mautic de webhooks pagina.",
"A short description of the webhook": "Een korte beschrijving van de webhook"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Software de automação de software de código aberto",
"Base URL": "URL Base",
"Username": "Usuário:",
"Password": "Senha",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Criar contato",
"Search Contact": "Pesquisar contato",
"Update Contact With Contact Id": "Atualizar Contato Com Id de Contato",
"Create Company": "Criar Empresa",
"Search Company": "Procurar Empresa",
"Update Company With Contact Id": "Atualizar Empresa com Contato Id",
"Custom API Call": "Chamada de API personalizada",
"Creates a new contact in Mautic CRM": "Cria um novo contato na Mautic CRM",
"Search for a contact in Mautic CRM": "Procurar por um contato na Mautic CRM",
"Update a contact in Mautic CRM": "Atualizar um contato no Mautic CRM",
"Creates a new company in Mautic CRM": "Cria uma nova empresa no Mautic CRM",
"Search for a company in Mautic CRM": "Procurar por uma empresa em CRM Mautic",
"Update a company in Mautic CRM": "Atualizar uma empresa no Mautic CRM",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"All Fields": "Todos os Campos",
"Id of the entity": "ID da entidade",
"Method": "Método",
"Headers": "Cabeçalhos",
"Query Parameters": "Parâmetros da consulta",
"Body": "Conteúdo",
"Response is Binary ?": "A resposta é binária ?",
"No Error on Failure": "Nenhum erro no Failure",
"Timeout (in seconds)": "Tempo limite (em segundos)",
"List of all possible fields present": "Lista de todos os campos possíveis presentes",
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
"Enable for files like PDFs, images, etc..": "Habilitar para arquivos como PDFs, imagens, etc..",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA",
"Contact Updated": "Contato atualizado",
"Contact Company Subscription Change": "Contatar assinatura da empresa alterada",
"Contact Channel Subscription Change": "Assinatura de canal de contato alterada",
"New Contact": "Novo Contato",
"Triggers when a contact is updated.": "Dispara quando um contato é atualizado.",
"Triggers when a commpany is added or removed to/from contact.": "Aciona quando uma composição é adicionada ou removida de/para o contato.",
"Triggers when a contact's channel subscription status changes.": "Aciona quando o estado da assinatura de um contato é alterado.",
"Triggers when a new contact is created.": "Dispara quando um novo contato é criado.",
"Webhook Name": "Nome Webhook",
"Description": "Descrição",
"The name the webhook will be searchable by in mautic the webhooks page.": "O nome do webhook será pesquisável pelo mautic a página de webhooks.",
"A short description of the webhook": "Uma breve descrição do webhook"
}

View File

@@ -0,0 +1,50 @@
{
"Mautic": "Маутик",
"Open-source marketing automation software": "Программное обеспечение автоматизации с открытым исходным кодом",
"Base URL": "Базовый URL",
"Username": "Имя пользователя",
"Password": "Пароль",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Создать контакт",
"Search Contact": "Поиск контакта",
"Update Contact With Contact Id": "Обновить контакт с контактом Id",
"Create Company": "Создать компанию",
"Search Company": "Поиск компании",
"Update Company With Contact Id": "Обновить компанию с контактным Id",
"Custom API Call": "Пользовательский вызов API",
"Creates a new contact in Mautic CRM": "Создает новый контакт в Mautic CRM",
"Search for a contact in Mautic CRM": "Поиск контакта в Mautic CRM",
"Update a contact in Mautic CRM": "Обновить контакт в Mautic CRM",
"Creates a new company in Mautic CRM": "Создает новую компанию в Mautic CRM",
"Search for a company in Mautic CRM": "Поиск компании в Mautic CRM",
"Update a company in Mautic CRM": "Обновить компанию в Mautic CRM",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"All Fields": "Все поля",
"Id of the entity": "Id сущности",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"List of all possible fields present": "Список всех возможных полей",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD",
"Contact Updated": "Контакт обновлен",
"Contact Company Subscription Change": "Изменение подписки контактной компании",
"Contact Channel Subscription Change": "Изменение подписки контактного канала",
"New Contact": "Новый контакт",
"Triggers when a contact is updated.": "Триггеры при обновлении контакта.",
"Triggers when a commpany is added or removed to/from contact.": "Включает запятую при добавлении или удалении контакта.",
"Triggers when a contact's channel subscription status changes.": "Включает при изменении статуса подписки канала контакта.",
"Triggers when a new contact is created.": "Включает при создании нового контакта.",
"Webhook Name": "Имя вебхука",
"Description": "Description",
"The name the webhook will be searchable by in mautic the webhooks page.": "Имя вебхука будет искать в mautic странице вебхуков.",
"A short description of the webhook": "Краткое описание вебхука"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Open-source marketing automation software",
"Base URL": "Base URL",
"Username": "Username",
"Password": "Password",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Create Contact",
"Search Contact": "Search Contact",
"Update Contact With Contact Id": "Update Contact With Contact Id",
"Create Company": "Create Company",
"Search Company": "Search Company",
"Update Company With Contact Id": "Update Company With Contact Id",
"Custom API Call": "Custom API Call",
"Creates a new contact in Mautic CRM": "Creates a new contact in Mautic CRM",
"Search for a contact in Mautic CRM": "Search for a contact in Mautic CRM",
"Update a contact in Mautic CRM": "Update a contact in Mautic CRM",
"Creates a new company in Mautic CRM": "Creates a new company in Mautic CRM",
"Search for a company in Mautic CRM": "Search for a company in Mautic CRM",
"Update a company in Mautic CRM": "Update a company in Mautic CRM",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"All Fields": "All Fields",
"Id of the entity": "Id of the entity",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"List of all possible fields present": "List of all possible fields present",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"Contact Updated": "Contact Updated",
"Contact Company Subscription Change": "Contact Company Subscription Change",
"Contact Channel Subscription Change": "Contact Channel Subscription Change",
"New Contact": "New Contact",
"Triggers when a contact is updated.": "Triggers when a contact is updated.",
"Triggers when a commpany is added or removed to/from contact.": "Triggers when a commpany is added or removed to/from contact.",
"Triggers when a contact's channel subscription status changes.": "Triggers when a contact's channel subscription status changes.",
"Triggers when a new contact is created.": "Triggers when a new contact is created.",
"Webhook Name": "Webhook Name",
"Description": "Description",
"The name the webhook will be searchable by in mautic the webhooks page.": "The name the webhook will be searchable by in mautic the webhooks page.",
"A short description of the webhook": "A short description of the webhook"
}

View File

@@ -0,0 +1,50 @@
{
"Mautic": "Mautic",
"Open-source marketing automation software": "Open-source marketing automation software",
"Base URL": "Base URL",
"Username": "Username",
"Password": "Password",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Create Contact",
"Search Contact": "Search Contact",
"Update Contact With Contact Id": "Update Contact With Contact Id",
"Create Company": "Create Company",
"Search Company": "Search Company",
"Update Company With Contact Id": "Update Company With Contact Id",
"Custom API Call": "Custom API Call",
"Creates a new contact in Mautic CRM": "Creates a new contact in Mautic CRM",
"Search for a contact in Mautic CRM": "Search for a contact in Mautic CRM",
"Update a contact in Mautic CRM": "Update a contact in Mautic CRM",
"Creates a new company in Mautic CRM": "Creates a new company in Mautic CRM",
"Search for a company in Mautic CRM": "Search for a company in Mautic CRM",
"Update a company in Mautic CRM": "Update a company in Mautic CRM",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"All Fields": "All Fields",
"Id of the entity": "Id of the entity",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"List of all possible fields present": "List of all possible fields present",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"Contact Updated": "Contact Updated",
"Contact Company Subscription Change": "Contact Company Subscription Change",
"Contact Channel Subscription Change": "Contact Channel Subscription Change",
"New Contact": "New Contact",
"Triggers when a contact is updated.": "Triggers when a contact is updated.",
"Triggers when a commpany is added or removed to/from contact.": "Triggers when a commpany is added or removed to/from contact.",
"Triggers when a contact's channel subscription status changes.": "Triggers when a contact's channel subscription status changes.",
"Triggers when a new contact is created.": "Triggers when a new contact is created.",
"Webhook Name": "Webhook Name",
"Description": "Description",
"The name the webhook will be searchable by in mautic the webhooks page.": "The name the webhook will be searchable by in mautic the webhooks page.",
"A short description of the webhook": "A short description of the webhook"
}

View File

@@ -0,0 +1,51 @@
{
"Open-source marketing automation software": "Open-source marketing automation software",
"Base URL": "基本网址",
"Username": "用户名",
"Password": "Password",
"\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n": "\nFollow these steps:\n\n1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is \"https://mautic.ddev.site/s/dashboard\", set your base URL as \"https://mautic.ddev.site/\".\n\n2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.\n\n",
"Create Contact": "Create Contact",
"Search Contact": "Search Contact",
"Update Contact With Contact Id": "Update Contact With Contact Id",
"Create Company": "Create Company",
"Search Company": "Search Company",
"Update Company With Contact Id": "Update Company With Contact Id",
"Custom API Call": "自定义 API 呼叫",
"Creates a new contact in Mautic CRM": "Creates a new contact in Mautic CRM",
"Search for a contact in Mautic CRM": "Search for a contact in Mautic CRM",
"Update a contact in Mautic CRM": "Update a contact in Mautic CRM",
"Creates a new company in Mautic CRM": "Creates a new company in Mautic CRM",
"Search for a company in Mautic CRM": "Search for a company in Mautic CRM",
"Update a company in Mautic CRM": "Update a company in Mautic CRM",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"All Fields": "All Fields",
"Id of the entity": "Id of the entity",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"List of all possible fields present": "List of all possible fields present",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色",
"Contact Updated": "Contact Updated",
"Contact Company Subscription Change": "Contact Company Subscription Change",
"Contact Channel Subscription Change": "Contact Channel Subscription Change",
"New Contact": "New Contact",
"Triggers when a contact is updated.": "Triggers when a contact is updated.",
"Triggers when a commpany is added or removed to/from contact.": "Triggers when a commpany is added or removed to/from contact.",
"Triggers when a contact's channel subscription status changes.": "Triggers when a contact's channel subscription status changes.",
"Triggers when a new contact is created.": "Triggers when a new contact is created.",
"Webhook Name": "Webhook Name",
"Description": "描述",
"The name the webhook will be searchable by in mautic the webhooks page.": "The name the webhook will be searchable by in mautic the webhooks page.",
"A short description of the webhook": "A short description of the webhook"
}

View File

@@ -0,0 +1,84 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import {
PieceAuth,
PiecePropValueSchema,
Property,
createPiece,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import {
createCompany,
createContact,
searchCompany,
searchContact,
updateCompany,
updateContact,
} from './lib/actions';
import { triggers } from './lib/triggers';
const markdownDescription = `
Follow these steps:
1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is "https://mautic.ddev.site/s/dashboard", set your base URL as "https://mautic.ddev.site/".
2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.
`;
export const mauticAuth = PieceAuth.CustomAuth({
description: markdownDescription,
props: {
base_url: Property.ShortText({
displayName: 'Base URL',
required: true,
}),
username: Property.ShortText({
displayName: 'Username',
required: true,
}),
password: PieceAuth.SecretText({
displayName: 'Password',
required: true,
}),
},
required: true,
});
export const mautic = createPiece({
displayName: 'Mautic',
description: 'Open-source marketing automation software',
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/mautic.png',
authors: ["bibhuty-did-this","kanarelo","kishanprmr","MoShizzle","khaledmashaly","abuaboud"],
categories: [PieceCategory.MARKETING],
auth: mauticAuth,
actions: [
createContact,
searchContact,
updateContact,
createCompany,
searchCompany,
updateCompany,
createCustomApiCallAction({
auth: mauticAuth,
baseUrl: (auth) => {
if (!auth) {
return '';
}
const { base_url } = auth.props;
return `${base_url.endsWith('/') ? base_url : base_url + '/'}api/`;
},
authMapping: async (auth) => {
const { username, password } = auth.props;
return {
Authorization:
'Basic ' +
Buffer.from(`${username}:${password}`).toString('base64'),
'Content-Type': 'application/json',
};
},
}),
],
triggers,
});

View File

@@ -0,0 +1,34 @@
import { createAction } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { mauticCommon } from '../common';
import { mauticAuth } from '../..';
export const createCompany = createAction({
auth: mauticAuth,
description: 'Creates a new company in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Create Company',
name: 'create_mautic_company',
props: {
fields: mauticCommon.companyFields,
},
run: async function (context) {
const { base_url, username, password } = context.auth.props;
const request: HttpRequest = {
method: HttpMethod.POST,
url:
(base_url.endsWith('/') ? base_url : base_url + '/') +
'api/companies/new',
body: JSON.stringify(context.propsValue.fields),
headers: {
Authorization:
'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
'Content-Type': 'application/json',
},
};
return await httpClient.sendRequest(request);
},
});

View File

@@ -0,0 +1,34 @@
import { createAction } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { mauticCommon } from '../common';
import { mauticAuth } from '../..';
export const createContact = createAction({
auth: mauticAuth,
description: 'Creates a new contact in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Create Contact',
name: 'create_mautic_contact',
props: {
fields: mauticCommon.contactFields,
},
run: async function (context) {
const { base_url, username, password } = context.auth.props;
const request: HttpRequest = {
method: HttpMethod.POST,
url:
(base_url.endsWith('/') ? base_url : base_url + '/') +
'api/contacts/new',
body: JSON.stringify(context.propsValue.fields),
headers: {
Authorization:
'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
'Content-Type': 'application/json',
},
};
return await httpClient.sendRequest(request);
},
});

View File

@@ -0,0 +1,6 @@
export { createContact } from './create-contact';
export { searchContact } from './search-contact';
export { updateContact } from './update-contact';
export { createCompany } from './create-company';
export { searchCompany } from './search-company';
export { updateCompany } from './update-company';

View File

@@ -0,0 +1,28 @@
import { createAction } from '@activepieces/pieces-framework';
import { mauticCommon, searchEntity } from '../common';
import { mauticAuth } from '../..';
export const searchCompany = createAction({
auth: mauticAuth,
description: 'Search for a company in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Search Company',
name: 'search_mautic_company',
props: {
fields: mauticCommon.companyFields,
},
run: async function (context) {
const { base_url, username, password } = context.auth.props;
const url =
(base_url.endsWith('/') ? base_url : base_url + '/') + 'api/companies';
const fields = context.propsValue.fields;
const keys = Object.keys(fields);
let searchParams = '?';
for (const key of keys) {
if (fields[key]) {
searchParams += `search=${key}:${fields[key]}&`;
}
}
const response = await searchEntity(url, searchParams, username, password);
return Object.values(response.body.companies)[0];
},
});

View File

@@ -0,0 +1,30 @@
import { createAction } from '@activepieces/pieces-framework';
import { mauticCommon, searchEntity } from '../common';
import { mauticAuth } from '../..';
export const searchContact = createAction({
auth: mauticAuth,
description: 'Search for a contact in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Search Contact',
name: 'search_mautic_contact',
props: {
fields: mauticCommon.contactFields,
},
run: async function (context) {
const { base_url, username, password } = context.auth.props;
const url =
(base_url.endsWith('/') ? base_url : base_url + '/') + 'api/contacts';
const fields = context.propsValue.fields;
const keys = Object.keys(fields);
let count = 0;
let searchParams = '?';
for (const key of keys) {
if (fields[key]) {
searchParams += `where[${count}][col]=${key}&where[${count}][expr]=eq&where[${count}][val]=${fields[key]}&`;
++count;
}
}
const response = await searchEntity(url, searchParams, username, password);
return Object.values(response.body.contacts)[0];
},
});

View File

@@ -0,0 +1,44 @@
import { createAction } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { mauticCommon } from '../common';
import { mauticAuth } from '../..';
export const updateCompany = createAction({
auth: mauticAuth,
description: 'Update a company in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Update Company With Contact Id',
name: 'update_mautic_company',
props: {
id: mauticCommon.id,
fields: mauticCommon.companyFields,
},
run: async function (context) {
const { base_url, username, password } = context.auth.props;
// This is intentionally done because for `null` data Mautic doesn't change data for contacts but
// for the same it changes data for companies. This step is taken to ensure both behave the same.
const fields = context.propsValue.fields;
const keys = Object.keys(fields);
for (const key of keys) {
if (!fields[key]) {
delete fields[key];
}
}
const request: HttpRequest = {
method: HttpMethod.PATCH,
url: `${
base_url.endsWith('/') ? base_url : base_url + '/'
}api/companies/${context.propsValue.id}/edit`,
body: JSON.stringify(fields),
headers: {
Authorization:
'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
'Content-Type': 'application/json',
},
};
return await httpClient.sendRequest(request);
},
});

View File

@@ -0,0 +1,35 @@
import { createAction } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { mauticCommon } from '../common';
import { mauticAuth } from '../..';
export const updateContact = createAction({
auth: mauticAuth,
description: 'Update a contact in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Update Contact With Contact Id',
name: 'update_mautic_contact',
props: {
id: mauticCommon.id,
fields: mauticCommon.contactFields,
},
run: async function (context) {
const { base_url, username, password } = context.auth.props;
const request: HttpRequest = {
method: HttpMethod.PATCH,
url: `${base_url.endsWith('/') ? base_url : base_url + '/'}api/contacts/${
context.propsValue.id
}/edit`,
body: JSON.stringify(context.propsValue.fields),
headers: {
Authorization:
'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
'Content-Type': 'application/json',
},
};
return await httpClient.sendRequest(request);
},
});

View File

@@ -0,0 +1,126 @@
import { DynamicPropsValue, Property } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { mauticAuth } from '../..';
// Function Section
export const mapMauticToActivepiecesProperty = (
type: string,
fieldMetadata: {
displayName: string;
required: boolean;
},
properties: object
) => {
switch (type) {
case 'lookup':
case 'text':
case 'email':
case 'tel':
case 'region':
case 'country':
case 'locale':
case 'timezone':
case 'url':
return Property.ShortText(fieldMetadata);
case 'date':
case 'datetime':
return Property.DateTime(fieldMetadata);
case 'number':
return Property.Number(fieldMetadata);
case 'boolean':
return Property.StaticDropdown({
...fieldMetadata,
options: {
options: [
{ value: 'no', label: 'No' },
{ value: 'yes', label: 'Yes' },
],
},
});
case 'multiselect':
return Property.StaticMultiSelectDropdown({
...fieldMetadata,
options: {
options: Object.values(properties)[0],
},
});
case 'select':
return Property.StaticDropdown({
...fieldMetadata,
options: {
options: Object.values(properties)[0],
},
});
default:
console.error(`No support of type ${type}`);
return null;
}
};
export const fetchDynamicFieldsFromMetadata = async (
baseUrl: string,
username: string,
password: string,
type: 'contact' | 'company' | 'lead'
) => {
const request: HttpRequest = {
method: HttpMethod.GET,
url: `${
baseUrl.endsWith('/') ? baseUrl : baseUrl + '/'
}api/fields/${type}?limit=1000`,
headers: {
Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString(
'base64'
)}`,
'Content-Type': 'application/json',
},
};
const result = await httpClient.sendRequest(request);
if (result.status == 200) {
return Object.values(result.body.fields).reduce(
(fields: DynamicPropsValue, field) => {
const {
label: displayName,
alias,
type,
properties,
} = field as Record<string, any>;
const fieldMetadata = {
displayName,
required: false,
};
if (!type) return {};
const f = mapMauticToActivepiecesProperty(
type,
fieldMetadata,
properties
);
if (f) {
fields[alias] = f;
}
return fields;
},
{}
);
}
throw Error(`Unable to fetch ${type} metadata`);
};
export const getFields = (type: 'contact' | 'company' | 'lead') =>
Property.DynamicProperties({
auth: mauticAuth,
displayName: 'All Fields',
description: 'List of all possible fields present',
required: true,
refreshers: [],
props: async ({ auth }) => {
if (!auth) return {};
const { base_url, username, password } = auth.props;
return fetchDynamicFieldsFromMetadata(base_url, username, password, type);
},
});

View File

@@ -0,0 +1,41 @@
import { Property } from '@activepieces/pieces-framework';
import { getFields } from './helper';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
export const mauticCommon = {
contactFields: { ...getFields('contact'), ...getFields('lead') },
companyFields: getFields('company'),
id: Property.ShortText({
displayName: 'Id of the entity',
required: true,
}),
};
export const searchEntity = async (
url: string,
searchParams: string,
username: string,
password: string
) => {
const request: HttpRequest = {
method: HttpMethod.GET,
url: `${url}${searchParams}`,
headers: {
Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString(
'base64'
)}`,
'Content-Type': 'application/json',
},
};
const response: Record<string, any> = await httpClient.sendRequest(request);
const length = response.body.total;
if (!length || length != 1)
throw Error(
'The query is not perfect enough to get single result. Please refine'
);
return response;
};

View File

@@ -0,0 +1,453 @@
import { HttpMethod, HttpRequest, httpClient } from '@activepieces/pieces-common';
import { mauticAuth } from '../../index';
import { Property, TriggerStrategy, createTrigger } from "@activepieces/pieces-framework";
const contactTestData = {
"contact": {
"id": 38186,
"points": 0,
"color": null,
"fields": {
"core": {
"points": {
"id": "9",
"label": "Points",
"alias": "points",
"type": "number",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": "0"
},
"title": {
"id": "1",
"label": "Title",
"alias": "title",
"type": "lookup",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"firstname": {
"id": "2",
"label": "First Name",
"alias": "firstname",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": "Test"
},
"lastname": {
"id": "3",
"label": "Last Name",
"alias": "lastname",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": "Contact"
},
"company": {
"id": "4",
"label": "Company",
"alias": "company",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"position": {
"id": "5",
"label": "Position",
"alias": "position",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"email": {
"id": "6",
"label": "Email",
"alias": "email",
"type": "email",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": "Test@email.com"
},
"phone": {
"id": "8",
"label": "Phone",
"alias": "phone",
"type": "tel",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"mobile": {
"id": "7",
"label": "Mobile",
"alias": "mobile",
"type": "tel",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"address1": {
"id": "11",
"label": "Address Line 1",
"alias": "address1",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"address2": {
"id": "12",
"label": "Address Line 2",
"alias": "address2",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"city": {
"id": "13",
"label": "City",
"alias": "city",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"state": {
"id": "14",
"label": "State",
"alias": "state",
"type": "region",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"zipcode": {
"id": "15",
"label": "Zip Code",
"alias": "zipcode",
"type": "text",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"country": {
"id": "16",
"label": "Country",
"alias": "country",
"type": "country",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": ""
},
"fax": {
"id": "10",
"label": "Fax",
"alias": "fax",
"type": "tel",
"group": "core",
"object": "lead",
"is_fixed": "0",
"value": null
},
"preferred_locale": {
"id": "17",
"label": "Preferred Locale",
"alias": "preferred_locale",
"type": "locale",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": null
},
"attribution_date": {
"id": "18",
"label": "Attribution Date",
"alias": "attribution_date",
"type": "datetime",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": null
},
"attribution": {
"id": "19",
"label": "Attribution",
"alias": "attribution",
"type": "number",
"group": "core",
"object": "lead",
"is_fixed": "1",
"value": null
},
"website": {
"id": "20",
"label": "Website",
"alias": "website",
"type": "url",
"group": "core",
"object": "lead",
"is_fixed": "0",
"value": null
},
"boolean": {
"id": "43",
"label": "Boolean",
"alias": "boolean",
"type": "boolean",
"group": "core",
"object": "lead",
"is_fixed": "0",
"value": null
},
"multiple_contact": {
"id": "44",
"label": "Multiple Contact",
"alias": "multiple_contact",
"type": "multiselect",
"group": "core",
"object": "lead",
"is_fixed": "0",
"value": null
}
},
"social": {
"facebook": {
"id": "21",
"label": "Facebook",
"alias": "facebook",
"type": "text",
"group": "social",
"object": "lead",
"is_fixed": "0",
"value": null
},
"foursquare": {
"id": "22",
"label": "Foursquare",
"alias": "foursquare",
"type": "text",
"group": "social",
"object": "lead",
"is_fixed": "0",
"value": null
},
"instagram": {
"id": "24",
"label": "Instagram",
"alias": "instagram",
"type": "text",
"group": "social",
"object": "lead",
"is_fixed": "0",
"value": null
},
"linkedin": {
"id": "25",
"label": "LinkedIn",
"alias": "linkedin",
"type": "text",
"group": "social",
"object": "lead",
"is_fixed": "0",
"value": null
},
"skype": {
"id": "26",
"label": "Skype",
"alias": "skype",
"type": "text",
"group": "social",
"object": "lead",
"is_fixed": "0",
"value": null
},
"twitter": {
"id": "27",
"label": "Twitter",
"alias": "twitter",
"type": "text",
"group": "social",
"object": "lead",
"is_fixed": "0",
"value": null
}
},
"personal": [],
"professional": []
}
},
"channel": "email",
"old_status": "contactable",
"new_status": "manual",
"timestamp": "2017-12-01T00:05:18-06:00"
}
export const triggers = [
{
name: "lead_post_save_update",
displayName: "Contact Updated",
description: "Triggers when a contact is updated.",
sampleData: {
"mautic.lead_post_save_update": [contactTestData]
},
eventType: "mautic.lead_post_save_update",
},
{
name: "lead_company_change",
displayName: "Contact Company Subscription Change",
description: "Triggers when a commpany is added or removed to/from contact.",
sampleData: {
"mautic.lead_company_change": [contactTestData]
},
eventType: "mautic.lead_company_change",
},
{
name: "lead_channel_subscription_changed",
displayName: "Contact Channel Subscription Change",
description: "Triggers when a contact's channel subscription status changes.",
sampleData: {
"mautic.lead_channel_subscription_changed": [contactTestData]
},
eventType: "mautic.lead_channel_subscription_changed",
},
{
name: "lead_post_save_new",
displayName: "New Contact",
description: "Triggers when a new contact is created.",
sampleData: {
"mautic.lead_post_save_new": [contactTestData]
},
eventType: "mautic.lead_post_save_new",
},
]
.map((props) => registerTrigger(props));
function registerTrigger({
name,
displayName,
eventType,
description,
sampleData
}: {
name: string;
displayName: string;
eventType: string;
description: string;
sampleData: unknown;
}) {
return createTrigger({
auth: mauticAuth,
name: `mautic_${name}_trigger`,
displayName,
description,
props: {
name: Property.ShortText({
displayName: "Webhook Name",
description: "The name the webhook will be searchable by in mautic the webhooks page.",
required: true
}),
description: Property.LongText({
displayName: "Description",
description: "A short description of the webhook",
required: true
})
},
sampleData,
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const { base_url, username, password } = context.auth.props
const request: HttpRequest = {
method: HttpMethod.POST,
url: `${(base_url.endsWith('/') ? base_url : base_url + '/')}api/hooks/new`,
body: {
name: context.propsValue.name,
description: context.propsValue.description,
webhookUrl: context.webhookUrl,
eventsOrderbyDir: "ASC",
triggers: [eventType]
},
headers: {
'Content-Type': 'application/json',
'Authorization':
'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
},
queryParams: {},
}
const response = await httpClient.sendRequest<WebhookInformation>(request);
await context.store.put<WebhookInformation>(`mautic_${name}_trigger`, response.body);
},
async onDisable(context) {
const { base_url, username, password } = context.auth.props
const webhook = await context.store.get<WebhookInformation>(`mautic_${name}_trigger`);
if (webhook != null) {
const request: HttpRequest = {
method: HttpMethod.DELETE,
url: `${(base_url.endsWith('/') ? base_url : base_url + '/')}api/hooks/${webhook.hook.id}/delete`,
headers: {
'Content-Type': 'application/json',
'Authorization':
'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
},
};
const response = await httpClient.sendRequest(request);
console.debug(`mautic.trigger.onDisable`, response);
}
},
async run(context) {
return [context.payload.body];
},
});
}
interface WebhookInformation {
hook: {
isPublished: boolean
dateAdded: string
dateModified: string
createdBy: number
createdByUser: string
modifiedBy: unknown | null
modifiedByUser: string
id: number
name: string
description: string
webhookUrl: string
secret: string
eventsOrderbyDir: string
category: {
id: number
createdByUser: string
modifiedByUser: string
title: string
alias: string
description: string | null
color: string | null
bundle: string
}
triggers: string[]
}
}