Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(google-my-business): ui improvement (#16062)

Talal Jaber4a8a37905773
diff --git a/bun.lock b/bun.lock
index 3fd488c4988..ab0e3cb8583 100644
--- a/bun.lock
+++ b/bun.lock
@@ -3923,7 +3923,7 @@
},
"packages/pieces/community/google-my-business": {
"name": "@activepieces/piece-google-my-business",
- "version": "0.4.0",
+ "version": "0.5.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
@@ -3934,6 +3934,7 @@
},
"devDependencies": {
"tslib": "2.6.2",
+ "vitest": "3.2.6",
},
},
"packages/pieces/community/google-search": {
diff --git a/packages/pieces/community/google-my-business/package.json b/packages/pieces/community/google-my-business/package.json
index 61647d729d7..b006b397c10 100644
--- a/packages/pieces/community/google-my-business/package.json
+++ b/packages/pieces/community/google-my-business/package.json
@@ -1,12 +1,13 @@
{
"name": "@activepieces/piece-google-my-business",
- "version": "0.4.0",
+ "version": "0.5.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
"bundle": "node ../../../../dist/packages/cli/src/index.js pieces bundle",
- "lint": "eslint 'src/**/*.ts'"
+ "lint": "eslint 'src/**/*.ts'",
+ "test": "vitest run"
},
"dependencies": {
"@activepieces/pieces-common": "workspace:*",
@@ -17,6 +18,7 @@
"@activepieces/core-utils": "workspace:*"
},
"devDependencies": {
- "tslib": "2.6.2"
+ "tslib": "2.6.2",
+ "vitest": "3.2.6"
}
}
diff --git a/packages/pieces/community/google-my-business/src/i18n/de.json b/packages/pieces/community/google-my-business/src/i18n/de.json
index 6d1a96bb0a1..27f66a514ac 100644
--- a/packages/pieces/community/google-my-business/src/i18n/de.json
+++ b/packages/pieces/community/google-my-business/src/i18n/de.json
@@ -32,5 +32,46 @@
"New Review": "Neue Bewertung",
"Triggers when there is new review": "Wird ausgelöst, wenn neue Rezension vorhanden ist",
"Account": "Konto",
- "Location": "Standort"
+ "Location": "Standort",
+ "Publish posts and reply to reviews on Google Business Profile.": "Beiträge veröffentlichen und auf Rezensionen im Google Unternehmensprofil antworten.",
+ "Publish an update, event, offer or alert on a location.": "Ein Update, eine Veranstaltung, ein Angebot oder eine Warnung für einen Standort veröffentlichen.",
+ "List the posts published on a location.": "Die Beiträge eines Standorts auflisten.",
+ "Get one post by its ID.": "Einen Beitrag anhand seiner ID abrufen.",
+ "Change the text, photo, button or details of a post.": "Text, Foto, Schaltfläche oder Details eines Beitrags ändern.",
+ "Delete a post from its location.": "Einen Beitrag von seinem Standort löschen.",
+ "Reply to a review, or replace the reply already posted.": "Auf eine Rezension antworten oder die bestehende Antwort ersetzen.",
+ "Post Text": "Beitragstext",
+ "Language Code": "Sprachcode",
+ "Alert Type": "Warnungstyp",
+ "Title": "Titel",
+ "Terms and Conditions": "Geschäftsbedingungen",
+ "Button Type": "Schaltflächentyp",
+ "Button Link": "Schaltflächen-Link",
+ "Publish At": "Veröffentlichen am",
+ "Post ID": "Beitrags-ID",
+ "Review ID": "Rezensions-ID",
+ "The Business Profile account that manages the location.": "Das Unternehmensprofil-Konto, das den Standort verwaltet.",
+ "The business listing on Google Search and Maps.": "Der Unternehmenseintrag in der Google Suche und in Google Maps.",
+ "A public image link. Google must open it without a login.": "Ein öffentlicher Bildlink. Google muss ihn ohne Anmeldung öffnen können.",
+ "Language of the post text, like en or en-GB.": "Sprache des Beitragstexts, z. B. en oder en-GB.",
+ "Required for Alert posts.": "Erforderlich für Warnungsbeiträge.",
+ "Required for Event and Offer posts, with both dates.": "Erforderlich für Veranstaltungs- und Angebotsbeiträge, mit beiden Daten.",
+ "24-hour clock, location time zone.": "24-Stunden-Format, Zeitzone des Standorts.",
+ "Required for every button except Call Now, which dials the location.": "Erforderlich für jede Schaltfläche außer Call Now, die den Standort anruft.",
+ "Leave empty to publish now.": "Leer lassen, um sofort zu veröffentlichen.",
+ "Stop after this many posts. Default 100.": "Nach so vielen Beiträgen aufhören. Standard: 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Das vollständige Feld name aus Create Post oder List Posts einfügen.",
+ "Leave empty to keep the current text.": "Leer lassen, um den aktuellen Text zu behalten.",
+ "Replaces every photo on the post. Must open without a login.": "Ersetzt alle Fotos des Beitrags. Muss ohne Anmeldung erreichbar sein.",
+ "Replaces the whole event, so fill in every field you want kept.": "Ersetzt die gesamte Veranstaltung. Füllen Sie jedes Feld aus, das erhalten bleiben soll.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Ersetzt das gesamte Angebot. Füllen Sie jedes Feld aus, das erhalten bleiben soll.",
+ "Choosing a type replaces the current button.": "Die Auswahl eines Typs ersetzt die aktuelle Schaltfläche.",
+ "Reschedule the post to a future time.": "Den Beitrag auf einen späteren Zeitpunkt verschieben.",
+ "Paste the whole name field from the New Review trigger.": "Das vollständige Feld name aus dem Trigger New Review einfügen.",
+ "Shown publicly under the review.": "Wird öffentlich unter der Rezension angezeigt.",
+ "Standard": "Standard",
+ "Event": "Veranstaltung",
+ "Offer": "Angebot",
+ "Alert": "Warnung",
+ "Triggers when a customer posts a new review on the location.": "Wird ausgelöst, wenn ein Kunde eine neue Rezension für den Standort schreibt."
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/es.json b/packages/pieces/community/google-my-business/src/i18n/es.json
index d7e827d6360..211de691b6e 100644
--- a/packages/pieces/community/google-my-business/src/i18n/es.json
+++ b/packages/pieces/community/google-my-business/src/i18n/es.json
@@ -32,5 +32,46 @@
"New Review": "Nueva reseña",
"Triggers when there is new review": "Dispara cuando hay una nueva revisión",
"Account": "Cuenta",
- "Location": "Ubicación"
+ "Location": "Ubicación",
+ "Publish posts and reply to reviews on Google Business Profile.": "Publica entradas y responde reseñas en el Perfil de Empresa de Google.",
+ "Publish an update, event, offer or alert on a location.": "Publica una novedad, un evento, una oferta o una alerta en una ubicación.",
+ "List the posts published on a location.": "Enumera las publicaciones de una ubicación.",
+ "Get one post by its ID.": "Obtiene una publicación por su ID.",
+ "Change the text, photo, button or details of a post.": "Cambia el texto, la foto, el botón o los detalles de una publicación.",
+ "Delete a post from its location.": "Elimina una publicación de su ubicación.",
+ "Reply to a review, or replace the reply already posted.": "Responde a una reseña o reemplaza la respuesta ya publicada.",
+ "Post Text": "Texto de la publicación",
+ "Language Code": "Código de idioma",
+ "Alert Type": "Tipo de alerta",
+ "Title": "Título",
+ "Terms and Conditions": "Términos y condiciones",
+ "Button Type": "Tipo de botón",
+ "Button Link": "Enlace del botón",
+ "Publish At": "Publicar el",
+ "Post ID": "ID de la publicación",
+ "Review ID": "ID de la reseña",
+ "The Business Profile account that manages the location.": "La cuenta del Perfil de Empresa que gestiona la ubicación.",
+ "The business listing on Google Search and Maps.": "La ficha de la empresa en la Búsqueda de Google y Maps.",
+ "A public image link. Google must open it without a login.": "Un enlace público a una imagen. Google debe poder abrirlo sin iniciar sesión.",
+ "Language of the post text, like en or en-GB.": "Idioma del texto de la publicación, como en o en-GB.",
+ "Required for Alert posts.": "Obligatorio para publicaciones de alerta.",
+ "Required for Event and Offer posts, with both dates.": "Obligatorio para publicaciones de evento y oferta, con ambas fechas.",
+ "24-hour clock, location time zone.": "Formato de 24 horas, zona horaria de la ubicación.",
+ "Required for every button except Call Now, which dials the location.": "Obligatorio para todos los botones excepto Call Now, que llama a la ubicación.",
+ "Leave empty to publish now.": "Déjalo vacío para publicar ahora.",
+ "Stop after this many posts. Default 100.": "Detenerse tras esta cantidad de publicaciones. Predeterminado: 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Pega el campo name completo de Create Post o List Posts.",
+ "Leave empty to keep the current text.": "Déjalo vacío para conservar el texto actual.",
+ "Replaces every photo on the post. Must open without a login.": "Reemplaza todas las fotos de la publicación. Debe abrirse sin iniciar sesión.",
+ "Replaces the whole event, so fill in every field you want kept.": "Reemplaza el evento completo, así que rellena cada campo que quieras conservar.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Reemplaza la oferta completa, así que rellena cada campo que quieras conservar.",
+ "Choosing a type replaces the current button.": "Elegir un tipo reemplaza el botón actual.",
+ "Reschedule the post to a future time.": "Reprograma la publicación para una hora futura.",
+ "Paste the whole name field from the New Review trigger.": "Pega el campo name completo del disparador New Review.",
+ "Shown publicly under the review.": "Se muestra públicamente debajo de la reseña.",
+ "Standard": "Estándar",
+ "Event": "Evento",
+ "Offer": "Oferta",
+ "Alert": "Alerta",
+ "Triggers when a customer posts a new review on the location.": "Se activa cuando un cliente publica una nueva reseña en la ubicación."
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/fr.json b/packages/pieces/community/google-my-business/src/i18n/fr.json
index a8bdeda2e3f..2794733b179 100644
--- a/packages/pieces/community/google-my-business/src/i18n/fr.json
+++ b/packages/pieces/community/google-my-business/src/i18n/fr.json
@@ -32,5 +32,46 @@
"New Review": "Nouveau commentaire",
"Triggers when there is new review": "Déclenche quand il y a une nouvelle revue",
"Account": "Compte client",
- "Location": "Localisation"
+ "Location": "Localisation",
+ "Publish posts and reply to reviews on Google Business Profile.": "Publiez des posts et répondez aux avis sur votre fiche d’établissement Google.",
+ "Publish an update, event, offer or alert on a location.": "Publier une actualité, un événement, une offre ou une alerte sur un établissement.",
+ "List the posts published on a location.": "Lister les posts publiés sur un établissement.",
+ "Get one post by its ID.": "Obtenir un post à partir de son ID.",
+ "Change the text, photo, button or details of a post.": "Modifier le texte, la photo, le bouton ou les détails d’un post.",
+ "Delete a post from its location.": "Supprimer un post de son établissement.",
+ "Reply to a review, or replace the reply already posted.": "Répondre à un avis ou remplacer la réponse déjà publiée.",
+ "Post Text": "Texte du post",
+ "Language Code": "Code de langue",
+ "Alert Type": "Type d’alerte",
+ "Title": "Titre",
+ "Terms and Conditions": "Conditions générales",
+ "Button Type": "Type de bouton",
+ "Button Link": "Lien du bouton",
+ "Publish At": "Publier le",
+ "Post ID": "ID du post",
+ "Review ID": "ID de l’avis",
+ "The Business Profile account that manages the location.": "Le compte de fiche d’établissement qui gère l’établissement.",
+ "The business listing on Google Search and Maps.": "La fiche de l’établissement dans la recherche Google et Maps.",
+ "A public image link. Google must open it without a login.": "Un lien public vers une image. Google doit pouvoir l’ouvrir sans connexion.",
+ "Language of the post text, like en or en-GB.": "Langue du texte du post, par exemple en ou en-GB.",
+ "Required for Alert posts.": "Obligatoire pour les posts d’alerte.",
+ "Required for Event and Offer posts, with both dates.": "Obligatoire pour les posts d’événement et d’offre, avec les deux dates.",
+ "24-hour clock, location time zone.": "Format 24 heures, fuseau horaire de l’établissement.",
+ "Required for every button except Call Now, which dials the location.": "Obligatoire pour tous les boutons sauf Call Now, qui appelle l’établissement.",
+ "Leave empty to publish now.": "Laissez vide pour publier maintenant.",
+ "Stop after this many posts. Default 100.": "S’arrêter après ce nombre de posts. Par défaut : 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Collez le champ name complet renvoyé par Create Post ou List Posts.",
+ "Leave empty to keep the current text.": "Laissez vide pour conserver le texte actuel.",
+ "Replaces every photo on the post. Must open without a login.": "Remplace toutes les photos du post. Doit s’ouvrir sans connexion.",
+ "Replaces the whole event, so fill in every field you want kept.": "Remplace tout l’événement : remplissez chaque champ à conserver.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Remplace toute l’offre : remplissez chaque champ à conserver.",
+ "Choosing a type replaces the current button.": "Choisir un type remplace le bouton actuel.",
+ "Reschedule the post to a future time.": "Reprogrammer le post à une date ultérieure.",
+ "Paste the whole name field from the New Review trigger.": "Collez le champ name complet du déclencheur New Review.",
+ "Shown publicly under the review.": "Affiché publiquement sous l’avis.",
+ "Standard": "Standard",
+ "Event": "Événement",
+ "Offer": "Offre",
+ "Alert": "Alerte",
+ "Triggers when a customer posts a new review on the location.": "Se déclenche lorsqu’un client publie un nouvel avis sur l’établissement."
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/ja.json b/packages/pieces/community/google-my-business/src/i18n/ja.json
index 07bed7356fa..e6c230be72f 100644
--- a/packages/pieces/community/google-my-business/src/i18n/ja.json
+++ b/packages/pieces/community/google-my-business/src/i18n/ja.json
@@ -32,5 +32,46 @@
"New Review": "新しいレビュー",
"Triggers when there is new review": "新しいレビューがある場合にトリガー",
"Account": "アカウント",
- "Location": "場所"
+ "Location": "場所",
+ "Publish posts and reply to reviews on Google Business Profile.": "Google ビジネス プロフィールで投稿を公開し、クチコミに返信します。",
+ "Publish an update, event, offer or alert on a location.": "ビジネス拠点に最新情報、イベント、特典、アラートを投稿します。",
+ "List the posts published on a location.": "ビジネス拠点で公開されている投稿を一覧表示します。",
+ "Get one post by its ID.": "ID を指定して投稿を 1 件取得します。",
+ "Change the text, photo, button or details of a post.": "投稿のテキスト、写真、ボタン、詳細を変更します。",
+ "Delete a post from its location.": "投稿をビジネス拠点から削除します。",
+ "Reply to a review, or replace the reply already posted.": "クチコミに返信するか、既存の返信を置き換えます。",
+ "Post Text": "投稿テキスト",
+ "Language Code": "言語コード",
+ "Alert Type": "アラートの種類",
+ "Title": "タイトル",
+ "Terms and Conditions": "利用規約",
+ "Button Type": "ボタンの種類",
+ "Button Link": "ボタンのリンク",
+ "Publish At": "公開日時",
+ "Post ID": "投稿 ID",
+ "Review ID": "クチコミ ID",
+ "The Business Profile account that manages the location.": "このビジネス拠点を管理するビジネス プロフィールのアカウント。",
+ "The business listing on Google Search and Maps.": "Google 検索とマップに表示されるビジネス情報。",
+ "A public image link. Google must open it without a login.": "公開されている画像のリンク。Google がログインなしで開ける必要があります。",
+ "Language of the post text, like en or en-GB.": "投稿テキストの言語(例: en、en-GB)。",
+ "Required for Alert posts.": "アラート投稿では必須です。",
+ "Required for Event and Offer posts, with both dates.": "イベントと特典の投稿では、両方の日付とともに必須です。",
+ "24-hour clock, location time zone.": "24 時間表記、ビジネス拠点のタイムゾーン。",
+ "Required for every button except Call Now, which dials the location.": "Call Now(ビジネス拠点に電話をかける)以外のすべてのボタンで必須です。",
+ "Leave empty to publish now.": "空欄にするとすぐに公開されます。",
+ "Stop after this many posts. Default 100.": "この件数に達したら停止します。既定値は 100 です。",
+ "Paste the whole name field from Create Post or List Posts.": "Create Post または List Posts の name フィールドをそのまま貼り付けます。",
+ "Leave empty to keep the current text.": "空欄にすると現在のテキストが保持されます。",
+ "Replaces every photo on the post. Must open without a login.": "投稿の写真をすべて置き換えます。ログインなしで開ける必要があります。",
+ "Replaces the whole event, so fill in every field you want kept.": "イベント全体が置き換わるため、残したい項目はすべて入力してください。",
+ "Replaces the whole offer, so fill in every field you want kept.": "特典全体が置き換わるため、残したい項目はすべて入力してください。",
+ "Choosing a type replaces the current button.": "種類を選ぶと現在のボタンが置き換わります。",
+ "Reschedule the post to a future time.": "投稿を将来の日時に再設定します。",
+ "Paste the whole name field from the New Review trigger.": "New Review トリガーの name フィールドをそのまま貼り付けます。",
+ "Shown publicly under the review.": "クチコミの下に公開で表示されます。",
+ "Standard": "標準",
+ "Event": "イベント",
+ "Offer": "特典",
+ "Alert": "アラート",
+ "Triggers when a customer posts a new review on the location.": "顧客がビジネス拠点に新しいクチコミを投稿したときにトリガーされます。"
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/nl.json b/packages/pieces/community/google-my-business/src/i18n/nl.json
index 6e9f7620c9a..511920c270e 100644
--- a/packages/pieces/community/google-my-business/src/i18n/nl.json
+++ b/packages/pieces/community/google-my-business/src/i18n/nl.json
@@ -32,5 +32,46 @@
"New Review": "Nieuwe review",
"Triggers when there is new review": "Triggert wanneer er nieuwe review is",
"Account": "Rekening",
- "Location": "Locatie"
+ "Location": "Locatie",
+ "Publish posts and reply to reviews on Google Business Profile.": "Publiceer berichten en reageer op reviews in je Google Bedrijfsprofiel.",
+ "Publish an update, event, offer or alert on a location.": "Publiceer een update, evenement, aanbieding of melding op een locatie.",
+ "List the posts published on a location.": "Toon de berichten die op een locatie zijn gepubliceerd.",
+ "Get one post by its ID.": "Haal één bericht op aan de hand van de ID.",
+ "Change the text, photo, button or details of a post.": "Wijzig de tekst, foto, knop of details van een bericht.",
+ "Delete a post from its location.": "Verwijder een bericht van de locatie.",
+ "Reply to a review, or replace the reply already posted.": "Reageer op een review of vervang de reactie die er al staat.",
+ "Post Text": "Berichttekst",
+ "Language Code": "Taalcode",
+ "Alert Type": "Type melding",
+ "Title": "Titel",
+ "Terms and Conditions": "Algemene voorwaarden",
+ "Button Type": "Knoptype",
+ "Button Link": "Knoplink",
+ "Publish At": "Publiceren op",
+ "Post ID": "Bericht-ID",
+ "Review ID": "Review-ID",
+ "The Business Profile account that manages the location.": "Het Bedrijfsprofiel-account dat de locatie beheert.",
+ "The business listing on Google Search and Maps.": "De bedrijfsvermelding in Google Zoeken en Maps.",
+ "A public image link. Google must open it without a login.": "Een openbare afbeeldingslink. Google moet die zonder inloggen kunnen openen.",
+ "Language of the post text, like en or en-GB.": "Taal van de berichttekst, zoals en of en-GB.",
+ "Required for Alert posts.": "Verplicht voor meldingsberichten.",
+ "Required for Event and Offer posts, with both dates.": "Verplicht voor evenement- en aanbiedingsberichten, met beide datums.",
+ "24-hour clock, location time zone.": "24-uursnotatie, tijdzone van de locatie.",
+ "Required for every button except Call Now, which dials the location.": "Verplicht voor elke knop behalve Call Now, die de locatie belt.",
+ "Leave empty to publish now.": "Laat leeg om nu te publiceren.",
+ "Stop after this many posts. Default 100.": "Stop na dit aantal berichten. Standaard 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Plak het volledige veld name uit Create Post of List Posts.",
+ "Leave empty to keep the current text.": "Laat leeg om de huidige tekst te behouden.",
+ "Replaces every photo on the post. Must open without a login.": "Vervangt alle foto’s van het bericht. Moet zonder inloggen te openen zijn.",
+ "Replaces the whole event, so fill in every field you want kept.": "Vervangt het hele evenement, dus vul elk veld in dat je wilt behouden.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Vervangt de hele aanbieding, dus vul elk veld in dat je wilt behouden.",
+ "Choosing a type replaces the current button.": "Een type kiezen vervangt de huidige knop.",
+ "Reschedule the post to a future time.": "Plan het bericht opnieuw in op een later tijdstip.",
+ "Paste the whole name field from the New Review trigger.": "Plak het volledige veld name uit de trigger New Review.",
+ "Shown publicly under the review.": "Wordt openbaar onder de review getoond.",
+ "Standard": "Standaard",
+ "Event": "Evenement",
+ "Offer": "Aanbieding",
+ "Alert": "Melding",
+ "Triggers when a customer posts a new review on the location.": "Wordt geactiveerd wanneer een klant een nieuwe review over de locatie plaatst."
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/pt.json b/packages/pieces/community/google-my-business/src/i18n/pt.json
index bc646acd0cb..5decac9d513 100644
--- a/packages/pieces/community/google-my-business/src/i18n/pt.json
+++ b/packages/pieces/community/google-my-business/src/i18n/pt.json
@@ -32,5 +32,46 @@
"New Review": "Nova Revisão",
"Triggers when there is new review": "Dispara quando houver uma nova revisão",
"Account": "conta",
- "Location": "Local:"
+ "Location": "Local:",
+ "Publish posts and reply to reviews on Google Business Profile.": "Publique posts e responda a avaliações no Perfil da Empresa no Google.",
+ "Publish an update, event, offer or alert on a location.": "Publica uma novidade, um evento, uma oferta ou um alerta em um local.",
+ "List the posts published on a location.": "Lista os posts publicados em um local.",
+ "Get one post by its ID.": "Obtém um post pelo ID.",
+ "Change the text, photo, button or details of a post.": "Altera o texto, a foto, o botão ou os detalhes de um post.",
+ "Delete a post from its location.": "Exclui um post do local.",
+ "Reply to a review, or replace the reply already posted.": "Responde a uma avaliação ou substitui a resposta já publicada.",
+ "Post Text": "Texto do post",
+ "Language Code": "Código de idioma",
+ "Alert Type": "Tipo de alerta",
+ "Title": "Título",
+ "Terms and Conditions": "Termos e condições",
+ "Button Type": "Tipo de botão",
+ "Button Link": "Link do botão",
+ "Publish At": "Publicar em",
+ "Post ID": "ID do post",
+ "Review ID": "ID da avaliação",
+ "The Business Profile account that manages the location.": "A conta do Perfil da Empresa que gerencia o local.",
+ "The business listing on Google Search and Maps.": "A ficha da empresa na Pesquisa Google e no Maps.",
+ "A public image link. Google must open it without a login.": "Um link público de imagem. O Google precisa abri-lo sem login.",
+ "Language of the post text, like en or en-GB.": "Idioma do texto do post, como en ou en-GB.",
+ "Required for Alert posts.": "Obrigatório para posts de alerta.",
+ "Required for Event and Offer posts, with both dates.": "Obrigatório para posts de evento e oferta, com as duas datas.",
+ "24-hour clock, location time zone.": "Formato de 24 horas, fuso horário do local.",
+ "Required for every button except Call Now, which dials the location.": "Obrigatório para todos os botões, exceto Call Now, que liga para o local.",
+ "Leave empty to publish now.": "Deixe vazio para publicar agora.",
+ "Stop after this many posts. Default 100.": "Parar após esta quantidade de posts. Padrão: 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Cole o campo name completo de Create Post ou List Posts.",
+ "Leave empty to keep the current text.": "Deixe vazio para manter o texto atual.",
+ "Replaces every photo on the post. Must open without a login.": "Substitui todas as fotos do post. Precisa abrir sem login.",
+ "Replaces the whole event, so fill in every field you want kept.": "Substitui o evento inteiro, então preencha cada campo que quiser manter.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Substitui a oferta inteira, então preencha cada campo que quiser manter.",
+ "Choosing a type replaces the current button.": "Escolher um tipo substitui o botão atual.",
+ "Reschedule the post to a future time.": "Reagenda o post para um horário futuro.",
+ "Paste the whole name field from the New Review trigger.": "Cole o campo name completo do gatilho New Review.",
+ "Shown publicly under the review.": "Exibido publicamente abaixo da avaliação.",
+ "Standard": "Padrão",
+ "Event": "Evento",
+ "Offer": "Oferta",
+ "Alert": "Alerta",
+ "Triggers when a customer posts a new review on the location.": "Dispara quando um cliente publica uma nova avaliação no local."
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/ru.json b/packages/pieces/community/google-my-business/src/i18n/ru.json
index 5fedd7700a7..f72562009e8 100644
--- a/packages/pieces/community/google-my-business/src/i18n/ru.json
+++ b/packages/pieces/community/google-my-business/src/i18n/ru.json
@@ -25,5 +25,46 @@
"New Review": "Новый отзыв",
"Triggers when there is new review": "Триггеры, когда есть новый отзыв",
"Account": "Аккаунт",
- "Location": "Местоположение"
+ "Location": "Местоположение",
+ "Publish posts and reply to reviews on Google Business Profile.": "Публикуйте записи и отвечайте на отзывы в профиле компании в Google.",
+ "Publish an update, event, offer or alert on a location.": "Опубликовать новость, мероприятие, предложение или оповещение для точки.",
+ "List the posts published on a location.": "Показать записи, опубликованные для точки.",
+ "Get one post by its ID.": "Получить запись по её ID.",
+ "Change the text, photo, button or details of a post.": "Изменить текст, фото, кнопку или сведения записи.",
+ "Delete a post from its location.": "Удалить запись из её точки.",
+ "Reply to a review, or replace the reply already posted.": "Ответить на отзыв или заменить уже опубликованный ответ.",
+ "Post Text": "Текст записи",
+ "Language Code": "Код языка",
+ "Alert Type": "Тип оповещения",
+ "Title": "Заголовок",
+ "Terms and Conditions": "Условия",
+ "Button Type": "Тип кнопки",
+ "Button Link": "Ссылка кнопки",
+ "Publish At": "Опубликовать в",
+ "Post ID": "ID записи",
+ "Review ID": "ID отзыва",
+ "The Business Profile account that manages the location.": "Аккаунт профиля компании, который управляет точкой.",
+ "The business listing on Google Search and Maps.": "Карточка компании в Google Поиске и Картах.",
+ "A public image link. Google must open it without a login.": "Публичная ссылка на изображение. Google должен открыть её без входа.",
+ "Language of the post text, like en or en-GB.": "Язык текста записи, например en или en-GB.",
+ "Required for Alert posts.": "Обязательно для записей-оповещений.",
+ "Required for Event and Offer posts, with both dates.": "Обязательно для мероприятий и предложений, вместе с обеими датами.",
+ "24-hour clock, location time zone.": "24-часовой формат, часовой пояс точки.",
+ "Required for every button except Call Now, which dials the location.": "Обязательно для всех кнопок, кроме Call Now, которая звонит в точку.",
+ "Leave empty to publish now.": "Оставьте пустым, чтобы опубликовать сразу.",
+ "Stop after this many posts. Default 100.": "Остановиться после этого числа записей. По умолчанию 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Вставьте поле name целиком из Create Post или List Posts.",
+ "Leave empty to keep the current text.": "Оставьте пустым, чтобы сохранить текущий текст.",
+ "Replaces every photo on the post. Must open without a login.": "Заменяет все фото записи. Должна открываться без входа.",
+ "Replaces the whole event, so fill in every field you want kept.": "Мероприятие заменяется целиком, поэтому заполните все поля, которые нужно сохранить.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Предложение заменяется целиком, поэтому заполните все поля, которые нужно сохранить.",
+ "Choosing a type replaces the current button.": "Выбор типа заменяет текущую кнопку.",
+ "Reschedule the post to a future time.": "Перенести запись на более позднее время.",
+ "Paste the whole name field from the New Review trigger.": "Вставьте поле name целиком из триггера New Review.",
+ "Shown publicly under the review.": "Показывается публично под отзывом.",
+ "Standard": "Обычная",
+ "Event": "Мероприятие",
+ "Offer": "Предложение",
+ "Alert": "Оповещение",
+ "Triggers when a customer posts a new review on the location.": "Срабатывает, когда клиент оставляет новый отзыв о точке."
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/i18n/translation.json b/packages/pieces/community/google-my-business/src/i18n/translation.json
index dd7937609e8..5d3c6a2a751 100644
--- a/packages/pieces/community/google-my-business/src/i18n/translation.json
+++ b/packages/pieces/community/google-my-business/src/i18n/translation.json
@@ -1,81 +1,134 @@
{
- "Manage your business on Google": "Manage your business on Google",
+ "Publish posts and reply to reviews on Google Business Profile.": "Publish posts and reply to reviews on Google Business Profile.",
+ "Create Post": "Create Post",
+ "List Posts": "List Posts",
+ "Get Post": "Get Post",
+ "Update Post": "Update Post",
+ "Delete Post": "Delete Post",
"Create or Update Reply": "Create or Update Reply",
+ "List Accounts": "List Accounts",
+ "List Locations": "List Locations",
+ "Get Location": "Get Location",
+ "Update Location": "Update Location",
+ "List Reviews": "List Reviews",
+ "Get Location Verification State": "Get Location Verification State",
+ "List Media": "List Media",
+ "Get Media": "Get Media",
+ "Get Review": "Get Review",
+ "Reply to Review": "Reply to Review",
+ "Delete Review Reply": "Delete Review Reply",
"Custom API Call": "Custom API Call",
- "Create or update a reply to a review if it already exists": "Create or update a reply to a review if it already exists",
+ "Publish an update, event, offer or alert on a location.": "Publish an update, event, offer or alert on a location.",
+ "List the posts published on a location.": "List the posts published on a location.",
+ "Get one post by its ID.": "Get one post by its ID.",
+ "Change the text, photo, button or details of a post.": "Change the text, photo, button or details of a post.",
+ "Delete a post from its location.": "Delete a post from its location.",
+ "Reply to a review, or replace the reply already posted.": "Reply to a review, or replace the reply already posted.",
+ "Lists the Business Profile accounts the connected user can access.": "Lists the Business Profile accounts the connected user can access.",
+ "Lists the business locations of an account.": "Lists the business locations of an account.",
+ "Gets the details of a business location.": "Gets the details of a business location.",
+ "Updates the website, labels or store code of a business location.": "Updates the website, labels or store code of a business location.",
+ "Lists the customer reviews of a location.": "Lists the customer reviews of a location.",
+ "Gets whether a location is verified and can publish changes.": "Gets whether a location is verified and can publish changes.",
+ "Lists the photos and videos of a location.": "Lists the photos and videos of a location.",
+ "Gets one photo or video of a location.": "Gets one photo or video of a location.",
+ "Gets one customer review of a location.": "Gets one customer review of a location.",
+ "Creates or replaces the owner reply to a review.": "Creates or replaces the owner reply to a review.",
+ "Deletes the owner reply to a review.": "Deletes the owner reply to a review.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
- "Review Name": "Review Name",
+ "Account": "Account",
+ "Location": "Location",
+ "Post Type": "Post Type",
+ "Post Text": "Post Text",
+ "Photo URL": "Photo URL",
+ "Language Code": "Language Code",
+ "Alert Type": "Alert Type",
+ "Title": "Title",
+ "Start Date": "Start Date",
+ "Start Time": "Start Time",
+ "End Date": "End Date",
+ "End Time": "End Time",
+ "Coupon Code": "Coupon Code",
+ "Redeem Online URL": "Redeem Online URL",
+ "Terms and Conditions": "Terms and Conditions",
+ "Button Type": "Button Type",
+ "Button Link": "Button Link",
+ "Publish At": "Publish At",
+ "Maximum Results": "Maximum Results",
+ "Post ID": "Post ID",
+ "Review ID": "Review ID",
"Comment": "Comment",
+ "Account ID": "Account ID",
+ "Location ID": "Location ID",
+ "Website": "Website",
+ "Labels": "Labels",
+ "Store Code": "Store Code",
+ "Order By": "Order By",
+ "Media ID": "Media ID",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body Type": "Body Type",
"Body": "Body",
- "Response is Binary ?": "Response is Binary ?",
- "No Error on Failure": "No Error on Failure",
- "Timeout (in seconds)": "Timeout (in seconds)",
+ "Response is Binary": "Response is Binary",
+ "Return Error as Output": "Return Error as Output",
+ "Timeout": "Timeout",
"Follow redirects": "Follow redirects",
- "You can find the review name from new review trigger": "You can find the review name from new review trigger",
- "Comment to be added to the review": "Comment to be added to the review",
+ "The Business Profile account that manages the location.": "The Business Profile account that manages the location.",
+ "The business listing on Google Search and Maps.": "The business listing on Google Search and Maps.",
+ "A public image link. Google must open it without a login.": "A public image link. Google must open it without a login.",
+ "Language of the post text, like en or en-GB.": "Language of the post text, like en or en-GB.",
+ "Required for Alert posts.": "Required for Alert posts.",
+ "Required for Event and Offer posts, with both dates.": "Required for Event and Offer posts, with both dates.",
+ "24-hour clock, location time zone.": "24-hour clock, location time zone.",
+ "Required for every button except Call Now, which dials the location.": "Required for every button except Call Now, which dials the location.",
+ "Leave empty to publish now.": "Leave empty to publish now.",
+ "Stop after this many posts. Default 100.": "Stop after this many posts. Default 100.",
+ "Paste the whole name field from Create Post or List Posts.": "Paste the whole name field from Create Post or List Posts.",
+ "Leave empty to keep the current text.": "Leave empty to keep the current text.",
+ "Replaces every photo on the post. Must open without a login.": "Replaces every photo on the post. Must open without a login.",
+ "Replaces the whole event, so fill in every field you want kept.": "Replaces the whole event, so fill in every field you want kept.",
+ "Replaces the whole offer, so fill in every field you want kept.": "Replaces the whole offer, so fill in every field you want kept.",
+ "Choosing a type replaces the current button.": "Choosing a type replaces the current button.",
+ "Reschedule the post to a future time.": "Reschedule the post to a future time.",
+ "Paste the whole name field from the New Review trigger.": "Paste the whole name field from the New Review trigger.",
+ "Shown publicly under the review.": "Shown publicly under the review.",
+ "Stop after this many items. Larger values are fetched over several requests.": "Stop after this many items. Larger values are fetched over several requests.",
+ "The account id, e.g. 123 or accounts/123. Get it from the name field returned by List Accounts (list-accounts).": "The account id, e.g. 123 or accounts/123. Get it from the name field returned by List Accounts (list-accounts).",
+ "The location id, e.g. 456 or locations/456. Get it from the name field returned by List Locations (list-locations).": "The location id, e.g. 456 or locations/456. Get it from the name field returned by List Locations (list-locations).",
+ "The public website URL of the business.": "The public website URL of the business.",
+ "Internal labels for the location. Replaces the existing labels. Leave empty to keep the current labels; this action cannot clear them.": "Internal labels for the location. Replaces the existing labels. Leave empty to keep the current labels; this action cannot clear them.",
+ "Your internal identifier for the location.": "Your internal identifier for the location.",
+ "Sort order. Google defaults to newest first when unset.": "Sort order. Google defaults to newest first when unset.",
+ "The media key: the last segment of the name field returned by List Media (list-media).": "The media key: the last segment of the name field returned by List Media (list-media).",
+ "The reviewId field returned by List Reviews (list-reviews), or the full review name.": "The reviewId field returned by List Reviews (list-reviews), or the full review name.",
+ "The reply text.": "The reply text.",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
+ "Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.",
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
+ "On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.",
+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).",
+ "Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.",
+ "Standard": "Standard",
+ "Event": "Event",
+ "Offer": "Offer",
+ "Alert": "Alert",
+ "COVID-19": "COVID-19",
+ "Book": "Book",
+ "Order Online": "Order Online",
+ "Shop": "Shop",
+ "Learn More": "Learn More",
+ "Sign Up": "Sign Up",
+ "Call Now": "Call Now",
+ "Newest first": "Newest first",
+ "Lowest rating first": "Lowest rating first",
+ "Highest rating first": "Highest rating first",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
- "None": "None",
- "JSON": "JSON",
- "Form Data": "Form Data",
- "Raw": "Raw",
"New Review": "New Review",
- "Triggers when there is new review": "Triggers when there is new review",
- "Account": "Account",
- "Location": "Location",
- "List Accounts": "List Accounts",
- "Lists the Business Profile accounts the connected user can access.": "Lists the Business Profile accounts the connected user can access.",
- "List Locations": "List Locations",
- "Lists the business locations of an account.": "Lists the business locations of an account.",
- "Get Location": "Get Location",
- "Gets the details of a business location.": "Gets the details of a business location.",
- "Update Location": "Update Location",
- "Updates the website, labels or store code of a business location.": "Updates the website, labels or store code of a business location.",
- "Website": "Website",
- "The public website URL of the business.": "The public website URL of the business.",
- "Labels": "Labels",
- "Store Code": "Store Code",
- "Your internal identifier for the location.": "Your internal identifier for the location.",
- "List Reviews": "List Reviews",
- "Lists the customer reviews of a location.": "Lists the customer reviews of a location.",
- "Order By": "Order By",
- "Sort order. Google defaults to newest first when unset.": "Sort order. Google defaults to newest first when unset.",
- "Newest first": "Newest first",
- "Lowest rating first": "Lowest rating first",
- "Highest rating first": "Highest rating first",
- "Get Location Verification State": "Get Location Verification State",
- "Gets whether a location is verified and can publish changes.": "Gets whether a location is verified and can publish changes.",
- "List Media": "List Media",
- "Lists the photos and videos of a location.": "Lists the photos and videos of a location.",
- "Get Media": "Get Media",
- "Gets one photo or video of a location.": "Gets one photo or video of a location.",
- "Media ID": "Media ID",
- "The media key: the last segment of the name field returned by List Media (list-media).": "The media key: the last segment of the name field returned by List Media (list-media).",
- "Get Review": "Get Review",
- "Gets one customer review of a location.": "Gets one customer review of a location.",
- "Reply to Review": "Reply to Review",
- "Creates or replaces the owner reply to a review.": "Creates or replaces the owner reply to a review.",
- "The reply text.": "The reply text.",
- "Delete Review Reply": "Delete Review Reply",
- "Deletes the owner reply to a review.": "Deletes the owner reply to a review.",
- "Account ID": "Account ID",
- "The account id, e.g. 123 or accounts/123. Get it from the name field returned by List Accounts (list-accounts).": "The account id, e.g. 123 or accounts/123. Get it from the name field returned by List Accounts (list-accounts).",
- "Location ID": "Location ID",
- "The location id, e.g. 456 or locations/456. Get it from the name field returned by List Locations (list-locations).": "The location id, e.g. 456 or locations/456. Get it from the name field returned by List Locations (list-locations).",
- "Review ID": "Review ID",
- "The reviewId field returned by List Reviews (list-reviews), or the full review name.": "The reviewId field returned by List Reviews (list-reviews), or the full review name.",
- "Maximum Results": "Maximum Results",
- "Stop after this many items. Larger values are fetched over several requests.": "Stop after this many items. Larger values are fetched over several requests.",
- "Internal labels for the location. Replaces the existing labels. Leave empty to keep the current labels; this action cannot clear them.": "Internal labels for the location. Replaces the existing labels. Leave empty to keep the current labels; this action cannot clear them.",
- "Updates selected fields of a Google Business Profile location; only the fields you supply are changed and everything else is left untouched. Website is public and appears on Google Maps and Search, so change it only when the user explicitly asks. Labels replaces the whole label set, so include every label you want to keep; an empty list is ignored and cannot clear them. Store Code is internal. Empty text fields are ignored. Description, phone, hours, address and categories cannot be edited here. Safe to repeat with the same values.": "Updates selected fields of a Google Business Profile location; only the fields you supply are changed and everything else is left untouched. Website is public and appears on Google Maps and Search, so change it only when the user explicitly asks. Labels replaces the whole label set, so include every label you want to keep; an empty list is ignored and cannot clear them. Store Code is internal. Empty text fields are ignored. Description, phone, hours, address and categories cannot be edited here. Safe to repeat with the same values."
+ "Triggers when a customer posts a new review on the location.": "Triggers when a customer posts a new review on the location."
}
diff --git a/packages/pieces/community/google-my-business/src/i18n/zh.json b/packages/pieces/community/google-my-business/src/i18n/zh.json
index e9cfaec127f..bf68c40e1da 100644
--- a/packages/pieces/community/google-my-business/src/i18n/zh.json
+++ b/packages/pieces/community/google-my-business/src/i18n/zh.json
@@ -32,5 +32,46 @@
"New Review": "New Review",
"Triggers when there is new review": "Triggers when there is new review",
"Account": "Account",
- "Location": "Location"
+ "Location": "Location",
+ "Publish posts and reply to reviews on Google Business Profile.": "在 Google 商家资料上发布帖子并回复评价。",
+ "Publish an update, event, offer or alert on a location.": "在某个营业地点发布动态、活动、优惠或提醒。",
+ "List the posts published on a location.": "列出某个营业地点已发布的帖子。",
+ "Get one post by its ID.": "按 ID 获取一条帖子。",
+ "Change the text, photo, button or details of a post.": "更改帖子的文字、照片、按钮或详细信息。",
+ "Delete a post from its location.": "从所属营业地点删除一条帖子。",
+ "Reply to a review, or replace the reply already posted.": "回复评价,或替换已发布的回复。",
+ "Post Text": "帖子文字",
+ "Language Code": "语言代码",
+ "Alert Type": "提醒类型",
+ "Title": "标题",
+ "Terms and Conditions": "条款和条件",
+ "Button Type": "按钮类型",
+ "Button Link": "按钮链接",
+ "Publish At": "发布时间",
+ "Post ID": "帖子 ID",
+ "Review ID": "评价 ID",
+ "The Business Profile account that manages the location.": "管理该营业地点的商家资料账号。",
+ "The business listing on Google Search and Maps.": "在 Google 搜索和地图上显示的商家信息。",
+ "A public image link. Google must open it without a login.": "公开的图片链接。Google 必须无需登录即可打开。",
+ "Language of the post text, like en or en-GB.": "帖子文字的语言,例如 en 或 en-GB。",
+ "Required for Alert posts.": "提醒类帖子必填。",
+ "Required for Event and Offer posts, with both dates.": "活动和优惠类帖子必填,并需填写两个日期。",
+ "24-hour clock, location time zone.": "24 小时制,营业地点所在时区。",
+ "Required for every button except Call Now, which dials the location.": "除 Call Now(拨打营业地点电话)外,所有按钮都必填。",
+ "Leave empty to publish now.": "留空则立即发布。",
+ "Stop after this many posts. Default 100.": "达到此数量后停止。默认 100。",
+ "Paste the whole name field from Create Post or List Posts.": "粘贴 Create Post 或 List Posts 返回的完整 name 字段。",
+ "Leave empty to keep the current text.": "留空则保留当前文字。",
+ "Replaces every photo on the post. Must open without a login.": "替换帖子上的所有照片。必须无需登录即可打开。",
+ "Replaces the whole event, so fill in every field you want kept.": "会替换整个活动,请填写所有要保留的字段。",
+ "Replaces the whole offer, so fill in every field you want kept.": "会替换整个优惠,请填写所有要保留的字段。",
+ "Choosing a type replaces the current button.": "选择类型会替换当前按钮。",
+ "Reschedule the post to a future time.": "将帖子改期到以后的时间。",
+ "Paste the whole name field from the New Review trigger.": "粘贴 New Review 触发器返回的完整 name 字段。",
+ "Shown publicly under the review.": "公开显示在评价下方。",
+ "Standard": "标准",
+ "Event": "活动",
+ "Offer": "优惠",
+ "Alert": "提醒",
+ "Triggers when a customer posts a new review on the location.": "当客户在营业地点发布新评价时触发。"
}
\ No newline at end of file
diff --git a/packages/pieces/community/google-my-business/src/index.ts b/packages/pieces/community/google-my-business/src/index.ts
index b4e5f18d5e7..f65cbaa95bb 100644
--- a/packages/pieces/community/google-my-business/src/index.ts
+++ b/packages/pieces/community/google-my-business/src/index.ts
@@ -34,7 +34,7 @@ export const googleAuth = PieceAuth.OAuth2({
export const googleBusiness = createPiece({
auth: googleAuth,
displayName: 'Google My Business',
- description: 'Manage your business on Google',
+ description: 'Publish posts and reply to reviews on Google Business Profile.',
logoUrl: 'https://cdn.activepieces.com/pieces/google-business.png',
authors: ["kishanprmr","MoShizzle","abuaboud"],
diff --git a/packages/pieces/community/google-my-business/src/lib/actions/create-post.ts b/packages/pieces/community/google-my-business/src/lib/actions/create-post.ts
index d84154a490a..33712d39ffd 100644
--- a/packages/pieces/community/google-my-business/src/lib/actions/create-post.ts
+++ b/packages/pieces/community/google-my-business/src/lib/actions/create-post.ts
@@ -10,7 +10,7 @@ export const createPost = createAction({
outputSchema: createPostActionOutputSchema,
classification: 'WRITE',
displayName: 'Create Post',
- description: 'Creates a post for a specified location.',
+ description: 'Publish an update, event, offer or alert on a location.',
audience: 'both',
aiMetadata: {
description:
@@ -18,94 +18,137 @@ export const createPost = createAction({
idempotent: false,
},
auth: googleAuth,
+ propertyGroups: [
+ {
+ key: 'business',
+ display: 'section',
+ label: 'Business',
+ icon: 'location',
+ props: ['account', 'location'],
+ },
+ {
+ key: 'content',
+ display: 'section',
+ label: 'Content',
+ icon: 'text',
+ props: ['topicType', 'summary', 'mediaSourceUrl', 'languageCode', 'alertType'],
+ },
+ {
+ key: 'event',
+ display: 'section',
+ label: 'Event and Offer Details',
+ icon: 'calendar',
+ props: ['eventTitle', 'eventStartDate', 'eventStartTime', 'eventEndDate', 'eventEndTime'],
+ },
+ {
+ key: 'offer',
+ display: 'section',
+ label: 'Offer Details',
+ icon: 'tag',
+ props: ['offerCouponCode', 'offerRedeemOnlineUrl', 'offerTermsConditions'],
+ },
+ {
+ key: 'button',
+ display: 'section',
+ label: 'Button',
+ icon: 'send',
+ props: ['callToActionType', 'callToActionUrl'],
+ },
+ ],
props: {
account: googleBusinessCommon.account,
location: googleBusinessCommon.location,
topicType: Property.StaticDropdown({
displayName: 'Post Type',
- description: 'The kind of post to publish.',
required: true,
defaultValue: 'STANDARD',
+ display: 'cards',
options: { disabled: false, options: localPostUtils.topicOptions },
}),
summary: Property.LongText({
- displayName: 'Summary',
- description: 'The body text of the post.',
+ displayName: 'Post Text',
+ placeholder: 'We are open late this Friday!',
required: true,
}),
- languageCode: Property.ShortText({
- displayName: 'Language Code',
- description: 'BCP 47 language code of the post text, for example `en` or `en-GB`.',
- required: true,
- defaultValue: 'en',
- }),
- scheduledTime: Property.DateTime({
- displayName: 'Publish At',
- description:
- 'Leave empty to publish immediately. Set a future time to schedule the post, which keeps it off the listing until then.',
- required: false,
- }),
mediaSourceUrl: Property.ShortText({
displayName: 'Photo URL',
- description:
- 'Publicly accessible URL of a photo to attach. Google fetches the image, so it must not require authentication.',
+ description: 'A public image link. Google must open it without a login.',
+ placeholder: 'https://example.com/photo.jpg',
required: false,
}),
- callToActionType: Property.StaticDropdown({
- displayName: 'Call To Action',
- description: 'Optional button shown on the post.',
- required: false,
- options: { disabled: false, options: localPostUtils.callToActionOptions },
+ languageCode: Property.ShortText({
+ displayName: 'Language Code',
+ description: 'Language of the post text, like en or en-GB.',
+ required: true,
+ defaultValue: 'en',
}),
- callToActionUrl: Property.ShortText({
- displayName: 'Call To Action URL',
- description:
- 'Where the button links to. Required for every call to action except Call Now, which uses the location phone number.',
+ alertType: Property.StaticDropdown({
+ displayName: 'Alert Type',
+ description: 'Required for Alert posts.',
required: false,
+ options: { disabled: false, options: localPostUtils.alertTypeOptions },
}),
eventTitle: Property.ShortText({
- displayName: 'Event / Offer Title',
- description: 'Required when the post type is Event or Offer.',
+ displayName: 'Title',
+ description: 'Required for Event and Offer posts, with both dates.',
required: false,
}),
eventStartDate: Property.ShortText({
displayName: 'Start Date',
- description: 'Required for Event and Offer posts, as `YYYY-MM-DD`.',
+ placeholder: '2026-12-31',
+ width: 'half',
required: false,
}),
eventStartTime: Property.ShortText({
displayName: 'Start Time',
- description:
- 'Optional time of day as `HH:mm` in 24-hour form. Interpreted in the location time zone, so no offset is sent.',
+ description: '24-hour clock, location time zone.',
+ placeholder: '09:00',
+ width: 'half',
required: false,
}),
eventEndDate: Property.ShortText({
displayName: 'End Date',
- description: 'Required for Event and Offer posts, as `YYYY-MM-DD`.',
+ placeholder: '2026-12-31',
+ width: 'half',
required: false,
}),
eventEndTime: Property.ShortText({
displayName: 'End Time',
- description: 'Optional time of day as `HH:mm` in 24-hour form.',
+ description: '24-hour clock, location time zone.',
+ placeholder: '17:00',
+ width: 'half',
required: false,
}),
offerCouponCode: Property.ShortText({
displayName: 'Coupon Code',
+ placeholder: 'SAVE20',
required: false,
}),
offerRedeemOnlineUrl: Property.ShortText({
displayName: 'Redeem Online URL',
+ placeholder: 'https://example.com/offer',
required: false,
}),
offerTermsConditions: Property.LongText({
- displayName: 'Terms And Conditions',
+ displayName: 'Terms and Conditions',
required: false,
}),
- alertType: Property.StaticDropdown({
- displayName: 'Alert Type',
- description: 'Required when the post type is Alert.',
+ callToActionType: Property.StaticDropdown({
+ displayName: 'Button Type',
+ required: false,
+ options: { disabled: false, options: localPostUtils.callToActionOptions },
+ }),
+ callToActionUrl: Property.ShortText({
+ displayName: 'Button Link',
+ description: 'Required for every button except Call Now, which dials the location.',
+ placeholder: 'https://example.com',
+ required: false,
+ }),
+ scheduledTime: Property.DateTime({
+ displayName: 'Publish At',
+ description: 'Leave empty to publish now.',
+ advanced: true,
required: false,
- options: { disabled: false, options: localPostUtils.alertTypeOptions },
}),
},
async run(ctx) {
diff --git a/packages/pieces/community/google-my-business/src/lib/actions/create-reply.ts b/packages/pieces/community/google-my-business/src/lib/actions/create-reply.ts
index 2ef5c1cdafd..7c551b79968 100644
--- a/packages/pieces/community/google-my-business/src/lib/actions/create-reply.ts
+++ b/packages/pieces/community/google-my-business/src/lib/actions/create-reply.ts
@@ -10,18 +10,20 @@ export const createReply = createAction({
name: 'create-reply',
classification: 'WRITE',
displayName: 'Create or Update Reply',
- description: 'Create or update a reply to a review if it already exists',
+ description: 'Reply to a review, or replace the reply already posted.',
audience: 'human',
aiMetadata: { description: 'Posts the business owner\'s reply to a specific Google Business Profile review, or overwrites the existing reply if one is already present. Use to respond to customer reviews; safe to repeat since it upserts on the review name. Requires the full review resource name in the form accounts/{account}/locations/{location}/reviews/{review}.', idempotent: true },
props: {
reviewName: Property.ShortText({
- displayName: 'Review Name',
- description: 'You can find the review name from new review trigger',
+ displayName: 'Review ID',
+ description: 'Paste the whole name field from the New Review trigger.',
+ placeholder: 'accounts/123/locations/456/reviews/789',
required: true,
}),
comment: Property.LongText({
displayName: 'Comment',
- description: 'Comment to be added to the review',
+ description: 'Shown publicly under the review.',
+ placeholder: 'Thanks for visiting us!',
required: true,
}),
},
diff --git a/packages/pieces/community/google-my-business/src/lib/actions/delete-post.ts b/packages/pieces/community/google-my-business/src/lib/actions/delete-post.ts
index 96abedb49a3..698c119d353 100644
--- a/packages/pieces/community/google-my-business/src/lib/actions/delete-post.ts
+++ b/packages/pieces/community/google-my-business/src/lib/actions/delete-post.ts
@@ -8,7 +8,7 @@ export const deletePost = createAction({
name: 'delete-post',
classification: 'WRITE',
displayName: 'Delete Post',
- description: 'Deletes a post from a specified location.',
+ description: 'Delete a post from its location.',
audience: 'both',
aiMetadata: {
description:
@@ -18,9 +18,9 @@ export const deletePost = createAction({
auth: googleAuth,
props: {
postName: Property.ShortText({
- displayName: 'Post Name',
- description:
- 'Full resource name of the post, as `accounts/{account}/locations/{location}/localPosts/{post}`.',
+ displayName: 'Post ID',
+ description: 'Paste the whole name field from Create Post or List Posts.',
+ placeholder: 'accounts/123/locations/456/localPosts/789',
required: true,
}),
},
diff --git a/packages/pieces/community/google-my-business/src/lib/actions/get-post.ts b/packages/pieces/community/google-my-business/src/lib/actions/get-post.ts
index d7a2b78dbb2..fa8f615ba5b 100644
--- a/packages/pieces/community/google-my-business/src/lib/actions/get-post.ts
+++ b/packages/pieces/community/google-my-business/src/lib/actions/get-post.ts
@@ -10,7 +10,7 @@ export const getPost = createAction({
outputSchema: getPostActionOutputSchema,
classification: 'READ',
displayName: 'Get Post',
- description: 'Retrieves a single post by its resource name.',
+ description: 'Get one post by its ID.',
audience: 'both',
aiMetadata: {
description:
@@ -20,9 +20,9 @@ export const getPost = createAction({
auth: googleAuth,
props: {
postName: Property.ShortText({
- displayName: 'Post Name',
- description:
- 'Full resource name of the post, as `accounts/{account}/locations/{location}/localPosts/{post}`. List Posts and Create Post both return it as `name`.',
+ displayName: 'Post ID',
+ description: 'Paste the whole name field from Create Post or List Posts.',
+ placeholder: 'accounts/123/locations/456/localPosts/789',
required: true,
}),
},
diff --git a/packages/pieces/community/google-my-business/src/lib/actions/list-posts.ts b/packages/pieces/community/google-my-business/src/lib/actions/list-posts.ts
index 03863146ee0..30301242726 100644
--- a/packages/pieces/community/google-my-business/src/lib/actions/list-posts.ts
+++ b/packages/pieces/community/google-my-business/src/lib/actions/list-posts.ts
@@ -11,7 +11,7 @@ export const listPosts = createAction({
outputSchema: listPostsActionOutputSchema,
classification: 'READ',
displayName: 'List Posts',
- description: 'Lists the posts of a specified location.',
+ description: 'List the posts published on a location.',
audience: 'both',
aiMetadata: {
description:
@@ -24,10 +24,13 @@ export const listPosts = createAction({
location: googleBusinessCommon.location,
maxResults: Property.Number({
displayName: 'Maximum Results',
- description:
- 'Stop after this many posts. Google returns at most 100 per request, so larger values are fetched over several requests.',
+ description: 'Stop after this many posts. Default 100.',
required: false,
defaultValue: 100,
+ display: 'stepper',
+ min: 1,
+ max: 1000,
+ step: 1,
}),
},
async run(ctx) {
diff --git a/packages/pieces/community/google-my-business/src/lib/actions/update-post.ts b/packages/pieces/community/google-my-business/src/lib/actions/update-post.ts
index e8f1301305c..67fbaef5a60 100644
--- a/packages/pieces/community/google-my-business/src/lib/actions/update-post.ts
+++ b/packages/pieces/community/google-my-business/src/lib/actions/update-post.ts
@@ -10,7 +10,7 @@ export const updatePost = createAction({
outputSchema: updatePostActionOutputSchema,
classification: 'WRITE',
displayName: 'Update Post',
- description: 'Updates a post for a specified location.',
+ description: 'Change the text, photo, button or details of a post.',
audience: 'both',
aiMetadata: {
description:
@@ -18,78 +18,122 @@ export const updatePost = createAction({
idempotent: true,
},
auth: googleAuth,
+ propertyGroups: [
+ {
+ key: 'content',
+ display: 'section',
+ label: 'Content',
+ icon: 'text',
+ props: ['postName', 'summary', 'mediaSourceUrl', 'languageCode'],
+ },
+ {
+ key: 'event',
+ display: 'section',
+ label: 'Event and Offer Details',
+ icon: 'calendar',
+ props: ['eventTitle', 'eventStartDate', 'eventStartTime', 'eventEndDate', 'eventEndTime'],
+ },
+ {
+ key: 'offer',
+ display: 'section',
+ label: 'Offer Details',
+ icon: 'tag',
+ props: ['offerCouponCode', 'offerRedeemOnlineUrl', 'offerTermsConditions'],
+ },
+ {
+ key: 'button',
+ display: 'section',
+ label: 'Button',
+ icon: 'send',
+ props: ['callToActionType', 'callToActionUrl'],
+ },
+ ],
props: {
postName: Property.ShortText({
- displayName: 'Post Name',
- description:
- 'Full resource name of the post, as `accounts/{account}/locations/{location}/localPosts/{post}`.',
+ displayName: 'Post ID',
+ description: 'Paste the whole name field from Create Post or List Posts.',
+ placeholder: 'accounts/123/locations/456/localPosts/789',
required: true,
}),
summary: Property.LongText({
- displayName: 'Summary',
- description: 'New body text. Leave empty to keep the current text.',
- required: false,
- }),
- languageCode: Property.ShortText({
- displayName: 'Language Code',
- description: 'BCP 47 language code, for example `en`.',
- required: false,
- }),
- scheduledTime: Property.DateTime({
- displayName: 'Publish At',
- description: 'Reschedule the post to a future time.',
+ displayName: 'Post Text',
+ description: 'Leave empty to keep the current text.',
required: false,
}),
mediaSourceUrl: Property.ShortText({
displayName: 'Photo URL',
- description:
- 'Publicly accessible photo URL. Setting this replaces every photo already on the post.',
+ description: 'Replaces every photo on the post. Must open without a login.',
+ placeholder: 'https://example.com/photo.jpg',
required: false,
}),
- callToActionType: Property.StaticDropdown({
- displayName: 'Call To Action',
- required: false,
- options: { disabled: false, options: localPostUtils.callToActionOptions },
- }),
- callToActionUrl: Property.ShortText({
- displayName: 'Call To Action URL',
- description: 'Required whenever a call to action other than Call Now is set.',
+ languageCode: Property.ShortText({
+ displayName: 'Language Code',
+ description: 'Language of the post text, like en or en-GB.',
+ placeholder: 'en',
required: false,
}),
eventTitle: Property.ShortText({
- displayName: 'Event / Offer Title',
+ displayName: 'Title',
+ description: 'Replaces the whole event, so fill in every field you want kept.',
required: false,
}),
eventStartDate: Property.ShortText({
displayName: 'Start Date',
- description: '`YYYY-MM-DD`. Must be given together with an End Date.',
+ placeholder: '2026-12-31',
+ width: 'half',
required: false,
}),
eventStartTime: Property.ShortText({
displayName: 'Start Time',
- description: '`HH:mm` in 24-hour form.',
+ description: '24-hour clock, location time zone.',
+ placeholder: '09:00',
+ width: 'half',
required: false,
}),
eventEndDate: Property.ShortText({
displayName: 'End Date',
- description: '`YYYY-MM-DD`. Must be given together with a Start Date.',
+ placeholder: '2026-12-31',
+ width: 'half',
required: false,
}),
eventEndTime: Property.ShortText({
displayName: 'End Time',
- description: '`HH:mm` in 24-hour form.',
+ description: '24-hour clock, location time zone.',
+ placeholder: '17:00',
+ width: 'half',
required: false,
}),
offerCouponCode: Property.ShortText({
displayName: 'Coupon Code',
+ description: 'Replaces the whole offer, so fill in every field you want kept.',
+ placeholder: 'SAVE20',
required: false,
}),
offerRedeemOnlineUrl: Property.ShortText({
displayName: 'Redeem Online URL',
+ placeholder: 'https://example.com/offer',
required: false,
}),
offerTermsConditions: Property.LongText({
- displayName: 'Terms And Conditions',
+ displayName: 'Terms and Conditions',
+ required: false,
+ }),
+ callToActionType: Property.StaticDropdown({
+ displayName: 'Button Type',
+ description: 'Choosing a type replaces the current button.',
+ required: false,
+ options: { disabled: false, options: localPostUtils.callToActionOptions },
+ }),
+ callToActionUrl: Property.ShortText({
+ displayName: 'Button Link',
+ description: 'Required for every button except Call Now, which dials the location.',
+ placeholder: 'https://example.com',
+ required: false,
+ }),
+ scheduledTime: Property.DateTime({
+ displayName: 'Publish At',
+ description: 'Reschedule the post to a future time.',
+ advanced: true,
required: false,
}),
},
diff --git a/packages/pieces/community/google-my-business/src/lib/common/client.ts b/packages/pieces/community/google-my-business/src/lib/common/client.ts
index 829d4e9e88b..ace6deb6077 100644
--- a/packages/pieces/community/google-my-business/src/lib/common/client.ts
+++ b/packages/pieces/community/google-my-business/src/lib/common/client.ts
@@ -4,6 +4,7 @@ import { isNil, Property } from '@activepieces/pieces-framework';
export const gmbApi = {
request,
paginate,
+ dropdownErrorPlaceholder,
locationReadMask:
'name,title,storeCode,languageCode,phoneNumbers,categories,storefrontAddress,websiteUri,regularHours,specialHours,serviceArea,labels,latlng,openInfo,metadata,profile',
resourceNames: { accountName, v1Location, v4Location, childId, reviewUrl },
@@ -87,8 +88,7 @@ function buildErrorMessage({ status, body }: { status: number; body: unknown }):
const vendorMessage = vendor.message ?? 'Unknown error';
const suffix = `(status ${status}${isNil(vendor.status) ? '' : ` ${vendor.status}`}): ${vendorMessage}`;
if (status === 403) {
- const disabled = vendor.reasons.some((reason) => reason === 'SERVICE_DISABLED' || reason === 'accessNotConfigured');
- if (disabled) {
+ if (vendor.reasons.some(isServiceDisabledReason)) {
return `This Business Profile API is not enabled for the connection's Google project ${suffix}`;
}
return `The connected Google account does not manage this account or location ${suffix}`;
@@ -105,6 +105,21 @@ function buildErrorMessage({ status, body }: { status: number; body: unknown }):
return `Google Business Profile request failed ${suffix}`;
}
+function dropdownErrorPlaceholder({ error, fallback }: { error: unknown; fallback: string }): string {
+ if (!(error instanceof HttpError) || error.response.status !== 403) {
+ return fallback;
+ }
+ const vendor = readVendorError(error.response.body);
+ if (vendor.reasons.some(isServiceDisabledReason)) {
+ return 'Enable the Business Profile APIs first';
+ }
+ return 'No access to Business Profile';
+}
+
+function isServiceDisabledReason(reason: string): boolean {
+ return reason === 'SERVICE_DISABLED' || reason === 'accessNotConfigured';
+}
+
function readVendorError(body: unknown): VendorError {
const empty: VendorError = { message: undefined, status: undefined, reasons: [] };
if (!isRecord(body) || !isRecord(body['error'])) {
diff --git a/packages/pieces/community/google-my-business/src/lib/common/common.ts b/packages/pieces/community/google-my-business/src/lib/common/common.ts
index 45df80b613d..8015c48ae7b 100644
--- a/packages/pieces/community/google-my-business/src/lib/common/common.ts
+++ b/packages/pieces/community/google-my-business/src/lib/common/common.ts
@@ -1,7 +1,8 @@
import {
Property,
- OAuth2PropertyValue,
DropdownOption,
+ isNil,
+ tryCatch,
} from '@activepieces/pieces-framework';
import {
httpClient,
@@ -10,109 +11,180 @@ import {
QueryParams,
} from '@activepieces/pieces-common';
import { googleAuth } from '../..';
+import { gmbApi } from './client';
export const googleBusinessCommon = {
account: Property.Dropdown({
displayName: 'Account',
+ description: 'The Business Profile account that manages the location.',
required: true,
auth: googleAuth,
refreshers: [],
- options: async (propsValue) => {
- if (!propsValue['auth']) {
+ options: async ({ auth }) => {
+ if (isNil(auth)) {
return {
disabled: true,
options: [],
- placeholder: 'Please authenticate first',
+ placeholder: 'Please connect your account first',
+ };
+ }
+ const accessToken = auth.access_token;
+ const result = await tryCatch(() => listAccountOptions(accessToken));
+ if (result.error !== null) {
+ return {
+ disabled: true,
+ options: [],
+ placeholder: gmbApi.dropdownErrorPlaceholder({
+ error: result.error,
+ fallback: 'Could not load accounts',
+ }),
+ };
+ }
+ if (result.data.length === 0) {
+ return {
+ disabled: false,
+ options: [],
+ placeholder: 'No Business Profile accounts found',
};
}
- const authProp: OAuth2PropertyValue = propsValue[
- 'auth'
- ] as OAuth2PropertyValue;
- const response = await httpClient.sendRequest<{
- accounts: { accountName: string; name: string }[];
- }>({
- url: 'https://mybusinessbusinessinformation.googleapis.com/v1/accounts',
- method: HttpMethod.GET,
- authentication: {
- type: AuthenticationType.BEARER_TOKEN,
- token: authProp.access_token,
- },
- });
-
return {
disabled: false,
- options: response.body.accounts.map(
- (location: { accountName: string; name: string }) => {
- return {
- label: location.accountName,
- value: location.name,
- };
- }
- ),
+ options: result.data,
};
},
}),
location: Property.Dropdown({
displayName: 'Location',
- auth: googleAuth,
+ description: 'The business listing on Google Search and Maps.',
+ auth: googleAuth,
required: true,
refreshers: ['account'],
- options: async (propsValue) => {
- if (!propsValue['auth'] || !propsValue['account']) {
+ options: async ({ auth, account }) => {
+ if (isNil(auth)) {
return {
disabled: true,
options: [],
- placeholder: 'Please select account first',
+ placeholder: 'Please connect your account first',
};
}
- const account = propsValue['account'];
- const authProp: OAuth2PropertyValue = propsValue[
- 'auth'
- ] as OAuth2PropertyValue;
+ if (typeof account !== 'string' || account.length === 0) {
+ return {
+ disabled: true,
+ options: [],
+ placeholder: 'Please select an account first',
+ };
+ }
+ const accessToken = auth.access_token;
+ const accountName = account;
+ const result = await tryCatch(() =>
+ listLocationOptions({ accessToken, account: accountName })
+ );
+ if (result.error !== null) {
+ return {
+ disabled: true,
+ options: [],
+ placeholder: gmbApi.dropdownErrorPlaceholder({
+ error: result.error,
+ fallback: 'Could not load locations',
+ }),
+ };
+ }
+ if (result.data.length === 0) {
+ return {
+ disabled: false,
+ options: [],
+ placeholder: 'No locations found in this account',
+ };
+ }
+ return {
+ disabled: false,
+ options: result.data,
+ };
+ },
+ }),
+};
- const options: DropdownOption<string>[] = [];
+async function listAccountOptions(
+ accessToken: string
+): Promise<DropdownOption<string>[]> {
+ const options: DropdownOption<string>[] = [];
+ let nextPageToken: string | undefined;
- let nextPageToken: string | undefined;
+ do {
+ const qs: QueryParams = {
+ pageSize: '20',
+ };
+ if (nextPageToken) {
+ qs.pageToken = nextPageToken;
+ }
- do {
- const qs: QueryParams = {
- pageSize: '100',
- read_mask: 'title,name',
- };
- if (nextPageToken) {
- qs.pageToken = nextPageToken;
- }
+ const response = await httpClient.sendRequest<{
+ accounts?: { accountName: string; name: string }[];
+ nextPageToken?: string;
+ }>({
+ url: `${gmbApi.hosts.accountManagement}/accounts`,
+ queryParams: qs,
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: accessToken,
+ },
+ });
- const response = await httpClient.sendRequest<{
- locations: { title: string; name: string }[];
- nextPageToken?: string;
- }>({
- url: `https://mybusinessbusinessinformation.googleapis.com/v1/${account}/locations`,
- queryParams: qs,
- method: HttpMethod.GET,
- authentication: {
- type: AuthenticationType.BEARER_TOKEN,
- token: authProp.access_token,
- },
- });
+ nextPageToken = response.body.nextPageToken;
+ for (const account of response.body.accounts ?? []) {
+ options.push({
+ label: account.accountName,
+ value: account.name,
+ });
+ }
+ } while (nextPageToken);
- nextPageToken = response.body.nextPageToken;
- if (response.body.locations && Array.isArray(response.body.locations)) {
+ return options;
+}
- for (const location of response.body.locations) {
- options.push({
- label: location.title,
- value: location.name,
- });
- }
+async function listLocationOptions({
+ accessToken,
+ account,
+}: {
+ accessToken: string;
+ account: string;
+}): Promise<DropdownOption<string>[]> {
+ const options: DropdownOption<string>[] = [];
+ let nextPageToken: string | undefined;
- }
- } while (nextPageToken);
+ do {
+ const qs: QueryParams = {
+ pageSize: '100',
+ read_mask: 'title,name',
+ };
+ if (nextPageToken) {
+ qs.pageToken = nextPageToken;
+ }
- return {
- disabled: false,
- options,
- };
- },
- }),
-};
+ const response = await httpClient.sendRequest<{
+ locations?: { title?: string; name: string }[];
+ nextPageToken?: string;
+ }>({
+ url: `https://mybusinessbusinessinformation.googleapis.com/v1/${account}/locations`,
+ queryParams: qs,
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: accessToken,
+ },
+ });
+
+ nextPageToken = response.body.nextPageToken;
+ if (Array.isArray(response.body.locations)) {
+ for (const location of response.body.locations) {
+ options.push({
+ label: isNil(location.title) || location.title.length === 0 ? location.name : location.title,
+ value: location.name,
+ });
+ }
+ }
+ } while (nextPageToken);
+
+ return options;
+}
diff --git a/packages/pieces/community/google-my-business/src/lib/common/local-post.ts b/packages/pieces/community/google-my-business/src/lib/common/local-post.ts
index 8df39ad94b0..2bfbb17e430 100644
--- a/packages/pieces/community/google-my-business/src/lib/common/local-post.ts
+++ b/packages/pieces/community/google-my-business/src/lib/common/local-post.ts
@@ -80,17 +80,17 @@ function assertValid({
const needsSchedule = topicType === 'EVENT' || topicType === 'OFFER';
if (needsSchedule && (isNil(eventTitle) || isNil(eventStartDate) || isNil(eventEndDate))) {
throw new Error(
- 'Event and Offer posts require an Event / Offer Title, a Start Date and an End Date.',
+ 'Event and Offer posts need a Title, a Start Date and an End Date.',
);
}
if (topicType === 'ALERT' && isNil(alertType)) {
- throw new Error('Alert posts require an Alert Type.');
+ throw new Error('Alert posts need an Alert Type.');
}
if (!isNil(callToActionType) && callToActionType !== 'CALL' && isNil(callToActionUrl)) {
- throw new Error('A Call To Action URL is required for every call to action except Call Now.');
+ throw new Error('Add a Button Link for every button type except Call Now.');
}
if (!isNil(eventStartDate) !== !isNil(eventEndDate)) {
- throw new Error('A Start Date and an End Date must be given together.');
+ throw new Error('Fill in both the Start Date and the End Date.');
}
}
@@ -118,10 +118,10 @@ export const localPostUtils = {
eventEndTime: z.optional(z.string().check(z.regex(TIME_PATTERN))),
},
topicOptions: [
- { label: 'Standard', value: 'STANDARD' },
- { label: 'Event', value: 'EVENT' },
- { label: 'Offer', value: 'OFFER' },
- { label: 'Alert', value: 'ALERT' },
+ { label: 'Standard', value: 'STANDARD', icon: 'text' },
+ { label: 'Event', value: 'EVENT', icon: 'calendar' },
+ { label: 'Offer', value: 'OFFER', icon: 'tag' },
+ { label: 'Alert', value: 'ALERT', icon: 'send' },
],
callToActionOptions: [
{ label: 'Book', value: 'BOOK' },
diff --git a/packages/pieces/community/google-my-business/src/lib/triggers/new-review.ts b/packages/pieces/community/google-my-business/src/lib/triggers/new-review.ts
index 9130f579bb5..f09bcd64a69 100644
--- a/packages/pieces/community/google-my-business/src/lib/triggers/new-review.ts
+++ b/packages/pieces/community/google-my-business/src/lib/triggers/new-review.ts
@@ -19,7 +19,7 @@ export const newReview = createTrigger({
name: 'new_review',
classification: 'READ',
displayName: 'New Review',
- description: 'Triggers when there is new review',
+ description: 'Triggers when a customer posts a new review on the location.',
aiMetadata: {
description: 'Fires when a new customer review is posted for the selected Google Business Profile account and location. Each event represents one newly created review and can be used to react to incoming customer feedback.',
},
diff --git a/packages/pieces/community/google-my-business/test/common.test.ts b/packages/pieces/community/google-my-business/test/common.test.ts
new file mode 100644
index 00000000000..e26d7acaeeb
--- /dev/null
+++ b/packages/pieces/community/google-my-business/test/common.test.ts
@@ -0,0 +1,133 @@
+import { HttpError } from '@activepieces/pieces-common';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import '../src';
+import { googleBusinessCommon } from '../src/lib/common/common';
+
+const sendRequest = vi.fn();
+
+vi.mock('@activepieces/pieces-common', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('@activepieces/pieces-common')>();
+ return {
+ ...actual,
+ httpClient: { sendRequest: (...args: unknown[]) => sendRequest(...args) },
+ };
+});
+
+beforeEach(() => {
+ sendRequest.mockReset();
+});
+
+describe('account dropdown', () => {
+ it('asks for a connection when there is none', async () => {
+ expect(await loadOptions({ prop: googleBusinessCommon.account, propsValue: {} })).toEqual({
+ disabled: true,
+ options: [],
+ placeholder: 'Please connect your account first',
+ });
+ expect(sendRequest).not.toHaveBeenCalled();
+ });
+
+ it('lists accounts from Account Management across every page', async () => {
+ ok({ body: { accounts: [{ name: 'accounts/1', accountName: 'Main Street Bakery' }], nextPageToken: 'page-2' } });
+ ok({ body: { accounts: [{ name: 'accounts/2', accountName: 'Harbor Cafe' }] } });
+
+ expect(await loadOptions({ prop: googleBusinessCommon.account, propsValue: CONNECTED })).toEqual({
+ disabled: false,
+ options: [
+ { label: 'Main Street Bakery', value: 'accounts/1' },
+ { label: 'Harbor Cafe', value: 'accounts/2' },
+ ],
+ });
+ expect(sendRequest).toHaveBeenCalledTimes(2);
+ expect(request(0).url).toBe('https://mybusinessaccountmanagement.googleapis.com/v1/accounts');
+ expect(request(0).queryParams).toEqual({ pageSize: '20' });
+ expect(request(1).queryParams).toEqual({ pageSize: '20', pageToken: 'page-2' });
+ });
+
+ it('shows an empty state when the response has no accounts field', async () => {
+ ok({ body: {} });
+
+ expect(await loadOptions({ prop: googleBusinessCommon.account, propsValue: CONNECTED })).toEqual({
+ disabled: false,
+ options: [],
+ placeholder: 'No Business Profile accounts found',
+ });
+ });
+
+ it.each([
+ [{ status: 403, body: { error: { details: [{ reason: 'SERVICE_DISABLED' }] } } }, 'Enable the Business Profile APIs first'],
+ [{ status: 403, body: { error: { errors: [{ reason: 'accessNotConfigured' }] } } }, 'Enable the Business Profile APIs first'],
+ [{ status: 403, body: { error: { message: 'The caller does not have permission' } } }, 'No access to Business Profile'],
+ [{ status: 500, body: {} }, 'Could not load accounts'],
+ ])('turns a failed request into a short placeholder', async (failure, placeholder) => {
+ fail(failure);
+
+ expect(await loadOptions({ prop: googleBusinessCommon.account, propsValue: CONNECTED })).toEqual({
+ disabled: true,
+ options: [],
+ placeholder,
+ });
+ });
+});
+
+describe('location dropdown', () => {
+ it('asks for an account before loading locations', async () => {
+ expect(await loadOptions({ prop: googleBusinessCommon.location, propsValue: CONNECTED })).toEqual({
+ disabled: true,
+ options: [],
+ placeholder: 'Please select an account first',
+ });
+ expect(sendRequest).not.toHaveBeenCalled();
+ });
+
+ it('pages through locations and falls back to the name when a title is missing', async () => {
+ ok({ body: { locations: [{ name: 'locations/10', title: 'Downtown' }], nextPageToken: 'page-2' } });
+ ok({ body: { locations: [{ name: 'locations/11', title: '' }] } });
+
+ expect(
+ await loadOptions({ prop: googleBusinessCommon.location, propsValue: { ...CONNECTED, account: 'accounts/1' } }),
+ ).toEqual({
+ disabled: false,
+ options: [
+ { label: 'Downtown', value: 'locations/10' },
+ { label: 'locations/11', value: 'locations/11' },
+ ],
+ });
+ expect(request(0).url).toBe('https://mybusinessbusinessinformation.googleapis.com/v1/accounts/1/locations');
+ expect(request(1).queryParams).toEqual({ pageSize: '100', read_mask: 'title,name', pageToken: 'page-2' });
+ });
+
+ it('turns a failed request into a short placeholder', async () => {
+ fail({ status: 500, body: {} });
+
+ expect(
+ await loadOptions({ prop: googleBusinessCommon.location, propsValue: { ...CONNECTED, account: 'accounts/1' } }),
+ ).toEqual({
+ disabled: true,
+ options: [],
+ placeholder: 'Could not load locations',
+ });
+ });
+});
+
+function ok({ body }: { body: unknown }) {
+ sendRequest.mockResolvedValueOnce({ status: 200, headers: {}, body });
+}
+
+function fail({ status, body }: { status: number; body: unknown }) {
+ sendRequest.mockRejectedValueOnce(new HttpError({}, { status, responseBody: body }));
+}
+
+function request(index: number) {
+ return sendRequest.mock.calls[index][0];
+}
+
+function loadOptions({ prop, propsValue }: { prop: { options: unknown }; propsValue: Record<string, unknown> }): Promise<unknown> {
+ const options = prop.options;
+ if (typeof options !== 'function') {
+ throw new Error('dropdown has no options function');
+ }
+ return Promise.resolve(Reflect.apply(options, prop, [propsValue, {}]));
+}
+
+const CONNECTED = { auth: { access_token: 'test-token' } };
diff --git a/packages/pieces/community/google-my-business/vitest.config.ts b/packages/pieces/community/google-my-business/vitest.config.ts
new file mode 100644
index 00000000000..79c97261904
--- /dev/null
+++ b/packages/pieces/community/google-my-business/vitest.config.ts
@@ -0,0 +1,19 @@
+import path from 'path'
+import { defineConfig } from 'vitest/config'
+
+const repoRoot = path.resolve(__dirname, '../../../..')
+
+export default defineConfig({
+ root: __dirname,
+ test: {
+ globals: true,
+ environment: 'node',
+ include: ['test/**/*.test.ts'],
+ },
+ resolve: {
+ alias: {
+ '@activepieces/pieces-framework': path.resolve(repoRoot, 'packages/pieces/framework/src/index.ts'),
+ '@activepieces/pieces-common': path.resolve(repoRoot, 'packages/pieces/common/src/index.ts'),
+ },
+ },
+})