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,33 @@
{
"extends": [
"../../../../.eslintrc.base.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}

View File

@@ -0,0 +1,7 @@
# pieces-manychat
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-manychat` to build the library.

View File

@@ -0,0 +1,4 @@
{
"name": "@activepieces/piece-manychat",
"version": "0.0.8"
}

View File

@@ -0,0 +1,60 @@
{
"name": "pieces-manychat",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/manychat/src",
"projectType": "library",
"release": {
"version": {
"currentVersionResolver": "git-tag",
"preserveLocalDependencyProtocols": false,
"manifestRootsToUpdate": [
"dist/{projectRoot}"
]
}
},
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/manychat",
"tsConfig": "packages/pieces/community/manychat/tsconfig.lib.json",
"packageJson": "packages/pieces/community/manychat/package.json",
"main": "packages/pieces/community/manychat/src/index.ts",
"assets": [
"packages/pieces/community/manychat/*.md"
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true
},
"dependsOn": [
"^build",
"prebuild"
]
},
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
},
"prebuild": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/pieces/community/manychat",
"command": "bun install --no-save --silent"
},
"dependsOn": [
"^build"
]
}
}
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automatisierung für Instagram, WhatsApp, TikTok, und Messenger Marketing.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "Du kannst einen API-Schlüssel erstellen, indem du zu **Einstellungen -> Erweiterungen -> API** navigierst.",
"Add Tag to User": "Tag zu Benutzer hinzufügen",
"Create Subscriber": "Abonnent erstellen",
"Find User by Custom Field": "Benutzer durch eigenes Feld finden",
"Find User by Name": "Benutzer nach Name finden",
"Remove Tag from User": "Tag vom Benutzer entfernen",
"Send Content to User": "Inhalt an Benutzer senden",
"Set Custom Field": "Benutzerdefiniertes Feld festlegen",
"Adds a tag to a user.": "Fügt einen Tag einem Benutzer hinzu.",
"Creates a Unified or a Whatsapp subscriber.": "Erstellt einen Unified oder einen Whatsapp Abonnenten.",
"Finds a user by custom field.": "Findet einen Benutzer nach benutzerdefiniertem Feld.",
"Finds a user by name.": "Findet einen Benutzer nach Namen.",
"Remove a tag from a user.": "Ein Tag von einem Benutzer entfernen.",
"Sends a content to a user.": "Sendet einen Inhalt an einen Benutzer.",
"Ass or Updates a custom field value for a user.": "Ein benutzerdefinierter Feldwert für einen Benutzer addiert oder aktualisiert.",
"User ID": "Benutzer-ID",
"Tag": "Markierung",
"First Name": "Vorname",
"Last Name": "Nachname",
"Phone Number": "Telefonnummer",
"WhatsApp Phone": "WhatsApp Telefon",
"Email": "E-Mail",
"Gender": "Geschlecht",
"SMS Opt-in": "SMS-Opt-in",
"Email Opt-in": "E-Mail-Opt-in",
"Consent Phrase": "Zustimmungssatz",
"Custom Field": "Eigenes Feld",
"Value": "Wert",
"Name": "Name",
"Platform": "Plattform",
"Content Type": "Inhaltstyp",
"Text Content": "Textinhalt",
"Media URL": "Medien-URL",
"Message Tag": "Tag der Nachricht",
"Field Value": "Feldwert",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Bitte lesen Sie [Manychat Anleitung](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42), um Benutzer/Kontakt-ID zu erhalten.",
"Fill in at least one field: phone or email or whatsapp phone.": "Füllen Sie mindestens ein Feld aus: Telefon oder E-Mail oder whatsapp Telefon.",
"The consent phrase provided by the subscriber.": "Der Zustimmungssatz des Abonnenten.",
"The value to search for.": "Der zu suchende Wert.",
"Provide user's full name to search.": "Geben Sie den vollständigen Namen des Benutzers für die Suche an.",
"The platform to send the content to.": "Die Plattform, an die die Inhalte gesendet werden sollen.",
"The type of content to send.": "Die Art des zu sendenden Inhalts.",
"The text content to send. Required when content type is Text.": "Der zu sendende Text. Wird benötigt wenn der Inhaltstyp Text ist.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL des zu sendenden Mediums (Bild, Video, Ton oder Datei). Wird für Medien-Content-Typen benötigt.",
"The tag to use for the message.": "Das Tag, das für die Nachricht verwendet wird.",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegramm",
"Text": "Text",
"Image": "Bild",
"Video": "Video",
"Audio": "Audio",
"File": "Datei",
"Account Update": "Kontoaktualisierung",
"Confirmed Event Update": "Bestätigtes Ereignis-Update",
"Human Agent": "Menschlicher Agent",
"Post Purchase Update": "Kaufaktualisierung posten",
"Business Productivity": "Geschäftliche Produktivität"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automatizaciones para el mercado Instagram, WhatsApp, TikTok y Messenger.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "Puedes crear una clave de API navegando a **Configuración-> Extensiones -> API**.",
"Add Tag to User": "Añadir etiqueta al usuario",
"Create Subscriber": "Crear suscriptor",
"Find User by Custom Field": "Buscar usuario por campo personalizado",
"Find User by Name": "Buscar usuario por nombre",
"Remove Tag from User": "Eliminar etiqueta del usuario",
"Send Content to User": "Enviar contenido al usuario",
"Set Custom Field": "Establecer campo personalizado",
"Adds a tag to a user.": "Añade una etiqueta a un usuario.",
"Creates a Unified or a Whatsapp subscriber.": "Crea un suscriptor Unificado o de Whatsapp.",
"Finds a user by custom field.": "Encuentra un usuario por campo personalizado.",
"Finds a user by name.": "Encuentra un usuario por nombre.",
"Remove a tag from a user.": "Eliminar una etiqueta de un usuario.",
"Sends a content to a user.": "Envía contenido a un usuario.",
"Ass or Updates a custom field value for a user.": "Ass o Actualiza un valor de campo personalizado para un usuario.",
"User ID": "ID Usuario",
"Tag": "Etiqueta",
"First Name": "Nombre",
"Last Name": "Apellido",
"Phone Number": "Número de teléfono",
"WhatsApp Phone": "Teléfono WhatsApp",
"Email": "E-mail",
"Gender": "Sexo",
"SMS Opt-in": "Opt-in SMS",
"Email Opt-in": "Correo electrónico",
"Consent Phrase": "Frase de consentimiento",
"Custom Field": "Campo personalizado",
"Value": "Valor",
"Name": "Nombre",
"Platform": "Plataforma",
"Content Type": "Tipo de contenido",
"Text Content": "Contenido de texto",
"Media URL": "URL de medios",
"Message Tag": "Etiqueta de mensaje",
"Field Value": "Valor del campo",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Por favor consulte [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) para obtener el usuario/contacto ID.",
"Fill in at least one field: phone or email or whatsapp phone.": "Rellena al menos un campo: teléfono o correo electrónico o teléfono whatsapp.",
"The consent phrase provided by the subscriber.": "La frase de consentimiento proporcionada por el suscriptor.",
"The value to search for.": "El valor por el que buscar.",
"Provide user's full name to search.": "Proporcionar el nombre completo del usuario para buscar.",
"The platform to send the content to.": "La plataforma a la que enviar el contenido.",
"The type of content to send.": "El tipo de contenido a enviar.",
"The text content to send. Required when content type is Text.": "El contenido de texto a enviar. Requerido cuando el tipo de contenido es Texto.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL del medio para enviar (imagen, vídeo, audio o archivo). Requerido para tipos de contenido multimedia.",
"The tag to use for the message.": "La etiqueta a usar para el mensaje.",
"Facebook": "Facebook",
"Instagram": "Instagrama",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "Texto",
"Image": "Imagen",
"Video": "Vídeo",
"Audio": "Audio",
"File": "Archivo",
"Account Update": "Actualizar Cuenta",
"Confirmed Event Update": "Actualización de evento confirmada",
"Human Agent": "Agente humano",
"Post Purchase Update": "Actualizar Post Compra",
"Business Productivity": "Productividad del negocio"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automatisation pour Instagram, WhatsApp, TikTok et Messenger marketing.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "Vous pouvez créer une clé API en allant dans **Réglage -> Extensions -> API**.",
"Add Tag to User": "Ajouter un tag à l'utilisateur",
"Create Subscriber": "Créer un abonné",
"Find User by Custom Field": "Trouver un utilisateur par champ personnalisé",
"Find User by Name": "Trouver un utilisateur par nom",
"Remove Tag from User": "Supprimer le tag de l'utilisateur",
"Send Content to User": "Envoyer du contenu à l'utilisateur",
"Set Custom Field": "Définir un champ personnalisé",
"Adds a tag to a user.": "Ajoute un tag à un utilisateur.",
"Creates a Unified or a Whatsapp subscriber.": "Crée un abonné unifié ou WhatsApp.",
"Finds a user by custom field.": "Trouve un utilisateur par champ personnalisé.",
"Finds a user by name.": "Trouve un utilisateur par nom.",
"Remove a tag from a user.": "Supprimer un tag d'un utilisateur.",
"Sends a content to a user.": "Envoie un contenu à un utilisateur.",
"Ass or Updates a custom field value for a user.": "Assigne ou Met à jour une valeur de champ personnalisé pour un utilisateur.",
"User ID": "Identifiant de l'utilisateur",
"Tag": "Étiquette",
"First Name": "First Name",
"Last Name": "Last Name",
"Phone Number": "Numéro de téléphone",
"WhatsApp Phone": "Téléphone WhatsApp",
"Email": "Courriel",
"Gender": "Sexe",
"SMS Opt-in": "SMS Opt-in",
"Email Opt-in": "Courriel opt-in",
"Consent Phrase": "Phrase de consentement",
"Custom Field": "Champ personnalisé",
"Value": "Valeur",
"Name": "Nom",
"Platform": "Plateforme",
"Content Type": "Type de contenu",
"Text Content": "Contenu du texte",
"Media URL": "URL du média",
"Message Tag": "Étiquette de message",
"Field Value": "Valeur du champ",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Veuillez vous référer au [Guide de Manychat](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) pour obtenir l'identifiant de l'utilisateur/contact.",
"Fill in at least one field: phone or email or whatsapp phone.": "Remplissez au moins un champ : téléphone ou e-mail ou téléphone WhatsApp.",
"The consent phrase provided by the subscriber.": "La phrase de consentement fournie par l'abonné.",
"The value to search for.": "La valeur à rechercher.",
"Provide user's full name to search.": "Fournir le nom complet de l'utilisateur à rechercher.",
"The platform to send the content to.": "La plateforme vers laquelle envoyer le contenu.",
"The type of content to send.": "Le type de contenu à envoyer.",
"The text content to send. Required when content type is Text.": "Le contenu du texte à envoyer. Requis lorsque le type de contenu est du texte.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL du média à envoyer (image, vidéo, audio ou fichier). Requis pour les types de contenu multimédia.",
"The tag to use for the message.": "Le tag à utiliser pour le message.",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Télégramme",
"Text": "Texte du texte",
"Image": "Image",
"Video": "Vidéo",
"Audio": "Audio",
"File": "Ficher",
"Account Update": "Mise à jour du compte",
"Confirmed Event Update": "Mise à jour de l'événement confirmée",
"Human Agent": "Agent Humain",
"Post Purchase Update": "Poster la mise à jour de l'achat",
"Business Productivity": "Productivité des affaires"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Instagram、WhatsApp、TikTok、およびMessengerマーケティングのための自動化。",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "API キーは、**設定 -> 拡張 -> API** に移動して作成できます。",
"Add Tag to User": "ユーザーにタグを追加",
"Create Subscriber": "購読者を作成",
"Find User by Custom Field": "カスタムフィールドでユーザーを検索",
"Find User by Name": "名前でユーザーを検索",
"Remove Tag from User": "ユーザーからタグを削除",
"Send Content to User": "ユーザーにコンテンツを送信",
"Set Custom Field": "カスタムフィールドを設定",
"Adds a tag to a user.": "ユーザーにタグを追加します。",
"Creates a Unified or a Whatsapp subscriber.": "Unified または Whatsapp 契約者を作成します。",
"Finds a user by custom field.": "カスタムフィールドでユーザーを検索します。",
"Finds a user by name.": "名前でユーザーを検索します。",
"Remove a tag from a user.": "ユーザーからタグを削除します。",
"Sends a content to a user.": "ユーザーにコンテンツを送信します。",
"Ass or Updates a custom field value for a user.": "Ass, or Updates a custom field value for a user.",
"User ID": "ユーザー ID",
"Tag": "タグ",
"First Name": "名",
"Last Name": "Last Name",
"Phone Number": "電話番号",
"WhatsApp Phone": "WhatsApp電話",
"Email": "Eメールアドレス",
"Gender": "性別",
"SMS Opt-in": "SMSのオプトイン",
"Email Opt-in": "メールのオプトイン",
"Consent Phrase": "同意フレーズ",
"Custom Field": "カスタムフィールド",
"Value": "値",
"Name": "Name",
"Platform": "プラットフォーム",
"Content Type": "コンテンツタイプ",
"Text Content": "テキストコンテンツ",
"Media URL": "メディア URL",
"Message Tag": "メッセージ タグ",
"Field Value": "フィールド値",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "ユーザー/連絡先IDを取得するには、[Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42)を参照してください。",
"Fill in at least one field: phone or email or whatsapp phone.": "電話または電子メールまたはwhatsapp携帯電話:少なくとも1つのフィールドに入力してください。",
"The consent phrase provided by the subscriber.": "購読者が提供する同意フレーズ。",
"The value to search for.": "検索する値。",
"Provide user's full name to search.": "検索するユーザーのフルネームを入力します。",
"The platform to send the content to.": "コンテンツを送信するためのプラットフォーム。",
"The type of content to send.": "送信するコンテンツのタイプ",
"The text content to send. Required when content type is Text.": "送信するテキストコンテンツ。コンテンツタイプがテキストの場合に必要です。",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "送信するメディアの URL (画像、ビデオ、オーディオ、ファイル) です。メディアコンテンツの種類に必要です。",
"The tag to use for the message.": "メッセージに使用するタグ。",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "テキスト",
"Image": "画像",
"Video": "ビデオ",
"Audio": "オーディオ",
"File": "ファイル",
"Account Update": "アカウントの更新",
"Confirmed Event Update": "確認されたイベントの更新",
"Human Agent": "ヒューマンエージェント",
"Post Purchase Update": "購入後の更新",
"Business Productivity": "ビジネスの生産性"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automatisering voor marketing op Instagram, WhatsApp, TikTok en Messenger.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "Je kunt een API-sleutel maken door naar **Instellingen-> Extensions -> API** te navigeren.",
"Add Tag to User": "Label toevoegen aan gebruiker",
"Create Subscriber": "Ontvanger aanmaken",
"Find User by Custom Field": "Gebruiker zoeken op aangepast veld",
"Find User by Name": "Zoek gebruiker op naam",
"Remove Tag from User": "Label van gebruiker verwijderen",
"Send Content to User": "Content verzenden naar gebruiker",
"Set Custom Field": "Stel aangepast veld in",
"Adds a tag to a user.": "Voegt een tag toe aan een gebruiker.",
"Creates a Unified or a Whatsapp subscriber.": "Maakt een verenigde of een Whatsapp abonnee aan.",
"Finds a user by custom field.": "Vindt een gebruiker via een aangepast veld.",
"Finds a user by name.": "Vondst een gebruiker op naam.",
"Remove a tag from a user.": "Verwijder een tag van een gebruiker.",
"Sends a content to a user.": "Stuurt content naar een gebruiker.",
"Ass or Updates a custom field value for a user.": "Verandert of update een aangepaste veldwaarde voor een gebruiker.",
"User ID": "Gebruiker ID",
"Tag": "Tagnaam",
"First Name": "Voornaam",
"Last Name": "Achternaam",
"Phone Number": "Telefoon nummer",
"WhatsApp Phone": "WhatsApp telefoon",
"Email": "E-mail",
"Gender": "Geslacht",
"SMS Opt-in": "SMS Int-in",
"Email Opt-in": "E-mail opt-in",
"Consent Phrase": "Toestemming zin",
"Custom Field": "Aangepast veld",
"Value": "Waarde",
"Name": "Naam",
"Platform": "Platform",
"Content Type": "Type inhoud",
"Text Content": "Tekst inhoud",
"Media URL": "Media URL",
"Message Tag": "Bericht label",
"Field Value": "Veld waarde",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Raadpleeg [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) om gebruiker/contact ID te verkrijgen.",
"Fill in at least one field: phone or email or whatsapp phone.": "Vul ten minste één veld in: telefoon of e-mail of Whatsapp telefoon.",
"The consent phrase provided by the subscriber.": "De toestemmingszin van de abonnee.",
"The value to search for.": "De waarde waarnaar gezocht moet worden.",
"Provide user's full name to search.": "Geef de volledige naam van de gebruiker om te zoeken.",
"The platform to send the content to.": "Het platform om inhoud naar toe te sturen.",
"The type of content to send.": "Het type inhoud dat verstuurd moet worden.",
"The text content to send. Required when content type is Text.": "De tekstinhoud om te verzenden. Vereist wanneer het inhoudstype tekst is.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL van de media om te verzenden (afbeelding, video, audio of bestand). Vereist voor bestandstypes.",
"The tag to use for the message.": "Het label om te gebruiken voor het bericht.",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "Tekstveld",
"Image": "Afbeelding",
"Video": "Video",
"Audio": "Geluid",
"File": "Bestand",
"Account Update": "Account bijwerken",
"Confirmed Event Update": "Bevestigde update evenement",
"Human Agent": "Menselijke agent",
"Post Purchase Update": "Post aankoop update",
"Business Productivity": "Zakelijke productiviteit"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automatizações para Instagram, WhatsApp, TikTok e marketing de Messenger.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "Você pode criar uma chave de API navegando para **Configurando-> Extensões -> API**.",
"Add Tag to User": "Adicionar Tag ao Usuário",
"Create Subscriber": "Criar Assinante",
"Find User by Custom Field": "Localizar usuário por campo personalizado",
"Find User by Name": "Localizar usuário por nome",
"Remove Tag from User": "Remover Tag do Usuário",
"Send Content to User": "Enviar Conteúdo ao Usuário",
"Set Custom Field": "Definir campo personalizado",
"Adds a tag to a user.": "Adiciona uma etiqueta a um usuário.",
"Creates a Unified or a Whatsapp subscriber.": "Cria um assinante unificado ou de um Whatsapp.",
"Finds a user by custom field.": "Localiza um usuário por um campo personalizado.",
"Finds a user by name.": "Localiza um usuário por nome.",
"Remove a tag from a user.": "Remover uma tag de um usuário.",
"Sends a content to a user.": "Envia um conteúdo para um usuário.",
"Ass or Updates a custom field value for a user.": "Ass ou Atualiza um valor de campo personalizado para um usuário.",
"User ID": "ID de usuário",
"Tag": "Etiqueta",
"First Name": "Nome",
"Last Name": "Sobrenome",
"Phone Number": "Número de telefone",
"WhatsApp Phone": "Telefone do WhatsApp",
"Email": "e-mail",
"Gender": "Gênero",
"SMS Opt-in": "Opt-in SMS",
"Email Opt-in": "E-mail Opt-in",
"Consent Phrase": "Frase de consentimento",
"Custom Field": "Campo personalizado",
"Value": "Valor",
"Name": "Nome",
"Platform": "Plataforma",
"Content Type": "Tipo de Conteúdo",
"Text Content": "Conteúdo do Texto",
"Media URL": "URL da Mídia",
"Message Tag": "Tag de Mensagem",
"Field Value": "Valor do Campo",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Por favor, consulte [Guia do Manychat](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) para obter ID de usuário/contato.",
"Fill in at least one field: phone or email or whatsapp phone.": "Preencha pelo menos um campo: telefone ou e-mail ou whatsapp telefone.",
"The consent phrase provided by the subscriber.": "A frase de consentimento fornecida pelo assinante.",
"The value to search for.": "O valor a procurar.",
"Provide user's full name to search.": "Forneça o nome completo do usuário para pesquisar.",
"The platform to send the content to.": "A plataforma para enviar conteúdo.",
"The type of content to send.": "O tipo de conteúdo para enviar.",
"The text content to send. Required when content type is Text.": "Conteúdo do texto a ser enviado. Obrigatório quando o tipo de conteúdo é Texto.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL da mídia para enviar (imagem, vídeo, áudio ou arquivo). Necessário para tipos de conteúdo de mídia.",
"The tag to use for the message.": "A tag a ser usada para a mensagem.",
"Facebook": "Siga-nos",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "texto",
"Image": "Imagem:",
"Video": "Vídeo",
"Audio": "Áudio",
"File": "Arquivo",
"Account Update": "Atualização da conta",
"Confirmed Event Update": "Atualização do evento confirmado",
"Human Agent": "Agente humano",
"Post Purchase Update": "Atualização da publicação",
"Business Productivity": "Produtividade de negócios"
}

View File

@@ -0,0 +1,63 @@
{
"Manychat": "Manychat",
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Автоматизации Instagram, WhatsApp, TikTok, и Messenger маркетинга.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "Вы можете создать ключ API, перейдя по ссылке **Setting -> Extensions -> API**.",
"Add Tag to User": "Добавить тег к пользователю",
"Create Subscriber": "Создать подписчика",
"Find User by Custom Field": "Поиск пользователя по настраиваемому полю",
"Find User by Name": "Поиск пользователя по имени",
"Remove Tag from User": "Удалить тег из пользователя",
"Send Content to User": "Отправить контент пользователю",
"Set Custom Field": "Установить настраиваемое поле",
"Adds a tag to a user.": "Добавляет тег пользователю.",
"Creates a Unified or a Whatsapp subscriber.": "Создает единого подписчика или подписчика WhatsApp.",
"Finds a user by custom field.": "Поиск пользователя по настраиваемому полю.",
"Finds a user by name.": "Поиск пользователя по имени.",
"Remove a tag from a user.": "Удалить тег у пользователя.",
"Sends a content to a user.": "Отправляет содержимое пользователю.",
"Ass or Updates a custom field value for a user.": "Присваивает или обновляет значение пользовательского поля.",
"User ID": "ID пользователя",
"Tag": "Тег",
"First Name": "First Name",
"Last Name": "Фамилия",
"Phone Number": "Номер телефона",
"WhatsApp Phone": "WhatsApp Телефон",
"Email": "Почта",
"Gender": "Гендерная проблематика",
"SMS Opt-in": "SMS-заявка",
"Email Opt-in": "Электронная почта",
"Consent Phrase": "Фраза согласия",
"Custom Field": "Настраиваемое поле",
"Value": "Значение",
"Name": "Наименование",
"Platform": "Платформа",
"Content Type": "Тип контента",
"Text Content": "Текстовое содержимое",
"Media URL": "URL-адрес медиа",
"Message Tag": "Тег сообщения",
"Field Value": "Значение поля",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Пожалуйста, ознакомьтесь с [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) для получения идентификатора пользователя/контакта.",
"Fill in at least one field: phone or email or whatsapp phone.": "Заполните хотя бы одно поле: телефон или email или телефон whatsApp.",
"The consent phrase provided by the subscriber.": "Фраза согласия подписчика.",
"The value to search for.": "Значение для поиска.",
"Provide user's full name to search.": "Введите полное имя пользователя для поиска.",
"The platform to send the content to.": "Платформа для отправки содержимого.",
"The type of content to send.": "Тип контента для отправки.",
"The text content to send. Required when content type is Text.": "Текстовое содержимое для отправки. Требуется когда тип содержимого является текстовым.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL для отправки мультимедиа (изображение, видео, аудио или файл). Требуется для типов медиа-контента.",
"The tag to use for the message.": "Тег для использования сообщения.",
"Facebook": "Facebook",
"Instagram": "Инстаграмма",
"WhatsApp": "WhatsApp",
"Telegram": "Телеграмма",
"Text": "Текст",
"Image": "Изображение",
"Video": "Видео",
"Audio": "Аудио",
"File": "Файл",
"Account Update": "Обновление учетной записи",
"Confirmed Event Update": "Обновление события подтверждено",
"Human Agent": "Человеческий агент",
"Post Purchase Update": "Обновление покупки поста",
"Business Productivity": "Производительность бизнеса"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "You can create an API key by navigating to **Setting -> Extensions -> API**.",
"Add Tag to User": "Add Tag to User",
"Create Subscriber": "Create Subscriber",
"Find User by Custom Field": "Find User by Custom Field",
"Find User by Name": "Find User by Name",
"Remove Tag from User": "Remove Tag from User",
"Send Content to User": "Send Content to User",
"Set Custom Field": "Set Custom Field",
"Adds a tag to a user.": "Adds a tag to a user.",
"Creates a Unified or a Whatsapp subscriber.": "Creates a Unified or a Whatsapp subscriber.",
"Finds a user by custom field.": "Finds a user by custom field.",
"Finds a user by name.": "Finds a user by name.",
"Remove a tag from a user.": "Remove a tag from a user.",
"Sends a content to a user.": "Sends a content to a user.",
"Ass or Updates a custom field value for a user.": "Ass or Updates a custom field value for a user.",
"User ID": "User ID",
"Tag": "Tag",
"First Name": "First Name",
"Last Name": "Last Name",
"Phone Number": "Phone Number",
"WhatsApp Phone": "WhatsApp Phone",
"Email": "Email",
"Gender": "Gender",
"SMS Opt-in": "SMS Opt-in",
"Email Opt-in": "Email Opt-in",
"Consent Phrase": "Consent Phrase",
"Custom Field": "Custom Field",
"Value": "Value",
"Name": "Name",
"Platform": "Platform",
"Content Type": "Content Type",
"Text Content": "Text Content",
"Media URL": "Media URL",
"Message Tag": "Message Tag",
"Field Value": "Field Value",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.",
"Fill in at least one field: phone or email or whatsapp phone.": "Fill in at least one field: phone or email or whatsapp phone.",
"The consent phrase provided by the subscriber.": "The consent phrase provided by the subscriber.",
"The value to search for.": "The value to search for.",
"Provide user's full name to search.": "Provide user's full name to search.",
"The platform to send the content to.": "The platform to send the content to.",
"The type of content to send.": "The type of content to send.",
"The text content to send. Required when content type is Text.": "The text content to send. Required when content type is Text.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL of the media to send (image, video, audio, or file). Required for media content types.",
"The tag to use for the message.": "The tag to use for the message.",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "Text",
"Image": "Image",
"Video": "Video",
"Audio": "Audio",
"File": "File",
"Account Update": "Account Update",
"Confirmed Event Update": "Confirmed Event Update",
"Human Agent": "Human Agent",
"Post Purchase Update": "Post Purchase Update",
"Business Productivity": "Business Productivity"
}

View File

@@ -0,0 +1,63 @@
{
"Manychat": "Manychat",
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "You can create an API key by navigating to **Setting -> Extensions -> API**.",
"Add Tag to User": "Add Tag to User",
"Create Subscriber": "Create Subscriber",
"Find User by Custom Field": "Find User by Custom Field",
"Find User by Name": "Find User by Name",
"Remove Tag from User": "Remove Tag from User",
"Send Content to User": "Send Content to User",
"Set Custom Field": "Set Custom Field",
"Adds a tag to a user.": "Adds a tag to a user.",
"Creates a Unified or a Whatsapp subscriber.": "Creates a Unified or a Whatsapp subscriber.",
"Finds a user by custom field.": "Finds a user by custom field.",
"Finds a user by name.": "Finds a user by name.",
"Remove a tag from a user.": "Remove a tag from a user.",
"Sends a content to a user.": "Sends a content to a user.",
"Ass or Updates a custom field value for a user.": "Ass or Updates a custom field value for a user.",
"User ID": "User ID",
"Tag": "Tag",
"First Name": "First Name",
"Last Name": "Last Name",
"Phone Number": "Phone Number",
"WhatsApp Phone": "WhatsApp Phone",
"Email": "Email",
"Gender": "Gender",
"SMS Opt-in": "SMS Opt-in",
"Email Opt-in": "Email Opt-in",
"Consent Phrase": "Consent Phrase",
"Custom Field": "Custom Field",
"Value": "Value",
"Name": "Name",
"Platform": "Nền tảng",
"Content Type": "Content Type",
"Text Content": "Text Content",
"Media URL": "Media URL",
"Message Tag": "Message Tag",
"Field Value": "Field Value",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.",
"Fill in at least one field: phone or email or whatsapp phone.": "Fill in at least one field: phone or email or whatsapp phone.",
"The consent phrase provided by the subscriber.": "The consent phrase provided by the subscriber.",
"The value to search for.": "The value to search for.",
"Provide user's full name to search.": "Provide user's full name to search.",
"The platform to send the content to.": "The platform to send the content to.",
"The type of content to send.": "The type of content to send.",
"The text content to send. Required when content type is Text.": "The text content to send. Required when content type is Text.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL of the media to send (image, video, audio, or file). Required for media content types.",
"The tag to use for the message.": "The tag to use for the message.",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "Text",
"Image": "Image",
"Video": "Video",
"Audio": "Audio",
"File": "File",
"Account Update": "Account Update",
"Confirmed Event Update": "Confirmed Event Update",
"Human Agent": "Human Agent",
"Post Purchase Update": "Post Purchase Update",
"Business Productivity": "Business Productivity"
}

View File

@@ -0,0 +1,62 @@
{
"Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.": "Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.",
"You can create an API key by navigating to **Setting -> Extensions -> API**.": "You can create an API key by navigating to **Setting -> Extensions -> API**.",
"Add Tag to User": "Add Tag to User",
"Create Subscriber": "Create Subscriber",
"Find User by Custom Field": "Find User by Custom Field",
"Find User by Name": "Find User by Name",
"Remove Tag from User": "Remove Tag from User",
"Send Content to User": "Send Content to User",
"Set Custom Field": "Set Custom Field",
"Adds a tag to a user.": "Adds a tag to a user.",
"Creates a Unified or a Whatsapp subscriber.": "Creates a Unified or a Whatsapp subscriber.",
"Finds a user by custom field.": "Finds a user by custom field.",
"Finds a user by name.": "Finds a user by name.",
"Remove a tag from a user.": "Remove a tag from a user.",
"Sends a content to a user.": "Sends a content to a user.",
"Ass or Updates a custom field value for a user.": "Ass or Updates a custom field value for a user.",
"User ID": "User ID",
"Tag": "标签",
"First Name": "First Name",
"Last Name": "名字",
"Phone Number": "Phone Number",
"WhatsApp Phone": "WhatsApp Phone",
"Email": "电子邮件地址",
"Gender": "Gender",
"SMS Opt-in": "SMS Opt-in",
"Email Opt-in": "Email Opt-in",
"Consent Phrase": "Consent Phrase",
"Custom Field": "Custom Field",
"Value": "值",
"Name": "名称",
"Platform": "平台",
"Content Type": "Content Type",
"Text Content": "Text Content",
"Media URL": "Media URL",
"Message Tag": "Message Tag",
"Field Value": "Field Value",
"Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.": "Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.",
"Fill in at least one field: phone or email or whatsapp phone.": "Fill in at least one field: phone or email or whatsapp phone.",
"The consent phrase provided by the subscriber.": "The consent phrase provided by the subscriber.",
"The value to search for.": "The value to search for.",
"Provide user's full name to search.": "Provide user's full name to search.",
"The platform to send the content to.": "The platform to send the content to.",
"The type of content to send.": "The type of content to send.",
"The text content to send. Required when content type is Text.": "The text content to send. Required when content type is Text.",
"URL of the media to send (image, video, audio, or file). Required for media content types.": "URL of the media to send (image, video, audio, or file). Required for media content types.",
"The tag to use for the message.": "The tag to use for the message.",
"Facebook": "Facebook",
"Instagram": "Instagram",
"WhatsApp": "WhatsApp",
"Telegram": "Telegram",
"Text": "文本",
"Image": "Image",
"Video": "Video",
"Audio": "Audio",
"File": "文件",
"Account Update": "Account Update",
"Confirmed Event Update": "Confirmed Event Update",
"Human Agent": "Human Agent",
"Post Purchase Update": "Post Purchase Update",
"Business Productivity": "Business Productivity"
}

View File

@@ -0,0 +1,57 @@
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { findUserByCustomFieldAction } from './lib/actions/find-user-by-custom-field';
import { createSubscriberAction } from './lib/actions/create-subscriber';
import { sendContentToUserAction } from './lib/actions/send-content-to-user';
import { setCustomFieldAction } from './lib/actions/set-custom-fields';
import { removeTagFromUserAction } from './lib/actions/remove-tag-from-user';
import { addTagToUserAction } from './lib/actions/add-tag-to-user';
import { findUserByNameAction } from './lib/actions/find-user-by-name';
import { PieceCategory } from '@activepieces/shared';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { BASE_URL } from './lib/common/props';
export const manychatAuth = PieceAuth.SecretText({
displayName: 'API Key',
required: true,
description: `You can create an API key by navigating to **Setting -> Extensions -> API**.`,
validate: async ({ auth }) => {
try {
await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${BASE_URL}/page/getInfo`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth
},
});
return {
valid: true,
};
} catch (e) {
return {
valid: false,
error: 'Invalid API Key',
};
}
},
});
export const manychat = createPiece({
displayName: 'Manychat',
description: 'Automations for Instagram, WhatsApp, TikTok, and Messenger marketing.',
categories: [PieceCategory.MARKETING],
auth: manychatAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: 'https://cdn.activepieces.com/pieces/manychat.png',
authors: ['neo773', 'kishanprmr'],
actions: [
addTagToUserAction,
createSubscriberAction,
findUserByCustomFieldAction,
findUserByNameAction,
removeTagFromUserAction,
sendContentToUserAction,
setCustomFieldAction,
],
triggers: [],
});

