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-smaily
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-smaily` to build the library.

View File

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

View File

@@ -0,0 +1,65 @@
{
"name": "pieces-smaily",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/smaily/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/smaily",
"tsConfig": "packages/pieces/community/smaily/tsconfig.lib.json",
"packageJson": "packages/pieces/community/smaily/package.json",
"main": "packages/pieces/community/smaily/src/index.ts",
"assets": [
"packages/pieces/community/smaily/*.md",
{
"input": "packages/pieces/community/smaily/src/i18n",
"output": "./src/i18n",
"glob": "**/!(i18n.json)"
}
],
"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/smaily",
"command": "bun install --no-save --silent"
},
"dependsOn": [
"^build"
]
}
}
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Domäne",
"User Name": "Benutzername",
"Password": "Kennwort",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Klicken Sie auf Profilbild (oben rechts), navigieren Sie zu **Einstellungen**.\n 2. Gehen Sie auf die Registerkarte **Integrations** und klicken Sie auf **Neuen Benutzer erstellen**.\n 3. Kopieren Sie generierte Domain, Benutzer und Passwort.",
"Create or Update Subscriber": "Abonnent erstellen oder aktualisieren",
"Get Subscriber": "Abonnent erhalten",
"Custom API Call": "Eigener API-Aufruf",
"Creates a new subscriber or update an existing subscriber by email.": "Erstellt einen neuen Abonnenten oder aktualisiert einen bestehenden Abonnenten per E-Mail.",
"retrieves detailed subscriber information for a given email address.": "ruft detaillierte Abonnenten-Informationen für eine angegebene E-Mail-Adresse ab.",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Email": "E-Mail",
"Subscription Status": "Abonnementstatus",
"Custom Fields": "Eigene Felder",
"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)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Gehe zu **Abonnenten Tab-> Alle Abonnenten -> Felder verwalten** um benutzerdefinierte Feldnamen zu erhalten.",
"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..",
"Unsubscribed": "Abgemeldet",
"Subscribed": "Abonniert",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Dominio",
"User Name": "Usuario",
"Password": "Contraseña",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.",
"Create or Update Subscriber": "Crear o actualizar suscriptores",
"Get Subscriber": "Obtener suscriptor",
"Custom API Call": "Llamada API personalizada",
"Creates a new subscriber or update an existing subscriber by email.": "Crea un nuevo suscriptor o actualiza un suscriptor existente por correo electrónico.",
"retrieves detailed subscriber information for a given email address.": "recupera información detallada del suscriptor para una dirección de correo electrónico determinada.",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Email": "E-mail",
"Subscription Status": "Estado de la suscripción",
"Custom Fields": "Campos personalizados",
"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)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Ve a **Tabla de Suscriptores-> Todos los Suscriptores -> Administrar Campos** para obtener nombres de campos personalizados.",
"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.",
"Unsubscribed": "Desuscrito",
"Subscribed": "Suscrito",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Domaine",
"User Name": "Nom d'utilisateur",
"Password": "Password",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.",
"Create or Update Subscriber": "Créer ou mettre à jour un abonné",
"Get Subscriber": "Obtenir l'abonné",
"Custom API Call": "Appel d'API personnalisé",
"Creates a new subscriber or update an existing subscriber by email.": "Crée un nouvel abonné ou met à jour un abonné existant par courriel.",
"retrieves detailed subscriber information for a given email address.": "récupère les informations d'abonné détaillées pour une adresse e-mail donnée.",
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
"Email": "Courriel",
"Subscription Status": "Statut de l'abonnement",
"Custom Fields": "Champs personnalisés",
"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'expiration (en secondes)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Allez dans l'onglet **Abonnés -> Tous les abonnés -> Gérer les champs** pour obtenir des noms de champs personnalisés.",
"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.",
"Unsubscribed": "Désabonné",
"Subscribed": "Inscrit",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "ドメイン",
"User Name": "ユーザー名",
"Password": "パスワード",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.",
"Create or Update Subscriber": "購読者を作成または更新",
"Get Subscriber": "購読者を取得",
"Custom API Call": "カスタムAPI通話",
"Creates a new subscriber or update an existing subscriber by email.": "新しい購読者を作成するか、メールで既存の購読者を更新します。",
"retrieves detailed subscriber information for a given email address.": "特定のメールアドレスの購読者情報を取得します。",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Email": "Eメールアドレス",
"Subscription Status": "サブスクリプションステータス",
"Custom Fields": "カスタムフィールド",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "カスタムフィールド名を取得するには、**購読者タブ->すべての購読者->フィールドを管理**に移動してください。",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"Unsubscribed": "購読解除済み",
"Subscribed": "購読中",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Domein",
"User Name": "Gebruikers naam",
"Password": "Wachtwoord",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Klik op het profiel pic (rechterbovenhoek), navigeer naar **Voorkeuren**.\n 2. Ga naar het tabblad **Integraties** en klik op **Maak een nieuwe gebruiker aan**.\n 3. Kopieer het gegenereerde domein, gebruiker en wachtwoord.",
"Create or Update Subscriber": "Aanmaken of bijwerken abonnee",
"Get Subscriber": "Ontvang abonnee",
"Custom API Call": "Custom API Call",
"Creates a new subscriber or update an existing subscriber by email.": "Maakt een nieuwe abonnee aan of werk een bestaande abonnee via e-mail bij.",
"retrieves detailed subscriber information for a given email address.": "haalt gedetailleerde abonnee-informatie op voor een bepaald e-mailadres.",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Email": "E-mail",
"Subscription Status": "Inschrijving Status",
"Custom Fields": "Aangepaste velden",
"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)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Ga naar **Abonnees Tab-> Alle Abonnees -> Beheer Velden** om aangepaste veldnamen te krijgen.",
"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..",
"Unsubscribed": "Uitgeschreven",
"Subscribed": "Ingeschreven",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Domínio",
"User Name": "Nome de usuário",
"Password": "Senha",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Clique na foto do perfil (canto superior direito), navegue até **Preferências**.\n 2. Vá para a guia **Integrações** e clique em **Criar um Novo Usuário**.\n 3. Copie o domínio gerado, usuário e senha.",
"Create or Update Subscriber": "Criar ou Atualizar Assinante",
"Get Subscriber": "Obter Assinante",
"Custom API Call": "Chamada de API personalizada",
"Creates a new subscriber or update an existing subscriber by email.": "Cria um novo assinante ou atualiza um assinante existente por e-mail.",
"retrieves detailed subscriber information for a given email address.": "recupera informações detalhadas de assinante para um endereço de e-mail fornecido.",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Email": "e-mail",
"Subscription Status": "Estado Subscrição",
"Custom Fields": "Campos Personalizados",
"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)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Vá para **Assinantes guias--> Todos assinantes -> Gerenciar Campos** para obter nomes de campos personalizados.",
"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..",
"Unsubscribed": "Cancelada",
"Subscribed": "Subscrito",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA"
}

View File

@@ -0,0 +1,32 @@
{
"Smaily": "Смайлика",
"Domain": "Домен",
"User Name": "Имя пользователя",
"Password": "Пароль",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Нажмите на пик профиля (верхний правый уголок), перейдите в **Preferences**.\n 2. Перейдите на вкладку **Интеграции** и нажмите на **Создать нового пользователя**.\n 3. Скопируйте сгенерированный домен, имя пользователя и пароль.",
"Create or Update Subscriber": "Создать или обновить подписчика",
"Get Subscriber": "Получить подписчика",
"Custom API Call": "Пользовательский вызов API",
"Creates a new subscriber or update an existing subscriber by email.": "Создает нового абонента или обновляет существующего абонента по электронной почте.",
"retrieves detailed subscriber information for a given email address.": "получает подробную информацию о подписчике на указанный адрес электронной почты.",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"Email": "Почта",
"Subscription Status": "Статус подписки",
"Custom Fields": "Пользовательские поля",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Перейдите в **Вкладку подписчиков-> Все Подписчики -> Управление Полями** для получения пользовательских имен полей.",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"Unsubscribed": "Отписано",
"Subscribed": "Подписан",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Domain",
"User Name": "User Name",
"Password": "Password",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.",
"Create or Update Subscriber": "Create or Update Subscriber",
"Get Subscriber": "Get Subscriber",
"Custom API Call": "Custom API Call",
"Creates a new subscriber or update an existing subscriber by email.": "Creates a new subscriber or update an existing subscriber by email.",
"retrieves detailed subscriber information for a given email address.": "retrieves detailed subscriber information for a given email address.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Email": "Email",
"Subscription Status": "Subscription Status",
"Custom Fields": "Custom Fields",
"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)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.",
"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..",
"Unsubscribed": "Unsubscribed",
"Subscribed": "Subscribed",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,32 @@
{
"Smaily": "Smaily",
"Domain": "Domain",
"User Name": "User Name",
"Password": "Password",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.",
"Create or Update Subscriber": "Create or Update Subscriber",
"Get Subscriber": "Get Subscriber",
"Custom API Call": "Custom API Call",
"Creates a new subscriber or update an existing subscriber by email.": "Creates a new subscriber or update an existing subscriber by email.",
"retrieves detailed subscriber information for a given email address.": "retrieves detailed subscriber information for a given email address.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Email": "Email",
"Subscription Status": "Subscription Status",
"Custom Fields": "Custom Fields",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Unsubscribed": "Unsubscribed",
"Subscribed": "Subscribed",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,33 @@
{
"Domain": "Domain",
"User Name": "User Name",
"Password": "密码",
"\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.": "\n 1. Click on profile pic (top right corner), navigate to **Preferences**.\n 2. Go to **Integrations** tab and click on **Create a New User**.\n 3. Copy generated domain, user and password.",
"Create or Update Subscriber": "Create or Update Subscriber",
"Get Subscriber": "Get Subscriber",
"Custom API Call": "自定义 API 呼叫",
"Creates a new subscriber or update an existing subscriber by email.": "Creates a new subscriber or update an existing subscriber by email.",
"retrieves detailed subscriber information for a given email address.": "retrieves detailed subscriber information for a given email address.",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Email": "电子邮件地址",
"Subscription Status": "Subscription Status",
"Custom Fields": "Custom Fields",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.": "Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"Unsubscribed": "Unsubscribed",
"Subscribed": "Subscribed",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色"
}

View File

@@ -0,0 +1,86 @@
import {
createPiece,
PieceAuth,
PiecePropValueSchema,
Property,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import {
AuthenticationType,
httpClient,
HttpMethod, createCustomApiCallAction
} from '@activepieces/pieces-common';
import { createOrUpdateSubscriberAction } from './lib/actions/create-or-update-subscriber.action';
import { getSubscriberAction } from './lib/actions/get-subscriber.action';
export const smailyAuth = PieceAuth.CustomAuth({
description: `
1. Click on profile pic (top right corner), navigate to **Preferences**.
2. Go to **Integrations** tab and click on **Create a New User**.
3. Copy generated domain, user and password.`,
required: true,
props: {
domain: Property.ShortText({
displayName: 'Domain',
required: true,
}),
username: Property.ShortText({
displayName: 'User Name',
required: true,
}),
password: Property.ShortText({
displayName: 'Password',
required: true,
}),
},
validate: async ({ auth }) => {
try {
await httpClient.sendRequest({
method: HttpMethod.GET,
url: `https://${auth.domain}.sendsmaily.net/api/organizations/users.php`,
authentication: {
type: AuthenticationType.BASIC,
username: auth.username,
password: auth.password,
},
});
return {
valid: true,
};
} catch {
return {
valid: false,
error: 'Please provide correct credentials.',
};
}
},
});
export const smaily = createPiece({
displayName: 'Smaily',
auth: smailyAuth,
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/smaily.png',
categories: [PieceCategory.MARKETING],
authors: ['kishanprmr'],
actions: [createOrUpdateSubscriberAction, getSubscriberAction,
createCustomApiCallAction({
auth:smailyAuth,
baseUrl: (auth)=>{
if (!auth) {
return '';
}
return `https://${auth.props.domain}.sendsmaily.net/api`
},
authMapping: async (auth) => ({
Authorization: `Basic ${Buffer.from(
`${auth.props.username}:${
auth.props.password
}`
).toString('base64')}`,
}),
})
],
triggers: [],
});

