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,52 @@
{
"Google Docs": "Google Docs",
"Create and edit documents online": "Create and edit documents online",
"Create Document": "Create Document",
"Edit template file": "Edit template file",
"Read Document": "Read Document",
"Find Document": "Find Document",
"Custom API Call": "Custom API Call",
"Append text to google docs": "Append text to google docs",
"Create a document on Google Docs": "Create a document on Google Docs",
"Edit a template file and replace the values with the ones provided": "Edit a template file and replace the values with the ones provided",
"Read a document from Google Docs": "Read a document from Google Docs",
"Search for document by name.": "Search for document by name.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Appends text to google docs": "Appends text to google docs",
"Document Title": "Document Title",
"Document Content": "Document Content",
"Destination File": "Destination File",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Placeholder Format",
"Document ID": "Document ID",
"Document Name": "Document Name",
"Folder": "Folder",
"Create a new document if not found?": "Create a new document if not found?",
"New Document Properties": "New Document Properties",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Text to append": "Text to append",
"The ID of the file to replace the values": "The ID of the file to replace the values",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Key: Image ID (get it manually from the Read File Action), Value: Image URL",
"Choose the format of placeholders in your template": "Choose the format of placeholders in your template",
"The ID of the document to read": "The ID of the document to read",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"The text to append to the document": "The text to append to the document",
"The ID of the document to append text to": "The ID of the document to append text to",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "Square Brackets [[]]",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"New Document": "New Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggers when a new document is added to a specific folder(optional)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Dokumente online erstellen und bearbeiten",
"Create Document": "Dokument erstellen",
"Edit template file": "Template-Datei bearbeiten",
"Read Document": "Dokument lesen",
"Find Document": "Dokument finden",
"Custom API Call": "Eigener API-Aufruf",
"Append text to google docs": "Text an Google Docs anhängen",
"Create a document on Google Docs": "Ein Dokument auf Google Docs erstellen",
"Edit a template file and replace the values with the ones provided": "Template-Datei bearbeiten und die Werte durch die angegebenen ersetzen",
"Read a document from Google Docs": "Dokument von Google Docs lesen",
"Search for document by name.": "Suche nach Dokument mit Namen.",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Appends text to google docs": "Fügt Text an Google Docs hinzu",
"Document Title": "Dokumenttitel",
"Document Content": "Dokumenteninhalt",
"Destination File": "Zieldatei",
"Variables": "Variablen",
"Images": "Bilder",
"Placeholder Format": "Platzhalterformat",
"Document ID": "Dokument-ID",
"Document Name": "Dokumentname",
"Folder": "Ordner",
"Create a new document if not found?": "Neues Dokument erstellen, wenn nicht gefunden?",
"New Document Properties": "Neue Dokumenteneigenschaften",
"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)",
"Text to append": "Anzuhängender Text",
"The ID of the file to replace the values": "Die ID der Datei, die die Werte ersetzen soll",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Geben Sie das Platzhalterformat \"[[]]\" oder \"{{}}\" nicht an, sondern nur den Schlüsselnamen und dessen Wert",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Tastatur: Bild-ID (holt sie manuell von der Lesedatei-Aktion), Wert: Bild-URL",
"Choose the format of placeholders in your template": "Wählen Sie das Format der Platzhalter in Ihrer Vorlage",
"The ID of the document to read": "Die ID des zu lesenden 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..",
"The text to append to the document": "Der Text, der dem Dokument angehängt wird",
"The ID of the document to append text to": "Die ID des Dokuments, an das Text angehängt wird",
"Curly Braces {{}}": "Geschwommene Klammern {{}}",
"Square Brackets [[]]": "Quadratische Klammern [[]]",
"Single Curly Braces {}": "Einzelne geschwemmte Klammern {}",
"Single Square Brackets []": "Einzelquadratische Klammern []",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD",
"New Document": "Neues Dokument",
"Triggers when a new document is added to a specific folder(optional).": "Wird ausgelöst, wenn ein neues Dokument einem bestimmten Ordner hinzugefügt wird (optional)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Crear y editar documentos en línea",
"Create Document": "Crear Documento",
"Edit template file": "Editar archivo de plantilla",
"Read Document": "Leer documento",
"Find Document": "Buscar documento",
"Custom API Call": "Llamada API personalizada",
"Append text to google docs": "Añadir texto a los documentos de Google",
"Create a document on Google Docs": "Crear un documento en Google Docs",
"Edit a template file and replace the values with the ones provided": "Editar un archivo de plantilla y reemplazar los valores por los proporcionados",
"Read a document from Google Docs": "Leer un documento de Google Docs",
"Search for document by name.": "Buscar documento por nombre.",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Appends text to google docs": "Añade texto a los documentos de Google",
"Document Title": "Título del documento",
"Document Content": "Contenido del documento",
"Destination File": "Archivo de destino",
"Variables": "Variables",
"Images": "Imágenes",
"Placeholder Format": "Formato de marcador",
"Document ID": "ID del documento",
"Document Name": "Nombre del documento",
"Folder": "Carpeta",
"Create a new document if not found?": "¿Crear un nuevo documento si no se encuentra?",
"New Document Properties": "Propiedades del documento nuevo",
"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)",
"Text to append": "Texto a añadir",
"The ID of the file to replace the values": "El ID del archivo para reemplazar los valores",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "No incluir el formato de marcador de posición \"[[]]\" o \"{{}}\", sólo el nombre de la clave y su valor",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Clave: ID de imagen (obtenerlo manualmente de la acción del archivo de lectura), Valor: URL de la imagen",
"Choose the format of placeholders in your template": "Elija el formato de marcadores de posición en su plantilla",
"The ID of the document to read": "El ID del documento a leer",
"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.",
"The text to append to the document": "El texto a añadir al documento",
"The ID of the document to append text to": "El ID del documento al que añadir texto",
"Curly Braces {{}}": "Brazados rizados {{}}",
"Square Brackets [[]]": "Corchetes cuadrados [[]]",
"Single Curly Braces {}": "Brazales individuales {}",
"Single Square Brackets []": "Corchetes cuadrados únicos []",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO",
"New Document": "Nuevo documento",
"Triggers when a new document is added to a specific folder(optional).": "Se activa cuando se añade un nuevo documento a una carpeta específica (opcional)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Créer et éditer des documents en ligne",
"Create Document": "Créer un document",
"Edit template file": "Modifier le fichier modèle",
"Read Document": "Lire le document",
"Find Document": "Trouver un document",
"Custom API Call": "Appel API personnalisé",
"Append text to google docs": "Ajouter du texte à google docs",
"Create a document on Google Docs": "Créer un document sur Google Docs",
"Edit a template file and replace the values with the ones provided": "Modifier un fichier modèle et remplacer les valeurs par celles fournies",
"Read a document from Google Docs": "Lire un document depuis Google Docs",
"Search for document by name.": "Rechercher un document par nom.",
"Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un endpoint spécifique",
"Appends text to google docs": "Ajoute du texte à google docs",
"Document Title": "Titre du document",
"Document Content": "Contenu du document",
"Destination File": "Fichier de destination",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Format des espaces réservés",
"Document ID": "ID du document",
"Document Name": "Nom du document",
"Folder": "Dossier",
"Create a new document if not found?": "Créer un nouveau document s'il n'est pas trouvé?",
"New Document Properties": "Nouvelles propriétés du document",
"Method": "Méthode",
"Headers": "En-têtes",
"Query Parameters": "Paramètres de requête",
"Body": "Corps",
"Response is Binary ?": "La réponse est Binaire ?",
"No Error on Failure": "Aucune erreur en cas d'échec",
"Timeout (in seconds)": "Délai d'attente (en secondes)",
"Text to append": "Texte à ajouter",
"The ID of the file to replace the values": "L'ID du fichier à remplacer par les valeurs",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Ne pas inclure le format de placeholder \"[[]]\" ou \"{{}}\", seulement le nom de la clé et sa valeur",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Clé : ID de l'image (récupérer manuellement à partir de l'action du fichier en lecture), Valeur: URL de l'image",
"Choose the format of placeholders in your template": "Choisissez le format des espaces réservés dans votre modèle",
"The ID of the document to read": "L'ID du document à lire",
"Authorization headers are injected automatically from your connection.": "Les en-têtes d'autorisation sont injectés automatiquement à partir de votre connexion.",
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
"The text to append to the document": "Le texte à ajouter au document",
"The ID of the document to append text to": "L'ID du document à ajouter au texte",
"Curly Braces {{}}": "Bretelles amplitudes {{}}",
"Square Brackets [[]]": "Crochets [[]]",
"Single Curly Braces {}": "Accolades simples {}",
"Single Square Brackets []": "Crochets simples []",
"GET": "OBTENIR",
"POST": "POSTER",
"PATCH": "PATCH",
"PUT": "EFFACER",
"DELETE": "SUPPRIMER",
"HEAD": "HEAD",
"New Document": "Nouveau document",
"Triggers when a new document is added to a specific folder(optional).": "Déclenche lorsqu'un nouveau document est ajouté à un dossier spécifique (optionnel)."
}

