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

View File

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

View File

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

View File

@@ -0,0 +1,57 @@
{
"name": "pieces-sendfox",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/sendfox/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/sendfox",
"tsConfig": "packages/pieces/community/sendfox/tsconfig.lib.json",
"packageJson": "packages/pieces/community/sendfox/package.json",
"main": "packages/pieces/community/sendfox/src/index.ts",
"assets": [
"packages/pieces/community/sendfox/*.md",
{
"input": "packages/pieces/community/sendfox/src/i18n",
"output": "./src/i18n",
"glob": "**/!(i18n.json)"
}
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true
},
"dependsOn": [
"^build",
"prebuild"
]
},
"publish": {
"command": "node tools/scripts/publish.mjs pieces-sendfox {args.ver} {args.tag}",
"dependsOn": [
"build"
]
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
},
"prebuild": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/pieces/community/sendfox",
"command": "bun install --no-save --silent"
},
"dependsOn": [
"^build"
]
}
},
"tags": []
}

View File

@@ -0,0 +1,113 @@
import { Property, OAuth2PropertyValue } from '@activepieces/pieces-framework';
import {
HttpMethod,
HttpMessageBody,
HttpResponse,
httpClient,
AuthenticationType,
} from '@activepieces/pieces-common';
import { sendfoxAuth } from '..';
export async function getLists(accessToken: string) {
const list_of_lists = [];
let last_page = 1;
for (let i = 1; i <= last_page; i++) {
const response = (
await callsendfoxApi<{
current_page: number;
data: {
id: number;
name: string;
}[];
last_page: number;
}>(HttpMethod.GET, `lists?page=${i}`, accessToken, undefined)
).body;
last_page = response.last_page;
const lists = response.data;
list_of_lists.push(lists);
}
return list_of_lists;
}
export async function getcontacts(accessToken: string) {
let list_of_contacts = [];
let last_page = 1;
for (let i = 1; i <= last_page; i++) {
const response = (
await callsendfoxApi<{
current_page: number;
data: {
id: number;
first_name: string;
last_name: string;
}[];
last_page: number;
}>(HttpMethod.GET, `contacts?page=${i}`, accessToken, undefined)
).body;
last_page = response.last_page;
const contacts = response.data;
list_of_contacts.push(contacts);
}
// convert the list of contacts to have name as first_name+last_name
list_of_contacts = list_of_contacts.flat().map((contact) => {
return {
id: contact.id,
name: contact.first_name + ' ' + contact.last_name,
};
});
return list_of_contacts;
}
export const sendfoxCommon = {
lists: Property.Dropdown({
auth: sendfoxAuth,
displayName: 'Lists',
required: false,
refreshers: ['auth'],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'connect your account first',
options: [],
};
}
const authentication = auth.secret_text;
if (!authentication) {
return {
disabled: true,
placeholder: 'connect your account first',
options: [],
};
}
const accessToken = authentication;
const list_of_lists = await getLists(accessToken);
return {
disabled: false,
options: list_of_lists.flat().map((list) => {
return {
label: list.name,
value: list.id,
};
}),
};
},
}),
};
export async function callsendfoxApi<T extends HttpMessageBody>(
method: HttpMethod,
apiUrl: string,
accessToken: string,
body: any | undefined
): Promise<HttpResponse<T>> {
return await httpClient.sendRequest<T>({
method: method,
url: `https://api.sendfox.com/${apiUrl}`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: accessToken,
},
body: body,
});
}

View File