View File

@@ -0,0 +1,59 @@
import {
AuthenticationType,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import { smailyAuth } from '../../';
import { createAction, Property } from '@activepieces/pieces-framework';
export const createOrUpdateSubscriberAction = createAction({
auth: smailyAuth,
name: 'create-or-update-subscriber',
displayName: 'Create or Update Subscriber',
description:
'Creates a new subscriber or update an existing subscriber by email.',
props: {
email: Property.ShortText({
displayName: 'Email',
required: true,
}),
is_unsubscribed: Property.StaticDropdown({
displayName: 'Subscription Status',
required: true,
defaultValue: 0,
options: {
disabled: false,
options: [
{ label: 'Unsubscribed', value: 1 },
{ label: 'Subscribed', value: 0 },
],
},
}),
custom_fields: Property.Object({
displayName: 'Custom Fields',
description: `Go to **Subscribers Tab-> All Subscribers -> Manage Fields** to get custom field names.`,
required: false,
}),
},
async run(context) {
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `https://${context.auth.props.domain}.sendsmaily.net/api/contact.php`,
headers: {
'Content-Type': 'application/json',
},
authentication: {
type: AuthenticationType.BASIC,
username: context.auth.props.username,
password: context.auth.props.password,
},
body: {
email: context.propsValue.email,
is_unsubscribed: context.propsValue.is_unsubscribed,
...context.propsValue.custom_fields,
},
});
return response.body;
},
});

View File

@@ -0,0 +1,40 @@
import {
AuthenticationType,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import { smailyAuth } from '../../';
import { createAction, Property } from '@activepieces/pieces-framework';
export const getSubscriberAction = createAction({
auth: smailyAuth,
name: 'get-subscriber',
displayName: 'Get Subscriber',
description:
'retrieves detailed subscriber information for a given email address.',
props: {
email: Property.ShortText({
displayName: 'Email',
required: true,
}),
},
async run(context) {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `https://${context.auth.props.domain}.sendsmaily.net/api/contact.php`,
queryParams: {
email: context.propsValue.email,
},
headers: {
'Content-Type': 'application/json',
},
authentication: {
type: AuthenticationType.BASIC,
username: context.auth.props.username,
password: context.auth.props.password,
},
});
return response.body;
},
});

View File

@@ -0,0 +1,19 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": 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"]
}