View File

@@ -0,0 +1,52 @@
{
"Google Docs": "Google Docs",
"Create and edit documents online": "Create and edit documents online",
"Create Document": "Create Document",
"Edit template file": "Edit template file",
"Read Document": "Read Document",
"Find Document": "Find Document",
"Custom API Call": "Custom API Call",
"Append text to google docs": "Append text to google docs",
"Create a document on Google Docs": "Create a document on Google Docs",
"Edit a template file and replace the values with the ones provided": "Edit a template file and replace the values with the ones provided",
"Read a document from Google Docs": "Read a document from Google Docs",
"Search for document by name.": "Search for document by name.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Appends text to google docs": "Appends text to google docs",
"Document Title": "Document Title",
"Document Content": "Document Content",
"Destination File": "Destination File",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Placeholder Format",
"Document ID": "Document ID",
"Document Name": "Document Name",
"Folder": "Folder",
"Create a new document if not found?": "Create a new document if not found?",
"New Document Properties": "New Document Properties",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Text to append": "Text to append",
"The ID of the file to replace the values": "The ID of the file to replace the values",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Key: Image ID (get it manually from the Read File Action), Value: Image URL",
"Choose the format of placeholders in your template": "Choose the format of placeholders in your template",
"The ID of the document to read": "The ID of the document to read",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"The text to append to the document": "The text to append to the document",
"The ID of the document to append text to": "The ID of the document to append text to",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "Square Brackets [[]]",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"New Document": "New Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggers when a new document is added to a specific folder(optional)."
}

