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,18 @@
|
||||
{
|
||||
"extends": ["../../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# pieces-discourse
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build pieces-discourse` to build the library.
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "@activepieces/piece-discourse",
|
||||
"version": "0.0.12"
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "pieces-discourse",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/discourse/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/js:tsc",
|
||||
"outputs": [
|
||||
"{options.outputPath}"
|
||||
],
|
||||
"options": {
|
||||
"outputPath": "dist/packages/pieces/community/discourse",
|
||||
"tsConfig": "packages/pieces/community/discourse/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/discourse/package.json",
|
||||
"main": "packages/pieces/community/discourse/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/discourse/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/discourse/src/i18n",
|
||||
"output": "./src/i18n",
|
||||
"glob": "**/!(i18n.json)"
|
||||
}
|
||||
],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"updateBuildableProjectDepsInPackageJson": true
|
||||
},
|
||||
"dependsOn": [
|
||||
"^build",
|
||||
"prebuild"
|
||||
]
|
||||
},
|
||||
"publish": {
|
||||
"command": "node tools/scripts/publish.mjs pieces-discourse {args.ver} {args.tag}",
|
||||
"dependsOn": [
|
||||
"build"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
},
|
||||
"prebuild": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "packages/pieces/community/discourse",
|
||||
"command": "bun install --no-save --silent"
|
||||
},
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Moderne Open Source Forum Software",
|
||||
"API Key": "API-Schlüssel",
|
||||
"API Username": "API Benutzername",
|
||||
"Website URL": "Website-URL",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL des Diskurses url i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Holen Sie sich Ihren Api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Beitrag erstellen",
|
||||
"Create Topic": "Thema erstellen",
|
||||
"Change User Trust Level": "Benutzer-Vertrauenslevel ändern",
|
||||
"Add Users to Group": "Benutzer zur Gruppe hinzufügen",
|
||||
"Send Private Message": "Private Nachricht senden",
|
||||
"Custom API Call": "Eigener API-Aufruf",
|
||||
"Create a new post in discourse": "Neuen Beitrag im Diskurs erstellen",
|
||||
"Create a new topic in Discourse": "Ein neues Thema im Diskurs erstellen",
|
||||
"Change the trust level of a user": "Vertrauensstufe eines Benutzers ändern",
|
||||
"Add users to a group": "Benutzer zu einer Gruppe hinzufügen",
|
||||
"Send a private message in Discourse": "Eine private Nachricht im Diskurs senden",
|
||||
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
|
||||
"Post Content": "Beitragsinhalt",
|
||||
"Topic ID": "Themen-ID",
|
||||
"Post Title": "Beitragstitel",
|
||||
"Topic Content": "Inhalt des Themas",
|
||||
"Category ID": "Kategorie-ID",
|
||||
"User ID": "Benutzer-ID",
|
||||
"New Trust Level": "Neue Vertrauensstufe",
|
||||
"Group Id": "Gruppen Id",
|
||||
"Users": "Benutzer",
|
||||
"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)",
|
||||
"Content of the post": "Inhalt des Beitrags",
|
||||
"ID of the topic to post in": "ID des Themas zum Posten",
|
||||
"Title of the Topic": "Titel des Themas",
|
||||
"Content of the topic": "Inhalt des Themas",
|
||||
"ID of the category to post in": "ID der Kategorie, in der gepostet werden soll",
|
||||
"ID of the user": "ID des Benutzers",
|
||||
"New trust level of the user": "Neue Vertrauensstufe des Benutzers",
|
||||
"Id of the group": "Id der Gruppe",
|
||||
"List of users to add to the group": "Liste der Benutzer zur Gruppe hinzufügen",
|
||||
"Title for the PM": "Titel für die PM",
|
||||
"List of users to send the PM to (can be one or more)": "Liste der Benutzer, an die die PN gesendet werden soll (kann einer oder mehrere sein)",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Software moderno de foro de código abierto",
|
||||
"API Key": "Clave API",
|
||||
"API Username": "Usuario API",
|
||||
"Website URL": "URL del sitio web",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL del url del discurso, es decir, https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Crear publicación",
|
||||
"Create Topic": "Crear tema",
|
||||
"Change User Trust Level": "Cambiar Nivel de Confianza de Usuario",
|
||||
"Add Users to Group": "Añadir usuarios al grupo",
|
||||
"Send Private Message": "Enviar mensaje privado",
|
||||
"Custom API Call": "Llamada API personalizada",
|
||||
"Create a new post in discourse": "Crear un nuevo mensaje en el discurso",
|
||||
"Create a new topic in Discourse": "Crear un nuevo tema en Discourse",
|
||||
"Change the trust level of a user": "Cambiar el nivel de confianza de un usuario",
|
||||
"Add users to a group": "Añadir usuarios a un grupo",
|
||||
"Send a private message in Discourse": "Enviar un mensaje privado en Discourse",
|
||||
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
|
||||
"Post Content": "Publicar contenido",
|
||||
"Topic ID": "ID del tema",
|
||||
"Post Title": "Título del post",
|
||||
"Topic Content": "Contenido del tema",
|
||||
"Category ID": "ID de categoría",
|
||||
"User ID": "ID Usuario",
|
||||
"New Trust Level": "Nuevo nivel de confianza",
|
||||
"Group Id": "Id del grupo",
|
||||
"Users": "Usuarios",
|
||||
"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)",
|
||||
"Content of the post": "Contenido del post",
|
||||
"ID of the topic to post in": "ID del tema en el que publicar",
|
||||
"Title of the Topic": "Título del tema",
|
||||
"Content of the topic": "Contenido del tema",
|
||||
"ID of the category to post in": "ID de la categoría en la que publicar",
|
||||
"ID of the user": "ID del usuario",
|
||||
"New trust level of the user": "Nuevo nivel de confianza del usuario",
|
||||
"Id of the group": "Id del grupo",
|
||||
"List of users to add to the group": "Lista de usuarios a añadir al grupo",
|
||||
"Title for the PM": "Título para el PM",
|
||||
"List of users to send the PM to (can be one or more)": "Lista de usuarios a los que enviar el MP (puede ser uno o más)",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Logiciel de forum libre moderne",
|
||||
"API Key": "Clé API",
|
||||
"API Username": "Nom d'utilisateur API",
|
||||
"Website URL": "URL du site web",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL de l'URL du discours i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Créer un message",
|
||||
"Create Topic": "Créer un sujet",
|
||||
"Change User Trust Level": "Changer le niveau de confiance de l'utilisateur",
|
||||
"Add Users to Group": "Ajouter des utilisateurs au groupe",
|
||||
"Send Private Message": "Envoyer un message privé",
|
||||
"Custom API Call": "Appel API personnalisé",
|
||||
"Create a new post in discourse": "Créer un nouveau message dans le discours",
|
||||
"Create a new topic in Discourse": "Créer un nouveau sujet dans le discours",
|
||||
"Change the trust level of a user": "Changer le niveau de confiance d'un utilisateur",
|
||||
"Add users to a group": "Ajouter des utilisateurs à un groupe",
|
||||
"Send a private message in Discourse": "Envoyer un message privé dans Discours",
|
||||
"Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un point de terminaison spécifique",
|
||||
"Post Content": "Contenu de la publication",
|
||||
"Topic ID": "ID du sujet",
|
||||
"Post Title": "Titre de la publication",
|
||||
"Topic Content": "Contenu du sujet",
|
||||
"Category ID": "ID de la catégorie",
|
||||
"User ID": "Identifiant de l'utilisateur",
|
||||
"New Trust Level": "Nouveau niveau de confiance",
|
||||
"Group Id": "Identifiant du groupe",
|
||||
"Users": "Utilisateurs",
|
||||
"Method": "Méthode",
|
||||
"Headers": "En-têtes",
|
||||
"Query Parameters": "Paramètres de requête",
|
||||
"Body": "Corps",
|
||||
"Response is Binary ?": "La réponse est Binaire ?",
|
||||
"No Error on Failure": "Aucune erreur en cas d'échec",
|
||||
"Timeout (in seconds)": "Délai d'attente (en secondes)",
|
||||
"Content of the post": "Contenu du message",
|
||||
"ID of the topic to post in": "ID du sujet à publier dans",
|
||||
"Title of the Topic": "Titre du sujet",
|
||||
"Content of the topic": "Contenu du sujet",
|
||||
"ID of the category to post in": "ID de la catégorie dans laquelle poster",
|
||||
"ID of the user": "ID de l'utilisateur",
|
||||
"New trust level of the user": "Nouveau niveau de confiance de l'utilisateur",
|
||||
"Id of the group": "Id du groupe",
|
||||
"List of users to add to the group": "Liste des utilisateurs à ajouter au groupe",
|
||||
"Title for the PM": "Titre du MP",
|
||||
"List of users to send the PM to (can be one or more)": "Liste des utilisateurs vers lesquels envoyer les MP (peut être un ou plusieurs)",
|
||||
"Authorization headers are injected automatically from your connection.": "Les en-têtes d'autorisation sont injectés automatiquement à partir de votre connexion.",
|
||||
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
|
||||
"GET": "OBTENIR",
|
||||
"POST": "POSTER",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "EFFACER",
|
||||
"DELETE": "SUPPRIMER",
|
||||
"HEAD": "TÊTE"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "モダンなオープンソースフォーラムソフトウェア",
|
||||
"API Key": "API キー",
|
||||
"API Username": "APIユーザー名",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "発言のURL。例:https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*APIキーを取得: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "投稿を作成",
|
||||
"Create Topic": "トピックを作成",
|
||||
"Change User Trust Level": "ユーザーの信頼レベルを変更",
|
||||
"Add Users to Group": "ユーザーをグループに追加",
|
||||
"Send Private Message": "プライベートメッセージを送信",
|
||||
"Custom API Call": "カスタムAPI通話",
|
||||
"Create a new post in discourse": "ディスカッションで新しい投稿を作成する",
|
||||
"Create a new topic in Discourse": "Discourse で新しいトピックを作成する",
|
||||
"Change the trust level of a user": "利用者の信頼レベルを変更する",
|
||||
"Add users to a group": "ユーザーをグループに追加",
|
||||
"Send a private message in Discourse": "Discourse でプライベートメッセージを送信する",
|
||||
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
|
||||
"Post Content": "コンテンツを投稿",
|
||||
"Topic ID": "トピックID",
|
||||
"Post Title": "投稿タイトル",
|
||||
"Topic Content": "トピックの内容",
|
||||
"Category ID": "カテゴリID",
|
||||
"User ID": "ユーザー ID",
|
||||
"New Trust Level": "新しい信託レベル",
|
||||
"Group Id": "グループ ID",
|
||||
"Users": "ユーザー",
|
||||
"Method": "方法",
|
||||
"Headers": "ヘッダー",
|
||||
"Query Parameters": "クエリパラメータ",
|
||||
"Body": "本文",
|
||||
"Response is Binary ?": "応答はバイナリですか?",
|
||||
"No Error on Failure": "失敗時にエラーはありません",
|
||||
"Timeout (in seconds)": "タイムアウト(秒)",
|
||||
"Content of the post": "投稿の内容",
|
||||
"ID of the topic to post in": "投稿するトピックの ID",
|
||||
"Title of the Topic": "トピックタイトル",
|
||||
"Content of the topic": "トピックの内容",
|
||||
"ID of the category to post in": "投稿するカテゴリID",
|
||||
"ID of the user": "利用者ID:",
|
||||
"New trust level of the user": "ユーザーの新しい信頼レベル",
|
||||
"Id of the group": "グループの Id",
|
||||
"List of users to add to the group": "グループに追加するユーザーのリスト",
|
||||
"Title for the PM": "PM のタイトル",
|
||||
"List of users to send the PM to (can be one or more)": "PMを送信するユーザーのリスト (1人以上可能)",
|
||||
"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": "頭"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Moderne open source forum software",
|
||||
"API Key": "API Sleutel",
|
||||
"API Username": "API gebruikersnaam",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL van de discours-url i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Krijg je api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Post aanmaken",
|
||||
"Create Topic": "Maak onderwerp aan",
|
||||
"Change User Trust Level": "Verander Gebruiker Trust Level",
|
||||
"Add Users to Group": "Gebruikers toevoegen aan groep",
|
||||
"Send Private Message": "Privé bericht verzenden",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create a new post in discourse": "Maak een nieuw bericht aan in de conversatie",
|
||||
"Create a new topic in Discourse": "Maak een nieuw topic aan in Discourse",
|
||||
"Change the trust level of a user": "Het trust level van een gebruiker wijzigen",
|
||||
"Add users to a group": "Gebruikers toevoegen aan een groep",
|
||||
"Send a private message in Discourse": "Stuur een privé bericht in Discourse",
|
||||
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
|
||||
"Post Content": "Bericht inhoud",
|
||||
"Topic ID": "Onderwerp ID",
|
||||
"Post Title": "Post titel",
|
||||
"Topic Content": "Onderwerp inhoud",
|
||||
"Category ID": "Categorie ID",
|
||||
"User ID": "Gebruiker ID",
|
||||
"New Trust Level": "Nieuw trustniveau",
|
||||
"Group Id": "Groep ID",
|
||||
"Users": "Gebruikers",
|
||||
"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)",
|
||||
"Content of the post": "Inhoud van het bericht",
|
||||
"ID of the topic to post in": "ID van het onderwerp om in te posten",
|
||||
"Title of the Topic": "Titel van het onderwerp",
|
||||
"Content of the topic": "Inhoud van het onderwerp",
|
||||
"ID of the category to post in": "ID van de te posten categorie",
|
||||
"ID of the user": "ID van de gebruiker",
|
||||
"New trust level of the user": "Nieuw trust level van de gebruiker",
|
||||
"Id of the group": "Id van de groep",
|
||||
"List of users to add to the group": "Lijst van toe te voegen gebruikers",
|
||||
"Title for the PM": "Titel van de PM",
|
||||
"List of users to send the PM to (can be one or more)": "Lijst van gebruikers om de PM naar te sturen (kan één of meer zijn)",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Software de fórum de código aberto moderno",
|
||||
"API Key": "Chave de API",
|
||||
"API Username": "Usuário da API",
|
||||
"Website URL": "URL do site",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL da url do discurso i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "U\n*Pegue sua chave de api: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Criar publicação",
|
||||
"Create Topic": "Criar tópico",
|
||||
"Change User Trust Level": "Mudar Nível de Confiança do Usuário",
|
||||
"Add Users to Group": "Adicionar Usuários ao Grupo",
|
||||
"Send Private Message": "Enviar mensagem privada",
|
||||
"Custom API Call": "Chamada de API personalizada",
|
||||
"Create a new post in discourse": "Criar uma nova publicação no discurso",
|
||||
"Create a new topic in Discourse": "Criar um novo tópico no Discourse",
|
||||
"Change the trust level of a user": "Alterar o nível de confiança de um usuário",
|
||||
"Add users to a group": "Adicionar usuários a um grupo",
|
||||
"Send a private message in Discourse": "Enviar uma mensagem privada no Discourse",
|
||||
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
|
||||
"Post Content": "Conteúdo da postagem",
|
||||
"Topic ID": "ID do tópico",
|
||||
"Post Title": "Título da Publicação",
|
||||
"Topic Content": "Conteúdo do tópico",
|
||||
"Category ID": "ID da Categoria",
|
||||
"User ID": "ID de usuário",
|
||||
"New Trust Level": "Novo nível de confiança",
|
||||
"Group Id": "ID do Grupo",
|
||||
"Users": "Usuários",
|
||||
"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)",
|
||||
"Content of the post": "Conteúdo da postagem",
|
||||
"ID of the topic to post in": "ID do tópico para publicar em",
|
||||
"Title of the Topic": "Título do Tópico",
|
||||
"Content of the topic": "Conteúdo do tópico",
|
||||
"ID of the category to post in": "ID da categoria para postar em",
|
||||
"ID of the user": "ID do usuário",
|
||||
"New trust level of the user": "Novo nível de confiança do usuário",
|
||||
"Id of the group": "ID do grupo",
|
||||
"List of users to add to the group": "Lista de usuários para adicionar ao grupo",
|
||||
"Title for the PM": "Título para a mensagem privada",
|
||||
"List of users to send the PM to (can be one or more)": "Lista de usuários para enviar mensagem privada (pode ser um ou mais)",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"Discourse": "Обсуждение",
|
||||
"Modern open source forum software": "Современное программное обеспечение с открытым исходным кодом",
|
||||
"API Key": "Ключ API",
|
||||
"API Username": "Имя пользователя API",
|
||||
"Website URL": "URL сайта",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL ссылки дискурса, т.е. https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Получить api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Создать запись",
|
||||
"Create Topic": "Создать тему",
|
||||
"Change User Trust Level": "Изменить уровень доверия пользователя",
|
||||
"Add Users to Group": "Добавить пользователей в группу",
|
||||
"Send Private Message": "Отправить личное сообщение",
|
||||
"Custom API Call": "Пользовательский вызов API",
|
||||
"Create a new post in discourse": "Создать новое сообщение в сообщении",
|
||||
"Create a new topic in Discourse": "Создать новую тему в Discourse",
|
||||
"Change the trust level of a user": "Изменить уровень доверия пользователя",
|
||||
"Add users to a group": "Добавить пользователей в группу",
|
||||
"Send a private message in Discourse": "Отправить личное сообщение в Дискурсе",
|
||||
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
|
||||
"Post Content": "Содержание сообщения",
|
||||
"Topic ID": "ID темы",
|
||||
"Post Title": "Название записи",
|
||||
"Topic Content": "Содержание темы",
|
||||
"Category ID": "ID категории",
|
||||
"User ID": "ID пользователя",
|
||||
"New Trust Level": "Новый уровень доверия",
|
||||
"Group Id": "ID группы",
|
||||
"Users": "Пользователи",
|
||||
"Method": "Метод",
|
||||
"Headers": "Заголовки",
|
||||
"Query Parameters": "Параметры запроса",
|
||||
"Body": "Тело",
|
||||
"No Error on Failure": "Нет ошибок при ошибке",
|
||||
"Timeout (in seconds)": "Таймаут (в секундах)",
|
||||
"Content of the post": "Содержание сообщения",
|
||||
"ID of the topic to post in": "ID темы для публикации",
|
||||
"Title of the Topic": "Название темы",
|
||||
"Content of the topic": "Содержание темы",
|
||||
"ID of the category to post in": "ID категории для публикации в",
|
||||
"ID of the user": "ID пользователя",
|
||||
"New trust level of the user": "Новый уровень доверия пользователя",
|
||||
"Id of the group": "Id группы",
|
||||
"List of users to add to the group": "Список пользователей для добавления в группу",
|
||||
"Title for the PM": "Название для PM",
|
||||
"List of users to send the PM to (can be one or more)": "Список пользователей, отправляющих ЛС (может быть одним или более)",
|
||||
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
|
||||
"GET": "ПОЛУЧИТЬ",
|
||||
"POST": "ПОСТ",
|
||||
"PATCH": "ПАТЧ",
|
||||
"PUT": "ПОКУПИТЬ",
|
||||
"DELETE": "УДАЛИТЬ",
|
||||
"HEAD": "HEAD"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Modern open source forum software",
|
||||
"API Key": "API Key",
|
||||
"API Username": "API Username",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL of the discourse url i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Topic": "Create Topic",
|
||||
"Change User Trust Level": "Change User Trust Level",
|
||||
"Add Users to Group": "Add Users to Group",
|
||||
"Send Private Message": "Send Private Message",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create a new post in discourse": "Create a new post in discourse",
|
||||
"Create a new topic in Discourse": "Create a new topic in Discourse",
|
||||
"Change the trust level of a user": "Change the trust level of a user",
|
||||
"Add users to a group": "Add users to a group",
|
||||
"Send a private message in Discourse": "Send a private message in Discourse",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Post Content": "Post Content",
|
||||
"Topic ID": "Topic ID",
|
||||
"Post Title": "Post Title",
|
||||
"Topic Content": "Topic Content",
|
||||
"Category ID": "Category ID",
|
||||
"User ID": "User ID",
|
||||
"New Trust Level": "New Trust Level",
|
||||
"Group Id": "Group Id",
|
||||
"Users": "Users",
|
||||
"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)",
|
||||
"Content of the post": "Content of the post",
|
||||
"ID of the topic to post in": "ID of the topic to post in",
|
||||
"Title of the Topic": "Title of the Topic",
|
||||
"Content of the topic": "Content of the topic",
|
||||
"ID of the category to post in": "ID of the category to post in",
|
||||
"ID of the user": "ID of the user",
|
||||
"New trust level of the user": "New trust level of the user",
|
||||
"Id of the group": "Id of the group",
|
||||
"List of users to add to the group": "List of users to add to the group",
|
||||
"Title for the PM": "Title for the PM",
|
||||
"List of users to send the PM to (can be one or more)": "List of users to send the PM to (can be one or more)",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"Discourse": "Discourse",
|
||||
"Modern open source forum software": "Modern open source forum software",
|
||||
"API Key": "API Key",
|
||||
"API Username": "API Username",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL of the discourse url i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Topic": "Create Topic",
|
||||
"Change User Trust Level": "Change User Trust Level",
|
||||
"Add Users to Group": "Add Users to Group",
|
||||
"Send Private Message": "Send Private Message",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create a new post in discourse": "Create a new post in discourse",
|
||||
"Create a new topic in Discourse": "Create a new topic in Discourse",
|
||||
"Change the trust level of a user": "Change the trust level of a user",
|
||||
"Add users to a group": "Add users to a group",
|
||||
"Send a private message in Discourse": "Send a private message in Discourse",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Post Content": "Post Content",
|
||||
"Topic ID": "Topic ID",
|
||||
"Post Title": "Post Title",
|
||||
"Topic Content": "Topic Content",
|
||||
"Category ID": "Category ID",
|
||||
"User ID": "User ID",
|
||||
"New Trust Level": "New Trust Level",
|
||||
"Group Id": "Group Id",
|
||||
"Users": "Users",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"Content of the post": "Content of the post",
|
||||
"ID of the topic to post in": "ID of the topic to post in",
|
||||
"Title of the Topic": "Title of the Topic",
|
||||
"Content of the topic": "Content of the topic",
|
||||
"ID of the category to post in": "ID of the category to post in",
|
||||
"ID of the user": "ID of the user",
|
||||
"New trust level of the user": "New trust level of the user",
|
||||
"Id of the group": "Id of the group",
|
||||
"List of users to add to the group": "List of users to add to the group",
|
||||
"Title for the PM": "Title for the PM",
|
||||
"List of users to send the PM to (can be one or more)": "List of users to send the PM to (can be one or more)",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Modern open source forum software": "Modern open source forum software",
|
||||
"API Key": "API 密钥",
|
||||
"API Username": "API Username",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the discourse url i.e https://discourse.yourinstance.com": "URL of the discourse url i.e https://discourse.yourinstance.com",
|
||||
"\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Topic": "Create Topic",
|
||||
"Change User Trust Level": "Change User Trust Level",
|
||||
"Add Users to Group": "Add Users to Group",
|
||||
"Send Private Message": "Send Private Message",
|
||||
"Custom API Call": "自定义 API 呼叫",
|
||||
"Create a new post in discourse": "Create a new post in discourse",
|
||||
"Create a new topic in Discourse": "Create a new topic in Discourse",
|
||||
"Change the trust level of a user": "Change the trust level of a user",
|
||||
"Add users to a group": "Add users to a group",
|
||||
"Send a private message in Discourse": "Send a private message in Discourse",
|
||||
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
|
||||
"Post Content": "Post Content",
|
||||
"Topic ID": "Topic ID",
|
||||
"Post Title": "Post Title",
|
||||
"Topic Content": "Topic Content",
|
||||
"Category ID": "Category ID",
|
||||
"User ID": "User ID",
|
||||
"New Trust Level": "New Trust Level",
|
||||
"Group Id": "Group Id",
|
||||
"Users": "用户",
|
||||
"Method": "方法",
|
||||
"Headers": "信头",
|
||||
"Query Parameters": "查询参数",
|
||||
"Body": "正文内容",
|
||||
"Response is Binary ?": "Response is Binary ?",
|
||||
"No Error on Failure": "失败时没有错误",
|
||||
"Timeout (in seconds)": "超时(秒)",
|
||||
"Content of the post": "Content of the post",
|
||||
"ID of the topic to post in": "ID of the topic to post in",
|
||||
"Title of the Topic": "Title of the Topic",
|
||||
"Content of the topic": "Content of the topic",
|
||||
"ID of the category to post in": "ID of the category to post in",
|
||||
"ID of the user": "ID of the user",
|
||||
"New trust level of the user": "New trust level of the user",
|
||||
"Id of the group": "Id of the group",
|
||||
"List of users to add to the group": "List of users to add to the group",
|
||||
"Title for the PM": "Title for the PM",
|
||||
"List of users to send the PM to (can be one or more)": "List of users to send the PM to (can be one or more)",
|
||||
"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": "黑色"
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import { createCustomApiCallAction } from '@activepieces/pieces-common';
|
||||
import {
|
||||
createPiece,
|
||||
PieceAuth,
|
||||
Property,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { addUsersToGroup } from './lib/actions/add-users-to-group.action';
|
||||
import { changeUserTrustLevel } from './lib/actions/change-trust-level.action';
|
||||
import { createPost } from './lib/actions/create-post.action';
|
||||
import { createTopic } from './lib/actions/create-topic.action';
|
||||
import { sendPrivateMessage } from './lib/actions/send-private-message.action';
|
||||
|
||||
const markdownPropertyDescription = `
|
||||
*Get your api Key: https://discourse.yourinstance.com/admin/api/keys
|
||||
`;
|
||||
|
||||
export const discourseAuth = PieceAuth.CustomAuth({
|
||||
description: markdownPropertyDescription,
|
||||
required: true,
|
||||
props: {
|
||||
api_key: PieceAuth.SecretText({
|
||||
displayName: 'API Key',
|
||||
required: true,
|
||||
}),
|
||||
api_username: Property.ShortText({
|
||||
displayName: 'API Username',
|
||||
required: true,
|
||||
}),
|
||||
website_url: Property.ShortText({
|
||||
displayName: 'Website URL',
|
||||
required: true,
|
||||
description:
|
||||
'URL of the discourse url i.e https://discourse.yourinstance.com',
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const discourse = createPiece({
|
||||
displayName: 'Discourse',
|
||||
description: 'Modern open source forum software',
|
||||
auth: discourseAuth,
|
||||
minimumSupportedRelease: '0.30.0',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/discourse.png',
|
||||
categories: [PieceCategory.COMMUNICATION],
|
||||
authors: ["pfernandez98","kishanprmr","MoShizzle","abuaboud"],
|
||||
actions: [
|
||||
createPost,
|
||||
createTopic,
|
||||
changeUserTrustLevel,
|
||||
addUsersToGroup,
|
||||
sendPrivateMessage,
|
||||
createCustomApiCallAction({
|
||||
baseUrl: (auth) => auth ? (auth.props.website_url.trim()) : '',
|
||||
auth: discourseAuth,
|
||||
authMapping: async (auth) => ({
|
||||
'Api-Key': auth.props.api_key,
|
||||
'Api-Username': auth.props.api_username,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { discourseAuth } from '../../index';
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
|
||||
export const addUsersToGroup = createAction({
|
||||
auth: discourseAuth,
|
||||
name: 'add_users_to_group',
|
||||
description: 'Add users to a group',
|
||||
displayName: 'Add Users to Group',
|
||||
props: {
|
||||
group_id: Property.Dropdown({
|
||||
auth: discourseAuth,
|
||||
description: 'Id of the group',
|
||||
displayName: 'Group Id',
|
||||
required: true,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your discourse account',
|
||||
};
|
||||
}
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${auth.props.website_url.trim()}/groups.json`,
|
||||
headers: {
|
||||
'Api-Key': auth.props.api_key,
|
||||
'Api-Username': auth.props.api_username,
|
||||
},
|
||||
});
|
||||
const options = response.body['groups'].map(
|
||||
(res: { display_name: any; id: any }) => {
|
||||
return {
|
||||
label: res.display_name,
|
||||
value: res.id,
|
||||
};
|
||||
}
|
||||
);
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
}),
|
||||
users: Property.Array({
|
||||
description: 'List of users to add to the group',
|
||||
displayName: 'Users',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { group_id, users } = context.propsValue;
|
||||
//convert array to comma separated string
|
||||
users.join(',');
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.PUT,
|
||||
url: `${context.auth.props.website_url.trim()}/groups/${group_id}/members.json`,
|
||||
headers: {
|
||||
'Api-Key': context.auth.props.api_key,
|
||||
'Api-Username': context.auth.props.api_username,
|
||||
},
|
||||
body: {
|
||||
usernames: users.join(','),
|
||||
},
|
||||
});
|
||||
return response.body;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { discourseAuth } from '../../index';
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
|
||||
export const changeUserTrustLevel = createAction({
|
||||
auth: discourseAuth,
|
||||
name: 'change_user_trust_level',
|
||||
description: 'Change the trust level of a user',
|
||||
displayName: 'Change User Trust Level',
|
||||
props: {
|
||||
user_id: Property.ShortText({
|
||||
description: 'ID of the user',
|
||||
displayName: 'User ID',
|
||||
required: true,
|
||||
}),
|
||||
new_trust_level: Property.Dropdown({
|
||||
description: 'New trust level of the user',
|
||||
displayName: 'New Trust Level',
|
||||
auth: discourseAuth,
|
||||
required: true,
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your discourse account',
|
||||
};
|
||||
}
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${auth.props.website_url.trim()}/site.json`,
|
||||
headers: {
|
||||
'Api-Key': auth.props.api_key,
|
||||
'Api-Username': auth.props.api_username,
|
||||
},
|
||||
});
|
||||
|
||||
const result: { name: string; value: number }[] = [];
|
||||
const trust_levels = response.body['trust_levels'];
|
||||
for (const key in trust_levels) {
|
||||
result.push({ name: key, value: trust_levels[key] });
|
||||
}
|
||||
|
||||
const options = result.map((res) => {
|
||||
return {
|
||||
label: res.name,
|
||||
value: res.value,
|
||||
};
|
||||
});
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
refreshers: [],
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { user_id, new_trust_level } = context.propsValue;
|
||||
return await httpClient.sendRequest({
|
||||
method: HttpMethod.PUT,
|
||||
url: `${context.auth.props.website_url.trim()}/u/${user_id}.json`,
|
||||
headers: {
|
||||
'Api-Key': context.auth.props.api_key,
|
||||
'Api-Username': context.auth.props.api_username,
|
||||
},
|
||||
body: {
|
||||
trust_level: new_trust_level,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { discourseAuth } from '../../index';
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
|
||||
export const createPost = createAction({
|
||||
auth: discourseAuth,
|
||||
name: 'create_post',
|
||||
description: 'Create a new post in discourse',
|
||||
displayName: 'Create Post',
|
||||
props: {
|
||||
raw: Property.LongText({
|
||||
description: 'Content of the post',
|
||||
displayName: 'Post Content',
|
||||
required: true,
|
||||
}),
|
||||
topic_id: Property.Dropdown({
|
||||
auth: discourseAuth,
|
||||
description: 'ID of the topic to post in',
|
||||
displayName: 'Topic ID',
|
||||
required: true,
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your discourse account',
|
||||
};
|
||||
}
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${auth.props.website_url.trim()}/latest.json`,
|
||||
headers: {
|
||||
'Api-Key': auth.props.api_key,
|
||||
'Api-Username': auth.props.api_username,
|
||||
},
|
||||
});
|
||||
const options = response.body['topic_list']['topics'].map(
|
||||
(res: { title: any; id: any }) => {
|
||||
return {
|
||||
label: res.title,
|
||||
value: res.id,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
refreshers: [],
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { raw, topic_id } = context.propsValue;
|
||||
|
||||
return await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/posts.json`,
|
||||
headers: {
|
||||
'Api-Key': context.auth.props.api_key,
|
||||
'Api-Username': context.auth.props.api_username,
|
||||
},
|
||||
body: {
|
||||
raw: raw,
|
||||
topic_id: topic_id,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,79 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { discourseAuth } from '../../index';
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
|
||||
export const createTopic = createAction({
|
||||
auth: discourseAuth,
|
||||
name: 'create_topic',
|
||||
description: 'Create a new topic in Discourse',
|
||||
displayName: 'Create Topic',
|
||||
props: {
|
||||
title: Property.ShortText({
|
||||
description: 'Title of the Topic',
|
||||
displayName: 'Post Title',
|
||||
required: true,
|
||||
}),
|
||||
raw: Property.LongText({
|
||||
description: 'Content of the topic',
|
||||
displayName: 'Topic Content',
|
||||
required: true,
|
||||
}),
|
||||
category: Property.Dropdown({
|
||||
description: 'ID of the category to post in',
|
||||
displayName: 'Category ID',
|
||||
required: false,
|
||||
auth: discourseAuth,
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your discourse account',
|
||||
};
|
||||
}
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${auth.props.website_url.trim()}/categories.json`,
|
||||
headers: {
|
||||
'Api-Key': auth.props.api_key,
|
||||
'Api-Username': auth.props.api_username,
|
||||
},
|
||||
});
|
||||
const options = response.body['category_list']['categories'].map(
|
||||
(res: { name: any; id: any }) => {
|
||||
return {
|
||||
label: res.name,
|
||||
value: res.id,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
refreshers: [],
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { title, raw, category } = context.propsValue;
|
||||
|
||||
console.log('new post action');
|
||||
|
||||
return await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/posts.json`,
|
||||
headers: {
|
||||
'Api-Key': context.auth.props.api_key,
|
||||
'Api-Username': context.auth.props.api_username,
|
||||
},
|
||||
body: {
|
||||
title: title,
|
||||
raw: raw,
|
||||
category: category,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { discourseAuth } from '../../index';
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
|
||||
export const sendPrivateMessage = createAction({
|
||||
auth: discourseAuth,
|
||||
name: 'send_private_message',
|
||||
description: 'Send a private message in Discourse',
|
||||
displayName: 'Send Private Message',
|
||||
props: {
|
||||
title: Property.ShortText({
|
||||
description: 'Title for the PM',
|
||||
displayName: 'Post Title',
|
||||
required: true,
|
||||
}),
|
||||
raw: Property.LongText({
|
||||
description: 'Content of the post',
|
||||
displayName: 'Post Content',
|
||||
required: true,
|
||||
}),
|
||||
target_recipients: Property.Array({
|
||||
description: 'List of users to send the PM to (can be one or more)',
|
||||
displayName: 'Users',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { title, raw, target_recipients } = context.propsValue;
|
||||
|
||||
return await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/posts.json`,
|
||||
headers: {
|
||||
'Api-Key': context.auth.props.api_key,
|
||||
'Api-Username': context.auth.props.api_username,
|
||||
},
|
||||
body: {
|
||||
raw: raw,
|
||||
title: title,
|
||||
target_recipients: target_recipients.join(','),
|
||||
archetype: 'private_message',
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user