View File

@@ -0,0 +1,49 @@
import { createAction } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manychatAuth } from '../../index';
import { BASE_URL, subscriberId, tagIdDropdown } from '../common/props';
export const addTagToUserAction = createAction({
auth: manychatAuth,
name: 'addTagToUser',
displayName: 'Add Tag to User',
description: 'Adds a tag to a user.',
props: {
subscriberId: subscriberId,
tagId: tagIdDropdown,
},
async run({ auth, propsValue }) {
const { subscriberId, tagId } = propsValue;
const addTagResponse = await httpClient.sendRequest<{ status: string }>({
url: `${BASE_URL}/subscriber/addTag`,
method: HttpMethod.POST,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
body: {
subscriber_id: subscriberId,
tag_id: tagId,
},
});
if (addTagResponse.body.status !== 'success') {
throw Error(`Unexpected Error occured : ${JSON.stringify(addTagResponse.body)}`);
}
const userResponse = await httpClient.sendRequest<{ data: Record<string, any> }>({
method: HttpMethod.GET,
url: `${BASE_URL}/subscriber/getInfo`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
queryParams: {
subscriber_id: `${subscriberId}`,
},
});
return userResponse.body.data;
},
});

View File

@@ -0,0 +1,93 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manychatAuth } from '../../index';
import { BASE_URL } from '../common/props';
import { isNil } from '@activepieces/shared';
export const createSubscriberAction = createAction({
auth: manychatAuth,
name: 'createSubscriber',
displayName: 'Create Subscriber',
description: 'Creates a Unified or a Whatsapp subscriber.',
props: {
first_name: Property.ShortText({
displayName: 'First Name',
required: true,
}),
last_name: Property.ShortText({
displayName: 'Last Name',
required: false,
}),
phone: Property.ShortText({
displayName: 'Phone Number',
required: false,
description: 'Fill in at least one field: phone or email or whatsapp phone.',
}),
whatsapp_phone: Property.ShortText({
displayName: 'WhatsApp Phone',
required: false,
description: 'Fill in at least one field: phone or email or whatsapp phone.',
}),
email: Property.ShortText({
displayName: 'Email',
required: false,
description: 'Fill in at least one field: phone or email or whatsapp phone.',
}),
gender: Property.ShortText({
displayName: 'Gender',
required: false,
}),
has_opt_in_sms: Property.Checkbox({
displayName: 'SMS Opt-in',
required: false,
}),
has_opt_in_email: Property.Checkbox({
displayName: 'Email Opt-in',
required: false,
}),
consent_phrase: Property.ShortText({
displayName: 'Consent Phrase',
description: 'The consent phrase provided by the subscriber.',
required: false,
}),
},
async run({ auth, propsValue }) {
const {
first_name,
last_name,
phone,
whatsapp_phone,
email,
gender,
has_opt_in_email,
has_opt_in_sms,
consent_phrase,
} = propsValue;
if (isNil(phone) && isNil(whatsapp_phone) && isNil(email)) {
throw Error(
'To create a subscriber you must fill in at least one field: phone or email or whatsapp_phone.',
);
}
const response = await httpClient.sendRequest<{ status: string; data: Record<string, any> }>({
method: HttpMethod.POST,
url: `${BASE_URL}/subscriber/createSubscriber`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
body: {
first_name,
last_name,
phone,
whatsapp_phone,
email,
gender,
has_opt_in_sms,
has_opt_in_email,
consent_phrase,
},
});
return response.body;
},
});

