@scopieflows/app-discourse 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-discourse
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build pieces-discourse` to build the library.
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@scopieflows/app-discourse",
3
+ "version": "0.1.1",
4
+ "dependencies": {
5
+ "@sinclair/typebox": "0.34.11",
6
+ "ai": "^6.0.0",
7
+ "axios": "1.13.1",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "form-data": "4.0.4",
11
+ "i18next": "23.13.0",
12
+ "mime-types": "2.1.35",
13
+ "nanoid": "3.3.8",
14
+ "semver": "7.6.0",
15
+ "socket.io-client": "4.8.1",
16
+ "zod": "4.1.13",
17
+ "@scopieflows/pieces-common": "0.11.2",
18
+ "@scopieflows/pieces-framework": "0.25.0",
19
+ "@scopieflows/shared": "0.33.0",
20
+ "tslib": "2.6.2"
21
+ },
22
+ "resolutions": {
23
+ "rollup": "npm:@rollup/wasm-node"
24
+ },
25
+ "types": "./src/index.d.ts",
26
+ "main": "./src/index.js",
27
+ "type": "commonjs"
28
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Moderne Open Source Forum Software",
3
+ "API Key": "API-Schlüssel",
4
+ "API Username": "API Benutzername",
5
+ "Website URL": "Website-URL",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL des Diskurses url i.e https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Beitrag erstellen",
9
+ "Create Topic": "Thema erstellen",
10
+ "Change User Trust Level": "Benutzer-Vertrauenslevel ändern",
11
+ "Add Users to Group": "Benutzer zur Gruppe hinzufügen",
12
+ "Send Private Message": "Private Nachricht senden",
13
+ "Custom API Call": "Eigener API-Aufruf",
14
+ "Create a new post in discourse": "Neuen Beitrag im Diskurs erstellen",
15
+ "Create a new topic in Discourse": "Ein neues Thema im Diskurs erstellen",
16
+ "Change the trust level of a user": "Vertrauensstufe eines Benutzers ändern",
17
+ "Add users to a group": "Benutzer zu einer Gruppe hinzufügen",
18
+ "Send a private message in Discourse": "Eine private Nachricht im Diskurs senden",
19
+ "Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
20
+ "Post Content": "Beitragsinhalt",
21
+ "Topic ID": "Themen-ID",
22
+ "Post Title": "Beitragstitel",
23
+ "Topic Content": "Inhalt des Themas",
24
+ "Category ID": "Kategorie-ID",
25
+ "User ID": "Benutzer-ID",
26
+ "New Trust Level": "Neue Vertrauensstufe",
27
+ "Group Id": "Gruppen Id",
28
+ "Users": "Benutzer",
29
+ "Method": "Methode",
30
+ "Headers": "Kopfzeilen",
31
+ "Query Parameters": "Abfrageparameter",
32
+ "Body Type": "Körpertyp",
33
+ "Body": "Körper",
34
+ "Response is Binary ?": "Antwort ist binär?",
35
+ "No Error on Failure": "Kein Fehler bei Fehler",
36
+ "Timeout (in seconds)": "Timeout (in Sekunden)",
37
+ "Follow redirects": "Weiterleitungen folgen",
38
+ "Content of the post": "Inhalt des Beitrags",
39
+ "ID of the topic to post in": "ID des Themas zum Posten",
40
+ "Title of the Topic": "Titel des Themas",
41
+ "Content of the topic": "Inhalt des Themas",
42
+ "ID of the category to post in": "ID der Kategorie, in der gepostet werden soll",
43
+ "ID of the user": "ID des Benutzers",
44
+ "New trust level of the user": "Neue Vertrauensstufe des Benutzers",
45
+ "Id of the group": "Id der Gruppe",
46
+ "List of users to add to the group": "Liste der Benutzer zur Gruppe hinzufügen",
47
+ "Title for the PM": "Titel für die PM",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
50
+ "Enable for files like PDFs, images, etc.": "Aktivieren für Dateien wie PDFs, Bilder usw.",
51
+ "GET": "ERHALTEN",
52
+ "POST": "POST",
53
+ "PATCH": "PATCH",
54
+ "PUT": "PUT",
55
+ "DELETE": "LÖSCHEN",
56
+ "HEAD": "HEAD",
57
+ "None": "Keine",
58
+ "JSON": "JSON",
59
+ "Form Data": "Formulardaten",
60
+ "Raw": "Rohe"
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Software moderno de foro de código abierto",
3
+ "API Key": "Clave API",
4
+ "API Username": "Usuario API",
5
+ "Website URL": "URL del sitio web",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL del url del discurso, es decir, https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Crear publicación",
9
+ "Create Topic": "Crear tema",
10
+ "Change User Trust Level": "Cambiar Nivel de Confianza de Usuario",
11
+ "Add Users to Group": "Añadir usuarios al grupo",
12
+ "Send Private Message": "Enviar mensaje privado",
13
+ "Custom API Call": "Llamada API personalizada",
14
+ "Create a new post in discourse": "Crear un nuevo mensaje en el discurso",
15
+ "Create a new topic in Discourse": "Crear un nuevo tema en Discourse",
16
+ "Change the trust level of a user": "Cambiar el nivel de confianza de un usuario",
17
+ "Add users to a group": "Añadir usuarios a un grupo",
18
+ "Send a private message in Discourse": "Enviar un mensaje privado en Discourse",
19
+ "Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
20
+ "Post Content": "Publicar contenido",
21
+ "Topic ID": "ID del tema",
22
+ "Post Title": "Título del post",
23
+ "Topic Content": "Contenido del tema",
24
+ "Category ID": "ID de categoría",
25
+ "User ID": "ID Usuario",
26
+ "New Trust Level": "Nuevo nivel de confianza",
27
+ "Group Id": "Id del grupo",
28
+ "Users": "Usuarios",
29
+ "Method": "Método",
30
+ "Headers": "Encabezados",
31
+ "Query Parameters": "Parámetros de consulta",
32
+ "Body Type": "Tipo de cuerpo",
33
+ "Body": "Cuerpo",
34
+ "Response is Binary ?": "¿Respuesta es binaria?",
35
+ "No Error on Failure": "No hay ningún error en fallo",
36
+ "Timeout (in seconds)": "Tiempo de espera (en segundos)",
37
+ "Follow redirects": "Seguir redirecciones",
38
+ "Content of the post": "Contenido del post",
39
+ "ID of the topic to post in": "ID del tema en el que publicar",
40
+ "Title of the Topic": "Título del tema",
41
+ "Content of the topic": "Contenido del tema",
42
+ "ID of the category to post in": "ID de la categoría en la que publicar",
43
+ "ID of the user": "ID del usuario",
44
+ "New trust level of the user": "Nuevo nivel de confianza del usuario",
45
+ "Id of the group": "Id del grupo",
46
+ "List of users to add to the group": "Lista de usuarios a añadir al grupo",
47
+ "Title for the PM": "Título para el PM",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
50
+ "Enable for files like PDFs, images, etc.": "Activar para archivos como PDFs, imágenes, etc.",
51
+ "GET": "RECOGER",
52
+ "POST": "POST",
53
+ "PATCH": "PATCH",
54
+ "PUT": "PUT",
55
+ "DELETE": "BORRAR",
56
+ "HEAD": "LIMPIO",
57
+ "None": "Ninguna",
58
+ "JSON": "JSON",
59
+ "Form Data": "Datos de Formulario",
60
+ "Raw": "Rápido"
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Logiciel de forum libre moderne",
3
+ "API Key": "Clé API",
4
+ "API Username": "Nom d'utilisateur API",
5
+ "Website URL": "URL du site web",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL de l'URL du discours i.e https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Créer un message",
9
+ "Create Topic": "Créer un sujet",
10
+ "Change User Trust Level": "Changer le niveau de confiance de l'utilisateur",
11
+ "Add Users to Group": "Ajouter des utilisateurs au groupe",
12
+ "Send Private Message": "Envoyer un message privé",
13
+ "Custom API Call": "Appel API personnalisé",
14
+ "Create a new post in discourse": "Créer un nouveau message dans le discours",
15
+ "Create a new topic in Discourse": "Créer un nouveau sujet dans le discours",
16
+ "Change the trust level of a user": "Changer le niveau de confiance d'un utilisateur",
17
+ "Add users to a group": "Ajouter des utilisateurs à un groupe",
18
+ "Send a private message in Discourse": "Envoyer un message privé dans Discours",
19
+ "Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un point de terminaison spécifique",
20
+ "Post Content": "Contenu de la publication",
21
+ "Topic ID": "ID du sujet",
22
+ "Post Title": "Titre de la publication",
23
+ "Topic Content": "Contenu du sujet",
24
+ "Category ID": "ID de la catégorie",
25
+ "User ID": "Identifiant de l'utilisateur",
26
+ "New Trust Level": "Nouveau niveau de confiance",
27
+ "Group Id": "Identifiant du groupe",
28
+ "Users": "Utilisateurs",
29
+ "Method": "Méthode",
30
+ "Headers": "En-têtes",
31
+ "Query Parameters": "Paramètres de requête",
32
+ "Body Type": "Body Type",
33
+ "Body": "Corps",
34
+ "Response is Binary ?": "La réponse est Binaire ?",
35
+ "No Error on Failure": "Aucune erreur en cas d'échec",
36
+ "Timeout (in seconds)": "Délai d'attente (en secondes)",
37
+ "Follow redirects": "Suivre les redirections",
38
+ "Content of the post": "Contenu du message",
39
+ "ID of the topic to post in": "ID du sujet à publier dans",
40
+ "Title of the Topic": "Titre du sujet",
41
+ "Content of the topic": "Contenu du sujet",
42
+ "ID of the category to post in": "ID de la catégorie dans laquelle poster",
43
+ "ID of the user": "ID de l'utilisateur",
44
+ "New trust level of the user": "Nouveau niveau de confiance de l'utilisateur",
45
+ "Id of the group": "Id du groupe",
46
+ "List of users to add to the group": "Liste des utilisateurs à ajouter au groupe",
47
+ "Title for the PM": "Titre du MP",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "Les en-têtes d'autorisation sont injectés automatiquement à partir de votre connexion.",
50
+ "Enable for files like PDFs, images, etc.": "Activer pour les fichiers comme les PDFs, les images, etc.",
51
+ "GET": "OBTENIR",
52
+ "POST": "POSTER",
53
+ "PATCH": "PATCH",
54
+ "PUT": "EFFACER",
55
+ "DELETE": "SUPPRIMER",
56
+ "HEAD": "TÊTE",
57
+ "None": "Aucun",
58
+ "JSON": "JSON",
59
+ "Form Data": "Données du formulaire",
60
+ "Raw": "Brut"
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "モダンなオープンソースフォーラムソフトウェア",
3
+ "API Key": "API キー",
4
+ "API Username": "APIユーザー名",
5
+ "Website URL": "Website URL",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "発言のURL。例:https://discourse.yourinstance.com",
7
+ "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*APIキーを取得: https://discourse.yourinstance.com/admin/api/keys\n",
8
+ "Create Post": "投稿を作成",
9
+ "Create Topic": "トピックを作成",
10
+ "Change User Trust Level": "ユーザーの信頼レベルを変更",
11
+ "Add Users to Group": "ユーザーをグループに追加",
12
+ "Send Private Message": "プライベートメッセージを送信",
13
+ "Custom API Call": "カスタムAPI通話",
14
+ "Create a new post in discourse": "ディスカッションで新しい投稿を作成する",
15
+ "Create a new topic in Discourse": "Discourse で新しいトピックを作成する",
16
+ "Change the trust level of a user": "利用者の信頼レベルを変更する",
17
+ "Add users to a group": "ユーザーをグループに追加",
18
+ "Send a private message in Discourse": "Discourse でプライベートメッセージを送信する",
19
+ "Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
20
+ "Post Content": "コンテンツを投稿",
21
+ "Topic ID": "トピックID",
22
+ "Post Title": "投稿タイトル",
23
+ "Topic Content": "トピックの内容",
24
+ "Category ID": "カテゴリID",
25
+ "User ID": "ユーザー ID",
26
+ "New Trust Level": "新しい信託レベル",
27
+ "Group Id": "グループ ID",
28
+ "Users": "ユーザー",
29
+ "Method": "方法",
30
+ "Headers": "ヘッダー",
31
+ "Query Parameters": "クエリパラメータ",
32
+ "Body Type": "ボディタイプ",
33
+ "Body": "本文",
34
+ "Response is Binary ?": "応答はバイナリですか?",
35
+ "No Error on Failure": "失敗時にエラーはありません",
36
+ "Timeout (in seconds)": "タイムアウト(秒)",
37
+ "Follow redirects": "リダイレクトをフォローする",
38
+ "Content of the post": "投稿の内容",
39
+ "ID of the topic to post in": "投稿するトピックの ID",
40
+ "Title of the Topic": "トピックタイトル",
41
+ "Content of the topic": "トピックの内容",
42
+ "ID of the category to post in": "投稿するカテゴリID",
43
+ "ID of the user": "利用者ID:",
44
+ "New trust level of the user": "ユーザーの新しい信頼レベル",
45
+ "Id of the group": "グループの Id",
46
+ "List of users to add to the group": "グループに追加するユーザーのリスト",
47
+ "Title for the PM": "PM のタイトル",
48
+ "List of users to send the PM to (can be one or more)": "PMを送信するユーザーのリスト (1人以上可能)",
49
+ "Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
50
+ "Enable for files like PDFs, images, etc.": "PDF、画像などのファイルを有効にする",
51
+ "GET": "取得",
52
+ "POST": "POST",
53
+ "PATCH": "PATCH",
54
+ "PUT": "PUT",
55
+ "DELETE": "削除",
56
+ "HEAD": "頭",
57
+ "None": "なし",
58
+ "JSON": "JSON",
59
+ "Form Data": "フォームデータ",
60
+ "Raw": "Raw"
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Moderne open source forum software",
3
+ "API Key": "API Sleutel",
4
+ "API Username": "API gebruikersnaam",
5
+ "Website URL": "Website URL",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL van de discours-url i.e https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Post aanmaken",
9
+ "Create Topic": "Maak onderwerp aan",
10
+ "Change User Trust Level": "Verander Gebruiker Trust Level",
11
+ "Add Users to Group": "Gebruikers toevoegen aan groep",
12
+ "Send Private Message": "Privé bericht verzenden",
13
+ "Custom API Call": "Custom API Call",
14
+ "Create a new post in discourse": "Maak een nieuw bericht aan in de conversatie",
15
+ "Create a new topic in Discourse": "Maak een nieuw topic aan in Discourse",
16
+ "Change the trust level of a user": "Het trust level van een gebruiker wijzigen",
17
+ "Add users to a group": "Gebruikers toevoegen aan een groep",
18
+ "Send a private message in Discourse": "Stuur een privé bericht in Discourse",
19
+ "Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
20
+ "Post Content": "Bericht inhoud",
21
+ "Topic ID": "Onderwerp ID",
22
+ "Post Title": "Post titel",
23
+ "Topic Content": "Onderwerp inhoud",
24
+ "Category ID": "Categorie ID",
25
+ "User ID": "Gebruiker ID",
26
+ "New Trust Level": "Nieuw trustniveau",
27
+ "Group Id": "Groep ID",
28
+ "Users": "Gebruikers",
29
+ "Method": "Methode",
30
+ "Headers": "Kopteksten",
31
+ "Query Parameters": "Query parameters",
32
+ "Body Type": "Type lichaam",
33
+ "Body": "Lichaam",
34
+ "Response is Binary ?": "Antwoord is binair?",
35
+ "No Error on Failure": "Geen fout bij fout",
36
+ "Timeout (in seconds)": "Time-out (in seconden)",
37
+ "Follow redirects": "Volg omleidingen",
38
+ "Content of the post": "Inhoud van het bericht",
39
+ "ID of the topic to post in": "ID van het onderwerp om in te posten",
40
+ "Title of the Topic": "Titel van het onderwerp",
41
+ "Content of the topic": "Inhoud van het onderwerp",
42
+ "ID of the category to post in": "ID van de te posten categorie",
43
+ "ID of the user": "ID van de gebruiker",
44
+ "New trust level of the user": "Nieuw trust level van de gebruiker",
45
+ "Id of the group": "Id van de groep",
46
+ "List of users to add to the group": "Lijst van toe te voegen gebruikers",
47
+ "Title for the PM": "Titel van de PM",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
50
+ "Enable for files like PDFs, images, etc.": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc.",
51
+ "GET": "KRIJG",
52
+ "POST": "POSTE",
53
+ "PATCH": "BEKIJK",
54
+ "PUT": "PUT",
55
+ "DELETE": "VERWIJDEREN",
56
+ "HEAD": "HOOFD",
57
+ "None": "geen",
58
+ "JSON": "JSON",
59
+ "Form Data": "Formulieren gegevens",
60
+ "Raw": "Onbewerkte"
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Software de fórum de código aberto moderno",
3
+ "API Key": "Chave de API",
4
+ "API Username": "Usuário da API",
5
+ "Website URL": "URL do site",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL da url do discurso i.e https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Criar publicação",
9
+ "Create Topic": "Criar tópico",
10
+ "Change User Trust Level": "Mudar Nível de Confiança do Usuário",
11
+ "Add Users to Group": "Adicionar Usuários ao Grupo",
12
+ "Send Private Message": "Enviar mensagem privada",
13
+ "Custom API Call": "Chamada de API personalizada",
14
+ "Create a new post in discourse": "Criar uma nova publicação no discurso",
15
+ "Create a new topic in Discourse": "Criar um novo tópico no Discourse",
16
+ "Change the trust level of a user": "Alterar o nível de confiança de um usuário",
17
+ "Add users to a group": "Adicionar usuários a um grupo",
18
+ "Send a private message in Discourse": "Enviar uma mensagem privada no Discourse",
19
+ "Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
20
+ "Post Content": "Conteúdo da postagem",
21
+ "Topic ID": "ID do tópico",
22
+ "Post Title": "Título da Publicação",
23
+ "Topic Content": "Conteúdo do tópico",
24
+ "Category ID": "ID da Categoria",
25
+ "User ID": "ID de usuário",
26
+ "New Trust Level": "Novo nível de confiança",
27
+ "Group Id": "ID do Grupo",
28
+ "Users": "Usuários",
29
+ "Method": "Método",
30
+ "Headers": "Cabeçalhos",
31
+ "Query Parameters": "Parâmetros da consulta",
32
+ "Body Type": "Tipo de Corpo",
33
+ "Body": "Conteúdo",
34
+ "Response is Binary ?": "A resposta é binária ?",
35
+ "No Error on Failure": "Nenhum erro no Failure",
36
+ "Timeout (in seconds)": "Tempo limite (em segundos)",
37
+ "Follow redirects": "Seguir redirecionamentos",
38
+ "Content of the post": "Conteúdo da postagem",
39
+ "ID of the topic to post in": "ID do tópico para publicar em",
40
+ "Title of the Topic": "Título do Tópico",
41
+ "Content of the topic": "Conteúdo do tópico",
42
+ "ID of the category to post in": "ID da categoria para postar em",
43
+ "ID of the user": "ID do usuário",
44
+ "New trust level of the user": "Novo nível de confiança do usuário",
45
+ "Id of the group": "ID do grupo",
46
+ "List of users to add to the group": "Lista de usuários para adicionar ao grupo",
47
+ "Title for the PM": "Título para a mensagem privada",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
50
+ "Enable for files like PDFs, images, etc.": "Habilitar para arquivos como PDFs, imagens, etc.",
51
+ "GET": "OBTER",
52
+ "POST": "POSTAR",
53
+ "PATCH": "COMPRAR",
54
+ "PUT": "COLOCAR",
55
+ "DELETE": "EXCLUIR",
56
+ "HEAD": "CABEÇA",
57
+ "None": "Nenhuma",
58
+ "JSON": "JSON",
59
+ "Form Data": "Dados de Formulário",
60
+ "Raw": "RAW"
61
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "Discourse": "Обсуждение",
3
+ "Modern open source forum software": "Современное программное обеспечение с открытым исходным кодом",
4
+ "API Key": "Ключ API",
5
+ "API Username": "Имя пользователя API",
6
+ "Website URL": "URL сайта",
7
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL ссылки дискурса, т.е. https://discourse.yourinstance.com",
8
+ "\n*Get your api Key: https://discourse.yourinstance.com/admin/api/keys\n": "\n*Получить api Key: https://discourse.yourinstance.com/admin/api/keys\n",
9
+ "Create Post": "Создать запись",
10
+ "Create Topic": "Создать тему",
11
+ "Change User Trust Level": "Изменить уровень доверия пользователя",
12
+ "Add Users to Group": "Добавить пользователей в группу",
13
+ "Send Private Message": "Отправить личное сообщение",
14
+ "Custom API Call": "Пользовательский вызов API",
15
+ "Create a new post in discourse": "Создать новое сообщение в сообщении",
16
+ "Create a new topic in Discourse": "Создать новую тему в Discourse",
17
+ "Change the trust level of a user": "Изменить уровень доверия пользователя",
18
+ "Add users to a group": "Добавить пользователей в группу",
19
+ "Send a private message in Discourse": "Отправить личное сообщение в Дискурсе",
20
+ "Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
21
+ "Post Content": "Содержание сообщения",
22
+ "Topic ID": "ID темы",
23
+ "Post Title": "Название записи",
24
+ "Topic Content": "Содержание темы",
25
+ "Category ID": "ID категории",
26
+ "User ID": "ID пользователя",
27
+ "New Trust Level": "Новый уровень доверия",
28
+ "Group Id": "ID группы",
29
+ "Users": "Пользователи",
30
+ "Method": "Метод",
31
+ "Headers": "Заголовки",
32
+ "Query Parameters": "Параметры запроса",
33
+ "Body": "Тело",
34
+ "No Error on Failure": "Нет ошибок при ошибке",
35
+ "Timeout (in seconds)": "Таймаут (в секундах)",
36
+ "Content of the post": "Содержание сообщения",
37
+ "ID of the topic to post in": "ID темы для публикации",
38
+ "Title of the Topic": "Название темы",
39
+ "Content of the topic": "Содержание темы",
40
+ "ID of the category to post in": "ID категории для публикации в",
41
+ "ID of the user": "ID пользователя",
42
+ "New trust level of the user": "Новый уровень доверия пользователя",
43
+ "Id of the group": "Id группы",
44
+ "List of users to add to the group": "Список пользователей для добавления в группу",
45
+ "Title for the PM": "Название для PM",
46
+ "List of users to send the PM to (can be one or more)": "Список пользователей, отправляющих ЛС (может быть одним или более)",
47
+ "Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
48
+ "GET": "ПОЛУЧИТЬ",
49
+ "POST": "ПОСТ",
50
+ "PATCH": "ПАТЧ",
51
+ "PUT": "ПОКУПИТЬ",
52
+ "DELETE": "УДАЛИТЬ",
53
+ "HEAD": "HEAD"
54
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Modern open source forum software",
3
+ "API Key": "API Key",
4
+ "API Username": "API Username",
5
+ "Website URL": "Website URL",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL of the discourse url i.e https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Create Post",
9
+ "Create Topic": "Create Topic",
10
+ "Change User Trust Level": "Change User Trust Level",
11
+ "Add Users to Group": "Add Users to Group",
12
+ "Send Private Message": "Send Private Message",
13
+ "Custom API Call": "Custom API Call",
14
+ "Create a new post in discourse": "Create a new post in discourse",
15
+ "Create a new topic in Discourse": "Create a new topic in Discourse",
16
+ "Change the trust level of a user": "Change the trust level of a user",
17
+ "Add users to a group": "Add users to a group",
18
+ "Send a private message in Discourse": "Send a private message in Discourse",
19
+ "Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
20
+ "Post Content": "Post Content",
21
+ "Topic ID": "Topic ID",
22
+ "Post Title": "Post Title",
23
+ "Topic Content": "Topic Content",
24
+ "Category ID": "Category ID",
25
+ "User ID": "User ID",
26
+ "New Trust Level": "New Trust Level",
27
+ "Group Id": "Group Id",
28
+ "Users": "Users",
29
+ "Method": "Method",
30
+ "Headers": "Headers",
31
+ "Query Parameters": "Query Parameters",
32
+ "Body Type": "Body Type",
33
+ "Body": "Body",
34
+ "Response is Binary ?": "Response is Binary ?",
35
+ "No Error on Failure": "No Error on Failure",
36
+ "Timeout (in seconds)": "Timeout (in seconds)",
37
+ "Follow redirects": "Follow redirects",
38
+ "Content of the post": "Content of the post",
39
+ "ID of the topic to post in": "ID of the topic to post in",
40
+ "Title of the Topic": "Title of the Topic",
41
+ "Content of the topic": "Content of the topic",
42
+ "ID of the category to post in": "ID of the category to post in",
43
+ "ID of the user": "ID of the user",
44
+ "New trust level of the user": "New trust level of the user",
45
+ "Id of the group": "Id of the group",
46
+ "List of users to add to the group": "List of users to add to the group",
47
+ "Title for the PM": "Title for the PM",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
50
+ "Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
51
+ "GET": "GET",
52
+ "POST": "POST",
53
+ "PATCH": "PATCH",
54
+ "PUT": "PUT",
55
+ "DELETE": "DELETE",
56
+ "HEAD": "HEAD",
57
+ "None": "None",
58
+ "JSON": "JSON",
59
+ "Form Data": "Form Data",
60
+ "Raw": "Raw"
61
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "Discourse": "Discourse",
3
+ "Modern open source forum software": "Modern open source forum software",
4
+ "API Key": "API Key",
5
+ "API Username": "API Username",
6
+ "Website URL": "Website URL",
7
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL of the discourse url i.e https://discourse.yourinstance.com",
8
+ "\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",
9
+ "Create Post": "Create Post",
10
+ "Create Topic": "Create Topic",
11
+ "Change User Trust Level": "Change User Trust Level",
12
+ "Add Users to Group": "Add Users to Group",
13
+ "Send Private Message": "Send Private Message",
14
+ "Custom API Call": "Custom API Call",
15
+ "Create a new post in discourse": "Create a new post in discourse",
16
+ "Create a new topic in Discourse": "Create a new topic in Discourse",
17
+ "Change the trust level of a user": "Change the trust level of a user",
18
+ "Add users to a group": "Add users to a group",
19
+ "Send a private message in Discourse": "Send a private message in Discourse",
20
+ "Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
21
+ "Post Content": "Post Content",
22
+ "Topic ID": "Topic ID",
23
+ "Post Title": "Post Title",
24
+ "Topic Content": "Topic Content",
25
+ "Category ID": "Category ID",
26
+ "User ID": "User ID",
27
+ "New Trust Level": "New Trust Level",
28
+ "Group Id": "Group Id",
29
+ "Users": "Users",
30
+ "Method": "Method",
31
+ "Headers": "Headers",
32
+ "Query Parameters": "Query Parameters",
33
+ "Body": "Body",
34
+ "No Error on Failure": "No Error on Failure",
35
+ "Timeout (in seconds)": "Timeout (in seconds)",
36
+ "Content of the post": "Content of the post",
37
+ "ID of the topic to post in": "ID of the topic to post in",
38
+ "Title of the Topic": "Title of the Topic",
39
+ "Content of the topic": "Content of the topic",
40
+ "ID of the category to post in": "ID of the category to post in",
41
+ "ID of the user": "ID of the user",
42
+ "New trust level of the user": "New trust level of the user",
43
+ "Id of the group": "Id of the group",
44
+ "List of users to add to the group": "List of users to add to the group",
45
+ "Title for the PM": "Title for the PM",
46
+ "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)",
47
+ "Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
48
+ "GET": "GET",
49
+ "POST": "POST",
50
+ "PATCH": "PATCH",
51
+ "PUT": "PUT",
52
+ "DELETE": "DELETE",
53
+ "HEAD": "HEAD"
54
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "Modern open source forum software": "Modern open source forum software",
3
+ "API Key": "API 密钥",
4
+ "API Username": "API Username",
5
+ "Website URL": "Website URL",
6
+ "URL of the discourse url i.e https://discourse.yourinstance.com": "URL of the discourse url i.e https://discourse.yourinstance.com",
7
+ "\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",
8
+ "Create Post": "Create Post",
9
+ "Create Topic": "Create Topic",
10
+ "Change User Trust Level": "Change User Trust Level",
11
+ "Add Users to Group": "Add Users to Group",
12
+ "Send Private Message": "Send Private Message",
13
+ "Custom API Call": "自定义 API 呼叫",
14
+ "Create a new post in discourse": "Create a new post in discourse",
15
+ "Create a new topic in Discourse": "Create a new topic in Discourse",
16
+ "Change the trust level of a user": "Change the trust level of a user",
17
+ "Add users to a group": "Add users to a group",
18
+ "Send a private message in Discourse": "Send a private message in Discourse",
19
+ "Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
20
+ "Post Content": "Post Content",
21
+ "Topic ID": "Topic ID",
22
+ "Post Title": "Post Title",
23
+ "Topic Content": "Topic Content",
24
+ "Category ID": "Category ID",
25
+ "User ID": "User ID",
26
+ "New Trust Level": "New Trust Level",
27
+ "Group Id": "Group Id",
28
+ "Users": "用户",
29
+ "Method": "方法",
30
+ "Headers": "信头",
31
+ "Query Parameters": "查询参数",
32
+ "Body Type": "Body Type",
33
+ "Body": "正文内容",
34
+ "Response is Binary ?": "Response is Binary ?",
35
+ "No Error on Failure": "失败时没有错误",
36
+ "Timeout (in seconds)": "超时(秒)",
37
+ "Follow redirects": "Follow redirects",
38
+ "Content of the post": "Content of the post",
39
+ "ID of the topic to post in": "ID of the topic to post in",
40
+ "Title of the Topic": "Title of the Topic",
41
+ "Content of the topic": "Content of the topic",
42
+ "ID of the category to post in": "ID of the category to post in",
43
+ "ID of the user": "ID of the user",
44
+ "New trust level of the user": "New trust level of the user",
45
+ "Id of the group": "Id of the group",
46
+ "List of users to add to the group": "List of users to add to the group",
47
+ "Title for the PM": "Title for the PM",
48
+ "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)",
49
+ "Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
50
+ "Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
51
+ "GET": "获取",
52
+ "POST": "帖子",
53
+ "PATCH": "PATCH",
54
+ "PUT": "弹出",
55
+ "DELETE": "删除",
56
+ "HEAD": "黑色",
57
+ "None": "无",
58
+ "JSON": "JSON",
59
+ "Form Data": "表单数据",
60
+ "Raw": "原始文件"
61
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export declare const discourseAuth: import("@scopieflows/pieces-framework").CustomAuthProperty<{
2
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
3
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
5
+ }>;
6
+ export declare const discourse: import("@scopieflows/pieces-framework").Piece<import("@scopieflows/pieces-framework").CustomAuthProperty<{
7
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
8
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
9
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
10
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.discourse = exports.discourseAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@scopieflows/pieces-common");
6
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
7
+ const shared_1 = require("@scopieflows/shared");
8
+ const add_users_to_group_action_1 = require("./lib/actions/add-users-to-group.action");
9
+ const change_trust_level_action_1 = require("./lib/actions/change-trust-level.action");
10
+ const create_post_action_1 = require("./lib/actions/create-post.action");
11
+ const create_topic_action_1 = require("./lib/actions/create-topic.action");
12
+ const send_private_message_action_1 = require("./lib/actions/send-private-message.action");
13
+ const markdownPropertyDescription = `
14
+ *Get your api Key: https://discourse.yourinstance.com/admin/api/keys
15
+ `;
16
+ exports.discourseAuth = pieces_framework_1.PieceAuth.CustomAuth({
17
+ description: markdownPropertyDescription,
18
+ required: true,
19
+ props: {
20
+ api_key: pieces_framework_1.PieceAuth.SecretText({
21
+ displayName: 'API Key',
22
+ required: true,
23
+ }),
24
+ api_username: pieces_framework_1.Property.ShortText({
25
+ displayName: 'API Username',
26
+ required: true,
27
+ }),
28
+ website_url: pieces_framework_1.Property.ShortText({
29
+ displayName: 'Website URL',
30
+ required: true,
31
+ description: 'URL of the discourse url i.e https://discourse.yourinstance.com',
32
+ }),
33
+ },
34
+ });
35
+ exports.discourse = (0, pieces_framework_1.createPiece)({
36
+ displayName: 'Discourse',
37
+ description: 'Modern open source forum software',
38
+ auth: exports.discourseAuth,
39
+ minimumSupportedRelease: '0.30.0',
40
+ logoUrl: '/pieces/discourse.png',
41
+ categories: [shared_1.PieceCategory.COMMUNICATION],
42
+ authors: ["pfernandez98", "kishanprmr", "MoShizzle", "abuaboud"],
43
+ actions: [
44
+ create_post_action_1.createPost,
45
+ create_topic_action_1.createTopic,
46
+ change_trust_level_action_1.changeUserTrustLevel,
47
+ add_users_to_group_action_1.addUsersToGroup,
48
+ send_private_message_action_1.sendPrivateMessage,
49
+ (0, pieces_common_1.createCustomApiCallAction)({
50
+ baseUrl: (auth) => auth ? (auth.props.website_url.trim()) : '',
51
+ auth: exports.discourseAuth,
52
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
53
+ return ({
54
+ 'Api-Key': auth.props.api_key,
55
+ 'Api-Username': auth.props.api_username,
56
+ });
57
+ }),
58
+ }),
59
+ ],
60
+ triggers: [],
61
+ });
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/discourse/src/index.ts"],"names":[],"mappings":";;;;AAAA,8DAAuE;AACvE,oEAIuC;AACvC,gDAAoD;AACpD,uFAA0E;AAC1E,uFAA+E;AAC/E,yEAA8D;AAC9D,2EAAgE;AAChE,2FAA+E;AAE/E,MAAM,2BAA2B,GAAG;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CAAC,YAAY;iBACxC,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const addUsersToGroup: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
2
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
3
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ group_id: import("@scopieflows/pieces-framework").DropdownProperty<any, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
7
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
8
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
9
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
10
+ }>>;
11
+ users: import("@scopieflows/pieces-framework").ArrayProperty<true>;
12
+ }>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addUsersToGroup = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ const index_1 = require("../../index");
7
+ const pieces_common_1 = require("@scopieflows/pieces-common");
8
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
9
+ exports.addUsersToGroup = (0, pieces_framework_1.createAction)({
10
+ auth: index_1.discourseAuth,
11
+ name: 'add_users_to_group',
12
+ description: 'Add users to a group',
13
+ displayName: 'Add Users to Group',
14
+ props: {
15
+ group_id: pieces_framework_1.Property.Dropdown({
16
+ auth: index_1.discourseAuth,
17
+ description: 'Id of the group',
18
+ displayName: 'Group Id',
19
+ required: true,
20
+ refreshers: [],
21
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
22
+ if (!auth) {
23
+ return {
24
+ disabled: true,
25
+ options: [],
26
+ placeholder: 'Please connect your discourse account',
27
+ };
28
+ }
29
+ const response = yield pieces_common_1.httpClient.sendRequest({
30
+ method: pieces_common_1.HttpMethod.GET,
31
+ url: `${auth.props.website_url.trim()}/groups.json`,
32
+ headers: {
33
+ 'Api-Key': auth.props.api_key,
34
+ 'Api-Username': auth.props.api_username,
35
+ },
36
+ });
37
+ const options = response.body['groups'].map((res) => {
38
+ return {
39
+ label: res.display_name,
40
+ value: res.id,
41
+ };
42
+ });
43
+ return {
44
+ options: options,
45
+ disabled: false,
46
+ };
47
+ }),
48
+ }),
49
+ users: pieces_framework_1.Property.Array({
50
+ description: 'List of users to add to the group',
51
+ displayName: 'Users',
52
+ required: true,
53
+ }),
54
+ },
55
+ run(context) {
56
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
57
+ const { group_id, users } = context.propsValue;
58
+ //convert array to comma separated string
59
+ users.join(',');
60
+ const response = yield pieces_common_1.httpClient.sendRequest({
61
+ method: pieces_common_1.HttpMethod.PUT,
62
+ url: `${context.auth.props.website_url.trim()}/groups/${group_id}/members.json`,
63
+ headers: {
64
+ 'Api-Key': context.auth.props.api_key,
65
+ 'Api-Username': context.auth.props.api_username,
66
+ },
67
+ body: {
68
+ usernames: users.join(','),
69
+ },
70
+ });
71
+ return response.body;
72
+ });
73
+ },
74
+ });
75
+ //# sourceMappingURL=add-users-to-group.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-users-to-group.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discourse/src/lib/actions/add-users-to-group.action.ts"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,uCAA4C;AAC5C,8DAAoE;AACpE,oEAAuE;AAE1D,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,C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AAyC;YACzC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,QAAQ,eAAe;gBAC/E,OAAO,EAAE;oBACP,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;oBACrC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY;iBAChD;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;iBAC3B;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const changeUserTrustLevel: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
2
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
3
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ user_id: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
7
+ new_trust_level: import("@scopieflows/pieces-framework").DropdownProperty<number, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
8
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
9
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
10
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
11
+ }>>;
12
+ }>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.changeUserTrustLevel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const index_1 = require("../../index");
8
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
9
+ exports.changeUserTrustLevel = (0, pieces_framework_1.createAction)({
10
+ auth: index_1.discourseAuth,
11
+ name: 'change_user_trust_level',
12
+ description: 'Change the trust level of a user',
13
+ displayName: 'Change User Trust Level',
14
+ props: {
15
+ user_id: pieces_framework_1.Property.ShortText({
16
+ description: 'ID of the user',
17
+ displayName: 'User ID',
18
+ required: true,
19
+ }),
20
+ new_trust_level: pieces_framework_1.Property.Dropdown({
21
+ description: 'New trust level of the user',
22
+ displayName: 'New Trust Level',
23
+ auth: index_1.discourseAuth,
24
+ required: true,
25
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
26
+ if (!auth) {
27
+ return {
28
+ disabled: true,
29
+ options: [],
30
+ placeholder: 'Please connect your discourse account',
31
+ };
32
+ }
33
+ const response = yield pieces_common_1.httpClient.sendRequest({
34
+ method: pieces_common_1.HttpMethod.GET,
35
+ url: `${auth.props.website_url.trim()}/site.json`,
36
+ headers: {
37
+ 'Api-Key': auth.props.api_key,
38
+ 'Api-Username': auth.props.api_username,
39
+ },
40
+ });
41
+ const result = [];
42
+ const trust_levels = response.body['trust_levels'];
43
+ for (const key in trust_levels) {
44
+ result.push({ name: key, value: trust_levels[key] });
45
+ }
46
+ const options = result.map((res) => {
47
+ return {
48
+ label: res.name,
49
+ value: res.value,
50
+ };
51
+ });
52
+ return {
53
+ options: options,
54
+ disabled: false,
55
+ };
56
+ }),
57
+ refreshers: [],
58
+ }),
59
+ },
60
+ run(context) {
61
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
+ const { user_id, new_trust_level } = context.propsValue;
63
+ return yield pieces_common_1.httpClient.sendRequest({
64
+ method: pieces_common_1.HttpMethod.PUT,
65
+ url: `${context.auth.props.website_url.trim()}/u/${user_id}.json`,
66
+ headers: {
67
+ 'Api-Key': context.auth.props.api_key,
68
+ 'Api-Username': context.auth.props.api_username,
69
+ },
70
+ body: {
71
+ trust_level: new_trust_level,
72
+ },
73
+ });
74
+ });
75
+ },
76
+ });
77
+ //# sourceMappingURL=change-trust-level.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-trust-level.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discourse/src/lib/actions/change-trust-level.action.ts"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,8DAAoE;AACpE,uCAA4C;AAC5C,oEAAuE;AAE1D,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,kCAAkC;IAC/C,WAAW,EAAE,yBAAyB;IACtC,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,qBAAa;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,uCAAuC;qBACrD,CAAC;gBACJ,CAAC;gBACD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;oBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY;oBACjD,OAAO,EAAE;wBACP,SAAS,EAAE,IAAI,CAAC,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,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const createPost: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
2
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
3
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ raw: import("@scopieflows/pieces-framework").LongTextProperty<true>;
7
+ topic_id: import("@scopieflows/pieces-framework").DropdownProperty<any, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
8
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
9
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
10
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
11
+ }>>;
12
+ }>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPost = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const index_1 = require("../../index");
8
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
9
+ exports.createPost = (0, pieces_framework_1.createAction)({
10
+ auth: index_1.discourseAuth,
11
+ name: 'create_post',
12
+ description: 'Create a new post in discourse',
13
+ displayName: 'Create Post',
14
+ props: {
15
+ raw: pieces_framework_1.Property.LongText({
16
+ description: 'Content of the post',
17
+ displayName: 'Post Content',
18
+ required: true,
19
+ }),
20
+ topic_id: pieces_framework_1.Property.Dropdown({
21
+ auth: index_1.discourseAuth,
22
+ description: 'ID of the topic to post in',
23
+ displayName: 'Topic ID',
24
+ required: true,
25
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
26
+ if (!auth) {
27
+ return {
28
+ disabled: true,
29
+ options: [],
30
+ placeholder: 'Please connect your discourse account',
31
+ };
32
+ }
33
+ const response = yield pieces_common_1.httpClient.sendRequest({
34
+ method: pieces_common_1.HttpMethod.GET,
35
+ url: `${auth.props.website_url.trim()}/latest.json`,
36
+ headers: {
37
+ 'Api-Key': auth.props.api_key,
38
+ 'Api-Username': auth.props.api_username,
39
+ },
40
+ });
41
+ const options = response.body['topic_list']['topics'].map((res) => {
42
+ return {
43
+ label: res.title,
44
+ value: res.id,
45
+ };
46
+ });
47
+ return {
48
+ options: options,
49
+ disabled: false,
50
+ };
51
+ }),
52
+ refreshers: [],
53
+ }),
54
+ },
55
+ run(context) {
56
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
57
+ const { raw, topic_id } = context.propsValue;
58
+ return yield pieces_common_1.httpClient.sendRequest({
59
+ method: pieces_common_1.HttpMethod.POST,
60
+ url: `${context.auth.props.website_url.trim()}/posts.json`,
61
+ headers: {
62
+ 'Api-Key': context.auth.props.api_key,
63
+ 'Api-Username': context.auth.props.api_username,
64
+ },
65
+ body: {
66
+ raw: raw,
67
+ topic_id: topic_id,
68
+ },
69
+ });
70
+ });
71
+ },
72
+ });
73
+ //# sourceMappingURL=create-post.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-post.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discourse/src/lib/actions/create-post.action.ts"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,8DAAoE;AACpE,uCAA4C;AAC5C,oEAAuE;AAE1D,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,gCAAgC;IAC7C,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,IAAI,EAA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C,WAAW,CAAC,IAAI,EAAE,aAAa;gBAC1D,OAAO,EAAE;oBACP,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;oBACrC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY;iBAChD;gBACD,IAAI,EAAE;oBACJ,GAAG,EAAE,GAAG;oBACR,QAAQ,EAAE,QAAQ;iBACnB;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const createTopic: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
2
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
3
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ title: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
7
+ raw: import("@scopieflows/pieces-framework").LongTextProperty<true>;
8
+ category: import("@scopieflows/pieces-framework").DropdownProperty<any, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
9
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
10
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
11
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
12
+ }>>;
13
+ }>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTopic = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const index_1 = require("../../index");
8
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
9
+ exports.createTopic = (0, pieces_framework_1.createAction)({
10
+ auth: index_1.discourseAuth,
11
+ name: 'create_topic',
12
+ description: 'Create a new topic in Discourse',
13
+ displayName: 'Create Topic',
14
+ props: {
15
+ title: pieces_framework_1.Property.ShortText({
16
+ description: 'Title of the Topic',
17
+ displayName: 'Post Title',
18
+ required: true,
19
+ }),
20
+ raw: pieces_framework_1.Property.LongText({
21
+ description: 'Content of the topic',
22
+ displayName: 'Topic Content',
23
+ required: true,
24
+ }),
25
+ category: pieces_framework_1.Property.Dropdown({
26
+ description: 'ID of the category to post in',
27
+ displayName: 'Category ID',
28
+ required: false,
29
+ auth: index_1.discourseAuth,
30
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
31
+ if (!auth) {
32
+ return {
33
+ disabled: true,
34
+ options: [],
35
+ placeholder: 'Please connect your discourse account',
36
+ };
37
+ }
38
+ const response = yield pieces_common_1.httpClient.sendRequest({
39
+ method: pieces_common_1.HttpMethod.GET,
40
+ url: `${auth.props.website_url.trim()}/categories.json`,
41
+ headers: {
42
+ 'Api-Key': auth.props.api_key,
43
+ 'Api-Username': auth.props.api_username,
44
+ },
45
+ });
46
+ const options = response.body['category_list']['categories'].map((res) => {
47
+ return {
48
+ label: res.name,
49
+ value: res.id,
50
+ };
51
+ });
52
+ return {
53
+ options: options,
54
+ disabled: false,
55
+ };
56
+ }),
57
+ refreshers: [],
58
+ }),
59
+ },
60
+ run(context) {
61
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
+ const { title, raw, category } = context.propsValue;
63
+ console.log('new post action');
64
+ return yield pieces_common_1.httpClient.sendRequest({
65
+ method: pieces_common_1.HttpMethod.POST,
66
+ url: `${context.auth.props.website_url.trim()}/posts.json`,
67
+ headers: {
68
+ 'Api-Key': context.auth.props.api_key,
69
+ 'Api-Username': context.auth.props.api_username,
70
+ },
71
+ body: {
72
+ title: title,
73
+ raw: raw,
74
+ category: category,
75
+ },
76
+ });
77
+ });
78
+ },
79
+ });
80
+ //# sourceMappingURL=create-topic.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-topic.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discourse/src/lib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CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG,CAC9D,CAAC,GAA2B,EAAE,EAAE;oBAC9B,OAAO;wBACL,KAAK,EAAE,GAAG,CAAC,IAAI;wBACf,KAAK,EAAE,GAAG,CAAC,EAAE;qBACd,CAAC;gBACJ,CAAC,CACF,CAAC;gBAEF,OAAO;oBACL,OAAO,EAAE,OAAO;oBAChB,QAAQ,EAAE,KAAK;iBAChB,CAAC;YACJ,CAAC,CAAA;YACD,UAAU,EAAE,EAAE;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEpD,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;YAE/B,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAClC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa;gBAC1D,OAAO,EAAE;oBACP,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;oBACrC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY;iBAChD;gBACD,IAAI,EAAE;oBACJ,KAAK,EAAE,KAAK;oBACZ,GAAG,EAAE,GAAG;oBACR,QAAQ,EAAE,QAAQ;iBACnB;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const sendPrivateMessage: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
2
+ api_key: import("@scopieflows/pieces-framework").SecretTextProperty<true>;
3
+ api_username: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ website_url: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ title: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
7
+ raw: import("@scopieflows/pieces-framework").LongTextProperty<true>;
8
+ target_recipients: import("@scopieflows/pieces-framework").ArrayProperty<true>;
9
+ }>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendPrivateMessage = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const index_1 = require("../../index");
8
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
9
+ exports.sendPrivateMessage = (0, pieces_framework_1.createAction)({
10
+ auth: index_1.discourseAuth,
11
+ name: 'send_private_message',
12
+ description: 'Send a private message in Discourse',
13
+ displayName: 'Send Private Message',
14
+ props: {
15
+ title: pieces_framework_1.Property.ShortText({
16
+ description: 'Title for the PM',
17
+ displayName: 'Post Title',
18
+ required: true,
19
+ }),
20
+ raw: pieces_framework_1.Property.LongText({
21
+ description: 'Content of the post',
22
+ displayName: 'Post Content',
23
+ required: true,
24
+ }),
25
+ target_recipients: pieces_framework_1.Property.Array({
26
+ description: 'List of users to send the PM to (can be one or more)',
27
+ displayName: 'Users',
28
+ required: true,
29
+ }),
30
+ },
31
+ run(context) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ const { title, raw, target_recipients } = context.propsValue;
34
+ return yield pieces_common_1.httpClient.sendRequest({
35
+ method: pieces_common_1.HttpMethod.POST,
36
+ url: `${context.auth.props.website_url.trim()}/posts.json`,
37
+ headers: {
38
+ 'Api-Key': context.auth.props.api_key,
39
+ 'Api-Username': context.auth.props.api_username,
40
+ },
41
+ body: {
42
+ raw: raw,
43
+ title: title,
44
+ target_recipients: target_recipients.join(','),
45
+ archetype: 'private_message',
46
+ },
47
+ });
48
+ });
49
+ },
50
+ });
51
+ //# sourceMappingURL=send-private-message.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-private-message.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discourse/src/lib/actions/send-private-message.action.ts"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,8DAAoE;AACpE,uCAA4C;AAC5C,oEAAuE;AAE1D,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,qCAAqC;IAClD,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAChC,WAAW,EAAE,sDAAsD;YACnE,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE7D,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAClC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa;gBAC1D,OAAO,EAAE;oBACP,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;oBACrC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY;iBAChD;gBACD,IAAI,EAAE;oBACJ,GAAG,EAAE,GAAG;oBACR,KAAK,EAAE,KAAK;o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