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

View File

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

View File

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

View File

@@ -0,0 +1,26 @@
{
"TidyCal": "TidyCal",
"Streamline your scheduling": "Streamline your scheduling",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "Custom API Call",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"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",
"Booking Canceled": "Booking Canceled",
"New Booking": "New Booking",
"New Contact": "New Contact",
"Triggers when a new booking is canceled": "Triggers when a new booking is canceled",
"Triggers when a new booking is created": "Triggers when a new booking is created",
"Triggers when a new contact is created": "Triggers when a new contact is created"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Streamline Ihre Terminplanung",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Persönliches Zugangs-Token\n1- Besuche https://tidycal. om/integrations/oauth und klicken Sie auf \"Neues Token erstellen\"\n2- Geben Sie einen Namen für Ihr Token ein und klicken Sie auf \"Erstellen\"\n",
"Custom API Call": "Eigener API-Aufruf",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"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",
"Booking Canceled": "Buchung storniert",
"New Booking": "Neue Buchung",
"New Contact": "Neuer Kontakt",
"Triggers when a new booking is canceled": "Wird ausgelöst, wenn eine neue Buchung storniert wird",
"Triggers when a new booking is created": "Wird ausgelöst, wenn eine neue Buchung erstellt wird",
"Triggers when a new contact is created": "Wird ausgelöst, wenn ein neuer Kontakt erstellt wird"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Escribe tu programación",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Token de Acceso Personal\n1- Visita https://tidycal. om/integraciones/oauth y haga clic en \"Crear un nuevo token\"\n2- Introduzca un nombre para su token y haga clic en \"Crear\"\n",
"Custom API Call": "Llamada API personalizada",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"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",
"Booking Canceled": "Reserva cancelada",
"New Booking": "Nueva reserva",
"New Contact": "Nuevo contacto",
"Triggers when a new booking is canceled": "Dispara cuando una nueva reserva es cancelada",
"Triggers when a new booking is created": "Dispara cuando se crea una nueva reserva",
"Triggers when a new contact is created": "Dispara cuando se crea un nuevo contacto"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Simplifiez votre planification",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Jeton d'accès personnel\n1- Visitez https://tidycal. om/integrations/oauth et cliquez sur \"Créer un nouveau jeton\"\n2- Entrez un nom pour votre jeton et cliquez sur \"Créer\"\n",
"Custom API Call": "Appel d'API personnalisé",
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
"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",
"Booking Canceled": "Réservation annulée",
"New Booking": "Nouvelle réservation",
"New Contact": "Nouveau contact",
"Triggers when a new booking is canceled": "Déclenche quand une nouvelle réservation est annulée",
"Triggers when a new booking is created": "Déclenche quand une nouvelle réservation est créée",
"Triggers when a new contact is created": "Déclenche lorsqu'un nouveau contact est créé"
}

View File

@@ -0,0 +1,26 @@
{
"TidyCal": "TidyCal",
"Streamline your scheduling": "Streamline your scheduling",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "Custom API Call",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"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",
"Booking Canceled": "Booking Canceled",
"New Booking": "New Booking",
"New Contact": "New Contact",
"Triggers when a new booking is canceled": "Triggers when a new booking is canceled",
"Triggers when a new booking is created": "Triggers when a new booking is created",
"Triggers when a new contact is created": "Triggers when a new contact is created"
}

View File