View File

@@ -0,0 +1,77 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { BASE_URL } from '../common/props';
import { manychatAuth } from '../../index';
export const findUserByCustomFieldAction = createAction({
auth: manychatAuth,
name: 'findUserByCustomField',
displayName: 'Find User by Custom Field',
description: 'Finds a user by custom field.',
props: {
field: Property.Dropdown({
auth: manychatAuth,
displayName: 'Custom Field',
refreshers: [],
required: true,
options: async ({ auth }) => {
if (!auth) {
return {
placeholder: 'Please connect your account.',
disabled: true,
options: [],
};
}
const response = await httpClient.sendRequest<{
data: Array<{ id: number; name: string; type: string }>;
}>({
url: `${BASE_URL}/page/getCustomFields`,
method: HttpMethod.GET,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text
},
});
return {
disabled: false,
options: response.body.data
.filter((field) => ['text', 'number'].includes(field.type))
.map((field) => ({
label: field.name,
value: field.id,
})),
};
},
}),
value: Property.ShortText({
displayName: 'Value',
description: 'The value to search for.',
required: true,
}),
},
async run({ auth, propsValue }) {
const { field, value } = propsValue;
const response = await httpClient.sendRequest<{
status: string;
data: Array<Record<string, any>>;
}>({
method: HttpMethod.GET,
url: `${BASE_URL}/subscriber/findByCustomField`,
queryParams: {
field_id: field.toString(),
field_value: value,
},
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
});
return {
found: response.body.status === 'success' && response.body.data.length > 0,
result: response.body.data,
};
},
});

