Add Activepieces integration for workflow automation

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

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

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

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Sichere Nachrichten und Zusammenarbeit",
"API key": "API-Schlüssel",
"Dust workspace ID": "Staub-Arbeitsbereich-ID",
"Region": "Region",
"Can be found in any of the workspace's URL": "Kann in jeder URL des Arbeitsbereichs gefunden werden",
"US": "MN",
"EU": "EU",
"Dust authentication requires an API key.": "Staubauthentifizierung erfordert einen API-Schlüssel.",
"Create conversation": "Unterhaltung erstellen",
"Get existing conversation": "Vorhandene Unterhaltung abrufen",
"Reply to conversation": "Auf Unterhaltung antworten",
"Add fragment to conversation": "Fragment zur Unterhaltung hinzufügen",
"Add or update document": "Dokument hinzufügen oder aktualisieren",
"Upload file": "Datei hochladen",
"Custom API Call": "Eigener API-Aufruf",
"Create a new conversation with a specific Dust assistant": "Erstelle eine neue Unterhaltung mit einem bestimmten Staubassistenten",
"Get an existing conversation": "Erhalte eine bestehende Unterhaltung",
"Send reply to existing conversation": "Antwort an bestehende Unterhaltung senden",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Erstellen Sie ein neues Inhaltsfragment in einer Unterhaltung. Inhaltsfragmente sind Informationsstücke, die in Unterhaltungen eingefügt werden können und als Kontext an Assistenten weitergegeben werden, wenn sie eine Antwort generieren.",
"Insert a new document to a Data Source (or update an existing one)": "Füge ein neues Dokument in eine Datenquelle ein (oder aktualisiere eine existierende)",
"Upload file to be used in conversation": "Datei hochladen, die in der Unterhaltung verwendet werden soll",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Agent": "Agent",
"Username": "Benutzername",
"Time zone": "Zeitzone",
"Title": "Titel",
"Query": "Abfrage",
"Fragment": "Fragment",
"File ID": "Datei-ID",
"Fragment/file name": "Fragment/Dateiname",
"Timeout (seconds)": "Timeout (Sekunden)",
"Conversation sID": "Konversations-ID",
"Conversation ID": "Konversations-ID",
"Fragment name": "Fragmentname",
"Data Source name": "Name der Datenquelle",
"Document ID": "Dokument-ID",
"Document content": "Dokumenteninhalt",
"Source URL": "Quell-URL",
"Document title": "Titel des Dokuments",
"Tags": "Tags",
"File": "Datei",
"Method": "Methode",
"Headers": "Kopfzeilen",
"Query Parameters": "Abfrageparameter",
"Body": "Körper",
"Response is Binary ?": "Antwort ist binär?",
"No Error on Failure": "Kein Fehler bei Fehler",
"Timeout (in seconds)": "Timeout (in Sekunden)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID der Datei, die zur Unterhaltung hinzugefügt werden soll (hat Vorrang vor Fragment)",
"The ID of the document you want to insert or replace": "Die ID des Dokuments, das Sie einfügen oder ersetzen möchten",
"The text content of the document": "Der Text des Dokuments",
"The source URL of the document (when cited)": "Die Quell-URL des Dokuments (wenn zitiert)",
"User-friendly title of the document": "Benutzerfreundlicher Titel des Dokuments",
"Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
"Enable for files like PDFs, images, etc..": "Aktivieren für Dateien wie PDFs, Bilder, etc..",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Colaboración y mensajería segura",
"API key": "Clave API",
"Dust workspace ID": "ID del espacio de trabajo de polvo",
"Region": "Región",
"Can be found in any of the workspace's URL": "Se puede encontrar en cualquiera de la URL del área de trabajo",
"US": "SUS",
"EU": "EU",
"Dust authentication requires an API key.": "La autenticación de polvo requiere una clave API.",
"Create conversation": "Crear conversación",
"Get existing conversation": "Conversación existente",
"Reply to conversation": "Responder a la conversación",
"Add fragment to conversation": "Añadir fragmento a la conversación",
"Add or update document": "Añadir o actualizar documento",
"Upload file": "Subir archivo",
"Custom API Call": "Llamada API personalizada",
"Create a new conversation with a specific Dust assistant": "Crear una nueva conversación con un asistente específico de Polvo",
"Get an existing conversation": "Obtener una conversación existente",
"Send reply to existing conversation": "Enviar respuesta a la conversación existente",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Crear un nuevo fragmento de contenido en una conversación. Los fragmentos de contenido son piezas de información que se pueden insertar en conversaciones y que se pasan como contexto a los asistentes a la hora de generar una respuesta.",
"Insert a new document to a Data Source (or update an existing one)": "Insertar un nuevo documento a una fuente de datos (o actualizar uno existente)",
"Upload file to be used in conversation": "Subir archivo a ser usado en la conversación",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Agent": "Agente",
"Username": "Usuario",
"Time zone": "Zona horaria",
"Title": "Título",
"Query": "Consulta",
"Fragment": "Fragmento",
"File ID": "ID de archivo",
"Fragment/file name": "Nombre del fragmento / archivo",
"Timeout (seconds)": "Tiempo agotado (segundos)",
"Conversation sID": "SID de conversación",
"Conversation ID": "ID de conversación",
"Fragment name": "Nombre del fragmento",
"Data Source name": "Nombre fuente de datos",
"Document ID": "ID del documento",
"Document content": "Contenido del documento",
"Source URL": "URL de origen",
"Document title": "Título del documento",
"Tags": "Etiquetas",
"File": "Archivo",
"Method": "Método",
"Headers": "Encabezados",
"Query Parameters": "Parámetros de consulta",
"Body": "Cuerpo",
"Response is Binary ?": "¿Respuesta es binaria?",
"No Error on Failure": "No hay ningún error en fallo",
"Timeout (in seconds)": "Tiempo de espera (en segundos)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID del archivo a agregar a la conversación (tiene precedencia sobre el fragmento)",
"The ID of the document you want to insert or replace": "El ID del documento que desea insertar o reemplazar",
"The text content of the document": "El contenido del texto del documento",
"The source URL of the document (when cited)": "La URL de origen del documento (cuando se cita)",
"User-friendly title of the document": "Título del documento fácil de usar",
"Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
"Enable for files like PDFs, images, etc..": "Activar para archivos como PDFs, imágenes, etc.",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Messagerie et collaboration sécurisées",
"API key": "Clé API",
"Dust workspace ID": "ID de l'espace de travail Dust",
"Region": "Région",
"Can be found in any of the workspace's URL": "Peut être trouvé dans n'importe quelle URL de l'espace de travail",
"US": "US",
"EU": "EU",
"Dust authentication requires an API key.": "L'authentification Dust nécessite une clé API.",
"Create conversation": "Créer une conversation",
"Get existing conversation": "Récupérer une conversation existante",
"Reply to conversation": "Répondre à la conversation",
"Add fragment to conversation": "Ajouter un fragment à la conversation",
"Add or update document": "Ajouter ou mettre à jour le document",
"Upload file": "Charger un fichier",
"Custom API Call": "Appel API personnalisé",
"Create a new conversation with a specific Dust assistant": "Créer une nouvelle conversation avec un assistant Dust spécifique",
"Get an existing conversation": "Récupérer une conversation existante",
"Send reply to existing conversation": "Envoyer une réponse à une conversation existante",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Créer un nouveau fragment de contenu dans une conversation. Les fragments de contenu sont des éléments d'information qui peuvent être insérés dans les conversations et sont passés comme contexte aux assistants quand ils génèrent une réponse.",
"Insert a new document to a Data Source (or update an existing one)": "Insérer un nouveau document dans une source de données (ou mettre à jour un document existant)",
"Upload file to be used in conversation": "Télécharger le fichier à utiliser dans la conversation",
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
"Agent": "Agent",
"Username": "Nom d'utilisateur",
"Time zone": "Fuseau horaire",
"Title": "Titre",
"Query": "Requête",
"Fragment": "Fragment",
"File ID": "ID du fichier",
"Fragment/file name": "Nom du fragment/fichier",
"Timeout (seconds)": "Délai d'attente (secondes)",
"Conversation sID": "sID de la conversation",
"Conversation ID": "ID de la conversation",
"Fragment name": "Nom du fragment",
"Data Source name": "Nom de la source de données",
"Document ID": "ID du document",
"Document content": "Contenu du document",
"Source URL": "URL de la source",
"Document title": "Titre du document",
"Tags": "Tags",
"File": "Ficher",
"Method": "Méthode",
"Headers": "Headers",
"Query Parameters": "Paramètres de requête",
"Body": "Body",
"Response is Binary ?": "La réponse est Binaire ?",
"No Error on Failure": "Aucune erreur en cas d'échec",
"Timeout (in seconds)": "Délai d'attente (en secondes)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID du fichier à ajouter à la conversation (a priorité sur Fragment)",
"The ID of the document you want to insert or replace": "L'ID du document que vous voulez insérer ou remplacer",
"The text content of the document": "Le contenu texte du document",
"The source URL of the document (when cited)": "L'URL source du document (lorsque cité)",
"User-friendly title of the document": "Titre convivial du document",
"Authorization headers are injected automatically from your connection.": "Les Headers d'autorisation sont injectés automatiquement à partir de votre connexion.",
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "セキュアなメッセージングとコラボレーション",
"API key": "API キー",
"Dust workspace ID": "ダストワークスペースID",
"Region": "地域",
"Can be found in any of the workspace's URL": "ワークスペースの URL のいずれかにあります",
"US": "米国",
"EU": "EU",
"Dust authentication requires an API key.": "Dust 認証には API キーが必要です。",
"Create conversation": "会話を作成",
"Get existing conversation": "既存の会話を取得",
"Reply to conversation": "会話に返信",
"Add fragment to conversation": "会話にフラグメントを追加",
"Add or update document": "ドキュメントを追加または更新",
"Upload file": "ファイルをアップロード",
"Custom API Call": "カスタムAPI通話",
"Create a new conversation with a specific Dust assistant": "特定のダストアシスタントとの新しい会話を作成します",
"Get an existing conversation": "既存の会話を取得する",
"Send reply to existing conversation": "既存の会話に返信する",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "会話内に新しいコンテンツフラグメントを作成します。 コンテンツフラグメントは、会話に挿入できる情報の断片であり、回答を生成する際にアシスタントにコンテキストとして渡されます。",
"Insert a new document to a Data Source (or update an existing one)": "データソースに新しいドキュメントを挿入する(または既存のドキュメントを更新する)",
"Upload file to be used in conversation": "会話で使用するファイルをアップロード",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Agent": "エージェント",
"Username": "ユーザー名",
"Time zone": "タイムゾーン",
"Title": "タイトル",
"Query": "クエリ",
"Fragment": "フラグメント",
"File ID": "ファイルID",
"Fragment/file name": "フラグメント/ファイル名",
"Timeout (seconds)": "タイムアウト (秒)",
"Conversation sID": "会話sID",
"Conversation ID": "会話ID",
"Fragment name": "フラグメント名",
"Data Source name": "データソース名",
"Document ID": "ドキュメントID",
"Document content": "ドキュメントの内容",
"Source URL": "ソースURL",
"Document title": "ドキュメントのタイトル",
"Tags": "タグ",
"File": "ファイル",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "会話に追加されるファイルのID欠片より優先",
"The ID of the document you want to insert or replace": "挿入または置き換えたいドキュメントの ID",
"The text content of the document": "ドキュメントのテキストコンテンツ",
"The source URL of the document (when cited)": "ドキュメントのソース URL (引用された場合)",
"User-friendly title of the document": "ドキュメントのユーザーフレンドリーなタイトル",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Veilige berichten en samenwerking",
"API key": "API sleutel",
"Dust workspace ID": "Dust workspace ID",
"Region": "Regio",
"Can be found in any of the workspace's URL": "Kan worden gevonden in een van de URL van de werkruimte",
"US": "VS",
"EU": "EU",
"Dust authentication requires an API key.": "Stof authenticatie vereist een API-sleutel.",
"Create conversation": "Creëer een gesprek",
"Get existing conversation": "Ophalen van bestaand gesprek",
"Reply to conversation": "Reageer op gesprek",
"Add fragment to conversation": "Voeg fragment toe aan gesprek",
"Add or update document": "Document toevoegen of bijwerken",
"Upload file": "Bestand uploaden",
"Custom API Call": "Custom API Call",
"Create a new conversation with a specific Dust assistant": "Maak een nieuw gesprek met een specifieke Stof assistent",
"Get an existing conversation": "Verkrijg een bestaand gesprek",
"Send reply to existing conversation": "Stuur een antwoord op bestaande conversatie",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Maak een nieuw inhoudsfragment in een gesprek. Inhoud fragmenten zijn stukjes informatie die in gesprekken kunnen worden ingevoegd en als context worden doorgegeven aan assistenten wanneer ze een antwoord genereren.",
"Insert a new document to a Data Source (or update an existing one)": "Een nieuw document toevoegen aan een data-bron (of een bestaande bijwerken)",
"Upload file to be used in conversation": "Upload bestand om in gesprek te worden gebruikt",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Agent": "Agent",
"Username": "Gebruikersnaam",
"Time zone": "Zone tijd",
"Title": "Aanspreektitel",
"Query": "Zoekopdracht",
"Fragment": "Fragment",
"File ID": "Bestand ID",
"Fragment/file name": "Fragment/bestandsnaam",
"Timeout (seconds)": "Time-out (seconden)",
"Conversation sID": "Gesprek sID",
"Conversation ID": "Conversatie ID",
"Fragment name": "Fragment naam",
"Data Source name": "Bronnaam van gegevens",
"Document ID": "Document ID",
"Document content": "Document inhoud",
"Source URL": "Bron URL",
"Document title": "Document titel",
"Tags": "Labels",
"File": "Bestand",
"Method": "Methode",
"Headers": "Kopteksten",
"Query Parameters": "Query parameters",
"Body": "Lichaam",
"Response is Binary ?": "Antwoord is binair?",
"No Error on Failure": "Geen fout bij fout",
"Timeout (in seconds)": "Time-out (in seconden)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID van het bestand dat wordt toegevoegd aan het gesprek (krijgt voorrang op Fragment)",
"The ID of the document you want to insert or replace": "Het ID van het document dat u wilt invoegen of vervangen",
"The text content of the document": "De tekstinhoud van het document",
"The source URL of the document (when cited)": "De bron-URL van het document (indien geciteerd)",
"User-friendly title of the document": "Gebruiksvriendelijke titel van het document",
"Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
"Enable for files like PDFs, images, etc..": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc..",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Mensagens e colaboração seguras",
"API key": "Chave da API",
"Dust workspace ID": "ID do projeto Dust",
"Region": "Região",
"Can be found in any of the workspace's URL": "Pode ser encontrado em qualquer URL da área de trabalho",
"US": "EUA",
"EU": "EU",
"Dust authentication requires an API key.": "A autenticação do Dust requer uma chave de API.",
"Create conversation": "Criar conversa",
"Get existing conversation": "Obter uma conversa existente",
"Reply to conversation": "Responder à conversa",
"Add fragment to conversation": "Adicionar fragmento à conversa",
"Add or update document": "Adicionar ou atualizar documento",
"Upload file": "Upload de arquivo",
"Custom API Call": "Chamada de API personalizada",
"Create a new conversation with a specific Dust assistant": "Criar uma nova conversa com um assistente de Dust específico",
"Get an existing conversation": "Obter uma conversa existente",
"Send reply to existing conversation": "Enviar resposta para conversa existente",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Crie um novo fragmento de conteúdo em uma conversa. Os fragmentos de conteúdo são informações que podem ser inseridas em conversas e são inseridas como contexto aos assistentes quando geram uma resposta.",
"Insert a new document to a Data Source (or update an existing one)": "Inserir um novo documento para uma Fonte de Dados (ou atualizar um já existente)",
"Upload file to be used in conversation": "Carregar arquivo a ser utilizado na conversa",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Agent": "Representante",
"Username": "Usuário:",
"Time zone": "Fuso horário",
"Title": "Título",
"Query": "Requisição",
"Fragment": "Fragmentos",
"File ID": "ID do arquivo",
"Fragment/file name": "Fragmento/nome do arquivo",
"Timeout (seconds)": "Tempo limite (segundos)",
"Conversation sID": "ID da conversa",
"Conversation ID": "ID da conversa",
"Fragment name": "Nome do fragmento",
"Data Source name": "Nome da fonte de dados",
"Document ID": "ID do documento",
"Document content": "Conteúdo do documento",
"Source URL": "URL de origem",
"Document title": "Título do documento",
"Tags": "Etiquetas",
"File": "Arquivo",
"Method": "Método",
"Headers": "Cabeçalhos",
"Query Parameters": "Parâmetros da consulta",
"Body": "Conteúdo",
"Response is Binary ?": "A resposta é binária ?",
"No Error on Failure": "Nenhum erro no Failure",
"Timeout (in seconds)": "Tempo limite (em segundos)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID do arquivo a ser adicionado à conversa (tem precedência sobre Fragmento)",
"The ID of the document you want to insert or replace": "O ID do documento que você deseja inserir ou substituir",
"The text content of the document": "O conteúdo do texto do documento",
"The source URL of the document (when cited)": "A URL de origem do documento (quando citado)",
"User-friendly title of the document": "Título do documento amigável ao usuário",
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
"Enable for files like PDFs, images, etc..": "Habilitar para arquivos como PDFs, imagens, etc..",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA"
}

