@activepieces/piece-cody 0.0.3 → 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/package.json +10 -14
- package/src/i18n/de.json +8 -2
- package/src/i18n/es.json +8 -2
- package/src/i18n/fr.json +8 -2
- package/src/i18n/ja.json +8 -2
- package/src/i18n/nl.json +8 -2
- package/src/i18n/pt.json +8 -2
- package/src/i18n/translation.json +8 -2
- package/src/i18n/zh.json +8 -2
- package/src/index.js +5 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-conversation.d.ts +1 -1
- package/src/lib/actions/create-conversation.js.map +1 -1
- package/src/lib/actions/create-document-from-text.d.ts +1 -1
- package/src/lib/actions/find-conversation.d.ts +4 -1
- package/src/lib/actions/send-message.d.ts +1 -1
- package/src/lib/actions/send-message.js.map +1 -1
- package/src/lib/actions/upload-file.d.ts +1 -1
- package/src/lib/common/client.d.ts +10 -8
- package/src/lib/common/client.js +24 -24
- package/src/lib/common/client.js.map +1 -1
- package/src/lib/common/props.d.ts +3 -3
- package/src/lib/common/props.js +4 -1
- package/src/lib/common/props.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-cody",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@sinclair/typebox": "0.34.11",
|
|
9
|
-
"
|
|
9
|
+
"ai": "^6.0.0",
|
|
10
|
+
"axios": "1.13.1",
|
|
10
11
|
"axios-retry": "4.4.1",
|
|
11
12
|
"deepmerge-ts": "7.1.0",
|
|
13
|
+
"form-data": "4.0.4",
|
|
14
|
+
"i18next": "23.13.0",
|
|
12
15
|
"mime-types": "2.1.35",
|
|
13
16
|
"nanoid": "3.3.8",
|
|
14
17
|
"semver": "7.6.0",
|
|
18
|
+
"socket.io-client": "4.8.1",
|
|
15
19
|
"tslib": "^2.3.0",
|
|
16
|
-
"zod": "
|
|
17
|
-
"@activepieces/pieces-common": "0.
|
|
18
|
-
"@activepieces/pieces-framework": "0.
|
|
19
|
-
"@activepieces/shared": "0.
|
|
20
|
-
},
|
|
21
|
-
"overrides": {
|
|
22
|
-
"@tryfabric/martian": {
|
|
23
|
-
"@notionhq/client": "$@notionhq/client"
|
|
24
|
-
},
|
|
25
|
-
"vite": {
|
|
26
|
-
"rollup": "npm:@rollup/wasm-node"
|
|
27
|
-
}
|
|
20
|
+
"zod": "4.1.13",
|
|
21
|
+
"@activepieces/pieces-common": "0.11.2",
|
|
22
|
+
"@activepieces/pieces-framework": "0.24.0",
|
|
23
|
+
"@activepieces/shared": "0.32.0"
|
|
28
24
|
},
|
|
29
25
|
"resolutions": {
|
|
30
26
|
"rollup": "npm:@rollup/wasm-node"
|
package/src/i18n/de.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "Methode",
|
|
28
28
|
"Headers": "Kopfzeilen",
|
|
29
29
|
"Query Parameters": "Abfrageparameter",
|
|
30
|
+
"Body Type": "Körpertyp",
|
|
30
31
|
"Body": "Körper",
|
|
31
32
|
"Response is Binary ?": "Antwort ist binär?",
|
|
32
33
|
"No Error on Failure": "Kein Fehler bei Fehler",
|
|
33
34
|
"Timeout (in seconds)": "Timeout (in Sekunden)",
|
|
35
|
+
"Follow redirects": "Weiterleitungen folgen",
|
|
34
36
|
"The name or title of the new document.": "Der Name oder der Titel des neuen Dokuments.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "Der Text oder HTML-Inhalt, der dem Dokument hinzugefügt werden soll. Max 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "Die hochzuladende Datei (z.B. txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "Der Name des Bots nach dem gesucht werden soll. Die Suche ist unabhängig von Groß-/Kleinschreibung und Teil.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "Der Name der zu suchenden Konversation (partielle Übereinstimmung).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Aktivieren für Dateien wie PDFs, Bilder usw.",
|
|
44
46
|
"GET": "ERHALTEN",
|
|
45
47
|
"POST": "POST",
|
|
46
48
|
"PATCH": "PATCH",
|
|
47
49
|
"PUT": "PUT",
|
|
48
50
|
"DELETE": "LÖSCHEN",
|
|
49
|
-
"HEAD": "HEAD"
|
|
51
|
+
"HEAD": "HEAD",
|
|
52
|
+
"None": "Keine",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "Formulardaten",
|
|
55
|
+
"Raw": "Rohe"
|
|
50
56
|
}
|
package/src/i18n/es.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "Método",
|
|
28
28
|
"Headers": "Encabezados",
|
|
29
29
|
"Query Parameters": "Parámetros de consulta",
|
|
30
|
+
"Body Type": "Tipo de cuerpo",
|
|
30
31
|
"Body": "Cuerpo",
|
|
31
32
|
"Response is Binary ?": "¿Respuesta es binaria?",
|
|
32
33
|
"No Error on Failure": "No hay ningún error en fallo",
|
|
33
34
|
"Timeout (in seconds)": "Tiempo de espera (en segundos)",
|
|
35
|
+
"Follow redirects": "Seguir redirecciones",
|
|
34
36
|
"The name or title of the new document.": "El nombre o título del nuevo documento.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "El texto o el contenido HTML a añadir al documento. Máximo 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "El archivo a subir (por ejemplo, txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "El nombre del bot para buscar. La búsqueda es insensible a mayúsculas y parcial.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "El nombre de la conversación a buscar (coincidencia parcial).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Activar para archivos como PDFs, imágenes, etc.",
|
|
44
46
|
"GET": "RECOGER",
|
|
45
47
|
"POST": "POST",
|
|
46
48
|
"PATCH": "PATCH",
|
|
47
49
|
"PUT": "PUT",
|
|
48
50
|
"DELETE": "BORRAR",
|
|
49
|
-
"HEAD": "LIMPIO"
|
|
51
|
+
"HEAD": "LIMPIO",
|
|
52
|
+
"None": "Ninguna",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "Datos de Formulario",
|
|
55
|
+
"Raw": "Rápido"
|
|
50
56
|
}
|
package/src/i18n/fr.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "Méthode",
|
|
28
28
|
"Headers": "Headers",
|
|
29
29
|
"Query Parameters": "Paramètres de requête",
|
|
30
|
+
"Body Type": "Body Type",
|
|
30
31
|
"Body": "Body",
|
|
31
32
|
"Response is Binary ?": "La réponse est Binaire ?",
|
|
32
33
|
"No Error on Failure": "Aucune erreur en cas d'échec",
|
|
33
34
|
"Timeout (in seconds)": "Délai d'expiration (en secondes)",
|
|
35
|
+
"Follow redirects": "Suivre les redirections",
|
|
34
36
|
"The name or title of the new document.": "Le nom ou le titre du nouveau document.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "Le texte ou le contenu HTML à ajouter au document. Maximum 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "Le fichier à télécharger (par exemple, txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "Le nom du bot à rechercher. La recherche est insensible à la casse et partielle.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "Le nom de la conversation à rechercher (correspondance partielle).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "Les headers d'autorisation sont injectés automatiquement à partir de votre connexion.",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Activer pour les fichiers comme les PDFs, les images, etc.",
|
|
44
46
|
"GET": "GET",
|
|
45
47
|
"POST": "POST",
|
|
46
48
|
"PATCH": "PATCH",
|
|
47
49
|
"PUT": "PUT",
|
|
48
50
|
"DELETE": "DELETE",
|
|
49
|
-
"HEAD": "HEAD"
|
|
51
|
+
"HEAD": "HEAD",
|
|
52
|
+
"None": "Aucun",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "Données du formulaire",
|
|
55
|
+
"Raw": "Brut"
|
|
50
56
|
}
|
package/src/i18n/ja.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "方法",
|
|
28
28
|
"Headers": "ヘッダー",
|
|
29
29
|
"Query Parameters": "クエリパラメータ",
|
|
30
|
+
"Body Type": "ボディタイプ",
|
|
30
31
|
"Body": "本文",
|
|
31
32
|
"Response is Binary ?": "応答はバイナリですか?",
|
|
32
33
|
"No Error on Failure": "失敗時にエラーはありません",
|
|
33
34
|
"Timeout (in seconds)": "タイムアウト(秒)",
|
|
35
|
+
"Follow redirects": "リダイレクトをフォローする",
|
|
34
36
|
"The name or title of the new document.": "新規ドキュメントの名前またはタイトル。",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "ドキュメントに追加するテキストまたはHTMLコンテンツ。最大768 KB。",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "アップロードするファイル (例: txt, md, rtf, pdf, ppt, docx)",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "検索するボットの名前。検索は大文字と小文字を区別しないものです。",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "検索する会話の名前 (部分一致)。",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "PDF、画像などのファイルを有効にする",
|
|
44
46
|
"GET": "取得",
|
|
45
47
|
"POST": "POST",
|
|
46
48
|
"PATCH": "PATCH",
|
|
47
49
|
"PUT": "PUT",
|
|
48
50
|
"DELETE": "削除",
|
|
49
|
-
"HEAD": "頭"
|
|
51
|
+
"HEAD": "頭",
|
|
52
|
+
"None": "なし",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "フォームデータ",
|
|
55
|
+
"Raw": "Raw"
|
|
50
56
|
}
|
package/src/i18n/nl.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "Methode",
|
|
28
28
|
"Headers": "Kopteksten",
|
|
29
29
|
"Query Parameters": "Query parameters",
|
|
30
|
+
"Body Type": "Type lichaam",
|
|
30
31
|
"Body": "Lichaam",
|
|
31
32
|
"Response is Binary ?": "Antwoord is binair?",
|
|
32
33
|
"No Error on Failure": "Geen fout bij fout",
|
|
33
34
|
"Timeout (in seconds)": "Time-out (in seconden)",
|
|
35
|
+
"Follow redirects": "Volg omleidingen",
|
|
34
36
|
"The name or title of the new document.": "De naam of titel van het nieuwe document.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "De tekst of HTML inhoud die aan het document moet worden toegevoegd. Maximaal 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "Het te uploaden bestand (bijv. txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "De naam van de bot waarnaar gezocht moet worden. De zoekopdracht is hoofdletterongevoelig en partijdig.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "De naam van het gesprek om naar te zoeken (gedeeltelijke wedstrijde).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc.",
|
|
44
46
|
"GET": "KRIJG",
|
|
45
47
|
"POST": "POSTE",
|
|
46
48
|
"PATCH": "BEKIJK",
|
|
47
49
|
"PUT": "PUT",
|
|
48
50
|
"DELETE": "VERWIJDEREN",
|
|
49
|
-
"HEAD": "HOOFD"
|
|
51
|
+
"HEAD": "HOOFD",
|
|
52
|
+
"None": "geen",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "Formulieren gegevens",
|
|
55
|
+
"Raw": "Onbewerkte"
|
|
50
56
|
}
|
package/src/i18n/pt.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "Método",
|
|
28
28
|
"Headers": "Cabeçalhos",
|
|
29
29
|
"Query Parameters": "Parâmetros da consulta",
|
|
30
|
+
"Body Type": "Tipo de Corpo",
|
|
30
31
|
"Body": "Conteúdo",
|
|
31
32
|
"Response is Binary ?": "A resposta é binária ?",
|
|
32
33
|
"No Error on Failure": "Nenhum erro no Failure",
|
|
33
34
|
"Timeout (in seconds)": "Tempo limite (em segundos)",
|
|
35
|
+
"Follow redirects": "Seguir redirecionamentos",
|
|
34
36
|
"The name or title of the new document.": "O nome ou o título do novo documento.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "O texto ou conteúdo HTML a ser adicionado ao documento. Máximo 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "O arquivo a ser enviado (ex.: txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "O nome do bot a ser pesquisado. A busca diferencia maiúsculas de minúsculas e parciais.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "O nome da conversa para pesquisar (correspondência parcial).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Habilitar para arquivos como PDFs, imagens, etc.",
|
|
44
46
|
"GET": "OBTER",
|
|
45
47
|
"POST": "POSTAR",
|
|
46
48
|
"PATCH": "COMPRAR",
|
|
47
49
|
"PUT": "COLOCAR",
|
|
48
50
|
"DELETE": "EXCLUIR",
|
|
49
|
-
"HEAD": "CABEÇA"
|
|
51
|
+
"HEAD": "CABEÇA",
|
|
52
|
+
"None": "Nenhuma",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "Dados de Formulário",
|
|
55
|
+
"Raw": "RAW"
|
|
50
56
|
}
|
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "Method",
|
|
28
28
|
"Headers": "Headers",
|
|
29
29
|
"Query Parameters": "Query Parameters",
|
|
30
|
+
"Body Type": "Body Type",
|
|
30
31
|
"Body": "Body",
|
|
31
32
|
"Response is Binary ?": "Response is Binary ?",
|
|
32
33
|
"No Error on Failure": "No Error on Failure",
|
|
33
34
|
"Timeout (in seconds)": "Timeout (in seconds)",
|
|
35
|
+
"Follow redirects": "Follow redirects",
|
|
34
36
|
"The name or title of the new document.": "The name or title of the new document.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "The text or HTML content to be added to the document. Max 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "The name of the bot to search for. The search is case-insensitive and partial.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "The name of the conversation to search for (partial match).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
44
46
|
"GET": "GET",
|
|
45
47
|
"POST": "POST",
|
|
46
48
|
"PATCH": "PATCH",
|
|
47
49
|
"PUT": "PUT",
|
|
48
50
|
"DELETE": "DELETE",
|
|
49
|
-
"HEAD": "HEAD"
|
|
51
|
+
"HEAD": "HEAD",
|
|
52
|
+
"None": "None",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "Form Data",
|
|
55
|
+
"Raw": "Raw"
|
|
50
56
|
}
|
package/src/i18n/zh.json
CHANGED
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"Method": "方法",
|
|
28
28
|
"Headers": "信头",
|
|
29
29
|
"Query Parameters": "查询参数",
|
|
30
|
+
"Body Type": "Body Type",
|
|
30
31
|
"Body": "正文内容",
|
|
31
32
|
"Response is Binary ?": "Response is Binary ?",
|
|
32
33
|
"No Error on Failure": "失败时没有错误",
|
|
33
34
|
"Timeout (in seconds)": "超时(秒)",
|
|
35
|
+
"Follow redirects": "Follow redirects",
|
|
34
36
|
"The name or title of the new document.": "The name or title of the new document.",
|
|
35
37
|
"The text or HTML content to be added to the document. Max 768 KB.": "The text or HTML content to be added to the document. Max 768 KB.",
|
|
36
38
|
"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).": "The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).",
|
|
@@ -40,11 +42,15 @@
|
|
|
40
42
|
"The name of the bot to search for. The search is case-insensitive and partial.": "The name of the bot to search for. The search is case-insensitive and partial.",
|
|
41
43
|
"The name of the conversation to search for (partial match).": "The name of the conversation to search for (partial match).",
|
|
42
44
|
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
|
|
43
|
-
"Enable for files like PDFs, images, etc
|
|
45
|
+
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
44
46
|
"GET": "获取",
|
|
45
47
|
"POST": "帖子",
|
|
46
48
|
"PATCH": "PATCH",
|
|
47
49
|
"PUT": "弹出",
|
|
48
50
|
"DELETE": "删除",
|
|
49
|
-
"HEAD": "黑色"
|
|
51
|
+
"HEAD": "黑色",
|
|
52
|
+
"None": "无",
|
|
53
|
+
"JSON": "JSON",
|
|
54
|
+
"Form Data": "表单数据",
|
|
55
|
+
"Raw": "原始文件"
|
|
50
56
|
}
|
package/src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const find_bot_1 = require("./lib/actions/find-bot");
|
|
|
11
11
|
const find_conversation_1 = require("./lib/actions/find-conversation");
|
|
12
12
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
13
13
|
const client_1 = require("./lib/common/client");
|
|
14
|
+
const shared_1 = require("@activepieces/shared");
|
|
14
15
|
// Define the authentication property using PieceAuth.SecretText
|
|
15
16
|
// This will create a secure text input field in the UI for the user's API key.
|
|
16
17
|
exports.codyAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
@@ -20,7 +21,10 @@ exports.codyAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
|
20
21
|
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
21
22
|
if (auth) {
|
|
22
23
|
try {
|
|
23
|
-
yield client_1.codyClient.listBots(
|
|
24
|
+
yield client_1.codyClient.listBots({
|
|
25
|
+
secret_text: auth,
|
|
26
|
+
type: shared_1.AppConnectionType.SECRET_TEXT,
|
|
27
|
+
});
|
|
24
28
|
return {
|
|
25
29
|
valid: true,
|
|
26
30
|
};
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/cody/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uFAAiF;AACjF,2DAA6D;AAC7D,6DAA+D;AAC/D,2EAA6E;AAC7E,qDAAuD;AACvD,uEAAyE;AACzE,+DAAwE;AACxE,gDAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/cody/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uFAAiF;AACjF,2DAA6D;AAC7D,6DAA+D;AAC/D,2EAA6E;AAC7E,qDAAuD;AACvD,uEAAyE;AACzE,+DAAwE;AACxE,gDAAiD;AACjD,iDAAyD;AAEzD,gEAAgE;AAChE,+EAA+E;AAClE,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IACzC,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,2DAA2D;IACxE,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACrB,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC;gBACD,MAAM,mBAAU,CAAC,QAAQ,CAAC;oBACtB,WAAW,EAAE,IAAI;oBACjB,IAAI,EAAE,0BAAiB,CAAC,WAAW;iBACtC,CAAC,CAAC;gBACH,OAAO;oBACH,KAAK,EAAE,IAAI;iBACd,CAAA;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,iBAAiB;iBAC3B,CAAA;YACL,CAAC;QAEL,CAAC;QACD,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,iBAAiB;SAC3B,CAAA;IAEL,CAAC,CAAA;CACJ,CAAC,CAAC;AAEU,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC5B,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,gBAAQ;IACd,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8CAA8C;IACvD,OAAO,EAAE,CAAE,YAAY,EAAC,aAAa,CAAE;IACvC,OAAO,EAAE;QACL,kDAAsB;QACtB,8BAAgB;QAChB,gCAAiB;QACjB,8CAAwB;QACxB,wBAAa;QACb,0CAAsB;QACtB,IAAA,yCAAyB,EAAC;YACpB,IAAI,EAAE,gBAAQ;YACd,OAAO,EAAE,GAAG,EAAE,CAAC,2BAA2B;YAC1C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,EAAE;iBAChC,CAAC,CAAA;cAAA;SACH,CAAC;KACP;IACH,QAAQ,EAAE;IACN,6BAA6B;KAChC;CACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const createConversationAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
bot_id: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
2
|
+
bot_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
3
|
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
document_ids: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
5
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-conversation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/create-conversation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAgD;AAEnC,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,MAAM,EAAE,qBAAa;QACrB,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC3B,WAAW,EAAE,2BAA2B;YACxC,WAAW,EACT,iFAAiF;YACnF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"create-conversation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/create-conversation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAgD;AAEnC,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,MAAM,EAAE,qBAAa;QACrB,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC3B,WAAW,EAAE,2BAA2B;YACxC,WAAW,EACT,iFAAiF;YACnF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,MAAM,MAAM,GAAG,YAAoC,CAAC;YAEpD,OAAO,MAAM,mBAAU,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3E,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const createDocumentFromText: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
folder_id: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
2
|
+
folder_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
3
|
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
content: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
5
5
|
}>;
|
|
@@ -3,9 +3,12 @@ export declare const findConversationAction: import("@activepieces/pieces-framew
|
|
|
3
3
|
required: false;
|
|
4
4
|
description?: string | undefined;
|
|
5
5
|
displayName: string;
|
|
6
|
+
auth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
7
|
refreshers: string[];
|
|
7
8
|
refreshOnSearch?: boolean;
|
|
8
|
-
options: (propsValue: Record<string, unknown
|
|
9
|
+
options: (propsValue: Record<string, unknown> & {
|
|
10
|
+
auth?: import("dist/packages/shared/src").SecretTextConnectionValue | undefined;
|
|
11
|
+
}, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<string>>;
|
|
9
12
|
valueSchema: string;
|
|
10
13
|
type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
|
|
11
14
|
defaultValue?: unknown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const sendMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
conversation_id: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
2
|
+
conversation_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
3
|
content: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
4
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/send-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAyD;AAE5C,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,0DAA0D;IACvE,KAAK,EAAE;QACH,eAAe,EAAE,8BAAsB;QACvC,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,gEAAgE;YAC7E,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/send-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAyD;AAE5C,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,0DAA0D;IACvE,KAAK,EAAE;QACH,eAAe,EAAE,8BAAsB;QACvC,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,gEAAgE;YAC7E,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,OAAO,MAAM,mBAAU,CAAC,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QAC1E,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const uploadFileAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
folder_id: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
2
|
+
folder_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
3
|
file: import("@activepieces/pieces-framework").FileProperty<true>;
|
|
4
4
|
}>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AppConnectionValueForAuthProperty } from "@activepieces/pieces-framework";
|
|
2
|
+
import { codyAuth } from "../..";
|
|
1
3
|
export declare const CODY_BASE_URL = "https://getcody.ai/api/v1";
|
|
2
4
|
export interface CodyFolder {
|
|
3
5
|
id: string;
|
|
@@ -51,16 +53,16 @@ export interface CodyCreateConversationResponse {
|
|
|
51
53
|
data: CodyConversation;
|
|
52
54
|
}
|
|
53
55
|
export declare const codyClient: {
|
|
54
|
-
listFolders(
|
|
55
|
-
createDocument(
|
|
56
|
-
getSignedUrl(
|
|
56
|
+
listFolders({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>): Promise<CodyFolder[]>;
|
|
57
|
+
createDocument({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, name: string, folderId: string, content: string): Promise<CodyCreateDocumentResponse>;
|
|
58
|
+
getSignedUrl({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, fileName: string, contentType: string): Promise<CodySignedUrlResponse["data"]>;
|
|
57
59
|
uploadFileToS3(signedUrl: string, fileBuffer: Buffer, contentType: string): Promise<void>;
|
|
58
|
-
createDocumentFromFile(
|
|
59
|
-
listConversations(
|
|
60
|
+
createDocumentFromFile({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, folderId: string, key: string): Promise<void>;
|
|
61
|
+
listConversations({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, params?: {
|
|
60
62
|
botId?: string;
|
|
61
63
|
keyword?: string;
|
|
62
64
|
}): Promise<CodyConversation[]>;
|
|
63
|
-
sendMessage(
|
|
64
|
-
listBots(
|
|
65
|
-
createConversation(
|
|
65
|
+
sendMessage({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, conversationId: string, content: string): Promise<CodyMessageResponse>;
|
|
66
|
+
listBots({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, keyword?: string): Promise<CodyBot[]>;
|
|
67
|
+
createConversation({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, botId: string, name: string, documentIds?: string[]): Promise<CodyCreateConversationResponse>;
|
|
66
68
|
};
|
package/src/lib/common/client.js
CHANGED
|
@@ -5,27 +5,27 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
exports.CODY_BASE_URL = "https://getcody.ai/api/v1";
|
|
7
7
|
exports.codyClient = {
|
|
8
|
-
listFolders(
|
|
9
|
-
return tslib_1.__awaiter(this,
|
|
8
|
+
listFolders(_a) {
|
|
9
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }) {
|
|
10
10
|
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
11
11
|
method: pieces_common_1.HttpMethod.GET,
|
|
12
12
|
url: `${exports.CODY_BASE_URL}/folders`,
|
|
13
13
|
authentication: {
|
|
14
14
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
15
|
-
token:
|
|
15
|
+
token: secret_text,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
return response.body.data;
|
|
19
19
|
});
|
|
20
20
|
},
|
|
21
|
-
createDocument(
|
|
22
|
-
return tslib_1.__awaiter(this,
|
|
21
|
+
createDocument(_a, name_1, folderId_1, content_1) {
|
|
22
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, name, folderId, content) {
|
|
23
23
|
const request = {
|
|
24
24
|
method: pieces_common_1.HttpMethod.POST,
|
|
25
25
|
url: `${exports.CODY_BASE_URL}/documents`,
|
|
26
26
|
authentication: {
|
|
27
27
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
28
|
-
token:
|
|
28
|
+
token: secret_text,
|
|
29
29
|
},
|
|
30
30
|
body: {
|
|
31
31
|
name,
|
|
@@ -38,14 +38,14 @@ exports.codyClient = {
|
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
40
|
// New function to get the signed URL
|
|
41
|
-
getSignedUrl(
|
|
42
|
-
return tslib_1.__awaiter(this,
|
|
41
|
+
getSignedUrl(_a, fileName_1, contentType_1) {
|
|
42
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, fileName, contentType) {
|
|
43
43
|
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
44
44
|
method: pieces_common_1.HttpMethod.POST,
|
|
45
45
|
url: `${exports.CODY_BASE_URL}/uploads/signed-url`,
|
|
46
46
|
authentication: {
|
|
47
47
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
48
|
-
token:
|
|
48
|
+
token: secret_text,
|
|
49
49
|
},
|
|
50
50
|
body: {
|
|
51
51
|
file_name: fileName,
|
|
@@ -69,15 +69,15 @@ exports.codyClient = {
|
|
|
69
69
|
});
|
|
70
70
|
},
|
|
71
71
|
// New function to finalize the document creation
|
|
72
|
-
createDocumentFromFile(
|
|
73
|
-
return tslib_1.__awaiter(this,
|
|
72
|
+
createDocumentFromFile(_a, folderId_1, key_1) {
|
|
73
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, folderId, key) {
|
|
74
74
|
yield pieces_common_1.httpClient.sendRequest({
|
|
75
75
|
method: pieces_common_1.HttpMethod.POST,
|
|
76
76
|
// This endpoint was in your first documentation dump.
|
|
77
77
|
url: `${exports.CODY_BASE_URL}/documents/file`,
|
|
78
78
|
authentication: {
|
|
79
79
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
80
|
-
token:
|
|
80
|
+
token: secret_text,
|
|
81
81
|
},
|
|
82
82
|
body: {
|
|
83
83
|
folder_id: folderId,
|
|
@@ -86,8 +86,8 @@ exports.codyClient = {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
},
|
|
89
|
-
listConversations(
|
|
90
|
-
return tslib_1.__awaiter(this,
|
|
89
|
+
listConversations(_a, params_1) {
|
|
90
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, params) {
|
|
91
91
|
const queryParams = {};
|
|
92
92
|
if (params === null || params === void 0 ? void 0 : params.botId) {
|
|
93
93
|
queryParams['bot_id'] = params.botId;
|
|
@@ -101,21 +101,21 @@ exports.codyClient = {
|
|
|
101
101
|
queryParams: queryParams,
|
|
102
102
|
authentication: {
|
|
103
103
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
104
|
-
token:
|
|
104
|
+
token: secret_text,
|
|
105
105
|
},
|
|
106
106
|
});
|
|
107
107
|
return response.body.data;
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
110
|
// New function to send a message
|
|
111
|
-
sendMessage(
|
|
112
|
-
return tslib_1.__awaiter(this,
|
|
111
|
+
sendMessage(_a, conversationId_1, content_1) {
|
|
112
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, conversationId, content) {
|
|
113
113
|
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
114
114
|
method: pieces_common_1.HttpMethod.POST,
|
|
115
115
|
url: `${exports.CODY_BASE_URL}/messages`,
|
|
116
116
|
authentication: {
|
|
117
117
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
118
|
-
token:
|
|
118
|
+
token: secret_text,
|
|
119
119
|
},
|
|
120
120
|
body: {
|
|
121
121
|
conversation_id: conversationId,
|
|
@@ -125,8 +125,8 @@ exports.codyClient = {
|
|
|
125
125
|
return response.body;
|
|
126
126
|
});
|
|
127
127
|
},
|
|
128
|
-
listBots(
|
|
129
|
-
return tslib_1.__awaiter(this,
|
|
128
|
+
listBots(_a, keyword_1) {
|
|
129
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, keyword) {
|
|
130
130
|
const queryParams = {};
|
|
131
131
|
if (keyword) {
|
|
132
132
|
queryParams['keyword'] = keyword;
|
|
@@ -137,21 +137,21 @@ exports.codyClient = {
|
|
|
137
137
|
queryParams: queryParams, // Add queryParams to the request
|
|
138
138
|
authentication: {
|
|
139
139
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
140
|
-
token:
|
|
140
|
+
token: secret_text,
|
|
141
141
|
},
|
|
142
142
|
});
|
|
143
143
|
return response.body.data;
|
|
144
144
|
});
|
|
145
145
|
},
|
|
146
146
|
// New function to create a conversation
|
|
147
|
-
createConversation(
|
|
148
|
-
return tslib_1.__awaiter(this,
|
|
147
|
+
createConversation(_a, botId_1, name_1, documentIds_1) {
|
|
148
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, botId, name, documentIds) {
|
|
149
149
|
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
150
150
|
method: pieces_common_1.HttpMethod.POST,
|
|
151
151
|
url: `${exports.CODY_BASE_URL}/conversations`,
|
|
152
152
|
authentication: {
|
|
153
153
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
154
|
-
token:
|
|
154
|
+
token: secret_text,
|
|
155
155
|
},
|
|
156
156
|
body: {
|
|
157
157
|
bot_id: botId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,+DAAsG;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,+DAAsG;AAIzF,QAAA,aAAa,GAAG,2BAA2B,CAAC;AAgE5C,QAAA,UAAU,GAAG;IAChB,WAAW;qEAAC,EAAC,WAAW,EAAqD;YAC/E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA0B;gBACnE,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAa,UAAU;gBAC/B,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,WAAW;iBACrB;aACJ,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9B,CAAC;KAAA;IAEK,cAAc;qEAChB,EAAC,WAAW,EAAqD,EACjE,IAAY,EACZ,QAAgB,EAChB,OAAe;YAEf,MAAM,OAAO,GAAgB;gBACzB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,qBAAa,YAAY;gBACjC,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,WAAW;iBACrB;gBACD,IAAI,EAAE;oBACF,IAAI;oBACJ,SAAS,EAAE,QAAQ;oBACnB,OAAO;iBACV;aACJ,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA6B,OAAO,CAAC,CAAC;YACnF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAED,qCAAqC;IAC/B,YAAY;qEAAC,EAAC,WAAW,EAAqD,EAAE,QAAgB,EAAE,WAAmB;YACvH,MAAM,QAAQ,G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,CAAuB;gBAChE,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAa,OAAO;gBAC5B,WAAW,EAAE,WAAW,EAAE,iCAAiC;gBAC3D,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,WAAW;iBACrB;aACJ,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9B,CAAC;KAAA;IAED,wCAAwC;IAClC,kBAAkB;qEACpB,EAAC,WAAW,EAAqD,EACjE,KAAa,EACb,IAAY,EACZ,WAAsB;YAEtB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAiC;gBAC1E,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,qBAAa,gBAAgB;gBACrC,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,WAAW;iBACrB;gBACD,IAAI,EAAE;oBACF,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,IAAI;oBACV,YAAY,EAAE,WAAW;iBAC5B;aACJ,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;CAGJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const folderIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
2
|
-
export declare const conversationIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
3
|
-
export declare const botIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
1
|
+
export declare const folderIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
2
|
+
export declare const conversationIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
export declare const botIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
package/src/lib/common/props.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.botIdDropdown = exports.conversationIdDropdown = exports.folderIdDropdow
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const client_1 = require("./client");
|
|
7
|
+
const __1 = require("../..");
|
|
7
8
|
exports.folderIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
9
|
+
auth: __1.codyAuth,
|
|
8
10
|
displayName: 'Folder',
|
|
9
11
|
required: true,
|
|
10
12
|
refreshers: [],
|
|
@@ -45,6 +47,7 @@ exports.folderIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
|
45
47
|
});
|
|
46
48
|
exports.conversationIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
47
49
|
displayName: 'Conversation',
|
|
50
|
+
auth: __1.codyAuth,
|
|
48
51
|
required: true,
|
|
49
52
|
refreshers: [],
|
|
50
53
|
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
@@ -56,7 +59,6 @@ exports.conversationIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
|
56
59
|
};
|
|
57
60
|
}
|
|
58
61
|
try {
|
|
59
|
-
// NOTE: Comment removed as endpoint is confirmed
|
|
60
62
|
const conversations = yield client_1.codyClient.listConversations(auth);
|
|
61
63
|
if (conversations.length === 0) {
|
|
62
64
|
return {
|
|
@@ -84,6 +86,7 @@ exports.conversationIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
|
84
86
|
});
|
|
85
87
|
// Add the new dropdown for bots
|
|
86
88
|
exports.botIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
89
|
+
auth: __1.codyAuth,
|
|
87
90
|
displayName: 'Bot',
|
|
88
91
|
required: true,
|
|
89
92
|
refreshers: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,qCAAsC;
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,qCAAsC;AACtC,6BAAiC;AAEpB,QAAA,gBAAgB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC9C,IAAI,EAAE,YAAQ;IACd,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACpB,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO;gBACH,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,qCAAqC;gBAClD,OAAO,EAAE,EAAE;aACd,CAAC;QACN,CAAC;QACD,IAAI,CAAC;YACD,0DAA0D;YAC1D,MAAM,OAAO,GAAG,MAAM,mBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnB,OAAO;oBACP,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,yDAAyD;iBACzE,CAAC;YACN,CAAC;YACD,OAAO;gBACH,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;oBAC9B,KAAK,EAAE,MAAM,CAAC,IAAI;oBAClB,KAAK,EAAE,MAAM,CAAC,EAAE;iBACnB,CAAC,CAAC;aACN,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAA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