View File

@@ -0,0 +1,52 @@
{
"Google Docs": "Google Docs",
"Create and edit documents online": "Create and edit documents online",
"Create Document": "Create Document",
"Edit template file": "Edit template file",
"Read Document": "Read Document",
"Find Document": "Find Document",
"Custom API Call": "Custom API Call",
"Append text to google docs": "Append text to google docs",
"Create a document on Google Docs": "Create a document on Google Docs",
"Edit a template file and replace the values with the ones provided": "Edit a template file and replace the values with the ones provided",
"Read a document from Google Docs": "Read a document from Google Docs",
"Search for document by name.": "Search for document by name.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Appends text to google docs": "Appends text to google docs",
"Document Title": "Document Title",
"Document Content": "Document Content",
"Destination File": "Destination File",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Placeholder Format",
"Document ID": "Document ID",
"Document Name": "Document Name",
"Folder": "Folder",
"Create a new document if not found?": "Create a new document if not found?",
"New Document Properties": "New Document Properties",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Text to append": "Text to append",
"The ID of the file to replace the values": "The ID of the file to replace the values",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Key: Image ID (get it manually from the Read File Action), Value: Image URL",
"Choose the format of placeholders in your template": "Choose the format of placeholders in your template",
"The ID of the document to read": "The ID of the document to read",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"The text to append to the document": "The text to append to the document",
"The ID of the document to append text to": "The ID of the document to append text to",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "Square Brackets [[]]",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"New Document": "New Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggers when a new document is added to a specific folder(optional)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "オンラインでドキュメントを作成・編集",
"Create Document": "ドキュメントを作成",
"Edit template file": "テンプレートファイルを編集",
"Read Document": "ドキュメントを読む",
"Find Document": "ドキュメントを検索",
"Custom API Call": "カスタムAPI通話",
"Append text to google docs": "Googleドキュメントにテキストを追加",
"Create a document on Google Docs": "Google Docsでドキュメントを作成",
"Edit a template file and replace the values with the ones provided": "テンプレートファイルを編集し、与えられたものと値を置き換えます",
"Read a document from Google Docs": "Google Docsからドキュメントを読む",
"Search for document by name.": "名前でドキュメントを検索します。",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Appends text to google docs": "Googleドキュメントにテキストを追加",
"Document Title": "ドキュメントタイトル",
"Document Content": "ドキュメントの内容",
"Destination File": "宛先ファイル",
"Variables": "変数",
"Images": "画像",
"Placeholder Format": "プレースホルダフォーマット",
"Document ID": "ドキュメントID",
"Document Name": "ドキュメント名",
"Folder": "Folder",
"Create a new document if not found?": "見つからない場合、新しいドキュメントを作成しますか?",
"New Document Properties": "新規ドキュメントのプロパティ",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"Text to append": "追加するテキスト",
"The ID of the file to replace the values": "値を置き換えるファイルの ID",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "プレースホルダ形式\"[[]]\"または\"{{}}\"を含めないでください。キー名とその値のみです",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "キー: イメージ ID (ファイルの読み取りアクションから手動で取得)、値: イメージ URL",
"Choose the format of placeholders in your template": "テンプレートのプレースホルダの形式を選択してください",
"The ID of the document to read": "読み込むドキュメントの ID",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"The text to append to the document": "ドキュメントに追加するテキスト",
"The ID of the document to append text to": "テキストを追加するドキュメントの ID",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "平方ブラケット[[]]",
"Single Curly Braces {}": "単一の中括弧{}",
"Single Square Brackets []": "単一の正方形のかっこ[]",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭",
"New Document": "新しいドキュメント",
"Triggers when a new document is added to a specific folder(optional).": "新しいドキュメントが特定のフォルダに追加されたときにトリガーします(任意)。"
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Creëer en bewerk online documenten",
"Create Document": "Document aanmaken",
"Edit template file": "Sjabloonbestand bewerken",
"Read Document": "Document lezen",
"Find Document": "Document zoeken",
"Custom API Call": "Custom API Call",
"Append text to google docs": "Tekst toevoegen aan google documenten",
"Create a document on Google Docs": "Maak een document aan op Google Docs",
"Edit a template file and replace the values with the ones provided": "Bewerk een sjabloonbestand en vervang de waarden door de opgegeven",
"Read a document from Google Docs": "Lees een document van Google Docs",
"Search for document by name.": "Zoek document op naam.",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Appends text to google docs": "Voegt tekst toe aan google documenten",
"Document Title": "Document titel",
"Document Content": "Document inhoud",
"Destination File": "Bestand bestemming",
"Variables": "Variabelen",
"Images": "Afbeeldingen",
"Placeholder Format": "Placeholder formaat",
"Document ID": "Document ID",
"Document Name": "Document naam",
"Folder": "Map",
"Create a new document if not found?": "Een nieuw document aanmaken indien niet gevonden?",
"New Document Properties": "Nieuwe documenteigenschappen",
"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)",
"Text to append": "Tekst toe te voegen",
"The ID of the file to replace the values": "De ID van het bestand om de waarden te vervangen",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Niet de placeholder format \"[[]]\" of \"{{}}\", alleen de key naam en de waarde ervan",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Sleutel: Afbeeldings-ID (verkrijg het handmatig uit de Lees bestandsactie), Waarde: Afbeeldings-URL",
"Choose the format of placeholders in your template": "Kies het formaat van tijdelijke aanduidingen in je template",
"The ID of the document to read": "Het ID van het te lezen 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..",
"The text to append to the document": "De aan het document toe te voegen tekst",
"The ID of the document to append text to": "Het ID van het document aan tekst toe te voegen",
"Curly Braces {{}}": "Krullende races {{}}",
"Square Brackets [[]]": "Haakjes [[]]",
"Single Curly Braces {}": "Enkele gekrulde races {}",
"Single Square Brackets []": "Enkele vierkante balken []",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD",
"New Document": "Nieuw Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggert wanneer een nieuw document wordt toegevoegd aan een specifieke map (optioneel)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Criar e editar documentos online",
"Create Document": "Criar documento",
"Edit template file": "Editar arquivo de modelo",
"Read Document": "Ler Documento",
"Find Document": "Localizar documento",
"Custom API Call": "Chamada de API personalizada",
"Append text to google docs": "Acrescentar texto à documentação do google",
"Create a document on Google Docs": "Criar um documento no Google Docs",
"Edit a template file and replace the values with the ones provided": "Editar um arquivo de template e substituir os valores pelos fornecidos",
"Read a document from Google Docs": "Ler um documento do Google Docs",
"Search for document by name.": "Pesquisar documento por nome.",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Appends text to google docs": "Acrescenta texto à documentação google",
"Document Title": "Título do documento",
"Document Content": "Conteúdo do documento",
"Destination File": "Arquivo de Destino",
"Variables": "Variáveis",
"Images": "Imagens",
"Placeholder Format": "Formato do Marcador",
"Document ID": "ID do documento",
"Document Name": "Nome do documento",
"Folder": "Pasta",
"Create a new document if not found?": "Criar um novo documento se não for encontrado?",
"New Document Properties": "Novas propriedades do documento",
"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)",
"Text to append": "Texto para acrescentar",
"The ID of the file to replace the values": "O ID do arquivo para substituir os valores",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Não incluir o formato \"[[]]\" ou \"{{}}\", somente o nome da chave e o seu valor",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Chave: ID da imagem (obtenha-o manualmente a partir da ação de leitura do arquivo), Valor: URL da imagem",
"Choose the format of placeholders in your template": "Escolha o formato dos espaços reservados no seu modelo",
"The ID of the document to read": "A ID do documento a ser lido",
"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..",
"The text to append to the document": "O texto para acrescentar ao documento",
"The ID of the document to append text to": "A ID do documento para anexar texto a",
"Curly Braces {{}}": "Chaves Curly {{}}",
"Square Brackets [[]]": "Braçadeiras quadradas [[]]",
"Single Curly Braces {}": "Chaves Únicas {}",
"Single Square Brackets []": "Chaves Quadradas Únicas []",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA",
"New Document": "Novo documento",
"Triggers when a new document is added to a specific folder(optional).": "Aciona quando um novo documento é adicionado a uma pasta específica(opcional)."
}