View File

@@ -0,0 +1,41 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { BASE_URL } from '../common/props';
import { manychatAuth } from '../../index';
export const findUserByNameAction = createAction({
auth: manychatAuth,
name: 'findUserByName',
displayName: 'Find User by Name',
description: 'Finds a user by name.',
props: {
name: Property.ShortText({
displayName: 'Name',
description: "Provide user's full name to search.",
required: true,
}),
},
async run({ auth, propsValue }) {
const { name } = propsValue;
const response = await httpClient.sendRequest<{
status: string;
data: Array<Record<string, any>>;
}>({
method: HttpMethod.GET,
url: `${BASE_URL}/subscriber/findByName`,
queryParams: {
name: name,
},
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
});
return {
found: response.body.status === 'success' && response.body.data.length > 0,
result: response.body.data,
};
},
});

View File

@@ -0,0 +1,49 @@
import { createAction } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { BASE_URL, subscriberId, tagIdDropdown } from '../common/props';
import { manychatAuth } from '../../index';
export const removeTagFromUserAction = createAction({
name: 'removeTagFromUser',
displayName: 'Remove Tag from User',
description: 'Remove a tag from a user.',
auth:manychatAuth,
props: {
subscriberId: subscriberId,
tagId: tagIdDropdown,
},
async run({ auth, propsValue }) {
const { subscriberId, tagId } = propsValue;
const removeTagResponse = await httpClient.sendRequest<{ status: string }>({
url: `${BASE_URL}/subscriber/removeTag`,
method: HttpMethod.POST,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
body: {
subscriber_id: subscriberId,
tag_id: tagId,
},
});
if (removeTagResponse.body.status !== 'success') {
throw Error(`Unexpected Error occured : ${JSON.stringify(removeTagResponse.body)}`);
}
const userResponse = await httpClient.sendRequest<{ data: Record<string, any> }>({
method: HttpMethod.GET,
url: `${BASE_URL}/subscriber/getInfo`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
queryParams: {
subscriber_id: subscriberId.toString(),
},
});
return userResponse.body.data;
},
});