@@ -0,0 +1,26 @@
{
"TidyCal": "TidyCal",
"Streamline your scheduling": "Streamline your scheduling",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "Custom API Call",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"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",
"Booking Canceled": "Booking Canceled",
"New Booking": "New Booking",
"New Contact": "New Contact",
"Triggers when a new booking is canceled": "Triggers when a new booking is canceled",
"Triggers when a new booking is created": "Triggers when a new booking is created",
"Triggers when a new contact is created": "Triggers when a new contact is created"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "スケジュールを合理化する",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "カスタムAPI通話",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"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": "頭",
"Booking Canceled": "予約がキャンセルされました",
"New Booking": "新規予約",
"New Contact": "新しい連絡先",
"Triggers when a new booking is canceled": "新しい予約がキャンセルされたときにトリガーします",
"Triggers when a new booking is created": "新しい予約が作成されたときに発生する",
"Triggers when a new contact is created": "新しい連絡先が作成されたときにトリガーします"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Streamline je planning",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Persoonlijke Toegang Token\n1- Bezoek https://tidycal. om/integratie/oauth en klik op \"Nieuwe token aanmaken\"\n2- Voer een naam in voor uw token en klik op \"Aanmaken\"\n",
"Custom API Call": "Custom API Call",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"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",
"Booking Canceled": "Boeking geannuleerd",
"New Booking": "Nieuwe boeking",
"New Contact": "Nieuw contactpersoon",
"Triggers when a new booking is canceled": "Triggert wanneer een nieuwe boeking wordt geannuleerd",
"Triggers when a new booking is created": "Triggert wanneer een nieuwe boeking wordt gemaakt",
"Triggers when a new contact is created": "Triggert wanneer een nieuw contact wordt aangemaakt"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Agilize seu agendamento",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Token de acesso pessoal\n1- Visite https://tidycal. om/integrations/oauth e clique em \"Criar um novo token\"\n2- Insira um nome para seu token e clique em \"Criar\"\n",
"Custom API Call": "Chamada de API personalizada",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"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",
"Booking Canceled": "Reserva Cancelada",
"New Booking": "Nova Reserva",
"New Contact": "Novo Contato",
"Triggers when a new booking is canceled": "Aciona quando uma nova reserva é anulada",
"Triggers when a new booking is created": "Dispara quando uma nova reserva é criada",
"Triggers when a new contact is created": "Dispara quando um novo contato é criado"
}

View File

@@ -0,0 +1,26 @@
{
"TidyCal": "TidyCal",
"Streamline your scheduling": "Трансляция планирования",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "Пользовательский вызов API",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"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",
"Booking Canceled": "Бронирование отменено",
"New Booking": "Новое бронирование",
"New Contact": "Новый контакт",
"Triggers when a new booking is canceled": "Триггеры при отмене нового заказа",
"Triggers when a new booking is created": "Триггеры при создании нового заказа",
"Triggers when a new contact is created": "Включает при создании нового контакта"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Streamline your scheduling",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "Custom API Call",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"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",
"Booking Canceled": "Booking Canceled",
"New Booking": "New Booking",
"New Contact": "New Contact",
"Triggers when a new booking is canceled": "Triggers when a new booking is canceled",
"Triggers when a new booking is created": "Triggers when a new booking is created",
"Triggers when a new contact is created": "Triggers when a new contact is created"
}

View File

@@ -0,0 +1,26 @@
{
"TidyCal": "TidyCal",
"Streamline your scheduling": "Streamline your scheduling",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "Custom API Call",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"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",
"Booking Canceled": "Booking Canceled",
"New Booking": "New Booking",
"New Contact": "New Contact",
"Triggers when a new booking is canceled": "Triggers when a new booking is canceled",
"Triggers when a new booking is created": "Triggers when a new booking is created",
"Triggers when a new contact is created": "Triggers when a new contact is created"
}

View File

@@ -0,0 +1,27 @@
{
"Streamline your scheduling": "Streamline your scheduling",
"\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n": "\n# Personal Access Token\n1- Visit https://tidycal.com/integrations/oauth and click on \"Create a new token\"\n2- Enter a name for your token and click on \"Create\"\n",
"Custom API Call": "自定义 API 呼叫",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"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": "黑色",
"Booking Canceled": "Booking Canceled",
"New Booking": "New Booking",
"New Contact": "New Contact",
"Triggers when a new booking is canceled": "Triggers when a new booking is canceled",
"Triggers when a new booking is created": "Triggers when a new booking is created",
"Triggers when a new contact is created": "Triggers when a new contact is created"
}

View File