View File

@@ -0,0 +1,52 @@
{
"Google Docs": "Google Docs",
"Create and edit documents online": "Создание и редактирование документов онлайн",
"Create Document": "Создать документ",
"Edit template file": "Редактировать файл шаблона",
"Read Document": "Читать документ",
"Find Document": "Найти документ",
"Custom API Call": "Пользовательский вызов API",
"Append text to google docs": "Добавить текст в Google docs",
"Create a document on Google Docs": "Создать документ на Google Docs",
"Edit a template file and replace the values with the ones provided": "Отредактируйте файл шаблона и замените введенные значения",
"Read a document from Google Docs": "Читать документ от Google Docs",
"Search for document by name.": "Поиск документа по имени.",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"Appends text to google docs": "Добавляет текст в Google docs",
"Document Title": "Заголовок документа",
"Document Content": "Содержимое документа",
"Destination File": "Файл назначения",
"Variables": "Переменные",
"Images": "Изображения",
"Placeholder Format": "Формат заполнителя",
"Document ID": "ID документа",
"Document Name": "Название документа",
"Folder": "Папка",
"Create a new document if not found?": "Создать новый документ, если не найден?",
"New Document Properties": "Новые свойства документа",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"Text to append": "Текст в добавление",
"The ID of the file to replace the values": "ID файла для замены значений",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Не используйте формат плейсхолдера \"[[]]\" или \"{{}}\", только имя ключа и его значение",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Ключ: ID изображения (получить вручную из действия чтения файла), значение: URL изображения",
"Choose the format of placeholders in your template": "Выберите формат заполнителей в вашем шаблоне",
"The ID of the document to read": "ID документа для чтения",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"The text to append to the document": "Текст для добавления в документ",
"The ID of the document to append text to": "ID документа для добавления текста в",
"Curly Braces {{}}": "Изогнутые Наручи {{}}",
"Square Brackets [[]]": "Квадратные скобки [[]]",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD",
"New Document": "Новый документ",
"Triggers when a new document is added to a specific folder(optional).": "Включает при добавлении нового документа в определенную папку(необязательно)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Create and edit documents online",
"Create Document": "Create Document",
"Edit template file": "Edit template file",
"Read Document": "Read Document",
"Find Document": "Find Document",
"Custom API Call": "Custom API Call",
"Append text to google docs": "Append text to google docs",
"Create a document on Google Docs": "Create a document on Google Docs",
"Edit a template file and replace the values with the ones provided": "Edit a template file and replace the values with the ones provided",
"Read a document from Google Docs": "Read a document from Google Docs",
"Search for document by name.": "Search for document by name.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Appends text to google docs": "Appends text to google docs",
"Document Title": "Document Title",
"Document Content": "Document Content",
"Destination File": "Destination File",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Placeholder Format",
"Document ID": "Document ID",
"Document Name": "Document Name",
"Folder": "Folder",
"Create a new document if not found?": "Create a new document if not found?",
"New Document Properties": "New Document Properties",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Text to append": "Text to append",
"The ID of the file to replace the values": "The ID of the file to replace the values",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Key: Image ID (get it manually from the Read File Action), Value: Image URL",
"Choose the format of placeholders in your template": "Choose the format of placeholders in your template",
"The ID of the document to read": "The ID of the document to read",
"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..",
"The text to append to the document": "The text to append to the document",
"The ID of the document to append text to": "The ID of the document to append text to",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "Square Brackets [[]]",
"Single Curly Braces {}": "Single Curly Braces {}",
"Single Square Brackets []": "Single Square Brackets []",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"New Document": "New Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggers when a new document is added to a specific folder(optional)."
}