View File

@@ -0,0 +1,154 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { subscriberId } from '../common/props';
import { manychatAuth } from '../../index';
export const sendContentToUserAction = createAction({
auth: manychatAuth,
name: 'sendContentToUser',
displayName: 'Send Content to User',
description: 'Sends a content to a user.',
props: {
subscriber_id: subscriberId,
platform: Property.StaticDropdown({
displayName: 'Platform',
description: 'The platform to send the content to.',
required: false,
options: {
options: [
{ label: 'Facebook', value: 'facebook' },
{ label: 'Instagram', value: 'instagram' },
{ label: 'WhatsApp', value: 'whatsapp' },
{ label: 'Telegram', value: 'telegram' },
],
},
}),
content_type: Property.StaticDropdown({
displayName: 'Content Type',
description: 'The type of content to send.',
required: true,
options: {
options: [
{ label: 'Text', value: 'text' },
{ label: 'Image', value: 'image' },
{ label: 'Video', value: 'video' },
{ label: 'Audio', value: 'audio' },
{ label: 'File', value: 'file' },
],
},
}),
text_content: Property.LongText({
displayName: 'Text Content',
description: 'The text content to send. Required when content type is Text.',
required: false,
defaultValue: '',
}),
media_url: Property.ShortText({
displayName: 'Media URL',
description:
'URL of the media to send (image, video, audio, or file). Required for media content types.',
required: false,
}),
message_tag: Property.StaticDropdown({
displayName: 'Message Tag',
description: 'The tag to use for the message.',
required: false,
options: {
options: [
{ label: 'Account Update', value: 'ACCOUNT_UPDATE' },
{ label: 'Confirmed Event Update', value: 'CONFIRMED_EVENT_UPDATE' },
{ label: 'Human Agent', value: 'HUMAN_AGENT' },
{ label: 'Post Purchase Update', value: 'POST_PURCHASE_UPDATE' },
{ label: 'Business Productivity', value: 'BUSINESS_PRODUCTIVITY' },
],
},
}),
},
async run({ auth, propsValue }) {
const { subscriber_id, platform, content_type, text_content, media_url, message_tag } =
propsValue;
// Validation
if (content_type === 'text' && !text_content) {
throw new Error('Text content is required when content type is Text');
}
if (['image', 'video', 'audio', 'file'].includes(content_type) && !media_url) {
throw new Error(`Media URL is required when content type is ${content_type}`);
}
// Build the content object based on the content type
const messages = [];
switch (content_type) {
case 'text':
messages.push({
type: 'text',
text: text_content,
});
break;
case 'image':
messages.push({
type: 'image',
url: media_url,
});
break;
case 'video':
messages.push({
type: 'video',
url: media_url,
});
break;
case 'audio':
messages.push({
type: 'audio',
url: media_url,
});
break;
case 'file':
messages.push({
type: 'file',
url: media_url,
});
break;
}
// Prepare the content object
const content: Record<string, any> = {
version: 'v2',
content: {
messages: messages,
actions: [],
quick_replies: [],
},
};
// Add platform type if specified
if (platform && platform !== 'facebook') {
content['content']['type'] = platform;
}
// Prepare the request body
const requestBody: Record<string, any> = {
subscriber_id: subscriber_id,
data: content,
};
if (message_tag) {
requestBody['message_tag'] = message_tag;
}
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://api.manychat.com/fb/sending/sendContent',
headers: {
accept: 'application/json',
Authorization: `Bearer ${auth}`,
'Content-Type': 'application/json',
},
body: requestBody,
});
return response.body;
},
});