@@ -0,0 +1,57 @@
import {
createCustomApiCallAction,
HttpMethod,
} from '@activepieces/pieces-common';
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { AppConnectionType, PieceCategory } from '@activepieces/shared';
import { calltidycalapi } from './lib/common';
import { tidycalbookingcancelled } from './lib/trigger/cancelled-booking';
import { tidycalnewbooking } from './lib/trigger/new-booking';
import { tidycalnewcontact } from './lib/trigger/new-contacts';
const markdown = `
# Personal Access Token
1- Visit https://tidycal.com/integrations/oauth and click on "Create a new token"
2- Enter a name for your token and click on "Create"
`;
export const tidyCalAuth = PieceAuth.SecretText({
displayName: 'API Key',
description: markdown,
required: true,
validate: async ({ auth }) => {
try {
await calltidycalapi(HttpMethod.GET, 'bookings', {
type: AppConnectionType.SECRET_TEXT,
secret_text: auth,
}, undefined);
return {
valid: true,
};
} catch (e) {
return {
valid: false,
error: 'Invalid API Key',
};
}
},
});
export const tidycal = createPiece({
displayName: 'TidyCal',
description: 'Streamline your scheduling',
auth: tidyCalAuth,
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/tidycal.png',
categories: [PieceCategory.PRODUCTIVITY],
authors: ["Salem-Alaa","kishanprmr","MoShizzle","abuaboud"],
actions: [
createCustomApiCallAction({
baseUrl: () => 'https://tidycal.com/api',
auth: tidyCalAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${auth}`,
}),
}),
],
triggers: [tidycalbookingcancelled, tidycalnewbooking, tidycalnewcontact],
});

View File

@@ -0,0 +1,26 @@
import {
AuthenticationType,
HttpMessageBody,
HttpMethod,
HttpResponse,
httpClient,
} from '@activepieces/pieces-common';
import { tidyCalAuth } from '../..';
import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
export async function calltidycalapi<T extends HttpMessageBody>(
method: HttpMethod,
apiUrl: string,
accessToken: AppConnectionValueForAuthProperty<typeof tidyCalAuth>,
body: any | undefined
): Promise<HttpResponse<T>> {
return await httpClient.sendRequest<T>({
method: method,
url: `https://tidycal.com/api/${apiUrl}`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: accessToken.secret_text,
},
body: body,
});
}

View File

@@ -0,0 +1,98 @@
import { AppConnectionValueForAuthProperty, createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import {
DedupeStrategy,
HttpMethod,
Polling,
pollingHelper,
} from '@activepieces/pieces-common';
import { calltidycalapi } from '../common';
import { tidyCalAuth } from '../../';
import dayjs from 'dayjs';
export const tidycalbookingcancelled = createTrigger({
auth: tidyCalAuth,
name: 'booking_canceled',
displayName: 'Booking Canceled',
description: 'Triggers when a new booking is canceled',
props: {},
sampleData: {
data: [
{
id: 1,
contact_id: 1,
booking_type_id: 1,
starts_at: '2022-01-01T00:00:00.000000Z',
ends_at: '2022-02-01T00:00:00.000000Z',
cancelled_at: '2022-02-01T00:00:00.000000Z',
created_at: '2022-02-01T00:00:00.000000Z',
updated_at: '2022-02-01T00:00:00.000000Z',
timezone: 'America/Los_Angeles',
meeting_url: 'https://zoom.us/j/949494949494',
meeting_id: 'fw44lkj48fks',
questions: {},
contact: {
id: '1',
email: 'john@doe.com',
name: 'John Doe',
created_at: '2022-01-01T00:00:00.000000Z',
updated_at: '2022-01-01T00:00:00.000000Z',
},
},
],
},
type: TriggerStrategy.POLLING,
onEnable: async (context) => {
await pollingHelper.onEnable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
onDisable: async (context) => {
await pollingHelper.onDisable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
run: async (context) => {
return await pollingHelper.poll(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
files: context.files,
});
},
test: async (context) => {
return await pollingHelper.test(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
files: context.files,
});
},
});
const polling: Polling<AppConnectionValueForAuthProperty<typeof tidyCalAuth>, Record<string, never>> = {
strategy: DedupeStrategy.TIMEBASED,
items: async ({ auth, lastFetchEpochMS }) => {
const currentValues = await calltidycalapi<{
data: {
id: string;
cancelled_at: string;
}[];
}>(HttpMethod.GET, `bookings?cancelled=true`, auth, undefined);
const cancelledBookings = currentValues.body;
const bookings = cancelledBookings.data.filter((item) => {
const cancelledAt = dayjs(item.cancelled_at);
return cancelledAt.isAfter(lastFetchEpochMS);
});
return bookings.map((item) => {
return {
epochMilliSeconds: dayjs(item.cancelled_at).valueOf(),
data: item,
};
});
},
};

View File

@@ -0,0 +1,98 @@
import { AppConnectionValueForAuthProperty, createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import {
DedupeStrategy,
HttpMethod,
Polling,
pollingHelper,
} from '@activepieces/pieces-common';
import { calltidycalapi } from '../common';
import { tidyCalAuth } from '../../';
import dayjs from 'dayjs';
export const tidycalnewbooking = createTrigger({
auth: tidyCalAuth,
name: 'new_booking',
displayName: 'New Booking',
description: 'Triggers when a new booking is created',
props: {},
sampleData: {
data: [
{
id: 1,
contact_id: 1,
booking_type_id: 1,
starts_at: '2022-01-01T00:00:00.000000Z',
ends_at: '2022-02-01T00:00:00.000000Z',
cancelled_at: '2022-02-01T00:00:00.000000Z',
created_at: '2022-02-01T00:00:00.000000Z',
updated_at: '2022-02-01T00:00:00.000000Z',
timezone: 'America/Los_Angeles',
meeting_url: 'https://zoom.us/j/949494949494',
meeting_id: 'fw44lkj48fks',
questions: {},
contact: {
id: '1',
email: 'john@doe.com',
name: 'John Doe',
created_at: '2022-01-01T00:00:00.000000Z',
updated_at: '2022-01-01T00:00:00.000000Z',
},
},
],
},
type: TriggerStrategy.POLLING,
onEnable: async (context) => {
await pollingHelper.onEnable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
onDisable: async (context) => {
await pollingHelper.onDisable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
run: async (context) => {
return await pollingHelper.poll(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
files: context.files,
});
},
test: async (context) => {
return await pollingHelper.test(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
files: context.files,
});
},
});
const polling: Polling<AppConnectionValueForAuthProperty<typeof tidyCalAuth>, Record<string, never>> = {
strategy: DedupeStrategy.TIMEBASED,
items: async ({ auth, lastFetchEpochMS }) => {
const currentValues = await calltidycalapi<{
data: {
id: string;
created_at: string;
}[];
}>(HttpMethod.GET, `bookings?cancelled=false`, auth, undefined);
const createdBookings = currentValues.body;
const bookings = createdBookings.data.filter((item) => {
const created_at = dayjs(item.created_at);
return created_at.isAfter(lastFetchEpochMS);
});
return bookings.map((item) => {
return {
epochMilliSeconds: dayjs(item.created_at).valueOf(),
data: item,
};
});
},
};

View File

@@ -0,0 +1,84 @@
import { AppConnectionValueForAuthProperty, createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import {
DedupeStrategy,
HttpMethod,
Polling,
pollingHelper,
} from '@activepieces/pieces-common';
import { calltidycalapi } from '../common';
import { tidyCalAuth } from '../../';
import dayjs from 'dayjs';
export const tidycalnewcontact = createTrigger({
auth: tidyCalAuth,
name: 'new_contact',
displayName: 'New Contact',
description: 'Triggers when a new contact is created',
props: {},
sampleData: {
data: [
{
id: '1',
email: 'john@doe.com',
name: 'John Doe',
created_at: '2022-01-01T00:00:00.000000Z',
updated_at: '2022-01-01T00:00:00.000000Z',
},
],
},
type: TriggerStrategy.POLLING,
onEnable: async (context) => {
await pollingHelper.onEnable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
onDisable: async (context) => {
await pollingHelper.onDisable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
run: async (context) => {
return await pollingHelper.poll(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
files: context.files,
});
},
test: async (context) => {
return await pollingHelper.test(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
files: context.files,
});
},
});
const polling: Polling<AppConnectionValueForAuthProperty<typeof tidyCalAuth>, Record<string, never>> = {
strategy: DedupeStrategy.TIMEBASED,
items: async ({ auth, lastFetchEpochMS }) => {
const currentValues = await calltidycalapi<{
data: {
id: string;
created_at: string;
}[];
}>(HttpMethod.GET, `contacts`, auth, undefined);
const createdcontacts = currentValues.body;
const contact = createdcontacts.data.filter((item) => {
const created_at = dayjs(item.created_at);
return created_at.isAfter(lastFetchEpochMS);
});
return contact.map((item) => {
return {
epochMilliSeconds: dayjs(item.created_at).valueOf(),
data: item,
};
});
},
};

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