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:
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify ist eine Plattform zum Erstellen und Bereitstellen von Websites und Apps.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nZur Authentifizierung mit Netlify:\n\n1. Gehen Sie zu Ihren Netlify-Benutzereinstellungen\n2. Navigieren Sie zu \"Anwendungen\" → \"OAuth-Anwendungen\"\n3. Klicken Sie auf \"Neue OAuth-Anwendung\"\n4. Fügen Sie https://cloud.activepieces hinzu. om/redirect zu autorisierten Weiterleitungs-URIs\n5. Kopieren Sie die Client-ID und Client-Geheimnis\n6. Benutze den OAuth2-Fluss unten\n\n**Hinweis:** Wenn dein Team SAML SSO verwendet, musst du dem Team den Zugriff gewähren, wenn du dein Token generierst.\n",
|
||||
"Start Deploy": "Deploy starten",
|
||||
"Get Site": "Seite abrufen",
|
||||
"List Site Deploys": "Site-Deploys auflisten",
|
||||
"List Files": "Dateien auflisten",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Löscht einen neuen Build für eine Website auf Netlify. Unterstützt das Leeren des Build-Caches.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Erhalten Sie eine angegebene Site. Hinweis: Umgebungsvariable Schlüssel und Werte wurden von build_settings verschoben. nv und repo.env zu einem neuen Endpunkt. Bitte verwenden Sie getEnvVars um die Site-Umgebungsvariablen abzurufen.",
|
||||
"Returns a list of all deploys for a specific site.": "Gibt eine Liste aller Deploys für eine bestimmte Site zurück.",
|
||||
"Returns a list of all the files in the current deploy.": "Gibt eine Liste aller Dateien im aktuellen Deploy zurück.",
|
||||
"Site": "Site",
|
||||
"Clear Build Cache": "Build-Cache leeren",
|
||||
"Page": "Seite",
|
||||
"Per Page": "Pro Seite",
|
||||
"Select the site to deploy": "Wählen Sie die zu installierende Seite",
|
||||
"Whether to clear the build cache before building": "Ob der Build-Cache vor dem Erstellen geleert werden soll",
|
||||
"Select the site to retrieve information for": "Wählen Sie die Website zum Abrufen von Informationen für",
|
||||
"Select the site to list deploys for": "Wählen Sie die Seite, für die Deploys aufgelistet werden sollen",
|
||||
"Page number for pagination (starts from 1)": "Seitenzahl für Seitenzahl (beginnt ab 1)",
|
||||
"Number of items per page (max 100)": "Anzahl der Elemente pro Seite (max. 100)",
|
||||
"Select the site to list files for": "Wählen Sie die Seite, für die Dateien aufgelistet werden sollen",
|
||||
"New Deploy Started": "Neuer Deploy gestartet",
|
||||
"New Deploy Succeeded": "Neuer Deploy erfolgreich",
|
||||
"New Deploy Failed": "Neuer Deploy fehlgeschlagen",
|
||||
"New Form Submission": "Neue Formulareinreichung",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Löscht sofort ab, wenn ein Deploy-Job auf Ihrer Netlify-Seite beginnt.",
|
||||
"Fires when a new site version has successfully deployed.": "Feuer, wenn eine neue Version erfolgreich eingesetzt wurde.",
|
||||
"Fires when a site deploy fails.": "Feuert ab, wenn eine Site nicht bereitstellt.",
|
||||
"Fires when a Netlify form submission is received.": "Feuert ab, wenn eine Netlify-Formularabgabe empfangen wird.",
|
||||
"Select the site to monitor for deploy events": "Wählen Sie die Website für Deploy-Events",
|
||||
"Select the site to monitor for successful deploy events": "Wählen Sie die zu überwachende Seite für erfolgreiche Deploy-Events",
|
||||
"Select the site to monitor for failed deploy events": "Wählen Sie die zu überwachende Seite für fehlgeschlagene Deploy-Ereignisse",
|
||||
"Select the site to monitor for form submissions": "Wählen Sie die zu überwachende Seite für Formulareinreichungen"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify es una plataforma para construir y desplegar sitios web y aplicaciones.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n",
|
||||
"Start Deploy": "Iniciar despliegue",
|
||||
"Get Site": "Obtener sitio",
|
||||
"List Site Deploys": "Listar Desplegados del Sitio",
|
||||
"List Files": "Listar archivos",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Activa una nueva compilación para un sitio en Netlify. Soporta limpiar caché de compilación.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Obtener un sitio especificado. Nota: Las claves y valores de las variables de entorno se han movido desde build_settings. nv y repo.env a un nuevo punto final. Utilice getEnvVars para recuperar las variables de entorno del sitio.",
|
||||
"Returns a list of all deploys for a specific site.": "Devuelve una lista de todas las implementaciones para un sitio específico.",
|
||||
"Returns a list of all the files in the current deploy.": "Devuelve una lista de todos los archivos en el despliegue actual.",
|
||||
"Site": "Sitio",
|
||||
"Clear Build Cache": "Limpiar caché de compilación",
|
||||
"Page": "Pgina",
|
||||
"Per Page": "Por página",
|
||||
"Select the site to deploy": "Seleccione el sitio para desplegar",
|
||||
"Whether to clear the build cache before building": "Si limpiar la caché de construcción antes de construir",
|
||||
"Select the site to retrieve information for": "Seleccione el sitio para recuperar información para",
|
||||
"Select the site to list deploys for": "Seleccione el sitio para la lista de implementaciones para",
|
||||
"Page number for pagination (starts from 1)": "Número de página para la paginación (comienza desde 1)",
|
||||
"Number of items per page (max 100)": "Número de elementos por página (máx. 100)",
|
||||
"Select the site to list files for": "Seleccione el sitio para listar archivos para",
|
||||
"New Deploy Started": "Nuevo despliegue iniciado",
|
||||
"New Deploy Succeeded": "Nuevo despliegue exitoso",
|
||||
"New Deploy Failed": "Nuevo despliegue fallido",
|
||||
"New Form Submission": "Nuevo envío de formulario",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Inmediatamente cuando un trabajo de despliegue comienza en su sitio Netlify.",
|
||||
"Fires when a new site version has successfully deployed.": "Dispara cuando una nueva versión del sitio se ha desplegado correctamente.",
|
||||
"Fires when a site deploy fails.": "Dispara cuando falle el despliegue de un sitio.",
|
||||
"Fires when a Netlify form submission is received.": "Dispara cuando se recibe un envío de un formulario de Netlify.",
|
||||
"Select the site to monitor for deploy events": "Seleccione el sitio para monitorizar los eventos de despliegue",
|
||||
"Select the site to monitor for successful deploy events": "Seleccione el sitio para monitorear los eventos de despliegue exitoso",
|
||||
"Select the site to monitor for failed deploy events": "Seleccione el sitio para monitorizar eventos de despliegue fallidos",
|
||||
"Select the site to monitor for form submissions": "Seleccione el sitio para monitorizar los envíos de formularios"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify est une plate-forme pour la construction et le déploiement de sites Web et d'applications.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n",
|
||||
"Start Deploy": "Commencer le déploiement",
|
||||
"Get Site": "Obtenir le site",
|
||||
"List Site Deploys": "Lister les déploiements du site",
|
||||
"List Files": "Lister les fichiers",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Déclenche une nouvelle version pour un site sur Netlify. Supporte le cache de compilation.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Récupère un site spécifié. Note: Les clés et les valeurs de variables d'environnement ont été déplacées depuis build_settings. nv et repo.env vers un nouveau terminal. Veuillez utiliser getEnvVars pour récupérer les variables d'environnement du site.",
|
||||
"Returns a list of all deploys for a specific site.": "Retourne une liste de tous les déploiements pour un site spécifique.",
|
||||
"Returns a list of all the files in the current deploy.": "Retourne une liste de tous les fichiers du déploiement courant.",
|
||||
"Site": "Site",
|
||||
"Clear Build Cache": "Vider le cache de compilation",
|
||||
"Page": "Page",
|
||||
"Per Page": "Par page",
|
||||
"Select the site to deploy": "Sélectionnez le site à déployer",
|
||||
"Whether to clear the build cache before building": "Si vous voulez vider le cache de construction avant la construction",
|
||||
"Select the site to retrieve information for": "Sélectionnez le site pour lequel récupérer les informations",
|
||||
"Select the site to list deploys for": "Sélectionnez le site pour lister les déploiements pour",
|
||||
"Page number for pagination (starts from 1)": "Numéro de page pour la pagination (commence à 1)",
|
||||
"Number of items per page (max 100)": "Nombre d'éléments par page (max 100)",
|
||||
"Select the site to list files for": "Sélectionnez le site pour lister les fichiers pour",
|
||||
"New Deploy Started": "Nouveau Déploiement commencé",
|
||||
"New Deploy Succeeded": "Nouveau déploiement réussi",
|
||||
"New Deploy Failed": "Échec du nouveau déploiement",
|
||||
"New Form Submission": "Nouvelle soumission de formulaire",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Déclenche immédiatement quand une tâche de déploiement commence sur votre site Netlify.",
|
||||
"Fires when a new site version has successfully deployed.": "Se déclenche lorsqu'un nouveau site a été déployé avec succès.",
|
||||
"Fires when a site deploy fails.": "Tire quand le déploiement d'un site échoue.",
|
||||
"Fires when a Netlify form submission is received.": "Déclenche lorsqu'un formulaire Netlify est soumis.",
|
||||
"Select the site to monitor for deploy events": "Sélectionnez le site à surveiller pour les événements de déploiement",
|
||||
"Select the site to monitor for successful deploy events": "Sélectionnez le site à surveiller pour les événements de déploiement réussi",
|
||||
"Select the site to monitor for failed deploy events": "Sélectionnez le site à surveiller pour les événements de déploiement échoués",
|
||||
"Select the site to monitor for form submissions": "Sélectionnez le site à surveiller pour les soumissions de formulaire"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify はウェブサイトやアプリを構築および展開するためのプラットフォームです。",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n",
|
||||
"Start Deploy": "デプロイを開始",
|
||||
"Get Site": "サイトを取得する",
|
||||
"List Site Deploys": "サイトデプロイの一覧",
|
||||
"List Files": "リストファイル",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Netlify 上のサイトの新しいビルドをトリガーします。ビルド キャッシュのクリアをサポートします。",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "指定されたサイトを取得します.注意: 環境変数のキーと値はbuild_settingsから移動しました. nv と repo.env を新しいエンドポイントに追加しました。環境変数を取得するには getEnvVar を使用してください。",
|
||||
"Returns a list of all deploys for a specific site.": "特定のサイトのすべてのデプロイのリストを返します。",
|
||||
"Returns a list of all the files in the current deploy.": "現在のデプロイ中のすべてのファイルのリストを返します。",
|
||||
"Site": "サイト",
|
||||
"Clear Build Cache": "ビルドキャッシュをクリア",
|
||||
"Page": "ページ",
|
||||
"Per Page": "ページごと",
|
||||
"Select the site to deploy": "デプロイするサイトを選択してください",
|
||||
"Whether to clear the build cache before building": "ビルドする前にビルドキャッシュをクリアするか",
|
||||
"Select the site to retrieve information for": "情報を取得するサイトを選択してください",
|
||||
"Select the site to list deploys for": "デプロイするサイトを選択してください",
|
||||
"Page number for pagination (starts from 1)": "ページネーションのページ番号(1から始まる)",
|
||||
"Number of items per page (max 100)": "Number of items per page (max 100)",
|
||||
"Select the site to list files for": "ファイル一覧を表示するサイトを選択してください",
|
||||
"New Deploy Started": "新しいデプロイが開始されました",
|
||||
"New Deploy Succeeded": "新しいデプロイに成功しました",
|
||||
"New Deploy Failed": "新規デプロイに失敗しました",
|
||||
"New Form Submission": "新しいフォーム提出",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Netlify サイトでデプロイジョブが開始されるとすぐに発生します。",
|
||||
"Fires when a new site version has successfully deployed.": "新しいサイトバージョンが正常にデプロイされたときに発生します。",
|
||||
"Fires when a site deploy fails.": "サイトのデプロイに失敗したときに発生します。",
|
||||
"Fires when a Netlify form submission is received.": "Netlify フォームの提出が受信されたときに発生します。",
|
||||
"Select the site to monitor for deploy events": "イベントのデプロイを監視するサイトを選択してください",
|
||||
"Select the site to monitor for successful deploy events": "正常にデプロイされるイベントを監視するサイトを選択します",
|
||||
"Select the site to monitor for failed deploy events": "デプロイに失敗したイベントを監視するサイトを選択してください",
|
||||
"Select the site to monitor for form submissions": "フォームの提出物を監視するサイトを選択してください"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify is een platform voor het bouwen en implementeren van websites en apps.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nOm te verifiëren met Netlify:\n\n1. Ga naar uw Netlify gebruikersinstellingen\n2. Navigeer naar \"Applicaties\" → \"OAuth applicaties\"\n3. Klik op \"Nieuwe OAuth applicatie\"\n4. Voeg https://cloud.activepieces toe. om/redirect naar toestemming voor redirect URIs\n5. Kopieer de Client-ID en Client-geheim\n6. Gebruik de OAuth2 stroom onder\n\n**Opmerking:** Als je team SAML SSO gebruikt, moet je bij het genereren van je token toegang verlenen aan het team.\n",
|
||||
"Start Deploy": "Start Implementeren",
|
||||
"Get Site": "Site ophalen",
|
||||
"List Site Deploys": "Lijst van implementaties",
|
||||
"List Files": "Lijst van bestanden",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Triggert een nieuwe build voor een site op Netlify. Ondersteunt het opschonen build cache.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Krijg een opgegeven site. Opmerking: sleutels en waarden van Omgevingsvariabele zijn verplaatst van build_settings. nv en repo.env naar een nieuw eindpunt. Gebruik getEnvVars om omgevingsvariabelen op te halen.",
|
||||
"Returns a list of all deploys for a specific site.": "Geeft een lijst van alle implementaties voor een specifieke site.",
|
||||
"Returns a list of all the files in the current deploy.": "Geeft een lijst van alle bestanden in de huidige implementatie.",
|
||||
"Site": "Website",
|
||||
"Clear Build Cache": "Wis Build Cache",
|
||||
"Page": "Pagina",
|
||||
"Per Page": "Per pagina",
|
||||
"Select the site to deploy": "Selecteer de site om te implementeren",
|
||||
"Whether to clear the build cache before building": "Wel of niet wissen van de build cache voor het bouwen",
|
||||
"Select the site to retrieve information for": "Selecteer de site om informatie op te halen voor",
|
||||
"Select the site to list deploys for": "Selecteer de site om implementaties voor te tonen",
|
||||
"Page number for pagination (starts from 1)": "Paginanummer voor paginering (begint vanaf 1)",
|
||||
"Number of items per page (max 100)": "Aantal items per pagina (max 100)",
|
||||
"Select the site to list files for": "Selecteer de site om bestanden voor te tonen",
|
||||
"New Deploy Started": "Nieuwe Deploy gestart",
|
||||
"New Deploy Succeeded": "Nieuwe Deploy Geslaagd",
|
||||
"New Deploy Failed": "Nieuwe Deploy Mislukt",
|
||||
"New Form Submission": "Nieuw formulier indienen",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Vuurt onmiddellijk wanneer een implementatietaak op uw website begint.",
|
||||
"Fires when a new site version has successfully deployed.": "Vuurt wanneer een nieuwe siteversie met succes is geïmplementeerd.",
|
||||
"Fires when a site deploy fails.": "Loopt af wanneer een installatie mislukt.",
|
||||
"Fires when a Netlify form submission is received.": "Vuurt wanneer een Netlify formulieren worden ingediend.",
|
||||
"Select the site to monitor for deploy events": "Selecteer de site om te monitoren voor deploy events",
|
||||
"Select the site to monitor for successful deploy events": "Selecteer de site om te monitoren voor succesvolle implementatiegebeurtenissen",
|
||||
"Select the site to monitor for failed deploy events": "Selecteer de site om te monitoren voor mislukte implementatiegebeurtenissen",
|
||||
"Select the site to monitor for form submissions": "Selecteer de site om te monitoren voor formulierinzendingen"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify é uma plataforma para construir e implantar sites e aplicativos.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n",
|
||||
"Start Deploy": "Iniciar implantação",
|
||||
"Get Site": "Obter Site",
|
||||
"List Site Deploys": "Listar implantações do site",
|
||||
"List Files": "Listar Arquivos",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Aciona uma nova compilação para um site no Netlify. Suporta a limpeza do cache de compilação.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Obtém um site específico. Nota: Chaves e valores de variáveis de ambiente foram movidos de build_settings. nv e repo.env para um novo endpoint. Por favor, use getEnvVars para recuperar as variáveis de ambiente do site.",
|
||||
"Returns a list of all deploys for a specific site.": "Retorna uma lista de todos os deploys para um site específico.",
|
||||
"Returns a list of all the files in the current deploy.": "Retorna uma lista de todos os arquivos da implantação atual.",
|
||||
"Site": "site",
|
||||
"Clear Build Cache": "Limpar cache da compilação",
|
||||
"Page": "Página",
|
||||
"Per Page": "Por página",
|
||||
"Select the site to deploy": "Selecione o site para implantar",
|
||||
"Whether to clear the build cache before building": "Limpar o cache de compilação antes de construir",
|
||||
"Select the site to retrieve information for": "Selecione o site para recuperar informações de",
|
||||
"Select the site to list deploys for": "Selecione o site para listar deploys",
|
||||
"Page number for pagination (starts from 1)": "Número da página para paginação (começa de 1)",
|
||||
"Number of items per page (max 100)": "Número de itens por página (máx. 100)",
|
||||
"Select the site to list files for": "Selecione o site para listar arquivos",
|
||||
"New Deploy Started": "Nova implantação iniciada",
|
||||
"New Deploy Succeeded": "Nova implantação bem-sucedida",
|
||||
"New Deploy Failed": "Nova implantação falhou",
|
||||
"New Form Submission": "Nova Submissão de Formulário",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Atira imediatamente quando um trabalho de deploy começa em seu site Netlify.",
|
||||
"Fires when a new site version has successfully deployed.": "Efetua quando uma nova versão do site for implantada com sucesso.",
|
||||
"Fires when a site deploy fails.": "Atira quando a implantação de site falhar.",
|
||||
"Fires when a Netlify form submission is received.": "Efetua quando um formulário Netlify é recebido na submissão.",
|
||||
"Select the site to monitor for deploy events": "Selecione o site para monitorar eventos de deploy",
|
||||
"Select the site to monitor for successful deploy events": "Selecione o site para monitorar eventos de deploy com sucesso",
|
||||
"Select the site to monitor for failed deploy events": "Selecione o site para monitorar eventos de deploy falhados",
|
||||
"Select the site to monitor for form submissions": "Selecione o site para monitorar as submissões de formulários"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify is a platform for building and deploying websites and apps.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n",
|
||||
"Start Deploy": "Start Deploy",
|
||||
"Get Site": "Get Site",
|
||||
"List Site Deploys": "List Site Deploys",
|
||||
"List Files": "List Files",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Triggers a new build for a site on Netlify. Supports clearing build cache.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.",
|
||||
"Returns a list of all deploys for a specific site.": "Returns a list of all deploys for a specific site.",
|
||||
"Returns a list of all the files in the current deploy.": "Returns a list of all the files in the current deploy.",
|
||||
"Site": "Site",
|
||||
"Clear Build Cache": "Clear Build Cache",
|
||||
"Page": "Page",
|
||||
"Per Page": "Per Page",
|
||||
"Select the site to deploy": "Select the site to deploy",
|
||||
"Whether to clear the build cache before building": "Whether to clear the build cache before building",
|
||||
"Select the site to retrieve information for": "Select the site to retrieve information for",
|
||||
"Select the site to list deploys for": "Select the site to list deploys for",
|
||||
"Page number for pagination (starts from 1)": "Page number for pagination (starts from 1)",
|
||||
"Number of items per page (max 100)": "Number of items per page (max 100)",
|
||||
"Select the site to list files for": "Select the site to list files for",
|
||||
"New Deploy Started": "New Deploy Started",
|
||||
"New Deploy Succeeded": "New Deploy Succeeded",
|
||||
"New Deploy Failed": "New Deploy Failed",
|
||||
"New Form Submission": "New Form Submission",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Fires immediately when a deploy job starts on your Netlify site.",
|
||||
"Fires when a new site version has successfully deployed.": "Fires when a new site version has successfully deployed.",
|
||||
"Fires when a site deploy fails.": "Fires when a site deploy fails.",
|
||||
"Fires when a Netlify form submission is received.": "Fires when a Netlify form submission is received.",
|
||||
"Select the site to monitor for deploy events": "Select the site to monitor for deploy events",
|
||||
"Select the site to monitor for successful deploy events": "Select the site to monitor for successful deploy events",
|
||||
"Select the site to monitor for failed deploy events": "Select the site to monitor for failed deploy events",
|
||||
"Select the site to monitor for form submissions": "Select the site to monitor for form submissions"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"Netlify is a platform for building and deploying websites and apps.": "Netlify is a platform for building and deploying websites and apps.",
|
||||
"\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n": "\nTo authenticate with Netlify:\n\n1. Go to your Netlify user settings\n2. Navigate to \"Applications\" → \"OAuth applications\"\n3. Click \"New OAuth application\"\n4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs\n5. Copy the Client ID and Client Secret\n6. Use the OAuth2 flow below\n\n**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.\n",
|
||||
"Start Deploy": "Start Deploy",
|
||||
"Get Site": "Get Site",
|
||||
"List Site Deploys": "List Site Deploys",
|
||||
"List Files": "List Files",
|
||||
"Triggers a new build for a site on Netlify. Supports clearing build cache.": "Triggers a new build for a site on Netlify. Supports clearing build cache.",
|
||||
"Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.": "Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.",
|
||||
"Returns a list of all deploys for a specific site.": "Returns a list of all deploys for a specific site.",
|
||||
"Returns a list of all the files in the current deploy.": "Returns a list of all the files in the current deploy.",
|
||||
"Site": "Site",
|
||||
"Clear Build Cache": "Clear Build Cache",
|
||||
"Page": "Page",
|
||||
"Per Page": "Per Page",
|
||||
"Select the site to deploy": "Select the site to deploy",
|
||||
"Whether to clear the build cache before building": "Whether to clear the build cache before building",
|
||||
"Select the site to retrieve information for": "Select the site to retrieve information for",
|
||||
"Select the site to list deploys for": "Select the site to list deploys for",
|
||||
"Page number for pagination (starts from 1)": "Page number for pagination (starts from 1)",
|
||||
"Number of items per page (max 100)": "Number of items per page (max 100)",
|
||||
"Select the site to list files for": "Select the site to list files for",
|
||||
"New Deploy Started": "New Deploy Started",
|
||||
"New Deploy Succeeded": "New Deploy Succeeded",
|
||||
"New Deploy Failed": "New Deploy Failed",
|
||||
"New Form Submission": "New Form Submission",
|
||||
"Fires immediately when a deploy job starts on your Netlify site.": "Fires immediately when a deploy job starts on your Netlify site.",
|
||||
"Fires when a new site version has successfully deployed.": "Fires when a new site version has successfully deployed.",
|
||||
"Fires when a site deploy fails.": "Fires when a site deploy fails.",
|
||||
"Fires when a Netlify form submission is received.": "Fires when a Netlify form submission is received.",
|
||||
"Select the site to monitor for deploy events": "Select the site to monitor for deploy events",
|
||||
"Select the site to monitor for successful deploy events": "Select the site to monitor for successful deploy events",
|
||||
"Select the site to monitor for failed deploy events": "Select the site to monitor for failed deploy events",
|
||||
"Select the site to monitor for form submissions": "Select the site to monitor for form submissions"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
import { createPiece } from "@activepieces/pieces-framework";
|
||||
import { netlifyAuth } from "./lib/common/auth";
|
||||
import { startDeploy } from "./lib/actions/start-deploy";
|
||||
import { getSite } from "./lib/actions/get-site";
|
||||
import { listSiteDeploys } from "./lib/actions/list-site-deploys";
|
||||
import { listFiles } from "./lib/actions/list-files";
|
||||
import { newDeployStarted } from "./lib/triggers/new-deploy-started";
|
||||
import { newDeploySucceeded } from "./lib/triggers/new-deploy-succeeded";
|
||||
import { newDeployFailed } from "./lib/triggers/new-deploy-failed";
|
||||
import { newFormSubmission } from "./lib/triggers/new-form-submission";
|
||||
import { PieceCategory } from "@activepieces/shared";
|
||||
|
||||
export const netlify = createPiece({
|
||||
displayName: "Netlify",
|
||||
auth: netlifyAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
description: "Netlify is a platform for building and deploying websites and apps.",
|
||||
logoUrl: "https://cdn.activepieces.com/pieces/netlify.png",
|
||||
authors: ["sparkybug"],
|
||||
categories: [PieceCategory.DEVELOPER_TOOLS],
|
||||
actions: [
|
||||
startDeploy,
|
||||
getSite,
|
||||
listSiteDeploys,
|
||||
listFiles,
|
||||
],
|
||||
triggers: [
|
||||
newDeployStarted,
|
||||
newDeploySucceeded,
|
||||
newDeployFailed,
|
||||
newFormSubmission,
|
||||
],
|
||||
});
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
import { createAction, Property, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const getSite = createAction({
|
||||
name: "get_site",
|
||||
displayName: "Get Site",
|
||||
description: "Get a specified site. Note: Environment variable keys and values have moved from build_settings.env and repo.env to a new endpoint. Please use getEnvVars to retrieve site environment variables.",
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to retrieve information for",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { siteId } = context.propsValue;
|
||||
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `https://api.netlify.com/api/v1/sites/${siteId}`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
if (response.status === 404) {
|
||||
throw new Error(`Site not found: ${siteId}. Please check the site ID or domain.`);
|
||||
}
|
||||
|
||||
if (response.status === 401) {
|
||||
throw new Error("Unauthorized. Please check your access token.");
|
||||
}
|
||||
|
||||
if (response.status === 403) {
|
||||
throw new Error("Forbidden. You don't have permission to access this site.");
|
||||
}
|
||||
|
||||
throw new Error(`Failed to get site: ${response.status}`);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,108 @@
|
||||
import { createAction, Property, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const listFiles = createAction({
|
||||
name: "list_files",
|
||||
displayName: "List Files",
|
||||
description: "Returns a list of all the files in the current deploy.",
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to list files for",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { siteId } = context.propsValue;
|
||||
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `https://api.netlify.com/api/v1/sites/${siteId}/files`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
if (response.status === 404) {
|
||||
throw new Error(`Site not found: ${siteId}. Please check the site ID or domain.`);
|
||||
}
|
||||
|
||||
if (response.status === 401) {
|
||||
throw new Error("Unauthorized. Please check your access token.");
|
||||
}
|
||||
|
||||
if (response.status === 403) {
|
||||
throw new Error("Forbidden. You don't have permission to access this site.");
|
||||
}
|
||||
|
||||
throw new Error(`Failed to list files: ${response.status}`);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,124 @@
|
||||
import { createAction, Property, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const listSiteDeploys = createAction({
|
||||
name: "list_site_deploys",
|
||||
displayName: "List Site Deploys",
|
||||
description: "Returns a list of all deploys for a specific site.",
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to list deploys for",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
page: Property.Number({
|
||||
displayName: "Page",
|
||||
description: "Page number for pagination (starts from 1)",
|
||||
required: false,
|
||||
defaultValue: 1,
|
||||
}),
|
||||
perPage: Property.Number({
|
||||
displayName: "Per Page",
|
||||
description: "Number of items per page (max 100)",
|
||||
required: false,
|
||||
defaultValue: 100,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { siteId, page, perPage } = context.propsValue;
|
||||
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const queryParams = new URLSearchParams();
|
||||
if (page) queryParams.append('page', page.toString());
|
||||
if (perPage) queryParams.append('per_page', perPage.toString());
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `https://api.netlify.com/api/v1/sites/${siteId}/deploys?${queryParams.toString()}`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
if (response.status === 404) {
|
||||
throw new Error(`Site not found: ${siteId}. Please check the site ID or domain.`);
|
||||
}
|
||||
|
||||
if (response.status === 401) {
|
||||
throw new Error("Unauthorized. Please check your access token.");
|
||||
}
|
||||
|
||||
if (response.status === 403) {
|
||||
throw new Error("Forbidden. You don't have permission to access this site.");
|
||||
}
|
||||
|
||||
throw new Error(`Failed to list site deploys: ${response.status}`);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,117 @@
|
||||
import { createAction, Property, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const startDeploy = createAction({
|
||||
name: "start_deploy",
|
||||
displayName: "Start Deploy",
|
||||
description: "Triggers a new build for a site on Netlify. Supports clearing build cache.",
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to deploy",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
clearCache: Property.Checkbox({
|
||||
displayName: "Clear Build Cache",
|
||||
description: "Whether to clear the build cache before building",
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { siteId, clearCache } = context.propsValue;
|
||||
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `https://api.netlify.com/api/v1/sites/${siteId}/deploys`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
clear_cache: clearCache,
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200 || response.status === 201) {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
if (response.status === 404) {
|
||||
throw new Error(`Site not found: ${siteId}. Please check the site ID or domain.`);
|
||||
}
|
||||
|
||||
if (response.status === 401) {
|
||||
throw new Error("Unauthorized. Please check your access token.");
|
||||
}
|
||||
|
||||
if (response.status === 403) {
|
||||
throw new Error("Forbidden. You don't have permission to deploy this site.");
|
||||
}
|
||||
|
||||
throw new Error(`Failed to start deploy: ${response.status}`);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
import { PieceAuth } from "@activepieces/pieces-framework";
|
||||
|
||||
export const netlifyAuth = PieceAuth.OAuth2({
|
||||
description: `
|
||||
To authenticate with Netlify:
|
||||
|
||||
1. Go to your Netlify user settings
|
||||
2. Navigate to "Applications" → "OAuth applications"
|
||||
3. Click "New OAuth application"
|
||||
4. Add https://cloud.activepieces.com/redirect to authorized redirect URIs
|
||||
5. Copy the Client ID and Client Secret
|
||||
6. Use the OAuth2 flow below
|
||||
|
||||
**Note:** If your team uses SAML SSO, you must grant access to the team when generating your token.
|
||||
`,
|
||||
authUrl: "https://app.netlify.com/authorize",
|
||||
tokenUrl: "https://api.netlify.com/oauth/token",
|
||||
required: true,
|
||||
scope: [],
|
||||
});
|
||||
@@ -0,0 +1,149 @@
|
||||
import { createTrigger, Property, TriggerStrategy, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const newDeployFailed = createTrigger({
|
||||
name: "new_deploy_failed",
|
||||
displayName: "New Deploy Failed",
|
||||
description: "Fires when a site deploy fails.",
|
||||
auth: netlifyAuth,
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to monitor for failed deploy events",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
id: "507f1f77bcf86cd799439011",
|
||||
site_id: "b6fda79c-0cb0-44ca-8e73-3f5f2c0f0e2d",
|
||||
build_id: "5d7725b654c02c0007350e8a",
|
||||
state: "error",
|
||||
name: "my-site",
|
||||
url: "https://my-site.netlify.app",
|
||||
ssl_url: "https://my-site.netlify.app",
|
||||
admin_url: "https://app.netlify.com/sites/my-site",
|
||||
deploy_url: "https://5d7725b654c02c0007350e8a--my-site.netlify.app",
|
||||
deploy_ssl_url: "https://5d7725b654c02c0007350e8a--my-site.netlify.app",
|
||||
created_at: "2025-09-02T10:15:30.000Z",
|
||||
updated_at: "2025-09-02T10:16:45.000Z",
|
||||
user_id: "507f1f77bcf86cd799439012",
|
||||
error_message: "Build failed due to missing dependency",
|
||||
branch: "main",
|
||||
commit_ref: "abc123def456",
|
||||
commit_url: "https://github.com/user/repo/commit/abc123def456",
|
||||
skipped: false,
|
||||
locked: false
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
onEnable: async (context) => {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: "https://api.netlify.com/api/v1/hooks",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
site_id: context.propsValue.siteId,
|
||||
type: "url",
|
||||
event: "deploy_failed",
|
||||
data: {
|
||||
url: context.webhookUrl,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 201) {
|
||||
await context.store.put("webhook_id", response.body.id);
|
||||
} else {
|
||||
throw new Error(`Failed to create webhook: ${response.status}`);
|
||||
}
|
||||
},
|
||||
onDisable: async (context) => {
|
||||
const webhookId = await context.store.get("webhook_id");
|
||||
if (webhookId) {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
await httpClient.sendRequest({
|
||||
method: HttpMethod.DELETE,
|
||||
url: `https://api.netlify.com/api/v1/hooks/${webhookId}`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
run: async (context) => {
|
||||
return [context.payload.body];
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,150 @@
|
||||
import { createTrigger, Property, TriggerStrategy, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const newDeployStarted = createTrigger({
|
||||
name: "new_deploy_started",
|
||||
displayName: "New Deploy Started",
|
||||
description: "Fires immediately when a deploy job starts on your Netlify site.",
|
||||
auth: netlifyAuth,
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to monitor for deploy events",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
id: "507f1f77bcf86cd799439013",
|
||||
site_id: "b6fda79c-0cb0-44ca-8e73-3f5f2c0f0e2d",
|
||||
build_id: "5d7725b654c02c0007350e8b",
|
||||
state: "building",
|
||||
name: "my-site",
|
||||
url: "https://my-site.netlify.app",
|
||||
ssl_url: "https://my-site.netlify.app",
|
||||
admin_url: "https://app.netlify.com/sites/my-site",
|
||||
deploy_url: "https://5d7725b654c02c0007350e8b--my-site.netlify.app",
|
||||
deploy_ssl_url: "https://5d7725b654c02c0007350e8b--my-site.netlify.app",
|
||||
created_at: "2025-09-02T10:15:30.000Z",
|
||||
updated_at: "2025-09-02T10:15:30.000Z",
|
||||
user_id: "507f1f77bcf86cd799439012",
|
||||
branch: "main",
|
||||
commit_ref: "def456ghi789",
|
||||
commit_url: "https://github.com/user/repo/commit/def456ghi789",
|
||||
skipped: false,
|
||||
locked: false,
|
||||
review_id: null,
|
||||
framework: "react"
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
onEnable: async (context) => {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: "https://api.netlify.com/api/v1/hooks",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
site_id: context.propsValue.siteId,
|
||||
type: "url",
|
||||
event: "deploy_created",
|
||||
data: {
|
||||
url: context.webhookUrl,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 201) {
|
||||
await context.store.put("webhook_id", response.body.id);
|
||||
} else {
|
||||
throw new Error(`Failed to create webhook: ${response.status}`);
|
||||
}
|
||||
},
|
||||
onDisable: async (context) => {
|
||||
const webhookId = await context.store.get("webhook_id");
|
||||
if (webhookId) {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
await httpClient.sendRequest({
|
||||
method: HttpMethod.DELETE,
|
||||
url: `https://api.netlify.com/api/v1/hooks/${webhookId}`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
run: async (context) => {
|
||||
return [context.payload.body];
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,152 @@
|
||||
import { createTrigger, Property, TriggerStrategy, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const newDeploySucceeded = createTrigger({
|
||||
name: "new_deploy_succeeded",
|
||||
displayName: "New Deploy Succeeded",
|
||||
description: "Fires when a new site version has successfully deployed.",
|
||||
auth: netlifyAuth,
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to monitor for successful deploy events",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
id: "507f1f77bcf86cd799439014",
|
||||
site_id: "b6fda79c-0cb0-44ca-8e73-3f5f2c0f0e2d",
|
||||
build_id: "5d7725b654c02c0007350e8c",
|
||||
state: "ready",
|
||||
name: "my-site",
|
||||
url: "https://my-site.netlify.app",
|
||||
ssl_url: "https://my-site.netlify.app",
|
||||
admin_url: "https://app.netlify.com/sites/my-site",
|
||||
deploy_url: "https://5d7725b654c02c0007350e8c--my-site.netlify.app",
|
||||
deploy_ssl_url: "https://5d7725b654c02c0007350e8c--my-site.netlify.app",
|
||||
created_at: "2025-09-02T10:15:30.000Z",
|
||||
updated_at: "2025-09-02T10:18:45.000Z",
|
||||
published_at: "2025-09-02T10:18:45.000Z",
|
||||
user_id: "507f1f77bcf86cd799439012",
|
||||
branch: "main",
|
||||
commit_ref: "ghi789jkl012",
|
||||
commit_url: "https://github.com/user/repo/commit/ghi789jkl012",
|
||||
skipped: false,
|
||||
locked: false,
|
||||
review_id: null,
|
||||
framework: "react",
|
||||
function_schedules: []
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
onEnable: async (context) => {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: "https://api.netlify.com/api/v1/hooks",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
site_id: context.propsValue.siteId,
|
||||
type: "url",
|
||||
event: "deploy_succeeded",
|
||||
data: {
|
||||
url: context.webhookUrl,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 201) {
|
||||
await context.store.put("webhook_id", response.body.id);
|
||||
} else {
|
||||
throw new Error(`Failed to create webhook: ${response.status}`);
|
||||
}
|
||||
},
|
||||
onDisable: async (context) => {
|
||||
const webhookId = await context.store.get("webhook_id");
|
||||
if (webhookId) {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
await httpClient.sendRequest({
|
||||
method: HttpMethod.DELETE,
|
||||
url: `https://api.netlify.com/api/v1/hooks/${webhookId}`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
run: async (context) => {
|
||||
return [context.payload.body];
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,152 @@
|
||||
import { createTrigger, Property, TriggerStrategy, OAuth2PropertyValue } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { netlifyAuth } from "../common/auth";
|
||||
|
||||
export const newFormSubmission = createTrigger({
|
||||
name: "new_form_submission",
|
||||
displayName: "New Form Submission",
|
||||
description: "Fires when a Netlify form submission is received.",
|
||||
auth: netlifyAuth,
|
||||
props: {
|
||||
siteId: Property.Dropdown({
|
||||
auth: netlifyAuth, displayName: "Site",
|
||||
description: "Select the site to monitor for form submissions",
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Connect your account first",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const authentication = auth as OAuth2PropertyValue;
|
||||
if (!authentication.access_token) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Access token is required",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: "https://api.netlify.com/api/v1/sites?per_page=50",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${authentication.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const sites = response.body as any[];
|
||||
return {
|
||||
disabled: false,
|
||||
options: sites.map((site) => ({
|
||||
label: `${site.name} (${site.url})`,
|
||||
value: site.id,
|
||||
})),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: `Failed to fetch sites: ${response.status}`,
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: "Failed to fetch sites",
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
id: "507f1f77bcf86cd799439015",
|
||||
number: 42,
|
||||
email: "user@example.com",
|
||||
name: "John Doe",
|
||||
first_name: "John",
|
||||
last_name: "Doe",
|
||||
company: "Acme Corp",
|
||||
summary: "Contact form submission from website",
|
||||
body: "Hello, I'm interested in your services. Please contact me.",
|
||||
data: {
|
||||
name: "John Doe",
|
||||
email: "user@example.com",
|
||||
message: "Hello, I'm interested in your services. Please contact me.",
|
||||
phone: "+1-555-123-4567"
|
||||
},
|
||||
created_at: "2025-09-02T10:15:30.000Z",
|
||||
site_url: "https://my-site.netlify.app",
|
||||
form_id: "507f1f77bcf86cd799439016",
|
||||
form_name: "contact",
|
||||
ip: "192.168.1.100",
|
||||
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
|
||||
referrer: "https://my-site.netlify.app/contact"
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
onEnable: async (context) => {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: "https://api.netlify.com/api/v1/hooks",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
site_id: context.propsValue.siteId,
|
||||
type: "url",
|
||||
event: "submission_created",
|
||||
data: {
|
||||
url: context.webhookUrl,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (response.status === 201) {
|
||||
await context.store.put("webhook_id", response.body.id);
|
||||
} else {
|
||||
throw new Error(`Failed to create webhook: ${response.status}`);
|
||||
}
|
||||
},
|
||||
onDisable: async (context) => {
|
||||
const webhookId = await context.store.get("webhook_id");
|
||||
if (webhookId) {
|
||||
if (!context.auth) {
|
||||
throw new Error("Authentication is required");
|
||||
}
|
||||
|
||||
const auth = context.auth as OAuth2PropertyValue;
|
||||
if (!auth.access_token) {
|
||||
throw new Error("Access token is required");
|
||||
}
|
||||
|
||||
await httpClient.sendRequest({
|
||||
method: HttpMethod.DELETE,
|
||||
url: `https://api.netlify.com/api/v1/hooks/${webhookId}`,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${auth.access_token}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
run: async (context) => {
|
||||
return [context.payload.body];
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user