Add Activepieces integration for workflow automation

- Add Activepieces fork with SmoothSchedule custom piece
- Create integrations app with Activepieces service layer
- Add embed token endpoint for iframe integration
- Create Automations page with embedded workflow builder
- Add sidebar visibility fix for embed mode
- Add list inactive customers endpoint to Public API
- Include SmoothSchedule triggers: event created/updated/cancelled
- Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,33 @@
{
"extends": [
"../../../../.eslintrc.base.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}

View File

@@ -0,0 +1,13 @@
# pieces-datadog
This library was generated with [Nx](https://nx.dev).
## Building
- Run `nx build pieces-datadog` to build the library.
- Add `datadog` to `AP_DEV_PIECES` environment variable to test
## Adding new actions
- Check the [Datadog API documentation](https://docs.datadoghq.com/api/latest/) to see the available endpoints and parameters.
- Prefer using the typescript SDK ([`@datadog/datadog-api-client`](https://github.com/DataDog/datadog-api-client-typescript)) over the HTTP API for better type safety and documentation.

View File

@@ -0,0 +1,11 @@
{
"name": "@activepieces/piece-datadog",
"version": "0.0.4",
"type": "commonjs",
"main": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"@datadog/datadog-api-client": "^1.43.0",
"tslib": "^2.3.0"
}
}

View File

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

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Cloud-Überwachungs- und Analyseplattform",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Datadog App-Schlüssel (benötigt für einige Endpunkte)",
"Site": "Site",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "Datadog Authentifizierung erfordert einen API-Schlüssel und eine Website (standardmäßig US1).",
"Send Multiple logs": "Mehrere Logs senden",
"Send One log": "Ein Protokoll senden",
"Custom API Call": "Eigener API-Aufruf",
"Send your logs to your Datadog platform over HTTP.": "Senden Sie Ihre Logs über HTTP an Ihre Datadog-Plattform.",
"Send one log to your Datadog platform over HTTP.": "Senden Sie eine Logdatei an Ihre Datadog Plattform über HTTP.",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Logs": "Logs",
"Message": "Nachricht",
"DD Source": "DD-Quelle",
"DD Tags": "DD Tags",
"Hostname": "Hostname",
"Service": "Service",
"Additional Properties": "Zusätzliche Eigenschaften",
"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)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Protokolle zum Senden an Datadog, müssen einen `logs` Schlüssel mit einem Array von Objekten enthalten. Dokumentation: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "Die Nachricht an Datadog senden",
"The DD source to send to Datadog": "Die zu sendende DD-Quelle an Datadog",
"The DD tags to send to Datadog, comma separated": "Die zu sendenden DD-Tags an Datadog, durch Komma getrennt",
"The hostname to send to Datadog": "Der zu sendende Hostname",
"The service to send to Datadog": "Der zu sendende Dienst an Datadog",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Zusätzliche Eigenschaften, die an Datadog gesendet werden sollen, in Schlüssel-Wert-Paaren wie Status, Ebene, etc.",
"Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
"Enable for files like PDFs, images, etc..": "Aktivieren für Dateien wie PDFs, Bilder, etc..",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Plataforma de monitorización y análisis en la nube",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Datadog App key (requerido para algunos extremos)",
"Site": "Sitio",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "La autenticación de datos requiere una clave API y un sitio (por defecto, US1).",
"Send Multiple logs": "Enviar registros múltiples",
"Send One log": "Enviar un registro",
"Custom API Call": "Llamada API personalizada",
"Send your logs to your Datadog platform over HTTP.": "Envía tus registros a tu plataforma de datos a través de HTTP.",
"Send one log to your Datadog platform over HTTP.": "Envía un registro a tu plataforma de datos a través de HTTP.",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Logs": "Registros",
"Message": "Mensaje",
"DD Source": "Fuente DD",
"DD Tags": "Etiquetas DD",
"Hostname": "Hostname",
"Service": "Servicio",
"Additional Properties": "Propiedades adicionales",
"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)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Los registros para enviar a Datadog, deben contener una clave `logs` con un array de objetos. Documentación: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "El mensaje a enviar a Datadog",
"The DD source to send to Datadog": "La fuente DD para enviar a Datadog",
"The DD tags to send to Datadog, comma separated": "Las etiquetas DD para enviar a Datadog, separadas por comas",
"The hostname to send to Datadog": "El nombre de host a enviar a Datadog",
"The service to send to Datadog": "El servicio a enviar a Datadog",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Propiedades adicionales para enviar a Datadog, en pares clave-valor como estado, nivel, etc.",
"Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
"Enable for files like PDFs, images, etc..": "Activar para archivos como PDFs, imágenes, etc.",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Plateforme de surveillance et d'analyse du cloud",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Clé d'application Datadog (requise pour certains terminaux)",
"Site": "Site",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "L'authentification Datadog nécessite une clé API et un site (par défaut, US1).",
"Send Multiple logs": "Envoyer plusieurs logs",
"Send One log": "Envoyer un log",
"Custom API Call": "Appel d'API personnalisé",
"Send your logs to your Datadog platform over HTTP.": "Envoyez vos logs à votre plateforme Datadog via HTTP.",
"Send one log to your Datadog platform over HTTP.": "Envoyez un log à votre plate-forme Datadog via HTTP.",
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
"Logs": "Journaux",
"Message": "Message",
"DD Source": "Source DD",
"DD Tags": "Tags DD",
"Hostname": "Hostname",
"Service": "Service",
"Additional Properties": "Propriétés supplémentaires",
"Method": "Méthode",
"Headers": "Headers",
"Query Parameters": "Paramètres de requête",
"Body": "Body",
"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)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Logs à envoyer à Datadog, doit contenir une clé `logs` avec un tableau d'objets. Documentation : https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "Le message à envoyer à Datadog",
"The DD source to send to Datadog": "La source DD à envoyer à Datadog",
"The DD tags to send to Datadog, comma separated": "Les balises DD à envoyer à Datadog, séparées par des virgules",
"The hostname to send to Datadog": "Le nom d'hôte à envoyer à Datadog",
"The service to send to Datadog": "Le service à envoyer à Datadog",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Propriétés supplémentaires à envoyer à Datadog, dans les paires clé-valeur comme le statut, le niveau, etc.",
"Authorization headers are injected automatically from your connection.": "Les Headers d'autorisation sont injectés automatiquement à partir de votre connexion.",
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "クラウドのモニタリングと分析プラットフォーム",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "データログアプリキー (一部のエンドポイントに必要)",
"Site": "サイト",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "データログ認証にはAPIキーとサイト(デフォルトではUS1)が必要です。",
"Send Multiple logs": "複数のログを送信",
"Send One log": "一つのログを送信",
"Custom API Call": "カスタムAPI通話",
"Send your logs to your Datadog platform over HTTP.": "HTTP経由でDatadogプラットフォームにログを送信します。",
"Send one log to your Datadog platform over HTTP.": "HTTP 経由で Datadog プラットフォームにログを送信します。",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Logs": "ログ",
"Message": "メッセージ",
"DD Source": "DD ソース",
"DD Tags": "DDタグ",
"Hostname": "Hostname",
"Service": "サービス",
"Additional Properties": "追加のプロパティ",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Datadogに送信するログには、オブジェクトの配列を持つ「logs」キーを含める必要があります。ドキュメント: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "Datadog に送信するメッセージ",
"The DD source to send to Datadog": "Datadog に送信する DD ソース",
"The DD tags to send to Datadog, comma separated": "Datadogに送信するDDタグ カンマで区切られた",
"The hostname to send to Datadog": "Datadog に送信するホスト",
"The service to send to Datadog": "Datadog に送信するサービス",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Datadogに送信する追加のプロパティは、ステータス、レベルなどのキーと値のペアで設定されています。",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Cloud monitoring en analytics platform",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Datadog App sleutel (vereist voor sommige eindpunten)",
"Site": "Website",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "Datadog authenticatie vereist een API-sleutel en een site (standaard US1).",
"Send Multiple logs": "Stuur meerdere logs",
"Send One log": "Stuur 1 log",
"Custom API Call": "Custom API Call",
"Send your logs to your Datadog platform over HTTP.": "Stuur uw logs naar uw Datadog platform via HTTP.",
"Send one log to your Datadog platform over HTTP.": "Stuur één log naar het datadog platform via HTTP.",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Logs": "Logboeken",
"Message": "bericht",
"DD Source": "DD Bron",
"DD Tags": "DD tags",
"Hostname": "Hostname",
"Service": "Diensten",
"Additional Properties": "Extra eigenschappen",
"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)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Logs om naar Datadog te versturen, moeten een `logs` sleutel bevatten met een array van objecten. Documentatie: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "Het bericht om te verzenden naar Datadog",
"The DD source to send to Datadog": "De DD-bron om naar Datadog te verzenden",
"The DD tags to send to Datadog, comma separated": "De DD tags te verzenden naar Datadog, gescheiden door een komma",
"The hostname to send to Datadog": "De hostnaam om naar Datadog te verzenden",
"The service to send to Datadog": "De dienst om naar Datadog te verzenden",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Extra eigenschappen om naar Datadog te verzenden, in sleutelwaarde paren zoals status, niveau, enz.",
"Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
"Enable for files like PDFs, images, etc..": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc..",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Monitoramento na nuvem e plataforma de análise",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Chave do aplicativo Datadog (necessário para alguns endpoints)",
"Site": "site",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "A autenticação do Datadog requer uma chave de API e um site (por padrão, US1).",
"Send Multiple logs": "Enviar Vários Logs",
"Send One log": "Enviar One log",
"Custom API Call": "Chamada de API personalizada",
"Send your logs to your Datadog platform over HTTP.": "Envie seus logs para sua plataforma Datadog por HTTP.",
"Send one log to your Datadog platform over HTTP.": "Envie um log para a sua plataforma Datadog por HTTP.",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Logs": "Registros",
"Message": "mensagem",
"DD Source": "Fonte DD",
"DD Tags": "Tags DD",
"Hostname": "Hostname",
"Service": "Serviço",
"Additional Properties": "Propriedades Adicionais",
"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)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Os logs para enviar para o Datadog, devem conter uma chave `logs` com um array de objetos. Documentação: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "A mensagem a enviar para Datadog",
"The DD source to send to Datadog": "A fonte de DD a enviar para Datadog",
"The DD tags to send to Datadog, comma separated": "The DD tags a enviar para Datadog, separadas por vírgulas",
"The hostname to send to Datadog": "O hostname a ser enviado para Datadog",
"The service to send to Datadog": "O serviço a ser enviado para o Datadog",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Propriedades adicionais a serem enviadas para o Datadog, em pares chave-valor, como status, nível, etc.",
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
"Enable for files like PDFs, images, etc..": "Habilitar para arquivos como PDFs, imagens, etc..",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Cloud monitoring and analytics platform",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Datadog App key (required for some endpoints)",
"Site": "Site",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "Datadog authentication requires an API key and a site (by default, US1).",
"Send Multiple logs": "Send Multiple logs",
"Send One log": "Send One log",
"Custom API Call": "Custom API Call",
"Send your logs to your Datadog platform over HTTP.": "Send your logs to your Datadog platform over HTTP.",
"Send one log to your Datadog platform over HTTP.": "Send one log to your Datadog platform over HTTP.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Logs": "Logs",
"Message": "Message",
"DD Source": "DD Source",
"DD Tags": "DD Tags",
"Hostname": "Hostname",
"Service": "Service",
"Additional Properties": "Additional Properties",
"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)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "The message to send to Datadog",
"The DD source to send to Datadog": "The DD source to send to Datadog",
"The DD tags to send to Datadog, comma separated": "The DD tags to send to Datadog, comma separated",
"The hostname to send to Datadog": "The hostname to send to Datadog",
"The service to send to Datadog": "The service to send to Datadog",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Additional properties to send to Datadog, in key-value pairs like status, level, etc.",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,49 @@
{
"Cloud monitoring and analytics platform": "Cloud monitoring and analytics platform",
"Datadog API key": "Datadog API key",
"Datadog App key (required for some endpoints)": "Datadog App key (required for some endpoints)",
"Site": "Site",
"US1": "US1",
"US3": "US3",
"US5": "US5",
"EU": "EU",
"AP1": "AP1",
"AP2": "AP2",
"US1-FED": "US1-FED",
"Datadog authentication requires an API key and a site (by default, US1).": "Datadog authentication requires an API key and a site (by default, US1).",
"Send Multiple logs": "Send Multiple logs",
"Send One log": "Send One log",
"Custom API Call": "自定义 API 呼叫",
"Send your logs to your Datadog platform over HTTP.": "Send your logs to your Datadog platform over HTTP.",
"Send one log to your Datadog platform over HTTP.": "Send one log to your Datadog platform over HTTP.",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Logs": "日志",
"Message": "Message",
"DD Source": "DD Source",
"DD Tags": "DD Tags",
"Hostname": "Hostname",
"Service": "Service",
"Additional Properties": "Additional Properties",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs": "Logs to send to Datadog, must contain a `logs` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs",
"The message to send to Datadog": "The message to send to Datadog",
"The DD source to send to Datadog": "The DD source to send to Datadog",
"The DD tags to send to Datadog, comma separated": "The DD tags to send to Datadog, comma separated",
"The hostname to send to Datadog": "The hostname to send to Datadog",
"The service to send to Datadog": "The service to send to Datadog",
"Additional properties to send to Datadog, in key-value pairs like status, level, etc.": "Additional properties to send to Datadog, in key-value pairs like status, level, etc.",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色"
}

View File

@@ -0,0 +1,88 @@
import { createPiece, PieceAuth, Property } from "@activepieces/pieces-framework";
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { constructDatadogBaseHeaders, constructDatadogBaseUrl, getDatadogConfiguration } from "./lib/common";
import { sendMultipleLogs } from "./lib/actions/send-multiple-logs";
import { v1 } from "@datadog/datadog-api-client";
import { sendOneLog } from "./lib/actions/send-one-log";
import { AppConnectionType, PieceCategory } from "@activepieces/shared";
export const datadogAuth = PieceAuth.CustomAuth({
description: 'Datadog authentication requires an API key and a site (by default, US1).',
required: true,
props: {
apiKey: PieceAuth.SecretText({
displayName: 'Datadog API key',
required: true,
}),
appKey: PieceAuth.SecretText({
displayName: 'Datadog App key (required for some endpoints)',
required: false,
}),
site: Property.StaticDropdown({
displayName: 'Site',
required: true,
defaultValue: 'datadoghq.com',
options: {
options: [
{ label: 'US1', value: 'datadoghq.com' },
{ label: 'US3', value: 'us3.datadoghq.com' },
{ label: 'US5', value: 'us5.datadoghq.com' },
{ label: 'EU', value: 'datadoghq.eu' },
{ label: 'AP1', value: 'ap1.datadoghq.com' },
{ label: 'AP2', value: 'ap2.datadoghq.com' },
{ label: 'US1-FED', value: 'ddog-gov.com' },
],
},
}),
},
validate: async ({ auth }) => {
/**
* Documentation: https://docs.datadoghq.com/api/latest/authentication/?code-lang=typescript
*/
try {
const apiInstance = new v1.AuthenticationApi(getDatadogConfiguration({
type: AppConnectionType.CUSTOM_AUTH,
props: auth,
}));
await apiInstance.validate()
return {
valid: true,
};
} catch (error) {
return {
valid: false,
error: 'Invalid auth credentials',
};
}
},
});
export const datadog = createPiece({
displayName: "Datadog",
description: "Cloud monitoring and analytics platform",
auth: datadogAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: "https://cdn.activepieces.com/pieces/datadog.png",
categories:[PieceCategory.DEVELOPER_TOOLS],
authors: ["chaimaa-kadaoui"],
actions: [
sendMultipleLogs,
sendOneLog,
createCustomApiCallAction({
baseUrl: (auth) =>auth ? constructDatadogBaseUrl(auth) : '',
auth: datadogAuth,
authMapping: async (auth) => constructDatadogBaseHeaders(auth),
authLocation: 'headers',
props: {
url: {
description: `You can either use the full URL or the relative path to the base URL
i.e https://api.datadoghq.com/api/v2/resource or /resource.
When using the relative path, the default subdomain is "api" and the default version is "v2".`,
}
},
}),
],
triggers: [],
});

View File

@@ -0,0 +1,63 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { v2 } from '@datadog/datadog-api-client';
import { datadogAuth } from '../..';
import { getDatadogConfiguration } from '../common';
import { z } from 'zod';
export const sendMultipleLogs = createAction({
name: 'sendMultipleLogs',
displayName: 'Send Multiple logs',
description: 'Send your logs to your Datadog platform over HTTP.',
auth: datadogAuth,
requireAuth: true,
props: {
body: Property.Json({
displayName: 'Logs',
required: true,
description: `Logs to send to Datadog, must contain a \`logs\` key with an array of objects. Documentation: https://docs.datadoghq.com/api/latest/logs/#send-logs`,
defaultValue: {logs: [
{
ddsource: "source",
ddtags: "env:test,version:1.0",
hostname: "hostname",
message: "message",
service: "service",
additionalProperties: {
status: "info",
},
},
]}
}),
},
async run({ auth, propsValue }) {
/**
* Documentation: https://docs.datadoghq.com/api/latest/logs/?code-lang=typescript
*/
const apiInstance = new v2.LogsApi(getDatadogConfiguration(auth));
// Validate the request body
z.object({
logs: z.array(
z.object({
message: z.string({error: "Log message cannot be empty"}),
ddsource: z.string().optional(),
ddtags: z.string().optional(),
hostname: z.string().optional(),
service: z.string().optional(),
additionalProperties: z.record(z.string(), z.unknown()).optional(),
}).strict().describe("Allowed properties are `message`, `ddsource`, `ddtags`, `hostname`, `service`, `additionalProperties`"),
{ error: "Logs must be an array of objects under `logs` key e.g `{'logs': [{'message': 'test'}]}`"}
).min(1, "At least one log entry is required")
}).strict().parse(propsValue.body);
const params: v2.LogsApiSubmitLogRequest = {
body: propsValue.body['logs'] as v2.HTTPLogItem[],
};
await apiInstance.submitLog(params)
return {
success: true,
message: 'Logs sent successfully',
};
},
});

View File

@@ -0,0 +1,67 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { v2 } from '@datadog/datadog-api-client';
import { datadogAuth } from '../..';
import { getDatadogConfiguration } from '../common';
export const sendOneLog = createAction({
name: 'sendOneLog',
displayName: 'Send One log',
description: 'Send one log to your Datadog platform over HTTP.',
auth: datadogAuth,
requireAuth: true,
props: {
message: Property.ShortText({
displayName: 'Message',
description: 'The message to send to Datadog',
required: true,
}),
ddsource: Property.ShortText({
displayName: 'DD Source',
description: 'The DD source to send to Datadog',
required: false,
}),
ddtags: Property.ShortText({
displayName: 'DD Tags',
description: 'The DD tags to send to Datadog, comma separated',
required: false,
}),
hostname: Property.ShortText({
displayName: 'Hostname',
description: 'The hostname to send to Datadog',
required: false,
}),
service: Property.ShortText({
displayName: 'Service',
description: 'The service to send to Datadog',
required: false,
}),
additionalProperties: Property.Json({
displayName: 'Additional Properties',
description: 'Additional properties to send to Datadog, in key-value pairs like status, level, etc.',
required: false,
}),
},
async run({ auth, propsValue }) {
/**
* Documentation: https://docs.datadoghq.com/api/latest/logs/?code-lang=typescript
*/
const apiInstance = new v2.LogsApi(getDatadogConfiguration(auth));
const params: v2.LogsApiSubmitLogRequest = {
body: [{
message: propsValue.message,
ddsource: propsValue.ddsource,
ddtags: propsValue.ddtags,
hostname: propsValue.hostname,
service: propsValue.service,
additionalProperties: propsValue.additionalProperties,
}],
};
await apiInstance.submitLog(params)
return {
success: true,
message: 'Logs sent successfully',
};
},
});

View File

@@ -0,0 +1,29 @@
import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
import { client } from '@datadog/datadog-api-client';
import { datadogAuth } from '../..';
export const getDatadogConfiguration = (auth: AppConnectionValueForAuthProperty<typeof datadogAuth>) => {
const configuration = client.createConfiguration(
{authMethods: {
apiKeyAuth: auth.props.apiKey,
...(auth.props.appKey ? {appKeyAuth: auth.props.appKey} : {}),
}}
);
configuration.setServerVariables({
site: auth.props.site
});
return configuration;
}
export const constructDatadogBaseUrl = (auth: AppConnectionValueForAuthProperty<typeof datadogAuth>, subdomain = 'api', version = 'v2') => {
return `https://${subdomain}.${auth.props.site}/api/${version}`;
};
export const constructDatadogBaseHeaders = (auth: AppConnectionValueForAuthProperty<typeof datadogAuth>) => {
return {
'Accept': 'application/json',
'DD-API-KEY': auth.props.apiKey,
...(auth.props.appKey ? {'DD-APPLICATION-KEY': auth.props.appKey} : {}),
};
};

View File

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

View File

@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"]
}