@@ -0,0 +1,31 @@
{
"SendFox": "SendFox",
"Email marketing made simple": "Email marketing made simple",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Create List",
"Unsubscribe Contact": "Unsubscribe Contact",
"Create Contact": "Create Contact",
"Custom API Call": "Custom API Call",
"Create a new list": "Create a new list",
"Unsubscribe a contact": "Unsubscribe a contact",
"Create a new contact": "Create a new contact",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"List Name": "List Name",
"Email": "Email",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Lists",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"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"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "E-Mail-Marketing einfach gemacht",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "Um Ihr persönliches Token zu erhalten, folgen Sie diesen Schritten:\n1. Loggen Sie sich in Ihr SendFox-Konto ein.\n2. Besuchen Sie https://sendfox.com/account/oauth um einen\n3 zu erstellen. Klicken Sie von OAuth Apps auf Neues Token.\n4. Geben Sie einen beliebigen Namen ein und klicken Sie dann auf Erstellen.\n5. Kopieren und fügen Sie Ihren Token hier ein.",
"Create List": "Liste erstellen",
"Unsubscribe Contact": "Kontakt abbestellen",
"Create Contact": "Kontakt erstellen",
"Custom API Call": "Eigener API-Aufruf",
"Create a new list": "Neue Liste erstellen",
"Unsubscribe a contact": "Kontakt abbestellen",
"Create a new contact": "Neuen Kontakt erstellen",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"List Name": "Listenname",
"Email": "E-Mail",
"First Name": "Vorname",
"Last Name": "Nachname",
"Lists": "Listen",
"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)",
"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"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "Marketing por email simplificado",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "Para obtener tu token personal, sigue estos pasos:\n1. Inicia sesión en tu cuenta de SendFox.\n2. Visita https://sendfox.com/account/oauth para crear una\n3. Desde OAuth Apps haga clic en Crear Nuevo Token.\n4. Introduce cualquier nombre que quieras y haz clic en crear.\n5. Copia y pega tu token aquí.",
"Create List": "Crear Lista",
"Unsubscribe Contact": "Desuscribirse Contacto",
"Create Contact": "Crear contacto",
"Custom API Call": "Llamada API personalizada",
"Create a new list": "Crear una nueva lista",
"Unsubscribe a contact": "Darse de baja de un contacto",
"Create a new contact": "Crear un nuevo contacto",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"List Name": "Nombre de lista",
"Email": "E-mail",
"First Name": "Nombre",
"Last Name": "Apellido",
"Lists": "Listas",
"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)",
"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"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "Courriel marketing simplifié",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Créer une liste",
"Unsubscribe Contact": "Se désabonner du contact",
"Create Contact": "Créer un contact",
"Custom API Call": "Appel d'API personnalisé",
"Create a new list": "Créer une nouvelle liste",
"Unsubscribe a contact": "Se désabonner d'un contact",
"Create a new contact": "Créer un nouveau contact",
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
"List Name": "Nom de la liste",
"Email": "Courriel",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Listes",
"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)",
"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": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,31 @@
{
"SendFox": "SendFox",
"Email marketing made simple": "Email marketing made simple",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Create List",
"Unsubscribe Contact": "Unsubscribe Contact",
"Create Contact": "Create Contact",
"Custom API Call": "Custom API Call",
"Create a new list": "Create a new list",
"Unsubscribe a contact": "Unsubscribe a contact",
"Create a new contact": "Create a new contact",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"List Name": "List Name",
"Email": "Email",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Lists",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"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"
}

View File

@@ -0,0 +1,31 @@
{
"SendFox": "SendFox",
"Email marketing made simple": "Email marketing made simple",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Create List",
"Unsubscribe Contact": "Unsubscribe Contact",
"Create Contact": "Create Contact",
"Custom API Call": "Custom API Call",
"Create a new list": "Create a new list",
"Unsubscribe a contact": "Unsubscribe a contact",
"Create a new contact": "Create a new contact",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"List Name": "List Name",
"Email": "Email",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Lists",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"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"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "メールマーケティングがシンプルになりました",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "リストを作成",
"Unsubscribe Contact": "連絡先を購読解除",
"Create Contact": "連絡先を作成",
"Custom API Call": "カスタムAPI通話",
"Create a new list": "新しいリストを作成",
"Unsubscribe a contact": "連絡先の登録を解除",
"Create a new contact": "新しい連絡先を作成",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"List Name": "リスト名",
"Email": "Eメールアドレス",
"First Name": "名",
"Last Name": "Last Name",
"Lists": "リスト",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"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": "頭"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "E-mailmarketing eenvoudig gemaakt",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "Om uw persoonlijke token te verkrijgen, volg deze stappen:\n1. Log in op uw SendFox account.\n2. Bezoek https://sendfox.com/account/oauth om een\n3 te maken. Van OAuth Apps klik op Nieuw Token.\n4. Voer elke naam in die u wilt en klik vervolgens op aanmaken.\n5. Kopieer en plak hier uw token.",
"Create List": "Lijst aanmaken",
"Unsubscribe Contact": "Ontvangers uitschrijven",
"Create Contact": "Contactpersoon aanmaken",
"Custom API Call": "Custom API Call",
"Create a new list": "Maak een nieuwe lijst",
"Unsubscribe a contact": "Een contact uitschrijven",
"Create a new contact": "Een nieuw contact maken",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"List Name": "Lijst Naam",
"Email": "E-mail",
"First Name": "Voornaam",
"Last Name": "Achternaam",
"Lists": "Lijsten",
"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)",
"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"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "Marketing de e-mail simplificado",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "Para obter seu token pessoal, siga estes passos:\n1. Inicie sessão na sua conta SendFox.\n2. Visite https://sendfox.com/account/oauth para criar um\n3. A partir de aplicativos OAuth clique em Criar Novo Token.\n4. Digite qualquer nome que quiser então clique em criar.\n5. Copie e cole o seu token aqui.",
"Create List": "Criar lista",
"Unsubscribe Contact": "Cancelar contato",
"Create Contact": "Criar contato",
"Custom API Call": "Chamada de API personalizada",
"Create a new list": "Criar uma nova lista",
"Unsubscribe a contact": "Cancelar contato",
"Create a new contact": "Criar um novo contato",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"List Name": "Lista de nomes",
"Email": "e-mail",
"First Name": "Nome",
"Last Name": "Sobrenome",
"Lists": "Listas",
"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)",
"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"
}

View File

@@ -0,0 +1,31 @@
{
"SendFox": "SendFox",
"Email marketing made simple": "Простой маркетинг по электронной почте",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "Для получения вашего персонального токена выполните следующие шаги:\n1. Войдите в свой аккаунт SendFox.\n2. Перейдите на сайт https://sendfox.com/account/oauth, чтобы создать его.\n3. В разделе OAuth приложения нажмите на «Создать новый токен».\n4. Введите любое имя, затем нажмите создать.\n5. Скопируйте и вставьте ваш токен сюда.",
"Create List": "Создать список",
"Unsubscribe Contact": "Отписаться от контактов",
"Create Contact": "Создать контакт",
"Custom API Call": "Пользовательский вызов API",
"Create a new list": "Создать новый список",
"Unsubscribe a contact": "Отменить подписку на контакт",
"Create a new contact": "Создать новый контакт",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"List Name": "Название списка",
"Email": "Почта",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Списки",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "Email marketing made simple",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Create List",
"Unsubscribe Contact": "Unsubscribe Contact",
"Create Contact": "Create Contact",
"Custom API Call": "Custom API Call",
"Create a new list": "Create a new list",
"Unsubscribe a contact": "Unsubscribe a contact",
"Create a new contact": "Create a new contact",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"List Name": "List Name",
"Email": "Email",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Lists",
"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)",
"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"
}

View File

@@ -0,0 +1,31 @@
{
"SendFox": "SendFox",
"Email marketing made simple": "Email marketing made simple",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Create List",
"Unsubscribe Contact": "Unsubscribe Contact",
"Create Contact": "Create Contact",
"Custom API Call": "Custom API Call",
"Create a new list": "Create a new list",
"Unsubscribe a contact": "Unsubscribe a contact",
"Create a new contact": "Create a new contact",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"List Name": "List Name",
"Email": "Email",
"First Name": "First Name",
"Last Name": "Last Name",
"Lists": "Lists",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"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"
}

View File

@@ -0,0 +1,32 @@
{
"Email marketing made simple": "Email marketing made simple",
"To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.": "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
"Create List": "Create List",
"Unsubscribe Contact": "Unsubscribe Contact",
"Create Contact": "Create Contact",
"Custom API Call": "自定义 API 呼叫",
"Create a new list": "Create a new list",
"Unsubscribe a contact": "Unsubscribe a contact",
"Create a new contact": "Create a new contact",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"List Name": "List Name",
"Email": "电子邮件地址",
"First Name": "First Name",
"Last Name": "名字",
"Lists": "Lists",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"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": "黑色"
}

View File

@@ -0,0 +1,36 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { createContact } from './lib/actions/create-contact';
import { createList } from './lib/actions/create-list';
import { unsubscribe } from './lib/actions/unsubscribe-contact';
export const sendfoxAuth = PieceAuth.SecretText({
displayName: 'API Key',
description:
'To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.',
required: true,
});
export const sendfox = createPiece({
displayName: 'SendFox',
description: 'Email marketing made simple',
auth: sendfoxAuth,
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/sendfox.png',
categories: [PieceCategory.MARKETING],
authors: ["Salem-Alaa","kishanprmr","MoShizzle","abuaboud"],
actions: [
createList,
unsubscribe,
createContact,
createCustomApiCallAction({
baseUrl: () => 'https://api.sendfox.com',
auth: sendfoxAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${auth.secret_text}`,
}),
}),
],
triggers: [],
});

View File

@@ -0,0 +1,49 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { sendfoxAuth } from '../../index';
import { callsendfoxApi, sendfoxCommon } from '../../common';
import { HttpMethod } from '@activepieces/pieces-common';
export const createContact = createAction({
name: 'create-contact',
auth: sendfoxAuth,
displayName: 'Create Contact',
description: 'Create a new contact',
props: {
email: Property.ShortText({
displayName: 'Email',
required: true,
}),
firstname: Property.ShortText({
displayName: 'First Name',
required: false,
}),
lastname: Property.ShortText({
displayName: 'Last Name',
required: false,
}),
list: sendfoxCommon.lists,
},
async run(context) {
const authentication = context.auth;
const accessToken = authentication.secret_text;
const email = context.propsValue.email;
const firstname = context.propsValue.firstname;
const lastname = context.propsValue.lastname;
const list = context.propsValue.list;
const request_body: { [key: string]: any } = { email: email };
if (firstname) request_body['first_name'] = firstname;
if (lastname) request_body['last_name'] = lastname;
if (list) request_body['lists'] = [list];
const response = (
await callsendfoxApi(
HttpMethod.POST,
'contacts',
accessToken,
request_body
)
).body;
return response;
},
});

View File

@@ -0,0 +1,28 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { sendfoxAuth } from '../../index';
import { callsendfoxApi } from '../../common';
import { HttpMethod } from '@activepieces/pieces-common';
export const createList = createAction({
name: 'create-list',
auth: sendfoxAuth,
displayName: 'Create List',
description: 'Create a new list',
props: {
task_name: Property.ShortText({
displayName: 'List Name',
required: true,
}),
},
async run(context) {
const authentication = context.auth;
const accessToken = authentication.secret_text;
const task_name = context.propsValue.task_name;
const response = (
await callsendfoxApi(HttpMethod.POST, 'lists', accessToken, {
name: task_name,
})
).body;
return [response];
},
});

View File

@@ -0,0 +1,28 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { sendfoxAuth } from '../../index';
import { callsendfoxApi } from '../../common';
import { HttpMethod } from '@activepieces/pieces-common';
export const unsubscribe = createAction({
name: 'unsubscribe',
auth: sendfoxAuth,
displayName: 'Unsubscribe Contact',
description: 'Unsubscribe a contact',
props: {
email: Property.ShortText({
displayName: 'Email',
required: true,
}),
},
async run(context) {
const authentication = context.auth;
const accessToken = authentication.secret_text;
const email = context.propsValue.email;
const response = (
await callsendfoxApi(HttpMethod.PATCH, 'unsubscribe', accessToken, {
email: email,
})
).body;
return [response];
},
});

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"]
}