View File

@@ -0,0 +1,52 @@
{
"Google Docs": "Google Docs",
"Create and edit documents online": "Create and edit documents online",
"Create Document": "Create Document",
"Edit template file": "Edit template file",
"Read Document": "Read Document",
"Find Document": "Find Document",
"Custom API Call": "Custom API Call",
"Append text to google docs": "Append text to google docs",
"Create a document on Google Docs": "Create a document on Google Docs",
"Edit a template file and replace the values with the ones provided": "Edit a template file and replace the values with the ones provided",
"Read a document from Google Docs": "Read a document from Google Docs",
"Search for document by name.": "Search for document by name.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Appends text to google docs": "Appends text to google docs",
"Document Title": "Document Title",
"Document Content": "Document Content",
"Destination File": "Destination File",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Placeholder Format",
"Document ID": "Document ID",
"Document Name": "Document Name",
"Folder": "Folder",
"Create a new document if not found?": "Create a new document if not found?",
"New Document Properties": "New Document Properties",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Text to append": "Text to append",
"The ID of the file to replace the values": "The ID of the file to replace the values",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Key: Image ID (get it manually from the Read File Action), Value: Image URL",
"Choose the format of placeholders in your template": "Choose the format of placeholders in your template",
"The ID of the document to read": "The ID of the document to read",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"The text to append to the document": "The text to append to the document",
"The ID of the document to append text to": "The ID of the document to append text to",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "Square Brackets [[]]",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"New Document": "New Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggers when a new document is added to a specific folder(optional)."
}

View File

@@ -0,0 +1,55 @@
{
"Create and edit documents online": "Create and edit documents online",
"Create Document": "Create Document",
"Edit template file": "Edit template file",
"Read Document": "Read Document",
"Find Document": "Find Document",
"Custom API Call": "自定义 API 呼叫",
"Append text to google docs": "Append text to google docs",
"Create a document on Google Docs": "Create a document on Google Docs",
"Edit a template file and replace the values with the ones provided": "Edit a template file and replace the values with the ones provided",
"Read a document from Google Docs": "Read a document from Google Docs",
"Search for document by name.": "Search for document by name.",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Appends text to google docs": "Appends text to google docs",
"Document Title": "Document Title",
"Document Content": "Document Content",
"Destination File": "Destination File",
"Variables": "Variables",
"Images": "Images",
"Placeholder Format": "Placeholder Format",
"Document ID": "Document ID",
"Document Name": "Document Name",
"Folder": "Folder",
"Create a new document if not found?": "Create a new document if not found?",
"New Document Properties": "New Document Properties",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"Text to append": "Text to append",
"The ID of the file to replace the values": "The ID of the file to replace the values",
"Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value": "Dont include the placeholder format \"[[]]\" or \"{{}}\", only the key name and its value",
"Key: Image ID (get it manually from the Read File Action), Value: Image URL": "Key: Image ID (get it manually from the Read File Action), Value: Image URL",
"Choose the format of placeholders in your template": "Choose the format of placeholders in your template",
"The ID of the document to read": "The ID of the document to read",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"The text to append to the document": "The text to append to the document",
"The ID of the document to append text to": "The ID of the document to append text to",
"Curly Braces {{}}": "Curly Braces {{}}",
"Square Brackets [[]]": "Square Brackets [[]]",
"Single Curly Braces {}": "Single Curly Braces {}",
"Single Square Brackets []": "Single Square Brackets []",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色",
"New Document": "New Document",
"Triggers when a new document is added to a specific folder(optional).": "Triggers when a new document is added to a specific folder(optional)."
}