View File

@@ -0,0 +1,128 @@
import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { BASE_URL, subscriberId } from '../common/props';
import { manychatAuth } from '../../index';
export const setCustomFieldAction = createAction({
auth: manychatAuth,
name: 'setCustomField',
displayName: 'Set Custom Field',
description: 'Ass or Updates a custom field value for a user.',
props: {
subscriber_id: subscriberId,
field_id: Property.Dropdown({
auth: manychatAuth,
displayName: 'Custom Field',
refreshers: [],
required: true,
options: async ({ auth }) => {
if (!auth) {
return {
placeholder: 'Please connect your account.',
disabled: true,
options: [],
};
}
const response = await httpClient.sendRequest<{
data: Array<{ id: number; name: string; type: string }>;
}>({
url: `${BASE_URL}/page/getCustomFields`,
method: HttpMethod.GET,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text
},
});
return {
disabled: false,
options: response.body.data
.filter((field) => field.type !== 'array')
.map((field) => ({
label: field.name,
value: `${field.id}:::${field.type}`,
})),
};
},
}),
field_value: Property.DynamicProperties({
auth: manychatAuth,
displayName: 'Field Value',
required: true,
refreshers: ['field_id'],
props: async ({ auth, field_id }) => {
if (!auth || !field_id) return {};
const fields: DynamicPropsValue = {};
const fieldType = (field_id as unknown as string).split(':::')[1];
switch (fieldType) {
case 'text':
fields['value'] = Property.ShortText({
displayName: 'Value',
required: true,
});
break;
case 'number':
fields['value'] = Property.Number({
displayName: 'Value',
required: true,
});
break;
case 'date':
case 'datetime':
fields['value'] = Property.DateTime({
displayName: 'Value',
required: true,
});
break;
case 'boolean':
fields['value'] = Property.Checkbox({
displayName: 'Value',
required: true,
});
break;
default:
break;
}
return fields;
},
}),
},
async run({ auth, propsValue }) {
const { subscriber_id, field_id, field_value } = propsValue;
const setCustomFieldResponse = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `${BASE_URL}/subscriber/setCustomField`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
body: {
subscriber_id,
field_id: field_id.split(':::')[0],
field_value: field_value['value'],
},
});
if (setCustomFieldResponse.body.status !== 'success') {
throw Error(`Unexpected Error occured : ${JSON.stringify(setCustomFieldResponse.body)}`);
}
const userResponse = await httpClient.sendRequest<{ data: Record<string, any> }>({
method: HttpMethod.GET,
url: `${BASE_URL}/subscriber/getInfo`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
queryParams: {
subscriber_id: `${subscriber_id}`,
},
});
return userResponse.body.data;
},
});

View File

@@ -0,0 +1,45 @@
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { Property } from '@activepieces/pieces-framework';
import { manychatAuth } from '../..';
export const BASE_URL = 'https://api.manychat.com/fb';
export const subscriberId = Property.Number({
displayName: 'User ID',
description: `Please refer [Manychat Guide](https://help.manychat.com/hc/en-us/articles/14959510331420-How-to-generate-a-token-for-the-Manychat-API-and-where-to-get-parameters#h_01JCR55RJ0B0PQW6HDW6RW0A42) to obtain user/contact ID.`,
required: true,
});
export const tagIdDropdown = Property.Dropdown({
auth: manychatAuth,
displayName: 'Tag',
refreshers: [],
required: true,
options: async ({ auth }) => {
if (!auth) {
return {
placeholder: 'Please connect your account.',
disabled: true,
options: [],
};
}
const response = await httpClient.sendRequest<{ data: Array<{ id: number; name: string }> }>({
url: `${BASE_URL}/page/getTags`,
method: HttpMethod.GET,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text
},
});
return {
disabled: false,
options: response.body.data.map((tag) => ({
label: tag.name,
value: tag.id,
})),
};
},
});

View File

@@ -0,0 +1,19 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}

View File

@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
}