View File

@@ -0,0 +1,62 @@
{
"Dust": "Пыль",
"Secure messaging and collaboration": "Безопасные сообщения и сотрудничество",
"API key": "API ключ",
"Dust workspace ID": "ID рабочей области пыли",
"Region": "Регион",
"Can be found in any of the workspace's URL": "Может быть найден в URL рабочей области",
"US": "США",
"EU": "EU",
"Dust authentication requires an API key.": "Dust authentication requires a API key.",
"Create conversation": "Создать разговор",
"Get existing conversation": "Получить существующую беседу",
"Reply to conversation": "Ответить в разговоре",
"Add fragment to conversation": "Добавить фрагмент в разговор",
"Add or update document": "Добавить или обновить документ",
"Upload file": "Загрузить файл",
"Custom API Call": "Пользовательский вызов API",
"Create a new conversation with a specific Dust assistant": "Создать новый разговор с конкретным ассистентом пыли",
"Get an existing conversation": "Получить существующую беседу",
"Send reply to existing conversation": "Отправить ответ в существующую беседу",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Создать новый фрагмент контента в разговоре. Фрагменты контента - это части информации, которые могут быть вставлены в разговоры и передаются помощникам при получении ответа.",
"Insert a new document to a Data Source (or update an existing one)": "Вставить новый документ в источник данных (или обновить существующий)",
"Upload file to be used in conversation": "Загрузить файл для использования в разговоре",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"Agent": "Агент",
"Username": "Имя пользователя",
"Time zone": "Часовой пояс",
"Title": "Заголовок",
"Query": "Запрос",
"Fragment": "Фрагменты",
"File ID": "ID файла",
"Fragment/file name": "Имя фрагмента/файла",
"Timeout (seconds)": "Таймаут (в секундах)",
"Conversation sID": "Разговор sID",
"Conversation ID": "ID разговора",
"Fragment name": "Название фрагмента",
"Data Source name": "Имя источника данных",
"Document ID": "ID документа",
"Document content": "Содержание документа",
"Source URL": "Исходный URL",
"Document title": "Название документа",
"Tags": "Теги",
"File": "Файл",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID файла, который будет добавлен в разговор (имеет приоритет над фрагментами)",
"The ID of the document you want to insert or replace": "ID документа, который вы хотите вставить или заменить",
"The text content of the document": "Текстовое содержание документа",
"The source URL of the document (when cited)": "URL источника документа (когда цитировано)",
"User-friendly title of the document": "Удобное название документа",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Secure messaging and collaboration",
"API key": "API key",
"Dust workspace ID": "Dust workspace ID",
"Region": "Region",
"Can be found in any of the workspace's URL": "Can be found in any of the workspace's URL",
"US": "US",
"EU": "EU",
"Dust authentication requires an API key.": "Dust authentication requires an API key.",
"Create conversation": "Create conversation",
"Get existing conversation": "Get existing conversation",
"Reply to conversation": "Reply to conversation",
"Add fragment to conversation": "Add fragment to conversation",
"Add or update document": "Add or update document",
"Upload file": "Upload file",
"Custom API Call": "Custom API Call",
"Create a new conversation with a specific Dust assistant": "Create a new conversation with a specific Dust assistant",
"Get an existing conversation": "Get an existing conversation",
"Send reply to existing conversation": "Send reply to existing conversation",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.",
"Insert a new document to a Data Source (or update an existing one)": "Insert a new document to a Data Source (or update an existing one)",
"Upload file to be used in conversation": "Upload file to be used in conversation",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Agent": "Agent",
"Username": "Username",
"Time zone": "Time zone",
"Title": "Title",
"Query": "Query",
"Fragment": "Fragment",
"File ID": "File ID",
"Fragment/file name": "Fragment/file name",
"Timeout (seconds)": "Timeout (seconds)",
"Conversation sID": "Conversation sID",
"Conversation ID": "Conversation ID",
"Fragment name": "Fragment name",
"Data Source name": "Data Source name",
"Document ID": "Document ID",
"Document content": "Document content",
"Source URL": "Source URL",
"Document title": "Document title",
"Tags": "Tags",
"File": "File",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID of the file to be added to the conversation (takes precedence over Fragment)",
"The ID of the document you want to insert or replace": "The ID of the document you want to insert or replace",
"The text content of the document": "The text content of the document",
"The source URL of the document (when cited)": "The source URL of the document (when cited)",
"User-friendly title of the document": "User-friendly title of the document",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,62 @@
{
"Dust": "Dust",
"Secure messaging and collaboration": "Secure messaging and collaboration",
"API key": "API key",
"Dust workspace ID": "Dust workspace ID",
"Region": "Region",
"Can be found in any of the workspace's URL": "Can be found in any of the workspace's URL",
"US": "US",
"EU": "EU",
"Dust authentication requires an API key.": "Dust authentication requires an API key.",
"Create conversation": "Create conversation",
"Get existing conversation": "Get existing conversation",
"Reply to conversation": "Reply to conversation",
"Add fragment to conversation": "Add fragment to conversation",
"Add or update document": "Add or update document",
"Upload file": "Upload file",
"Custom API Call": "Custom API Call",
"Create a new conversation with a specific Dust assistant": "Create a new conversation with a specific Dust assistant",
"Get an existing conversation": "Get an existing conversation",
"Send reply to existing conversation": "Send reply to existing conversation",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.",
"Insert a new document to a Data Source (or update an existing one)": "Insert a new document to a Data Source (or update an existing one)",
"Upload file to be used in conversation": "Upload file to be used in conversation",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Agent": "Agent",
"Username": "Username",
"Time zone": "Time zone",
"Title": "Title",
"Query": "Query",
"Fragment": "Fragment",
"File ID": "File ID",
"Fragment/file name": "Fragment/file name",
"Timeout (seconds)": "Timeout (seconds)",
"Conversation sID": "Conversation sID",
"Conversation ID": "Conversation ID",
"Fragment name": "Fragment name",
"Data Source name": "Data Source name",
"Document ID": "Document ID",
"Document content": "Document content",
"Source URL": "Source URL",
"Document title": "Document title",
"Tags": "Tags",
"File": "File",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID of the file to be added to the conversation (takes precedence over Fragment)",
"The ID of the document you want to insert or replace": "The ID of the document you want to insert or replace",
"The text content of the document": "The text content of the document",
"The source URL of the document (when cited)": "The source URL of the document (when cited)",
"User-friendly title of the document": "User-friendly title of the document",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,63 @@
{
"Secure messaging and collaboration": "Secure messaging and collaboration",
"API key": "API key",
"Dust workspace ID": "Dust workspace ID",
"Region": "Region",
"Can be found in any of the workspace's URL": "Can be found in any of the workspace's URL",
"US": "US",
"EU": "EU",
"Dust authentication requires an API key.": "Dust authentication requires an API key.",
"Create conversation": "Create conversation",
"Get existing conversation": "Get existing conversation",
"Reply to conversation": "Reply to conversation",
"Add fragment to conversation": "Add fragment to conversation",
"Add or update document": "Add or update document",
"Upload file": "Upload file",
"Custom API Call": "自定义 API 呼叫",
"Create a new conversation with a specific Dust assistant": "Create a new conversation with a specific Dust assistant",
"Get an existing conversation": "Get an existing conversation",
"Send reply to existing conversation": "Send reply to existing conversation",
"Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.": "Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.",
"Insert a new document to a Data Source (or update an existing one)": "Insert a new document to a Data Source (or update an existing one)",
"Upload file to be used in conversation": "Upload file to be used in conversation",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Agent": "Agent",
"Username": "用户名",
"Time zone": "Time zone",
"Title": "标题",
"Query": "Query",
"Fragment": "Fragment",
"File ID": "File ID",
"Fragment/file name": "Fragment/file name",
"Timeout (seconds)": "Timeout (seconds)",
"Conversation sID": "Conversation sID",
"Conversation ID": "Conversation ID",
"Fragment name": "Fragment name",
"Data Source name": "Data Source name",
"Document ID": "Document ID",
"Document content": "Document content",
"Source URL": "Source URL",
"Document title": "Document title",
"Tags": "标签",
"File": "文件",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"ID of the file to be added to the conversation (takes precedence over Fragment)": "ID of the file to be added to the conversation (takes precedence over Fragment)",
"The ID of the document you want to insert or replace": "The ID of the document you want to insert or replace",
"The text content of the document": "The text content of the document",
"The source URL of the document (when cited)": "The source URL of the document (when cited)",
"User-friendly title of the document": "User-friendly title of the document",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色"
}

View File

@@ -0,0 +1,75 @@
import {
AppConnectionValueForAuthProperty,
createPiece,
PieceAuth,
Property,
} from '@activepieces/pieces-framework';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { createConversation } from './lib/actions/create-conversation';
import { replyToConversation } from './lib/actions/reply-to-conversation';
import { upsertDocument } from './lib/actions/upsert-document';
import { addFragmentToConversation } from './lib/actions/add-fragment-to-conversation';
import { getConversation } from './lib/actions/get-conversation';
import { uploadFile } from './lib/actions/upload-file';
import { DUST_BASE_URL } from './lib/common';
export const dustAuth = PieceAuth.CustomAuth({
description: 'Dust authentication requires an API key.',
required: true,
props: {
apiKey: PieceAuth.SecretText({
displayName: 'API key',
required: true,
}),
workspaceId: Property.ShortText({
displayName: 'Dust workspace ID',
required: true,
description: "Can be found in any of the workspace's URL",
}),
region: Property.StaticDropdown({
displayName: 'Region',
required: false,
defaultValue: 'us',
options: {
options: [
{ label: 'US', value: 'us' },
{ label: 'EU', value: 'eu' },
],
},
}),
},
});
export type DustAuthType = AppConnectionValueForAuthProperty<
typeof dustAuth
>['props'];
export const dust = createPiece({
displayName: 'Dust',
description: 'Secure messaging and collaboration',
auth: dustAuth,
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/dust.png',
authors: ['AdamSelene', 'abuaboud'],
actions: [
createConversation,
getConversation,
replyToConversation,
addFragmentToConversation,
upsertDocument,
uploadFile,
createCustomApiCallAction({
baseUrl: (auth) =>
auth
? `${DUST_BASE_URL[auth.props.region ?? 'us']}/${
auth.props.workspaceId
}`
: '',
auth: dustAuth,
authMapping: async (auth) => ({
'Content-Type': 'application/json',
Authorization: `Bearer ${auth.props.apiKey}`,
}),
}),
],
triggers: [],
});

View File

@@ -0,0 +1,59 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { dustAuth, DustAuthType } from '../..';
import { DUST_BASE_URL } from '../common';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import mime from 'mime-types';
export const addFragmentToConversation = createAction({
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
name: 'addFragmentToConversation',
displayName: 'Add fragment to conversation',
description:
'Create a new content fragment in a conversation. Content fragments are pieces of information that can be inserted in conversations and are passed as context to assistants to when they generate an answer.',
auth: dustAuth,
props: {
conversationId: Property.ShortText({
displayName: 'Conversation ID',
required: true,
}),
fragment: Property.File({ displayName: 'Fragment', required: true }),
fragmentName: Property.ShortText({
displayName: 'Fragment name',
required: false,
}),
},
async run({ auth, propsValue }) {
const mimeType = propsValue.fragmentName
? mime.lookup(propsValue.fragmentName) ||
mime.lookup(propsValue.fragment.filename)
: mime.lookup(propsValue.fragment.filename);
const dustAuth = auth.props;
const request: HttpRequest = {
method: HttpMethod.POST,
url: `${DUST_BASE_URL[dustAuth.region ?? 'us']}/${
dustAuth.workspaceId
}/assistant/conversations/${propsValue.conversationId}/content_fragments`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${auth.props.apiKey}`,
},
body: JSON.stringify(
{
content: propsValue.fragment.data.toString('utf-8'),
title: propsValue.fragmentName || propsValue.fragment.filename,
contentType: mimeType || 'text/plain',
context: null,
url: null,
},
(key, value) => (typeof value === 'undefined' ? null : value)
),
};
return (await httpClient.sendRequest(request)).body;
},
});

View File

@@ -0,0 +1,97 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import {
assistantProp,
usernameProp,
timezoneProp,
getConversationContent,
timeoutProp,
createClient,
} from '../common';
import { dustAuth, DustAuthType } from '../..';
import mime from 'mime-types';
import { PublicPostConversationsRequestBody } from '@dust-tt/client';
export const createConversation = createAction({
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
name: 'createConversation',
displayName: 'Create conversation',
description: 'Create a new conversation with a specific Dust assistant',
auth: dustAuth,
props: {
assistant: assistantProp,
username: usernameProp,
timezone: timezoneProp,
title: Property.ShortText({ displayName: 'Title', required: false }),
query: Property.LongText({ displayName: 'Query', required: false }),
fragment: Property.File({ displayName: 'Fragment', required: false }),
fileId: Property.ShortText({
displayName: 'File ID',
required: false,
description:
'ID of the file to be added to the conversation (takes precedence over Fragment)',
}),
fragmentName: Property.ShortText({
displayName: 'Fragment/file name',
required: false,
}),
timeout: timeoutProp,
},
async run({ auth, propsValue }) {
const client = createClient(auth.props);
const payload: PublicPostConversationsRequestBody = {
visibility: 'unlisted',
title: propsValue.title || null,
};
if (propsValue.query) {
payload.message = {
content: propsValue.query,
mentions: [{ configurationId: propsValue.assistant }],
context: {
timezone: propsValue.timezone,
username: propsValue.username,
email: null,
fullName: null,
profilePictureUrl: null,
},
};
}
if (propsValue.fileId) {
payload.contentFragment = {
title: propsValue.fragmentName || '',
fileId: propsValue.fileId,
};
} else if (propsValue.fragment) {
const mimeType = propsValue.fragmentName
? mime.lookup(propsValue.fragmentName) ||
mime.lookup(propsValue.fragment.filename)
: mime.lookup(propsValue.fragment.filename);
payload.contentFragment = {
title: propsValue.fragmentName || propsValue.fragment.filename,
content: propsValue.fragment.data.toString('utf-8'),
contentType: mimeType || 'text/plain',
context: null,
url: null,
};
}
const response = await client.createConversation(payload);
if (response.isErr()) {
throw new Error(`API Error: ${response.error.message}`);
}
const conversationId = response.value.conversation.sId;
if (propsValue.query) {
return await getConversationContent(
conversationId,
propsValue.timeout,
auth.props
);
} else {
return response.value;
}
},
});

View File

@@ -0,0 +1,24 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { getConversationContent, timeoutProp } from '../common';
import { dustAuth, DustAuthType } from '../..';
export const getConversation = createAction({
name: 'getConversation',
displayName: 'Get existing conversation',
description: 'Get an existing conversation',
auth: dustAuth,
props: {
conversationSid: Property.ShortText({
displayName: 'Conversation sID',
required: true,
}),
timeout: timeoutProp,
},
async run({ auth, propsValue }) {
return await getConversationContent(
propsValue.conversationSid,
propsValue.timeout,
auth.props
);
},
});

View File

@@ -0,0 +1,67 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { dustAuth, DustAuthType } from '../..';
import {
assistantProp,
DUST_BASE_URL,
getConversationContent,
timeoutProp,
timezoneProp,
usernameProp,
} from '../common';
export const replyToConversation = createAction({
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
name: 'replyToConversation',
displayName: 'Reply to conversation',
description: 'Send reply to existing conversation',
auth: dustAuth,
props: {
conversationId: Property.ShortText({
displayName: 'Conversation ID',
required: true,
}),
assistant: assistantProp,
query: Property.LongText({ displayName: 'Query', required: true }),
username: usernameProp,
timezone: timezoneProp,
timeout: timeoutProp,
},
async run({ auth, propsValue }) {
const dustAuth = auth.props;
const request: HttpRequest = {
method: HttpMethod.POST,
url: `${DUST_BASE_URL[dustAuth.region || 'us']}/${
dustAuth.workspaceId
}/assistant/conversations/${propsValue.conversationId}/messages`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${auth.props.apiKey}`,
},
body: JSON.stringify(
{
content: propsValue.query,
mentions: [{ configurationId: propsValue.assistant }],
context: {
timezone: propsValue.timezone,
username: propsValue.username,
email: null,
fullName: null,
profilePictureUrl: null,
},
},
(key, value) => (typeof value === 'undefined' ? null : value)
),
};
await httpClient.sendRequest(request);
return await getConversationContent(
propsValue.conversationId,
propsValue.timeout,
dustAuth
);
},
});

View File

@@ -0,0 +1,49 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { createClient } from '../common';
import { dustAuth, DustAuthType } from '../..';
import mimeTypes from 'mime-types';
import { FileUploadUrlRequestType } from '@dust-tt/client';
export const uploadFile = createAction({
name: 'uploadFile',
displayName: 'Upload file',
description: 'Upload file to be used in conversation',
auth: dustAuth,
props: {
file: Property.File({
displayName: 'File',
required: true,
}),
},
async run({ auth, propsValue: { file } }) {
const client = createClient(auth.props);
const contentType = (mimeTypes.lookup(file.filename) ||
'text/plain') as FileUploadUrlRequestType['contentType'];
const blob = new Blob([file.data as unknown as ArrayBuffer], {
type: contentType,
});
const formData = new FormData();
formData.append('file', blob, file.filename);
const fileObject = formData.get('file');
if (!fileObject || typeof fileObject === 'string') {
throw new Error('File object is missing');
}
const response = await client.uploadFile({
contentType,
fileObject,
fileName: file.filename,
fileSize: blob.size,
useCase: 'conversation',
});
if (response.isErr()) {
throw new Error(`API Error: ${response.error.message}`);
}
return response.value;
},
});

View File

@@ -0,0 +1,77 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { DUST_BASE_URL } from '../common';
import { dustAuth, DustAuthType } from '../..';
import mimeTypes from 'mime-types';
export const upsertDocument = createAction({
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
name: 'addDocument',
displayName: 'Add or update document',
description:
'Insert a new document to a Data Source (or update an existing one)',
auth: dustAuth,
props: {
datasource: Property.ShortText({
displayName: 'Data Source name',
required: true,
}),
documentId: Property.ShortText({
displayName: 'Document ID',
description: 'The ID of the document you want to insert or replace',
required: true,
}),
content: Property.LongText({
displayName: 'Document content',
description: 'The text content of the document',
required: true,
}),
sourceUrl: Property.ShortText({
displayName: 'Source URL',
description: 'The source URL of the document (when cited)',
required: false,
}),
title: Property.ShortText({
displayName: 'Document title',
description: 'User-friendly title of the document',
required: false,
}),
tags: Property.Array({
displayName: 'Tags',
required: false,
}),
},
async run({ auth, propsValue }) {
const dustAuth = auth.props;
const tags = propsValue.title
? [`title:${propsValue.title}`, ...(propsValue.tags as string[])]
: (propsValue.tags as string[]);
const request: HttpRequest = {
method: HttpMethod.POST,
url: `${DUST_BASE_URL[dustAuth.region || 'us']}/${
dustAuth.workspaceId
}/data_sources/${propsValue.datasource}/documents/${encodeURIComponent(
propsValue.documentId
)}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${auth.props.apiKey}`,
},
body: JSON.stringify(
{
text: propsValue.content,
source_url: propsValue.sourceUrl,
tags: tags,
},
(key, value) => (typeof value === 'undefined' ? null : value)
),
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});

View File

@@ -0,0 +1,138 @@
import { Property } from '@activepieces/pieces-framework';
import {
httpClient,
HttpMessageBody,
HttpMethod,
} from '@activepieces/pieces-common';
import { dustAuth, DustAuthType } from '..';
import { DustAPI } from '@dust-tt/client';
export const DUST_BASE_URL: Record<string, string> = {
us: 'https://dust.tt/api/v1/w',
eu: 'https://eu.dust.tt/api/v1/w',
};
export const createClient = (auth: DustAuthType) => {
return new DustAPI(
{ url: auth.region === 'eu' ? 'https://eu.dust.tt' : 'https://dust.tt' },
{
workspaceId: auth.workspaceId,
apiKey: auth.apiKey,
},
console
);
};
export const assistantProp = Property.Dropdown({
auth: dustAuth,
displayName: 'Agent',
required: true,
refreshers: ['auth'],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
placeholder: 'Please authenticate first',
};
}
const client = createClient(auth.props);
const response = await client.getAgentConfigurations({});
if (response.isErr()) {
throw new Error(`API Error: ${response.error.message}`);
}
const options = response.value
.filter((agentConfiguration) => agentConfiguration.status === 'active')
.map((agentConfiguration) => {
return {
label: `[${agentConfiguration['scope']}] ${agentConfiguration['name']}`,
value: agentConfiguration['sId'],
};
})
.sort((a: { label: string }, b: { label: string }) =>
a['label'].localeCompare(b['label'])
);
return {
options: options,
};
},
});
export const usernameProp = Property.ShortText({
displayName: 'Username',
required: true,
});
export const timezoneProp = Property.ShortText({
displayName: 'Time zone',
required: true,
defaultValue: 'Europe/Paris',
});
export const timeoutProp = Property.Number({
displayName: 'Timeout (seconds)',
required: true,
defaultValue: 120,
});
export async function getConversationContent(
conversationId: string,
timeout: number,
auth: DustAuthType
) {
const getConversation = async (conversationId: string) => {
return httpClient.sendRequest({
method: HttpMethod.GET,
url: `${DUST_BASE_URL[auth.region || 'us']}/${
auth.workspaceId
}/assistant/conversations/${conversationId}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${auth.apiKey}`,
},
});
};
let conversation = await getConversation(conversationId);
let retries = 0;
const maxRetries = timeout / 10;
while (
!['succeeded', 'failed'].includes(
getConversationStatus(conversation.body)
) &&
retries < maxRetries
) {
await new Promise((f) => setTimeout(f, 10000));
conversation = await getConversation(conversationId);
retries += 1;
}
const conversationStatus = getConversationStatus(conversation.body);
if (conversationStatus != 'succeeded') {
if (retries >= maxRetries) {
throw new Error(
`Could not load conversation ${conversationId} after ${timeout}s - ${conversationStatus} - consider increasing timeout value`
);
} else {
const error = getConversationError(conversation.body);
throw new Error(
`Could not load conversation ${conversationId} - ${conversationStatus}: ${error.message} (${error.code})`
);
}
}
return conversation.body;
}
function getConversationStatus(conversation: HttpMessageBody): string {
return conversation['conversation']['content']?.at(-1)?.at(0)?.status;
}
function getConversationError(conversation: HttpMessageBody): {
code: string;
message: string;
} {
return conversation['conversation']['content']?.at(-1)?.at(0)?.error;
}