View File

@@ -0,0 +1,54 @@
import { OAuth2PropertyValue, PieceAuth, createPiece } from '@activepieces/pieces-framework';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { PieceCategory } from '@activepieces/shared';
import { createDocument } from './lib/actions/create-document';
import { createDocumentBasedOnTemplate } from './lib/actions/create-document-based-on-template.action';
import { readDocument } from './lib/actions/read-document.action';
import { appendText } from './lib/actions/append-text';
import { findDocumentAction } from './lib/actions/find-document';
import { newDocumentTrigger } from './lib/triggers/new-document';
export const googleDocsAuth = PieceAuth.OAuth2({
authUrl: 'https://accounts.google.com/o/oauth2/auth',
tokenUrl: 'https://oauth2.googleapis.com/token',
required: true,
scope: [
'https://www.googleapis.com/auth/documents',
'https://www.googleapis.com/auth/drive.readonly',
'https://www.googleapis.com/auth/drive',
],
});
export const googleDocs = createPiece({
displayName: 'Google Docs',
description: 'Create and edit documents online',
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/google-docs.png',
categories: [PieceCategory.CONTENT_AND_FILES],
authors: [
'pfernandez98',
'kishanprmr',
'MoShizzle',
'khaledmashaly',
'abuaboud',
'AbdullahBitar',
'Kevinyu-alan'
],
auth: googleDocsAuth,
actions: [
createDocument,
createDocumentBasedOnTemplate,
readDocument,
findDocumentAction,
createCustomApiCallAction({
baseUrl: () => 'https://docs.googleapis.com/v1',
auth: googleDocsAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${(auth).access_token}`,
}),
}),
appendText,
],
triggers: [newDocumentTrigger],
});

View File

@@ -0,0 +1,29 @@
import { docsCommon } from '../common';
import { googleDocsAuth } from '../..';
import { Property, createAction } from "@activepieces/pieces-framework";
export const appendText = createAction({
auth: googleDocsAuth,
name: 'append_text',
description: 'Appends text to google docs',
displayName: 'Append text to google docs',
props: {
text: Property.LongText({
displayName: 'Text to append',
description: 'The text to append to the document',
required: true,
}),
documentId: Property.ShortText({
displayName: 'Document ID',
description: 'The ID of the document to append text to',
required: true,
})
},
async run(context) {
return await docsCommon.writeToDocument(
context.propsValue.documentId,
context.propsValue.text,
context.auth.access_token
);
},
});

View File

@@ -0,0 +1,92 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { googleDocsAuth } from '../../index';
import { Property, createAction } from '@activepieces/pieces-framework';
import { google } from 'googleapis';
import { OAuth2Client } from 'googleapis-common';
export const createDocumentBasedOnTemplate = createAction({
auth: googleDocsAuth,
name: 'create_document_based_on_template',
description:
'Edit a template file and replace the values with the ones provided',
displayName: 'Edit template file',
props: {
template: Property.ShortText({
displayName: 'Destination File',
description: 'The ID of the file to replace the values',
required: true,
}),
values: Property.Object({
displayName: 'Variables',
description: 'Dont include the placeholder format "[[]]" or "{{}}", only the key name and its value',
required: true,
}),
images: Property.Object({
displayName: 'Images',
description:
'Key: Image ID (get it manually from the Read File Action), Value: Image URL',
required: true,
}),
placeholder_format: Property.StaticDropdown({
displayName: 'Placeholder Format',
description: 'Choose the format of placeholders in your template',
required: true,
defaultValue: '[[KEY]]',
options: {
disabled: false,
options: [
{ label: 'Curly Braces {{}}', value: '{{KEY}}' },
{ label: 'Square Brackets [[]]', value: '[[KEY]]' },
{ label: 'Single Curly Braces {}', value: '{KEY}' },
{ label: 'Single Square Brackets []', value: '[KEY]' }
],
},
}),
},
async run(context) {
const documentId: string = context.propsValue.template;
const values = context.propsValue.values;
const placeholder_format = context.propsValue.placeholder_format;
const authClient = new OAuth2Client();
authClient.setCredentials(context.auth);
const docs = google.docs('v1');
const requests = [];
for (const key in values) {
const value = values[key];
const new_key = placeholder_format.replace('KEY', key);
requests.push({
replaceAllText: {
containsText: {
text: new_key,
matchCase: true,
},
replaceText: String(value),
},
});
}
for (const key in context.propsValue.images) {
const value = context.propsValue.images[key];
requests.push({
replaceImage: {
imageObjectId: key,
uri: String(value),
},
});
}
const res = await docs.documents.batchUpdate({
auth: authClient,
documentId,
requestBody: {
requests: requests,
},
});
return res;
},
});

View File

@@ -0,0 +1,27 @@
import { createAction } from '@activepieces/pieces-framework';
import { docsCommon } from '../common';
import { googleDocsAuth } from '../..';
export const createDocument = createAction({
auth: googleDocsAuth,
name: 'create_document',
description: 'Create a document on Google Docs',
displayName: 'Create Document',
props: {
title: docsCommon.title,
body: docsCommon.body,
},
async run(context) {
const document = await docsCommon.createDocument(
context.propsValue.title,
context.auth.access_token
);
const response = await docsCommon.writeToDocument(
document.documentId,
context.propsValue.body,
context.auth.access_token
);
return response;
},
});

View File

@@ -0,0 +1,128 @@
import { googleDocsAuth } from '../..';
import {
createAction,
DynamicPropsValue,
Property,
} from '@activepieces/pieces-framework';
import { google } from 'googleapis';
import { OAuth2Client } from 'googleapis-common';
import { folderIdProp } from '../common/props';
export const findDocumentAction = createAction({
auth: googleDocsAuth,
name: 'google-docs-find-document',
displayName: 'Find Document',
description: 'Search for document by name.',
props: {
name: Property.ShortText({
displayName: 'Document Name',
required: true,
}),
folderId: folderIdProp,
createIfNotFound: Property.Checkbox({
displayName: 'Create a new document if not found?',
defaultValue: false,
required: false,
}),
newDocumentProps: Property.DynamicProperties({
auth: googleDocsAuth,
displayName: 'New Document Properties',
required: false,
refreshers: ['createIfNotFound'],
props: async ({ auth, createIfNotFound }) => {
if (!auth) return {};
if (!createIfNotFound) return {};
const props: DynamicPropsValue = {};
if (createIfNotFound) {
props['content'] = Property.LongText({
displayName: 'Document Content',
required: true,
});
}
return props;
},
}),
},
async run(context) {
const { name: documentName, folderId, createIfNotFound, newDocumentProps } = context.propsValue;
const newDocumentContent = newDocumentProps?.['content'] as string;
const authClient = new OAuth2Client();
authClient.setCredentials(context.auth);
const drive = google.drive({ version: 'v3', auth: authClient });
const docs = google.docs({ version: 'v1', auth: authClient });
// Search for the document in Google Drive
const query: string[] = [
`name contains '${documentName}'`,
`mimeType='application/vnd.google-apps.document'`,
'trashed=false',
];
if (folderId) query.push(`'${folderId}' in parents`);
const response = await drive.files.list({
q: query.join(' and '),
supportsAllDrives: true,
fields: '*',
pageSize: 1,
includeItemsFromAllDrives: true,
});
const existingFile = response.data.files?.[0];
if (existingFile) {
return { found: true, file: existingFile };
}
// Create a new document if not found
if (!createIfNotFound) return { found: false, file: {} };
//creating new Document
const createdDoc = await docs.documents.create({ requestBody: { title: documentName } });
const documentId = createdDoc.data.documentId;
if (!documentId) throw new Error('Failed to create document');
// Insert content into the new document
if (newDocumentContent) {
// appending text
await docs.documents.batchUpdate({
documentId,
requestBody: {
requests: [{ insertText: { text: newDocumentContent, endOfSegmentLocation: {} } }],
},
});
}
// Move the document to the specified folder
if (folderId) {
const fileData = await drive.files.get({
fileId: documentId,
supportsAllDrives: true,
fields: 'id, parents',
});
await drive.files.update({
fileId: documentId,
fields: 'id, name, parents',
removeParents: fileData.data.parents?.join(','),
addParents: folderId,
supportsAllDrives: true,
});
}
// Fetch document details
const finalFile = await drive.files.get({
fileId: documentId,
supportsAllDrives: true,
fields: '*',
});
return { found: false, file: finalFile.data };
},
});

View File

@@ -0,0 +1,34 @@
import { googleDocsAuth } from '../../index';
import { Property, createAction } from '@activepieces/pieces-framework';
import { google } from 'googleapis';
import { OAuth2Client } from 'googleapis-common';
export const readDocument = createAction({
displayName: 'Read Document',
auth: googleDocsAuth,
name: 'read_document',
description: 'Read a document from Google Docs',
props: {
documentId: Property.ShortText({
displayName: 'Document ID',
description: 'The ID of the document to read',
required: true,
}),
},
async run(context) {
const authClient = new OAuth2Client();
authClient.setCredentials(context.auth);
const docs = google.docs({ version: 'v1', auth: authClient });
const response = await docs.documents.get({
documentId: context.propsValue.documentId,
});
if (response.status !== 200) {
console.error(response);
throw new Error('Error reading document');
}
return response.data;
},
});

View File

@@ -0,0 +1,56 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient, AuthenticationType } from '@activepieces/pieces-common';
export const docsCommon = {
baseUrl: 'https://docs.googleapis.com/v1',
title: Property.ShortText({
displayName: 'Document Title',
required: true,
}),
body: Property.LongText({
displayName: 'Document Content',
required: true,
}),
// Creates an empty document with the title provided
createDocument: async (title: string, accessToken: string) => {
const createRequest = await httpClient.sendRequest({
url: `${docsCommon.baseUrl}/documents`,
method: HttpMethod.POST,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: accessToken,
},
body: {
title: title,
},
});
return createRequest.body;
},
// Writes provided content to the end of an existing document
writeToDocument: async (documentId: string, body: string, accessToken: string) => {
const writeRequest = await httpClient.sendRequest({
url: `${docsCommon.baseUrl}/documents/${documentId}:batchUpdate`,
method: HttpMethod.POST,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: accessToken,
},
body: {
requests: [
{
insertText: {
text: body,
endOfSegmentLocation: {},
},
},
],
},
});
return writeRequest.body;
},
};

View File

@@ -0,0 +1,56 @@
import { googleDocsAuth } from '../../index';
import { DropdownOption, PiecePropValueSchema, Property } from '@activepieces/pieces-framework';
import { google, drive_v3 } from 'googleapis';
import { OAuth2Client } from 'googleapis-common';
export const folderIdProp = Property.Dropdown({
displayName: 'Folder',
refreshers: [],
auth: googleDocsAuth,
required: false,
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Please connect to your Google Drive account.',
options: [],
};
}
const authValue = auth as PiecePropValueSchema<typeof googleDocsAuth>;
const authClient = new OAuth2Client();
authClient.setCredentials(authValue);
const drive = google.drive({ version: 'v3', auth: authClient });
const options: DropdownOption<string>[] = [];
let nextPageToken;
do {
const response: any = await drive.files.list({
q: "mimeType='application/vnd.google-apps.folder' and trashed = false",
supportsAllDrives: true,
orderBy:'createdTime desc',
includeItemsFromAllDrives: true,
pageToken: nextPageToken,
});
const fileList: drive_v3.Schema$FileList = response.data;
if (fileList.files) {
for (const file of fileList.files)
options.push({
label: file.name!,
value: file.id!,
});
}
nextPageToken = response.data.nextPageToken;
} while (nextPageToken);
return {
disabled: false,
options,
};
},
});

View File

@@ -0,0 +1,105 @@
import { googleDocsAuth } from '../../index';
import { DedupeStrategy, Polling, pollingHelper } from '@activepieces/pieces-common';
import {
AppConnectionValueForAuthProperty,
createTrigger,
PiecePropValueSchema,
TriggerStrategy,
} from '@activepieces/pieces-framework';
import { folderIdProp } from '../common/props';
import dayjs from 'dayjs';
import { google, drive_v3 } from 'googleapis';
import { OAuth2Client } from 'googleapis-common';
type Props = {
folderId?: string;
};
const polling: Polling<AppConnectionValueForAuthProperty<typeof googleDocsAuth>, Props> = {
strategy: DedupeStrategy.TIMEBASED,
async items({ auth, propsValue, lastFetchEpochMS }) {
const authValue = auth;
const folderId = propsValue.folderId;
const q = ["mimeType='application/vnd.google-apps.document'", 'trashed = false'];
if (lastFetchEpochMS) {
q.push(`createdTime > '${dayjs(lastFetchEpochMS).toISOString()}'`);
}
if (folderId) {
q.push(`'${folderId}' in parents`);
}
const authClient = new OAuth2Client();
authClient.setCredentials(authValue);
const drive = google.drive({ version: 'v3', auth: authClient });
let nextPageToken;
const items = [];
do {
const response: any = await drive.files.list({
q: q.join(' and '),
fields: '*',
orderBy: 'createdTime desc',
supportsAllDrives: true,
includeItemsFromAllDrives: true,
pageToken: nextPageToken,
});
const fileList: drive_v3.Schema$FileList = response.data;
if (fileList.files) {
items.push(...fileList.files);
}
if (lastFetchEpochMS === 0) break;
nextPageToken = response.data.nextPageToken;
} while (nextPageToken);
return items.map((item) => ({
epochMilliSeconds: dayjs(item.createdTime).valueOf(),
data: item,
}));
},
};
export const newDocumentTrigger = createTrigger({
auth: googleDocsAuth,
name: 'new-document',
displayName: 'New Document',
description: 'Triggers when a new document is added to a specific folder(optional).',
type: TriggerStrategy.POLLING,
props: {
folderId: folderIdProp,
},
async onEnable(context) {
await pollingHelper.onEnable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
async onDisable(context) {
await pollingHelper.onDisable(polling, {
auth: context.auth,
store: context.store,
propsValue: context.propsValue,
});
},
async test(context) {
return await pollingHelper.test(polling, context);
},
async run(context) {
return await pollingHelper.poll(polling, context);
},
sampleData: {
kind: 'drive#file',
mimeType: 'application/vnd.google-apps.document',
webViewLink:
'https://docs.google.com/document/d/1_9xjsrYFgHVvgqYwAJ8KcsDcNU/edit?usp=drivesdk',
id: '1_9xjsrYFgHVvgqYwAJ8KcsDcN3AzPelsux',
name: 'Test Document',
},
});